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
Adds a new provider to the provider collection.
def add extension, provider providers[extension] = provider end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_provider(name, klass)\n @providers[name] = klass\n end", "def add_provider!(provider, provider_info = {}, access = {})\n Api::Request.new do |request|\n request[:access] = access\n request[:method] = :POST\n request[:path] = \"/mgmt/{{client_id}}/storages/#{provider...
[ "0.6940578", "0.66328067", "0.64919317", "0.6239821", "0.61185026", "0.607157", "0.606617", "0.60642457", "0.60566235", "0.59977895", "0.5982376", "0.59495604", "0.59476715", "0.59152204", "0.5864147", "0.5859157", "0.5837305", "0.5832999", "0.5809659", "0.5809659", "0.580965...
0.7386824
0
List of configured providers.
def providers @providers ||= {} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def providers\n @providers.keys\n end", "def providers\n @providers ||= load_hash 'config/providers.yml'\n end", "def providers\n driver(current_driver).providers\n end", "def providers\n @providers_manager\n end", "def providers\n providers = YARD::Registry.all(\"pup...
[ "0.8362594", "0.8128595", "0.80782074", "0.79805493", "0.7715629", "0.76403266", "0.76014507", "0.76014507", "0.7413273", "0.74022377", "0.7297735", "0.72866434", "0.72759145", "0.6921644", "0.6845834", "0.67605525", "0.6726786", "0.6722341", "0.6717966", "0.67173785", "0.666...
0.8151667
1
Resets the provider collection to the initial values.
def reset providers.clear configured_providers.each { |k, v| self[k] = v } self.default = configured_default end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_provider\n remove_stored_info\n set_default_as_provider\n end", "def reset\n @collection = []\n end", "def reset!\n # this should be overridden by concrete adapters\n end", "def reset_initial_values\n @initial_values.clear if @initial_values\n @missing...
[ "0.7753693", "0.7116367", "0.6629752", "0.6623564", "0.66110027", "0.66110027", "0.6471403", "0.6417714", "0.6363478", "0.63123494", "0.63123494", "0.62903196", "0.624949", "0.6244952", "0.6232816", "0.6227661", "0.6222696", "0.62199634", "0.6205134", "0.6171895", "0.61715275...
0.7555268
1
Get provider corresponding to a given format.
def [] format providers[format] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def formatted_provider\n if provider_missing?\n case provider\n when 'ELDERSERVEHEALTH'\n Provider[5]\n when 'AMERIGROUP'\n Provider[1]\n else\n Provider[16]\n end\n else\n Provider.where(name: provider).first\n end\n end", "d...
[ "0.6637845", "0.6160864", "0.6144279", "0.612312", "0.59931195", "0.59456164", "0.59246707", "0.5909754", "0.57798964", "0.5763829", "0.5706053", "0.5702132", "0.5696122", "0.56224453", "0.5619345", "0.56161296", "0.5578824", "0.5563391", "0.55528134", "0.551311", "0.5490883"...
0.6890807
0
If any of the 'indicator properties' in the attribute hash are not nil, the boolean property is set to true in the attribute hash. Otherwise it's set to the default (or not set if default=nil). Returns the attribute hash.
def infer_boolean bool_property, indicator_properties, atts, default=nil atts[bool_property] = default unless (atts[bool_property] or default.nil?) indicator_properties.each do |x| atts[bool_property] = true unless atts[x].nil? end return atts end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def boolean_attributes\n @boolean_attributes\n end", "def copy_boolean_options_to_attributes(keys)\n keys.each do |k|\n if @opts[k] && !@attr.has_key?(k)\n @attr[k] = k\n end\n end\n end", "def attributes_nil_hash\n @_attributes_nil_hash ||= {}.tap do |attr_hash...
[ "0.5871165", "0.58479124", "0.5739904", "0.563485", "0.5597352", "0.5594985", "0.55411273", "0.5538196", "0.552452", "0.5505258", "0.5490311", "0.5428838", "0.53585804", "0.52806413", "0.5279203", "0.5273315", "0.52719796", "0.52068394", "0.51994675", "0.5199269", "0.5197765"...
0.7186898
0
Cleans a list of Boolean values to be either true or false
def clean_bool dirty_vals vals = [] array = separate(dirty_vals) array.each { |dirty_val| val = get_b(dirty_val) #if val.nil? and (!dirty_val.nil? and dirty_val.strip!='') # val = dirty_val.match(/(not applicable|n\/a|not available)/i).nil? #end vals << val } if vals....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_falsy_values(list)\n list.select {|element| !!element}\nend", "def remove_falsy_values list\n list.select { |item| !!item }\nend", "def munge_boolean(value)\n case value\n when true, 'true', :true\n 'true'\n when false, 'false', :false\n 'false'\n else\n raise \"Invalid ...
[ "0.67963964", "0.677568", "0.66777885", "0.664705", "0.6532966", "0.6388392", "0.63500625", "0.6339539", "0.6331791", "0.6289312", "0.62826055", "0.6270334", "0.6262669", "0.6237597", "0.6234937", "0.62102747", "0.61962754", "0.6169771", "0.61552", "0.6148134", "0.6104385", ...
0.7573842
0
see if any sibling response exists with the same respondent_id
def respondent_already_answered? sibling_responses.exists?(user_id: user_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def respondent_already_answered?\n sibling_responses.exists?(responder_id: self.responder_id)\n end", "def respondent_already_answered?\n sibling_responses.where('user_id = ?', self.user_id).exists?\n end", "def sibling_responses\n # self.question.responses.where(\"responses.id != ?\", self.id...
[ "0.76925874", "0.7279114", "0.6903097", "0.6882504", "0.6853014", "0.6681651", "0.6681651", "0.66347", "0.6610954", "0.6606145", "0.65704745", "0.63962346", "0.6159311", "0.61430603", "0.6081521", "0.6046843", "0.5690411", "0.56268024", "0.56240535", "0.5583392", "0.55649704"...
0.730623
1
User Can't Create Multiple Responses To The Same Question
def not_duplicate_response if respondent_already_answered? errors[:user_id] << 'this user has already answered this question' end # unless sibling_responses.where(user_id: user_id).empty? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n \n respond_to do |format|\n \n if !params[:questions].nil? \n params[:questions].each {\n |q| \n type = Question.find_by_id(q[0]).question_type\n answer = (type == 2 ? Answer.find_by_id(q[1]).correct : nil)\n Response.new( \n {\...
[ "0.71334463", "0.71333545", "0.694733", "0.68908095", "0.68387", "0.67739964", "0.67739964", "0.67181784", "0.6646776", "0.6606174", "0.6529411", "0.6510068", "0.64713866", "0.6468316", "0.6412771", "0.6402794", "0.63880986", "0.6382566", "0.63802475", "0.63491833", "0.629651...
0.7277313
0
Author Can't Respond To Own Poll The simplest way is to use associations to traverse from a Response object back to the AnswerChoice, to the Question, and finally the Poll. You can then verify whether the poll's author is the same as the respondent_id. This may involve multiple queries, but we will later improve this. ...
def respondent_is_not_author_poll? # # respondend.id == author.id if question.poll.author.id == user.id errors[:user_id] << 'author should not answer to his/her poll' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_author?\n Response.joins(question: :poll).where(\"polls.user_id = ?\", self.user_id).exists?\n end", "def not_author_response\n if author_respondent?\n errors[:author] << 'cannot answer their own poll'\n end\n end", "def poll_author?\n self.answer_choice.question.poll....
[ "0.7459119", "0.74162626", "0.74114394", "0.6611128", "0.65162957", "0.6469948", "0.61780465", "0.60721993", "0.6028036", "0.5976189", "0.5953859", "0.5941682", "0.58937144", "0.5889886", "0.58878314", "0.58872795", "0.58787656", "0.58635414", "0.58278686", "0.58248705", "0.5...
0.771261
0
Getter for the +synonym_dictionaries+ class variable
def synonym_dictionaries @@synonym_dictionaries end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def synonym_dict\n return @@synonym_dict if @@synonym_dict\n @@synonym_dict = {}\n config[\"synonyms\"].each do |syn_set|\n syn_set.each {|syn| @@synonym_dict[syn] ||= Set.new; @@synonym_dict[syn].merge syn_set }\n end\n @@synonym_dict\n end", "def synonyms\n @synonyms ||= self.clas...
[ "0.72524345", "0.7052447", "0.6648062", "0.6587201", "0.6079081", "0.6041376", "0.60287887", "0.58597106", "0.57994384", "0.56783175", "0.5657994", "0.5577216", "0.5484738", "0.5428246", "0.54171556", "0.5338815", "0.5298998", "0.5243255", "0.52053016", "0.5148142", "0.514814...
0.8335839
0
Checks if the given +dictionary+ symbol is a key in the +synonym_dictionaries+ class variable
def dictionary_exists? dictionary synonym_dictionaries.key?(dictionary.capitalize) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_for_dictionary(dictionary)\n right = dictionary.word_present?(@word)\n return true if right\n false\n end", "def checking_dictionary_for_word_match\n valid_word?(@prefix)\n end", "def is_word?(word)\n Constants::DICTIONARY.key?(word.downcase)\n end", "def tag_in_di...
[ "0.6732161", "0.6651128", "0.62585914", "0.619724", "0.61556536", "0.6082066", "0.5996537", "0.5889723", "0.5883029", "0.5878499", "0.5804458", "0.5798499", "0.5776489", "0.5756547", "0.5722699", "0.57173216", "0.56295604", "0.5624733", "0.55810237", "0.55740976", "0.5567953"...
0.7829819
0
Output the config settings
def output_config puts 'Using config file: ' + $CONFIG_FILE @conf.each { |key, value| puts key + " = " + value } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_config\n self.config_to_hash.each { |k, v| puts \"#{k}: #{v}\" }\n end", "def display_config\n # Format types and the additional options that apply to each type\n format_opts = {\n \"block\" => [\n \"entry-break\",\n \"element-break\",\n ...
[ "0.7614439", "0.74402165", "0.696857", "0.69136924", "0.6891031", "0.6890713", "0.6855754", "0.6665212", "0.66063887", "0.65654945", "0.6543973", "0.6507965", "0.6497492", "0.6485931", "0.647976", "0.6419686", "0.6391958", "0.63871443", "0.63694614", "0.6325521", "0.6306755",...
0.8242229
0
Check if the pwd is zup enabled
def zup_dir_enabled? if File.exist?('.zup/enabled') return true else return false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enable_zup_dir\n unless zup_dir_enabled?\n puts ' * Adding current directory'\n # Create .zup directory\n FileUtils.mkdir('.zup') unless File.directory?('.zup')\n # Create file to enable zup\n File.open(\".zup/enabled\", 'w') { |f| f.close }\n else\n puts ' * Directory alrea...
[ "0.69885933", "0.68684465", "0.6520007", "0.6285853", "0.60789806", "0.599638", "0.5930512", "0.5908339", "0.5835427", "0.58321446", "0.58160293", "0.58053213", "0.5750155", "0.5736638", "0.57259625", "0.5686872", "0.565659", "0.565015", "0.5611827", "0.5549427", "0.552972", ...
0.76437134
0
Run unison to sync with remote host if enabled
def sync_zup_dir if zup_dir_enabled? local_dir = File.basename(Dir.pwd) # Output the full unison command if debugging enabled puts($SYNC_COMMAND + ' . ' + @conf['protocol'] + '://' \ + @conf['server'] + '/' + @conf['remote_dir'] + '/' \ + local_dir) if $ZUP_DEBUG # Run un...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sync\n # preparation\n check_remote_path_valid\n check_git_repo\n reset_remote_repo\n\n diff_text = local_diff\n apply_diff_to_remote diff_text\n\n # output = @ssh.exec! 'hostname'\n # puts output\n end", "def remo...
[ "0.6375961", "0.6325847", "0.62261987", "0.5861778", "0.56953704", "0.5694294", "0.5652193", "0.56343615", "0.5618496", "0.5607516", "0.55646706", "0.552747", "0.5507347", "0.54969", "0.5482247", "0.54487777", "0.5443176", "0.54225856", "0.54140884", "0.53845", "0.53729093", ...
0.66907656
0
Tacks the registry behind local_tag
def full_tag(local_tag, registry) "#{registry}/#{local_tag}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tag(tag); end", "def tag(tag); end", "def our_tags\n tag_map.tap do |t|\n t.each_pair { |k, v| t[k] = tags.fetch(v, nil) }\n end\n end", "def local_tags\n @local.tags\n end", "def tags_to_add\n local_tags.reject { |t, v| aws_tags.include?(t) and aws_tags[t] == v }...
[ "0.55408585", "0.55408585", "0.5540361", "0.5477359", "0.54692864", "0.5456492", "0.5453355", "0.54405653", "0.54222846", "0.539707", "0.5288271", "0.52485037", "0.52144533", "0.5187233", "0.51737446", "0.5171082", "0.5171082", "0.51461905", "0.51461905", "0.513562", "0.51338...
0.70968634
0
Calculate the SHA256 of the concatenated content of the given list of files after line endings have been stripped
def sha256(files) sha = Digest::SHA2.new files.each do |f| next if File.directory?(f) content = File.binread(f) # work around possible git checkout issues by removing CR and LF from the file content.gsub!("\n", "") content.gsub!("\r", "") sha << content end sha.hexdi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def digest_sha2(*files)\n files.flatten.collect { |file| \n File.exists?(file) ? Digest::SHA2.hexdigest(File.read(file)) : nil\n }\n end", "def digest_sha1(*files)\n files.flatten.collect { |file| \n File.exists?(file) ? Digest::SHA1.hexdigest(File.read(file)) : nil\n }\n ...
[ "0.66718936", "0.63775253", "0.6148582", "0.5974193", "0.5872315", "0.58635956", "0.5860442", "0.58485496", "0.5744255", "0.5714874", "0.5702175", "0.5652525", "0.56464887", "0.56072354", "0.55387217", "0.55273", "0.5516689", "0.5507359", "0.550718", "0.55028313", "0.542722",...
0.7338418
0
Get the value of key and delete the key. This command is similar to GET, except for the fact that it also deletes the key on success.
def getdel(key) send_command([:getdel, key]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete key\n rv = self[key]\n self.removeField key\n return rv\n end", "def delete(key)\n response = request(:delete, uri(key))\n if response.status == 200\n data = MultiJson.load(response.body)\n data[S_PREV_VALUE]\n else\n nil\n end\n end", "def delet...
[ "0.78800714", "0.7846711", "0.78098875", "0.78098875", "0.78098875", "0.78098875", "0.78098875", "0.7728809", "0.7728809", "0.76398957", "0.7554374", "0.75538796", "0.75500077", "0.7517569", "0.7509904", "0.74682623", "0.74482524", "0.74388283", "0.742984", "0.7425656", "0.73...
0.80624545
0
The Nth group of the last regexp match.
def nth_ref(n) if lm = last_match() return lm[n] end return nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nth_ref(n)\n if lm = @last_match\n return lm[n]\n end\n\n return nil\n end", "def process_nth_ref(exp)\n n = exp.shift\n raise if n < 1 or n > 9\n resultify(\"(RegExp.$#{n} || #{@model.encode_nil})\")\n end", "def retrieve_last_match_from_stderr(re, nth = 0)\n return unless $s...
[ "0.7311233", "0.6590991", "0.64058936", "0.6100316", "0.6100138", "0.58060926", "0.5659509", "0.5657635", "0.5489867", "0.5486948", "0.5441531", "0.54292196", "0.5419881", "0.5405483", "0.5402288", "0.5325947", "0.53171045", "0.5288833", "0.5286013", "0.52855444", "0.5268016"...
0.72483605
1
POST /clubs/1/join POST /clubs/1/join.json
def join @club = Club.find(params[:id]) authorize @club @club.club_memberships.create! user_id: current_user.id redirect_to action: :show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def join\n @beer_club = BeerClub.find(params[:id])\n if Membership.where(:beer_club_id => @beer_club.id, :user_id => current_user.id).exists?\n respond_to do |format|\n format.html { redirect_to :back, notice: \"You are already a member of this club!\" }\n end\n else\n...
[ "0.7300599", "0.65574485", "0.64909005", "0.64552486", "0.64253485", "0.63883805", "0.6370366", "0.63585943", "0.63530385", "0.6340715", "0.63233674", "0.6319779", "0.6173563", "0.61190057", "0.60923785", "0.60726094", "0.6056324", "0.6054606", "0.6047761", "0.6042337", "0.60...
0.78311723
0
These defs are made to determine the amount of CP a character needs to level up and if they did level up how much CP they will need for their next level.
def CP(level) cpNeeded = 0 if level > 0 && level <= 5 cpNeeded + 4 elsif level > 5 && level <= 20 cpNeeded + 8 else cpNeeded + 0 end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cr_or_level(num_of_pcs, cr_or_level)\n if num_of_pcs <= 4\n @cr = cr_or_level\n elsif num_of_pcs == 5\n @cr = cr_or_level + (cr_or_level * 0.25)\n elsif num_of_pcs == 6\n @cr = cr_or_level + (cr_or_level * 0.5)\n elsif num_of_pcs == 7\n @cr = cr_or_level + (cr_or_level * 0.7...
[ "0.65192807", "0.5765847", "0.5704485", "0.5703791", "0.5649336", "0.56417644", "0.5570401", "0.55661213", "0.5530373", "0.54888004", "0.5477106", "0.5445855", "0.5432166", "0.5427537", "0.5421823", "0.53717446", "0.53274924", "0.5319638", "0.5318701", "0.526846", "0.5257585"...
0.75770634
0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Generate Equip Set ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def maesb_generate_equip_set @maesb_belongs_to_sets = [] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maesb_generate_equipment_sets\n # Generate Equipment Sets\n ($data_weapons + $data_armors).compact.each { |equip| equip.maesb_generate_equip_set }\n # Update items to refer to the set to which they belong\n set_items = $data_armors.compact.select {|armor| !armor.maesb_sets.empty? }\n set_items.e...
[ "0.68351865", "0.60732543", "0.60037035", "0.5973523", "0.5968878", "0.5706798", "0.5605056", "0.55641353", "0.55604774", "0.55501145", "0.5425557", "0.5397567", "0.5395156", "0.53529346", "0.53304124", "0.5302607", "0.5301194", "0.52929443", "0.5286353", "0.5280704", "0.5276...
0.6679016
1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Generate Equipment Sets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def maesb_generate_equipment_sets # Generate Equipment Sets ($data_weapons + $data_armors).compact.each { |equip| equip.maesb_generate_equip_set } # Update items to refer to the set to which they belong set_items = $data_armors.compact.select {|armor| !armor.maesb_sets.empty? } set_items.each { |set...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maesb_generate_equip_set\n @maesb_belongs_to_sets = []\n end", "def maesb_generate_equip_set\n super\n @maesb_sets = note.scan(/\\\\SET\\s*\\[(.+?)\\]/i).collect { |set_s| \n MAESB_EquipmentSet.new(set_s[0]) }\n end", "def generate_demands\n\t\n\t\tcase @inputs.generation_method...
[ "0.7470944", "0.6843264", "0.59731007", "0.59340966", "0.5891488", "0.58855706", "0.5860812", "0.58247143", "0.5794167", "0.57598925", "0.57151693", "0.5606726", "0.5597033", "0.55759776", "0.555635", "0.5553693", "0.5518126", "0.5489724", "0.547689", "0.54609674", "0.5440910...
0.8237184
0
Returns true if a particular concern exists
def exists? concern mapper.instance_variable_get('@concerns').include?(concern) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register?(curation_concern)\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"curation_concern=#{curation_concern.id}\",\n ...
[ "0.70485693", "0.6434445", "0.6415208", "0.6409155", "0.63483673", "0.6341407", "0.6309783", "0.6258535", "0.62329644", "0.6208513", "0.61902153", "0.61816335", "0.61488104", "0.61488104", "0.6148396", "0.61426073", "0.609767", "0.60826993", "0.6078935", "0.6068534", "0.60672...
0.84185463
0
Update the `:last_accessed_at` to current time.
def update_limitable_access_at(token_or_object) record = extract_object_from_options(token_or_object) record.last_accessed_at = Time.current record.save(validate: false) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_last_activity_at\n current_user.last_activity_at = Time.zone.now if current_user\n end", "def touch\n @last_access_time = @@access_time_sequence\n @@access_time_sequence += 1\n end", "def access!\n today = Time.now\n if last_access.nil? || last_access < today\n...
[ "0.7388707", "0.6967271", "0.69560385", "0.681438", "0.67254746", "0.6642778", "0.66007364", "0.6571303", "0.6568112", "0.6568112", "0.6568112", "0.6568112", "0.65566546", "0.65069973", "0.6478962", "0.6476362", "0.64331293", "0.64331293", "0.6421007", "0.6396269", "0.6396269...
0.71818066
1
Expire session matching the +token_or_object+.
def expire_session_limit(token_or_object) object = extract_object_from_options(token_or_object) object && session_limitable_adapter.destroy(object) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expire!\n token = nil\n save!\n end", "def invalidate_session\n @sequence = 0\n @session_id = nil\n end", "def end_session\n self.update_attributes(session_expires_in: Time.now)\n end", "def logout!(options = {})\n session[:session_token] = session[:active_at] = nil\n end", ...
[ "0.6366113", "0.634913", "0.6299228", "0.6176928", "0.61189204", "0.59891504", "0.5950706", "0.59456265", "0.59401256", "0.5930891", "0.5928277", "0.59167", "0.58880484", "0.58853513", "0.5880049", "0.58356476", "0.58177674", "0.57804483", "0.5754164", "0.5742323", "0.5733262...
0.78240633
0
POST /work_orders or /work_orders.json
def create @work_order = WorkOrder.new(work_order_params) respond_to do |format| if @work_order.save format.html { redirect_to @work_order, notice: "Work order was successfully created." } format.json { render :show, status: :created, location: @work_order } else format.html...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @work_order = WorkOrder.new(work_order_params)\n\n respond_to do |format|\n if @work_order.save\n format.html { redirect_to @work_order, notice: 'Work order was successfully created.' }\n format.json { render :show, status: :created, location: @work_order }\n else\n ...
[ "0.7093797", "0.70524096", "0.69922006", "0.6932895", "0.66960317", "0.6581095", "0.65136456", "0.6477542", "0.63537896", "0.6351503", "0.63468224", "0.627304", "0.6240671", "0.6225582", "0.6166329", "0.6153152", "0.6151447", "0.61240906", "0.6116668", "0.60931695", "0.606656...
0.7104326
0
PATCH/PUT /work_orders/1 or /work_orders/1.json
def update respond_to do |format| if @work_order.update(work_order_params) format.html { redirect_to @work_order, notice: "Work order was successfully updated." } format.json { render :show, status: :ok, location: @work_order } else format.html { render :edit, status: :unprocessa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @work_order.update(work_order_params)\n format.html { redirect_to \"/\", notice: 'Work order was successfully updated.' }\n format.json { render :show, status: :ok, location: @work_order }\n else\n format.html { render :edit }\n form...
[ "0.74276525", "0.7385749", "0.73043853", "0.7267081", "0.7245943", "0.71147776", "0.69847083", "0.6865372", "0.6825763", "0.67332447", "0.666819", "0.6662556", "0.663212", "0.66103715", "0.6608452", "0.6556171", "0.65483063", "0.65383714", "0.6523433", "0.65123105", "0.649043...
0.7395378
1
Unloads the given classes from CLI::UI, reloads them and stubs the OS to the given one. This is used to run tests on classes with variables that depend on the OS (e.g. Glyph), so that we can mock their state in the context of this block.
def with_os_mock_and_reload(os, class_names = [], files = []) class_names = Array(class_names) files = Array(files) CLI::UI::OS.stubs(:current).returns(os) class_names.each { |classname| CLI::UI.send(:remove_const, classname) } files.each { |file| load(file) } yield ensure CLI::UI::OS.unstub(:current) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reload_classes\n klasses = [:Inject]\n\n # unload classes\n Object.class_eval do\n klasses.each do |klass|\n remove_const klass.to_s if const_defined? klass.to_s\n end\n end\n\n # reload classes\n klasses.each do |klass|\n load \"#{klass.to_s.underscore}.rb\"\n end\n ...
[ "0.62564576", "0.56486017", "0.54004097", "0.53735065", "0.53324556", "0.5285842", "0.5255584", "0.52352035", "0.5221185", "0.5196356", "0.5176559", "0.513618", "0.513618", "0.50943863", "0.50763613", "0.5030562", "0.5027552", "0.5027265", "0.4968354", "0.49631885", "0.494205...
0.7662515
0
GET /item_rankings GET /item_rankings.json
def index @item_rankings = ItemRanking.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ranking(opts={})\r\n Rakuten::Request.get(\"https://app.rakuten.co.jp/services/api/IchibaItem/Ranking/20120927\", Rakuten::Api.merge(opts))\r\n end", "def get_event_rankings ( event_key )\n get_api_resource \"#{@@api_base_url}event/#{event_key}/rankings\"\n end", "def set_item_ranking\n...
[ "0.72139746", "0.6896911", "0.6643657", "0.659491", "0.64716196", "0.6453341", "0.6373512", "0.63703084", "0.63243186", "0.632234", "0.62185717", "0.6214583", "0.6207837", "0.62075925", "0.620475", "0.6160642", "0.6150194", "0.6080413", "0.6069298", "0.6030084", "0.6011758", ...
0.77147114
0
POST /item_rankings POST /item_rankings.json
def create @item_ranking = ItemRanking.new(item_ranking_params) respond_to do |format| if @item_ranking.save format.html { redirect_to @item_ranking, notice: 'Item ranking was successfully created.' } format.json { render :show, status: :created, location: @item_ranking } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @item_rankings = ItemRanking.all\n end", "def item_ranking_params\n params.require(:item_ranking).permit(:rate, :item_id)\n end", "def set_item_ranking\n @item_ranking = ItemRanking.find(params[:id])\n end", "def post_search_rankings(date, expires_in: 1.minute)\n request(\"...
[ "0.68096066", "0.6789939", "0.6666405", "0.6439185", "0.63918465", "0.62733364", "0.6188241", "0.61412334", "0.6078728", "0.6003345", "0.5916057", "0.59083617", "0.58862156", "0.5881707", "0.58772343", "0.58504343", "0.5837703", "0.58015203", "0.5788694", "0.5786926", "0.5782...
0.6901273
0
PATCH/PUT /item_rankings/1 PATCH/PUT /item_rankings/1.json
def update respond_to do |format| if @item_ranking.update(item_ranking_params) format.html { redirect_to @item_ranking, notice: 'Item ranking was successfully updated.' } format.json { render :show, status: :ok, location: @item_ranking } else format.html { render :edit } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @item = Item.find(params[:id])\n if params[:item][:index]\n index = params[:item][:index]\n params[:item].delete :index\n @item.update_attribute :ranked_position, index\n end \n\n respond_to do |format|\n if @item.update_attributes(params[:item].slice(*Item.accessibl...
[ "0.68599015", "0.66274136", "0.6508496", "0.6340348", "0.63239443", "0.62848413", "0.62710446", "0.62439257", "0.61559725", "0.6145884", "0.60575366", "0.5971054", "0.5936134", "0.59322625", "0.59126186", "0.58988595", "0.58931506", "0.58705455", "0.58664817", "0.5864502", "0...
0.71110916
0
DELETE /item_rankings/1 DELETE /item_rankings/1.json
def destroy @item_ranking.destroy respond_to do |format| format.html { redirect_to item_rankings_url, notice: 'Item ranking was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @rank = Rank.find(params[:id])\n @rank.destroy\n\n respond_to do |format|\n format.html { redirect_to ranks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @rankings = Rankings.find(params[:id])\n @rankings.destroy\n\n respond_to do |format|\n ...
[ "0.68501824", "0.68422025", "0.6840022", "0.6770794", "0.67589015", "0.65938085", "0.6571634", "0.65698636", "0.6538403", "0.65367013", "0.6523786", "0.65098137", "0.6484703", "0.64690304", "0.64682484", "0.64209443", "0.6415747", "0.6407332", "0.6360723", "0.63552964", "0.63...
0.7505948
0
This allows us to support IE89 and their shimmed pseudoCORS support. This parses the post body as form data, even if the contenttype is text/plain or unknown. The issue is that IE89 will send POST data with an empty ContentType (see: Some Rails servers (Passenger) will treat this as nil, in which case Rack parses the p...
def parse_post_for_pseudo_ie_cors if(request.post? && request.POST.blank? && request.raw_post.present?) params.merge!(Rack::Utils.parse_nested_query(request.raw_post)) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_form_data(request, params, sep = '&')\n request.body = params.map {|k,v|\n if v.instance_of?(Array)\n v.map {|e| \"#{urlencode(k.to_s)}=#{urlencode(e.to_s)}\"}.join(sep)\n else\n \"#{urlencode(k.to_s)}=#{urlencode(v.to_s)}\"\n end\n }.join(sep)\n\n request.content_type = 'application/...
[ "0.60795456", "0.591431", "0.59020835", "0.58857805", "0.5850121", "0.5850121", "0.5850121", "0.5850121", "0.5832998", "0.57904124", "0.56843203", "0.5557801", "0.55250865", "0.55151635", "0.5480747", "0.54667395", "0.5453187", "0.5440593", "0.54059327", "0.5365653", "0.53323...
0.6961951
0
def index ar_friendships = current_user.friendships.where(status: 'accepted') friendships = ar_friendships.map do |ar_friend| friend = User.find( ar_friend.friend_id ) data = ar_friend.as_json data['friend_name'] = friend.username data end render json: friendships end
def index @user = current_user render json: @user.friends end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @friendships = @user.friendships\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @friendships }\n end\n end", "def show_list_by_user_id\n @id = current_user.id\n @userfriendships = User.find(@id).friends\n if @userfriendships.empty?\...
[ "0.8320625", "0.8054562", "0.8018408", "0.7982256", "0.78971964", "0.78971964", "0.7773522", "0.7728358", "0.76968557", "0.7679429", "0.7648935", "0.76224095", "0.7606261", "0.75727224", "0.7572466", "0.7570316", "0.74314004", "0.73649013", "0.73437345", "0.73317647", "0.7323...
0.8178186
1
3. Create a method to see if a particular item (string) is in the zombie_apocalypse_supplies. Do not use any special builtin methods. For instance: are boots in your list of supplies?
def in_supplies?(string, supplies) supplies.each do |item| return true if item == string end false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_item(string)\n zombie_apocalypse_supplies = [\"hatchet\", \"rations\", \"water jug\", \"binoculars\",\n \"shotgun\", \"compass\", \"CB radio\", \"batteries\"]\n\n i = 0\n is_supply = false\n\n while i < zombie_apocalypse_supplies.length\n if zombie_apocalypse_supplies[...
[ "0.76571524", "0.74470526", "0.7132986", "0.6896234", "0.67134064", "0.6694458", "0.6544314", "0.64940953", "0.64900964", "0.6433929", "0.64124745", "0.6289699", "0.62678015", "0.6266765", "0.6216749", "0.616886", "0.6168236", "0.6148342", "0.6142186", "0.6125588", "0.6082959...
0.76505107
1
4. You've heard that the following animals might be extinct, but you're not sure. Check if they're included in extinct_animals, one by one: "Andean Cat" "Dodo" "Saiga Antelope" Do not use any special builtin methods.
def check_extinct(animal, extinct_list) if extinct_list[animal] puts "#{animal} is extinct" else puts "#{animal} is not extinct" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_extinct_animal(animal)\n extinct_animals = {\n \"Tasmanian Tiger\" => 1936,\n \"Eastern Hare Wallaby\" => 1890,\n \"Dodo\" => 1662,\n \"Pyrenean Ibex\" => 2000,\n \"Passenger Pigeon\" => 1914,\n \"West African Black Rhinoceros\" => 2011,\n \"Laysan Crake\" => 1923\n }\n in_list = false\n extinct_...
[ "0.7414375", "0.6663922", "0.66616917", "0.64059746", "0.63151616", "0.62521374", "0.622866", "0.6140318", "0.61202025", "0.61101234", "0.61020046", "0.60617363", "0.6060068", "0.60401064", "0.6006544", "0.5924958", "0.588766", "0.58550495", "0.579571", "0.57668453", "0.57620...
0.7974839
0
Colorize the time in red if the bus leaves in 10 or less minutes
def departure_time text = @transit_details['departure_time']['text'] if @transit_details['departure_time']['value'].to_i - Time.now.to_i <= 600 text.colorize(:red) else text end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_for_new_paint(new_color)\n @color = new_color\n ahh_fresh_paint\nend", "def initialize(time)\n super(label:\"%02dh %02dm %02ds\" % [time.hour, time.min, time.sec])\n @font=\"Arial\"\n @color=\"black\"\n @weight=\"normal\"\n @style=\"normal\"\n\t\tscreen=Gdk::Screen.default\n\t\tsetBackg...
[ "0.61671656", "0.6088907", "0.5885887", "0.58775216", "0.58315504", "0.5822127", "0.57659763", "0.5724839", "0.5550674", "0.5488168", "0.5486996", "0.5486386", "0.5472931", "0.5450368", "0.54492867", "0.5436585", "0.54300857", "0.5406273", "0.53764814", "0.53722453", "0.53641...
0.7377865
0
Duplicate underlying table when OpenStruct is duplicated or cloned.
def initialize_copy(original) super @table = @table.dup end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_copy(orig)\n super\n @__table__ = @__table__.dup\n end", "def initialize_copy(orig)\n super\n @table = @table.dup\n end", "def _clone(*_)\n new_inst = _klass_new(_fn_name, *_fn_args)\n new_inst._data.replace(__hashish[\n @table.map { |_key, _value|\n if _k...
[ "0.68593657", "0.68032324", "0.6569473", "0.65506077", "0.6459358", "0.63797605", "0.6345265", "0.61102915", "0.6106479", "0.6084783", "0.60298187", "0.5973599", "0.5961", "0.5950045", "0.591033", "0.589985", "0.5897402", "0.5868126", "0.5867543", "0.58612686", "0.58525324", ...
0.6831622
1
format = '"Text with yyyy/mm/dd"yyyy[aa.bb][cc.dd.ee][ff]mmdd"Text with [aa.bb]"[]' format_parts(format) => [ '"Text with yyyy/mm/dd"', 'yyyy', '[aa.bb]', '[cc.dd.ee][ff]mmdd', '"Text with [aa.bb]"', '[', '', ']' ]
def format_parts(format) # Separate format to array formats = [] split_formats = format.split(/"/) split_formats.each_with_index do |sf, i| sf = %("#{sf}") if i % 2 == 1 formats << sf end formats.collect! do |f| if f =~ /"/ f ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_format(path)\n # format appears after the last period.\n remainder, dot, format = path.rpartition('.')\n return [path, ''] if dot.empty?\n return [remainder, format]\n end", "def split(parts); end", "def _process_format(format); end", "def _process_format(format); end", "de...
[ "0.67150545", "0.60502195", "0.5724073", "0.5724073", "0.5637958", "0.5620289", "0.5610066", "0.55777824", "0.55194247", "0.55191123", "0.5513906", "0.55050284", "0.54896235", "0.54811573", "0.5458997", "0.5433693", "0.54069597", "0.536396", "0.53546613", "0.5336816", "0.5324...
0.794051
0
CustomFields::AutoNumbering.increase(Integer) > String Get the next string CustomFields::AutoNumbering.increase(custom_field_id) => 10Text15120143
def increase(custom_field_id, cells) ActiveRecord::Base.transaction do custom_field = CustomFields::AutoNumbering.find(custom_field_id) if self.unset_cells(custom_field, cells).empty? value = format_value(custom_field, cells) key_hash = AutoNumberRunning.k...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def up_number\n unless number\n if Invoice.count == 0\n self.number = '001'\n else\n last_invoice = Invoice.order(:number).last\n self.number = last_invoice.number.succ\n end\n end\n end", "def custom_attribute_field_id\n @ca_field_id ||= 0\n @ca_field_id += 1\n\n...
[ "0.6313153", "0.626972", "0.6189276", "0.61273783", "0.60978633", "0.60512966", "0.6033119", "0.6012774", "0.5972744", "0.5963771", "0.5963771", "0.5963771", "0.5956725", "0.59532183", "0.5952783", "0.595243", "0.59191203", "0.5902649", "0.5855905", "0.58193666", "0.5815659",...
0.73044413
0
custom_field.format_key > string Get format key custom_field.format_key => "yymmdd"
def format_key formats = CustomFields::AutoNumbering.format_parts(self.format) formats.select{|f| (f =~ /("|#)/).nil? }.join('-') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def key_format(field)\n @formatted_key[field] ||= JSONAPI.configuration\n .key_formatter\n .format(resource_key_for(field))\n .to_sym\n end", "def format(value, key = nil, model = nil)\n if !key.nil?\n if key.to_s.ends_with?('_at')\n l(value.to_date...
[ "0.6988146", "0.6979394", "0.6971839", "0.6855248", "0.6465034", "0.64554995", "0.62444687", "0.61550605", "0.61434186", "0.6141597", "0.61248356", "0.6122676", "0.5986273", "0.59589183", "0.59386146", "0.5897729", "0.5897417", "0.58601105", "0.5854681", "0.5850038", "0.58435...
0.76499903
0
cutom_field.reference_custom_field_ids > an array Get reference custom field ids custom_field.reference_custom_field_ids => [10,11,12,13]
def reference_custom_field_ids self[:value] ||= {} self[:value][:custom_field_ids] ||= [] @custom_field_ids ||= self[:value][:custom_field_ids].collect{|cf_id| cf_id.to_i if CustomField.exists?(cf_id) }.compact end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reference_custom_fields\n reference_custom_field_ids.collect{|cf_id| CustomFields::Reference.find(cf_id) }\n end", "def custom_fields\n field_values = @client.account_details.custom_field_values\n\n fields = []\n\n 3.times do |i|\n n = i+1\n\n if send(:\"field#{n}_value_i...
[ "0.82706416", "0.62558174", "0.6199382", "0.60171694", "0.6004322", "0.59667856", "0.59193647", "0.5727874", "0.5708435", "0.56372553", "0.55993074", "0.55993074", "0.5564795", "0.555203", "0.5534277", "0.55329764", "0.552238", "0.5492505", "0.54437894", "0.5438593", "0.54049...
0.8533863
0
cutom_field.reference_custom_fields > an array Get reference custom fields custom_field.reference_custom_fields => [CustomFields::Reference,CustomFields::Reference,CustomFields::Reference,CustomFields::Reference]
def reference_custom_fields reference_custom_field_ids.collect{|cf_id| CustomFields::Reference.find(cf_id) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reference_custom_field_ids\n self[:value] ||= {}\n self[:value][:custom_field_ids] ||= []\n \n @custom_field_ids ||= self[:value][:custom_field_ids].collect{|cf_id| cf_id.to_i if CustomField.exists?(cf_id) }.compact\n end", "def custom_fields\n field_values = @client.account_detai...
[ "0.7628164", "0.6554916", "0.6377768", "0.63773763", "0.6209855", "0.6170273", "0.61499184", "0.61368376", "0.6105796", "0.6061481", "0.60173017", "0.5999315", "0.58081925", "0.5783502", "0.5762397", "0.5715312", "0.5715312", "0.56559294", "0.5623446", "0.5610104", "0.5526577...
0.8362868
0
Consultor del titulo, devuelve nil ya que solo las calles tienen titulo
def titulo return nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def asignar_titulo_propiedad()\n \n end", "def titulo_guia\n titulo = []\n\n t = Especie.find(params[:especie_id])\n a = t.adicional\n\n tipo_region = params[:tipo_region] == \"anp\" ? \"ANP \" : \"Municipio de \"\n \n if a.nombre_comun_principal.present?\n titulo[0] = \"Guía...
[ "0.6372878", "0.6333957", "0.6325835", "0.6239822", "0.60625803", "0.6023917", "0.60175425", "0.5932207", "0.5886024", "0.585017", "0.582606", "0.5805335", "0.57674766", "0.5748658", "0.5712684", "0.56854683", "0.5675048", "0.5662179", "0.56564146", "0.5652772", "0.56351566",...
0.7745368
1
GET /draft_investments/1 GET /draft_investments/1.xml
def show @draft_investment = DraftInvestment.find(params[:id]) respond_to do |format| format.xml { render :xml => @draft_investment } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @draft_investment = DraftInvestment.new\n\n respond_to do |format|\n\n format.xml { render :xml => @draft_investment }\n end\n end", "def show\n @invest = Invest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @in...
[ "0.7332301", "0.7167561", "0.6709937", "0.6649071", "0.6569686", "0.65380096", "0.6527645", "0.6504869", "0.6488592", "0.64177066", "0.6391856", "0.6375843", "0.6279832", "0.62487864", "0.62323475", "0.6164607", "0.6135705", "0.61334616", "0.6111598", "0.6111598", "0.6111598"...
0.7968183
0
GET /draft_investments/new GET /draft_investments/new.xml
def new @draft_investment = DraftInvestment.new respond_to do |format| format.xml { render :xml => @draft_investment } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @fixed_deposit = FixedDeposit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @fixed_deposit }\n end\n end", "def new\n @invest = Invest.new\n @invest.seq = get_next_seq(Invest)\n respond_to do |format|\n format.html # new.htm...
[ "0.72021484", "0.7185856", "0.71423906", "0.70694804", "0.7049854", "0.70109576", "0.69804657", "0.6924873", "0.6898461", "0.68829817", "0.68815154", "0.68684196", "0.6858502", "0.6840151", "0.6827573", "0.6824441", "0.6824441", "0.6798169", "0.67973655", "0.6790792", "0.6790...
0.81029046
0
PUT /draft_investments/1 PUT /draft_investments/1.xml
def update @draft_investment = DraftInvestment.find(params[:id]) respond_to do |format| if @draft_investment.update_attributes(params[:investment]) format.xml else format.xml { render :xml => @draft_investment.errors, :status => :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @invest = Invest.find(params[:id])\n\n respond_to do |format|\n if @invest.update_attributes(params[:invest])\n format.html { redirect_to(@invest, :notice => 'Invest was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \...
[ "0.7177903", "0.68185717", "0.67332476", "0.6634273", "0.6590446", "0.6556295", "0.65534264", "0.65534264", "0.65513444", "0.6547284", "0.6453545", "0.6422345", "0.63840234", "0.6367753", "0.6352475", "0.6352475", "0.634028", "0.633478", "0.6331328", "0.6317676", "0.63150215"...
0.7863944
0
DELETE /draft_investments/1 DELETE /draft_investments/1.xml
def destroy @draft_investment = DraftInvestment.find(params[:id]) @draft_investment.destroy respond_to do |format| format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @invest = Invest.find(params[:id])\n @invest.destroy\n\n respond_to do |format|\n format.html { redirect_to(invests_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @investigation = Investigation.find(params[:id])\n @investigation.destroy\n\n respond_to...
[ "0.7325162", "0.6885616", "0.68521565", "0.68063796", "0.6720497", "0.66675067", "0.6581549", "0.657877", "0.657877", "0.6574228", "0.655173", "0.6549124", "0.6544644", "0.6521697", "0.6502779", "0.6489537", "0.6445264", "0.6442577", "0.643813", "0.64325726", "0.6432013", "...
0.79728395
0
GET /relatives GET /relatives.json
def index @relatives = Relative.includes(:organizations, :representative) .group_by { |relative| relative.representative } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path(*args)\n return call_ancestry_method(:path) if use_ancestry?\n\n Relationship.resources(path_rels(*args)) # TODO: Prevent preload of self which is in the list\n end", "def add_relatives(relatives,min_distance,max_distance,relationship)\n min_distance.upto(max_distance) do |distance|\n ...
[ "0.59531796", "0.5941671", "0.57423955", "0.56898934", "0.5578644", "0.55052364", "0.5496592", "0.5490209", "0.5455474", "0.54151464", "0.5390504", "0.53170204", "0.5308653", "0.52572894", "0.52275693", "0.52261436", "0.52238655", "0.51975673", "0.51880985", "0.5168235", "0.5...
0.6495635
0
DELETE /relatives/1 DELETE /relatives/1.json
def destroy @relative.destroy respond_to do |format| format.html { redirect_to [:admin, :relatives], notice: 'Relative was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @relatory.destroy\n respond_to do |format|\n format.html { redirect_to relatories_url, notice: 'Relatório deletado.' }\n format.json { head :no_content }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def ...
[ "0.6867178", "0.6731767", "0.6679621", "0.66419244", "0.6641555", "0.6560886", "0.6531206", "0.65192753", "0.65192753", "0.64699703", "0.64286506", "0.6426314", "0.64173937", "0.64156896", "0.64134645", "0.64024055", "0.63852704", "0.63792837", "0.6366503", "0.6362228", "0.63...
0.7204016
0
Generates a Ruby Hash containing a configuration compatible with ExtJS Buttonwidget definition, to be used inside an items list of a panel container. Works similarly to ApplicationHelper::create_extjs_button_config, but instead of returning a parsable Javascript string, the result is a plain Ruby Hash. == Params: actio...
def create_button_config( action_title_i19n_sym, action_title_i19n_scope_sym, image_name = "cog.png" ) action_text = I18n.t( action_title_i19n_sym.to_sym, {:scope => [action_title_i19n_scope_sym ? action_title_i19n_scope_sym.to_sym : nil]} ) tooltip_text = I18n.t( "#{action_title_i19n_sym}_tooltip".to_sym, {:s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def integrated_slat_action_button_component_options\n { theme: (theme || :secondary),\n traits: traits,\n as: :a,\n confirm: confirm,\n disable_with: disable_with,\n href: href,\n method: send(:method),\n remote: ...
[ "0.5712615", "0.5438926", "0.53248334", "0.5288526", "0.5206415", "0.5156668", "0.50238985", "0.49551955", "0.49250045", "0.49193814", "0.49146566", "0.48829538", "0.48395914", "0.48334154", "0.48087484", "0.480182", "0.4778795", "0.47403705", "0.4709297", "0.46431372", "0.46...
0.8323124
0
The method should mutate the given array by replacing elements with their corresponding values in the hash. The method should return the given array. Note: this method must MUTATE the input array. This means that the object_id of the input array should be identical to the object_id of the returned array. The exact obje...
def ele_replace!(array, hash) array.map! do |ele| #go through the array if hash.has_key?(ele) #hash contains a key thats also in the array arr = [4,2,0,2] vs hash = {2=>two, 0 => zero} hash[ele] #convert array values with corresponding hash values -> [ ... ,two,zero,two] else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def element_replace(array, hash)\n new_array = []\n\n array.each do |ele|\n if hash.keys.include?(ele)\n new_array << hash[ele]\n else\n new_array << ele\n end\n end\n\n new_array\nend", "def mutate(arr)\n arr.uniq!\nend", "def element_replace(arr, hash)\n new_arr = []\n\n arr.each ...
[ "0.653968", "0.63620627", "0.63458717", "0.60115594", "0.6002978", "0.5959449", "0.5938209", "0.58660126", "0.5831873", "0.58262515", "0.5797022", "0.57001776", "0.56677926", "0.56462127", "0.56319356", "0.56319356", "0.56319356", "0.56248444", "0.5600751", "0.5587469", "0.55...
0.64846176
1
return if idx2 >= arr.size block.call(arr[idx1], arr[idx2]) each_cons(arr, idx1 + 1, idx2 + 1, &block) end
def each_cons(arr, &block) arr.size < 2 ? return : block.call(arr[0, 2]) each_cons(arr.drop(1), &block) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def each_cons(arr)\n first = 0\n second = 1\n loop do\n break if second >= arr.size\n yield(arr[first], arr[second])\n first += 1\n second += 1\n end\n nil\nend", "def each_cons(array)\n index1 = 0\n index2 = 1\n while index1 < array.size\n yield(index1, index2)\n index1 += 2\n index...
[ "0.7513829", "0.744859", "0.7363853", "0.7146757", "0.7092168", "0.70180184", "0.68389475", "0.66824883", "0.6497901", "0.64506173", "0.6392409", "0.6355082", "0.63120294", "0.62711823", "0.62602246", "0.6240947", "0.62398815", "0.6193741", "0.6148433", "0.61179006", "0.60856...
0.78848267
0
keep only those values in a hash that the particular model can hold
def remove_extras(hash, model) hash.reject do |key,value| # puts !(model.column_names.include?(key.to_s)) !(model.column_names.include?(key.to_s)) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanse\n select { |_k, v| v }\n end", "def trim_params(params)\n Hash[*(params.select { |k,v| new.attributes.keys.include? k.to_s}.flatten)] \n end", "def clean_unwanted_keys(hash)\r\n ignored_keys = [:only_path, :use_route]\r\n hash.dup.delete_if{|key,value| ignored_keys.inc...
[ "0.65138555", "0.6250353", "0.6091582", "0.60621876", "0.6036989", "0.6012394", "0.5995255", "0.5985245", "0.5964224", "0.59614027", "0.5920211", "0.591813", "0.59164935", "0.59141177", "0.5912165", "0.5894061", "0.5875437", "0.5849526", "0.58455145", "0.58175856", "0.5817585...
0.69985276
0
checks if a stream contains the same values as a row
def same_stream(row,stream) stream && row['raw_ip_incoming'] == stream.raw_ip_incoming && row['raw_ip_outgoing'] == stream.raw_ip_outgoing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def victory_row?(row_values)\n unique_values = row_values.uniq\n one_unique_value?(unique_values)\nend", "def compare_by_row_vectors(rows)\n my_rows = @rows\n sz = my_rows.size \n return false unless sz == rows.size\n \n for i in 0..sz-1 do\n return false unless my_rows[i] == rows[i]\n e...
[ "0.6977281", "0.6673285", "0.64837277", "0.6466026", "0.6462633", "0.6322916", "0.62861496", "0.6259263", "0.6230632", "0.61884433", "0.61884433", "0.61713946", "0.61272645", "0.61162", "0.60725456", "0.606138", "0.6039915", "0.60231626", "0.59984165", "0.5993717", "0.5983723...
0.7295439
0
GET /portfolio_sections or /portfolio_sections.json
def index @portfolio_sections = PortfolioSection.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @sections = params[:path].nil? ? Section.all : Section.where(path: params[:path])\n\n respond_to do |format|\n format.html { render html: @sections }\n format.json { render json: @sections }\n end\n end", "def index\n @sections = Section.all\n\n respond_to do |format|\n ...
[ "0.7078329", "0.6507914", "0.6155657", "0.6155657", "0.6141313", "0.61217445", "0.60782117", "0.6019916", "0.59749746", "0.59729964", "0.59427726", "0.5920429", "0.59004426", "0.58665156", "0.5824857", "0.5822177", "0.57960844", "0.57933074", "0.57933074", "0.57933074", "0.57...
0.6794938
1
POST /portfolio_sections or /portfolio_sections.json
def create @portfolio_section = PortfolioSection.new(portfolio_section_params) respond_to do |format| if @portfolio_section.save format.html { redirect_to @portfolio_section, notice: "Portfolio section was successfully created." } format.json { render :show, status: :created, location: @p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def portfolio_section_params\n params.require(:portfolio_section).permit(:section_id, :description)\n end", "def update\n respond_to do |format|\n if @portfolio_section.update(portfolio_section_params)\n format.html { redirect_to @portfolio_section, notice: \"Portfolio section was successf...
[ "0.60431874", "0.5990474", "0.5899722", "0.57596093", "0.5750639", "0.5725831", "0.57105815", "0.56725", "0.56526077", "0.5643183", "0.56402206", "0.5634459", "0.5610074", "0.5608394", "0.5567733", "0.55623496", "0.5501148", "0.54992104", "0.5463102", "0.5457635", "0.5453343"...
0.67352015
0
PATCH/PUT /portfolio_sections/1 or /portfolio_sections/1.json
def update respond_to do |format| if @portfolio_section.update(portfolio_section_params) format.html { redirect_to @portfolio_section, notice: "Portfolio section was successfully updated." } format.json { render :show, status: :ok, location: @portfolio_section } else format.html ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @portfolio.update(portfolio_params)\n format.html { redirect_to portfolios_path, notice: 'Portfolio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render...
[ "0.6760475", "0.6745794", "0.6541424", "0.65223616", "0.6522224", "0.6475697", "0.647009", "0.6319075", "0.6313279", "0.6299481", "0.6241893", "0.6223241", "0.6188944", "0.6185844", "0.6148391", "0.6128615", "0.6113522", "0.61014324", "0.60972816", "0.6095056", "0.6086648", ...
0.75231564
0
DELETE /portfolio_sections/1 or /portfolio_sections/1.json
def destroy @portfolio_section.destroy respond_to do |format| format.html { redirect_to portfolio_sections_url, notice: "Portfolio section was successfully destroyed." } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @portfolio.destroy\n respond_to do |format|\n format.html { redirect_to portfolios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @section.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n ...
[ "0.7024811", "0.68701804", "0.68602204", "0.68602204", "0.68563086", "0.6772851", "0.6762478", "0.6718766", "0.6718766", "0.6718766", "0.6718766", "0.67173123", "0.6711294", "0.6711294", "0.6698228", "0.6698228", "0.66063607", "0.6601907", "0.65477306", "0.65272635", "0.65224...
0.7480284
0
Provides for mapping model attributes to attributes of the returned amazonecs result object. An optional parameter allows for certain attributes which may occur multiple times (eg. the authors of a book) to be returned as a single string joined with a provided parameter eg. maps_to_amazon_attribute :authorlist => 'auth...
def maps_to_amazon_attribute(args = {}) if @amazon_mappings.nil? @amazon_mappings = Hash.new @amazon_join_mappings = Hash.new end joiner = args.delete(:combine) if args[:combine] args.each do |key, value| if joiner @amazon_join_mappings[key] = [...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attributor(attributes)\n inject_s(attributes) {|key, value| \" #{key.to_s}=\\\"#{value.to_s}\\\"\"}\n end", "def attribute(*args)\n if args.first.is_a?(Hash)\n args.first.each_pair { |k,v| self.attribute(k, :as => v) }\n else # array of attributes\n options = args.extract_opti...
[ "0.58226246", "0.57816154", "0.5633592", "0.5604154", "0.55828434", "0.554471", "0.5435935", "0.5433353", "0.5425095", "0.53514314", "0.53451556", "0.5337609", "0.5330308", "0.5328944", "0.530573", "0.5286945", "0.5262937", "0.52565056", "0.52436113", "0.5238925", "0.523477",...
0.6848314
0
Model.load_from_amazon!(asin_value, dev_key, associates_id) will load the model from an amazon result (or return empty if the product couldn't be found) and call the save method on the model object.
def load_from_amazon!(asin_value, dev_key = '1MZTQGBA4YWAFHSTG4R2', associates_id = 'thirddayweb-20') result = self.load_from_amazon(asin_value, dev_key, associates_id) if result result.save return result end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_to_spree\n ::Product.save_from_amazon({\n :attributes =>{\n :amazon_id => self.id,\n :sku => self.id,\n :name => self.name,...
[ "0.62749094", "0.6029529", "0.55829054", "0.5578833", "0.54520476", "0.54130673", "0.5380609", "0.5309279", "0.52557606", "0.51518077", "0.5074921", "0.50407237", "0.5018755", "0.5006323", "0.5001743", "0.49675694", "0.49513745", "0.4931584", "0.49025086", "0.48906144", "0.48...
0.8468291
0
GET /holiday_exceptions GET /holiday_exceptions.json
def index @holiday_exceptions = HolidayException.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calendar_exceptions\n get '/gtfs/calendarDate'\n end", "def calendar_service_exceptions(service_id)\n get \"/gtfs/calendarDate/serviceId/#{service_id}\"\n end", "def handle_response(response)\n case response.code.to_i\n when 200\n JSON.parse(response.body)['holidays']\n ...
[ "0.755907", "0.6884884", "0.64303064", "0.6386149", "0.6309451", "0.6216709", "0.61845356", "0.6161303", "0.60819626", "0.60589796", "0.59875226", "0.5916819", "0.5898217", "0.5874412", "0.5815764", "0.5810869", "0.5794554", "0.5761122", "0.5714819", "0.5707645", "0.57006437"...
0.76140076
0
PATCH/PUT /holiday_exceptions/1 PATCH/PUT /holiday_exceptions/1.json
def update respond_to do |format| begin status = @holiday_exception.update(holiday_exception_params) rescue => e status = false customer_holiday_ids = CustomersHoliday.where(customer_id: @holiday_exception.customer_id).pluck(:holiday_id) @holidays = Holiday.where(global:tru...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @extra_holiday.update(extra_holiday_params)\n format.html { redirect_to @extra_holiday, notice: 'Extra holiday was successfully updated.' }\n format.json { render :show, status: :ok, location: @extra_holiday }\n else\n format.html { render ...
[ "0.66124696", "0.6513476", "0.6476268", "0.63946867", "0.6384276", "0.6287663", "0.6247102", "0.61614746", "0.6155098", "0.6103232", "0.6100695", "0.60963273", "0.6084834", "0.6074538", "0.58965045", "0.5814902", "0.58013284", "0.57657105", "0.5750159", "0.5733447", "0.573297...
0.72125435
0
DELETE /holiday_exceptions/1 DELETE /holiday_exceptions/1.json
def destroy @holiday_exception.destroy respond_to do |format| format.html { redirect_to projects_url, notice: 'Holiday exception was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @holiday.destroy\n respond_to do |format|\n format.html { redirect_to holidays_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @extra_holiday.destroy\n respond_to do |format|\n format.html { redirect_to extra_holidays_url, notice: 'Extra holiday ...
[ "0.7002371", "0.68797535", "0.6859485", "0.6815075", "0.6803325", "0.67865103", "0.6731", "0.6698058", "0.6689843", "0.6626396", "0.66021675", "0.6595427", "0.6402482", "0.63887775", "0.6379769", "0.63430214", "0.63414776", "0.63273454", "0.6326809", "0.63128775", "0.6305207"...
0.7129668
0
Generate video for a slide by combining the image and audio
def video_gen(slide) term = slide['term'] kind = slide['kind'] index = slide['index'] audio = slide['audio'] image = slide['image'] raise "audio is required fof #{term}" unless audio raise "image is required fof #{term}" unless image file_name = file_name_gen(slide, ".mpg") audio = command_arg(slide['...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def combine_video(presentation)\n term = presentation['term']\n args = []\n for slide in presentation['slides']\n args.push command_arg(slide['video'])\n end\n args = args.join(' ')\n combined_arg = command_arg(\"#{BUILD_DIR}/#{term}/#{term}-combined.mpg\")\n final = \"#{DIST_DIR}/#{term}/#{term}.avi\"\n...
[ "0.6927799", "0.6225185", "0.6198179", "0.6175752", "0.61704004", "0.60580444", "0.6045214", "0.6028644", "0.5981926", "0.5957051", "0.5941192", "0.5835128", "0.58052325", "0.5803109", "0.5773791", "0.56421083", "0.5614227", "0.55597156", "0.5538567", "0.5537054", "0.5532856"...
0.78131044
0
Concatenate slide videos together into one video
def combine_video(presentation) term = presentation['term'] args = [] for slide in presentation['slides'] args.push command_arg(slide['video']) end args = args.join(' ') combined_arg = command_arg("#{BUILD_DIR}/#{term}/#{term}-combined.mpg") final = "#{DIST_DIR}/#{term}/#{term}.avi" final_arg = comm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mergeVideos()\n pathToIntermediates=\"#{$PATHTOGENERATEINTERMEDIATES}/#{@meetingData.meetingId}\"\n vidList=\"#{pathToIntermediates}/vidList.txt\"\n # Create a txt file with the lists of all videos to concatenate\n system \"echo >#{vidList}\"\n (0...@objects.length).each do |...
[ "0.73224336", "0.7141569", "0.6384308", "0.62886745", "0.60178113", "0.59477186", "0.5943647", "0.5934862", "0.5877982", "0.58245325", "0.57119554", "0.56690454", "0.5609804", "0.5609109", "0.5550787", "0.5529381", "0.55183834", "0.55170727", "0.55033576", "0.5500784", "0.545...
0.776836
0
Basecamp helper method returns an instance specific basecamp object if valid connection credentials exist. Otherwise, returns nil.
def basecamp return nil unless establish_connection! @basecamp ||= Basecamp.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def basecamp_connection\n return unless establish_connection!\n Basecamp.connection\n end", "def establish_connection!\n return if [app_path, username, password].select{|f| f.blank? }.length > 0\n Basecamp.establish_connection!(app_path, username, password, true) unless @connection_established\n ...
[ "0.7672671", "0.59911245", "0.5626143", "0.51805216", "0.517009", "0.5117425", "0.5108495", "0.5108495", "0.50839883", "0.5073246", "0.5069892", "0.5067903", "0.5064274", "0.5042828", "0.5038577", "0.5032745", "0.50205684", "0.49857393", "0.49834186", "0.4960603", "0.4952047"...
0.8374647
0
Returns a basecamp connection object. Ensures that a connection is established first, otherwise returns nil
def basecamp_connection return unless establish_connection! Basecamp.connection end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def basecamp\n return nil unless establish_connection!\n @basecamp ||= Basecamp.new\n end", "def connection\n @connection ||= make_connection\n end", "def connection\n @connection ||= build_connection\n end", "def connection\n raise ConnectionNotEstablished unless @@connection\n ...
[ "0.83089864", "0.6855643", "0.6799865", "0.6796116", "0.6792206", "0.67111826", "0.66553694", "0.6612947", "0.6587227", "0.6542022", "0.64816594", "0.64416236", "0.64188665", "0.63282216", "0.6296006", "0.62567365", "0.6251459", "0.61888725", "0.6172135", "0.6167632", "0.6153...
0.8500907
0
Returns a list of todos for the given account and project_id. TODO: Can we return a blank project id and get all todo lists for all objects???
def todos(project_id) return [] if project_id.blank? || !basecamp @todos[project_id] ||= Basecamp::TodoList.all(project_id, false) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lists(project_id, complete=nil)\n records \"todo-list\", \"/projects/#{project_id}/todos/lists\", :complete => complete\n end", "def get_items(projectid, todolistid)\n get(\"projects/#{projectid}/todolists/#{todolistid}.json\")\n end", "def get_all_withassigned(projectid)\n get(\"projects/#{proj...
[ "0.704227", "0.69164544", "0.6630713", "0.66013193", "0.6564256", "0.6552887", "0.65388757", "0.6512203", "0.62591076", "0.62354654", "0.6223964", "0.6217156", "0.6206288", "0.6192626", "0.618925", "0.61635625", "0.6134018", "0.6092453", "0.6082023", "0.6072686", "0.60657704"...
0.8015326
0
Create a new time entry for a todo item
def create_todo(fact, todo_id = nil) response = basecamp_connection.post("/todo_items/#{todo_id}/time_entries.xml", "<time-entry> <person-id>#{fact.activity.category.account.user_id}</person-id> <date>#{fact.start_time...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n\t\t@project = Project.find(get_stored_project_id)\n\t\t@time_entry = @project.time_entries.build(params[:time_entry])\n\t\tif @time_entry.save\n\t\t\tflash[:success] = \"New entry saved!\"\n\t\t\tredirect_to project_path(@project)\n\t\telse\n\t\t\trender project_path(@project)\n\t\tend\n\tend", "def...
[ "0.6905482", "0.67226046", "0.67226046", "0.67226046", "0.6716773", "0.65780985", "0.6569305", "0.6525802", "0.6366464", "0.6357043", "0.6357043", "0.6354616", "0.6339933", "0.6269349", "0.623345", "0.62332565", "0.6230968", "0.62197655", "0.6199245", "0.61868274", "0.6108667...
0.74935913
0
Destroy a time entry
def destroy_time_entry(time_entry_id) response = basecamp_connection.delete("/time_entries/#{time_entry_id}.xml") if response.code == '200' return true else return false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_time_entry(id)\n send(:delete, \"time_entries/#{id}\")\n end", "def destroy\n @time_slot.destroy\n end", "def destroy\n @timeslot.destroy\n end", "def destroy\n @time_entry = TimeEntry.find(params[:id])\n @time_entry.destroy\n\n respond_to do |format|\n format.htm...
[ "0.77992654", "0.7590809", "0.74623907", "0.7444488", "0.7444488", "0.7431935", "0.7351253", "0.72916806", "0.7277229", "0.6959602", "0.69578123", "0.69498515", "0.689085", "0.68891627", "0.6864954", "0.6813109", "0.6696011", "0.6674523", "0.6649583", "0.664586", "0.6645859",...
0.7660365
1
GET /icomes/1 GET /icomes/1.json
def show @icome = Icome.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @icome } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @experiment_biomechanical = ExperimentBiomechanical.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @experiment_biomechanical }\n end\n end", "def index\n @gets = Get.all\n\n respond_to do |format|\n format.html # i...
[ "0.63075227", "0.626157", "0.62382036", "0.6234618", "0.6215815", "0.6206675", "0.61918247", "0.6173541", "0.6132568", "0.6129017", "0.6121705", "0.6095726", "0.6084141", "0.60785836", "0.60707396", "0.6066736", "0.6065762", "0.60516524", "0.6047337", "0.60449815", "0.6039095...
0.7091643
0
GET /icomes/new GET /icomes/new.json
def new @icome = Icome.new respond_to do |format| format.html # new.html.erb format.json { render json: @icome } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @thing = Thing.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @thing }\n end\n end", "def new\n @interesting = Interesting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interest...
[ "0.7360428", "0.73581916", "0.73581624", "0.72970355", "0.7215863", "0.712866", "0.7015207", "0.7011244", "0.70019805", "0.6997052", "0.6980332", "0.6963859", "0.69465125", "0.69465125", "0.6940887", "0.6933443", "0.69254947", "0.6889972", "0.6880738", "0.68654084", "0.686118...
0.7676254
0
POST /icomes POST /icomes.json
def create @icome = Icome.new(params[:icome]) respond_to do |format| if @icome.save format.html { redirect_to @icome, notice: 'Icome was successfully created.' } format.json { render json: @icome, status: :created, location: @icome } else format.html { render action: "new" }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createCharities\n\tcharity_list = [\"Direct Relief\", \"Catholic Medical Mission Board\", \"MAP International\", \"United Nations Foundation\", \"The Rotary Foundation of Rotary International\", \"Samaritan's Purse\", \"Institute of International Education\", \"International Rescue Committee\", \"Compassion In...
[ "0.5795012", "0.5752791", "0.5645945", "0.55474675", "0.5447112", "0.5443642", "0.5397432", "0.5395905", "0.53814924", "0.53669167", "0.53457403", "0.53420395", "0.53363365", "0.53102446", "0.53069204", "0.5304057", "0.52766067", "0.52694386", "0.5268545", "0.52385765", "0.52...
0.65722305
0
PUT /icomes/1 PUT /icomes/1.json
def update @icome = Icome.find(params[:id]) respond_to do |format| if @icome.update_attributes(params[:icome]) format.html { redirect_to @icome, notice: 'Icome was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "def put(*args)\n request :put, *args\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def put(id, json)\n with_endpoint do |endpoint|\n url = [en...
[ "0.622978", "0.6066552", "0.60259026", "0.5992352", "0.5986322", "0.5944172", "0.5943403", "0.59099716", "0.5884617", "0.58782387", "0.58176047", "0.5701883", "0.56877875", "0.5642806", "0.5615466", "0.55889285", "0.5588622", "0.5584942", "0.558493", "0.55839026", "0.55822134...
0.64691037
0
DELETE /icomes/1 DELETE /icomes/1.json
def destroy @icome = Icome.find(params[:id]) @icome.destroy respond_to do |format| format.html { redirect_to icomes_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n client.delete(\"/#{id}\")\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def delete(path)\n RestClient.delete request_base+path\n end", "def destroy\n @anything.destroy\n respond_to do |format|\n format....
[ "0.71528244", "0.6851649", "0.68198633", "0.6779597", "0.67709005", "0.67559874", "0.6736724", "0.67078704", "0.6707748", "0.6697663", "0.66600794", "0.66600794", "0.66600794", "0.66600794", "0.66583514", "0.6635848", "0.6631323", "0.6629502", "0.6588127", "0.6585304", "0.655...
0.722648
0
Called from current_user. First attempt to login by the user id stored in the session.
def login_from_session self.current_user = User.find_by_id(session[:user_id]) if session[:user_id] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def login_from_session\n self.current_user = User.find(session[:user_id]) if session[:user_id]\n end", "def login_from_session\n self.current_user = User.find(session[:user_id]) if session[:user_id]\n end", "def login_from_session\n self.current_user = User.find_by_id( session[ :user_id ] ) ...
[ "0.84740376", "0.84740376", "0.8404325", "0.8352608", "0.8280006", "0.7980598", "0.78989327", "0.7846605", "0.7675138", "0.7612057", "0.7590172", "0.7568378", "0.75255775", "0.74937797", "0.74930966", "0.74859357", "0.74751997", "0.7442288", "0.73781353", "0.733913", "0.73246...
0.854995
0
POST /comments/watch?commentable_type=&commentable_id= DELETE /comments/watch?commentable_type=&commentable_id=
def watch klass = params[:commentable_type].constantize @commentable = klass.find(params[:commentable_id]) authorize! :read, @commentable if request.post? User.create_action(:watch_comment, target: @commentable, user: current_user, action_option: "watch") else User.create_action(:watch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @commentable = @comment.commentable\n @comment.destroy\n respond_to do |format|\n format.js\n end\n end", "def destroy\n if @commentable.comments.find(params[:id]).destroy\n render json: { success: true }\n end\n end", "def destroy\n @comment = @commentabl...
[ "0.65277755", "0.6377914", "0.63224655", "0.63129306", "0.61909795", "0.6085293", "0.60674876", "0.5994362", "0.589722", "0.5810435", "0.57966363", "0.5791599", "0.5781984", "0.5760412", "0.5753952", "0.57530266", "0.57439554", "0.5743916", "0.5708132", "0.5698728", "0.569828...
0.76093477
0
Retrieve latest gem metadata and contents from rubygems.org
def retrieve_latest(name) client.url = "https://rubygems.org/api/v1/gems/#{name}.json" client.http_get spec = client.body_str gem = parse spec gem end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_gem(name, version)\n http_get(host + \"/gems/#{name}-#{version}.gem\").body\n end", "def gem_info(gem, client)\n gem_data = {}\n uri = (\n Gems.info(gem)['source_code_uri'] || Gems.info(gem)['homepage_uri']).sub!(%r{http.*com/}, '')\n repo = repository(uri, client)\n contributo...
[ "0.6909436", "0.67987716", "0.6710202", "0.66781497", "0.6618561", "0.6537107", "0.6537107", "0.6492002", "0.6484249", "0.6458951", "0.6332161", "0.63310087", "0.632336", "0.6286475", "0.6163504", "0.6142461", "0.61202216", "0.6107243", "0.609859", "0.60928434", "0.6092", "...
0.7547621
0
Retrieve latest version of gem matching dep
def latest_matching(dep) version = latest_version_matching(dep) raise RuntimeError, "no version found" if version.nil? retrieve dep.name, version end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def latest_version_matching(dep)\n version = versions_matching(dep).collect { |v| ::Gem::Version.new v }.max\n version.nil? ? nil : version.to_s\n end", "def latest_version(gem_name, pre: false)\n return versions(gem_name).first if pre\n versions(gem_name).find { |version| !versi...
[ "0.8244557", "0.7792762", "0.76194817", "0.7469064", "0.74484146", "0.73296195", "0.7291352", "0.71392804", "0.70718825", "0.70357835", "0.70006084", "0.6985557", "0.6905778", "0.6897987", "0.68828255", "0.6881632", "0.6877673", "0.68730646", "0.6867428", "0.6809918", "0.6798...
0.8405214
0
Retrieve earliest version of gem matching dep
def earliest_matching(dep) version = earliest_version_matching(dep) raise RuntimeError, "no version found" if version.nil? retrieve dep.name, version end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def earliest_version_matching(dep)\n version = versions_matching(dep).collect { |v| ::Gem::Version.new v }.min\n version.nil? ? nil : version.to_s\n end", "def latest_version_matching(dep)\n version = versions_matching(dep).collect { |v| ::Gem::Version.new v }.max\n version.nil? ...
[ "0.88362706", "0.7383093", "0.72318274", "0.6998485", "0.69249725", "0.6920941", "0.6867914", "0.67370117", "0.6648179", "0.6630547", "0.6561474", "0.64380574", "0.6429268", "0.6398479", "0.63848245", "0.6306309", "0.6301754", "0.6299568", "0.62795097", "0.62770534", "0.62758...
0.84916043
1
Retrieve latest version of gem in target
def latest_in_target(name, target) version = latest_version_in_target(name, target) raise RuntimeError, "no matching version" if version.nil? retrieve name, version end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def latest_version_in_target(name, target)\n versions_in_target(name, target).collect { |v| ::Gem::Version.new v }.max\n end", "def latest_version(module_name)\n versions(module_name).last\n end", "def latest_version(gem_name, pre: false)\n return versions(gem_name).first if pre\n ...
[ "0.7854426", "0.74819744", "0.7322488", "0.72508657", "0.7245595", "0.7161212", "0.7131202", "0.71140045", "0.706569", "0.7040538", "0.70030904", "0.69820124", "0.6968745", "0.69412816", "0.69284654", "0.6922672", "0.69146144", "0.69102955", "0.69070584", "0.6899313", "0.6899...
0.7759147
1
module ClassMethods Download the local gem and return it as a string
def download_gem self.class.download_gem @name, @version end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_gem\n self.class.download_gem @name, @version\n end", "def gem_path\n @path || downloaded_gem_path\n end", "def downloaded_gem_path\n self.class.downloaded_gem_path @name, @version\n end", "def gem_path\n @path || downloaded_gem_path\n end", "def downloa...
[ "0.7213154", "0.6753743", "0.6710639", "0.66692287", "0.6586051", "0.6453498", "0.6374388", "0.63688445", "0.61961573", "0.61261266", "0.6104272", "0.60967845", "0.6090408", "0.6082866", "0.6081862", "0.60184836", "0.59918666", "0.59887403", "0.5980656", "0.59715223", "0.5948...
0.73404676
0
Return path to downloaded gem
def downloaded_gem_path self.class.downloaded_gem_path @name, @version end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gem_path\n @path || downloaded_gem_path\n end", "def gem_path\n @path || downloaded_gem_path\n end", "def downloaded_gem_path\n self.class.downloaded_gem_path @name, @version\n end", "def downloaded_gem_path(name, version)\n # ensure gem is downloaded\n downl...
[ "0.86328757", "0.8511787", "0.8444249", "0.764266", "0.7624339", "0.7498303", "0.71763456", "0.70950896", "0.70950896", "0.7091811", "0.7047844", "0.7008313", "0.7005286", "0.69122773", "0.6885031", "0.6885031", "0.68829566", "0.68764734", "0.6868022", "0.68548036", "0.678479...
0.8569027
1
This only formats MMYYYY
def format_month_year(date) date.strftime("%Y-%b") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_date(month, year)\n \"#{format(month,:two_digits)}/#{format(year, :two_digits)}\"\n end", "def format_date(month, year)\n \"#{format(month,:two_digits)}/#{format(year, :two_digits)}\"\n end", "def format_ap_date(date_obj)\n date_obj = DateTime.parse(date_obj) unless date_obj...
[ "0.71196556", "0.71196556", "0.6733248", "0.67012584", "0.6603148", "0.65891355", "0.65476215", "0.6544962", "0.6523477", "0.6468496", "0.6459266", "0.64371973", "0.6404232", "0.6392666", "0.63622385", "0.6317562", "0.6307046", "0.62962246", "0.6293782", "0.62904775", "0.6253...
0.713793
0
Returns the date / time value from config/locale/sitemap.yml associated with the current controller / action. The static date/times are actual timestamps extracted from the date of the view on disk and from a .git repository if used. Be sure to run the generator or rake task: duck_map:sync to populate the locale file a...
def sitemap_static_lastmod(my_controller_name = nil, my_action_name = nil) value = nil unless my_controller_name.blank? || my_action_name.blank? unless my_controller_name.blank? my_controller_name = my_controller_name.underscore my_controller_name = my_controller_name.gsub("/",...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def schedule_info\n\n Time.at(@at)\n end", "def system_modified_dtsi\n Time.parse get('system_modified_dtsi')\n end", "def deployed_at() ; info_time(:deployed_datetime) ; end", "def deployed_at() ; info_time(:deployed_datetime) ; end", "def get_request_timestamp\n\t\treturn @...
[ "0.57362396", "0.5731056", "0.5713031", "0.5713031", "0.56561637", "0.56265986", "0.5583622", "0.548209", "0.53863734", "0.53863734", "0.53863734", "0.5386075", "0.53558856", "0.53481543", "0.5327672", "0.53198487", "0.5304827", "0.52979004", "0.5290553", "0.5285355", "0.5278...
0.71463656
0
copy from the key's data using the glob pattern
def nuspec_copy(key, glob) puts "key: #{key}, glob: #{glob}, proj dir: #{PROJECTS[key][:dir]}" FileList[File.join(FOLDERS[:binaries], PROJECTS[key][:dir], glob)].collect{ |f| to = File.join( FOLDERS[:"#{key}"][:nuspec], "lib", FRAMEWORK ) FileUtils.mkdir_p to cp f, to # return the file name an...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy_tree_to(key, source_root, source_key)\n source_root.unprefixed_subtree_keys(source_key).each do |unprefixed_key|\n copy_content_to(File.join(key, unprefixed_key), source_root, File.join(source_key, unprefixed_key))\n end\n end", "def nuspec_copy(key, glob)\r\n puts \"key: #{key}, glob: #{...
[ "0.6027272", "0.5952779", "0.5875576", "0.5826581", "0.5565297", "0.5502867", "0.54241097", "0.53902346", "0.53886354", "0.53438026", "0.53034526", "0.52869344", "0.5276853", "0.5276853", "0.52369374", "0.5235098", "0.51434904", "0.5128714", "0.5125614", "0.5124747", "0.51005...
0.60046256
1
API methods api/campaigns (all campaigns) api/campaigns/active (all active campaigns) api/:country/campaigns (campaigns in country) api/:country/campaigns/active (active campaigns in country)
def api_index campaigns = Campaign.all campaigns = campaigns.for_country(params[:country].presence) if params[:country] campaigns = campaigns.active if 'active' == params[:status] respond_to do |format| format.json { render json: campaigns } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def campaigns(options={})\n response = connection.get do |req|\n \treq.url \"campaigns\", options\n end\n return_error_or_body(response)\n \tend", "def campaign_find_active\n call_api(:campaign_find_active)\n end", "def get_campaigns_with_http_info(opts = {})\n if @api_cli...
[ "0.70781124", "0.6772431", "0.6720626", "0.6612099", "0.6534977", "0.64728206", "0.6457495", "0.63592166", "0.6358737", "0.62297285", "0.619548", "0.6191473", "0.61860263", "0.6166906", "0.6166906", "0.6166906", "0.61664605", "0.6122602", "0.6113763", "0.61098367", "0.6097153...
0.8253609
0
Updates the both Event and Idea/Transportation/Notes models. Idea model's title is copied from Event model.
def update @event = Event.find(params[:id]) if @event.eventable_type == "Activity" or @event.eventable_type == "Hotel" or @event.eventable_type == "Foodanddrink" @idea = Idea.find(@event.eventable_id) respond_to do |format| if @event.update_attributes(params[:event]) and @...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @idea_event = IdeaEvent.find(params[:id])\n\n respond_to do |format|\n if @idea_event.update_attributes(params[:idea_event])\n format.html { redirect_to @idea_event, notice: 'Idea event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { ...
[ "0.6033221", "0.5766155", "0.5753449", "0.5753449", "0.5720658", "0.56744754", "0.5643645", "0.56246233", "0.561939", "0.5604081", "0.5591615", "0.5591615", "0.5591615", "0.5591615", "0.5579878", "0.55676687", "0.5543988", "0.55154854", "0.55154854", "0.551388", "0.5500097", ...
0.6241192
0
This will read a given test case and pass that into the test_case_processor. A test case is defined as the number of lines_per_test_case Can optionally pass in a line_processor that will process a line before adding it to the buffer. Will stop reading after we hit the number of test cases defined in the file Assumption...
def parse(test_case_processor, line_processor = nil) (raise ArgumentError.new('Missing input filename to parse')) unless @filename line_counter = -1 test_cases_read = 0 test_cases = 0 line_buffer = [] IO.foreach(@filename) do |line| line.strip! # read number of case...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_testcase(line_buffer)\n line_buffer\n end", "def process_block(line_buffer, test_number)\n if (@custom_processor && @custom_processor.class.method_defined?(:process_testcase))\n @custom_processor.process_testcase line_buffer\n else\n line_buffer\n end\n end", "de...
[ "0.6840313", "0.6714628", "0.61795497", "0.6089046", "0.56071186", "0.5429095", "0.53580374", "0.5227789", "0.51999575", "0.5108008", "0.5098291", "0.5067358", "0.5023306", "0.5021187", "0.498296", "0.49813312", "0.4975683", "0.497382", "0.49237415", "0.4920486", "0.4916869",...
0.8160645
0
Remove pfda admin from orgs Skip if the host user is actual ADMIN_USER
def remove_pfda_admin_user(orgs_dxs) return if user.dxid == ADMIN_USER orgs_dxs.each { |dxorg| papi.call(dxorg, "removeMember", user: ADMIN_USER) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_pfda_admin_user(space, space_form)\n return if user.dxid == ADMIN_USER\n\n unless space_form.host_admin.dxid == ADMIN_USER\n admin_api.org_remove_member(space.host_dxorg, ADMIN_USER)\n end\n\n return if space_form.guest_admin.nil? || space_form.guest_admin&.dxid == ADMIN_USER\...
[ "0.73185605", "0.6716337", "0.65860397", "0.6558528", "0.65524524", "0.64814305", "0.6458961", "0.6430686", "0.6403793", "0.6403793", "0.63285977", "0.63171566", "0.631586", "0.62212825", "0.62212825", "0.61993843", "0.6192403", "0.6179935", "0.61742574", "0.61648476", "0.616...
0.7002545
1
Send an activation email to all space leads
def send_emails(space) space.leads.find_each do |lead| notification_mailer.space_activation_email(space, lead).deliver_now! end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_activation_email\n ensure_activation_token_set\n UserMailer.account_activation(self, activation_token).deliver_later unless activated?\n end", "def send_activation_or_reset_mail\n end", "def activation\n @greeting = \"Hi\"\n\n mail :to => \"john@synapticmishap.co.uk\"\n end", "def sen...
[ "0.7594372", "0.75799966", "0.7558296", "0.744841", "0.74068123", "0.7365573", "0.7356083", "0.7335921", "0.73024637", "0.7287065", "0.7273054", "0.72715235", "0.7268526", "0.7264571", "0.72345513", "0.7231706", "0.72259665", "0.7212751", "0.7186972", "0.7186972", "0.7186972"...
0.78956795
1
Create a project of a cooperative review space.
def create_reviewer_cooperative_project(space) if ADMIN_USER != user.dxid papi.call( space.host_dxorg, "invite", invitee: user.dxid, level: "ADMIN", suppressEmailNotification: true ) end project_dxid = api.call( "project", "new", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_project (project, pledge_goal)\n Project.new(project, self, pledge_goal)\n end", "def create\n name = shift_argument\n unless name\n error(\"Usage: mortar projects:create PROJECTNAME\\nMust specify PROJECTNAME\")\n end\n\n args = [name,]\n is_public = false \n if optio...
[ "0.68930215", "0.65978414", "0.65761304", "0.6571514", "0.65533745", "0.65262187", "0.65135425", "0.64749277", "0.64422035", "0.6402188", "0.64003485", "0.63773036", "0.6349652", "0.63400304", "0.6294244", "0.62593", "0.6241359", "0.6240975", "0.62366915", "0.6218934", "0.620...
0.78070325
0
TODO: to be refactored Apply space_template to the space if space_template exists
def apply_space_template(space) parent_space = space.space return if parent_space.blank? template = parent_space.space_template return if template.blank? template.space_template_nodes.each do |n| node = n.node case node when UserFile copy_service.copy(no...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_space_type(template, clim, building_type, spc_type)\n #OpenStudio::logFree(OpenStudio::Info, 'openstudio.standards.Model', \"Adding space type: #{template}-#{clim}-#{building_type}-#{spc_type}\")\n\n # Get the space type data\n data = self.find_object(self.standards['space_types'], {'template'=>te...
[ "0.57424045", "0.555385", "0.54832", "0.53907865", "0.5252938", "0.52402824", "0.52234554", "0.5207747", "0.5174894", "0.5164923", "0.51312476", "0.5115307", "0.50710034", "0.50550723", "0.50517523", "0.5044105", "0.5026249", "0.5018389", "0.50085974", "0.5006663", "0.4985411...
0.77530843
0
GET /ins_co_offices/1 GET /ins_co_offices/1.xml
def show @ins_co_office = InsCoOffice.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @ins_co_office } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @offices = current_user.offices\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @offices }\n end\n end", "def index\n @offices = Office.all\n #Office.lets_scrape\n end", "def list_branch_offices\n\t\t\txml = \"<?xml version='1.0' e...
[ "0.6778899", "0.6207084", "0.61900645", "0.61384565", "0.60676956", "0.59978044", "0.5992629", "0.59857357", "0.597969", "0.59686255", "0.5964498", "0.5959601", "0.5952478", "0.5948258", "0.585986", "0.5850791", "0.5834076", "0.57208395", "0.5718783", "0.571761", "0.5711841",...
0.6586802
1
GET /ins_co_offices/new GET /ins_co_offices/new.xml
def new @ins_co_office = InsCoOffice.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @ins_co_office } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @office = Office.new\n\t\t\n\t\t\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @office }\n end\n end", "def new\n @officer = Officer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @off...
[ "0.6782288", "0.6741558", "0.66297346", "0.66275966", "0.65640706", "0.6553684", "0.6552235", "0.65375686", "0.65375686", "0.6515558", "0.6482163", "0.64396846", "0.6438755", "0.64386404", "0.64208925", "0.6417984", "0.64154696", "0.6386465", "0.6380879", "0.63801163", "0.637...
0.7053239
0
POST /ins_co_offices POST /ins_co_offices.xml
def create @ins_co_office = InsCoOffice.new(params[:ins_co_office]) respond_to do |format| if @ins_co_office.save format.html { redirect_to(@ins_co_office, :notice => 'Office was successfully created.') } format.xml { render :xml => @ins_co_office, :status => :created, :location => @ins_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @office = current_user.offices.build(params[:office])\n\n respond_to do |format|\n if @office.save\n flash[:notice] = 'Office was successfully created.'\n format.html { redirect_to(root_path) }\n format.xml { render :xml => @office, :status => :created, :location => @o...
[ "0.5972843", "0.58993775", "0.5696602", "0.5676932", "0.5502328", "0.5480036", "0.5472551", "0.5425959", "0.54230785", "0.53897434", "0.5375659", "0.53277665", "0.53269917", "0.52758044", "0.52560896", "0.5250543", "0.52231205", "0.52176917", "0.52162737", "0.52116734", "0.52...
0.628173
0
PUT /ins_co_offices/1 PUT /ins_co_offices/1.xml
def update @ins_co_office = InsCoOffice.find(params[:id]) respond_to do |format| if @ins_co_office.update_attributes(params[:ins_co_office]) format.html { redirect_to(@ins_co_office, :notice => 'Office was successfully updated.') } format.xml { head :ok } else format.html {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @office.update(office_params)\n head :no_content\n end", "def update\n @office = Office.find(params[:id])\n\n respond_to do |format|\n if @office.update_attributes(params[:office])\n format.html { redirect_to offices_path, notice: 'Office was successfully updated.' }\n ...
[ "0.61209834", "0.58853495", "0.5862495", "0.5802529", "0.57994395", "0.5777615", "0.57137275", "0.5679202", "0.56741464", "0.56029654", "0.5584538", "0.5583037", "0.5563727", "0.5562154", "0.54945403", "0.54758495", "0.5463382", "0.54628986", "0.54586387", "0.54527646", "0.54...
0.64627606
0
DELETE /ins_co_offices/1 DELETE /ins_co_offices/1.xml
def destroy @ins_co_office = InsCoOffice.find(params[:id]) @ins_co_office.destroy respond_to do |format| format.html { redirect_to(ins_co_offices_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end", "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end", "def destroy\n @office = Office.find(params[:id])\n @off...
[ "0.6583533", "0.6518735", "0.64920455", "0.6396862", "0.6299352", "0.6170572", "0.6164077", "0.6160628", "0.61012083", "0.60825944", "0.6075309", "0.6060401", "0.60582286", "0.6047363", "0.60300773", "0.6015298", "0.60115176", "0.6001922", "0.59869945", "0.5981915", "0.597664...
0.6935799
0
POST /online_judges POST /online_judges.json
def create @online_judge = OnlineJudge.new(online_judge_params) @online_judge.user = current_user respond_to do |format| if @online_judge.save format.html { redirect_to current_user, notice: 'Online judge was successfully created.' } format.json { render :show, status: :created, locat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_judgings(n = 100)\n\t\tresult = api_get('judgings', cid: contest_id, limit: n,\n\t\t fromid: last_judging)\n\t\tself.last_judging = result.last['id'] + 1 unless result.empty?\n\t\tresult\n\tend", "def create\n @judge = @competition.judges.build(judge_params)\n authorize ...
[ "0.58430684", "0.5757473", "0.56651497", "0.54522693", "0.5367972", "0.5334164", "0.5315734", "0.5271995", "0.5180628", "0.51660585", "0.51344687", "0.50466317", "0.50420463", "0.5015169", "0.4998017", "0.49963892", "0.4977875", "0.491329", "0.4897295", "0.4892257", "0.488237...
0.5990504
0