query
stringlengths
7
6.41k
document
stringlengths
12
28.8k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
GET /property_between_floor_slaps GET /property_between_floor_slaps.json
def index @property_between_floor_slaps = PropertyBetweenFloorSlap.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_property_between_floor_slap\n @property_between_floor_slap = PropertyBetweenFloorSlap.find(params[:id])\n end", "def property_between_floor_slap_params\n params.require(:property_between_floor_slap).permit(:between_floor_slap_id, :property_id, :quality_id)\n end", "def create\n @prop...
[ "0.69060063", "0.61157036", "0.5888169", "0.5649257", "0.5491359", "0.5422482", "0.5376796", "0.5331189", "0.53073645", "0.52703154", "0.5230716", "0.52174205", "0.52156436", "0.52033854", "0.51998276", "0.5193905", "0.51654613", "0.51582396", "0.5149543", "0.510811", "0.5101...
0.78588855
0
POST /property_between_floor_slaps POST /property_between_floor_slaps.json
def create @property_between_floor_slap = PropertyBetweenFloorSlap.new(property_between_floor_slap_params) respond_to do |format| if @property_between_floor_slap.save format.html { redirect_to @property_between_floor_slap, notice: 'Property between floor slap was successfully created.' } format.json { render :show, status: :created, location: @property_between_floor_slap } else format.html { render :new } format.json { render json: @property_between_floor_slap.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @property_between_floor_slaps = PropertyBetweenFloorSlap.all\n end", "def set_property_between_floor_slap\n @property_between_floor_slap = PropertyBetweenFloorSlap.find(params[:id])\n end", "def property_between_floor_slap_params\n params.require(:property_between_floor_slap).permi...
[ "0.6934517", "0.68359023", "0.65886587", "0.55116165", "0.5449827", "0.5305369", "0.5082544", "0.50723386", "0.5067619", "0.50580436", "0.50201815", "0.50010294", "0.49929175", "0.49878052", "0.49708432", "0.4954112", "0.49523896", "0.49491084", "0.49345988", "0.49335435", "0...
0.6978419
0
PATCH/PUT /property_between_floor_slaps/1 PATCH/PUT /property_between_floor_slaps/1.json
def update respond_to do |format| if @property_between_floor_slap.update(property_between_floor_slap_params) format.html { redirect_to @property_between_floor_slap , notice: 'Property between floor slap was successfully updated.' } format.json { render :show, status: :ok, location: @property_between_floor_slap } else format.html { render :edit } format.json { render json: @property_between_floor_slap.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_property_between_floor_slap\n @property_between_floor_slap = PropertyBetweenFloorSlap.find(params[:id])\n end", "def update\n @floor = Floor.find(params[:id])\n params[:floor][:location_id] = params[:floor][:loc_id]\n params[:floor].delete :loc_id\n respond_to do |format|\n if @f...
[ "0.6611928", "0.64026827", "0.6253212", "0.6180711", "0.59178376", "0.58830047", "0.5867793", "0.581085", "0.5779907", "0.57641405", "0.5741139", "0.57381433", "0.56444305", "0.5617428", "0.5576063", "0.5557531", "0.5538262", "0.55241364", "0.551262", "0.5512446", "0.5505184"...
0.69383144
0
DELETE /property_between_floor_slaps/1 DELETE /property_between_floor_slaps/1.json
def destroy @property_between_floor_slap.destroy respond_to do |format| format.html { redirect_to property_between_floor_slaps_url, notice: 'Property between floor slap was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @floor_plan.destroy\n respond_to do |format|\n format.html { redirect_to location_path(@location) }\n format.json { head :no_content }\n end\n end", "def destroy\n @floor = Floor.find(params[:id])\n @floor.destroy\n\n respond_to do |format|\n format.html { redirect...
[ "0.6767104", "0.6629417", "0.65859383", "0.6548821", "0.65027034", "0.6496672", "0.6478902", "0.64782614", "0.6418464", "0.6389761", "0.63772845", "0.63682294", "0.63654083", "0.63643336", "0.6358095", "0.634887", "0.6343281", "0.6322753", "0.6319015", "0.63171756", "0.630803...
0.78118306
0
Unregisters the webhook with Jive
def unregister_webhook require "open-uri" require "net/http" require "openssl" return if self.add_on.nil? # Can't do it without a token! return if self.oauth_token.nil? # Can't do it without a token! uri = URI.parse("#{self.add_on.jive_url}/api/core/v3/webhooks/#{self.webhook_id}") http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true request = Net::HTTP::Delete.new(uri.request_uri) request["Content-Type"] = "application/json" request["Authorization"] = "Bearer #{self.oauth_token.access_token}" response = http.request(request) # Need 2XX status code if !response.code.to_i.between?(200, 299) errors[:base] << "#{request.inspect} => #{response.body}" return false end true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unsubscribe_request_hook(name)\n EasyPost::Hooks.unsubscribe(:request, name)\n end", "def delete_webhook(target_url)\n Uploadcare::Webhook.delete(target_url)\n end", "def unsubscribe_response_hook(name)\n EasyPost::Hooks.unsubscribe(:response, name)\n end", "def unregister...
[ "0.6840325", "0.6647022", "0.64943475", "0.64802325", "0.6425156", "0.6414358", "0.64120054", "0.64065605", "0.63679594", "0.6276741", "0.62552524", "0.62387514", "0.623862", "0.62308806", "0.61917335", "0.6186117", "0.6183866", "0.6099072", "0.60828346", "0.6080911", "0.6072...
0.7900918
0
Registers the webhook with Jive
def register_webhook require "open-uri" require "net/http" require "openssl" uri = URI.parse("#{self.add_on.jive_url}/api/core/v3/webhooks") http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true #http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Post.new(uri.request_uri) request["Content-Type"] = "application/json" request["Authorization"] = "Bearer #{self.oauth_token.access_token}" body = { "callback" => self.callback, "object" => self.object, } body["events"] = self.events if !self.events.to_s.empty? request.body = body.to_json response = http.request(request) # Need 2XX status code if !response.code.to_i.between?(200, 299) errors[:base] << "#{request.inspect} => #{response.body}" return false end json_body = JSON.parse(response.body) self.webhook_id = json_body["id"] true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_webhook(project_id_or_key, name, hook_url, params = {})\n params[:name] = name\n params[:hook_url] = hook_url\n post(\"projects/#{project_id_or_key}/webhooks\", params)\n end", "def webhook\n @config = ZipMoney::Configuration \n @_webhook = ZipMoney::WebHook if @_webhoo...
[ "0.6617718", "0.656444", "0.65150595", "0.64781016", "0.64551556", "0.6398318", "0.63663626", "0.63569754", "0.63287765", "0.63153994", "0.6296852", "0.6244124", "0.62091345", "0.61630535", "0.6134478", "0.61271334", "0.6125525", "0.6123998", "0.6104226", "0.6083307", "0.6076...
0.8315143
0
Refresh one feed source and return the updated feed items
def refresh FeedSource.find(params[:feed_source_id]).refresh feed_sources = params[:feed_sources] @feed_source_titles = {} FeedSource.find(feed_sources).each { |source| @feed_source_titles[source.id] = source.title} @feed_items = FeedItem.where("feed_source_id IN (?)", feed_sources).order(pub_date: :desc).limit(20).offset(0) @feed_items = @feed_items.sort_by{ |item| item.pub_date.to_i }.reverse render :index end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def refresh_feed(feed)\n FeedRefreshManager.refresh feed, self\n end", "def refresh\n Feed.update_all\n # @feeds = Feed.all\n # feed_array = []\n # @feeds.each do |f|\n # EntryFeed.create_from_feed(f)\n # end\n\n redirect_to blogs_path\n flash[:notice] = \"Blogs successfully updated...
[ "0.73419046", "0.6547046", "0.6506305", "0.6465421", "0.64161277", "0.6409836", "0.6389569", "0.6370014", "0.63508123", "0.63415533", "0.6319646", "0.6308639", "0.6308639", "0.6303377", "0.62841046", "0.62739736", "0.6230807", "0.6220272", "0.6220272", "0.6210587", "0.6197166...
0.82401633
0
Store page title options that are used on I18n interpolation.
def page_title_options @page_title_options ||= {} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def title=(t)\n @options[:title] = t\n end", "def page_title(options = {})\n return \"\" if @page.title.blank?\n\n options = {\n prefix: \"\",\n suffix: \"\",\n separator: \"\"\n }.update(options)\n title_parts = [options[:prefix]]\n title_parts << if respons...
[ "0.731271", "0.73069143", "0.7233398", "0.72106487", "0.716158", "0.7127059", "0.709165", "0.7079146", "0.7051273", "0.7026661", "0.69825894", "0.6956374", "0.68932176", "0.6877517", "0.68723416", "0.6852441", "0.68501896", "0.68482125", "0.6831096", "0.67903167", "0.6788046"...
0.84882396
0
Override in the subclass to provide a place to do initialization of game logic, load files, set up state, etc
def game_setup end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize()\n @tileset = Gosu::Image.load_tiles(\"media/tileset.png\", TILE_WIDTH, TILE_HEIGHT, tileable: true)\n\n # Load images here so they will only be loaded once per game\n @enemyAnimation = *Gosu::Image.load_tiles(\"media/enemy_char.png\", Enemy::WIDTH, Enemy::HEIGHT)\n @por...
[ "0.7197501", "0.6927094", "0.68548703", "0.68363637", "0.67903966", "0.6709493", "0.6681035", "0.66754824", "0.6657464", "0.6593433", "0.6593433", "0.6568565", "0.6536359", "0.6532853", "0.65298796", "0.6522084", "0.6518121", "0.6491702", "0.64911246", "0.64601445", "0.646014...
0.7465463
0
Called on an instance of the subclass, this will run the game_setup method and then begin the show loop on the delegate
def game_start game_setup @console_delegate.show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def game_setup\n end", "def start\n DataManager.create_game_objects\n $game_party.setup_starting_members\n $game_map.setup(Config::Starting_Map_ID)\n $game_player.moveto(Config::X_Pos, Config::Y_Pos)\n $game_player.followers.visible = false\n $game_player.refresh\n $game_player.make_encou...
[ "0.68360984", "0.6639908", "0.6451325", "0.62993324", "0.61970586", "0.6163759", "0.6157443", "0.6131971", "0.6095512", "0.6061154", "0.6006015", "0.60039425", "0.5999125", "0.5988099", "0.5987031", "0.59720844", "0.59613466", "0.59466904", "0.5942263", "0.59374255", "0.59353...
0.77794194
0
Gets the chat property value. The chat between the user and Teams app.
def chat return @chat end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def chat_info\n return @chat_info\n end", "def chat\n @_chat || payload && payload['chat']\n end", "def chat=(value)\n @chat = value\n end", "def chat\n @_chat ||=\n if payload\n if payload.is_a?(Hash)\n p...
[ "0.71748775", "0.7054701", "0.7045065", "0.7031462", "0.7023305", "0.7023305", "0.67733926", "0.6639497", "0.6575313", "0.6302959", "0.6302959", "0.6287643", "0.5960013", "0.5855995", "0.5847797", "0.58272797", "0.57949525", "0.57499456", "0.57348585", "0.57348585", "0.571157...
0.7338721
0
Sets the chat property value. The chat between the user and Teams app.
def chat=(value) @chat = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_chat\n @chat = Chat.get_one(params[:app_token], params[:number])\n end", "def set_chat\n @chat = @application.chats.find_by!(number: params[:id])\n end", "def set_chat\n @chat = Chat.find(params[:id])\n end", "def set_chat\n @chat = Chat.find(params[:id])\n end", "def se...
[ "0.75856173", "0.7266743", "0.7255754", "0.7255754", "0.7255754", "0.7255754", "0.7255754", "0.7255754", "0.7255754", "0.7255754", "0.7255754", "0.7255754", "0.7255754", "0.71931034", "0.7139131", "0.7139131", "0.7018493", "0.6961826", "0.67970365", "0.6774398", "0.66801286",...
0.8534229
0
Instantiates a new userScopeTeamsAppInstallation and sets the default values.
def initialize() super @odata_type = "#microsoft.graph.userScopeTeamsAppInstallation" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def installed_apps()\n return MicrosoftGraph::Me::JoinedTeams::Item::InstalledApps::InstalledAppsRequestBuilder.new(@path_parameters, @request_adapter)\n end", "def initialize\n @initted = false\n @h_steam_user = @@dll_SteamAPI_GetHSteamUser.call\n return if (@s...
[ "0.54527813", "0.52849585", "0.5226986", "0.51630723", "0.51314735", "0.5057966", "0.50249255", "0.5002965", "0.50024647", "0.49959233", "0.4945063", "0.4878081", "0.48780555", "0.48567334", "0.48553476", "0.48341924", "0.48106268", "0.48098832", "0.47992164", "0.479649", "0....
0.74524724
0
GPS version Returns an array of projects that are similar if project exists
def project_exists if self.check_project_exists == true return (Project.select{ |proj| proj.project_type == self.project_type } && Project.select{ |proj| proj.street1.to_f.between?((self.street1.to_f - 0.02), (self.street1.to_f + 0.02))} && Project.select{ |proj| proj.street2.to_f.between?((self.street2.to_f - 0.02), (self.street2.to_f + 0.02 ))}) else return [] end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def known_omnibus_projects\n # iterate through min/max versions for all product names\n # and collect the name for both versions\n projects = %w{ 0.0.0 1000.1000.1000 }.collect do |v|\n @version = v\n omnibus_project\n end\n # remove duplicates and return multip...
[ "0.6690948", "0.6394917", "0.5990774", "0.5943927", "0.5851132", "0.5848677", "0.5834253", "0.5830118", "0.57999", "0.5787687", "0.5622428", "0.56071115", "0.56039155", "0.5595532", "0.55241996", "0.5422615", "0.5381047", "0.53718483", "0.53706586", "0.5354612", "0.5352882", ...
0.64128435
1
GPS version check for projects that have similar streets reversing street order as necessary.
def check_project_exists # if latitude is within +/- 2 ten-thounsandths of another project's latitude it is the same (Project.select{ |proj| proj.project_type == self.project_type }.count > 0 && Project.select{ |proj| proj.street1.to_f.between?((self.street1.to_f - 0.002), (self.street1.to_f + 0.002))}.count > 0 && Project.select{ |proj| proj.street2.to_f.between?((self.street2.to_f - 0.02), (self.street2.to_f + 0.02))}.count > 0) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compare_build_vers(loc_ver,rem_ver)\n if loc_ver.to_s.match(/No/)\n result = 0\n else\n if rem_ver.to_s.match(/-/) and !rem_ver.to_s.match(/beta/)\n if $verbose == 1\n puts \"Local build date: \"+loc_ver.to_s\n puts \"Remote build date: \"+rem_ver.to_s\n end\n if rem_ver.t...
[ "0.56617856", "0.5622213", "0.53688985", "0.52612925", "0.52385014", "0.5199634", "0.5196009", "0.5139134", "0.5099616", "0.5096459", "0.50687355", "0.500505", "0.4997049", "0.49902913", "0.4971103", "0.4854134", "0.48421282", "0.48408216", "0.48359808", "0.48330972", "0.4823...
0.65193725
0
Details: Finish the solution so that it sorts the passed in array of numbers. If the function passes in an empty array or null/nil value then it should return an empty array. For example: solution([1, 2, 10, 50, 5]) should return [1,2,5,10,50] solution(nil) should return []
def solution(nums) nums.to_a.sort end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_array(nums)\n nums.nil? ? [] : nums.sort\nend", "def my_sort(nums, sorted=[])\n\t# get min\n\t# Remove min from nums\n\t# recursion until nums.size == 0 with new nums and new sorted\n\t# Return sorted\n\n\tmin = nums.min\n\tsorted << min\n\n\tnums.delete_if {|n| n == min}\n\n\tif nums.size > 0\n\t\tmy_...
[ "0.79653484", "0.66269785", "0.6622227", "0.6622227", "0.6503862", "0.64985967", "0.64985967", "0.64849895", "0.64233613", "0.64233613", "0.63996476", "0.6398528", "0.6390439", "0.6390439", "0.6390439", "0.6373231", "0.6340254", "0.6340031", "0.63360506", "0.6335004", "0.6313...
0.7088003
1
GET /regionextras GET /regionextras.json
def index @regionextras = Regionextra.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_region\n respond_to do |format|\n format.json{ render :json => { :region => Region.all } }\n end\n end", "def region\n @regions = @company.companyregions\n respond_with @regions\n end", "def regions\n client.get_stats('/stats/regions')\n end", "def show\n render json: @regio...
[ "0.71900696", "0.67239195", "0.66143936", "0.6611175", "0.64833874", "0.64386183", "0.6378065", "0.6367327", "0.63036364", "0.6268304", "0.6228991", "0.6211672", "0.6211672", "0.62070656", "0.6194856", "0.61833453", "0.61815906", "0.6171834", "0.61537635", "0.6150054", "0.614...
0.72709906
0
POST /regionextras POST /regionextras.json
def create @regionextra = Regionextra.new(regionextra_params) respond_to do |format| if @regionextra.save format.html { redirect_to @regionextra, notice: 'Regionextra was successfully created.' } format.json { render :show, status: :created, location: @regionextra } else format.html { render :new } format.json { render json: @regionextra.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def regionextra_params\n params.require(:regionextra).permit(:RegionID, :Name, :value)\n end", "def set_regionextra\n @regionextra = Regionextra.find(params[:id])\n end", "def create\n @region = Region.new(region_params)\n\n if @region.save\n render json: @region, status: :created, l...
[ "0.6437806", "0.6351956", "0.6259945", "0.61845803", "0.60703605", "0.60580385", "0.60164356", "0.5906255", "0.58810335", "0.5846377", "0.5806539", "0.5758439", "0.5758439", "0.57405806", "0.5724111", "0.571648", "0.56633353", "0.5647524", "0.5631641", "0.5614036", "0.5608624...
0.67595834
0
PATCH/PUT /regionextras/1 PATCH/PUT /regionextras/1.json
def update respond_to do |format| if @regionextra.update(regionextra_params) format.html { redirect_to @regionextra, notice: 'Regionextra was successfully updated.' } format.json { render :show, status: :ok, location: @regionextra } else format.html { render :edit } format.json { render json: @regionextra.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @region = Region.find(params[:id])\n\n if @region.update(region_params)\n head :no_content\n else\n render json: @region.errors, status: :unprocessable_entity\n end\n end", "def update_region\n Region.find(params[:record][:id]).update_attributes(params[:record])\n render...
[ "0.6586227", "0.6577751", "0.64481485", "0.6431758", "0.6291979", "0.628427", "0.623349", "0.623349", "0.61646736", "0.6111565", "0.60827404", "0.6052583", "0.603586", "0.6031507", "0.5999401", "0.5952492", "0.5939089", "0.5910816", "0.5901486", "0.58903587", "0.585253", "0...
0.6898627
0
DELETE /regionextras/1 DELETE /regionextras/1.json
def destroy @regionextra.destroy respond_to do |format| format.html { redirect_to regionextras_url, notice: 'Regionextra was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_region\n Region.find(params[:id]).destroy\n render :json => {}\n end", "def destroy\n @region.destroy\n\n head :no_content\n end", "def destroy\n @region = Region.find(params[:id])\n @region.destroy\n\n respond_to do |format|\n format.html { redirect_to regions_url }\n ...
[ "0.74677545", "0.7150684", "0.7055704", "0.6934371", "0.6837629", "0.6837629", "0.6837629", "0.67998534", "0.6740191", "0.66453683", "0.662495", "0.6567241", "0.6561294", "0.65553993", "0.6547393", "0.654193", "0.65335745", "0.6477611", "0.6430961", "0.6404991", "0.63848144",...
0.7439709
1
=begin need function that takes and argument that argument will be an array reference value to check against if the next number is bigger than reference value it becomes the reference value at the end of iterating over each item the reference value the largest number =end
def max_value(our_array) reference = -100000 our_array.each do |number| if number > reference reference = number end end reference end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_max_number(any_array)\n\treference = any_array[1]\n\tany_array.each do |number|\n\t\tif number > reference\n\t\treference = number\n\t\tend\n\tend \n\treference\nend", "def find_greatest(numbers)\n saved_number = numbers[0]\n\n numbers.each do |num|\n if saved_number >= num\n next\n else\n ...
[ "0.80275106", "0.76950336", "0.7690046", "0.76097184", "0.7540231", "0.7538304", "0.75273305", "0.7512896", "0.75111955", "0.7472626", "0.74536985", "0.74472046", "0.74168944", "0.74168944", "0.74168944", "0.74026215", "0.7386269", "0.73623466", "0.7346802", "0.73148793", "0....
0.7971969
1
Overwrites slug_exists? from Slug. We allow duplicate slugs on different published_at dates.
def slug_exists? Article.on(published_at).where(slug: slug).exists? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_slug_needed?\n !slug || slug_text != slug.name\n end", "def should_generate_new_friendly_id?\n slug.blank? || permalink_changed?\n end", "def auto_generate_slug\n return true unless self.slug.nil?\n return true if self.respond_to?(:published?) && !self.published?\n self.slu...
[ "0.7531849", "0.70434123", "0.7031356", "0.6907691", "0.69001466", "0.6841139", "0.66248775", "0.6604771", "0.66036475", "0.66036475", "0.66036475", "0.6590974", "0.6581869", "0.6568581", "0.6568581", "0.6549414", "0.65259534", "0.65133417", "0.6489964", "0.64785665", "0.6469...
0.8027041
1
START Feed Action Tests
def test_get_feed get :feed assert_response :success end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_mp3_feed_works\n get \"/podcast_feed/all/mp3/rss.xml\"\n assert last_response.ok?\n end", "def fetch_test_feed\n logger.info 'FeedManager: env is test, fetching test data'\n data = Feedzirra::Feed.parse File.open(Rails.root.join('test', 'test_feeds', 'valid_feed.xml'), 'r').read\n return...
[ "0.6573332", "0.6347964", "0.6263043", "0.624825", "0.61992455", "0.6184532", "0.61655474", "0.6161431", "0.6106196", "0.60878974", "0.6031313", "0.5993742", "0.59935594", "0.5933913", "0.5873512", "0.5824045", "0.5824045", "0.5824045", "0.5824045", "0.57848823", "0.5769436",...
0.6938861
0
Class method version of Gorilla::Unitnormalize, to handle, e.g., Enumerable, Numeric, and Range objects.
def normalize input, &block case input when Range normalize(input.min, &block)..normalize(input.max, &block) when Enumerable input.map { |unit| normalize unit, &block } when Numeric normalize Unit.new(input), &block else # Unit, etc. input.normalize(&block) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_to(unit)\n unit = Unit.get(unit) if unit.is_a?(Symbol)\n self.normalize + unit.denormalize\n end", "def normalize\n divide(magnitude)\n end", "def normalized; end", "def normalize\n self / self.norm\n end", "def normalize; end", "def normalize!\n\t\t\tmagnitude = self...
[ "0.6815934", "0.67310166", "0.67151874", "0.6477827", "0.64341897", "0.64118713", "0.6294422", "0.6287442", "0.6274068", "0.62591845", "0.6256661", "0.6229033", "0.62161964", "0.60913044", "0.60724473", "0.60711014", "0.606446", "0.60351926", "0.60207754", "0.60141015", "0.60...
0.7427953
0
Returns whether a unit was defined as metric. ==== Example class Coolness true end Coolness.new(1, :megaFonzie).metric? => true
def metric? unit and self.class.rules[unit][:metric] || false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def metric?\n @metric\n end", "def metric_ton? = unit == 'metric-ton'", "def metrics?\n @metrics\n end", "def pixel_per_meter? = unit == 'pixel-per-meter'", "def metricModel? \n model = Sketchup.active_model\n\n # Get the length Units of the active model from the unitsOptions\n # 0=inche...
[ "0.8225088", "0.81232244", "0.73423445", "0.7090844", "0.6979925", "0.6822958", "0.6769892", "0.6758768", "0.6748588", "0.667046", "0.66321015", "0.66016424", "0.6527534", "0.6502581", "0.64179325", "0.63817996", "0.633297", "0.6319842", "0.6311718", "0.6305567", "0.62871915"...
0.89512295
0
Get exception status detail
def status_details(exception) StatusDetails.new(message: exception&.message, trace: exception&.backtrace&.join("\n")) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status\n return 404 if NOT_FOUND_ERRORS.include? @exception.class.to_s\n @exception.respond_to?(:http_status) ? @exception.http_status : 500\n end", "def get_http_status exception\n http_status = nil\n if defined?(ActionDispatch::ExceptionWrapper) &&\n ActionDispatc...
[ "0.7047844", "0.6799808", "0.676369", "0.6662642", "0.66613734", "0.6559857", "0.6522813", "0.65098566", "0.6508267", "0.64736664", "0.64581007", "0.6454799", "0.6428949", "0.64248025", "0.64009047", "0.63842976", "0.634557", "0.63399905", "0.6338014", "0.63068277", "0.629083...
0.81669265
0
Retrieve all CPEs and their associated variants. The 'live' field in the output indicates whether any advisory has been shipped for that CPE and variant. This API does not require authentication. :apiurl: /api/v1/security/cpes :apimethod: GET :apiresponseexample: file:publican_docs/Developer_Guide/api_examples/cpes.json
def cpes @variants = Variant.all.group_by{|variant| variant.cpe || ''}.sort_by{|cpe,v| cpe} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @cps = Cp.all\n end", "def index\n @capexes = Capex.all\n end", "def index\n @pcs = Pc.all\n end", "def vpcs\n @vpcs ||= init_vpcs\n end", "def get_variants\n return [] if is_pdc?\n get_variants_by_package.values.flatten.uniq\n end", "def cpe\n\t\t\t\t\twhere(:r...
[ "0.5546804", "0.54726803", "0.53062415", "0.5253674", "0.5248795", "0.52337486", "0.510101", "0.4996687", "0.4957536", "0.49566272", "0.49063808", "0.48832402", "0.48682535", "0.4859834", "0.48554453", "0.48535448", "0.48460883", "0.48076898", "0.47946066", "0.47735325", "0.4...
0.5975741
0
Creates a SUBSCRIBE frame. Sets `ack` header to 'auto' unless it is already set to 'client' or 'clientindividual'.
def subscribe_frame d, h h[:ack] = 'auto' unless ['client', 'client-individual'].include?(h[:ack]) create_frame 'SUBSCRIBE', [{:id => OnStomp.next_serial}, h, {:destination => d}] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_client_ack_with_symbol_11\n if @conn.protocol != Stomp::SPL_11\n assert true\n return\n end\n sid = @conn.uuid()\n queue = make_destination()\n @conn.subscribe queue, :ack => :client, :id => sid\n @conn.publish queue, \"test_stomp#test_client_ack_with_symbol_11\"\n msg = @co...
[ "0.55870736", "0.55790424", "0.54074484", "0.5380273", "0.53647137", "0.5324904", "0.5308", "0.5260508", "0.5181441", "0.49778032", "0.49193686", "0.49107003", "0.48726657", "0.481885", "0.47889104", "0.4776266", "0.4776266", "0.47730666", "0.47506678", "0.47465703", "0.47461...
0.6750201
0
Creates an ACK frame
def ack_frame *args create_ack_or_nack 'ACK', args end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ack(opts={})\n\t\t\t# Set delivery tag\n\t\t\tdelivery_tag = opts.delete(:delivery_tag)\n\t\t\tdelivery_tag ||= self.delivery_tag\n\t\t\traise Bunny::AcknowledgementError, \"No delivery tag received\" unless delivery_tag\n\t\t\t\n client.send_frame(\n Qrack::Protocol09::Basic::Ack.new({:delivery_ta...
[ "0.65102285", "0.6487016", "0.6350764", "0.63146967", "0.62166655", "0.6072652", "0.6046227", "0.5995287", "0.58656776", "0.58335435", "0.5818466", "0.5782469", "0.5761721", "0.57331836", "0.5656255", "0.5650389", "0.56393814", "0.5625183", "0.55410886", "0.54408187", "0.5410...
0.780006
0
Creates an NACK frame
def nack_frame *args create_ack_or_nack 'NACK', args end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ack_frame *args\n create_ack_or_nack 'ACK', args\n end", "def gen_packet type, payload\n length = payload.size\n number = Thread.current[:number]\n Thread.current[:number] = number + 1\n \"@ABCD\" + [type,length,number].pack('CS>I>').force_encoding(ENCODING) + payload\nend", "def nacknowledge_frame...
[ "0.6508923", "0.5741221", "0.5615624", "0.561104", "0.5471409", "0.5460339", "0.5451302", "0.52467227", "0.520806", "0.51764727", "0.5139951", "0.5100133", "0.50859934", "0.5026159", "0.50260675", "0.5025573", "0.5017612", "0.5017612", "0.5017612", "0.5017612", "0.501504", ...
0.7034159
0
Creates a heartbeat frame (serialized as a single "\n" character)
def heartbeat_frame OnStomp::Components::Frame.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_heartbeat(sequence)\n send_packet(Opcodes::HEARTBEAT, sequence)\n end", "def save_heartbeat\n timestamp = Time.now.to_i\n store.zadd(\"hb:#{@client.uid}\", timestamp, [Time.now.to_s(:db), @payload].to_json)\n end", "def handle_heartbeat(_payload)\n send_packet(OPCODES[:HEARTBEAT]...
[ "0.599535", "0.5900252", "0.57715", "0.56977063", "0.5687411", "0.5641977", "0.5555416", "0.554638", "0.54458064", "0.54110134", "0.54101676", "0.5333949", "0.5303429", "0.52913487", "0.5267683", "0.5169766", "0.51461494", "0.5113312", "0.5075621", "0.50172395", "0.50087696",...
0.65995765
0
tyear, tmonth, tweek assigned where setting spent_on attributes these attributes make time aggregations easier
def spent_on=(date) super self.tyear = spent_on ? spent_on.year : nil self.tmonth = spent_on ? spent_on.month : nil self.tweek = spent_on ? spent_on.cweek : nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spent_on=(date)\n super\n self.tyear = spent_on ? spent_on.year : nil\n self.tmonth = spent_on ? spent_on.month : nil\n self.tweek = spent_on ? Date.civil(spent_on.year, spent_on.month, spent_on.day).cweek : nil\n self.spent_from = date\n self.spent_to = self.spent_from.advance(:hours=>hours)...
[ "0.6525233", "0.6523704", "0.6403977", "0.6160838", "0.5894229", "0.5734933", "0.5646814", "0.56262475", "0.5550448", "0.552101", "0.54953843", "0.5461707", "0.54507524", "0.5431598", "0.5400899", "0.5361746", "0.53082275", "0.5303204", "0.53031826", "0.5294604", "0.52906287"...
0.66099507
0
GET /stay_times GET /stay_times.json
def index @stay_times = StayTime.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @service_times = ServiceTime.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @service_times }\n end\n end", "def index\n @tea_times = TeaTime.all\n respond_to do |format|\n format.html { render layout: !request.xhr? }\n fo...
[ "0.66211087", "0.63165516", "0.6313331", "0.6311019", "0.62858325", "0.6283367", "0.62432575", "0.6238713", "0.62150556", "0.6213193", "0.6212546", "0.6203579", "0.62031066", "0.616202", "0.61575663", "0.6142375", "0.61341816", "0.612905", "0.6113712", "0.6113712", "0.6102728...
0.75969326
0
POST /stay_times POST /stay_times.json
def create @stay_time = StayTime.new(stay_time_params) respond_to do |format| if @stay_time.save format.html { redirect_to @stay_time, notice: 'Stay time was successfully created.' } format.json { render :show, status: :created, location: @stay_time } else format.html { render :new } format.json { render json: @stay_time.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stay_time_params\n params.require(:stay_time).permit(:arrive_date, :leave_date, :nationality, :country_stay, :day_stay)\n end", "def index\n @stay_times = StayTime.all\n end", "def create\n @timing = Timing.new(params[:timing].slice(:start, :stop, :days, :parent_class, :parent_id, :active))\...
[ "0.6601063", "0.6519595", "0.62858284", "0.6268728", "0.6266317", "0.62011385", "0.617307", "0.6168958", "0.6111555", "0.60858476", "0.60694796", "0.6050281", "0.6019576", "0.60107577", "0.5925939", "0.5908032", "0.5900547", "0.58972186", "0.5892104", "0.5891286", "0.5875553"...
0.7005587
0
PATCH/PUT /stay_times/1 PATCH/PUT /stay_times/1.json
def update respond_to do |format| if @stay_time.update(stay_time_params) format.html { redirect_to @stay_time, notice: 'Stay time was successfully updated.' } format.json { render :show, status: :ok, location: @stay_time } else format.html { render :edit } format.json { render json: @stay_time.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @patient = Patient.find(params[:patient_id])\n @schedule = @patient.schedules.find(params[:id])\n @pill_times = @schedule.pill_times\n\n # TODO can improve it to use nested attributes\n if params[:pill_time]\n params[:pill_time].each_with_index do |pill_time, idx|\n if @pill...
[ "0.6653054", "0.66524994", "0.6601323", "0.6582362", "0.6573549", "0.65660256", "0.6546499", "0.6529287", "0.6527774", "0.6489228", "0.6447293", "0.64378303", "0.6422342", "0.641576", "0.6414202", "0.6411619", "0.6408857", "0.6397323", "0.639375", "0.6386395", "0.6381744", ...
0.7227714
0
DELETE /stay_times/1 DELETE /stay_times/1.json
def destroy @stay_time.destroy respond_to do |format| format.html { redirect_to stay_times_url, notice: 'Stay time was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @time_gap = TimeGap.find(params[:id])\n @time_gap.destroy\n\n respond_to do |format|\n format.html { redirect_to time_gaps_url }\n format.json { head :ok }\n end\n end", "def destroy\n @meal_time = MealTime.find(params[:id])\n @meal_time.destroy\n\n respond_to do |fo...
[ "0.7226604", "0.69612134", "0.6939054", "0.6817791", "0.681168", "0.6803863", "0.67897755", "0.6786757", "0.6783543", "0.6771888", "0.6769168", "0.6741878", "0.67337954", "0.6730354", "0.66895", "0.6688952", "0.6681023", "0.66767806", "0.66705346", "0.6667793", "0.66658086", ...
0.74384403
0
Returns a list of open hours grouped by same days
def grouped_open_hours open_hours = [] start_day = nil end_day = nil current_period = nil standard_hours.sort.each_with_index do |o, i| if not o.open? period = "Stengt" else period = I18n.l(o.open_time, format: :time) + " - " + I18n.l(o.close_time, format: :time) end # Track day if start_day == nil start_day = o.day current_period = period end # Previous group ended, add it if period != current_period day = I18n.t("days.#{start_day}") if end_day != nil day += " - " + I18n.t("days.#{end_day}") end # Hverdager custom string if start_day == "monday" and end_day == "friday" day = "Hverdager" end open_hours.append([day, current_period]) current_period = period start_day = o.day end_day = nil end # Update period end if start_day != o.day end_day = o.day end # Last day closes period if i >= standard_hours.count - 1 day = I18n.t("days.#{start_day}") if end_day != nil day += " - " + I18n.t("days.#{o.day}") end open_hours.append([day, current_period]) end end open_hours end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grouped_office_hours\n merged_hours.map { |hash_list|\n days = if hash_list.length == 1\n hash_list.first[:day]\n elsif hash_list.length > 1\n \"#{hash_list.first[:day]} - #{hash_list.last[:day]}\"\n end\n {:hours => hash_list.first[:hours],\n :day => days }\n }....
[ "0.70517796", "0.69048524", "0.6768556", "0.6492265", "0.64917797", "0.63770425", "0.63338524", "0.6316042", "0.6208983", "0.61528325", "0.61422634", "0.6134684", "0.6125631", "0.60609424", "0.60586065", "0.60343283", "0.601223", "0.59675455", "0.5867969", "0.581537", "0.5812...
0.8231436
0
GET /graphium/cities GET /graphium/cities.json
def index @graphium_cities = Graphium::City.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n neo = Neography::Rest.new\n r = neo.execute_query(\"START n=node(*) RETURN n;\")\n r[\"data\"].shift # first node is wacky\n @cities = r[\"data\"].map { |node|\n OpenStruct.new(node[0][\"data\"].merge(id: node[0][\"self\"].match(/node\\/(\\d+)$/)[1].to_i))\n }\n end", "def cities...
[ "0.7350134", "0.7333397", "0.7067631", "0.7065568", "0.68672746", "0.68098557", "0.67984647", "0.6751429", "0.6747969", "0.6618983", "0.6499412", "0.6432094", "0.6423962", "0.6411681", "0.6357759", "0.634278", "0.62999105", "0.6293347", "0.6292854", "0.626926", "0.62361985", ...
0.7864492
0
POST /graphium/cities POST /graphium/cities.json
def create @graphium_city = Graphium::City.new(graphium_city_params) respond_to do |format| if @graphium_city.save format.html { redirect_to @graphium_city, notice: 'City was successfully created.' } format.json { render :show, status: :created, location: @graphium_city } else format.html { render :new } format.json { render json: @graphium_city.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n neo = Neography::Rest.new\n city = neo.create_node(params[:city])\n redirect_to cities_path\n end", "def graphium_city_params\n params.require(:graphium_city).permit(:name, :state, :state_code, :country, :country_code, :population, :osm_node_id)\n end", "def index\n @graphium_...
[ "0.72843736", "0.6981593", "0.66361165", "0.635568", "0.63230383", "0.6254943", "0.60747796", "0.60582554", "0.6043469", "0.599677", "0.5981062", "0.5971438", "0.5939756", "0.59395474", "0.5933267", "0.59171426", "0.5915548", "0.5906117", "0.5881162", "0.5881162", "0.5881162"...
0.7155015
1
PATCH/PUT /graphium/cities/1 PATCH/PUT /graphium/cities/1.json
def update respond_to do |format| if @graphium_city.update(graphium_city_params) format.html { redirect_to @graphium_city, notice: 'City was successfully updated.' } format.json { render :show, status: :ok, location: @graphium_city } else format.html { render :edit } format.json { render json: @graphium_city.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def update\n if @city.update(city_params)\n render json: @city\n # 'city was successfully updated.'\n else\n render json: @city.errors, status: :unprocessable_entity\n end\n end", "def ...
[ "0.6442021", "0.61399406", "0.60396487", "0.6007295", "0.59603", "0.5939284", "0.59242314", "0.5900325", "0.5857155", "0.5848182", "0.58433634", "0.5836922", "0.58034754", "0.57885444", "0.578303", "0.57777816", "0.57711077", "0.5769961", "0.57688624", "0.57521904", "0.573857...
0.651353
0
DELETE /graphium/cities/1 DELETE /graphium/cities/1.json
def destroy @graphium_city.destroy respond_to do |format| format.html { redirect_to graphium_cities_url, notice: 'City was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def delete\n client.delete(\"/#{id}\")\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def destroy\n @city.destroy\n respond_to do |format|\n format.html {...
[ "0.6828938", "0.67404467", "0.6609387", "0.65831393", "0.6540373", "0.6499345", "0.6491838", "0.6472032", "0.6430665", "0.642744", "0.641377", "0.6393286", "0.6391623", "0.6378624", "0.63537174", "0.6353204", "0.6331599", "0.63308287", "0.6330156", "0.6270522", "0.62668324", ...
0.73883075
0
Link to kata: Description: Fix the function I created this function to add five to any number that was passed in to it and return the new value. It doesn't throw any errors but it returns the wrong number. Can you help me fix the function? Answer:
def addFive(num) num + 5 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_five num\n num + 5\nend", "def add_ten(number)\n number += 10\nend", "def sum_3_5(number) \r\n\tsum3 = 0\r\n\tsum5 = 0\r\n\tsum15 = 0\r\n\t0.step(number-1,3) do |num|\r\n\t\tsum3 += num\r\n\tend\r\n\t0.step(number-1,5) do |num|\r\n\t\tsum5 += num\r\n\tend\r\n\t0.step(number-1,15) do |num|\r\n\t\tsum1...
[ "0.76271623", "0.70259476", "0.70219594", "0.6982283", "0.69683284", "0.6938488", "0.6938488", "0.6938488", "0.6938488", "0.6938488", "0.6938488", "0.6938488", "0.6938488", "0.6938488", "0.6938488", "0.6888496", "0.68528074", "0.68372726", "0.68290305", "0.6823146", "0.681391...
0.76390034
0
GET /productors GET /productors.json
def index @productors = Productor.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n if is_my_resource(params[:prossumer_id])\n @products = Product.where(prossumer_id: params[:prossumer_id]).as_json({\n cycle_id: params[:cycle_id],\n ...
[ "0.6741463", "0.67171097", "0.671549", "0.6692232", "0.6658295", "0.6645084", "0.6617059", "0.65588254", "0.65062225", "0.63921005", "0.6380967", "0.63795066", "0.63716406", "0.6369781", "0.63629127", "0.63590723", "0.6352903", "0.6352829", "0.63419574", "0.6332381", "0.63308...
0.724601
0
POST /productors POST /productors.json
def create @productor = Productor.new(productor_params) respond_to do |format| if @productor.save format.html { redirect_to @productor, notice: 'Productor was successfully created.' } format.json { render :show, status: :created, location: @productor } else format.html { render :new } format.json { render json: @productor.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @product = Product.new(product_args)\n\n if @product.save\n render json: Product.all, status: :created\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", "def create\n if params[:products]\n params[:products].each do |product|\n @...
[ "0.6713027", "0.6615665", "0.65932584", "0.65732664", "0.6542138", "0.6514128", "0.6510743", "0.6489597", "0.64563674", "0.6453787", "0.64093566", "0.6408194", "0.637801", "0.63757545", "0.63692707", "0.6295044", "0.62853426", "0.6271232", "0.6265685", "0.62552404", "0.624977...
0.69069326
0
Returns Allows us to get individual returns from the API
def returns(periodKey) self.class.get(url("returns", periodKey), headers: @headers ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def returns\n parsed {\n @returns\n }\n end", "def find_returns\n\t\tbus = Bus.find(params[:bus_id])\n\t\t@return_buses = bus.find_returns(params[:dep_id] == '0' ? true : false).select{|rb| (!rb.maximum_seats || rb.available_tickets(params[:dep_id] == '0' ? 'to_waterloo' : 'from_waterloo') > ...
[ "0.69270486", "0.65126646", "0.6433455", "0.6315461", "0.6242207", "0.6183215", "0.61437607", "0.60923105", "0.6080625", "0.6005776", "0.5913505", "0.5892927", "0.58929265", "0.58929265", "0.58929265", "0.58929265", "0.58929265", "0.58929265", "0.58929265", "0.58929265", "0.5...
0.7180429
0
this determines the reading order from the stub_object_type (default ltr unless the object type contains one of the possible "rtl" designations)
def book_reading_order return 'right-to-left' if stub_object_type.include?('rtl') || stub_object_type.include?('r-l') 'left-to-right' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def line_order = locale_info(:layout, :orientation, :line_order)", "def text_direction\n I18n.translate(:'bidi.direction') == 'right-to-left' ? 'rtl' : 'ltr'\n # in ../locale/he.yml add\n # he:\n #bidi:\n #direction: right-to-left\n # then in ../locale/root.yml add\n # root:\n ...
[ "0.526763", "0.52128154", "0.52128154", "0.51135576", "0.50958973", "0.5048924", "0.49184984", "0.4907119", "0.48280075", "0.47610536", "0.47595844", "0.4753641", "0.47307527", "0.4727238", "0.4699162", "0.46970668", "0.46337548", "0.4633393", "0.46326482", "0.46310407", "0.4...
0.7757093
0
GET /investments GET /investments.json
def index @investments = Investment.all respond_to do |format| format.html format.json end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @investments = Investment.all\n\n render json: {investments: @investments}, root: false\n end", "def show\n render json: @investment, root: false\n end", "def index\n @investables = Investable.all\n end", "def index\n @investigations = Investigation.where(:visible => true)\n\n ...
[ "0.7938945", "0.7190257", "0.71611875", "0.6985033", "0.69051164", "0.6877576", "0.68006974", "0.67372435", "0.66845745", "0.6632461", "0.6598962", "0.6554188", "0.6550055", "0.6512522", "0.6326754", "0.6315476", "0.6315378", "0.6278007", "0.62501585", "0.62358487", "0.623186...
0.8015847
0
Record has a fixed barcode length
def shift_barcode_length return unless record.barcode_length shift_fixed_length(record.barcode_length) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def length\n barcode.two_dimensional? ? encoding.first.length : encoding.length\n end", "def length\n barcode.two_dimensional? ? encoding.first.length : encoding.length\n end", "def barcode\n str_order = order.id.to_s.rjust(5, '0')\n str_cardinality = 1.to_s.rjust(3, '0')\n str_order +...
[ "0.6568643", "0.6568643", "0.6193347", "0.6172301", "0.60400975", "0.60082644", "0.598168", "0.5893825", "0.5878259", "0.57244277", "0.5696949", "0.56375873", "0.56272346", "0.56210715", "0.5613167", "0.55780613", "0.5565064", "0.55514145", "0.55440646", "0.5540473", "0.55172...
0.7220451
0
Determines the public IP address of the running AWS instance
def determine_public_ip # 169.254.169.254 is the address of the AWS instance metadata service # See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html `curl --silent -XGET http://169.254.169.254/latest/meta-data/public-ipv4` end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_aws_ip(n)\n if node['analytics-cluster']['aws']['use_private_ip_for_ssh']\n n['ec2']['local_ipv4']\n else\n n['ec2']['public_ipv4']\n end\n end", "def get_aws_ip(n)\n if node['delivery-cluster']['aws']['use_private_ip_for_ssh']\n n['ec2']['local_ipv4']\n e...
[ "0.8188898", "0.80910486", "0.80247253", "0.80016977", "0.79642713", "0.7935058", "0.77813494", "0.77796614", "0.7759515", "0.7752921", "0.77118146", "0.7660461", "0.7611136", "0.7594755", "0.7531203", "0.7402093", "0.7347458", "0.72919375", "0.7099349", "0.70677626", "0.7060...
0.9010124
0
Add host in the specified groups. ==== Attributes +host+ Hostname +groups+ Groups to assign ==== Examples add_groups('pa2web01', ['local', 'web']) add_groups('pa2sql01', ['local', 'mysql', 'heartbeat'])
def add_groups(host, groups=[]) for group in groups if !GROUPS.key?(group) then GROUPS[group] = [] end GROUPS[group].push(host) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_new_groups(params = {})\n post(\"/groups\", params)\n end", "def hostgroup_add_member(hostnames: nil, params: {})\n raise ArgumentError, 'Hostnames is required' unless hostnames\n\n params[:all] = true\n\n params[:host] = hostnames if hostnames.kind_of?(Array)\n params[:ho...
[ "0.68681824", "0.6770978", "0.6735424", "0.6659156", "0.6440352", "0.64264405", "0.63937706", "0.63391197", "0.629191", "0.62590903", "0.6233617", "0.6229149", "0.6226344", "0.6211744", "0.62107027", "0.6054811", "0.60118145", "0.59988844", "0.5995727", "0.59905773", "0.59826...
0.7607118
0
Add disk to the virtual machine ==== Attributes +server+ Server object +size+ Disk size in bytes ==== Examples add_disk(server, 5) Add a 5GB disk add_disk(server, 10) Add a 10GB disk
def add_disk(server, size) host = server.to_s # Increment disk id if !DISKS.key?(host) then DISKS[host] = 0 else DISKS[host] += 1 end disk_id = DISKS[host] disk_filename = ".vagrant/disks/" + host + "_" + disk_id.to_s + ".vdi" server.vm.provider "virtualbox" do |v| # Create disk if it not exist unless File.exist?(disk) v.customize ["createhd", "--filename", disk_filename, "--size", size * 1024 * 1024] end v.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', disk_id, '--device', 0, '--type', 'hdd', '--medium', disk] end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_hdd_to_vbox_vm(client_name,vbox_disk_name)\n message = \"Attaching:\\tStorage to VM \"+client_name\n command = \"VBoxManage storageattach \\\"#{client_name}\\\" --storagectl \\\"#{$vbox_disk_type}\\\" --port 0 --device 0 --type hdd --medium \\\"#{vbox_disk_name}\\\"\"\n execute_command(message,command)\...
[ "0.7076035", "0.693785", "0.68272406", "0.67360306", "0.6712447", "0.6695081", "0.65584517", "0.6548588", "0.6505648", "0.64939356", "0.6481664", "0.63985795", "0.6391803", "0.6383347", "0.6370955", "0.63696635", "0.6250282", "0.62104225", "0.6199367", "0.6185591", "0.6156167...
0.8375884
0
GET /membership_contributions GET /membership_contributions.json
def index @membership_contributions = MembershipContribution.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n user = User.find_by(id: params[:user_id])\n return respond_with contributions: [], status: :not_found if user.nil?\n contributions = user.contributions\n respond_with contributions: contributions, status: :ok\n end", "def get_contributions(repository)\n Git.contributions GithubAPI.n...
[ "0.73480463", "0.68995786", "0.68482727", "0.6628131", "0.6467863", "0.6412968", "0.62731004", "0.61800843", "0.60863173", "0.60760957", "0.60544586", "0.60061777", "0.59870064", "0.59585655", "0.59462893", "0.59455144", "0.5944579", "0.5922383", "0.5919908", "0.59150016", "0...
0.7566682
0
POST /membership_contributions POST /membership_contributions.json
def create # byebug @membership_contribution = MembershipContribution.new(membership_contribution_params) @membership = MembershipBalance.find_by(params[:membership_id]) respond_to do |format| if @membership_contribution.save @a = MembershipContribution.all.last # @balance = MembershipBalance.find(params) @amount1 = @membership.balance + @a.amount @b = MembershipBalance.where(membership_id: @a.membership_id).update_all(balance: @amount1) format.html { redirect_to @membership_contribution, notice: 'Membership contribution was successfully created.' } format.json { render :show, status: :created, location: @membership_contribution } else format.html { render :new } format.json { render json: @membership_contribution.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def membership_contribution_params\n params.require(:membership_contribution).permit(:membership_id, :date, :amount)\n end", "def index\n @membership_contributions = MembershipContribution.all\n end", "def set_membership_contribution\n @membership_contribution = MembershipContribution.find(par...
[ "0.7063032", "0.6562812", "0.64714324", "0.64046425", "0.631506", "0.629244", "0.6206663", "0.6166496", "0.61541796", "0.6131366", "0.610208", "0.6083469", "0.6061317", "0.6032376", "0.6020434", "0.598938", "0.59712744", "0.5959901", "0.5947049", "0.59300524", "0.5919236", ...
0.6768626
1
PATCH/PUT /membership_contributions/1 PATCH/PUT /membership_contributions/1.json
def update respond_to do |format| if @membership_contribution.update(membership_contribution_params) format.html { redirect_to @membership_contribution, notice: 'Membership contribution was successfully updated.' } format.json { render :show, status: :ok, location: @membership_contribution } else format.html { render :edit } format.json { render json: @membership_contribution.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_membership_contribution\n @membership_contribution = MembershipContribution.find(params[:id])\n end", "def update\n @contribution = Contribution.find(params[:id])\n\n respond_to do |format|\n if @contribution.update_attributes(params[:contribution])\n format.html { redirect_to @...
[ "0.6815647", "0.67277837", "0.6674991", "0.6674991", "0.66394836", "0.65078545", "0.6483071", "0.64645773", "0.646334", "0.6427524", "0.6405148", "0.6401074", "0.63899326", "0.63718337", "0.63718337", "0.63718337", "0.63718337", "0.63718337", "0.6368388", "0.6347717", "0.6339...
0.74537194
0
DELETE /membership_contributions/1 DELETE /membership_contributions/1.json
def destroy @membership_contribution.destroy respond_to do |format| format.html { redirect_to membership_contributions_url, notice: 'Membership contribution was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @contribution = Contribution.find(params[:id])\n @contribution.destroy\n\n respond_to do |format|\n format.html { redirect_to contributions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @contribution.destroy\n\n respond_to do |format|\n form...
[ "0.73390275", "0.72188705", "0.7212978", "0.7210668", "0.7210668", "0.7193398", "0.7193253", "0.71769303", "0.71652806", "0.71325195", "0.71325195", "0.7132139", "0.71162033", "0.70957476", "0.7081842", "0.70556927", "0.7054126", "0.70502704", "0.7048006", "0.6959316", "0.694...
0.79422396
0
Return booking request list where your user ID is equal to the client ID on the booking = Requests you've made on spaces.
def my_booking_requests my_booking_requests = CONNECTION.exec("SELECT id FROM bookings WHERE client_id='#{@user_id}'") return my_booking_requests end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_booking_of_client\n\t\t@bookings = Booking.where(client_id: params[:client_id])\n\t\trender json: @bookings, status: 200\n\tend", "def my_space_requests\n my_space_requests = CONNECTION.exec(\"SELECT id FROM bookings WHERE owner_id='#{@user_id}'\")\n return my_space_requests\n end", "def recieve...
[ "0.6396313", "0.63608074", "0.57924014", "0.56113684", "0.5597698", "0.55717677", "0.55717677", "0.55717677", "0.5549683", "0.5516849", "0.5508632", "0.55073", "0.54674083", "0.5437219", "0.54329133", "0.5396922", "0.5394028", "0.53838533", "0.53683054", "0.5334283", "0.53265...
0.6759875
0
GET /game_ratings GET /game_ratings.json
def index @game_ratings = GameRating.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ratings\n Birdman::Requester.get(\"movies/#{id}/ratings\")\n end", "def index\n @ratings = Rating.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ratings }\n end\n end", "def index\n @ratings = Rating.all\n\n respond_to do |format|\n...
[ "0.771419", "0.7032027", "0.7032027", "0.7032027", "0.7023711", "0.70226836", "0.69158506", "0.6869383", "0.6686899", "0.66244346", "0.66244346", "0.66244346", "0.662329", "0.66206205", "0.65967506", "0.658551", "0.65697235", "0.65697235", "0.65697235", "0.6553288", "0.654544...
0.7501716
1
POST /game_ratings POST /game_ratings.json
def create @game_rating = GameRating.new(game_rating_params) respond_to do |format| if @game_rating.save format.html { redirect_to @game_rating, notice: 'Game rating was successfully created.' } format.json { render :show, status: :created, location: @game_rating } else format.html { render :new } format.json { render json: @game_rating.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def game_rating_params\n params.require(:game_rating).permit(:game_id, :rating)\n end", "def rating_params\n params.require(:rating).permit(:score, :game_id)\n end", "def evaluate\n puts params[:rating].inspect.yellow\n params[:ratings].each do |tenant, report|\n participant = @game....
[ "0.7197672", "0.7022388", "0.6925746", "0.67633516", "0.6507356", "0.6348106", "0.63153785", "0.6305905", "0.6299254", "0.62990385", "0.6297955", "0.6293861", "0.6279696", "0.62654066", "0.6264876", "0.6251327", "0.62446856", "0.62214065", "0.62188613", "0.62092495", "0.61877...
0.7137196
1
PATCH/PUT /game_ratings/1 PATCH/PUT /game_ratings/1.json
def update respond_to do |format| if @game_rating.update(game_rating_params) format.html { redirect_to @game_rating, notice: 'Game rating was successfully updated.' } format.json { render :show, status: :ok, location: @game_rating } else format.html { render :edit } format.json { render json: @game_rating.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\r\n rating = Rating.where(rater_id: current_user.id, ratee_id: params[:id]).first\r\n\r\n if rating.update(score: params[:score], comment: params[:comment], rater_id: current_user.id, ratee_id: params[:ratee_id])\r\n render json: rating\r\n else\r\n render json: { error: rating.errors...
[ "0.70348614", "0.6950785", "0.6945379", "0.69256663", "0.6916264", "0.6839343", "0.67661744", "0.6760663", "0.6705841", "0.67040485", "0.66811776", "0.6667291", "0.66468287", "0.6590141", "0.6578216", "0.65491855", "0.65368575", "0.6528095", "0.65101016", "0.65097815", "0.650...
0.7391049
0
DELETE /game_ratings/1 DELETE /game_ratings/1.json
def destroy @game_rating.destroy respond_to do |format| format.html { redirect_to game_ratings_url, notice: 'Game rating was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @rating.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @rating = Rating.find(params[:id])\n @rating.destroy\n\n respond_to do |format|\n format.html { redirect_to ratings_url }\n format.json { head :ok }\n end\n ...
[ "0.7305474", "0.72226065", "0.7190627", "0.71213555", "0.70387083", "0.6971562", "0.68876237", "0.6873108", "0.6873108", "0.6868143", "0.6737254", "0.6698981", "0.6692994", "0.66805327", "0.6652504", "0.66397953", "0.6626312", "0.6609389", "0.66038406", "0.6589429", "0.658470...
0.74243283
0
GET /post316s/1 GET /post316s/1.xml
def show @post316 = Post316.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @post316 } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @post306 = Post306.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post306 }\n end\n end", "def show\n @post154 = Post154.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.x...
[ "0.65667033", "0.64826024", "0.6475384", "0.6451592", "0.6415183", "0.6383217", "0.6381178", "0.63731956", "0.63688684", "0.6352993", "0.63419676", "0.63406247", "0.6333633", "0.63286227", "0.6324045", "0.6321663", "0.63183653", "0.6312433", "0.6309652", "0.63031256", "0.6301...
0.6583203
0
GET /post316s/new GET /post316s/new.xml
def new @post316 = Post316.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @post316 } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @post306 = Post306.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post306 }\n end\n end", "def new\n @post227 = Post227.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post227 }\...
[ "0.7530846", "0.7428117", "0.7421778", "0.7418029", "0.74089366", "0.74083734", "0.7403376", "0.7396353", "0.7396012", "0.73938376", "0.7392765", "0.739177", "0.73851305", "0.73619413", "0.7353478", "0.73423994", "0.7336948", "0.7336151", "0.73351943", "0.7330803", "0.7321566...
0.7545023
0
POST /post316s POST /post316s.xml
def create @post316 = Post316.new(params[:post316]) respond_to do |format| if @post316.save format.html { redirect_to(@post316, :notice => 'Post316 was successfully created.') } format.xml { render :xml => @post316, :status => :created, :location => @post316 } else format.html { render :action => "new" } format.xml { render :xml => @post316.errors, :status => :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @post154 = Post154.new(params[:post154])\n\n respond_to do |format|\n if @post154.save\n format.html { redirect_to(@post154, :notice => 'Post154 was successfully created.') }\n format.xml { render :xml => @post154, :status => :created, :location => @post154 }\n else\n ...
[ "0.59064585", "0.5880296", "0.57913655", "0.578824", "0.5699257", "0.56484497", "0.5628692", "0.5627111", "0.5621102", "0.56096923", "0.5598626", "0.55933845", "0.5591631", "0.55877405", "0.55799884", "0.5578797", "0.55697846", "0.55695444", "0.5567126", "0.55658454", "0.5561...
0.63874596
0
Place Order POST /orders Recurring order start from the day you place them Assuming Resturant sent belongs to the user region only
def create order_params = (place_order_params) order_params[:customer_id] = current_user.customer_id @order = Order.new(order_params) if @order.recurring? if((Time.now + 1.hour).strftime('%H:%M:%S') <= (Time.parse(@order.place_date + ' ' + @order.timeslot.start)).strftime('%H:%M:%S') && !@order.completed? ) # Add the auto generated entry @order.category = 'single' @order.created_by = 'auto' @order.save! end # Improve this if Order.create!(order_params) render json: @order, status: 201 else render json: {'errors': ['Order can no be placed']}, status: :unprocessable_entity end else if (Time.now + 1.hour <= Time.parse(@order.place_date + ' ' + @order.timeslot.start)) && @order.save! render json: @order, status: 201 else render json: {'errorrs': ['Order can not be placed']}, status: :unprocessable_entity end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assign_order_date\n @booked_quotes = Quote.where(florist_id: session[\"found_florist_id\"]).where(status: \"Ordered\").where(wholesale_order_date: nil) + Quote.where(florist_id: session[\"found_florist_id\"]).where(status: \"Booked\").where(wholesale_order_date: nil)\n for booked_quote in @booked_quotes\...
[ "0.60226583", "0.60044086", "0.5978317", "0.5932185", "0.59172076", "0.58884907", "0.5885946", "0.5857208", "0.5855647", "0.58469707", "0.5816737", "0.57520276", "0.5719332", "0.5710581", "0.57015103", "0.5701419", "0.56888866", "0.56853765", "0.5673064", "0.56502813", "0.564...
0.71176016
0
Update order || Category can not be changed || Placed date || Time slot can not be changed |All ids are replaced| PATCH/PUT /orders/1 Assuming Resturant sent belongs to the user region only
def update if @order.single? if( (Time.now + 1.hour <= Time.parse(@order.place_date + ' ' + @order.timeslot.start)) && (!@order.completed? ) && @order.update(update_order_params) ) render json: @order, status: 200 else render json: {'errorrs': ['Order can not be updated']}, status: :unprocessable_entity end else if(@order.update(update_order_params)) render json: @order, status: 200 else render json: {'errorrs': ['Order can not be updated']}, status: :unprocessable_entity end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n if params[:order][:taxis][:taxi_id].blank?\n orders_taxi.destroy if orders_taxi = OrdersTaxi.where([\"order_id = ?\", @order.id]).first\n else\n unless OrdersTaxi.where([\"order_id = ? AND taxi_id = ?\", @order.id, params[:order][:taxis][:taxi_id]]).first\n unless @order.taxis.b...
[ "0.71665585", "0.6944809", "0.6906992", "0.6838878", "0.68093055", "0.6788424", "0.6773653", "0.6767925", "0.67581916", "0.6752395", "0.6752395", "0.67469424", "0.67360055", "0.6722087", "0.6717004", "0.6688588", "0.6687143", "0.6683587", "0.6683047", "0.66819257", "0.6661239...
0.77046275
0
get/order/customer_recurring_orders Gets All recurring order that are used to generate auto orders for a customer || Check status
def customer_recurring_orders # 1 represents @orders = Order.where(customer_id: current_user.customer_id, category: :recurring) render json: @orders, status: 200 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_orders(options)\n request :account, :get, 'allOrders', options\n end", "def list_customer_orders\n orders = current_user.restaurant.orders.where.not(\"status = ? OR status = ? OR status = ? OR status = ?\", 2, 7, 8, 9)\n\n if orders.where(status: 6).length > 0 || orders.where(status...
[ "0.6655822", "0.6456264", "0.62143826", "0.60961294", "0.60788256", "0.59696996", "0.595337", "0.5926247", "0.58955306", "0.5890947", "0.5888247", "0.5874496", "0.585628", "0.58253384", "0.5813705", "0.57688797", "0.57616186", "0.57507354", "0.5744033", "0.57139045", "0.56910...
0.7130487
0
get/order/customer_single_orders Get all single order regardless they are manual or auto for a customer
def customer_single_orders @orders = Order.where(customer_id: current_user.customer_id, category: :single) render json: @orders, status: 200 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @orders = Order.where(:customer_id => params[:customer_id])\n @order = @orders.first \n end", "def customer\n @orders = Spree::Order.where(user_id: current_spree_user.id, state: 'complete').where.not(shipment_state: 'shipped', state: 'returned').order(created_at: :desc)\n end", "def all...
[ "0.66842574", "0.6492773", "0.6374647", "0.63126725", "0.6172871", "0.615013", "0.61402535", "0.61110544", "0.6083359", "0.6062478", "0.6053173", "0.60333455", "0.6025719", "0.5997093", "0.59852153", "0.5981229", "0.59235555", "0.5920914", "0.5916245", "0.59034634", "0.588778...
0.73650944
0
get/order/driver_recurring_orders Gets recurring order that are used to generate auto orders for a driver
def driver_recurring_orders @orders = Timeslot.joins(:orders).where(orders: { category: :recurring}, timeslots: {region_id: current_user.driver.region_id}) render json: @orders, status: 200 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_recurring_order\n if actual_order = self.last_active_recurring_order\n self.orders.recurring.find(:all, :conditions => [\"orders.id > ?\", actual_order.id],\n :order => \"orders.id ASC\").first\n end\n end", "def list_orders(code)\n PsegRecurring::Order.new(@credentials).fetch_or...
[ "0.6323658", "0.5873915", "0.58131254", "0.5789864", "0.57825345", "0.56828517", "0.5634773", "0.5529241", "0.54923326", "0.5396034", "0.53715116", "0.53293836", "0.5292301", "0.52753055", "0.52412367", "0.5189769", "0.5189136", "0.51814663", "0.51620156", "0.5151022", "0.514...
0.66845405
0
get/order/driver_single_orders Get all single order regardless they are manual or auto for a driver
def driver_single_orders @orders = Timeslot.joins(:orders).where(orders: { category: :single}, timeslots: {region_id: current_user.driver.region_id}) render json: @orders, status: 200 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_orders\n orders\n end", "def orders\n return [] if !is_client?\n client.orders\n end", "def getorders(args={})\n {\n :method=> \"GetOrders\"\n }.to_json\n end", "def get_orders\n return ShopifyAPI::Order.all\n end", "def get_all_orders() \n\tputs \"Getting all...
[ "0.599514", "0.5944234", "0.58264637", "0.5820596", "0.57453036", "0.5741173", "0.57253313", "0.570094", "0.56805474", "0.5624305", "0.5595843", "0.5519352", "0.5471493", "0.5464744", "0.5426373", "0.5423127", "0.54051054", "0.5386229", "0.5369818", "0.5352874", "0.5347232", ...
0.6335111
0
put/order/1 Mark a order as complete by driver
def mark_order_complete order_params = (driver_order_params) order_params[:payable_attributes][:driver_id] = current_user.customer_id if @order.single? if( (Time.now >= Time.parse(@order.place_date + ' ' + @order.timeslot.start) || true) && (@order.pending? ) && @order.update(order_params) ) render json: @order, status: 200 else render json: {'errorrs': ['Order can not be completed']}, status: :unprocessable_entity end else if(@order.update(order_params)) render json: @order, status: 200 else render json: {'errorrs': ['Order can not be completed']}, status: :unprocessable_entity end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mark_complete\n ActiveRecord::Base.transaction do\n find_order\n separate_shipment_costs\n assert_refund_adjustments params['refund_items'], true\n @order.update!\n end\n settle_payments_if_desired\n render text: @settlement_result...
[ "0.69553185", "0.6759722", "0.6741864", "0.6729067", "0.6714085", "0.66975635", "0.6635356", "0.6536199", "0.6515236", "0.6497", "0.64500105", "0.6392472", "0.63909906", "0.6379636", "0.6368655", "0.63317764", "0.6310971", "0.6308635", "0.6249706", "0.6230844", "0.6187945", ...
0.74576443
0
xroad_id may be either ClientId or ServerId.
def verify_xroad_instance(xroad_id) logger.debug("Instance verification: #{xroad_id}") unless @xroad_instance.eql?(xroad_id.xroad_instance) raise t("request.incorrect_instance") end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_xroad_instance(xroad_id)\n logger.debug(\"Instance verification: #{xroad_id}\")\n\n unless @xroad_instance.eql?(xroad_id.xroad_instance)\n raise t(\"request.incorrect_instance\")\n end\n end", "def set_mainroad\n @mainroad = Mainroad.find(params[:id])\n end", "def set_road\n ...
[ "0.66138875", "0.5049378", "0.50263023", "0.48848465", "0.4846459", "0.47275993", "0.4703783", "0.4653071", "0.46315962", "0.46029252", "0.45669642", "0.45372003", "0.45358035", "0.453562", "0.45174667", "0.4458038", "0.44488096", "0.4443291", "0.44104835", "0.44089085", "0.4...
0.6561161
1
GET /agenciamadres/1 GET /agenciamadres/1.xml
def show @agenciamadre = Agenciamadre.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @agenciamadre } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @relatestagiario = Relatestagiario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @relatestagiario }\n end\n end", "def download_xml\n\t\turi = URI.parse(\"http://www.esmadrid.com/opendata/tiendas_v1_es.xml\")\n\t\tresponse...
[ "0.6237832", "0.62087727", "0.6183817", "0.61069185", "0.6057191", "0.60394096", "0.6030785", "0.60258734", "0.5999758", "0.5983949", "0.59808916", "0.59781045", "0.5955818", "0.59473175", "0.59176636", "0.59057117", "0.5896805", "0.5892465", "0.5879226", "0.58749354", "0.587...
0.6580325
0
GET /agenciamadres/new GET /agenciamadres/new.xml
def new @agenciamadre = Agenciamadre.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @agenciamadre } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @relatestagiario = Relatestagiario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @relatestagiario }\n end\n end", "def new\n @omatsuri = Omatsuri.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { ...
[ "0.7245398", "0.7164518", "0.71478367", "0.71264786", "0.712289", "0.70754814", "0.70577675", "0.7046149", "0.7043363", "0.7038602", "0.70277387", "0.7027488", "0.70097184", "0.70051676", "0.6998889", "0.69982636", "0.69962996", "0.6978991", "0.6969443", "0.69611156", "0.6948...
0.7411457
0
POST /agenciamadres POST /agenciamadres.xml
def create @agenciamadre = Agenciamadre.new(params[:agenciamadre]) respond_to do |format| if @agenciamadre.save format.html { redirect_to(@agenciamadre, :notice => 'Agencia Madre fue creada satisfactoriamente.') } format.xml { render :xml => @agenciamadre, :status => :created, :location => @agenciamadre } else format.html { render :action => "new" } format.xml { render :xml => @agenciamadre.errors, :status => :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_tags\n uri = URI.parse(\"https://api.thomsonreuters.com/permid/calais\")\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n post_body = []\n post_body << \"<Document><Body>\"\n # stip html\n post_body << ActionView::Base.full_sanitizer.sanitize(params...
[ "0.568386", "0.5615961", "0.556143", "0.53071696", "0.5302942", "0.5282424", "0.5253082", "0.5227075", "0.51156545", "0.5100632", "0.50992155", "0.5084646", "0.50764245", "0.50733185", "0.5062335", "0.50605386", "0.50602293", "0.50296885", "0.50226015", "0.5014628", "0.496211...
0.5974314
0
get next yahrzeit date on or after "from" date
def next_yahrzeit_date(from=Date.today) return unless death_date # TODO: use Marlena rules h_from = Hebruby::HebrewDate.new(from) h_death = Hebruby::HebrewDate.new(death_date) # yahrzeit date from year h_yahrzeit = Hebruby::HebrewDate.new(h_death.day, h_death.month, h_from.year) date = Date.jd(h_yahrzeit.jd) if date < from h_yahrzeit = Hebruby::HebrewDate.new(h_death.day, h_death.month, h_from.year+1) date = Date.jd(h_yahrzeit.jd) end date end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_yahrzeit_date(from=Date.today)\n return unless death_hebrew_date_day && death_hebrew_date_month\n @next_yahrzeit_date ||= begin\n # TODO: use Marlena rules\n h_from = Hebruby::HebrewDate.new(from)\n # yahrzeit date from year\n h_yahrzeit = Hebruby::HebrewDate.new(death_hebrew_dat...
[ "0.6988127", "0.69150674", "0.6720934", "0.6713743", "0.6561058", "0.654712", "0.651791", "0.65158767", "0.651048", "0.6485499", "0.64658606", "0.64643204", "0.64403236", "0.64092857", "0.640129", "0.6307372", "0.6299992", "0.6291768", "0.62493706", "0.6238404", "0.61948866",...
0.70579094
0
Sets attributes of the load balancer The following attributes can be set: CrossZoneLoadBalancing (enable/disable) ConnectionDraining (enable/disable and timeout) Idle Connection Timeouts Still requires: AccessLog configuration ==== Parameters lb_name Name of the ELB options 'ConnectionDraining': 'Enabled' whether to enable connection draining 'Timeout' max time to keep existing conns open before deregistering instances 'CrossZoneLoadBalancing': 'Enabled' whether to enable cross zone load balancing 'ConnectionSettings': 'IdleTimeout' time (in seconds) the connection is allowed to be idle (no data has been sent over the connection) before it is closed by the load balancer. ==== Returns response: body: 'ResponseMetadata': 'RequestId' Id of request
def modify_load_balancer_attributes(lb_name, options) attributes = Fog::AWS.serialize_keys 'LoadBalancerAttributes', options request(attributes.merge( 'Action' => 'ModifyLoadBalancerAttributes', 'LoadBalancerName' => lb_name, :parser => Fog::Parsers::AWS::ELB::Empty.new )) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def modify_load_balancer_attributes(lb_id, attributes)\n attributes = Fog::AWS.serialize_keys 'Attributes', attributes.map{ |property, value| { :Key => property, :Value => value } }\n request(attributes.merge(\n 'Action' => 'ModifyLoadBalancerAttributes',\n 'LoadBa...
[ "0.6881987", "0.63550526", "0.60747653", "0.5950793", "0.58297247", "0.5668725", "0.5498494", "0.54914826", "0.5449023", "0.54453933", "0.5378115", "0.53044623", "0.5206537", "0.5151398", "0.51446295", "0.51323014", "0.507111", "0.5070972", "0.50553644", "0.501969", "0.500384...
0.7620888
0
repair the list this item belongs to
def repair_list self.class.repair_list(list_scope) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repair_list\n model.repair_list(list_scope)\n end", "def fix_items\n valid_items = EquipmentModel.where(id: items.keys).collect(&:id)\n self.items = items.select { |em, _count| valid_items.include? em }\n end", "def remove_from_list\n # if in_list?\n # decrement_positions...
[ "0.76052976", "0.6876154", "0.63864297", "0.632772", "0.61386406", "0.6077444", "0.60354894", "0.60253173", "0.6018955", "0.6008113", "0.5993467", "0.5975745", "0.5974182", "0.59669507", "0.59631884", "0.5959673", "0.59484965", "0.5943476", "0.59429574", "0.59238696", "0.5908...
0.76322925
0
reorder the list this item belongs to
def reorder_list(order) self.class.repair_list(list_scope.merge(:order => order)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reorder_list(order)\n model.repair_list(list_scope.merge(:order => order))\n end", "def reorder_queue_items\n queue_items.each_with_index do |queue_item,index|\n queue_item.update_attributes(list_order: index + 1)\n end\n end", "def reorder(positions)\n\t SortableList.new(self....
[ "0.761894", "0.72861505", "0.6808553", "0.6429333", "0.63515824", "0.63418937", "0.62593096", "0.6160428", "0.6114032", "0.6087117", "0.6077317", "0.6066348", "0.60639775", "0.60224295", "0.601586", "0.5976452", "0.5976452", "0.5970553", "0.5920123", "0.58942634", "0.5885365"...
0.7510975
1
Find best matching competition race for category. Iterate through traits (weight, equipment, ages, gender, abilities) until there is a single match (or none).
def best_match_in(event) logger.debug "Category#best_match_in #{name} in #{event.name}: #{event.categories.map(&:name).join(', ')}" candidate_categories = event.categories equivalent_match = candidate_categories.detect { |category| equivalent?(category) } logger.debug "equivalent: #{equivalent_match&.name}" return equivalent_match if equivalent_match candidate_categories = candidate_categories.select { |category| weight == category.weight } logger.debug "weight: #{candidate_categories.map(&:name).join(', ')}" candidate_categories = candidate_categories.select { |category| equipment == category.equipment } logger.debug "equipment: #{candidate_categories.map(&:name).join(', ')}" candidate_categories = candidate_categories.select { |category| ages_begin.in?(category.ages) } logger.debug "ages: #{candidate_categories.map(&:name).join(', ')}" candidate_categories = candidate_categories.reject { |category| gender == "M" && category.gender == "F" } logger.debug "gender: #{candidate_categories.map(&:name).join(', ')}" candidate_categories = candidate_categories.select { |category| ability_begin.in?(category.abilities) } logger.debug "ability: #{candidate_categories.map(&:name).join(', ')}" return candidate_categories.first if candidate_categories.one? return nil if candidate_categories.empty? if junior? junior_categories = candidate_categories.select { |category| category.junior? } logger.debug "junior: #{junior_categories.map(&:name).join(', ')}" return junior_categories.first if junior_categories.one? if junior_categories.present? candidate_categories = junior_categories end end if masters? masters_categories = candidate_categories.select { |category| category.masters? } logger.debug "masters?: #{masters_categories.map(&:name).join(', ')}" return masters_categories.first if masters_categories.one? if masters_categories.present? candidate_categories = masters_categories end end # E.g., if Cat 3 matches Senior Men and Cat 3, use Cat 3 # Could check size of range and use narrowest if there is a single one more narrow than the others candidate_categories = candidate_categories.reject { |category| category.all_abilities? } logger.debug "reject wildcards: #{candidate_categories.map(&:name).join(', ')}" return candidate_categories.first if candidate_categories.one? return nil if candidate_categories.empty? # "Highest" is lowest ability number highest_ability = candidate_categories.map(&:ability_begin).min if candidate_categories.one? { |category| category.ability_begin == highest_ability } highest_ability_category = candidate_categories.detect { |category| category.ability_begin == highest_ability } logger.debug "highest ability: #{highest_ability_category.name}" return highest_ability_category end candidate_categories = candidate_categories.reject { |category| gender == "F" && category.gender == "M" } logger.debug "exact gender: #{candidate_categories.map(&:name).join(', ')}" return candidate_categories.first if candidate_categories.one? return nil if candidate_categories.empty? logger.debug "no wild cards: #{candidate_categories.map(&:name).join(', ')}" return candidate_categories.first if candidate_categories.one? return nil if candidate_categories.empty? raise "Multiple matches #{candidate_categories.map(&:name)} for #{name} in #{event.categories.map(&:name).join(', ')}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def best_match_in(event_categories, result_age = nil)\n debug \"Category#best_match_in for #{name} in #{event_categories.map(&:name).join(', ')}\"\n\n candidate_categories = event_categories.dup\n\n equivalent_matches = candidate_categories.select { |category| equivalent?(category) }\n debug \"...
[ "0.5972105", "0.5694107", "0.55712306", "0.5510315", "0.5304478", "0.5271997", "0.5234641", "0.5234431", "0.52040195", "0.51542526", "0.51541793", "0.5127752", "0.509658", "0.5092023", "0.5078666", "0.50630593", "0.50441486", "0.50382066", "0.50222635", "0.50100756", "0.49888...
0.6049323
0
of sniff Version of the sniffer that uses multiple threads, may be better for bursty but otherwise low traffic environments.
def sniff_queue queue = Queue.new # Spin up a thread that just queues packets (a buffer, if you will) qthread = Thread.new do @sniffer.each_packet do |pkt| queue.push pkt unless queue.length > 1000 end end # of qthread # Now read each of those packets loop do pkt = queue.pop @event_collector.pkt_count += 1 @event_collector.bytes += pkt.caplen case pkt when @tcp_traffic @tcp_handler.packet(pkt) if @tcp_handler when @udp_traffic @udp_handler.packet(pkt) if @udp_handler and pkt.udp? # INVESTIGATE! end end # of each_packet end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def multithreaded\n get_value :multithreaded\n end", "def thread; end", "def thread; end", "def thread; end", "def do_sendtrain(train)\n # send the train\n $threadLock.synchronize {\n\twhile $activeThreads >= $maxThreads\n\t\t$threadCond.wait($threadLock)\t# wait until there is one less thread\n\...
[ "0.5767929", "0.5718602", "0.5718602", "0.5718602", "0.5625441", "0.55687666", "0.55488056", "0.55488056", "0.55488056", "0.54524916", "0.53529274", "0.5319013", "0.53042847", "0.5265917", "0.52533245", "0.52300936", "0.5217938", "0.52061605", "0.518276", "0.5179148", "0.5173...
0.5941943
0
of packet() If the sequence number is valid, update the stream attributes. If not, perform the appropriate response but don't update the stream. Return true if valid and should continue parsing, false if it shouldn't, and a pkt if there is a queued next packet that needs to be injected into the stream.
def validate_sequence_numbers(pkt, state, dir) expected_seq = dir == :up ? state.seq_up : state.seq_down # If we don't have an expected sequence number yet, set one expected_seq = pkt.tcp_seq if expected_seq == 0 # If we did not expect this sequence number, handle dissonance if pkt.tcp_seq != expected_seq return nil if pkt.tcp_seq < expected_seq # OS would ignore this packet # The sequence number is high - save it for later? if pkt.tcp_seq - expected_seq < FORWARD_WINDOW segments = dir == :up ? state.segments_up : state.segments_down segments[pkt.tcp_seq] = pkt else # This packet is too far in advance, we're aborting on this steram @event_collector.send(:tcp_stream_end) do { :syn_seen => !!state.syn_seen, :src_ip => @protos.str_ip(pkt.src.to_i), :dst_ip => @protos.str_ip(pkt.dst.to_i), :src_port => pkt.sport, :dst_port => pkt.dport, :rst => false, :fin => false, :sync => true, :timeout => false } end @protos.conclude(state, :up) # Kill the stream in both directions @protos.conclude(state, :down) state.app_state = nil # not parsing anymore #delete_state(state) # don't delete the state, FIN/RST will do it. end return nil # in either case, we don't process the packet right now # Sequence number was what we expected, this is part of our stream else # If this was a SYN packet, increase next expected sequence number by 1 # as specified by the TCP RFC. expected_seq += 1 if pkt.tcp_syn? # Adjust our next expected sequence number if dir == :up state.seq_up = (expected_seq + pkt.tcp_data_len) % 4294967296 else state.seq_down = (expected_seq + pkt.tcp_data_len) % 4294967296 end # Do we have a queued packet that we received out of order? segments = dir == :up ? state.segments_up : state.segments_down if segments.length > 0 queued_pkt = segments[expected_seq] segments.reject! { |k,_| k <= expected_seq } # delete all passed segs if queued_pkt return queued_pkt end end # of if segments.length > 0 end true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid?\n return false if !@display_name.nil? && @display_name.to_s.length > 255\n return false if !@description.nil? && @description.to_s.length > 1024\n return false if @tcp_closed.nil?\n return false if @tcp_closed > 4320000\n return false if @tcp_closed < 10\n return false if @...
[ "0.54812187", "0.53521025", "0.53457576", "0.53096867", "0.5280621", "0.52769667", "0.52022445", "0.51943576", "0.51724285", "0.5150046", "0.5149561", "0.51452684", "0.5095811", "0.50434756", "0.5041339", "0.5025787", "0.50133234", "0.49645808", "0.4958033", "0.49557388", "0....
0.66046137
0
GET /wishes/new GET /wishes/new.json
def new @wish = Wish.new respond_to do |format| format.html # new.html.erb format.json { render json: @wish } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @wishlistitem = Wishlistitem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @wishlistitem }\n end\n end", "def new\n @wish_list_item = WishListItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { r...
[ "0.75034636", "0.7397594", "0.712135", "0.712135", "0.6997838", "0.6956595", "0.69218665", "0.6855291", "0.6832216", "0.6832216", "0.680942", "0.6806758", "0.6797136", "0.6782294", "0.67808294", "0.6780439", "0.6733088", "0.67297685", "0.6728313", "0.67146295", "0.67120075", ...
0.7856075
0
POST /wishes POST /wishes.json
def create @wish = current_user.wishes.build(params[:wish]) if @wish.save flash[:success] = "Wish created!" redirect_to root_url else @feed_items = [] render 'static_pages/home' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @wish = Wish.create(wish_params)\n\n respond_to do |format|\n if @wish.save\n format.html { redirect_to @wish, notice: 'Wish was successfully created.' }\n format.json { render :show, status: :created, location: @wish }\n else\n format.html { render :new }\n ...
[ "0.6912995", "0.6840946", "0.6729906", "0.6561722", "0.6483702", "0.63777417", "0.63369393", "0.62611157", "0.6222567", "0.6171183", "0.61618245", "0.6150779", "0.6122475", "0.6095343", "0.60716784", "0.6065541", "0.6029707", "0.59819096", "0.5970839", "0.5970839", "0.5953641...
0.7107845
0
PUT /wishes/1 PUT /wishes/1.json
def update @wish = Wish.find(params[:id]) respond_to do |format| if @wish.update_attributes(params[:wish]) format.html { redirect_to @wish, notice: 'Wish was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @wish.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @wish.update(wish_params)\n format.html { redirect_to @wish, notice: 'Wish was successfully updated.' }\n format.json { render :show, status: :ok, location: @wish }\n else\n format.html { render :edit }\n format.json { render json: @...
[ "0.6478893", "0.6446402", "0.6404435", "0.62265486", "0.62234676", "0.61401874", "0.61304915", "0.61304915", "0.61304915", "0.6079557", "0.6057336", "0.6011446", "0.59815335", "0.59564936", "0.5954274", "0.5932123", "0.5930394", "0.58973336", "0.5880298", "0.58720905", "0.585...
0.65631545
0
GET /aktions/1 GET /aktions/1.xml
def show @aktion = Aktion.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @aktion } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @kontakties = Kontakty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @kontakties }\n end\n end", "def show\n @arc = Arc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render ...
[ "0.6348968", "0.61060447", "0.5890238", "0.583558", "0.5822921", "0.5783563", "0.57820463", "0.57705635", "0.5753406", "0.57525", "0.5744738", "0.57319534", "0.57258654", "0.57128507", "0.56969434", "0.5695478", "0.56927633", "0.5690401", "0.5683251", "0.56711614", "0.5668034...
0.6412662
0
GET /aktions/new GET /aktions/new.xml
def new @aktion = Aktion.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @aktion } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @atom = Atom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @atom }\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end", "def new\n @newz...
[ "0.6836664", "0.66961354", "0.6647385", "0.6611461", "0.6600876", "0.6588805", "0.6579335", "0.6578438", "0.65678596", "0.6561316", "0.6546243", "0.6540222", "0.6532622", "0.6532622", "0.6532622", "0.6523455", "0.65155053", "0.6515044", "0.6496029", "0.64893603", "0.6485425",...
0.7027073
0
POST /aktions POST /aktions.xml
def create @aktion = Aktion.new(params[:aktion]) respond_to do |format| if @aktion.save flash[:notice] = 'Aktion was successfully created.' format.html { redirect_to(@aktion) } format.xml { render :xml => @aktion, :status => :created, :location => @aktion } else format.html { render :action => "new" } format.xml { render :xml => @aktion.errors, :status => :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @akt = Akt.new(akt_params)\n\n respond_to do |format|\n if @akt.save\n format.html { redirect_to @akt, notice: 'Акт створено.' }\n format.json { render :show, status: :created, location: @akt }\n else\n format.html do\n prepare_form_data\n render ...
[ "0.5446658", "0.5281343", "0.5253184", "0.5202324", "0.51885104", "0.5118851", "0.5112516", "0.508409", "0.5081446", "0.5081028", "0.5074932", "0.50144464", "0.5013193", "0.50059336", "0.49958107", "0.49835205", "0.49536613", "0.4944312", "0.49390098", "0.49359998", "0.493529...
0.5885438
0
PUT /aktions/1 PUT /aktions/1.xml
def update @aktion = Aktion.find(params[:id]) respond_to do |format| if @aktion.update_attributes(params[:aktion]) flash[:notice] = 'Aktion was successfully updated.' format.html { redirect_to(@aktion) } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @aktion.errors, :status => :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end", "def test_should_update_link_via_API_XML\r\n get \"/logout\"\r\n put \"/links/1.xml\", :link => {:user_id => 1,\r\n :title => 'API Link 1',\...
[ "0.5846597", "0.5741908", "0.56314933", "0.56169415", "0.55770534", "0.5570146", "0.5535835", "0.55105174", "0.5508029", "0.54939276", "0.53676236", "0.5338769", "0.5329612", "0.53254646", "0.53153676", "0.530708", "0.5272382", "0.5258371", "0.52416664", "0.5218568", "0.52040...
0.58411115
1
DELETE /aktions/1 DELETE /aktions/1.xml
def destroy @aktion = Aktion.find(params[:id]) @aktion.destroy respond_to do |format| format.html { redirect_to(aktions_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end", "def destroy\n @kontak = Kontak.find(params[:id])\n @kontak.destroy\n\n respond_to do |format|\n format.html { redirect_to(kontaks_url) }\n format.xml { head :ok }\n end\n end", "def delete()\n...
[ "0.67681015", "0.6438368", "0.63879585", "0.6378644", "0.6357101", "0.6355549", "0.63552016", "0.6332766", "0.63288426", "0.62855387", "0.62809", "0.62789476", "0.62674224", "0.62603086", "0.6244535", "0.6224033", "0.62123626", "0.6189972", "0.61838096", "0.6168901", "0.61669...
0.68998826
0
Sets flag to make create/update account the default account
def add_default_account(post) post[:defaultacct] = 'Y' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_defaults\n self.state ||= 'ACTIVE'\n self.account_user_id ||= Gizmo::Util::Uuid.generate\n self.is_owner ||= false\n end", "def set_defaults\n self.state ||= 'NEW'\n self.account_id ||= Gizmo::Util::Uuid.generate\n self.account_name ||= self.subdomain\n end", "def set_...
[ "0.71875703", "0.6926933", "0.6569838", "0.6523224", "0.6505293", "0.6360575", "0.6339988", "0.6300126", "0.62328976", "0.6231819", "0.62196255", "0.6130573", "0.61287594", "0.61264807", "0.6109155", "0.61017406", "0.61017406", "0.6088548", "0.60852414", "0.60523975", "0.6046...
0.7921206
0
Adds profile to post and sets update flag
def add_profile(post, profile) post[:profile] = profile post[:profileupdate] = 'Y' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_profile(body={})\n perform_post(\"/account/update_profile.json\", :body => body)\nend", "def set_post\n @profile = Profile.find(params[:id])\n end", "def update_profile(body)\n post(\"user/#{user_id}/profile.json\", body)\n end", "def update_profile(options={})\n perform_post...
[ "0.67057496", "0.66889435", "0.653363", "0.6407962", "0.63639706", "0.63453615", "0.62816125", "0.6268229", "0.6218425", "0.6208063", "0.62006456", "0.6168615", "0.6160453", "0.6145818", "0.61370856", "0.613005", "0.6107415", "0.61013746", "0.6100688", "0.60894877", "0.608503...
0.85272396
0
Parses profileid and acctid from profile, and adds it parameters, used for profile deletion
def add_profile_parameters(parameters, profile) profileid, acctid = profile.split('/') parameters[:profileid] = profileid parameters[:acctid] = acctid end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def profile_params\n params\n .require(:profile)\n .permit(:last_name, :first_name, :address, :phone, :age)\n .merge(:account_id => current_user.id)\n end", "def profile_params\n params.require(:profile).permit(:profile_first_name, :profile_last_name, :user_id, :profile_preferred_ri...
[ "0.67498636", "0.65747064", "0.6551823", "0.6509432", "0.6485902", "0.64439625", "0.6434388", "0.64103013", "0.6394292", "0.63849723", "0.633013", "0.63192815", "0.63086426", "0.630434", "0.6280754", "0.62768734", "0.6273976", "0.62671655", "0.626039", "0.6253733", "0.6248475...
0.82952243
0
DELETE /list_invites/1 DELETE /list_invites/1.json
def destroy @list_invite.destroy respond_to do |format| format.html { redirect_to list_invites_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @invite_list = InviteList.find(params[:id])\n @invite_list.destroy\n\n respond_to do |format|\n format.html { redirect_to invite_lists_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @invite = Invite.find(params[:id])\n @invite.destroy\n\n respo...
[ "0.7614332", "0.7483555", "0.7483555", "0.7483555", "0.7483555", "0.7312825", "0.7312825", "0.72277004", "0.72108185", "0.71746373", "0.7099659", "0.7077111", "0.7051402", "0.7051402", "0.7051402", "0.7051402", "0.6994812", "0.6852885", "0.68522215", "0.6768387", "0.6764497",...
0.7661324
0
Returns the permissions associated with the role
def permissions Roles.type_map[role_type].permissions end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def role_permissions\n return @role_permissions\n end", "def permissions\n if @permissions.nil?\n perm_array = []\n roles.each { |r| perm_array << r.permission_ids }\n @permissions = perm_array.flatten.uniq\n else\n @permissions\n end\n end"...
[ "0.83612496", "0.7967314", "0.7944717", "0.7577825", "0.7563391", "0.74145716", "0.74088514", "0.72138083", "0.71344703", "0.7127846", "0.7009284", "0.69980043", "0.6966114", "0.69469106", "0.6939263", "0.6932439", "0.68984014", "0.68984014", "0.689288", "0.689288", "0.688554...
0.81939876
1
Sets the nearest timeframe
def set_time_frame time, time_slot = 30.minutes Time.at(((time.to_i / time_slot).round * time_slot) + time_slot).to_i end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjust_timeframe(timeframe)\n timeframe\n end", "def timeframe=(val)\n raise(ArgumentError, 'timeframe value must be in the days_ago_list') unless days_ago_list.include? val\n\n @timeframe = val\n refresh_data\n\n end", "def set_timeframe\n @timeframe = Timeframe.find(params[:id]...
[ "0.67763716", "0.5833987", "0.5665923", "0.5644117", "0.5591518", "0.5580752", "0.5405682", "0.53374815", "0.53036475", "0.52960515", "0.5290458", "0.5290458", "0.5290458", "0.5290458", "0.5290458", "0.5290458", "0.5290458", "0.5290458", "0.5276369", "0.5274024", "0.5274024",...
0.59649295
1
Returns the recipe classes in order based on the Gemfile order
def ordered_recipes return @ordered_recipes if @ordered_recipes names = Bundler.load.dependencies.map(&:name) # Setup a hash with the recipe name and the recipe class recipe_pool = recipes.dup.inject({}) {|memo,recipe| memo[recipe.gem_name] = recipe ; memo } # Go through the gems in the order they are in the Gemfile, then # add them to the ordered list @ordered_recipes = [] names.each do |name| if recipe_pool[name] @ordered_recipes << recipe_pool[name] recipe_pool.delete(name) end end # Add the remaining recipes (load them after everything else) @ordered_recipes += recipe_pool.values return @ordered_recipes end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def depends_all\n pkg_depends = self.class.depends_all\n if self.class.omnibus_package\n self.class.omnibus_recipes.each { |omni_recipe|\n recipe_file = File.expand_path(omni_recipe + '.rb', File.dirname(filename))\n\n Book.instance.load_recipe(recipe_file, config) do |...
[ "0.663816", "0.663816", "0.647818", "0.6027255", "0.5872339", "0.57335997", "0.57302433", "0.5720733", "0.57169104", "0.5702004", "0.56983083", "0.56872267", "0.56674826", "0.56643623", "0.5659114", "0.5616627", "0.55957377", "0.5593597", "0.5582223", "0.55817837", "0.5573044...
0.79110026
0
Returns the list of classes that match the current list of roles in the correct run order
def recipe_classes_with_roles(roles) # Check to make sure some recipes have been added if ordered_recipes.size == 0 raise Thor::InvocationError, 'no recipes have been defined' end if (roles.is_a?(Array) && roles.size == 0) || roles == :all # Use all classes role_classes = ordered_recipes else # Remove classes that don't fit the roles being used role_classes = ordered_recipes.reject do |recipe_class| ![roles].flatten.map(&:to_s).include?(recipe_class.class_role) end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def roles\n Jak.role_klass.where(id: grants.pluck(:role_ids).compact.flatten)\n end", "def roles\n @run_list.select do |rl|\n rl.start_with?('r_', 'p_', 'base_', 'os_', 'os-')\n end\n end", "def roles\n self.class.roles.map do |name|\n __send__(name)\n end\n end", "def...
[ "0.6776941", "0.656379", "0.6520467", "0.6483397", "0.64126897", "0.6331103", "0.63098425", "0.6295739", "0.6293623", "0.6227268", "0.6221702", "0.61961675", "0.6187308", "0.61219615", "0.6045106", "0.60402143", "0.60402143", "0.6031308", "0.5972891", "0.5972758", "0.59591484...
0.7155205
0
Invokes all recipes that implement the passed in role
def invoke_roles(task_name, roles, options={}) role_classes = self.recipe_classes_with_roles(roles) # Run the taks on each role class role_classes.each do |recipe_class| # This class matches the role, so we should run it recipe = recipe_class.new([], options) task = recipe_class.tasks[task_name.to_s] recipe.invoke_task(task) # Copy back and updated options options = recipe.options end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tell(role_name, method_name, ...)\n if context == self || context.contains?(self)\n context.dispatch(role(role_name), method_name, ...)\n end\n end", "def method_missing(meth_name, *args, &block)\n raise \"No method named: #{meth_name}\" unless recipe.respond_to? meth_name\n ...
[ "0.5542909", "0.5435228", "0.5433466", "0.5427825", "0.52657735", "0.5257147", "0.5225269", "0.5148291", "0.50860053", "0.50795543", "0.50388676", "0.50357753", "0.4998903", "0.49958935", "0.49937195", "0.49792033", "0.497508", "0.4946387", "0.4942964", "0.4920764", "0.491855...
0.61740804
0
GET /air_moistures GET /air_moistures.json
def index @air_moistures = AirMoisture.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @air_qualities = AirQuality.all\n\n render json: @air_qualities\n end", "def index\n @soil_moistures = SoilMoisture.all\n end", "def show\n render json: @air_quality\n end", "def set_air_moisture\n @air_moisture = AirMoisture.find(params[:id])\n end", "def index\n @cap...
[ "0.6477318", "0.6322574", "0.6238727", "0.6140732", "0.6136393", "0.61150396", "0.6083614", "0.60437167", "0.60434604", "0.6033698", "0.60279095", "0.6005438", "0.59941566", "0.5992053", "0.5980522", "0.59371537", "0.59309715", "0.5927996", "0.59212065", "0.59185755", "0.5907...
0.75258315
0
POST /air_moistures POST /air_moistures.json
def create @air_moisture = AirMoisture.new(air_moisture_params) respond_to do |format| if @air_moisture.save format.html { redirect_to @air_moisture, notice: 'Air moisture was successfully created.' } format.json { render :show, status: :created, location: @air_moisture } else format.html { render :new } format.json { render json: @air_moisture.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @air_moistures = AirMoisture.all\n end", "def create\n @soil_moisture = SoilMoisture.new(soil_moisture_params)\n\n respond_to do |format|\n if @soil_moisture.save\n format.html { redirect_to @soil_moisture, notice: 'Soil moisture was successfully created.' }\n format.json...
[ "0.6157518", "0.6023888", "0.59428394", "0.5910758", "0.5841418", "0.57893306", "0.57763255", "0.5775427", "0.57316273", "0.5690711", "0.56655085", "0.5650385", "0.5640944", "0.56387323", "0.5595094", "0.5562408", "0.555145", "0.55506915", "0.5550431", "0.553902", "0.55364805...
0.7118669
0