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
POST /now_assigns POST /now_assigns.json
def create @now_assign = NowAssign.new(now_assign_params) respond_to do |format| if @now_assign.save format.html { redirect_to @now_assign, notice: 'Now assign was successfully created.' } format.json { render :show, status: :created, location: @now_assign } else format.html...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @now_assigns = NowAssign.all\n end", "def assigns\n @assigns ||= { }\n end", "def create\n @assigned = Assigned.new(params[:assigned])\n\n respond_to do |format|\n if @assigned.save\n format.html { redirect_to @assigned, notice: 'Assigned was successfully created.' }\n ...
[ "0.7020888", "0.63886464", "0.6270156", "0.61548364", "0.61548364", "0.61548364", "0.61548364", "0.59917635", "0.59917635", "0.5902141", "0.5854145", "0.5821531", "0.5641448", "0.5593123", "0.55688536", "0.55591565", "0.55509377", "0.5513271", "0.54748476", "0.54687405", "0.5...
0.65310895
1
PATCH/PUT /now_assigns/1 PATCH/PUT /now_assigns/1.json
def update respond_to do |format| if @now_assign.update(now_assign_params) format.html { redirect_to @now_assign, notice: 'Now assign was successfully updated.' } format.json { render :show, status: :ok, location: @now_assign } else format.html { render :edit } format.jso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @assigned = Assigned.find(params[:id])\n\n respond_to do |format|\n if @assigned.update_attributes(params[:assigned])\n format.html { redirect_to @assigned, notice: 'Assigned was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { ren...
[ "0.6279113", "0.6085637", "0.60172045", "0.60090154", "0.5909141", "0.5868616", "0.5847082", "0.5722251", "0.57159454", "0.5706269", "0.5667845", "0.5663065", "0.56536025", "0.5615739", "0.5609738", "0.5594881", "0.5584768", "0.5580862", "0.55790067", "0.55651957", "0.5564155...
0.6739728
0
DELETE /now_assigns/1 DELETE /now_assigns/1.json
def destroy @now_assign.destroy respond_to do |format| format.html { redirect_to now_assigns_url, notice: 'Now assign was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @assigned = Assigned.find(params[:id])\n @assigned.destroy\n\n respond_to do |format|\n format.html { redirect_to assigneds_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @assign.destroy\n respond_to do |format|\n format.html { redirect_to as...
[ "0.6961078", "0.68701416", "0.6530035", "0.6512286", "0.6482235", "0.6387322", "0.6363145", "0.6352876", "0.6328281", "0.632265", "0.63171726", "0.6314954", "0.63058394", "0.62946546", "0.6285363", "0.6284444", "0.6277052", "0.6277052", "0.6275891", "0.62583286", "0.62516934"...
0.7461754
0
GET /feed_items GET /feed_items.json
def index @feed_items = @user.feed_items render json: @feed_items end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def feed_items\n feed_item\n end", "def show\n @feed_item = Item.find(params[:id])\n\n render json: @feed_item\n end", "def feed\n @feed_items = @repository.recent_feed_items\n respond_to do |format|\n format.html # feed.html.erb\n format.json { render json: @feed_items }\n end\n...
[ "0.7607938", "0.7577279", "0.7547135", "0.7103888", "0.70869637", "0.6982978", "0.6769755", "0.6700494", "0.66766906", "0.66600543", "0.6628024", "0.6560946", "0.6488373", "0.6467441", "0.64593935", "0.6411641", "0.6408077", "0.6368168", "0.6365577", "0.6358505", "0.6313285",...
0.79181004
0
POST /feed_items POST /feed_items.json
def create @feed_item = FeedItem.new(feed_item_params) respond_to do |format| if @feed_item.save format.json { render :show, status: :created, location: @feed_item } else format.json { render json: @feed_item.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n item = list.items.create!(item_params)\n render json: item, status: 201\n end", "def create\n @feed_item = FeedItem.new(feed_item_params)\n\n respond_to do |format|\n if @feed_item.save\n format.html {redirect_to @feed_item, notice: 'Feed item was successfully created.'}\n ...
[ "0.70278084", "0.6674621", "0.6633626", "0.66114926", "0.6512276", "0.6362718", "0.63025254", "0.6281664", "0.6269231", "0.62541735", "0.6248387", "0.6230771", "0.6204548", "0.62005824", "0.6193904", "0.6178561", "0.6171192", "0.61603427", "0.61371636", "0.6120742", "0.611853...
0.7122677
0
PATCH/PUT /feed_items/1 PATCH/PUT /feed_items/1.json
def update respond_to do |format| if @feed_item.update(feed_item_params) format.json { render :show, status: :ok, location: @feed_item } else format.json { render json: @feed_item.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n render json: Item.update(params[\"id\"], params[\"item\"])\n end", "def update\n respond_to do |format|\n if @feed_item.update(feed_item_params)\n format.html {redirect_to @feed_item, notice: 'Feed item was successfully updated.'}\n format.json {render :show, status: :ok, l...
[ "0.6957239", "0.6911151", "0.6589507", "0.6589507", "0.6547246", "0.6530992", "0.6516565", "0.64932853", "0.64099556", "0.6404292", "0.63964415", "0.63853556", "0.638271", "0.6365961", "0.63575256", "0.6352661", "0.6337317", "0.63370883", "0.6335891", "0.6335891", "0.63282174...
0.7281706
0
DELETE /feed_items/1 DELETE /feed_items/1.json
def destroy @feed_item.destroy respond_to do |format| format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @feed_item = FeedItem.find(params[:id])\n @feed_item.destroy\n\n respond_to do |format|\n format.html { redirect_to feed_items_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @feed_item.destroy\n respond_to do |format|\n format.html {redirect_...
[ "0.76366144", "0.7383579", "0.71145946", "0.70760983", "0.7014173", "0.69843024", "0.6970514", "0.6958597", "0.6958597", "0.6958597", "0.6958597", "0.6958597", "0.6958597", "0.6958597", "0.6958597", "0.6958597", "0.6958597", "0.6958597", "0.6958597", "0.6958597", "0.6958597",...
0.7842684
0
Converts JSONparsed hash keys and values into a Rubyfriendly format Convert :id into integer and :updated_time into Time and all keys into symbols
def normalize_hash(hash) normalized_hash = {} hash.each do |k, v| case k when "error" raise FacebookError.new("#{v['type']} - #{v['message']}") when "id" if (v == v.to_i.to_s) normalized_hash[k.to_sym] = v.to_i else normalized_h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_hash\n as_json.with_indifferent_access.tap do |rec|\n rec.transform_values! do |value|\n if value.is_a?(Time) || value.is_a?(DateTime)\n ymdhms = value.utc.strftime(\"%Y-%m-%d %H:%M:%S\")\n subseconds = value.utc.strftime(\".%6N\").to_f.to_s.sub(/^0\\./, \"\")\n \"#...
[ "0.6333961", "0.6091948", "0.5960392", "0.5904445", "0.5844305", "0.57200915", "0.5718297", "0.5571941", "0.5571941", "0.5555279", "0.5491618", "0.5474334", "0.5422195", "0.54121065", "0.53676033", "0.5361193", "0.5272662", "0.5272401", "0.52711004", "0.52529746", "0.52529746...
0.61115336
1
Extracts data from "data" key in Hash, if present
def extract_data(object) if object.is_a?(Hash)&&object.keys.include?('data') return object['data'] else return object end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data(key=nil)\n @data ||= {}\n @data[key]\n end", "def get_data(key) \n return @data[key]\n end", "def fetch_data(hash, key)\n cur = hash\n key.split('.').each { |k| cur = (cur || {})[k] }\n cur\n end", "def data_hash\n @data_hash |...
[ "0.6820225", "0.6733879", "0.6593655", "0.64690113", "0.6254744", "0.62208533", "0.60864574", "0.60666233", "0.60391283", "0.60235566", "0.5979417", "0.596466", "0.5900748", "0.5836069", "0.5806345", "0.5802529", "0.5769023", "0.57553196", "0.5748411", "0.57403016", "0.573277...
0.73690903
0
returns array of x,y coordinates of characters in the 2D image array
def coordinates(image) image.each_with_index.flat_map do |row,x| (0...row.length).find_all{|i| row[i] == @char }.map{|y| [x,y] } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def coordinates(string)\n return nil if string.length != 2\n # interpret letter as column\n column = self.class::COLUMNS.index(string[0])\n row = self.class::ROWS.index(string[1])\n return nil if !column || !row\n [row, column]\n end", "def text_coordinates\n return 28, 5, 152, 16\n ...
[ "0.6801473", "0.6664606", "0.6534729", "0.65216327", "0.6516987", "0.6465866", "0.6403239", "0.6316422", "0.62856555", "0.6280391", "0.6235133", "0.6192584", "0.6144271", "0.6097275", "0.6085641", "0.6057833", "0.60517174", "0.60516196", "0.60348696", "0.5975286", "0.59559745...
0.8540626
0
scans through the tile looking for images images are matched one character at a time. each match attempt is abandoned upon the first failed comparison
def scan(img) num_images = 0 img_height,img_width = img.length,img.width coords = coordinates(img.data) for x in 0..(@size - img_width-1) do for y in 0..(@size - img_height-1) do match = coords.map do |x1,y1| break [false] if @data[x+x1][y+y1] != @char true end...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def match_position_by_full_string\n\n t_width = template_image.columns\n t_height = template_image.rows\n t_pixels = template_image.export_pixels_to_str(0, 0, t_width, t_height)\n\n catch :found_match do\n search_rows.times do |y|\n search_cols.times do |x|\n \n ...
[ "0.6911133", "0.675757", "0.67393875", "0.64362615", "0.62412745", "0.61054957", "0.60105103", "0.5908611", "0.57935", "0.572194", "0.5715868", "0.56966037", "0.56945646", "0.5688181", "0.5642281", "0.563548", "0.5613567", "0.5606868", "0.56018627", "0.55794424", "0.55498177"...
0.6834054
1
Test that run finds the correct number of files
def test_run_num_files f = FolderWalker.new("./TestFolders/") f.run assert_equal(6,f.files.length) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_files\n `touch ../harness/test/foo ../harness/test/bar`\n f = @td.files\n assert_equal(2, f.length)\n assert(f.find \"foo\")\n assert(f.find \"bar\")\n end", "def num_files_total\n command_string = 'find '+@install_root+' | wc -l'\n inspec.bash(command_string).stdout.split(...
[ "0.7070228", "0.6878344", "0.67987144", "0.66965634", "0.66452765", "0.65579015", "0.64727426", "0.6459901", "0.6417304", "0.627495", "0.6270468", "0.62671477", "0.6265281", "0.62220746", "0.62060523", "0.6201823", "0.61571187", "0.6119148", "0.6107139", "0.60747886", "0.6064...
0.79651314
0
Test that run finds the correct number of folders
def test_run_num_folders f = FolderWalker.new("./TestFolders/") f.run assert_equal(6,f.sub_folders.length) #note that there are 6 sub folders end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_run_num_files\n\t\tf = FolderWalker.new(\"./TestFolders/\")\n\t\tf.run\n\t\tassert_equal(6,f.files.length)\n\tend", "def test_calculate_tree_size_many_files\n\t\tf = FolderWalker.new(\"./TestFolders/\")\n\t\tf.run\n\t\tassert_equal(2705,f.calculate_tree_size(\"./TestFolders/Folder1/\"))\n\tend", "def ...
[ "0.8215494", "0.75585216", "0.7175305", "0.703243", "0.6969532", "0.68966025", "0.66667825", "0.6615327", "0.63305104", "0.63259894", "0.62678164", "0.62345445", "0.62092966", "0.609752", "0.6094918", "0.6076502", "0.60744876", "0.6070298", "0.6058726", "0.5950371", "0.591436...
0.8452967
0
Test that zero size folders are correctly calculated
def test_calculate_tree_size_no_files f = FolderWalker.new("./TestFolders/") f.run assert_equal(0,f.calculate_tree_size("./TestFolders/Folder2/")) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_calculate_tree_size_one_file\n\t\tf = FolderWalker.new(\"./TestFolders/\")\n\t\tf.run\n\t\tassert_equal(391,f.calculate_tree_size(\"./TestFolders/Folder3/\"))\n\tend", "def test_calculate_tree_size_many_files\n\t\tf = FolderWalker.new(\"./TestFolders/\")\n\t\tf.run\n\t\tassert_equal(2705,f.calculate_tre...
[ "0.73691976", "0.7348623", "0.67720884", "0.6761129", "0.6565264", "0.6452102", "0.63649493", "0.6322961", "0.62453777", "0.6128325", "0.60411394", "0.59869885", "0.59800684", "0.59556", "0.5955104", "0.59242445", "0.59101444", "0.5907366", "0.5899765", "0.58755594", "0.58593...
0.80461156
0
Test that calculation for size with manys files (including subfolders) are correct
def test_calculate_tree_size_many_files f = FolderWalker.new("./TestFolders/") f.run assert_equal(2705,f.calculate_tree_size("./TestFolders/Folder1/")) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_calculate_tree_size_one_file\n\t\tf = FolderWalker.new(\"./TestFolders/\")\n\t\tf.run\n\t\tassert_equal(391,f.calculate_tree_size(\"./TestFolders/Folder3/\"))\n\tend", "def get_all_size\n s_old = 0\n Dir.glob($dir + '/**/*').each { | a_file |\n dn = File.dirname(a_file)\n s = File.lstat(a_file)...
[ "0.78279763", "0.7153861", "0.7145839", "0.70673305", "0.7045007", "0.6914126", "0.68802", "0.6836673", "0.6820553", "0.6778381", "0.6724744", "0.6715456", "0.6686396", "0.66457164", "0.66164", "0.65745836", "0.6557232", "0.65544426", "0.65510404", "0.6532933", "0.65182656", ...
0.7884959
0
Prints a "F" and saves the failure details (including line number and file) for the end. Prints in yellow if possible.
def fail(description, message, line, file) print yellow("F") @details << "FAILURE - #{test_detail(description, message)} #{line_info(line, file)}".strip end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_failing_test(suite, test, reason, file_path);\n text = format_failure({file_path: file_path, reason: reason})\n format_text_after_step(method(:red), \"\\n\", text)\n end", "def setup_fail(message)\n puts '-'*50\n message.each { |line| puts line }\n puts '-'*50\n exit\n end", "def...
[ "0.733229", "0.6493783", "0.6453176", "0.63990283", "0.62750876", "0.62519854", "0.62358797", "0.622311", "0.61330384", "0.61330384", "0.61058646", "0.6067563", "0.602105", "0.602105", "0.6000905", "0.59603834", "0.5943969", "0.59214586", "0.5909766", "0.58985925", "0.5874518...
0.6844419
1
A simple clock publisher of sorts. It writes the current time every second to the current clients.
def start loop do now = Time.now msg = "%02d:%02d:%02d" % [now.hour, now.min, now.sec] @mutex.synchronize { @clients.each { |c| # If the connection is closed while writing this could occur. Just # the nature of async systems. puts "--- write failed" unless c.write(ms...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ring\n every(2) do\n broadcast(:time, Time.now.httpdate)\n end\n end", "def now\n @clock\n end", "def time(&blk)\n if block_given?\n websocket.subscribe :time, &blk\n else\n http.get :time\n end\n end", "def time\n\n init_vars\n\n @pubnub.time(:ca...
[ "0.6400875", "0.626256", "0.61699796", "0.6080367", "0.603801", "0.59868497", "0.59587157", "0.5844667", "0.5816702", "0.5796471", "0.57024324", "0.56944203", "0.5609793", "0.5601667", "0.55834293", "0.5574489", "0.55519956", "0.55407065", "0.55206376", "0.5486406", "0.545225...
0.65192217
0
GET /entity_end_point_rels GET /entity_end_point_rels.xml
def index @entity_end_point_rels = EntityEndPointRel.all respond_to do |format| format.html # index.html.erb format.xml { render :xml => @entity_end_point_rels } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @entity_end_point_rel = EntityEndPointRel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @entity_end_point_rel }\n end\n end", "def new\n @entity_end_point_rel = EntityEndPointRel.new\n\n respond_to do |format|\n ...
[ "0.6910985", "0.61793983", "0.61738926", "0.58662504", "0.57284707", "0.564968", "0.5602334", "0.5598963", "0.5591444", "0.55247366", "0.55234694", "0.5469111", "0.5383375", "0.5378741", "0.536021", "0.532422", "0.53151745", "0.52591217", "0.52324206", "0.5229857", "0.5176872...
0.76303756
0
GET /entity_end_point_rels/1 GET /entity_end_point_rels/1.xml
def show @entity_end_point_rel = EntityEndPointRel.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @entity_end_point_rel } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @entity_end_point_rels = EntityEndPointRel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @entity_end_point_rels }\n end\n end", "def new\n @entity_end_point_rel = EntityEndPointRel.new\n\n respond_to do |format|\n format.ht...
[ "0.77154636", "0.6417611", "0.6308051", "0.60555893", "0.5983329", "0.5782202", "0.57389575", "0.55425936", "0.54915625", "0.54024583", "0.53358036", "0.5334146", "0.533134", "0.5319379", "0.5299693", "0.5295352", "0.52909636", "0.5279325", "0.5265161", "0.525591", "0.5227885...
0.72798735
1
GET /entity_end_point_rels/new GET /entity_end_point_rels/new.xml
def new @entity_end_point_rel = EntityEndPointRel.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @entity_end_point_rel } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @entity_end_point_rel = EntityEndPointRel.new(params[:entity_end_point_rel])\n\n respond_to do |format|\n if @entity_end_point_rel.save\n format.html { redirect_to(@entity_end_point_rel, :notice => 'Entity end point rel was successfully created.') }\n format.xml { render :xml...
[ "0.7133042", "0.628834", "0.62561065", "0.62223476", "0.6217291", "0.6171932", "0.6166786", "0.61633873", "0.6148189", "0.6148189", "0.61249036", "0.6067396", "0.60501105", "0.60478514", "0.6024648", "0.5986014", "0.59627634", "0.5962528", "0.59536916", "0.5927142", "0.592590...
0.8008794
0
POST /entity_end_point_rels POST /entity_end_point_rels.xml
def create @entity_end_point_rel = EntityEndPointRel.new(params[:entity_end_point_rel]) respond_to do |format| if @entity_end_point_rel.save format.html { redirect_to(@entity_end_point_rel, :notice => 'Entity end point rel was successfully created.') } format.xml { render :xml => @entity...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @entity_end_point_rels = EntityEndPointRel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @entity_end_point_rels }\n end\n end", "def destroy\n @entity_end_point_rel = EntityEndPointRel.find(params[:id])\n @entity_end_point_rel.d...
[ "0.66041714", "0.6249737", "0.62457484", "0.6133671", "0.6035429", "0.5454902", "0.53924245", "0.52724266", "0.5201989", "0.5122858", "0.5101275", "0.5077767", "0.49562803", "0.4947828", "0.49398896", "0.49224684", "0.48865974", "0.48725775", "0.48723343", "0.48543265", "0.48...
0.65950185
1
PUT /entity_end_point_rels/1 PUT /entity_end_point_rels/1.xml
def update @entity_end_point_rel = EntityEndPointRel.find(params[:id]) respond_to do |format| if @entity_end_point_rel.update_attributes(params[:entity_end_point_rel]) format.html { redirect_to(@entity_end_point_rel, :notice => 'Entity end point rel was successfully updated.') } format.xm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @entity_end_point_rel = EntityEndPointRel.find(params[:id])\n @entity_end_point_rel.destroy\n\n respond_to do |format|\n format.html { redirect_to(entity_end_point_rels_url) }\n format.xml { head :ok }\n end\n end", "def index\n @entity_end_point_rels = EntityEndPointRel....
[ "0.6345643", "0.60037243", "0.59018344", "0.5640405", "0.55602294", "0.5555032", "0.5508932", "0.5340004", "0.53250897", "0.5323525", "0.530562", "0.527949", "0.52296937", "0.5217253", "0.52015674", "0.51809144", "0.5159081", "0.5151861", "0.5144769", "0.5139589", "0.5123986"...
0.7232294
0
DELETE /entity_end_point_rels/1 DELETE /entity_end_point_rels/1.xml
def destroy @entity_end_point_rel = EntityEndPointRel.find(params[:id]) @entity_end_point_rel.destroy respond_to do |format| format.html { redirect_to(entity_end_point_rels_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n\t\tdb.execute{ \"delete edge #{ref_name} #{rrid}\" }\n\tend", "def destroy\n @end_point = EndPoint.find(params[:id])\n @end_point.destroy\n\n respond_to do |format|\n format.html { redirect_to end_points_url }\n format.json { head :no_content }\n end\n end", "def remove_enti...
[ "0.62980604", "0.6142012", "0.60746086", "0.6028093", "0.5960066", "0.59409046", "0.59088063", "0.5904957", "0.5885447", "0.5880399", "0.58693075", "0.58692604", "0.586663", "0.58664376", "0.586271", "0.58512497", "0.5841506", "0.58276653", "0.5818714", "0.58186436", "0.58139...
0.7948107
0
GET /ground_functions GET /ground_functions.xml
def index @ground_functions = GroundFunction.all respond_to do |format| format.html # index.html.erb format.xml { render :xml => @ground_functions } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @ground_function = GroundFunction.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ground_function }\n end\n end", "def index\n @functions = Function.all\n\n respond_to do |format|\n format.html # index.rhtml\n ...
[ "0.65453106", "0.6193276", "0.5930195", "0.5768307", "0.57503057", "0.5730637", "0.56876737", "0.55887055", "0.5557865", "0.55555844", "0.5554288", "0.54734194", "0.5470807", "0.54646605", "0.54193807", "0.5356114", "0.53254193", "0.53200865", "0.53131866", "0.5292679", "0.52...
0.7062496
0
GET /ground_functions/1 GET /ground_functions/1.xml
def show @ground_function = GroundFunction.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @ground_function } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @ground_functions = GroundFunction.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ground_functions }\n end\n end", "def index\n @functions = Function.all\n\n respond_to do |format|\n format.html # index.rhtml\n format....
[ "0.70844424", "0.63215524", "0.61065346", "0.5964533", "0.58154327", "0.5593157", "0.55505854", "0.5539122", "0.55350995", "0.55260366", "0.5489773", "0.546435", "0.54563797", "0.54144126", "0.53905827", "0.5386268", "0.53848153", "0.5370777", "0.5344751", "0.5333777", "0.527...
0.6703074
1
GET /ground_functions/new GET /ground_functions/new.xml
def new @ground_function = GroundFunction.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @ground_function } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @ground_function = GroundFunction.new(params[:ground_function])\n\n respond_to do |format|\n if @ground_function.save\n format.html { redirect_to(@ground_function, :notice => 'Ground function was successfully created.') }\n format.xml { render :xml => @ground_function, :statu...
[ "0.6794196", "0.6764712", "0.62145555", "0.6183931", "0.61651766", "0.6137017", "0.612525", "0.60323733", "0.5899586", "0.58830243", "0.587066", "0.5806931", "0.5798216", "0.5745316", "0.5740266", "0.5736395", "0.57350373", "0.5722531", "0.57050204", "0.56928706", "0.56849897...
0.74989265
0
POST /ground_functions POST /ground_functions.xml
def create @ground_function = GroundFunction.new(params[:ground_function]) respond_to do |format| if @ground_function.save format.html { redirect_to(@ground_function, :notice => 'Ground function was successfully created.') } format.xml { render :xml => @ground_function, :status => :creat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @ums_function = Ums::Function.new(ums_function_params)\n\n respond_to do |format|\n if @ums_function.save\n format.html { redirect_to ums.functions_url, notice: '功能创建创建成功.' }\n format.json { render action: 'show', status: :created, location: @ums_function }\n else\n ...
[ "0.58167434", "0.5758174", "0.5727504", "0.5717479", "0.557453", "0.55350906", "0.55038965", "0.5452712", "0.5339042", "0.53315693", "0.5323977", "0.52793413", "0.5258425", "0.5238035", "0.5235776", "0.52273226", "0.5199936", "0.5199346", "0.5193652", "0.5175325", "0.51708066...
0.677608
0
PUT /ground_functions/1 PUT /ground_functions/1.xml
def update @ground_function = GroundFunction.find(params[:id]) respond_to do |format| if @ground_function.update_attributes(params[:ground_function]) format.html { redirect_to(@ground_function, :notice => 'Ground function was successfully updated.') } format.xml { head :ok } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @system_function = SystemFunction.find(params[:id])\n\n respond_to do |format|\n if @system_function.update_attributes(params[:system_function])\n format.html { redirect_to(@system_function, :notice => 'SystemFunction was successfully updated.') }\n format.xml { head :ok }\n ...
[ "0.60247207", "0.56604457", "0.56478375", "0.56312996", "0.56220025", "0.559219", "0.5582085", "0.5558526", "0.5556705", "0.5489322", "0.54831535", "0.5482249", "0.54625136", "0.5413596", "0.53672534", "0.5338568", "0.52952045", "0.5294104", "0.5265299", "0.52470744", "0.5241...
0.6657647
0
DELETE /ground_functions/1 DELETE /ground_functions/1.xml
def destroy @ground_function = GroundFunction.find(params[:id]) @ground_function.destroy respond_to do |format| format.html { redirect_to(ground_functions_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @system_function = SystemFunction.find(params[:id])\n @system_function.destroy\n\n respond_to do |format|\n format.html { redirect_to(system_functions_url) }\n format.xml { head :ok }\n end\n end", "def delete()\n response = send_post_request(@xml_api_delete_path)\n ...
[ "0.6509117", "0.6409326", "0.6363658", "0.62779754", "0.6239092", "0.62384266", "0.6176102", "0.61473495", "0.6131849", "0.6116218", "0.6113682", "0.6089298", "0.60858727", "0.5999346", "0.59663963", "0.59606254", "0.5958344", "0.5951191", "0.5951013", "0.59473306", "0.589553...
0.7241844
0
Internal: Initialize object for compression or expansion uri A String containing URI that may or may not contain the scheme env The current "environment" that assets are being loaded into.
def initialize(uri, env) @root = env.root @env = env uri = uri.to_s if uri.include?("://".freeze) @scheme, _, @path = uri.partition("://".freeze) @scheme << "://".freeze else @scheme = "".freeze @path = uri end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(env, secret)\n env[:url] = Addressable::URI.parse env[:url]\n @env, @secret = env, secret\n end", "def initialize env\n @rack_environment = env\n @rack_version = env['rack.version']\n\n sanity_check!\n @rack_request = Rack::Request.new(rack_environment)...
[ "0.62372994", "0.61079836", "0.6005355", "0.5976958", "0.58094484", "0.58053243", "0.5749934", "0.5695211", "0.5595237", "0.554637", "0.5527688", "0.55251396", "0.55192167", "0.5514989", "0.5514989", "0.55103767", "0.5507993", "0.5502816", "0.5493326", "0.54885834", "0.548282...
0.71809566
0
Internal: Returns "compressed" path If the input uri is relative to the environment root it will return a path relative to the environment root. Otherwise an absolute path will be returned. Only path information is returned, and not scheme. Returns String
def compressed_path # windows if !@root.start_with?("/".freeze) && path.start_with?("/".freeze) consistent_root = "/".freeze + @root else consistent_root = @root end if compressed_path = PathUtils.split_subpath(consistent_root, path) compressed_path else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compress\n scheme + compressed_path\n end", "def absolute_path\n if is_url?\n # Use the last path component without the query string plus the name\n # of the resource in Base64. This should be both mildly readable and\n # also unique per invocation.\n ...
[ "0.66939205", "0.63998574", "0.62804145", "0.6171862", "0.6137756", "0.59810704", "0.5977217", "0.5955524", "0.59284276", "0.59284276", "0.59101063", "0.5905852", "0.59015334", "0.58832043", "0.58792585", "0.5829051", "0.58216476", "0.58004534", "0.57852757", "0.5774998", "0....
0.7354053
0
GET /news_sources GET /news_sources.json
def index @news_sources = NewsSource.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sources_data\n sources_url = Api.gnews_path('sources')\n call_gnews_url(sources_url).parse\n end", "def top_news_sources\n\n end", "def get_articles(source_hash)\n\t# make string of all the sources in hash\n\tsources_string = \"\"\n\tsource_hash.each_value do |source_array|\n\t\tsource_...
[ "0.7621815", "0.68484175", "0.67917913", "0.66716135", "0.66203827", "0.65776587", "0.6519943", "0.650303", "0.64753735", "0.6441766", "0.64233863", "0.6364194", "0.63572484", "0.62940425", "0.6291115", "0.6281036", "0.6206559", "0.61822635", "0.6164082", "0.6148602", "0.6096...
0.7561626
1
POST /news_sources POST /news_sources.json
def create @news_source = NewsSource.new(news_source_params) respond_to do |format| if @news_source.save format.html { redirect_to @news_source, notice: 'News source was successfully created.' } format.json { render :show, status: :created, location: @news_source } else form...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sources_post(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: SourceApi#sources_post ...\"\n end\n \n # resource path\n path = \"/sources\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'access...
[ "0.65927416", "0.6567212", "0.6339624", "0.6287057", "0.6240334", "0.6216206", "0.6053985", "0.5982103", "0.5919232", "0.591753", "0.58542633", "0.5843646", "0.58049583", "0.57986486", "0.577724", "0.5742772", "0.57143134", "0.56619793", "0.56560844", "0.56495994", "0.5645492...
0.7182317
0
PATCH/PUT /news_sources/1 PATCH/PUT /news_sources/1.json
def update respond_to do |format| if @news_source.update(news_source_params) format.html { redirect_to @news_source, notice: 'News source was successfully updated.' } format.json { render :show, status: :ok, location: @news_source } else format.html { render :edit } forma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n sources = Fenix::Store::Converter::Flattener.sources params[:sources]\n respond_to do |format|\n if @host.set_sources sources\n format.html { redirect_to source, notice: 'SourceList was successfully updated.' }\n format.json { render :show, status: :ok, location: source }\n ...
[ "0.64478344", "0.64008933", "0.6221924", "0.6199038", "0.61409014", "0.6110137", "0.6097395", "0.6085654", "0.60745925", "0.60640454", "0.60640454", "0.6049413", "0.6049413", "0.60472", "0.6043289", "0.6032733", "0.6026059", "0.60146487", "0.6001857", "0.59918576", "0.5985473...
0.68684113
0
DELETE /news_sources/1 DELETE /news_sources/1.json
def destroy @news_source.destroy respond_to do |format| format.html { redirect_to news_sources_url, notice: 'News source was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @source = Source.find(params[:id])\n @source.destroy\n\n respond_to do |format|\n format.html { redirect_to sources_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @source = Source.find(params[:id])\n @source.destroy\n\n respond_to do |format|\n...
[ "0.7032533", "0.7032533", "0.7032288", "0.6962704", "0.690601", "0.68882865", "0.68830156", "0.68830156", "0.68830156", "0.68830156", "0.68787867", "0.68269044", "0.6818512", "0.6802493", "0.67994004", "0.6744682", "0.67399406", "0.67373604", "0.6727953", "0.6727953", "0.6727...
0.7569872
0
Unused: Show the form to create a new mixtape
def new # Debug: just do the create for now redirect_to Mixtape.create_for(current_user) # refuse_access end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @cut = Cut.new\n\n\n render :layout => \"fancybox\"\n\n end", "def maker\n show \n end", "def create\n refuse_access and return if contest_started\n\n @mixtape = Mixtape.new(mixtape_params)\n\n if @mixtape.save\n flash[:info] = \"Mixtape created successfully\"\n session[...
[ "0.63238376", "0.62685984", "0.6205438", "0.61561567", "0.6143055", "0.6135621", "0.6105373", "0.6103083", "0.606547", "0.605269", "0.6036929", "0.60352963", "0.60134816", "0.59846854", "0.5982936", "0.597696", "0.59769225", "0.5969942", "0.5969777", "0.596213", "0.596213", ...
0.65769035
0
POST: Create the actual mixtape
def create refuse_access and return if contest_started @mixtape = Mixtape.new(mixtape_params) if @mixtape.save flash[:info] = "Mixtape created successfully" session[:mixtape] = @mixtape.id redirect_to @mixtape else render 'new' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @mix = Mix.new(mix_params)\n\n respond_to do |format|\n if @mix.save\n format.html { redirect_to @mix, notice: 'Mix was successfully created.' }\n format.json { render :show, status: :created, location: @mix }\n else\n format.html { render :new }\n format.js...
[ "0.6962097", "0.66207397", "0.65681154", "0.6471781", "0.643429", "0.63758546", "0.63381356", "0.63250935", "0.62894666", "0.62779254", "0.62212753", "0.6210904", "0.6181225", "0.61782455", "0.6178127", "0.61395043", "0.61092573", "0.60885364", "0.60565484", "0.6055538", "0.6...
0.74217457
0
Return true if the formatter name is known.
def known?(name) ProcessLog.instance_variable_get(:@format).has_key?(name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def formatter?\n subscribers.any? { |s| s.respond_to?(:is_formatter?) && s.is_formatter? }\n end", "def valid_format?(format)\n return false if format.nil?\n\n FORMATS.include? format.to_sym\n end", "def formattable? format\n Hash.instance_methods.collect(&:to_sym).include? to_forma...
[ "0.7050307", "0.6612422", "0.65856767", "0.6184406", "0.61571693", "0.60925204", "0.6059489", "0.6057653", "0.5953805", "0.59514874", "0.5950744", "0.5883174", "0.5878971", "0.58673424", "0.5835671", "0.5828714", "0.5799861", "0.57971257", "0.5762273", "0.5746107", "0.5734505...
0.74923164
0
Read the raw log file and return the process log table grouped by log id.
def read(location) # create local cache of raw log for performance cache = location unless location.scheme == "local" cache = Location[Temppath.create] cache.create(location.read) end # read all records records = cache.path.each_line.m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_log_file(file)\n File.open(file) { |input|\n input.each_line.inject(Array.new) { |acc, text|\n entry = restartable do\n restart :skip_log_entry do\n leave\n end\n parse_log_entry(text)\n end\n entry ? acc << entry : acc\n }\n }\nend", "def parse_log_...
[ "0.5932557", "0.58926845", "0.5842954", "0.5793455", "0.5745481", "0.5723517", "0.57185763", "0.5653698", "0.5584373", "0.5496392", "0.54712963", "0.5468523", "0.5429453", "0.5417541", "0.5391529", "0.53663516", "0.53313875", "0.53254825", "0.5311488", "0.5296529", "0.5284742...
0.64209837
0
Return the record table grouped by the key.
def group_by(key, records) records.inject({}) do |table, record| table[record.send(key)] ||= [] table.tap {|x| x[record.send(key)] << record} end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keyed_table\n @keyed_table ||= table.each_with_object({}) do |row, hash|\n hash[normalize_key(row[0])] = row\n end\n end", "def table\n @table ||= __getobj__.each_with_object(Hash.new) do |document, table|\n table[document.key] = document\n end\n end", "def kv_table(...
[ "0.6436219", "0.62713104", "0.5942029", "0.5911378", "0.5889566", "0.58811665", "0.5864037", "0.57871836", "0.5562739", "0.5551805", "0.5530744", "0.5524975", "0.55147296", "0.5475451", "0.5442985", "0.53657794", "0.53602403", "0.53343934", "0.5319932", "0.53063565", "0.52981...
0.7134432
0
GET /referenceboxes GET /referenceboxes.json
def index @referenceboxes = Referencebox.all respond_to do |format| format.html # index.html.erb format.json { render json: @referenceboxes } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @referencebox = Referencebox.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @referencebox }\n end\n end", "def index\n @references = Reference.all\n\n render json: @references\n end", "def list_all_tenantcircles_for_...
[ "0.70714825", "0.62468904", "0.60008633", "0.58878416", "0.567455", "0.5554408", "0.55060893", "0.55060893", "0.5499883", "0.54312855", "0.5404503", "0.5384352", "0.5357756", "0.5281852", "0.52406055", "0.52397656", "0.52183825", "0.52173674", "0.5212243", "0.5196834", "0.516...
0.76074594
0
GET /referenceboxes/1 GET /referenceboxes/1.json
def show @referencebox = Referencebox.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @referencebox } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @referenceboxes = Referencebox.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @referenceboxes }\n end\n end", "def index\n @references = Reference.all\n\n render json: @references\n end", "def list_all_tenantcircles_for_a_versio...
[ "0.76216096", "0.6201557", "0.6114375", "0.6000087", "0.5949788", "0.5945105", "0.5934648", "0.5918883", "0.58598715", "0.57785016", "0.55870646", "0.5570121", "0.55366397", "0.5430379", "0.54239887", "0.54082525", "0.54082525", "0.53800184", "0.537385", "0.537314", "0.531171...
0.75216454
1
POST /referenceboxes POST /referenceboxes.json
def create @referencebox = Referencebox.new(params[:referencebox]) if @referencebox.save if params[:referencebox][:referenceimage].present? render :crop else redirect_to :back, notice: 'Referenz erfolgreich angelegt.' end else respond_to do |format| format.htm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @reference = Reference.new(reference_params)\n\n if @reference.save\n render json: @reference, status: :created, location: @reference\n else\n render json: @reference.errors, status: :unprocessable_entity\n end\n end", "def index\n @referenceboxes = Referencebox.all\n\n ...
[ "0.626301", "0.6015651", "0.594002", "0.5715877", "0.5563813", "0.5536373", "0.55294555", "0.5486971", "0.5373104", "0.5343087", "0.5293162", "0.52865034", "0.5282339", "0.52661943", "0.52400064", "0.5237357", "0.52304715", "0.5221896", "0.5213888", "0.52080494", "0.5205315",...
0.6044079
1
wrap emojis with an HTML span contained in given content
def e(content, params = {}) clazz = params.fetch(:class, 'emoji') content.gsub(Unicode::Emoji::REGEX, '<span class="' + clazz + '">\0</span>') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def span_wrap tag, text\n \"<span class='#{tag}' markdown='1'>#{text}</span>\"\nend", "def render(text, emojis)\n emoji_index_cycle = (0...emojis.size).cycle\n\n char_maps = text.split('')\n .map { |char|\n downcase_char_map(char)\n # char_map(char)\n }.compact # get the map for each letter\n ...
[ "0.64959836", "0.6362624", "0.60722077", "0.59313166", "0.59139663", "0.5824643", "0.575115", "0.57348275", "0.57178736", "0.56887233", "0.56851983", "0.566945", "0.566945", "0.565604", "0.5638439", "0.5621196", "0.5611237", "0.559929", "0.5596356", "0.55511636", "0.55458456"...
0.69885665
0
Append an invocation to the chain of invocations. It is an error if the invocation already listed.
def append(invocation) if member?(invocation) fail RuntimeError, "Circular dependency detected: #{to_s} => #{invocation}" end conj(invocation) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(chain)\n @actions << chain.actions\n end", "def append(*args, &blk)\n steps << make(*args, &blk)\n nil\n end", "def add_chain task_chain\n @chains << task_chain\n end", "def append(&block)\n be_callable!(block)\n synchronize do\n if applied?\n ...
[ "0.6543184", "0.61498713", "0.6000883", "0.5699266", "0.56207234", "0.55317324", "0.54811144", "0.5470095", "0.53912234", "0.5367365", "0.5346708", "0.5248552", "0.524334", "0.5230117", "0.52152234", "0.52118057", "0.5156539", "0.51494145", "0.5136916", "0.513215", "0.5124360...
0.7791443
0
Get a transaction by code
def find_by_code(company_code, transaction_code, args = {}) raise ArgumentError, 'company_code is required' if company_code.blank? raise ArgumentError, 'transaction_code is required' if transaction_code.blank? resp = connection.get "/api/v2/companies/#{company_code}/transactions/#{transaction_c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transaction\n Transaction.find_by_notification_code(code)\n end", "def get_transaction(account_id, transaction_id)\n query_api_object Transaction, \"/rest/accounts/#{account_id}/transactions/#{transaction_id}\"\n end", "def gettransaction(txid)\n coind.gettransaction txid\n end", "def...
[ "0.8033801", "0.69089824", "0.678911", "0.6749764", "0.6749764", "0.6721717", "0.6598095", "0.6532463", "0.6532463", "0.6466283", "0.64498323", "0.6448001", "0.631835", "0.63159674", "0.62458223", "0.62458223", "0.6185226", "0.61804974", "0.61769915", "0.61457825", "0.6114874...
0.7625717
1
Change a transaction code
def change_code(company_code, transaction_code, args = {}) post_for(:changecode, company_code, transaction_code, args) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_transaction_code\n unless transaction_code\n number = 15170000 + id\n prefix = (defined? TRANSACTION_CODE_PREFIX) ? TRANSACTION_CODE_PREFIX : ''\n self.transaction_code = \"#{prefix}#{number.to_s}\"\n save!\n end\n end", "def code= new_code\n @code = new_code\n end"...
[ "0.79012537", "0.70441836", "0.70064425", "0.658075", "0.6551869", "0.6519719", "0.6479792", "0.64765334", "0.63170725", "0.62242293", "0.6215334", "0.6207202", "0.6207202", "0.6207202", "0.6207202", "0.6207202", "0.6207202", "0.6207202", "0.6197387", "0.6179368", "0.6157876"...
0.774449
1
total_stock = 0 for drink in drinks total_stock += drink[:price] end return total_stock end
def total_stock_value(drinks) drinks.reduce(0) { |sum, drink| sum + drink[:price] } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_stock(aliments_or_drinks)\n total= 0\n for food_or_drink in aliments_or_drinks\n total += food_or_drink.price\n end\n return total\n end", "def total_value_in_stock\n sum = 0.0\n @books_in_stock.each { |book| sum += book.price }\n sum\n end", "def brand_toy_stock item\n\t$nu...
[ "0.86109227", "0.7779747", "0.74598706", "0.73553634", "0.72688776", "0.71071875", "0.7096916", "0.7082884", "0.70291823", "0.69864804", "0.6952519", "0.69509643", "0.69379073", "0.69040716", "0.68978214", "0.6882225", "0.6834091", "0.67750114", "0.67375743", "0.67305213", "0...
0.8437065
1
_start_monitor alternative start monitor script. Have not been able to get to work. Was suppose to use daemon.rb class
def _start_monitor(analyzer_id, port) $logger.debug "_START MONITOR" opts={ :ARGV => ['restart',analyzer_id.to_s,port.to_s], :multiple => true, :monitor => true, :backtrace => true, :mode => :exec, :log_output => File.join(File.dirname(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _start_monitor(analyzer_id, port)\n $logger.debug \"_START MONITOR\"\n opts={\n :ARGV => ['restart', analyzer_id.to_s, port.to_s],\n :multiple => true,\n :monitor => true,\n :backtrace => true,\n :mode => :exec,\n ...
[ "0.74292433", "0.72330475", "0.72132766", "0.71917397", "0.7037656", "0.7024647", "0.6653582", "0.65816915", "0.65523535", "0.6471771", "0.63553053", "0.6302112", "0.6250627", "0.61817306", "0.6160648", "0.61453605", "0.6116767", "0.6071032", "0.60404307", "0.6004605", "0.599...
0.7468217
0
===get_port Looks up the TCP/IP port from the internal array by analyzer id
def get_port(analyzer_id) @ports_analyzer.each_index { |index| if @ports_analyzer[index] == analyzer_id port_nbr=@start_port+index anl=Analyzer.find(analyzer_id) if !anl.nil?#Set port number in database when we assign it in array anl.update_attributes({:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def actual_port; end", "def actual_port; end", "def port\n data[:port]\n end", "def getPort()\n return @port\n\tend", "def port\n nodes[0][1].to_i\n end", "def allocate_port(analyzer_id)\n if !get_port(analyzer_id).nil?\n raise \"Tried to allocate a port for an...
[ "0.7013534", "0.7013534", "0.69554996", "0.6873781", "0.6862205", "0.6710699", "0.66843015", "0.6657216", "0.6650815", "0.6621067", "0.6504189", "0.64707124", "0.64477414", "0.6446983", "0.6442226", "0.6430122", "0.64246595", "0.642144", "0.6416366", "0.6416366", "0.6416366",...
0.7586907
0
===get_port(analyzer_id) Creates a port if none exist for an analyzer.
def allocate_port(analyzer_id) if !get_port(analyzer_id).nil? raise "Tried to allocate a port for an analyzer that already exists" end len=@ports_analyzer.length if (len < (@stop_port-@start_port+1)) @ports_analyzer[len]=analyzer_id return len+@start_port else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_port(analyzer_id)\n @ports_analyzer.each_index { |index|\n if @ports_analyzer[index] == analyzer_id\n port_nbr=@start_port+index\n anl=Analyzer.find(analyzer_id)\n if !anl.nil?#Set port number in database when we assign it in array\n anl.update_at...
[ "0.7441825", "0.6358911", "0.594338", "0.594338", "0.58763814", "0.57729584", "0.575494", "0.5717048", "0.5630386", "0.5593842", "0.5586783", "0.5580746", "0.5519333", "0.5500725", "0.5459212", "0.543067", "0.5390082", "0.5385219", "0.5363333", "0.5340969", "0.5316326", "0....
0.80868465
0
===run(cmd,param) Takes command sent to master.rb (GETPORT or RESET) and then If GETPORT then we return the tcp/ip port number to the process that made a request to the master.rb
def run(cmd, param) if cmd == 'GETPORT' || cmd == 'RESET' #Start server if not started analyzer_id=param.to_i anl_port_nbr=get_port(analyzer_id) if (anl_port_nbr.nil?) new_port=allocate_port(analyzer_id) if new_port.nil? SystemLog.log("Una...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_command\n _, cmd, _, atype, addr_length = @data.unpack(\"C5\")\n header_length = 0\n\n case atype\n when 1, 4 # 1: ipv4, 4 bytes / 4: ipv6, 16 bytes\n ip_length = 4 * atype\n host = IPAddr.ntop @data[4, ip_length]\n port = @data[4 + ip_le...
[ "0.6354797", "0.6279593", "0.6272184", "0.62581277", "0.6232933", "0.61404014", "0.6106389", "0.60982347", "0.60793024", "0.6072797", "0.60319185", "0.59858626", "0.59816056", "0.5969689", "0.5897619", "0.58906335", "0.5867419", "0.58329093", "0.58207804", "0.5818279", "0.580...
0.81710243
0
GET /vcats GET /vcats.json
def index @vcats = Vcat.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @curriculum_vitaes = findable_curriculum_vitaes.all\n respond_to do |format|\n format.html {}\n format.json { render json: @curriculum_vitaes }\n end\n end", "def index\n @vacancies = Vacancy.all_vacancies# current_user.vacancies #\n render json: @vacancies\n end"...
[ "0.6561805", "0.6406263", "0.62883955", "0.6187642", "0.61823374", "0.6171804", "0.6165619", "0.61543995", "0.61442554", "0.6142823", "0.6142823", "0.6116726", "0.6110532", "0.6093143", "0.60906184", "0.60672414", "0.60671335", "0.60498405", "0.6033372", "0.60272974", "0.6005...
0.76041055
0
POST /vcats POST /vcats.json
def create @vcat = Vcat.new(vcat_params) respond_to do |format| if @vcat.save format.html { redirect_to @vcat, notice: 'Vcat was successfully created.' } format.json { render action: 'show', status: :created, location: @vcat } else format.html { render action: 'new' } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @vcats = Vcat.all\n end", "def create\n @cvi = Cvi.new(params[:cvi])\n @people = Person.all\n\n respond_to do |format|\n if @cvi.save\n format.html { redirect_to @cvi, notice: 'Cvi was successfully created.' }\n format.json { render json: @cvi, status: :created, locati...
[ "0.62096196", "0.57327396", "0.55180025", "0.5486941", "0.5471087", "0.54470193", "0.54228055", "0.5419978", "0.54139256", "0.5397362", "0.5389669", "0.53595895", "0.534344", "0.5341382", "0.5339308", "0.53320116", "0.53165686", "0.53128314", "0.5308162", "0.53056425", "0.528...
0.6160623
1
PATCH/PUT /vcats/1 PATCH/PUT /vcats/1.json
def update respond_to do |format| if @vcat.update(vcat_params) format.html { redirect_to @vcat, notice: 'Vcat was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @vcat.errors, status: :unproce...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def update\n if @vat.update(vat_params)\n head :no_content\n e...
[ "0.6300067", "0.62378", "0.6184597", "0.613466", "0.6112326", "0.6072269", "0.6071464", "0.60632753", "0.6055715", "0.6048371", "0.60286254", "0.6024728", "0.5998288", "0.59934485", "0.59913373", "0.5983626", "0.59600997", "0.5955249", "0.593891", "0.59018034", "0.5901048", ...
0.6513307
0
DELETE /vcats/1 DELETE /vcats/1.json
def destroy @vcat.destroy respond_to do |format| format.html { redirect_to vcats_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @contacter = Contacter.find(params[:id])\n @contacter.destroy\n\n respond_to do |format|\n format.html { redirect_to contacters_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @voc = Voc.find(params[:id])\n @voc.destroy\n\n respond_to do |format...
[ "0.6986445", "0.6930726", "0.69273204", "0.68908286", "0.6868831", "0.6828068", "0.67878157", "0.6769514", "0.6745027", "0.6739681", "0.6734963", "0.67342186", "0.6724443", "0.6717522", "0.6712632", "0.67124283", "0.67081213", "0.6704369", "0.67041045", "0.66914946", "0.66896...
0.7482345
0
update attribute tinhtrang = "cancel"
def cancel_order @order = Dondathang.find(params[:madondathang]) @order.update_column(:tinhtrang, 0) redirect_to dondathangs_path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n # @cancel.update\n end", "def update\n @cancel.update\n end", "def cancel!\n self.update_attributes(status: CANCELLED)\n #self.line_items.update_attributes(status: LineItem::CANCELLED)\n end", "def cancel\n self.update_status :cancelled\n end", "def cancel\n self....
[ "0.61890113", "0.61420786", "0.60934687", "0.6048749", "0.6034673", "0.59269625", "0.5913758", "0.5846952", "0.56876785", "0.5682341", "0.5634392", "0.559555", "0.5582782", "0.55643743", "0.55003583", "0.54321", "0.5405169", "0.5319204", "0.5318773", "0.531601", "0.528762", ...
0.6324724
0
=begin Return the sum of all odd Fibonacci numbers up to and including the passed number if it is a Fibonacci number. The first few numbers of the Fibonacci sequence are 1, 1, 2, 3, 5 and 8, and each subsequent number is the sum of the previous two numbers. INPUT: Obtain a number CREATE a variable called sum = 0 CREATE...
def sum_fibs(number) sum, previous_num, current_num = 0, 1, 0 while current_num <= number sum += current_num if current_num.odd? current_num, previous_num = previous_num, (current_num + previous_num) end sum end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def even_fibonacci_numbers(maxNumber)\n\n sum = 0\n\n previous_num = 1\n current_num = 2\n\n while(current_num < maxNumber)\n\n if(even?(current_num))\n sum += current_num\n end\n\n temp_current_num = current_num\n current_num += previous_num\n previous_num = temp_current_num\n\n end\n\n ...
[ "0.8434741", "0.8218194", "0.8197561", "0.81693375", "0.8112857", "0.8084779", "0.80749935", "0.7907694", "0.7878882", "0.78100955", "0.78027344", "0.7776524", "0.77518153", "0.7709352", "0.76996195", "0.7670309", "0.7642639", "0.7640338", "0.76194185", "0.7596115", "0.759010...
0.8268713
1
Creates the archive file for the export set
def create_archive created = false empty = true Dir.mktmpdir do |tmpdir| # create manifest tmpmf = File.join(tmpdir, DulHydra.export_set_manifest_file_name) # create the zip archive zip_name = "export_set_#{Time.now.strftime('%Y%m%d%H%M%S')}.zip" zip_path = File.join(tmpdir, zi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_archive\n if flash[:archive]\n if flash[:archive] == \"true\"\n result = Urlmaster.where(:archive => \"archive\").order(:archiveTime => :desc)\n nameArc = \"Archive\"\n elsif flash[:archive] == \"false\"\n result = Urlmaster.where(:archive => nil)\n nameArc = \"N...
[ "0.66108465", "0.6405447", "0.6405447", "0.6404191", "0.63135123", "0.6284363", "0.6274789", "0.62562585", "0.62539464", "0.6212706", "0.6210433", "0.619667", "0.6193369", "0.61203647", "0.61004144", "0.6085501", "0.6078206", "0.6076769", "0.60601664", "0.60532856", "0.604427...
0.76592964
0
`Newman::ResponseLoggercall` simply delegates to `EmailLoggerlog_email`, passing it a logger instance, the `"RESPONSE"` prefix for the log line, and an instance of an email object. See `Newman::Server.tick` and `Newman::EmailLoggerlog_email` for details.
def call(params) log_email(params[:logger], "RESPONSE", params[:response]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_response(receiver, response)\n unless response.instance_of? Net::HTTPOK\n LogPoint::write 'Cannot deliver to ' + receiver, 'slack_messages', Logger::WARN\n end\n LogPoint::write(\n sprintf('Processed %s with status %s.', receiver, response.to_s),\n 'inbound',\n ...
[ "0.6320477", "0.59986115", "0.57338136", "0.5668786", "0.5454881", "0.5386759", "0.53791296", "0.53791296", "0.53608936", "0.5359047", "0.5291241", "0.52409506", "0.5216048", "0.5212602", "0.51826835", "0.51766527", "0.5146975", "0.5144983", "0.5110644", "0.5095453", "0.50889...
0.7845866
0
Wait for the 1st pressing of button
def wait_for_press wait_for_presses(1) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def click_on_next_button\n\n click_button NEXT_BUTTON\n sleep(THREAD_SLEEP_1)\n\n end", "def wait_for_elements\n super\n @wait_on << :continue_button\n end", "def click_twice_on_next_button\n\n click_button NEXT_BUTTON\n sleep(THREAD_SLEEP_1)\n click_button NEXT_BUTTON\n sleep(T...
[ "0.6884999", "0.68523604", "0.67731106", "0.65912217", "0.6579494", "0.6528512", "0.65240633", "0.64521736", "0.63221157", "0.6283769", "0.62785935", "0.626881", "0.62026817", "0.6174282", "0.611569", "0.611569", "0.60736", "0.6035912", "0.60349756", "0.6014094", "0.6006043",...
0.76848674
0
Wait for several sequential presses
def wait_for_presses(attempts=2, timeout=@timeout) @intervals = [] attempts.times do interval = [] timer = Time.now while not_pressed? && (Time.now-timer) < timeout do sleep @measure_pause end interval << Time.now-timer timer = Time.now while...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait_for_press\n wait_for_presses(1)\n end", "def wait(seq)\n nseq = nil\n while not nseq\n nseq,data = read_data(seq)\n select\n end\n end", "def wait_for_sequence\n tsbs_wait_update\n tsbs_wait_update while @spriteset.busy?\n end", "def wait_until(index)\n\t\t@wait = ...
[ "0.72735196", "0.6138742", "0.59466857", "0.5853282", "0.5849591", "0.5835887", "0.5835887", "0.5835887", "0.58159745", "0.5795005", "0.57576853", "0.5740697", "0.5719924", "0.5714619", "0.5653641", "0.5601966", "0.56005645", "0.5590964", "0.5590964", "0.55490446", "0.5540566...
0.6488587
1
GET /takes/1 GET /takes/1.json
def show @take = Take.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @take } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @take = Take.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @take }\n end\n end", "def create\n @take = Take.new(params[:take])\n\n respond_to do |format|\n if @take.save\n format.html { redirect_to @take, notice: 'Take was...
[ "0.6477233", "0.634259", "0.62342066", "0.6126795", "0.5958599", "0.59035164", "0.58886564", "0.5847418", "0.5841845", "0.5752354", "0.57515895", "0.56847686", "0.5659129", "0.55674803", "0.5537241", "0.55144274", "0.5479688", "0.54485464", "0.5429827", "0.53990644", "0.53878...
0.6755486
0
GET /takes/new GET /takes/new.json
def new @take = Take.new respond_to do |format| format.html # new.html.erb format.json { render json: @take } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @intake = Intake.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @intake }\n end\n end", "def new\n @taker = Taker.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @taker }\n end\n e...
[ "0.7153195", "0.7007305", "0.6969601", "0.6764588", "0.6743593", "0.67319083", "0.6719353", "0.6702569", "0.66981727", "0.6697857", "0.6688329", "0.66332465", "0.6610931", "0.6595486", "0.6595239", "0.6583546", "0.6559834", "0.65441644", "0.6526687", "0.6486176", "0.6475536",...
0.7784209
0
POST /takes POST /takes.json
def create @take = Take.new(params[:take]) respond_to do |format| if @take.save format.html { redirect_to @take, notice: 'Take was successfully created.' } format.json { render json: @take, status: :created, location: @take } else format.html { render action: "new" } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post\n Typhoeus.post(@url,\n body: @results_hash.to_json,\n headers: { 'Content-Type' => 'application/json' })\n end", "def take\n sanitized = whitelist(params, :take)\n travel = Travels::Travel.find(sanitized[:id])\n\n if travel.taken?\n respond_to do |for...
[ "0.62596995", "0.60236543", "0.60166395", "0.59079766", "0.5735016", "0.5717084", "0.57051504", "0.563229", "0.56310683", "0.5553367", "0.55511564", "0.554676", "0.5546028", "0.55268085", "0.5482261", "0.5454751", "0.543923", "0.5430948", "0.5425836", "0.5423114", "0.53862566...
0.63803816
0
PUT /takes/1 PUT /takes/1.json
def update @take = Take.find(params[:id]) respond_to do |format| if @take.update_attributes(params[:take]) format.html { redirect_to @take, notice: 'Take was successfully updated.' } format.json { head :ok } else format.html { render action: "edit" } format.json { re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @taking.update(taking_params)\n format.html { redirect_to @taking, notice: 'Taking was successfully updated.' }\n format.json { render :show, status: :ok, location: @taking }\n else\n format.html { render :edit }\n format.json { rend...
[ "0.6561563", "0.6233122", "0.60324746", "0.60183495", "0.5975659", "0.57838595", "0.56526905", "0.56068385", "0.55873376", "0.5574791", "0.55651975", "0.5560537", "0.55545336", "0.5490192", "0.5486789", "0.54046303", "0.540139", "0.5361453", "0.5348683", "0.5322026", "0.52936...
0.65464926
1
DELETE /takes/1 DELETE /takes/1.json
def destroy @take = Take.find(params[:id]) @take.destroy respond_to do |format| format.html { redirect_to takes_url } format.json { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @intake.destroy\n respond_to do |format|\n format.html { redirect_to intakes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @intake = Intake.find(params[:id])\n @intake.destroy\n\n respond_to do |format|\n flash[:success] = \"Intake successfu...
[ "0.7178577", "0.6837524", "0.6755592", "0.67516917", "0.67245346", "0.67035955", "0.6640906", "0.66265833", "0.65525484", "0.65395826", "0.64826", "0.6481597", "0.64754385", "0.6473317", "0.64717555", "0.6470322", "0.6466854", "0.64587414", "0.6453087", "0.64503336", "0.64402...
0.7468431
0
Only to be used by admins in case user accidentally revoked consent.
def unrevoke_consent! update(consent_revoked_at: nil) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def consent_revoked?\n !consent_revoked_at.nil?\n end", "def user_consenting; end", "def user_consenting?; end", "def user_consenting=(_arg0); end", "def enforce_requested_account_authorized!\n clear_authorization! unless requested_account_authorized?\n end", "def authorize_consent_edit(id)\n ...
[ "0.72662693", "0.6805394", "0.6794904", "0.64892995", "0.63733685", "0.6357512", "0.62036127", "0.61047137", "0.6099146", "0.60566825", "0.6016225", "0.60021454", "0.59810555", "0.5901965", "0.58644783", "0.58252954", "0.5788188", "0.5787609", "0.57738245", "0.5748696", "0.57...
0.78480977
0
Only used by admins when Slice failed to initially set a subject code.
def assign_subject! return if subject_code.present? update(slice_subject_id: nil) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setSubjectCode(code)\n Rails.logger.debug(\"app setSubjectCode code: #{code.inspect}\")\n if Subject.where(:tree_type_id => @treeTypeRec.id).map{ |s| s.code}.include?(code)\n # next default Subject to cookie:\n Rails.logger.debug(\"app Subject code matched! #{code.inspect}\")\n @...
[ "0.6801242", "0.62651646", "0.6255594", "0.6205414", "0.61689514", "0.5974212", "0.59194434", "0.5770905", "0.57375824", "0.56911576", "0.56732064", "0.5660391", "0.5657834", "0.5630112", "0.56098026", "0.5580429", "0.55401474", "0.55401474", "0.55401474", "0.55401474", "0.55...
0.75208724
0
POST /products/1/flags POST /products/1/flags.json
def create @product = Product.find(params[:product_id]) params[:flags][:reasons].each do |reason| @flag = @product.flags.build(reason: reason) @flag.save end respond_to do |format| if @flag.save format.json { head :no_content } format.js else format.js...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flag_params\n params.require(:flags).permit(:product_id, :reason)\n end", "def new\n @product = Product.find(params[:product_id])\n @flags = @product.flags.build\n end", "def create\n @flag = Flag.new(flag_params)\n\n respond_to do |format|\n if @flag.save\n format.html { redir...
[ "0.6909392", "0.64620566", "0.62389195", "0.61640745", "0.60759115", "0.60061675", "0.5993025", "0.59844285", "0.58651906", "0.5852358", "0.5788886", "0.5781071", "0.5781071", "0.5771978", "0.57350963", "0.5707807", "0.5628398", "0.56241083", "0.5607077", "0.5579951", "0.5530...
0.7408841
0
Start Middleman in a fork
def start if @options[:"disable-watcher"] bootup else @server_job = fork { Signal.trap(::Middleman::WINDOWS ? :KILL : :TERM) { exit! } bootup } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forking\n call_hooks :before, :fork\n end", "def forking\n call_hooks :before, :fork\n end", "def fork\n git_url = shift_argument\n name = shift_argument\n unless git_url and name\n error(\"Usage: mortar projects:fork GIT_URL PROJECT\\nMust specify GIT_URL and PROJECT.\")\n ...
[ "0.58797365", "0.58797365", "0.56956464", "0.5664571", "0.5636153", "0.56340796", "0.5632829", "0.5625823", "0.55948454", "0.55848986", "0.5573942", "0.5564966", "0.555429", "0.5554123", "0.55486053", "0.55458647", "0.55291855", "0.55291855", "0.5436509", "0.5432917", "0.5425...
0.6468301
0
Stop the forked Middleman
def stop puts "== The Middleman is shutting down" if !@options[:"disable-watcher"] Process.kill(::Middleman::WINDOWS ? :KILL : :TERM, @server_job) Process.wait @server_job @server_job = nil end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop\n end", "def stop\n end", "def stop\n end", "def stop\n end", "def stop\n end", "def stop\n end", "def stop\n end", "def stop\n end", "def stop\n exit\n end", "def stop\n control :kill\n self\n end", "def stop\n end", "def stop\n end", "def ...
[ "0.6332641", "0.6332641", "0.6332641", "0.6332641", "0.6332641", "0.6332641", "0.6332641", "0.6332641", "0.6302515", "0.62946886", "0.6277352", "0.6277352", "0.6277352", "0.6277352", "0.6253802", "0.6242588", "0.6237432", "0.6227349", "0.6227349", "0.6227349", "0.6227349", ...
0.6689945
0
POST /admin/registries This method checks whether the given registry is reachable or not. If it is not, then it will redirect back to the :new page asking for confirmation. If the :force parameter is passed, then this check is not done. If this check is passed/skipped, then it will try to create the registry.
def create @registry = Registry.new(create_params) # Check the reachability of the registry. unless params[:force] msg = @registry.reachable? unless msg.empty? logger.info "\nRegistry not reachable:\n#{@registry.inspect}\n#{msg}\n" msg = "#{msg} You can skip this check by clicki...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @registry = Registry.new(create_params)\n\n # Check the reachability of the registry.\n\n check_reachability(\"new\") unless params[:force]\n return if @unreachable\n\n if @registry.save\n Namespace.update_all(registry_id: @registry.id)\n redirect_to admin_registries_path, not...
[ "0.72968155", "0.6635199", "0.64209646", "0.63894355", "0.6382682", "0.6102412", "0.6005517", "0.59569824", "0.5934627", "0.588765", "0.5781111", "0.575869", "0.56620467", "0.55873644", "0.55851525", "0.5581801", "0.5507844", "0.5464698", "0.5404092", "0.5366641", "0.5358118"...
0.7223544
1
GET /admin/registries/:id/edit Note that the admin will only be able to edit the hostname if there are no repositories.
def edit @registry = Registry.find(params[:id]) @can_change_hostname = !Repository.any? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @registry = Registry.find(params[:id])\n @registry.assign_attributes(update_params)\n @can_change_hostname = !Repository.any?\n\n # Check the reachability of the registry.\n check_reachability(\"edit\")\n return if @unreachable\n\n if @registry.save\n # NOTE: if we decide to ...
[ "0.7030276", "0.6197419", "0.6158881", "0.6002386", "0.5942345", "0.5783055", "0.577759", "0.5705152", "0.5696534", "0.56743443", "0.56727284", "0.56552076", "0.56472874", "0.56472874", "0.5581536", "0.55620897", "0.55186594", "0.5501763", "0.54858047", "0.54740727", "0.54535...
0.7837682
1
PUT /admin/registries/1 Right now this just toggles the value of the "use_ssl" attribute for the given registry. This might change in the future.
def update @registry = Registry.find(params[:id]) @registry.update_attributes(update_params) redirect_to admin_registries_path, notice: "Registry updated successfully!" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @registry = @user.registries.find(params[:id])\n\n respond_to do |format|\n # if @registry.update_attributes(params[:registry])\n if @registry.update_attributes(registry_params)\n flash[:notice] = 'Registry was successfully updated.'\n format.html { redirect_to([@user,@reg...
[ "0.5815516", "0.57655406", "0.5697738", "0.5697738", "0.54620016", "0.543834", "0.5289092", "0.51607645", "0.51607645", "0.51267487", "0.4977713", "0.4977713", "0.49546748", "0.49470106", "0.4897158", "0.4820266", "0.47741857", "0.474622", "0.47459885", "0.47406054", "0.47361...
0.5967756
0
Raises a routing error if there is already a registry in place. NOTE: (mssola) remove this once we support multiple registries.
def registry_created raise ActionController::RoutingError, "Not found" if Registry.count > 0 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def registry_created\n raise ActionController::RoutingError, \"Not found\" if Registry.any?\n end", "def undefined_route\n routing_error!\n end", "def force_registry_config!\n return unless current_user && current_user.admin?\n return if Registry.any?\n return if protected_controllers?(\"admin...
[ "0.7509875", "0.62727773", "0.607034", "0.60520446", "0.58868074", "0.5885744", "0.5823939", "0.5797855", "0.5775896", "0.5720352", "0.57083416", "0.56541425", "0.56013775", "0.5586213", "0.55858654", "0.55858654", "0.55858654", "0.55858654", "0.55858654", "0.55858654", "0.55...
0.7105002
1
The required/permitted parameters on update. The hostname parameter will be allowed depending whether there are repositories already created or not.
def update_params permitted = [:name, :use_ssl, (:hostname unless Repository.any?), :external_hostname].compact params.require(:registry).permit(permitted) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update!(**args)\n @host_name = args[:host_name] if args.key?(:host_name)\n @host_owner = args[:host_owner] if args.key?(:host_owner)\n end", "def update!(**args)\n @host_name = args[:host_name] if args.key?(:host_name)\n @host_owner = args[:host_owner] if args.key?(...
[ "0.675629", "0.675629", "0.6646779", "0.66339713", "0.65608615", "0.6528154", "0.6465911", "0.64468294", "0.64262486", "0.6359615", "0.632642", "0.6301619", "0.6298921", "0.6283517", "0.62793624", "0.6275876", "0.6260345", "0.6255733", "0.6249143", "0.6249143", "0.62479204", ...
0.7665663
1
GET /sent_orders GET /sent_orders.json
def index @sent_orders = SentOrder.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def orders\n authenticated_post(\"auth/r/orders\").body\n end", "def orders\n authenticated_post(\"orders\").body\n end", "def orders\n params = { command: 'account_orders' }\n get('/json.php', params)\n end", "def getorders(args={})\n {\n :method=> \"GetOrders\...
[ "0.72561485", "0.72540057", "0.72355837", "0.71782976", "0.70714587", "0.7059863", "0.6933519", "0.6875712", "0.6867955", "0.6867653", "0.6867653", "0.6867653", "0.6867653", "0.6851253", "0.6844815", "0.6825695", "0.6786025", "0.6778447", "0.6758612", "0.66730595", "0.662757"...
0.75403595
0
POST /sent_orders POST /sent_orders.json
def create @sent_order = SentOrder.new(sent_order_params) respond_to do |format| if @sent_order.save format.html { redirect_to @sent_order, notice: 'Sent order was successfully created.' } format.json { render :show, status: :created, location: @sent_order } else format.html...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def submit_order()\n\tputs \"Submitting order\"\n\tdata = create_order()\n\tresponse = request_post(\"/api/order\", data)\n\tputs response.body\nend", "def orders\n authenticated_post(\"orders\").body\n end", "def orders\n authenticated_post(\"auth/r/orders\").body\n end", "def sent_order_par...
[ "0.692099", "0.67827463", "0.67360765", "0.6681294", "0.65560335", "0.65097773", "0.65011096", "0.62977684", "0.6278823", "0.6248882", "0.6245569", "0.6236823", "0.62290007", "0.61963034", "0.6188796", "0.6127706", "0.61120355", "0.60926455", "0.606832", "0.606022", "0.605812...
0.71067053
0
PATCH/PUT /sent_orders/1 PATCH/PUT /sent_orders/1.json
def update respond_to do |format| if @sent_order.update(sent_order_params) format.html { redirect_to @sent_order, notice: 'Sent order was successfully updated.' } format.json { render :show, status: :ok, location: @sent_order } else format.html { render :edit } format.jso...
{ "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.6592586", "0.6592586", "0.64970756", "0.64927095", "0.6491152", "0.6457471", "0.6457309", "0.6439364", "0.64391637", "0.64248854", "0.6408306", "0.6408286", "0.6401164", "0.6394601", "0.6394601", "0.6394601", "0.6394601", "0.6394601", "0.6394601", "0.6394601", "0.6394601",...
0.6974288
0
DELETE /sent_orders/1 DELETE /sent_orders/1.json
def destroy @sent_order.destroy respond_to do |format| format.html { redirect_to sent_orders_url, notice: 'Sent 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 @order_item.destroy\n\n render json: { operation: 'OK' }, status: :ok\n end", "def destroy\n @order1 = Order1.find(params[:id])\n @order1.destroy\n\n respond_to do |fo...
[ "0.7170959", "0.70910597", "0.7090722", "0.70727146", "0.705218", "0.70325065", "0.7021819", "0.7008883", "0.69875664", "0.69875664", "0.69875664", "0.69875664", "0.69875664", "0.69875664", "0.69875664", "0.69875664", "0.69875664", "0.69875664", "0.69875664", "0.69875664", "0...
0.7422989
0
code your move_taken? method here! def position_taken?(board, position) move = "move".to_i if (board[move] === " ") || (board[move] === nil) || (board[move] === "") false else true end end
def position_taken?(board, position) move = position.to_i if board[move] == " " false elsif board[move] == "" false elsif board[move] == nil false else true end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def position_taken?(board, move)\n if board[move] == \" \" || board[move] == \"\" || board[move] == nil \n return false \n else \n return true \n end\nend", "def position_taken?(board,move)\n if board[move]!=\" \"\n return false\n end\nreturn true\nend", "def position_taken?(board, move, char = \...
[ "0.93517214", "0.92236435", "0.9086558", "0.9083947", "0.90748966", "0.905349", "0.90367", "0.9022755", "0.9005052", "0.9000995", "0.8982276", "0.89795566", "0.8978831", "0.8976406", "0.8976008", "0.89758176", "0.8975321", "0.89719945", "0.8969942", "0.8968089", "0.8967178", ...
0.9378621
0
Returns how much better is VAL relative to TO_BASE
def get_percentage_score(val, to_base) return (1.0 - val[:score] / to_base[:score])*100 * (@greater_is_better ? -1.0 : 1.0) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tfullness\n ttaken.to_f/tlimit.to_f\n end", "def actual_cost\n self.cost/1000.to_f\n end", "def eth_gain\n return ((eth_value - eth_initial) / eth_value) * 100\n end", "def prop_t\n bases_t / length.to_f\n end", "def bases\n return (self.calculate_singles+(2*self.doubles)+(3*self...
[ "0.58536536", "0.5716783", "0.56488043", "0.56192696", "0.5610834", "0.5554966", "0.5483016", "0.54474854", "0.54246396", "0.537459", "0.5346269", "0.5346143", "0.53382283", "0.53270215", "0.5319643", "0.53016335", "0.52912176", "0.5290933", "0.528571", "0.5277642", "0.524926...
0.6566606
0
GET /sequence_databases GET /sequence_databases.json
def index @sequence_databases = SequenceDatabase.all respond_to do |format| format.html # index.html.erb format.json { render json: @sequence_databases } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @sequence_database = SequenceDatabase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sequence_database }\n end\n end", "def databases\n get '_all_dbs'\n end", "def databases\n CouchRest.get \"#{@uri}/_all_dbs\...
[ "0.66002136", "0.64167887", "0.6359427", "0.6263057", "0.6263057", "0.6256265", "0.62258375", "0.6217974", "0.6153418", "0.6133572", "0.60011274", "0.60007834", "0.59628934", "0.58841187", "0.58750045", "0.5851088", "0.5849692", "0.5826851", "0.581046", "0.58032304", "0.56972...
0.73612154
0
GET /sequence_databases/1 GET /sequence_databases/1.json
def show @sequence_database = SequenceDatabase.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @sequence_database } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @sequence_databases = SequenceDatabase.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sequence_databases }\n end\n end", "def new\n @sequence_database = SequenceDatabase.new\n\n respond_to do |format|\n format.html # new.html...
[ "0.72535896", "0.64762664", "0.6330242", "0.61916727", "0.61575747", "0.6095603", "0.60727715", "0.6072693", "0.60702294", "0.60083354", "0.5998585", "0.59667784", "0.5964319", "0.58931726", "0.58871156", "0.58805364", "0.5847584", "0.583658", "0.5815325", "0.5815325", "0.581...
0.70572686
1
GET /sequence_databases/new GET /sequence_databases/new.json
def new @sequence_database = SequenceDatabase.new respond_to do |format| format.html # new.html.erb format.json { render json: @sequence_database } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @db_sequence = DbSequence.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @db_sequence }\n end\n end", "def create\n @sequence_database = SequenceDatabase.new(params[:sequence_database])\n\n respond_to do |format|\n if @sequence_da...
[ "0.74463075", "0.7147828", "0.7056954", "0.7008432", "0.7007821", "0.6622006", "0.65427643", "0.65119684", "0.6474917", "0.6455112", "0.6404893", "0.624709", "0.6196404", "0.61097676", "0.60440373", "0.604107", "0.6029041", "0.60132676", "0.5999954", "0.5997611", "0.5936527",...
0.77599245
0
POST /sequence_databases POST /sequence_databases.json
def create @sequence_database = SequenceDatabase.new(params[:sequence_database]) respond_to do |format| if @sequence_database.save format.html { redirect_to @sequence_database, notice: 'Sequence database was successfully created.' } format.json { render json: @sequence_database, status: :...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @db_sequence = DbSequence.new(params[:db_sequence])\n\n respond_to do |format|\n if @db_sequence.save\n format.html { redirect_to @db_sequence, notice: 'Db sequence was successfully created.' }\n format.json { render json: @db_sequence, status: :created, location: @db_sequence...
[ "0.63449854", "0.582666", "0.58077097", "0.57059467", "0.5628269", "0.56260735", "0.55951136", "0.5581875", "0.55646807", "0.5494088", "0.54611206", "0.5457465", "0.53778046", "0.535239", "0.5328971", "0.5319635", "0.5270742", "0.52603316", "0.5247992", "0.5220298", "0.520098...
0.68074614
0
PUT /sequence_databases/1 PUT /sequence_databases/1.json
def update @sequence_database = SequenceDatabase.find(params[:id]) respond_to do |format| if @sequence_database.update_attributes(params[:sequence_database]) format.html { redirect_to @sequence_database, notice: 'Sequence database was successfully updated.' } format.json { head :no_conten...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @db_sequence = DbSequence.find(params[:id])\n\n respond_to do |format|\n if @db_sequence.update_attributes(params[:db_sequence])\n format.html { redirect_to @db_sequence, notice: 'Db sequence was successfully updated.' }\n format.json { head :no_content }\n else\n ...
[ "0.60959595", "0.60441715", "0.6022282", "0.5768734", "0.57400894", "0.5675925", "0.56457794", "0.5602228", "0.5564406", "0.542365", "0.542365", "0.54073274", "0.5373518", "0.53665483", "0.53658414", "0.52799886", "0.52790797", "0.52790797", "0.5278393", "0.52693814", "0.5238...
0.6492773
0
DELETE /sequence_databases/1 DELETE /sequence_databases/1.json
def destroy @sequence_database = SequenceDatabase.find(params[:id]) @sequence_database.destroy respond_to do |format| format.html { redirect_to sequence_databases_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @database = Database.find(params[:id])\n path = @database.path\n delete = %x[rm -R #{path}]\n @database.destroy\n\n respond_to do |format|\n format.html { redirect_to databases_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @db_sequence = DbSeq...
[ "0.73278433", "0.72334826", "0.69464463", "0.6924883", "0.68505484", "0.67781097", "0.67681587", "0.6763715", "0.6756703", "0.67332107", "0.66437435", "0.6624889", "0.6581845", "0.65590465", "0.64270264", "0.6372385", "0.63704145", "0.636617", "0.6324328", "0.6323744", "0.626...
0.7679413
0
Initialize the Rake application object and load the core rake tasks, the site specific rake tasks, and the site specific ruby code. Any extra command line arguments are converted into a page name and directory that might get created (depending upon the task invoked).
def init( args ) # Make sure we're in a folder with a Sitefile options = app.standard_rake_options [['--rakefile', 'Sitefile'], ['--no-search', nil], ['--silent', nil]].each {|opt, value| options.assoc(opt).last.call(value)} unless app.have_rakefile raise RuntimeError, "Sitefile not fou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init( args )\n # Make sure we're in a folder with a Sitefile\n options = app.standard_rake_options\n [['--rakefile', 'StratusSite'],\n ['--no-search', nil],\n ['--silent', nil]].each {|opt, value| options.assoc(opt).last.call(value)}\n\n unless app.have_rakefile\n @mode = :app\n end...
[ "0.73262906", "0.7137913", "0.6535776", "0.647217", "0.61992186", "0.6181829", "0.6055132", "0.5933987", "0.59305", "0.5900405", "0.58736", "0.587042", "0.58615386", "0.58466977", "0.5814974", "0.57816756", "0.5776587", "0.57568645", "0.57568645", "0.5753186", "0.57315415", ...
0.79247665
0
Returns the options hash from the Rake application object.
def options app.options end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def options\n @options ||= Launchr::OrderedHash.new\n @options\n end", "def app_config\n values = {}\n\n GCLOUD_OPTIONS_LIST.each do |option|\n values[option] = ENV[option.to_s.upcase] || self.send(option)\n end\n\n return values\n end", "def create_applic...
[ "0.6797926", "0.6518242", "0.64163345", "0.6399167", "0.6370971", "0.63249594", "0.6321097", "0.6317936", "0.6317936", "0.6317936", "0.6304859", "0.62419444", "0.62419444", "0.62419444", "0.6240457", "0.6237937", "0.6237937", "0.6231898", "0.62092257", "0.61843485", "0.617840...
0.72404844
1
Load options from the command line into the ::Webby.site struct
def load_command_line_options cmd_line_options.each do |key, value| ::Webby.site.__send__("#{key}=", value) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse( args )\n self.data = File.join(::Webby::PATH, 'data')\n self.update = false\n\n opts = OptionParser.new\n opts.banner << ' site'\n\n opts.separator ''\n opts.on('-u', '--update',\n 'update the rake tasks for the site') {self.update = true}\n\n opts.separator ''\n opts....
[ "0.73902893", "0.669798", "0.6692928", "0.6650126", "0.64885277", "0.64319634", "0.6401834", "0.63922215", "0.6383291", "0.6315386", "0.6272112", "0.6243736", "0.6235486", "0.62275654", "0.62272424", "0.6217646", "0.6211813", "0.6201291", "0.6169243", "0.6154355", "0.61165124...
0.8533441
0
Add p to self, return modified self
def add(p) q = self.dup q.add!(p) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def <<(p)\n Parsby.new \"(#{label} << #{p.label})\" do |c|\n x = parse c\n y = p.parse c\n # like x << y, but without modifying x.\n x + [y]\n end\n end", "def add!(p)\n@x += p.x\n@y += p.y\nself\nend", "def +(p)\n Pair.new(@x + p.x, @y + p.y)\n end", "def push(p)\n @o...
[ "0.6828403", "0.6678371", "0.64425683", "0.64049053", "0.64046293", "0.62869114", "0.6275837", "0.60978657", "0.6082984", "0.6082638", "0.6082638", "0.5891301", "0.5889165", "0.57722276", "0.5726317", "0.56707704", "0.5667099", "0.5647602", "0.56290776", "0.5578171", "0.55781...
0.75797635
0
Create an alias for the method m in the class (or module) c
def backup(c, m, prefix="original") n = :"#{prefix}_#{m}" # Compute the alias c.class_eval { # Because alias_method is private alias_method n, m # Make n an alias for m } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def backup(c, m, prefix = \"original\") #method m ,in the class (or module) c\r\n n = :\"#{prefix}_#{m}\" #compute the alias\r\n c.class_eval { #alias method is private\r\n alias_method n,m #make n alias for m\r\n }\r\nend", "def define_alias_methods(member_name, options); end", "def metaalias(...
[ "0.7220271", "0.67392474", "0.66482943", "0.6549997", "0.64849764", "0.64849764", "0.63273084", "0.6309301", "0.62176865", "0.6125922", "0.6088447", "0.60520935", "0.6049291", "0.60057884", "0.5986287", "0.5963168", "0.5911216", "0.5887935", "0.5876789", "0.58744866", "0.5850...
0.686177
1
Ruby 1.8 keeps Mutex in this library Obtain the Mutex associated with the object o, and then evaluate the block under the protection of that Mutex. This works like the synchronized keyword of Java.
def synchronized(o) o.mutex.synchronize { yield } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use(&block)\n @mutex.synchronize { yield @obj, @mutex }\n end", "def synchronize(&block)\n @mutex.synchronize(&block)\n end", "def synchronize(&block)\n @mutex.synchronize(&block)\n end", "def synchronize_block(&block)\n @lock.synchronize(&block)\n end", "def synchronized(*a...
[ "0.72009313", "0.69895357", "0.6911238", "0.68175757", "0.6743456", "0.6664544", "0.6664544", "0.6664544", "0.6664544", "0.6642533", "0.65307057", "0.64779913", "0.64725184", "0.6470529", "0.6442934", "0.6421002", "0.63997877", "0.63997877", "0.63997877", "0.63997877", "0.639...
0.81407624
0
Trace the specified methods, sending output to STDERR.
def trace!(*methods) @_traced = @_traced || [] # Remember the set of traced methods # If no methods were specified, use all public methods defined # directly (not inherited) by the class of this object methods = public_methods(false) if methods.size == 0 methods.map! {|m| m.to_sym } # Convert any strings to symbols met...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trace( *messages )\n\t$stderr.puts( messages.join ) if Rake.application.options.trace\nend", "def untrace!(*methods)\n if methods.size == 0 # If no methods specified untrace\n methods = @_traced # all currently traced methods \n STDERR << \"Untracing all methods on #{object_id}\\n\"\n e...
[ "0.6634732", "0.6590178", "0.6538972", "0.6538972", "0.62534076", "0.6166968", "0.6154179", "0.6154179", "0.60105944", "0.5906177", "0.58481014", "0.5757657", "0.57392865", "0.5667338", "0.55685174", "0.5563224", "0.5557912", "0.5530948", "0.5475306", "0.5453173", "0.54415286...
0.6634983
0
Append the value x to the array a, return a. If no array is specified, start with an empty one.
def append(x, a=[]) a << x end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append(x, a=[])\n a << x\nend", "def add_to_array(x, y)\n combined_array = x\n combined_array.push(y)\nend", "def add_to_array(arr, a)\r\n\treturn_array = arr\r\n\treturn_array << a\r\nend", "def push(x)\n @arr1.push(x)\n end", "def append(array,input)\n array << input\n return array\n...
[ "0.7386795", "0.71238506", "0.6716101", "0.6693569", "0.66855437", "0.66721404", "0.6580559", "0.6580559", "0.6580559", "0.65744185", "0.650149", "0.6478031", "0.640218", "0.63410395", "0.6300418", "0.6290103", "0.62880206", "0.6210427", "0.62018836", "0.61867696", "0.6182971...
0.7267476
1
Return the largest of the one or more arguments passed
def max(first, *rest) # Assume that the required first argument is the largest max = first # Now loop through each of the optional arguments looking for bigger ones rest.each {|x| max = x if x > max } # Return the largest one we found max end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max(*args)\n args.max\n end", "def largest_number (number_1, number_2)\n \n [number_1, number_2].max\n \nend", "def max(one_param, *numbers, another)\n\t#Variable length parameters passed in become an array\n\tnumbers.max\nend", "def max _obj, _args\n \"_obj max _args;\" \n end",...
[ "0.8275227", "0.7927337", "0.7652894", "0.76392627", "0.75789386", "0.7576753", "0.75646853", "0.7543834", "0.7539919", "0.74939895", "0.7417148", "0.7410273", "0.7392411", "0.7387346", "0.73690325", "0.7356477", "0.7353507", "0.73421687", "0.729325", "0.72673064", "0.7266066...
0.7979858
1
Generate a sequence of n numbers mi + c and pass them to the block
def sequence2(n, m, c) i = 0 while(i < n) # loop n times yield i*m + c # pass next element of the sequence to the block i += 1 end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sequence(n, m, c)\r\n i, s = 0, []\r\n while(i < n)\r\n y=m*i + c\r\n\tyield y if block_given?\r\n\ts << y\r\n\ti+= 1\r\n end\r\n s\r\nend", "def sequence4(n, m, c, b) # No ampersand used for argument b\ni = 0\nwhile(i < n)\nb.call(i*m + c)\n# Proc is called explicitly\ni += 1\nend\nend", "def multi...
[ "0.78114694", "0.65556794", "0.64079994", "0.6201119", "0.615187", "0.613652", "0.6132093", "0.60984176", "0.60766727", "0.6068652", "0.6063258", "0.60457385", "0.59958774", "0.5926588", "0.5922441", "0.58267474", "0.5822738", "0.57961434", "0.57945025", "0.5788779", "0.57839...
0.78916
0
Return a pair of lambdas that share access to a local variable.
def accessor_pair(initialValue=nil) value = initialValue # A local variable shared by the returned lambdas. getter = lambda { value } # Return value of local variable. setter = lambda {|x| value = x } # Change value of local variable. return getter,setter # Return pair of lambdas to caller. end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accessor_pair(initialValue=nil)\n value = initialValue # A local vairable shared by the returned lambdas.\n getter = lambda{value} # Return value of local vairable.\n setter = lambda{|x| value=x} # Change value of local vairable.\n return getter, setter ...
[ "0.6333249", "0.59444535", "0.55528265", "0.54237854", "0.53516966", "0.5339539", "0.5320951", "0.53135765", "0.5311402", "0.5305853", "0.5299982", "0.52756053", "0.52011555", "0.51733446", "0.5173004", "0.5161763", "0.51458865", "0.51359606", "0.51310384", "0.5073355", "0.50...
0.66431224
0