query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Tells if a provider was found for the given url.
def has_provider?( url ) @config.each do | options | if ( url =~ options[ :pattern ]) return true end end false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find(url)\n @@urls.keys.each do |url_regexp|\n next unless url_regexp.match?(url)\n\n matching_provider = @@urls[url_regexp].detect { |p| p.include?(url) }\n\n # If we've found a matching provider, return it right away!\n return matching_provider if matching_provider\...
[ "0.7255196", "0.7116635", "0.70400745", "0.69524974", "0.69524974", "0.69312924", "0.6908129", "0.657495", "0.64997005", "0.6427866", "0.63893634", "0.6355167", "0.63489544", "0.63422465", "0.6262378", "0.6245814", "0.6222895", "0.6202723", "0.61677235", "0.61459297", "0.6130...
0.81838304
0
Finds providers of the given url.
def providers( url ) @config.each do | name, options | if ( url =~ options[ :pattern ]) yield self._provider( name, options ) end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find(url)\n @@urls.keys.each do |url_regexp|\n next unless url_regexp.match?(url)\n\n matching_provider = @@urls[url_regexp].detect { |p| p.include?(url) }\n\n # If we've found a matching provider, return it right away!\n return matching_provider if matching_provider\...
[ "0.7527646", "0.64078915", "0.63623244", "0.6304663", "0.61685497", "0.60551894", "0.6027206", "0.5877691", "0.58356684", "0.58181214", "0.5786123", "0.5763605", "0.5701064", "0.56214684", "0.5597115", "0.5492994", "0.54603374", "0.54574925", "0.5452589", "0.5427383", "0.5417...
0.7796191
0
Lazy loads a provider given its name and configuration.
def _provider( name, options ) @_provider ||= { } @_provider[ name ] ||= ( Object::const_get( name ).new( options ) ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use_provider( name )\n name = name.to_s\n raise Polylog::UnknownProvider, \"unknown provider: #{name.inspect}\" unless @providers.key? name\n\n @provider = @providers[name]\n end", "def get_provider_config(name)\n raise \"Must finalize first.\" if !@__finalized\n\n result = @__compile...
[ "0.7008453", "0.6556769", "0.65116", "0.634863", "0.6256502", "0.62456053", "0.6183423", "0.6155379", "0.6124937", "0.6069193", "0.6067455", "0.6057814", "0.6035572", "0.60267144", "0.60250473", "0.5990827", "0.596385", "0.5877515", "0.5861626", "0.58346653", "0.5828624", "...
0.64647275
3
Public: Validates uniqueness of subboard.
def validate super rescue Sudoku::Constraint::ConstraintError => e raise ConstraintError, e.message + " in a 3x3 subboard" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name_uniqueness\n other_sprint = Sprint.where(board_id: self.board_id, name: self.name).where.not(id: self.id).count\n if other_sprint > 0\n errors.add(:name, 'must be uniq.')\n end\n end", "def ensure_unique_board_title\n unless self.has_unique_title\n errors.add_to_base(\"please choo...
[ "0.66366756", "0.6488248", "0.6420856", "0.62770236", "0.6222425", "0.6118906", "0.6075701", "0.59731096", "0.5900208", "0.57765025", "0.5773502", "0.5759283", "0.5745953", "0.5730159", "0.5680878", "0.56145227", "0.5607456", "0.5596017", "0.5586421", "0.5570675", "0.5551813"...
0.63333267
3
^ same as writing: attr_reader :pudginess attr_writer :pudginess
def initialize(args) @stomach = [] @pudginess = args[:pudginess] || :low end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pudginess=(new_pudginess_value)\n @pudginess = new_pudginess_value\n end", "def pudginess\n @pudginess\n end", "def writable?() end", "def test_dogs_stolen_setter\n evil_henchperson = EvilHenchperson.new(name: \"Rasputin\", age: 47, gender: \"male\", \n legs: 4, eyes: 2, ears: 2, shot...
[ "0.7672744", "0.72023046", "0.5547324", "0.5477828", "0.54745907", "0.54452765", "0.52501047", "0.52453136", "0.524482", "0.52444285", "0.52406555", "0.52213603", "0.51996446", "0.5187393", "0.5165023", "0.51542383", "0.5145975", "0.51454026", "0.5143173", "0.513879", "0.5130...
0.494256
41
attr_reader :pudginess makes the code below rendundant (it creates the same mehtod)
def pudginess @pudginess end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def probers; end", "def attr_reader(*)\n end", "def pudginess=(new_pudginess_value)\n @pudginess = new_pudginess_value\n end", "def instance_variables() end", "def instance_variables; end", "def potion; end", "def class_variables() end", "def droid; end", "def ini...
[ "0.61743426", "0.6109068", "0.59846795", "0.5905944", "0.58007646", "0.57175636", "0.5634166", "0.55826026", "0.55764437", "0.5514299", "0.5471307", "0.5405409", "0.5387891", "0.53689504", "0.53689504", "0.5346605", "0.53377134", "0.53375643", "0.5335438", "0.53268", "0.53240...
0.6961064
0
attr_writer :pudginess makes the code below rendundant (it creates the same mehtod)
def pudginess=(new_pudginess_value) @pudginess = new_pudginess_value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pudginess\n @pudginess\n end", "def attr_writer(sym, *more) end", "def gr_policy_setup\n begin\n # If there are no accessors for the model object's accessors,\n # they need to be defined so we can alias them\n define_attribute_methods\n rescue\n end\n \n if self.respond_to...
[ "0.62570596", "0.6248934", "0.6054617", "0.60068256", "0.58932686", "0.5858085", "0.58251", "0.58030343", "0.5788806", "0.57129824", "0.5649265", "0.55959475", "0.5526958", "0.5518594", "0.5496552", "0.5493387", "0.54573876", "0.544527", "0.54441917", "0.54413354", "0.543481"...
0.6296605
0
GET /crunch_companies/1 GET /crunch_companies/1.json
def show @crunch_company = CrunchCompany.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @crunch_company } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def companies\n render \"company/companies.json.jbuilder\", status: :ok\n end", "def index\n @companies = Company.all\n @com_info = Company.last\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end", "def index\n @companie...
[ "0.76162297", "0.7445542", "0.74085504", "0.7300953", "0.7300953", "0.7300953", "0.7300953", "0.72552043", "0.72347057", "0.7200467", "0.7160801", "0.7104492", "0.70934415", "0.701492", "0.6956844", "0.69529015", "0.6952322", "0.69521314", "0.6897682", "0.6897682", "0.6897682...
0.777616
0
GET /crunch_companies/new GET /crunch_companies/new.json
def new @crunch_company = CrunchCompany.new respond_to do |format| format.html # new.html.erb format.json { render json: @crunch_company } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @company = Company.new(:name => 'default')\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @company }\n end\n end", "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render ...
[ "0.79488385", "0.78844327", "0.78844327", "0.78844327", "0.78844327", "0.78844327", "0.78844327", "0.78844327", "0.78844327", "0.78844327", "0.78844327", "0.78526264", "0.75860524", "0.75149864", "0.7503254", "0.74803853", "0.743372", "0.7421453", "0.73877597", "0.7355252", "...
0.7949289
0
POST /crunch_companies POST /crunch_companies.json
def create @crunch_company = CrunchCompany.new(params[:crunch_company]) @fetch_crunch = Crunchbase::Company.get(@crunch_company.company_name) # @fetch_crunch_posts_call = Crunchbase::Posts.get(@crunch_company.company_name) # @fetch_crunch_posts = @fetch_crunch["num_posts"] @fetch_crunch_ipo_year = @...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n if @company = Company.find(entity_id_from_params(:company))\n respond_to do |format|\n current_user.account.companies << @company\n format.html { redirect_to root_path, notice: 'Company was successfully created.' }\n format.json\n end\n end\n end", "def create\n...
[ "0.7280003", "0.7254238", "0.7248311", "0.6906008", "0.68854696", "0.6851776", "0.68477434", "0.6789858", "0.678918", "0.678918", "0.678918", "0.678918", "0.67847383", "0.67722076", "0.67720073", "0.67558736", "0.67558736", "0.67558736", "0.67558736", "0.67558736", "0.6747215...
0.686769
5
PUT /crunch_companies/1 PUT /crunch_companies/1.json
def update @crunch_company = CrunchCompany.find(params[:id]) @fetch_crunch = Crunchbase::Company.get(@crunch_company.company_name) @fetch_crunch_posts = @fetch_crunch.ipo respond_to do |format| if @crunch_company.update_attributes(params[:crunch_company]) @crunch_company.update_attribute(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end", "def crunch\n @crunch_company = CrunchCompany.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @crunch_company }\n end\n @fetch_crunch = Crunchbase::Company.get(...
[ "0.741391", "0.70041966", "0.7000469", "0.68948317", "0.6786039", "0.6743134", "0.6736278", "0.6695271", "0.6657798", "0.66475105", "0.6632987", "0.6624847", "0.6624847", "0.6624847", "0.6624847", "0.6624847", "0.6624847", "0.66162527", "0.65924305", "0.65611", "0.65203536", ...
0.7196457
1
DELETE /crunch_companies/1 DELETE /crunch_companies/1.json
def destroy @crunch_company = CrunchCompany.find(params[:id]) @crunch_company.destroy respond_to do |format| format.html { redirect_to crunch_companies_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n render json: Company.delete(params[\"id\"])\n end", "def destroy\n @company.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format....
[ "0.7629519", "0.7423011", "0.723418", "0.723418", "0.723418", "0.723418", "0.723418", "0.723418", "0.723418", "0.723418", "0.723418", "0.723418", "0.7205004", "0.72004235", "0.72004235", "0.72004235", "0.7195811", "0.7178211", "0.7142651", "0.71339065", "0.7081433", "0.7065...
0.7902959
0
custom crunch method to take from form
def crunch @crunch_company = CrunchCompany.new respond_to do |format| format.html # new.html.erb format.json { render json: @crunch_company } end @fetch_crunch = Crunchbase::Company.get(@crunch_company.company_name) # @fetch_crunch_posts_call = Crunchbase::Posts.get(@crunch_company.comp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def form; end", "def formation; end", "def ing_form; end", "def forms; end", "def _reduce_1(val, _values, result)\n result = Form.new(val[1], val[2]) \n result\nend", "def _reduce_1(val, _values, result)\n result = Form.new(val[1], val[2]) \n result\nend", "def process_form(entry)\n\t\t# set flag...
[ "0.5914847", "0.58512485", "0.5553589", "0.55381304", "0.5430218", "0.5430218", "0.54152256", "0.5412264", "0.5327706", "0.5305554", "0.529601", "0.52954245", "0.5257463", "0.5190776", "0.5184736", "0.5153157", "0.51515913", "0.514377", "0.5141818", "0.51042724", "0.50865406"...
0.0
-1
Une Array of [employe_nom, dateTime]
def initialize @data = Array.new # Obtenir toutes les feuilles de temps les employes de moins de 18 ans minDate = Date::today().years_ago(18); Feuille. joins('inner join employes as empl on employe_id = empl.id'). where('empl.naissance > ?', minDate.to_formatted_s(:db)).each do | f | ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dates\n @datapoints.collect { |point| point[0] }\n end", "def get_hours_array hours\n hours_array = []\n hours.each { |h| hours_array << h.date }\n return hours_array\n end", "def to_a\n return [@t_year, @t_month, @t_day, @t_hour, @t_min, @t_sec, @t_usec]\n end", "def to_a\n [@year, ...
[ "0.5913694", "0.5817972", "0.57922107", "0.5737033", "0.57019955", "0.56692237", "0.56607443", "0.56568754", "0.56370044", "0.5626931", "0.5609938", "0.55750996", "0.5556535", "0.5529931", "0.5524295", "0.5489918", "0.5472819", "0.54502875", "0.54350644", "0.54259396", "0.536...
0.6309461
0
this method is only called from methods that execute on creation.
def local_song_file @song_file ||= SongFile.new(local_data.to_file(:original).path) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def initialize\n super\n end", "def initialize\n super\n end", "def initialize\n \n end", "def initialize()\n super\n end", "def initialize()\n super\n end", "def initialize()\n ...
[ "0.72471833", "0.6961156", "0.6961156", "0.6842862", "0.68120646", "0.68120646", "0.68120646", "0.68120646", "0.68120646", "0.68120646", "0.68120646", "0.68120646", "0.68120646", "0.68120646", "0.68120646", "0.68120646", "0.68120646", "0.68120646", "0.68120646", "0.68120646", ...
0.0
-1
List of tests 1. Empty Eobqa create 2. Create with invalid data Check with nil total_fields Check with nil total_incorrect_fields Check with nil account_number Check Uniqueness of name 3. Check Eobqa count when we created and distroy Blank EOBQA
def test_blank_eobqa eobqa = EobQa.new(:total_fields => 10, :total_incorrect_fields => 2) assert_equal(false, eobqa.save) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_blank_data\n eobqa = EobQa.new(:id => 4, :total_fields => 10, :total_incorrect_fields => 2,\n :account_number => '00001', :payer => 'abcd')\n assert_equal(true, eobqa.save)\n eobqa3 = EobQa.new(:id => 7, :total_fields => 10, :total_incorrect_fields => 2)\n assert_equa...
[ "0.6669407", "0.6357184", "0.6068123", "0.6029477", "0.58244556", "0.57928324", "0.5747221", "0.573746", "0.57251877", "0.57250005", "0.5723604", "0.570722", "0.5683975", "0.5683111", "0.5677606", "0.56504655", "0.5644551", "0.5637583", "0.5596987", "0.5594741", "0.55768627",...
0.6451921
1
Test with nil total_fields total_incorrect_fields & account_number
def test_with_blank_data eobqa = EobQa.new(:id => 4, :total_fields => 10, :total_incorrect_fields => 2, :account_number => '00001', :payer => 'abcd') assert_equal(true, eobqa.save) eobqa3 = EobQa.new(:id => 7, :total_fields => 10, :total_incorrect_fields => 2) assert_equal(false, e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_account?\n !country_id.blank? && !iban_dc.blank? && !bank_id.blank? && !bank_office_id.blank? && !account_no.blank?\n end", "def fields_missing_errors(*fields)\n !fields_have_errors(*fields)\n end", "def any_fields?\n num_fields.positive?\n end", "def fixed_field_check(record)\n {\n...
[ "0.62495303", "0.6200177", "0.58967215", "0.58857554", "0.5840539", "0.5773326", "0.5773108", "0.5749961", "0.5694846", "0.56943864", "0.5692888", "0.5686806", "0.56771916", "0.5665321", "0.56607056", "0.56565315", "0.56390166", "0.5631794", "0.56204075", "0.5595767", "0.5587...
0.0
-1
num1 The Integer which is going to be compared num2 The Integer which is also going to be compare max The Integer which temporarily is the largest of the two Example max_of_two(1, 2) => 2 Returns the largest number
def max_of_two(num1, num2) max = num1 if num2 > num1 max = num2 end return max end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_of_two(num1, num2)\n \n if num1 < num2\n return num2\n else \n return num1\n end\n end", "def max_of_two(num1, num2)\n if num1 > num2\n return num1\n end\n return num2\nend", "def max_of_two(num1, num2)\n output = num1\n if num1 < n...
[ "0.86543715", "0.84330344", "0.8348366", "0.83224964", "0.8314668", "0.8310239", "0.8310239", "0.8281536", "0.8163986", "0.8154231", "0.8136487", "0.81026196", "0.80816853", "0.80734056", "0.79379857", "0.7930652", "0.7842155", "0.7668436", "0.766485", "0.76244813", "0.761533...
0.8572739
1
DELETE /student_assigns/1 DELETE /student_assigns/1.xml
def destroy @student_assign = StudentAssign.find(params[:id]) @student_assign.destroy redirect_to(courses_url) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @student_referee = StudentReferee.find(params[:id])\n @student_referee.destroy\n\n respond_to do |format|\n format.html { redirect_to(student_referees_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @student_correspondence = StudentCorrespondence.find(params...
[ "0.7001196", "0.69346046", "0.6909074", "0.6908387", "0.6908387", "0.6908387", "0.6908387", "0.6908387", "0.6908387", "0.6854975", "0.6839801", "0.6784897", "0.6765536", "0.6763868", "0.6697386", "0.6659295", "0.66331583", "0.6617018", "0.6566718", "0.65524197", "0.6499336", ...
0.6652204
16
this sorts the players by score from high to low
def <=>(other) other.score <=> score end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def player_sort()\n\t\tsession[:player].sort {|a, b| a.total_score <=> b.total_score }\n\tend", "def sort\n @hits = all.sort {|x,y| y.score <=> x.score }\n end", "def sorted_scores\n self.object.teams.map {|team| team.score}.sort.reverse\n end", "def create_leaderboard(team_scorecard)\n #sort scorec...
[ "0.85659236", "0.75483847", "0.73179823", "0.7284128", "0.72748727", "0.7183378", "0.7180833", "0.71787876", "0.71085006", "0.7097531", "0.68950653", "0.6887334", "0.6840702", "0.6830117", "0.68154454", "0.67751986", "0.6770662", "0.67542785", "0.6748922", "0.67485386", "0.67...
0.0
-1
TODO: the first category cannot be destoryed
def depth self.ancestors.size end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_category\n if self.shoes.empty?\n self.delete\n else\n return false\n end\n end", "def remove_category category_name\r\n delete category_name\r\n end", "def ultimo_item\n \tcats = Category.all\n \t\tcats.each do |n|\n \t\t\tif n.items.empty?\n \t\t\t\tn.destroy\n \t\...
[ "0.6592688", "0.65877014", "0.6489609", "0.6486068", "0.6471803", "0.6414432", "0.6406733", "0.63822216", "0.63485724", "0.63208", "0.62700254", "0.62427926", "0.62330616", "0.62097573", "0.62076217", "0.619208", "0.61744595", "0.6172119", "0.61495817", "0.6054357", "0.603909...
0.0
-1
Asks a question without context awareness. Searches the knowledge base for a fact within timeframe of the present time, and asks a random question that can be asked about that fact. Also, creates a list of possible answers based on similar facts that occurred around that timeframe.
def askQuestion(timeframe=1*DAY_TO_SECONDS) facts = @kb.getFacts(timeframe) while facts.length > 0 fact = facts.sample matched = [] @qat.each do |qat| ismatch = qat.matches(fact) matched.push(ismatch) if ismatch end qat,matchesArr = matched.sample if not qat #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ask(question)\n session[:question_id] = question.id\n session[:correct_answer] = question.answer_correct\n session[:current_answers] = [@question.answer_correct, @question.answer_wrong_1, @question.answer_wrong_2, @question.answer_wrong_3].shuffle\n end", "def ask_questions\n until game_over?\...
[ "0.6220518", "0.6205648", "0.6189438", "0.58474475", "0.5824504", "0.5784658", "0.5671709", "0.56490004", "0.5648689", "0.5628906", "0.5612855", "0.55622005", "0.55618936", "0.5558363", "0.55450124", "0.55378205", "0.5511263", "0.54956305", "0.54510105", "0.5445995", "0.54261...
0.7452652
0
KS test all assumptions about destroy here (it should blow away any accompanying data in all the tables in cascading fashion)
def test_destroy #TODO: do this #assert false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n [METADATA_TABLE_NAME, RUN_HISTORY_TABLE_NAME,\n DISABLED_MONITOR_TABLE_NAME, MONITOR_INFO_TABLE_NAME].each do |table|\n @db.execute(\"DROP TABLE IF EXISTS #{table}\")\n end\n\n create()\n end", "def test_destroy\n Model0.destroy_all\n assert_equa...
[ "0.7192457", "0.7175689", "0.71424687", "0.71250516", "0.7078477", "0.7078477", "0.7074828", "0.70273733", "0.69917744", "0.6988772", "0.6964955", "0.693825", "0.69211066", "0.691629", "0.68923366", "0.68738776", "0.68663245", "0.68463016", "0.68371433", "0.68312943", "0.6830...
0.0
-1
KS picture related tests
def test_make_primary #KS- load dummy user to add the image to user = users(:bob) #KS- create the image uploaded_pic = uploaded_jpeg(File.dirname(__FILE__) + '/../data/tiny_smedberg.jpg', 'tiny_smedberg.jpg') pic = Picture.new({'picture' => uploaded_pic, 'size_type' => Picture::SIZE_FULL}) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_10b\r\n db = build\r\n nm = File.join(test_data,'image-1.jpg')\r\n db['group1'].store(nm)\r\n assert File.exists?(File.join(db.root,'groups',\r\n 'group1','originals',\r\n 'image-1.jpg'))\r\n end", "def test_truth\n assert...
[ "0.6577694", "0.6489941", "0.6387638", "0.63697416", "0.6355515", "0.63407433", "0.6335082", "0.633209", "0.6268209", "0.6262523", "0.62584436", "0.6218614", "0.6200919", "0.61868006", "0.61839694", "0.6159232", "0.6133506", "0.61280257", "0.60888004", "0.60878944", "0.607538...
0.6266855
9
don't need to define login because there's nothing that goes in it, same with home but leaving it there for reminder
def home end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_login\n login(\"rohitsjce@gmail.com\",\"codetheoryio\")\n end", "def login; end", "def login\n\tend", "def login\n end", "def login\n end", "def login\n end", "def login\n end", "def login\n end", "def login\n end", "def login\n end", "def login\n end", "def login\n e...
[ "0.73177105", "0.7241152", "0.70805424", "0.7076857", "0.7076857", "0.7076857", "0.7076857", "0.7076857", "0.7076857", "0.7076857", "0.7076857", "0.7076857", "0.7067627", "0.6940309", "0.6917434", "0.6917434", "0.6900706", "0.68891954", "0.6873086", "0.6862887", "0.67656183",...
0.0
-1
clear session, done after logout
def destroy session.clear redirect_to '/' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_session\n\t\tsession.clear\n\tend", "def clear_session\n @session = @login_info = nil\n end", "def clear_session\n session.clear\n end", "def logout!\n session.clear\n end", "def logout!\n session.clear\n end", "def logout!\n session.clear\n end", "def clear_sess...
[ "0.88098896", "0.8788531", "0.87514806", "0.8711549", "0.85835767", "0.85835767", "0.84334326", "0.8367724", "0.83286303", "0.83152664", "0.83152664", "0.82954144", "0.82798654", "0.8246233", "0.82120854", "0.819798", "0.81555146", "0.8150843", "0.81307375", "0.8123074", "0.8...
0.0
-1
give user created by google auth a session and redirect to user home page
def omniauth @user = User.create_by_google_omniauth(auth) session[:user_id] = @user.id redirect_to user_path(@user) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def google_sign_in(user)\n\t\t# Already created user from google acc\n\t\tsession[:user_id]=user.id\n\t\t# directed back to session_controller.\n\tend", "def create_google\n @user = GetOauthUser.new(:service_hash => omniauth_hash).call\n\n if @user\n establish_session @user\n redirect_to return_l...
[ "0.8181551", "0.75449103", "0.7501131", "0.73647857", "0.7360084", "0.7250715", "0.72398186", "0.7159845", "0.71494263", "0.70670885", "0.7033737", "0.70058054", "0.70028436", "0.69878054", "0.6978868", "0.6969305", "0.69450384", "0.69165677", "0.6893603", "0.68889236", "0.68...
0.775722
1
get data from env file
def auth request.env['omniauth.auth'] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_env_data(env)\n config_path = \"#{File.expand_path(\"../../\", __FILE__).gsub('features', '')}config/config.yml\"\n yml = YAML::load(File.read(config_path))\n yml[env.downcase]\nend", "def env_file\n dir['env.rb']\n end", "def read_env(file = '.env')\n if !ENV['ENV']\n File.open(file, \"...
[ "0.8056938", "0.7254151", "0.70743096", "0.7047099", "0.6859104", "0.6766254", "0.6647846", "0.66366863", "0.6632117", "0.65406746", "0.6460147", "0.6451404", "0.6451404", "0.6451404", "0.6451404", "0.6401518", "0.6386515", "0.63698626", "0.6357603", "0.63479304", "0.6346557"...
0.0
-1
This makes sure for isntance 1024 becomes [0,0,0,0,0,0,4,0] and in turn [4,0]
def bytes [self].pack("q>").bytes.to_a.drop_while{|x| x == 0} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def something\n max = self.max_size\n arrays = self.lifts_array\n arrays.each do |array|\n if array.size < max \n difference1 = max - array.size\n difference = difference1 / 2\n difference.times do \n array << 0\n array << \"0\"\n end\n else\n e...
[ "0.6624902", "0.61328495", "0.61235434", "0.6118042", "0.5938104", "0.5932858", "0.5886708", "0.58822775", "0.5876732", "0.5738176", "0.5736462", "0.5712202", "0.5703762", "0.5691505", "0.5675791", "0.5671478", "0.56462866", "0.56290174", "0.5605564", "0.5594689", "0.55787724...
0.0
-1
def genre_ids=(ids_for_genres) ids_for_genres.each do |genre_id| self.genres << Genre.find(genre_id) end end
def author_name if author author.full_name else 'No Author Found' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def genre=(genre)\n @genre = genre\n GENRES << genre\nend", "def genre=(genre)\n @genre = genre #assigns a genre to the song (song belongs to genre)\n genre.songs << self unless genre.songs.include?(self) #adds the song to the genre's collection of songs (genre has many songs); does not add the song to t...
[ "0.7408103", "0.7397275", "0.73613", "0.72699916", "0.72674733", "0.72464675", "0.7235752", "0.71631706", "0.71631706", "0.715199", "0.7141185", "0.7134633", "0.7104079", "0.70802873", "0.7040735", "0.70363", "0.7025308", "0.6862615", "0.6862615", "0.68452734", "0.68448454", ...
0.0
-1
GET /bids/1 GET /bids/1.json
def show @bid = Bid.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @bid } end authorize! :manage, @bid end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @bids = Bid.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bids }\n end\n end", "def index\n @bids = Bid.where(\"auction_id = ?\", params[:auction_id])\n\n render json: @bids\n end", "def index\n @bids = Bid.all\n end", "de...
[ "0.7316642", "0.72940105", "0.7085918", "0.7085918", "0.7085918", "0.7085918", "0.6833086", "0.6790436", "0.6663255", "0.65048826", "0.6488335", "0.6477471", "0.64463115", "0.63831323", "0.6349913", "0.6315001", "0.62983173", "0.62611383", "0.6250379", "0.6215613", "0.6203251...
0.57304966
42
GET /bids/new GET /bids/new.json
def new @bid = Bid.new respond_to do |format| format.html # new.html.erb format.json { render json: @bid } end authorize! :manage, @bid end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @bid = @swarm_request.bids.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bid }\n end\n end", "def new\n @bid = Bid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bid }\n end\n...
[ "0.7496531", "0.73489213", "0.73489213", "0.728023", "0.71174914", "0.6664957", "0.6653947", "0.65992606", "0.652772", "0.6489777", "0.6450561", "0.6395271", "0.6385277", "0.63619155", "0.6358876", "0.6326445", "0.6321947", "0.63161117", "0.6312895", "0.6284549", "0.6278423",...
0.6696161
5
POST /bids POST /bids.json
def create @user = current_user @product = Product.find(params[:product_id]) @bid = @user.bids.build @product.high_bidder = @user.id @bid.product = @product @product.current_price = @product.current_price + @product.current_price * 0.1 @product.save #implement later for time control...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @auction = Auction.find(params[:auction_id])\n params[:bid].reverse_merge!({owner_id: current_user.id})\n @bid = @auction.bids.build(params[:bid])\n \n respond_to do |format|\n if @bid.save\n format.html { redirect_to @auction, notice: 'You submitted a bid!'}\n ...
[ "0.68447447", "0.6685207", "0.64385206", "0.6362177", "0.6347325", "0.62413627", "0.62205774", "0.6212634", "0.620443", "0.6057686", "0.60175085", "0.6003951", "0.59786093", "0.597183", "0.59495384", "0.5935892", "0.59151524", "0.5855464", "0.5823328", "0.58200645", "0.580997...
0.5815826
20
PUT /bids/1 PUT /bids/1.json
def update @bid = Bid.find(params[:id]) respond_to do |format| if @bid.update_attributes(params[:bid]) format.html { redirect_to @bid, notice: 'Bid was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @bid = @swarm_request.bids.find(params[:id])\n\n respond_to do |format|\n if @bid.update_attributes(params[:bid])\n format.html { redirect_to(swarm_request_bid_url(:id => @bid.to_param, :swarm_request_id => @swarm_request.to_param), :notice => 'Bid was successfully updated.') }\n ...
[ "0.6879835", "0.67677456", "0.6642161", "0.6425714", "0.63788253", "0.6300821", "0.6202197", "0.61814135", "0.61256367", "0.6119356", "0.6119356", "0.6119356", "0.6119356", "0.6119356", "0.6119356", "0.6106487", "0.6102352", "0.6092546", "0.60766643", "0.6070816", "0.6070816"...
0.63410693
5
DELETE /bids/1 DELETE /bids/1.json
def destroy @bid = Bid.find(params[:id]) @bid.destroy respond_to do |format| format.html { redirect_to bids_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @bid = @swarm_request.bids.find(params[:id])\n @bid.destroy\n\n respond_to do |format|\n format.html { redirect_to(swarm_request_bids_url(:swarm_request_id => @swarm_request.to_param)) }\n format.xml { head :ok }\n end\n end", "def destroy\n @bid = Bid.find(params[:id])\n...
[ "0.7265017", "0.7011534", "0.69841284", "0.691064", "0.6892343", "0.68220365", "0.6776673", "0.67706794", "0.67293334", "0.67293334", "0.67293334", "0.67293334", "0.67293334", "0.6720355", "0.664227", "0.66281056", "0.65884835", "0.657224", "0.6567639", "0.6561069", "0.655938...
0.73180234
1
execute the search and run its actions
def search() @query_status = Query.for_queue(@queue) unless @query && @query_status return end total = 0 results = [] page = 1 @last_twid = @query_status.last_twid loop do # App.log.info("last_twid: " + @last_twid.to_s) results = fetch_page(page).select{|result| re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execute\n @model_class.search(KEYWORD)\n end", "def run\n self.prominence!\n return self.send_results if @query.any?\n\n self.fuzzy_match\n self.apply_narrowing_filters\n self.apply_limit\n self.load_and_sort_by_matches\n self.send_results\n end", "def execute_search\n...
[ "0.7475209", "0.7304377", "0.7283649", "0.7092081", "0.6914058", "0.6907542", "0.68996394", "0.6897319", "0.68756354", "0.6871859", "0.6825716", "0.6817816", "0.68047726", "0.67873526", "0.67873526", "0.67873526", "0.67873526", "0.67873526", "0.67873526", "0.67873526", "0.678...
0.0
-1
update the query status
def update_query_status(total) @query_status.last_twid = @last_twid @query_status.last_run = Time.now.utc @query_status.last_result_count = total @query_status.save! end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update!(**args)\n @date = args[:date] if args.key?(:date)\n @query_count_by_status = args[:query_count_by_status] if args.key?(:query_count_by_status)\n end", "def update!(**args)\n @date = args[:date] if args.key?(:date)\n @query_count_by_status = args[:query_count...
[ "0.6688124", "0.6688124", "0.6688124", "0.6688124", "0.66236174", "0.65903366", "0.6449525", "0.64352274", "0.64189225", "0.641443", "0.64049655", "0.63817847", "0.63817847", "0.63817847", "0.63817847", "0.63817847", "0.63817847", "0.636065", "0.6340218", "0.63337326", "0.631...
0.79606515
0
add a conversion job to the queue
def add_to_queue(result) @last_twid = @last_twid > result.id ? @last_twid : result.id App.log.info("pushing job to queue #{@queue.name}:\n#{result.text}\n#{"-"*80}") @queue.push(ConversionJob.new({ "queue_id" => @queue.id, "twid" => result.id, "from_user_id" => r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_to_queue\n if !queue_id.blank? && cancelling?\n # cancelling items already have a valid job payload on the queue - do not add again\n return\n end\n\n payload = AnalysisJobsItem.create_action_payload(analysis_job, audio_recording)\n\n result = nil\n error = nil\n\n begin\n ...
[ "0.7004597", "0.6896169", "0.67999756", "0.6408161", "0.63775694", "0.63246256", "0.6297046", "0.61584514", "0.61241007", "0.60401875", "0.5991856", "0.59873873", "0.59580046", "0.5957965", "0.59307635", "0.58833957", "0.5881176", "0.58786744", "0.58733386", "0.5861526", "0.5...
0.79376227
0
fetch a page of results from the twitter search api
def fetch_page(page) @client ||= Grackle::Client.new(:api=>:search) @client.search.json?(:q=>@query, :since_id=>@last_twid || 0, :rpp=>RESULTS_PER_PAGE, :page=>page).results end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_twitter()\n search_call = \"#{@api_endpoint_twitter}?ors=#{@search_term}&result_type=#{@result_type}&rpp=#{@results_per_page}\"\n @response = http_get search_call\n end", "def search\n @tweets = TwitterClient.search(params[:query], result_type: 'recent').take(20)\n render json: @tweets\n ...
[ "0.8108952", "0.7770472", "0.73969775", "0.7275508", "0.72751784", "0.72455955", "0.6956694", "0.695317", "0.68771285", "0.6826776", "0.6812767", "0.67780393", "0.6775992", "0.67448187", "0.6737454", "0.67218226", "0.67137986", "0.6712968", "0.66120744", "0.66113585", "0.6607...
0.6762725
13
layout 'posts' GET /posts GET /posts.json
def index @posts = Post.page(params[:page]).order('created_at desc') users = User.where 'account_id == ?', current_account.id if users[0] == nil then user = User.new user.account_id = current_account.id user.sitename = '<< no name >>' user.save users = User.where...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @posts = Post.find(params[:id])\n render json: @posts\n end", "def index\n @posts = Post.all\n render json: @posts\n end", "def index\n @posts = Post.all\n\n render json: @posts\n end", "def index\n @posts = Post.all\n\n render json: @posts\n end", "def inde...
[ "0.77448124", "0.75219595", "0.75105035", "0.75105035", "0.7505284", "0.7469503", "0.744089", "0.7430878", "0.742645", "0.742645", "0.742645", "0.74090856", "0.7361069", "0.73216724", "0.7313642", "0.72980523", "0.7247698", "0.724597", "0.7237507", "0.7228243", "0.7210058", ...
0.0
-1
GET /posts/1 GET /posts/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @posts = Post.find(params[:id])\n render json: @posts\n end", "def show\n render json: Post.find(params[\"id\"])\n end", "def show\r\n post = Post.find(params[:id])\r\n render json: post\r\n end", "def show\n @post = Post.find(params[:id])\n\n render json: @post\n end", ...
[ "0.77110183", "0.73537844", "0.73433185", "0.73379177", "0.73228735", "0.7293139", "0.7275997", "0.7256934", "0.7161576", "0.7158913", "0.71552676", "0.71552676", "0.7119547", "0.7094749", "0.7094749", "0.7094749", "0.70943594", "0.7071599", "0.70607626", "0.70452625", "0.703...
0.0
-1
POST /posts POST /posts.json
def create @posts = Post.page(params[:page]).order('created_at desc') @post = Post.new(post_params) @user = User.where('account_id == ?', current_account.id)[0] respond_to do |format| if @post.save format.html { redirect_to '/posts' } format.json { render :show, status: :created, l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n render json: Post.create(params[\"post\"])\n end", "def create\n respond_with Post.create(params[:posts])\n end", "def create\n @post = Post.create(post_params)\n render json: @post, serializer: PostSerializer\n end", "def create\n @post = Post.new(post_params)\n @po...
[ "0.74463975", "0.73221767", "0.73072433", "0.7123966", "0.7015686", "0.701327", "0.69841874", "0.6939327", "0.69313824", "0.69053805", "0.68196476", "0.6812792", "0.6793222", "0.6792862", "0.6779654", "0.6779654", "0.67625546", "0.67602354", "0.67515427", "0.6735786", "0.6698...
0.6479418
37
PATCH/PUT /posts/1 PATCH/PUT /posts/1.json
def update redirect_to '/posts' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n render json: Post.update(params[\"id\"], params[\"post\"])\n end", "def update\n respond_with Post.update(params[:id], params[:posts])\n end", "def update\n @post = Post.find(params[:id])\n respond_to do |format|\n if @post.update_attributes(params[:post])\n forma...
[ "0.7186282", "0.7042108", "0.6773305", "0.676692", "0.66699713", "0.66483396", "0.65782195", "0.6556628", "0.6550815", "0.65503174", "0.6534799", "0.65308446", "0.6499477", "0.6497078", "0.64680237", "0.6431206", "0.64281857", "0.64266086", "0.6426207", "0.6419313", "0.641812...
0.0
-1
DELETE /posts/1 DELETE /posts/1.json
def destroy redirect_to '/posts' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n render json: Post.delete(params[\"id\"])\n end", "def destroy\n @post.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n post = Post.find(params[:id])\n if post.destroy\n render json: {status: \"success\", data: {id: param...
[ "0.8047287", "0.7690689", "0.7584699", "0.758098", "0.75686055", "0.75052667", "0.7503448", "0.74758047", "0.7468409", "0.7466228", "0.74649256", "0.7460206", "0.7460206", "0.7460206", "0.7460206", "0.74587125", "0.74587125", "0.74587125", "0.74587125", "0.74587125", "0.74587...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_post @post = Post.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def post_params params.require(:post).permit(:title, :content, :user_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
Print summary of both values (first + second)
def calc_sum_two(first, second) puts "the sum of #{first} and #{second} is #{first + second}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_summary\n stats = [statistics[:total_code_loc], statistics[:total_spec_loc]]\n stats.push(stats[1].to_f / stats[0].to_f)\n \n puts \" Code LOC: %s Test LOC: %s Code to Test Ratio: 1:%1.1f\" % stats\n puts\n end", "def summary *args\n @summary = args...
[ "0.65547305", "0.64058495", "0.63943195", "0.63444966", "0.6329624", "0.6329624", "0.6329624", "0.6329624", "0.62666273", "0.62666273", "0.6202423", "0.62013173", "0.62013173", "0.61506426", "0.6148977", "0.60771966", "0.6077174", "0.605109", "0.60176456", "0.6003753", "0.598...
0.64732563
1
GET /orders GET /orders.json
def index #@orders = Order.all if current_user.admin? @orders = Order.all.order("created_at DESC").paginate(:page => params[:page], :per_page => 20) else @orders = current_user.orders.order("created_at DESC").paginate(:page => params[:page], :per_page => 10) end #@categories = Category.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getorders(args={})\n {\n :method=> \"GetOrders\"\n }.to_json\n end", "def orders\n params = { command: 'account_orders' }\n get('/json.php', params)\n end", "def index\n @orders = Order.all\n render json: @orders\n end", "def index\n @orders = Order.all\n ...
[ "0.8326041", "0.8153059", "0.80040073", "0.7947495", "0.784569", "0.7822416", "0.78030884", "0.7699251", "0.7697712", "0.7682738", "0.7682738", "0.7682738", "0.7682738", "0.7682717", "0.7588262", "0.7574177", "0.7561304", "0.75315773", "0.74857086", "0.7431969", "0.73695844",...
0.0
-1
GET /orders/1 GET /orders/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getorders(args={})\n {\n :method=> \"GetOrders\"\n }.to_json\n end", "def index\n @orders = Order.all\n render json: @orders\n end", "def index\n @orders = Order.all\n render json: @orders, status: 200\n end", "def index\n @orders = Order.order(\"id\").all\n\n resp...
[ "0.7554187", "0.7488565", "0.7475228", "0.73777765", "0.73714006", "0.7341344", "0.73384553", "0.73168725", "0.73018956", "0.7291244", "0.7291244", "0.7291244", "0.7291244", "0.72911215", "0.7281374", "0.7266143", "0.72498786", "0.7228276", "0.7213504", "0.71842283", "0.71261...
0.0
-1
POST /orders POST /orders.json
def create #@order = Order.new(order_params) @order = current_user.orders.build(order_params) @order.add_line_items_from_cart(@cart) @amount = @cart.total_price.to_i * 100 customer = Stripe::Customer.create( email: params[:stripeEmail], source: params[:stripeToken] ) charg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def orders\n authenticated_post(\"orders\").body\n end", "def orders\n authenticated_post(\"auth/r/orders\").body\n end", "def create\n order = Order.create(order_params)\n render json: order\nend", "def submit_order()\n\tputs \"Submitting order\"\n\tdata = create_order()\n\tresponse = ...
[ "0.75886714", "0.7490972", "0.7488501", "0.74664384", "0.72739846", "0.7195349", "0.7063682", "0.69745994", "0.6910657", "0.68880194", "0.68747663", "0.685004", "0.6840204", "0.6838178", "0.6838178", "0.6838178", "0.6838178", "0.682244", "0.6790037", "0.67793274", "0.6779247"...
0.0
-1
PATCH/PUT /orders/1 PATCH/PUT /orders/1.json
def update respond_to do |format| if @order.update(order_params) format.html { redirect_to @order, notice: 'Order was successfully updated.' } format.json { render :show, status: :ok, location: @order } else format.html { render :edit } format.json { render json: @order.e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @order = Order.find(params[:id])\n\n if @order.update(order_params)\n head :no_content\n else\n render json: @order.errors, status: :unprocessable_entity\n end\n end", "def update\n @order = Order.find(params[:id])\n\n if @order.update(order_params)\n head :no_conte...
[ "0.6802842", "0.6802842", "0.6775041", "0.67438585", "0.6735413", "0.6727097", "0.6723568", "0.67197806", "0.67049384", "0.6704871", "0.6704871", "0.6704871", "0.6704871", "0.6704871", "0.6704871", "0.6704871", "0.6704871", "0.6704871", "0.6704871", "0.6704871", "0.6704871", ...
0.0
-1
DELETE /orders/1 DELETE /orders/1.json
def destroy @order.destroy respond_to do |format| format.html { redirect_to orders_url, notice: 'Order was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @v1_order = V1::Order.find(params[:id])\n @v1_order.destroy\n\n head :no_content\n end", "def destroy\n @order1 = Order1.find(params[:id])\n @order1.destroy\n\n respond_to do |format|\n format.html { redirect_to order1s_url }\n format.json { head :no_content }\n end\...
[ "0.7591194", "0.747362", "0.7429384", "0.73711056", "0.73708886", "0.7370632", "0.7356767", "0.7356767", "0.7356767", "0.7356767", "0.7356767", "0.7346855", "0.7346855", "0.7346855", "0.7346855", "0.7346855", "0.7346855", "0.7346855", "0.7346855", "0.7346855", "0.7346855", ...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_order @order = Order.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def order_params params.require(:order).permit(:pay_type, :address, :stripeEmail, :stripeToken, :stripe_card_token, :product_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
If you're using AutoscalingBootstrap to create a new ELB, that name goes here
def elb_name=(str) @elb_name = str end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_auto_scaling \n AWS::AutoScaling.new(:auto_scaling_endpoint => \"autoscaling.#{AMI_REGION}.amazonaws.com\")\nend", "def create_elb(elb)\n resp = aws_api_connect(\"ELB_Client\")\n begin\n pants = resp.create_load_balancer({\n load_balancer_name: elb[:name],\n listeners: [\n {\n...
[ "0.69061524", "0.67470187", "0.6716204", "0.6509005", "0.62201685", "0.616548", "0.60989124", "0.5907382", "0.5907382", "0.5733388", "0.5646197", "0.5634782", "0.5627658", "0.5625028", "0.5593386", "0.55669516", "0.55453116", "0.55148226", "0.55103433", "0.55070335", "0.54574...
0.5561536
16
Using variables passed in, generate user data file
def generate_user_data(userdata_dir, bootstrap_script, config) ERB.new( File.new(File.join(userdata_dir, bootstrap_script)).read, nil, '-' ).result(binding) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_data!\n start_dir = Dir.pwd\n \n Dir.chdir tool_path\n system \"./generate -pc #{product_factor} -fn #{filename} -fc\"\n ensure\n Dir.chdir start_dir\n end", "def user_data(instance)\n hostname = instance[\"hostname\"]\n # write specific per instance cloud-init confi...
[ "0.6534886", "0.6387762", "0.62336093", "0.6111031", "0.6078598", "0.6054507", "0.5970801", "0.59336394", "0.59281564", "0.59163314", "0.5879696", "0.5848639", "0.5808675", "0.58084387", "0.5807046", "0.5747532", "0.5741986", "0.5741401", "0.5699366", "0.5693416", "0.5673781"...
0.65833896
0
Check if we allow clobbering and need to clobber
def check_clobber(opts, config) fail Tapjoy::AutoscalingBootstrap::Errors::ClobberRequired if check_as_clobber(**opts, **config) puts "We don't need to clobber" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clobber(*includes)\n Rake.application.IncludeClobberTargets(includes)\n end", "def offer_to_overwrite_conflicts\n @host.overwrite = \"true\" if @host.errors.any? and @host.errors.are_all_conflicts?\n end", "def clobber\n rm_r(srcdir)\n rm_r(blddir)\n rm_r(libdir)\n rm_r(conf...
[ "0.5986086", "0.57403255", "0.55791146", "0.55518526", "0.5498995", "0.54911387", "0.54592115", "0.5386684", "0.53555053", "0.53498936", "0.5337371", "0.5297694", "0.52858853", "0.52833694", "0.52809346", "0.52669007", "0.52357155", "0.5229142", "0.5228914", "0.5223487", "0.5...
0.7100273
0
See what version of the yaml we are running
def check_yaml_version(config) # If we don't have one specified assume v1 config[:version] ? config[:version] : "1.0.0" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def docker_version() ; info[:docker_version] ; end", "def loaded_config_version; end", "def loaded_config_version; end", "def version\n read_property 'Version'\n end", "def version\n @version ||= config(\"version\", \"0.0.1\")\n end", "def config_version\n @attributes[:config_ver...
[ "0.67725146", "0.67651474", "0.67651474", "0.65780026", "0.6533408", "0.63644576", "0.6364249", "0.63516414", "0.6340926", "0.63308066", "0.6317984", "0.6281915", "0.6279746", "0.6251743", "0.6251743", "0.6251743", "0.6243827", "0.62405777", "0.6208967", "0.6196441", "0.61818...
0.74204487
0
Clean list of ELBs
def elb_list(config) config[:elb].map(&:keys).flatten.join(',') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_li_listsings(li_values)\n li_values.css(\"li\").css(\"a\").map {|li| [li.attributes[\"href\"].value.split(\"/\").last, li.text] }\n end", "def unset_all_tags\n @deployment.servers_no_reload.each do |s|\n # can't unset ALL tags, so we must set a bogus one\n s.tags = [{\"name\"=>\"...
[ "0.5632461", "0.54817635", "0.5389503", "0.5380785", "0.5380785", "0.5380785", "0.53085405", "0.5284449", "0.5261338", "0.520592", "0.5199736", "0.5175812", "0.51508814", "0.51180863", "0.50844264", "0.5074068", "0.5064477", "0.5054512", "0.5052035", "0.5051757", "0.50367", ...
0.520748
9
Confirm config settings before running autoscaling code
def confirm_config(keypair:, zones:, security_groups:, instance_type:, image_id:, iam_instance_profile:, prompt:, use_vpc: use_vpc, vpc_subnets: nil, has_elb: has_elb, config:, termination_policies:, **unused_values) puts ' Preparing to configure the following autoscaling group:' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confirm_configuration\n confirm_step(:confirm_configuration)\n check_required\n end", "def check_configure\n apply_task_params(true)\n enable_variants\n unless Cache.instance[\"configuration_data\"][\"configured\"]\n if @script.autoconf\n configure\n end\n ...
[ "0.652166", "0.61397094", "0.59791344", "0.59107965", "0.58833855", "0.585126", "0.5845361", "0.5775155", "0.57532287", "0.5729988", "0.5709509", "0.5699191", "0.5644088", "0.5557039", "0.55190027", "0.5511181", "0.5499644", "0.54853576", "0.5472756", "0.5469583", "0.5440778"...
0.7044274
0
Check if security group exists and create it if it does not
def sec_group_exists(groups) groups.each do |group| begin puts "Verifying #{group} exists..." group = Tapjoy::AutoscalingBootstrap::AWS::EC2.describe_security_groups(group) rescue Aws::EC2::Errors::InvalidGroupNotFound => err STDERR.puts "Warning: #{err}" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ensure_security_group_prepared\n provider.create_security_group(system_config.security_group, required_public_ports)\n end", "def create_secgroup(group)\n connect = aws_api_connect('EC2_Client')\n begin\n p group[:name]\n sec_id = connect.describe_security_groups({\n filters: [\n ...
[ "0.742731", "0.73788494", "0.7366194", "0.73355585", "0.73331946", "0.7209726", "0.70928437", "0.70911574", "0.70814353", "0.69527274", "0.6951067", "0.6898731", "0.67898524", "0.67183954", "0.6718309", "0.67094636", "0.6682101", "0.6668888", "0.666473", "0.6663505", "0.66480...
0.7841249
1
TODO: OMG THIS IS WAY TOO LONG
def process_mail(mail) @files_to_commit = [] keyvals = { :tags => "", # a YAML array :markup => @blog.markup, :slug => nil, :published => true, :layout => "post", } subject = mail.subject return false unless is_subject_valid?(subject, keyvals) # v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def probers; end", "def schubert; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def formation; end", "def suivre; end", "def stderrs; end", "def offences_by; end", "def weber; end", "def terpene; end", "def identify; end", "def ve...
[ "0.72018415", "0.65945524", "0.6360035", "0.61980325", "0.61980325", "0.61980325", "0.61980325", "0.60217106", "0.59133935", "0.588567", "0.58761847", "0.5857011", "0.58493316", "0.5818546", "0.57978994", "0.577699", "0.57734156", "0.57311016", "0.5708573", "0.5708573", "0.57...
0.0
-1
TODO: refactor me into multiple methods
def process_multipart_mail(mail, body, images_needing_replacement, keyvals) html_part = -1 txt_part = -1 #Figure out which part is html and which #is text mail.parts.each_with_index do |p, idx| if p.content_type.start_with?("text/html") html_part = idx elsif p.content_type.start...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def probers; end", "def schubert; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def suivre; end", "def identify; end", "def formation; end", "def implementation; end", "def implementation; end", "def operations; end", "def operation...
[ "0.72699726", "0.6396529", "0.6377754", "0.6283823", "0.6283823", "0.6283823", "0.6283823", "0.61249095", "0.6068648", "0.6024738", "0.590375", "0.590375", "0.58257097", "0.58257097", "0.5805805", "0.57267946", "0.57089186", "0.5678245", "0.5678245", "0.56677526", "0.5666114"...
0.0
-1
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
def document_selector attributes.fetch(:documentSelector) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def selector\n @selector ||= climb({ \"_id\" => _root.id }) do |document, value|\n value[\"#{document.path}._id\"] = document.id; value\n end\n end", "def query_selector(selector)\n document.query_selector selector\n end", "def server_selector\n @server_selector ||= Ser...
[ "0.6419798", "0.55847627", "0.552872", "0.5436941", "0.5323006", "0.5273802", "0.5267735", "0.52674943", "0.52036124", "0.50797176", "0.50477594", "0.5004154", "0.4998262", "0.48959288", "0.4892503", "0.48760754", "0.48599246", "0.48297074", "0.4814002", "0.4814002", "0.47815...
0.6895065
1
An optional identifier under which the diagnostics are managed by the client.
def identifier attributes.fetch(:identifier) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identifier_string\n change_loggable.identifier_string rescue \"unknown\"\n end", "def identifier\n @info.identifier\n end", "def identifier\n @info.identifier\n end", "def simple_identifier\n {\n id: @se_identifier.to_s,\n message: 'identifier is missing required el...
[ "0.6011768", "0.5973442", "0.5973442", "0.5937441", "0.5870883", "0.5870883", "0.5805675", "0.579615", "0.57353985", "0.56774455", "0.56539077", "0.5653518", "0.56422675", "0.5618378", "0.5578911", "0.557153", "0.5521324", "0.54763985", "0.5459999", "0.54475844", "0.5440736",...
0.0
-1
Whether the language has inter file dependencies meaning that editing code in one file can result in a different diagnostic set in another file. Inter file dependencies are common for most programming languages and typically uncommon for linters.
def inter_file_dependencies attributes.fetch(:interFileDependencies) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dependency_met?\n true\n end", "def meets_pods_project_source_dependency(source_filename, dependent_source_filename)\n has_pods_project_source_file(source_filename) ? has_pods_project_source_file(dependent_source_filename) : true\nend", "def meets_pods_project_source_dependency(source_filename, de...
[ "0.6484812", "0.6354322", "0.6354322", "0.62092525", "0.62092525", "0.6154517", "0.60931206", "0.60740244", "0.60318154", "0.59154034", "0.5912645", "0.58908856", "0.58712023", "0.5854364", "0.58492553", "0.58437157", "0.5829227", "0.58051616", "0.5798708", "0.57947826", "0.5...
0.56994665
25
The server provides support for workspace diagnostics as well.
def workspace_diagnostics attributes.fetch(:workspaceDiagnostics) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rpc_current_workspace\n db_check\n { \"workspace\" => self.framework.db.workspace.name, \"workspace_id\" => self.framework.db.workspace.id }\n end", "def workspace_info\n link_to_workspace_info(\"http://library.nyu.edu/info/myworkspace.html\", \"left\")\n end", "def workspace_show(parame...
[ "0.6239733", "0.59037197", "0.5838877", "0.58335423", "0.5817978", "0.5817978", "0.5817978", "0.5817978", "0.57503855", "0.57212186", "0.5697048", "0.5663104", "0.55502397", "0.54918903", "0.5483182", "0.54824764", "0.5456979", "0.54555964", "0.54555964", "0.54555964", "0.545...
0.55712557
12
The id used to register the request. The id can be used to deregister the request again. See also Registrationid.
def id attributes.fetch(:id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request_id\n # FIXME make this number configurable and document the probabilities of clashes\n @request_id ||= SecureRandom.hex(DEFAULT_REQUEST_ID_LENGTH)\n end", "def id\n # FIXME: make this number configurable and document the probabilities of clashes\n @id ||= @env[Action:...
[ "0.7454776", "0.73551255", "0.72371554", "0.72371554", "0.72012115", "0.7010974", "0.69810784", "0.69777936", "0.69777936", "0.6842972", "0.6838054", "0.6827672", "0.6623343", "0.6596519", "0.6596176", "0.6574785", "0.6520533", "0.64881283", "0.648424", "0.6481379", "0.641436...
0.0
-1
calls the two methods below passing instance variables as parameters
def virus_effects predicted_deaths speed_of_spread end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calls; end", "def calls; end", "def probers=(_arg0); end", "def parameters; end", "def parameters; end", "def parameters; end", "def parameters; end", "def parameters; end", "def parameters; end", "def parameters; end", "def parameters; end", "def instance_variables() end", "def paramet...
[ "0.6066181", "0.6066181", "0.60002685", "0.5989861", "0.5989861", "0.5989861", "0.5989861", "0.5989861", "0.5989861", "0.5989861", "0.5989861", "0.5978323", "0.5927383", "0.5915157", "0.590652", "0.58791476", "0.58791476", "0.58791476", "0.58791476", "0.58791476", "0.58791476...
0.0
-1
determines predicted deaths in a state based on population density and population size (+ a fixed % to apply to it)
def predicted_deaths # predicted deaths is solely based on population density number_of_deaths = if @population_density >= 200 (@population * 0.4).floor elsif @population_density >= 150 (@population * 0.3).floor elsi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predicted_deaths\n # predicted deaths is solely based on population density\n STATE_FORMULA.each do |state_size, calculation|\n if @population_density >= calculation[:pop_density]\n return number_of_deaths = (@population * calculation[:deaths]).floor\n end\n end\n number_of_deaths ...
[ "0.8536596", "0.85147345", "0.8510475", "0.8468699", "0.8468247", "0.8427181", "0.8423084", "0.8419381", "0.8418857", "0.8418323", "0.8418323", "0.8418323", "0.8418323", "0.8418323", "0.8417734", "0.84173274", "0.84159064", "0.84159064", "0.84159064", "0.84159064", "0.8415906...
0.0
-1
takes in population_density then calculates and prints speed
def speed_of_spread #in months # We are still perfecting our formula here. The speed is also affected # by additional factors we haven't added into this functionality. speed = if @population_density >= 200 0.5 elsif @population_density >= 150 1 elsif ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def speed_of_spread(population_density) #in months\n if @population_density >= 200\n speed = 0.5\n elsif @population_density >= 150\n speed = 1\n elsif @population_density >= 100\n speed = 1.5\n elsif @population_density >= 50\n speed = 2\n else \n speed = 2.5\n end\n\n ...
[ "0.7579581", "0.748573", "0.748573", "0.74415004", "0.73912835", "0.7331615", "0.7312518", "0.7301723", "0.72627187", "0.72518516", "0.7244665", "0.7244665", "0.7244665", "0.7244665", "0.7225928", "0.71998143", "0.7184342", "0.71790326", "0.7177099", "0.7166954", "0.7151867",...
0.68687236
90
GET /minutes/1 GET /minutes/1.xml
def show @minute = Minute.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @minute } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @minute = Minute.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @minute }\n end\n end", "def show\n @company_minute = CompanyMinute.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { ...
[ "0.63706416", "0.6068426", "0.57254404", "0.5451189", "0.543272", "0.5407796", "0.53916675", "0.53668153", "0.53667885", "0.5356544", "0.530902", "0.53015447", "0.5282837", "0.52486736", "0.52237904", "0.5222088", "0.52205634", "0.5194988", "0.51727414", "0.51633495", "0.5160...
0.6922635
0
GET /minutes/new GET /minutes/new.xml
def new @minute = Minute.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @minute } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @company_minute = CompanyMinute.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @company_minute }\n end\n end", "def new\n @countdown = Countdown.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { re...
[ "0.69622225", "0.6736143", "0.6607605", "0.6570045", "0.6551787", "0.65448797", "0.6544432", "0.6531261", "0.6509289", "0.63995725", "0.63324946", "0.6313526", "0.629552", "0.628855", "0.628855", "0.6287286", "0.62817454", "0.6269366", "0.6269366", "0.6251309", "0.62479776", ...
0.77903676
0
POST /minutes POST /minutes.xml
def create params[:minute][:content] = '' if params[:minute][:content]=="Enter the action items here, e.g: \r\nEvaluate tools for startups @Joseluis #Tools [19-Sep-2011]\r\nRun a few tests in staging @Rebecca #Tests [Tomorrow]" params[:minute][:name] = '' if params[:minute][:name]=="Untitled Minute" @m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @time_balance = TimeBalance.new(params[:time_balance])\n @time_balance.minutes = 0 if not @time_balance.minutes or @time_balance.minutes == nil\n\n respond_to do |format|\n if @time_balance.save\n Notifier.new_minutes(@time_balance).deliver\n format.html { redirect_to @time...
[ "0.60690904", "0.6014304", "0.5885072", "0.5804507", "0.57591486", "0.5326177", "0.52859914", "0.52747583", "0.52672833", "0.5187824", "0.51625335", "0.51586866", "0.5156156", "0.50792193", "0.50671566", "0.5065724", "0.50485116", "0.4952174", "0.49427074", "0.49143648", "0.4...
0.57678604
4
PUT /minutes/1 PUT /minutes/1.xml
def update # checar params[:regenerateTasks] @minute = Minute.find(params[:id]) respond_to do |format| if @minute.update_attributes(params[:minute]) if params[:regenerateTasks]=="1" @tasks = @minute.get_tasks_from_description(params[:minute][:content], current_user.id) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @minutes_minute.update(minutes_minute_params)\n format.html { redirect_to @minutes_minute, notice: 'Protokoll erfolgreich bearbeitet.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json ...
[ "0.6083236", "0.55762255", "0.55281466", "0.55057466", "0.54637957", "0.5426322", "0.5390643", "0.5368446", "0.53237814", "0.5320486", "0.53087956", "0.5303844", "0.52755004", "0.52626395", "0.52603805", "0.5218518", "0.5193554", "0.5190825", "0.5180333", "0.5157133", "0.5149...
0.62809557
0
DELETE /minutes/1 DELETE /minutes/1.xml
def destroy @minute = Minute.find(params[:id]) @minute.destroy respond_to do |format| format.html { redirect_to(minutes_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @minutes_minute.destroy\n respond_to do |format|\n format.html { redirect_to minutes_minutes_url, notice: 'Protokoll erfolgreich gelöscht.' }\n format.json { head :no_content }\n end\n end", "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n ...
[ "0.6516073", "0.63068753", "0.6155413", "0.61415267", "0.60799354", "0.60523456", "0.60082704", "0.59777635", "0.59664524", "0.59476465", "0.5927631", "0.5904886", "0.5890676", "0.5888566", "0.5883684", "0.5880129", "0.5876815", "0.5846884", "0.5806015", "0.5794103", "0.57931...
0.7438899
0
GET /notify_observers/1 GET /notify_observers/1.json
def show @notify_observer = NotifyObserver.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render :json => @notify_observer } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @notify_observer = NotifyObserver.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @notify_observer }\n end\n end", "def notifications(params={})\n Endpoints::Notifications.new(self).get(params)\n end", "def show\n @notify_config...
[ "0.6679375", "0.6350663", "0.62022144", "0.6148225", "0.60914654", "0.5997011", "0.59696573", "0.5941806", "0.5937846", "0.5897938", "0.5873139", "0.5842152", "0.581177", "0.5802769", "0.58006495", "0.5796618", "0.5796242", "0.57929915", "0.5782998", "0.5771536", "0.5760723",...
0.7137802
0
GET /notify_observers/new GET /notify_observers/new.json
def new @notify_observer = NotifyObserver.new respond_to do |format| format.html # new.html.erb format.json { render :json => @notify_observer } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @notify = Notify.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @notify }\n end\n end", "def new\n @new_city_notification = NewCityNotification.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { rende...
[ "0.7437638", "0.6821567", "0.67940336", "0.6630634", "0.65612787", "0.6519853", "0.643303", "0.63937074", "0.6366645", "0.6334044", "0.6258785", "0.6256312", "0.6230163", "0.61961436", "0.6184669", "0.6177883", "0.6164019", "0.6161905", "0.6122316", "0.6095881", "0.60663867",...
0.8061594
0
POST /notify_observers POST /notify_observers.json
def create @notify_observer = NotifyObserver.new(params[:notify_observer]) @notify_observer.save @properties = params[:notify_observer_properties] for property in @properties @notify_observer.notify_observer_properties.create(:name => property) end if @properties respond_to do ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def notify\n @observers.each { |observer| observer.update }\nend", "def notify(params)\n client.post('/notify', params)\n end", "def notify_observers(*args)\n return unless changed?\n\n unwrap(connection).exec \"NOTIFY #{channel}, #{args}\"\n\n changed false\n end", "def no...
[ "0.66861117", "0.66156477", "0.6432171", "0.63168323", "0.62884223", "0.62785906", "0.6182468", "0.61646575", "0.6153129", "0.61447895", "0.61443645", "0.6140239", "0.6075427", "0.6058974", "0.6058799", "0.601907", "0.60101265", "0.5998924", "0.5998924", "0.59515643", "0.5939...
0.6469427
2
PUT /notify_observers/1 PUT /notify_observers/1.json
def update @notify_observer = NotifyObserver.find(params[:id]) respond_to do |format| if @notify_observer.update_attributes(params[:notify_observer]) format.html { redirect_to @notify_observer, notice: 'Notify observer was successfully updated.' } format.json { head :no_content } el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def notify\n @observers.each { |observer| observer.update }\nend", "def send_update\n changed\n notify_observers(self)\n end", "def update\n respond_to do |format|\n if update = @incident.add_update(change: incident_params, comment: params[:comment])\n notified_channels.each do |ch|\n ...
[ "0.6628566", "0.6173911", "0.61720085", "0.6171948", "0.6167479", "0.60883677", "0.60636115", "0.59069836", "0.5865832", "0.5840024", "0.5823833", "0.5820939", "0.5803311", "0.5742201", "0.57386994", "0.5728982", "0.5728544", "0.5719092", "0.57188064", "0.5713792", "0.5696249...
0.7065118
0
DELETE /notify_observers/1 DELETE /notify_observers/1.json
def destroy @notify_observer = NotifyObserver.find(params[:id]) @notify_observer.destroy respond_to do |format| format.html { redirect_to notify_observers_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @notify = Notify.find(params[:id])\n @notify.destroy\n\n respond_to do |format|\n format.html { redirect_to notifies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @notify_config = NotifyConfig.find(params[:id])\n @notify_config.destroy\n\n res...
[ "0.6881463", "0.6876431", "0.6684027", "0.66701657", "0.65536404", "0.65410644", "0.65313417", "0.6520619", "0.64755195", "0.64400285", "0.63851124", "0.63587797", "0.63226056", "0.63226056", "0.63226056", "0.63226056", "0.63192177", "0.6294157", "0.6285829", "0.6262645", "0....
0.7737706
0
Start a named child process and execute the provided block in it.
def start(name, &block) Process.fork(name: name, &block) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fork_child(&block)\n Process.fork &block\n end", "def process(process_name, &block)\n process_proxy = ProcessMethods.new(process_name.to_s, self)\n \n # Assigns all attributes from application scope and assigns to process\n assign_global_attributes(process_proxy)\n ...
[ "0.72448087", "0.68582743", "0.65173846", "0.6454191", "0.6418816", "0.6411056", "0.6304653", "0.62689346", "0.6140041", "0.61296874", "0.60901755", "0.60745335", "0.6020331", "0.60060644", "0.5925818", "0.59183204", "0.5865766", "0.5815029", "0.5800491", "0.5772588", "0.5766...
0.7552368
0
specifies what we can write to the database as a new entry we can write a title and description to the database
def url_params params.require(:url).permit(:link) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save\n conn = Sandwich.open_connection\n\n if self.id\n #Update\n sql = \"UPDATE sandwich SET title='#{self.title}', description='#{self.description}' WHERE id=#{self.id}\"\n else\n #Add\n sql= \"INSERT INTO sandwich (title, description) VALUES ('#{self.title}','#{self.description}...
[ "0.62744445", "0.6106109", "0.60205317", "0.60157704", "0.5984782", "0.58734274", "0.5837264", "0.583067", "0.58005786", "0.5790685", "0.57693106", "0.5751783", "0.5733796", "0.5730341", "0.57181495", "0.5701026", "0.5690655", "0.5671027", "0.5623484", "0.56016845", "0.560014...
0.0
-1
The id field name used for identifying specific Action objects via Zabbix API
def indentify 'name' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def objname\n id\n end", "def name\n # The name must be a string\n id.to_s\n end", "def id\n name\n end", "def id\n name\n end", "def id\n name\n end", "def id\n \"#{kind}_#{@id}\"\n end", "def id\n \"#{kind}_#{@id}\"\n end", "def nam...
[ "0.6521814", "0.6355766", "0.63347155", "0.63347155", "0.63157034", "0.6311015", "0.6311015", "0.6310895", "0.6295071", "0.62894285", "0.6222165", "0.62011933", "0.61963046", "0.6194393", "0.6183853", "0.61700773", "0.6131356", "0.60967237", "0.6085745", "0.606408", "0.605477...
0.0
-1
Figure out who the winnar is!
def hof(m, params) fool = m.sourcenick tmpKey = params[:key].to_s targetKey = tmpKey.to_sym m.reply("Checking out the #{tmpKey} HoF...") tmp = @registry.to_hash tmp.delete("totals") sorted = tmp.sort { |a,b| b[1][targetKey] <=> a[1][targetKey] } winnersLeft = 5 winners = [] sor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def this_person_win?(who)\n\t\t@counter= 0\n\n\t\t@winners.each do |key,value|\n\n\t\t break if @counter == 3 \n\n\t\t\tvalue.each do |x| \n\t\t \t um = eval(\"@\"+who +\"_position.include?(x)\")\n\t\t \t\tif \tum == true then\n\n\t\t \t @counter +=1 \n\t\t\t\n\t\t \t\t\n\t\t \t puts \"#{username} WINS\"...
[ "0.6794631", "0.6432052", "0.6398652", "0.6359156", "0.6352652", "0.63446194", "0.6326237", "0.6325512", "0.6281253", "0.6234906", "0.62221456", "0.62189764", "0.6214252", "0.6208094", "0.6206194", "0.6204634", "0.6195003", "0.61915195", "0.6167195", "0.6155528", "0.6144617",...
0.0
-1
Gets the Association for the given server url and handle.
def get_association(server_url, handle = nil) assns = query_associations(server_url, handle) assns.reverse.each do |assn| a = assn.from_record if a.expires_in == 0 assn.destroy else return a end end if assns.any? return nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_association(server_url, handle=nil)\n raise NotImplementedError\n end", "def get_association(server_url, handle=nil)\n serialized = @cache_client.get(assoc_key(server_url, handle))\n if serialized\n return deserialize(serialized)\n else\n return nil\n ...
[ "0.8446435", "0.84294343", "0.8253541", "0.6155563", "0.58642125", "0.5695428", "0.55984503", "0.53754467", "0.5362927", "0.5324828", "0.5323396", "0.50846857", "0.50327384", "0.50292397", "0.4991731", "0.4957044", "0.48547876", "0.4837", "0.47466004", "0.4736384", "0.4732080...
0.7477305
3
Stores an Association for the given server url and OpenID::Association.
def store_association(server_url, assoc) remove_association(server_url, assoc.handle) Association.create(:server_url => server_url, :handle => assoc.handle, :secret => Moped::BSON::Binary.new(:generic, assoc.secret), :issued...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def store_association(server_url, association)\n oa = OpenidAssociation.new\n oa.server_url = server_url\n oa.target = targetize(server_url)\n oa.handle = association.handle\n oa.secret = association.secret\n oa.issued = association.issued\n oa.lifetime = associatio...
[ "0.89128214", "0.80983216", "0.8052341", "0.7863225", "0.59333813", "0.5858888", "0.5601765", "0.55553067", "0.54782164", "0.54765683", "0.5445348", "0.54353404", "0.54292893", "0.5416451", "0.5406446", "0.5325762", "0.53215736", "0.52243894", "0.51839113", "0.5154365", "0.51...
0.8644479
1
Creates a Nonce for the given information.
def use_nonce(server_url, timestamp, salt) return false if any_nonces?(server_url, timestamp, salt) || delta_beyond_skew?(timestamp) Nonce.create(:server_url => server_url, :timestamp => timestamp, :salt => salt) return true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gen_nonce\n Time.now.utc.to_i.to_s\n end", "def identity_create\n # Potential threat of overlap\n identity = Identity.create(uid:rand(100000000..9999999999), provider: 'registration')\n identity.user_id = resource.id\n identity.name = params['user']['name'] #Looks very ugly\n identity....
[ "0.59492886", "0.586249", "0.58302337", "0.58302337", "0.5792179", "0.57009035", "0.5695269", "0.5588308", "0.5587837", "0.5582987", "0.5572934", "0.554688", "0.5512468", "0.54963166", "0.54846233", "0.5479743", "0.54577386", "0.5455441", "0.5415838", "0.5372558", "0.5361229"...
0.55590594
11
before_action :group_params, only: :create
def create @group = Group.find(params[:message][:group_id]) # @message = current_user.messages.build(params[:message]) @message = current_user.messages.build(content: params[:message][:content], picture: params[:message][:picture]) # Group.find(params[:message][:group_id]).messages << @message @gr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def group_params\n params.require(:group).permit!\n end", "def group_params\n # params.require(:group).permit(:title, :description)\n end", "def group_params\n params.require(:group).permit(:title)\n end", "def group_params\n params.require(:group).permit(:group_name)\n end", "def group...
[ "0.77382267", "0.7488651", "0.7397759", "0.7396095", "0.7346473", "0.7346473", "0.7346473", "0.7337591", "0.73113525", "0.72680163", "0.7264015", "0.72305596", "0.72305596", "0.7221277", "0.7221277", "0.7221277", "0.7221277", "0.7221277", "0.7221277", "0.7221277", "0.72088915...
0.0
-1
def message_params params.require(:message).permit(:content, :picture) end
def correct_user @message = current_user.messages.find_by(id: params[:id]) redirect_to group_url if @message.nil? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def message_params\n params.require(:message).permit(:content, :image)\n end", "def message_params\n params.require(:message).permit(:title, :article, :description, :picture)\n end", "def message_params\n params.require(:message).permit(:content)\n end", "def message_params\n params....
[ "0.9318103", "0.91689545", "0.84608793", "0.84209424", "0.8396392", "0.8396392", "0.8396392", "0.8396392", "0.8396392", "0.83861864", "0.8297763", "0.8214311", "0.8197464", "0.8194481", "0.81933993", "0.8170521", "0.80995977", "0.8054397", "0.8041404", "0.8028981", "0.8018798...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_system_test @system_test = SystemTest.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.61637366", "0.60446453", "0.59452957", "0.591511", "0.58885515", "0.5834122", "0.57761765", "0.5702554", "0.5702554", "0.5652102", "0.5619581", "0.5423898", "0.5409782", "0.5409782", "0.5409782", "0.5394745", "0.53780794", "0.5356209", "0.5338898", "0.53381324", "0.5328622...
0.0
-1
Only allow a trusted parameter "white list" through.
def system_test_params params.require(:system_test).permit(:title, :status, :description, :r_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", ...
[ "0.7121862", "0.70524937", "0.6947974", "0.69016707", "0.6735245", "0.67157984", "0.66887176", "0.66779864", "0.6660236", "0.6554225", "0.6527208", "0.6456831", "0.6451704", "0.64509416", "0.64478475", "0.6432556", "0.6411603", "0.6411603", "0.6389978", "0.63789994", "0.63789...
0.0
-1
Create a new instance
def initialize super() end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n \n end", "def new\n \n end", "def new\n \n end", "def new\n \n end", "def new\n \n end", "def new\n \n end", "def newInstance( params={} )\n model.new( params ).extend( InstanceMethods )\n end", "def new; end", "def new; end", "def new; end", "def new; end"...
[ "0.7774979", "0.7774979", "0.7774979", "0.7774979", "0.7774979", "0.7706133", "0.76376265", "0.7614688", "0.7614688", "0.7614688", "0.7614688", "0.7614688", "0.7614688", "0.7614688", "0.7614688", "0.7614688", "0.7550588", "0.75246334", "0.74862075", "0.7480368", "0.7401344", ...
0.0
-1
Create a digest of the content
def digest '' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def digest(data); end", "def digest\n digest = ''\n @entries.each { |entry| digest << entry.digest << ' ' }\n digest\n end", "def digest\n @digest ||= DEFAULT_DIGEST_PROC\n end", "def digest_for(entry) \n MD5.hexdigest( [ entry.title, entry.content, entry.date_published ]....
[ "0.7819154", "0.69804555", "0.6971215", "0.6885851", "0.685243", "0.6797832", "0.6745241", "0.672651", "0.67126006", "0.6678958", "0.6600249", "0.6599254", "0.65914047", "0.6578593", "0.656169", "0.65189487", "0.6501309", "0.6475631", "0.64738953", "0.6461183", "0.6422366", ...
0.6817889
6
Create a new button
def initialize(line_id) super() @line_id = line_id end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createNewHypothesisButton()\n\t\treturn ButtonCreator.new(\n\t\t\t:assetName => 'plus.png', \n\t\t\t:assetSize => 40, \n\t\t\t:parent => self,\n\t\t\t:clicked => :btn_new_clicked\n\t\t)\n\tend", "def new_button\n begin\n $results.log_action(\"button(#{@params[0..-1].join(' ')})\")\n if @par...
[ "0.7915032", "0.74492866", "0.7373985", "0.7373985", "0.7273122", "0.7256615", "0.71732485", "0.7130936", "0.7091999", "0.6938925", "0.6923482", "0.6913698", "0.6775529", "0.67236793", "0.67162955", "0.6647855", "0.66465276", "0.6642395", "0.6627355", "0.66018724", "0.6567184...
0.0
-1
Create a new heading
def initialize(level, title) super() @level, @title = level, title end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_heading level\n heading = RDoc::Markup::Heading.new level, text\n skip :NEWLINE\n\n heading\n end", "def add_heading(heading)\n table.heading = heading\n end", "def build_heading level\n heading = super\n\n @section = heading.text\n\n heading\n end", "def build_heading l...
[ "0.74288493", "0.7395365", "0.7357064", "0.7252181", "0.7120475", "0.7095312", "0.6884357", "0.6872214", "0.68604934", "0.68392724", "0.6831466", "0.6806305", "0.6806305", "0.67611855", "0.6758229", "0.673869", "0.6730162", "0.6730162", "0.6725219", "0.66473615", "0.66182846"...
0.0
-1
Create a digest of the content
def digest @title end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def digest(data); end", "def digest\n digest = ''\n @entries.each { |entry| digest << entry.digest << ' ' }\n digest\n end", "def digest\n @digest ||= DEFAULT_DIGEST_PROC\n end", "def digest_for(entry) \n MD5.hexdigest( [ entry.title, entry.content, entry.date_published ]....
[ "0.7819154", "0.69804555", "0.6971215", "0.6885851", "0.685243", "0.6817889", "0.6817889", "0.6797832", "0.6745241", "0.672651", "0.67126006", "0.6678958", "0.6600249", "0.6599254", "0.65914047", "0.6578593", "0.656169", "0.65189487", "0.6501309", "0.6475631", "0.64738953", ...
0.0
-1
Return a string representation of this element
def to_s @title end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def string\n element().to_s\n end", "def to_s\n self.inspect\n end", "def to_s\n @string\n end", "def to_s\n @string\n end", "def to_s\n @string\n end", "def to_s\n @string\n end", "def inspect\n \"<#{self.class.to_s} \" +\n ...
[ "0.8632077", "0.7785022", "0.7684095", "0.7684095", "0.7684095", "0.7684095", "0.7640589", "0.76188034", "0.756505", "0.75623024", "0.7539377", "0.7539377", "0.7539377", "0.7539377", "0.75355273", "0.75067985", "0.749463", "0.749463", "0.7483942", "0.74585253", "0.7452343", ...
0.0
-1
Return a string representation of this element
def to_s @content end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def string\n element().to_s\n end", "def to_s\n self.inspect\n end", "def to_s\n @string\n end", "def to_s\n @string\n end", "def to_s\n @string\n end", "def to_s\n @string\n end", "def inspect\n \"<#{self.class.to_s} \" +\n ...
[ "0.8632163", "0.7785062", "0.76841354", "0.76841354", "0.76841354", "0.76841354", "0.76406544", "0.76188487", "0.75650764", "0.7562342", "0.7539421", "0.7539421", "0.7539421", "0.7539421", "0.75355667", "0.75068784", "0.74946636", "0.74946636", "0.7484002", "0.74586034", "0.7...
0.0
-1
Create a new image
def initialize(location, alt, title, width_slide, width_plain) super() @location, @alt, @title, @width_slide, @width_plain = location, alt, title, width_slide, width_plain @formats = [ ] @license = nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def image_new(width, height)\n Magick::Image.new(width, height)\n end", "def create_image(m, n)\n @image = Image.new m.to_i, n.to_i\n end", "def create_basic\n ImageGeneratingService.new(self, 'Basic.jpg', 'image/jpeg', 100).generate_resized(600)\n end", "def create_image(title, descripti...
[ "0.72558755", "0.72027034", "0.7154681", "0.70970213", "0.7079718", "0.704715", "0.704715", "0.6954225", "0.69056153", "0.6853606", "0.6777228", "0.67731184", "0.6759798", "0.67579937", "0.6743904", "0.6690444", "0.66464025", "0.6643725", "0.66232246", "0.6615203", "0.6587376...
0.0
-1