query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
$File$ $Author$ $Date$ $Revision$
def rabbits(mem, m, n) return 0 if n < 0 mem[:rabbits] ||= [0, 1, 1] mem[:rabbits][n] ||= rabbits(mem, m, n-1) - newborn(mem, m, n-m) + newborn(mem, m, n) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def verdi; end", "def probers; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def schubert; end", "def who_we_are\r\n end", "def loc; end", "def loc; end", "def loc; end", "def src; end", "def src; end", "def src; end", "def ext...
[ "0.75132084", "0.6883884", "0.6582789", "0.6389289", "0.6389289", "0.6389289", "0.6389289", "0.63495743", "0.631917", "0.63124007", "0.63124007", "0.63124007", "0.62987363", "0.62987363", "0.62987363", "0.6246101", "0.6246101", "0.62054044", "0.62054044", "0.62054044", "0.620...
0.0
-1
quick note on paging: there are two "calls" that can generate an unbounded (well, bounded at the max number of entries) list of entries 1. search 2. tags
def pagetitle(page) "Page #{page}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_implementation( tags, user, page, per_page )\n if tags == 'testtag'\n items = []\n 1.upto(20) {|i| items<< ('tag_'+i.to_s)}\n return items\n elsif user == 'testuser'\n items = []\n 1.upto(20) {|i| items<< ('user_'+i.to_s)}\n return items\n elsif !user && !tags\n ...
[ "0.6880123", "0.6594059", "0.6545681", "0.6442195", "0.6333141", "0.6203575", "0.6192486", "0.6163629", "0.6131244", "0.6124893", "0.61235386", "0.61188924", "0.61185634", "0.6101337", "0.60960186", "0.609207", "0.6089053", "0.6064753", "0.60486245", "0.6041328", "0.6032404",...
0.0
-1
GET /committees_districts GET /committees_districts.json
def all @committees_districts = CommitteesDistrict.joins(:voivodship).all.where("votes is not null").order("voivodships.name") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_committees_district\n @committees_district = CommitteesDistrict.find(params[:id])\n end", "def get_district_list ( year )\n get_api_resource \"#{@@api_base_url}districts/#{year}\"\n end", "def create\n @committees_district = CommitteesDistrict.new(committees_district_params)\n\n respo...
[ "0.7062748", "0.6783752", "0.67304915", "0.6569313", "0.64704114", "0.6371459", "0.6273493", "0.6176255", "0.61527747", "0.61046803", "0.6102989", "0.6044632", "0.60257024", "0.60257024", "0.59875596", "0.5987313", "0.59506285", "0.5950379", "0.59498394", "0.5923602", "0.5901...
0.6437266
5
GET /committees_districts/1 GET /committees_districts/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_committees_district\n @committees_district = CommitteesDistrict.find(params[:id])\n end", "def create\n @committees_district = CommitteesDistrict.new(committees_district_params)\n\n respond_to do |format|\n if @committees_district.save\n format.html { redirect_to @committees_dis...
[ "0.73049384", "0.69132155", "0.6640247", "0.6586527", "0.6547623", "0.6485642", "0.647416", "0.64469546", "0.64369845", "0.64229906", "0.641797", "0.6348234", "0.62624407", "0.6183684", "0.6183046", "0.6183046", "0.6183046", "0.6134049", "0.6134049", "0.61040586", "0.6086997"...
0.0
-1
POST /committees_districts POST /committees_districts.json
def create @committees_district = CommitteesDistrict.new(committees_district_params) respond_to do |format| if @committees_district.save format.html { redirect_to @committees_district, notice: 'Committees district was successfully created.' } format.json { render :show, status: :created, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_committees_district\n @committees_district = CommitteesDistrict.find(params[:id])\n end", "def create\n @district = District.new(district_params)\n\n respond_to do |format|\n if @district.save\n format.html { redirect_to @district, notice: 'District was successfully created.' }\...
[ "0.7175959", "0.6954812", "0.6954812", "0.6861234", "0.6830998", "0.6749745", "0.6640001", "0.6634793", "0.6598612", "0.659209", "0.6589841", "0.6491917", "0.6474568", "0.63967204", "0.6395624", "0.6387284", "0.6305317", "0.6301924", "0.6299319", "0.6299319", "0.62172157", ...
0.7823064
0
PATCH/PUT /committees_districts/1 PATCH/PUT /committees_districts/1.json
def update respond_to do |format| if @committees_district.update(committees_district_params) format.html { redirect_to @committees_district, notice: 'Committees district was successfully updated.' } format.json { render :show, status: :ok, location: @committees_district } else fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @electoral_district = ElectoralDistrict.find(params[:id])\n\n respond_to do |format|\n if @electoral_district.update_attributes(params[:electoral_district])\n format.html { redirect_to @electoral_district, notice: 'Electoral district was successfully updated.' }\n format.json ...
[ "0.68556154", "0.6837712", "0.6834776", "0.68011975", "0.68011975", "0.6735658", "0.6724123", "0.66546994", "0.6636661", "0.6567615", "0.65157294", "0.64855766", "0.64855766", "0.64730316", "0.6463057", "0.62901825", "0.62179685", "0.6198103", "0.6102439", "0.6084682", "0.600...
0.75307155
0
DELETE /committees_districts/1 DELETE /committees_districts/1.json
def destroy @committees_district.destroy respond_to do |format| format.html { redirect_to committees_districts_url, notice: 'Committees district was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @clidistrict = Clidistrict.find(params[:id])\n @clidistrict.destroy\n\n respond_to do |format|\n format.html { redirect_to clidistricts_url }\n format.json { head :ok }\n end\n end", "def destroy\n @congressional_district = CongressionalDistrict.find(params[:id])\n @con...
[ "0.7479546", "0.74526256", "0.74226516", "0.7386433", "0.7362839", "0.72982585", "0.7288405", "0.7288405", "0.72480077", "0.72234225", "0.7146693", "0.7101386", "0.70441663", "0.69218653", "0.69218653", "0.68070775", "0.6788402", "0.6709456", "0.66864777", "0.66587", "0.65211...
0.7895342
0
Use callbacks to share common setup or constraints between actions.
def set_committees_district @committees_district = CommitteesDistrict.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def committees_district_params params.require(:committees_district).permit(:votes) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
GET /operating_systems GET /operating_systems.xml
def index @operating_systems = OperatingSystem.find(:all) respond_to do |format| format.html # index.html.erb format.xml { render :xml => @operating_systems } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @operating_system = OperatingSystem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @operating_system }\n end\n end", "def new\n @operating_system = OperatingSystem.new\n\n respond_to do |format|\n format.html # n...
[ "0.7129051", "0.61812294", "0.59341675", "0.5931678", "0.5880972", "0.5879139", "0.58486307", "0.57934415", "0.5724449", "0.57125133", "0.56956464", "0.5664769", "0.5664769", "0.564516", "0.56168604", "0.5594253", "0.5568731", "0.55546176", "0.55484647", "0.5509452", "0.55065...
0.7408988
0
GET /operating_systems/1 GET /operating_systems/1.xml
def show @operating_system = OperatingSystem.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @operating_system } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @operating_systems = OperatingSystem.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @operating_systems }\n end\n end", "def new\n @operating_system = OperatingSystem.new\n\n respond_to do |format|\n format.html # new....
[ "0.73860013", "0.64232904", "0.61740327", "0.609455", "0.6011001", "0.6011001", "0.5969509", "0.59550625", "0.5916186", "0.59045583", "0.58923", "0.5800359", "0.5793652", "0.57707494", "0.576986", "0.5764476", "0.5763525", "0.5761998", "0.57546014", "0.57327205", "0.5732513",...
0.7380893
1
GET /operating_systems/new GET /operating_systems/new.xml
def new @operating_system = OperatingSystem.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @operating_system } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @system }\n end\n end", "def create\n @operating_system = OperatingSystem.new(params[:operating_system])\n\n respond_to do |format|\n if @operating_system.save\n flash[...
[ "0.71510583", "0.7015758", "0.69381446", "0.6797597", "0.67579716", "0.6675998", "0.6675998", "0.6675998", "0.66498154", "0.66416365", "0.64920515", "0.64909685", "0.6375223", "0.6357001", "0.63560593", "0.6331095", "0.6319811", "0.62932855", "0.6291044", "0.62857974", "0.626...
0.77715
0
POST /operating_systems POST /operating_systems.xml
def create @operating_system = OperatingSystem.new(params[:operating_system]) respond_to do |format| if @operating_system.save flash[:notice] = 'OperatingSystem was successfully created.' format.html { redirect_to(@operating_system) } format.xml { render :xml => @operating_system...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def operating_system_params\n params.require(:operating_system).permit(:name)\n end", "def new\n @operating_system = OperatingSystem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @operating_system }\n end\n end", "def operating_system_par...
[ "0.6248745", "0.6151086", "0.6036177", "0.60025674", "0.5887162", "0.5866965", "0.5767906", "0.5729201", "0.5604373", "0.559588", "0.55095387", "0.5489837", "0.5481287", "0.54334193", "0.5429388", "0.54046804", "0.5400324", "0.537817", "0.5365232", "0.5364596", "0.5363217", ...
0.70990074
0
PUT /operating_systems/1 PUT /operating_systems/1.xml
def update @operating_system = OperatingSystem.find(params[:id]) respond_to do |format| if @operating_system.update_attributes(params[:operating_system]) flash[:notice] = 'OperatingSystem was successfully updated.' format.html { redirect_to(@operating_system) } format.xml { head ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_operating_system\n @operating_system = OperatingSystem.find(params[:id])\n end", "def set_operating_system\n @operating_system = OperatingSystem.find(params[:id])\n end", "def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n ...
[ "0.64752597", "0.6353205", "0.6261905", "0.6060206", "0.6029819", "0.6023304", "0.6014545", "0.5908809", "0.58200926", "0.5793191", "0.57510674", "0.57484096", "0.5698905", "0.56966144", "0.5684016", "0.56744194", "0.5652215", "0.55766916", "0.55751526", "0.55502826", "0.5539...
0.7029696
0
DELETE /operating_systems/1 DELETE /operating_systems/1.xml
def destroy @operating_system = OperatingSystem.find(params[:id]) @operating_system.destroy respond_to do |format| format.html { redirect_to(operating_systems_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n chef_server_rest.delete(\"nodes/#{name}\")\n end", "def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end", "def destroy\n @system.destroy\n respond_to do |format|\n format...
[ "0.65420985", "0.64905506", "0.64388424", "0.64153564", "0.6390158", "0.6375329", "0.6332834", "0.6327779", "0.6325992", "0.6298389", "0.6298389", "0.62529016", "0.62468445", "0.619498", "0.6150544", "0.6114768", "0.60716206", "0.6067162", "0.6062645", "0.6038981", "0.6028628...
0.74557185
0
GET /areas/1 GET /areas/1.json
def show @area = Area.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @area } #format.pdf { render :text => PDFKit.new( area_url(@area) ).to_pdf } #format.pdf do #html = area_url(@area) #@pdf = PDFKit.new(html, page_size: '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def areas\n @area = Area.new(geo_json: params.to_json)\n if @area.save\n json_response([id: @area.id], :created, :geo_json_recieved)\n else\n json_response(nil, :error, :db_error)\n end\n end", "def show\n @area = Area.find(params[:id])\n\n respond_to do |format|\n format.html #...
[ "0.7257378", "0.7246614", "0.7233719", "0.72223955", "0.71683943", "0.7099105", "0.7037471", "0.70100826", "0.69471836", "0.6852366", "0.6783057", "0.6762816", "0.67470545", "0.6666218", "0.66365665", "0.65919495", "0.65689945", "0.65426314", "0.65372306", "0.65372306", "0.65...
0.0
-1
GET /areas/new GET /areas/new.json
def new @area = Area.new respond_to do |format| format.html # new.html.erb format.json { render json: @area } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @area = Area.new\n @other_areas = Area.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @area }\n end\n end", "def new\n @area_type = AreaType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render ...
[ "0.8211101", "0.7715998", "0.75987095", "0.7385983", "0.73363537", "0.73301375", "0.72320074", "0.72320074", "0.72158444", "0.72158444", "0.72060525", "0.716951", "0.71321756", "0.71270025", "0.71167433", "0.70712095", "0.7063271", "0.7057671", "0.6963985", "0.69159186", "0.6...
0.8005892
1
POST /areas POST /areas.json
def create @area = Area.new(params[:area]) respond_to do |format| if @area.save format.html { redirect_to areas_path, notice: 'Area was successfully created.' } format.json { render json: @area, status: :created, location: @area } else format.html { render action: "new" } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def areas\n @area = Area.new(geo_json: params.to_json)\n if @area.save\n json_response([id: @area.id], :created, :geo_json_recieved)\n else\n json_response(nil, :error, :db_error)\n end\n end", "def create\n @area = Area.new(params[:area])\n\n respond_to do |format|\n if @area.s...
[ "0.7822764", "0.70543414", "0.70543414", "0.67330635", "0.6700156", "0.6628294", "0.66078615", "0.6589515", "0.6525069", "0.6361951", "0.63133705", "0.6311309", "0.62578034", "0.62578034", "0.624433", "0.6226551", "0.621831", "0.6216068", "0.62087953", "0.6205518", "0.6177835...
0.71488166
1
PUT /areas/1 PUT /areas/1.json
def update @area = Area.find(params[:id]) respond_to do |format| if @area.update_attributes(params[:area]) format.html { redirect_to @area, notice: 'Area was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.j...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\r\n @area = Area.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @area.update_attributes(params[:area])\r\n format.html { redirect_to areas_url(domain_id: @area.domain_id), notice: 'Area was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n ...
[ "0.6495229", "0.64698887", "0.6464209", "0.64014536", "0.64014536", "0.639423", "0.6319678", "0.63031846", "0.6292189", "0.62690103", "0.62296885", "0.61843765", "0.6157281", "0.6152307", "0.6151907", "0.6150895", "0.61459094", "0.6126075", "0.60751027", "0.60751027", "0.6066...
0.6895142
1
DELETE /areas/1 DELETE /areas/1.json
def destroy @area = Area.find(params[:id]) @area.destroy respond_to do |format| format.html { redirect_to areas_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @area = Area.find(params[:id])\n @area.destroy\n\n respond_to do |format|\n format.html { redirect_to(areas_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @area = Area.find(params[:id])\n @area.destroy\n\n respond_to do |format|\n format.html { r...
[ "0.7358223", "0.7358223", "0.7304793", "0.72348976", "0.7186475", "0.71424913", "0.71305966", "0.711875", "0.7115187", "0.70908946", "0.70902616", "0.7051532", "0.7045915", "0.7045915", "0.7010025", "0.7008359", "0.7006367", "0.6930255", "0.6893073", "0.6819426", "0.6802588",...
0.7575874
1
accepts the info hash from metainfo. prefix_dir is the directory (i.e. download directory, etc.) for torrent files and their directories.
def initialize(info, prefix_dir) @info_dictionary = info @files = Array.new @piece_files = Array.new @pieceLength = info["piece length"] @numBytes = 0 @totalPieces = info["pieces"].bytesize / 20 build_dir_path(prefix_dir) unless prefix_dir.chars.last == File::SEPARAT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def metainfo\n return @mii unless @mii.nil?\n if file_exists?\n File.open path, 'rb' do |file|\n stream = RubyTorrent::BStream.new file\n @mii = RubyTorrent::MetaInfo.from_bstream( stream ).info\n end\n elsif downloaded?\n StringIO.open download.payload, 'r'do |stream|\n ...
[ "0.565343", "0.53597546", "0.5260681", "0.5217774", "0.5173527", "0.51288646", "0.5045346", "0.49515086", "0.4947716", "0.49151957", "0.48691067", "0.48468316", "0.4836314", "0.4803813", "0.47852355", "0.4757819", "0.47509432", "0.47461793", "0.47234744", "0.47059777", "0.467...
0.5476121
1
will build the provided directory path, or do nothing if it exists already
def build_dir_path(dir_path) dir_builder = "" dir_path.split("/").each { |dir| unless Dir.exists?(dir_builder + dir) Dir.mkdir(dir_builder + dir) end dir_builder += dir + "/" } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_folder_if_needed path; Dir.mkdir(path) unless File.exists?(path) end", "def make_dir(path)\n FileUtils.mkdir_p( path )# unless File.exists?(path)\n end", "def create_dir(dirName)\r\n\tif !File.directory?(dirName)\r\n\t\tFileUtils.mkdir(dirName) #creates the /build directory\r\n\tend\r\nend", "...
[ "0.7523352", "0.74078155", "0.7363721", "0.7363721", "0.7132363", "0.709212", "0.7036454", "0.6952001", "0.6931142", "0.6841905", "0.67742324", "0.6771064", "0.6752997", "0.67329216", "0.67186767", "0.6705382", "0.6692561", "0.666724", "0.66667867", "0.66663116", "0.665809", ...
0.6741905
13
Only reset for the specific category
def reset_demos reset_demo demos_for_category.where( "record_index > 0 OR tic_record = 't' OR second_record = 't' OR undisputed_record = 't'" ).update_all( record_index: 0, tic_record: false, second_record: false, undisputed_record: false, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_category_quantities_and_reports\n\t\tself.categories.map {|cat|\n\t\t\tcat.quantity = 0\t\n\t\t\tcat.required_for_reports = []\n\t\t\tcat.optional_for_reports = []\n\t\t}\n\tend", "def test_reset_categories\n assert @work_opinion.categories_string = @new_cat_string\n assert @work_opinion.reload\n...
[ "0.6770463", "0.65342414", "0.6355709", "0.6355709", "0.6335724", "0.6327855", "0.6309225", "0.6296598", "0.62586176", "0.62296116", "0.62296116", "0.6207688", "0.6207688", "0.6207688", "0.6207688", "0.619321", "0.619321", "0.619321", "0.619321", "0.619321", "0.619321", "0....
0.60293084
54
def logout_user session[:user_num] = nil end def find_current_user
def add_event_info(assign,action,object) @event = Event.new @event.assignment = assign if current_user != nil @event.operator = current_user.id end @event.action = action @event.object = object.id @event.save end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_out\n session.delete(:user_id)\n @current_user=nil\n end", "def logout\n @current_user = session[:user_id] = nil\n end", "def log_out\n\t \tsession.delete(:user_id)\n\t \t@current_user =nil\n\t end", "def log_out\n\t\tsession[:user_id] = nil\n\tend", "def log_out\n session.delete(:use...
[ "0.83251", "0.8304485", "0.8260212", "0.8251699", "0.8239719", "0.8216462", "0.8197199", "0.8194434", "0.818404", "0.8182639", "0.8160778", "0.8143699", "0.81412154", "0.81390643", "0.8110805", "0.8110805", "0.8110805", "0.8110805", "0.8110578", "0.8076418", "0.8076347", "0...
0.0
-1
Integrating AritcleSerailizer in our project see article '
def serializer ArticleSerializer end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def annotator; end", "def make_articles\n EndangeredSpecies::Scraper.new.make_articles\n end", "def interpret(i)\n article = Article.new\n article.title = !i.title.nil? ? i.title : 'n/a'\n article.source = @source\n article.pub_date = !i.pubDate.nil? ? i.pubDate : nil\n\n name = !i.source.ni...
[ "0.5621827", "0.5601048", "0.55779165", "0.54550713", "0.54334974", "0.54106706", "0.53752446", "0.53720343", "0.5354334", "0.53268397", "0.52851146", "0.52646756", "0.52646756", "0.5257381", "0.5255731", "0.5248354", "0.52352667", "0.5228935", "0.52099174", "0.52054965", "0....
0.0
-1
GET /anexo_relatorios_colaborador GET /anexo_relatorios_colaborador.json
def index @anexo_relatorios_colaborador = AnexoRelatorioColaborador.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @relatorios_colaborador = RelatorioColaborador.all\n end", "def index\n @colaboradors = Colaborador.all\n end", "def index\n @laboratorios = Laboratorio.all\n end", "def index\n @colaboradors = current_user.empresa.colaboradors.all\n end", "def index\n @comprobantes = Comprob...
[ "0.74335474", "0.6869329", "0.68087447", "0.6712738", "0.6537442", "0.6515938", "0.6497021", "0.64455277", "0.64090854", "0.6390322", "0.6358468", "0.63484395", "0.6341834", "0.63298583", "0.63207203", "0.63119346", "0.6303317", "0.6289614", "0.6289144", "0.6252671", "0.62522...
0.7303694
1
GET /anexo_relatorios_colaborador/1 GET /anexo_relatorios_colaborador/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @relatorios_colaborador = RelatorioColaborador.all\n end", "def index\n @anexo_relatorios_colaborador = AnexoRelatorioColaborador.all\n end", "def index\n @laboratorios = Laboratorio.all\n end", "def index\n @colaboradors = Colaborador.all\n end", "def index\n @comprobantes =...
[ "0.7151641", "0.696157", "0.66832787", "0.6524917", "0.64683867", "0.645301", "0.64257115", "0.64157563", "0.6404782", "0.6371045", "0.6301429", "0.6299716", "0.6275215", "0.6266612", "0.6263289", "0.6239406", "0.62053907", "0.6202149", "0.6201945", "0.6175673", "0.61678535",...
0.0
-1
POST /anexo_relatorios_colaborador POST /anexo_relatorios_colaborador.json
def create @anexo_relatorio_colaborador = AnexoRelatorioColaborador.new(anexo_relatorio_colaborador_params) respond_to do |format| if @anexo_relatorio_colaborador.save format.html { redirect_to @anexo_relatorio_colaborador, notice: 'Anexo relatorio colaborador was successfully created.' } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @relatorio_colaborador = RelatorioColaborador.new(relatorio_colaborador_params)\n\n respond_to do |format|\n if @relatorio_colaborador.save\n format.html { redirect_to @relatorio_colaborador, notice: 'Relatorio colaborador was successfully created.' }\n format.json { render :s...
[ "0.7430114", "0.73960066", "0.73492146", "0.7219299", "0.70867604", "0.70574284", "0.6990959", "0.69741505", "0.6859094", "0.68577474", "0.68052036", "0.6792925", "0.6769665", "0.676911", "0.67673934", "0.67533034", "0.6694062", "0.6693825", "0.6671718", "0.6613863", "0.65775...
0.7542018
0
PATCH/PUT /anexo_relatorios_colaborador/1 PATCH/PUT /anexo_relatorios_colaborador/1.json
def update respond_to do |format| if @anexo_relatorio_colaborador.update(anexo_relatorio_colaborador_params) format.html { redirect_to @anexo_relatorio_colaborador, notice: 'Anexo relatorio colaborador was successfully updated.' } format.json { render :show, status: :ok, location: @anexo_relat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @relatorio_colaborador.update(relatorio_colaborador_params)\n format.html { redirect_to @relatorio_colaborador, notice: 'Relatorio colaborador was successfully updated.' }\n format.json { render :show, status: :ok, location: @relatorio_colaborador }\n ...
[ "0.69264317", "0.6916227", "0.6752675", "0.6730173", "0.669817", "0.66641974", "0.6637073", "0.6565741", "0.6531829", "0.647755", "0.6448292", "0.64303344", "0.64223045", "0.64112866", "0.6369155", "0.62701124", "0.6234952", "0.62315834", "0.6213905", "0.6205706", "0.62011325...
0.6954788
0
DELETE /anexo_relatorios_colaborador/1 DELETE /anexo_relatorios_colaborador/1.json
def destroy @anexo_relatorio_colaborador.destroy respond_to do |format| format.html { redirect_to anexo_relatorios_colaborador_url, notice: 'Anexo relatorio colaborador was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n \n @laboratorio.destroy\n respond_to do |format|\n msg = { :status => \"ok\", :message => \"Eliminado!\" }\n format.json { render :json => msg }\n end\n end", "def destroy\n @colaborador.destroy\n respond_to do |format|\n format.html { redirect_to colaboradors_url...
[ "0.74482346", "0.7436348", "0.74083674", "0.71659946", "0.71659946", "0.71633893", "0.71578664", "0.71502244", "0.7134064", "0.70597935", "0.7025444", "0.70136005", "0.6998987", "0.6970663", "0.6969654", "0.69613975", "0.6952416", "0.69421846", "0.6941203", "0.6938774", "0.69...
0.75331146
0
Use callbacks to share common setup or constraints between actions.
def set_anexo_relatorio_colaborador @anexo_relatorio_colaborador = AnexoRelatorioColaborador.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def anexo_relatorio_colaborador_params params.require(:anexo_relatorio_colaborador).permit(:path, :relatorio_colaborador_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.6981269", "0.6783559", "0.6746007", "0.67423046", "0.6735905", "0.6593568", "0.6504213", "0.649792", "0.6482664", "0.6478558", "0.64566684", "0.64392304", "0.6380194", "0.6376366", "0.636562", "0.63208145", "0.63006365", "0.63001287", "0.6292953", "0.62927175", "0.62911004...
0.0
-1
grab google to access google for user data
def google_token x = self.authentications.find_by(provider: 'google_oauth2') return x.token unless x.nil? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_details_from_google_oauth2\n\t\t# To Do\n\t\tself.user.has_google = true\n\t\tself.user.save\n\tend", "def import_profile_from_google\n # forthcoming\n end", "def auth_google\n @attributes[:auth_google]\n end", "def get_user_info()\n return_map = nil\n if session[:google_unique] !=...
[ "0.70599234", "0.68542886", "0.6695554", "0.65548927", "0.6415024", "0.62403667", "0.6227571", "0.6159301", "0.61578625", "0.6132184", "0.61205184", "0.60578567", "0.60172325", "0.60172325", "0.60036004", "0.5971567", "0.5946125", "0.59445536", "0.59415406", "0.5934195", "0.5...
0.5469474
70
helpers: given a form input name returns the right POST data you still need your boundaries before this
def upload_form(key,content) return "Content-Disposition: form-data; name=\"#{CGI::escape(key)}\"\r\n" + "\r\n" + "#{content}\r\n" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def form_data?; end", "def param_posted?(sym)\n request.post? and params[sym]\n end", "def process_form(formdata: {}, wunderbar: {})\n statement = formdata['statement']\n\n _h3 'Copy of statement to put in an email (if necessary)'\n _pre statement\n\n _hr\n\n _h3 'Transcript of update to nomination file'...
[ "0.6084489", "0.58398515", "0.5791605", "0.5721115", "0.5697405", "0.5691681", "0.5659157", "0.5643381", "0.5643381", "0.5643381", "0.5643381", "0.5636438", "0.5579523", "0.55471534", "0.5515281", "0.5456323", "0.5456323", "0.5456323", "0.5456323", "0.5435946", "0.53717434", ...
0.0
-1
given a form file input name returns the right POST data you still need your boundaries before this
def file_to_multipart(key,filename,mime_type,content) return "Content-Disposition: form-data; name=\"#{CGI::escape(key)}\"; filename=\"#{File.basename(filename)}\"\r\n" + "Content-Transfer-Encoding: binary\r\n" + "Content-Type: #{mime_type}\r\n" + "\r\n" + "#{content}\r\n" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_web_form_request\n if !params[:file].blank?\n return [params[:file], 'file']\n elsif !params[:freetext].blank?\n return [params[:freetext], 'text']\n elsif !params[:url].blank?\n return [params[:url], 'url']\n elsif !params[:example_url].blank?\n return [params[:example_url], 'url']\n en...
[ "0.62293637", "0.5846043", "0.5833105", "0.57775414", "0.5748283", "0.56719947", "0.56638366", "0.56235737", "0.5611074", "0.5600049", "0.5600049", "0.55704004", "0.5511404", "0.5508407", "0.5502854", "0.54926044", "0.54856753", "0.5472426", "0.5451905", "0.54462945", "0.5444...
0.5204256
46
a restaurant has a name, a list of cuisines, an address, and a phone number
def initialize(restaurant_hash) @name = restaurant_hash[:name] @phone_number = restaurant_hash[:phone_number] @cuisine = restaurant_hash[:cuisine] @address = restaurant_hash[:address] @@all << self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_restaurant(address, cuisines, budget_low)\n # Get a list of all restaurants that deliver to this address from the API\n @all_restaurants = @api.delivery_list(address)\n\n # Filter down to the valid restaurants for this purpose\n @valid_restaurants = get_valid_restaurants(@all_restaurants, cuis...
[ "0.69927853", "0.69927853", "0.66188586", "0.6510852", "0.6386528", "0.6381883", "0.6371748", "0.63354266", "0.6320075", "0.63185614", "0.63177836", "0.6313368", "0.6261515", "0.6226841", "0.6196191", "0.613923", "0.61308223", "0.61306417", "0.6091269", "0.60828876", "0.60610...
0.6400138
4
before_filter :load_calendar GET /rewards GET /rewards.xml
def index @calendar = Calendar.first(:conditions => {:fam_id => @user.fam_id}) @rewards = @calendar.rewards respond_to do |format| format.html # index.html.erb format.xml { render :xml => @rewards } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n #@calendar = Calendar.find(params[:calendar_id])\n #@reward = @calendar.rewards.find(params[:id])\n\t\t#@rewards = Reward.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @reward }\n end\n end", "def show\n respond_to do |format|\n ...
[ "0.7174135", "0.59588623", "0.5859926", "0.58457494", "0.5819464", "0.5775837", "0.56985193", "0.55708927", "0.5565929", "0.55454373", "0.55206406", "0.54755855", "0.5472419", "0.5453126", "0.54428995", "0.54428995", "0.5437707", "0.54308456", "0.54258007", "0.5409516", "0.54...
0.69727826
1
GET /rewards/1 GET /rewards/1.xml
def show #@calendar = Calendar.find(params[:calendar_id]) #@reward = @calendar.rewards.find(params[:id]) #@rewards = Reward.all respond_to do |format| format.html # show.html.erb format.xml { render :xml => @reward } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n\t\t@calendar = Calendar.first(:conditions => {:fam_id => @user.fam_id})\n\t\t@rewards = @calendar.rewards\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @rewards }\n end\n end", "def index\n @api_v1_rewards = Api::V1::Reward.all\n end", ...
[ "0.68748325", "0.6705942", "0.66112256", "0.653504", "0.65348685", "0.6175462", "0.6114455", "0.5947075", "0.5903752", "0.584691", "0.58368516", "0.57717776", "0.57669693", "0.575779", "0.5713138", "0.567792", "0.5645299", "0.56019485", "0.5596408", "0.5585045", "0.5585045", ...
0.6622643
2
GET /rewards/new GET /rewards/new.xml
def new @reward = Reward.new points = {1 => 1, 2 => 2, 3 => 3, 5 => 5, 10 => 10, 15 => 15, 20 => 20,30 => 30, 60 => 60} @points = points.sort respond_to do |format| format.html # new.html.erb format.xml { render :xml => @reward } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @reward_profile = RewardProfile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reward_profile }\n end\n end", "def new\n @balance = Balance.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render...
[ "0.72358006", "0.67454684", "0.67091", "0.67047584", "0.66971964", "0.66939676", "0.66924", "0.66823214", "0.666646", "0.666646", "0.666585", "0.6647835", "0.6641791", "0.6640495", "0.6629811", "0.6624588", "0.6615251", "0.6594008", "0.6591354", "0.6590044", "0.6587619", "0...
0.67165023
2
POST /rewards POST /rewards.xml
def create @calendar = Calendar.find(params[:calendar_id]) @reward = @calendar.rewards.build(params[:reward]) respond_to do |format| if @reward.save flash[:notice] = 'Reward was successfully created.' format.html { redirect_to calendar_configurations_path(params[:calendar_id]) } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rewards_data\r\n BnetApi.make_request('/sc2/data/rewards')\r\n end", "def post_save xml, options={:mapping=>:_default}\n xml.root.add_attributes(\"xmlns\"=>\"http://schema.intuit.com/platform/fdatafeed/rewardsaccount/v1\")\n end", "def send_reward_request(address, promo, rewards_token)\n ...
[ "0.6389064", "0.6380745", "0.60853875", "0.60848683", "0.59093666", "0.5905638", "0.5740837", "0.56122375", "0.55959564", "0.5537588", "0.55130476", "0.54980034", "0.54914427", "0.5456052", "0.5454542", "0.5451461", "0.5429088", "0.5406201", "0.5391478", "0.53677136", "0.5338...
0.5818668
6
PUT /rewards/1 PUT /rewards/1.xml
def update @reward = Reward.find(params[:id]) respond_to do |format| if @reward.update_attributes(params[:reward]) flash[:notice] = 'Reward was successfully updated.' format.html { redirect_to calendar_configurations_path(params[:calendar_id]) } format.xml { head :ok } else...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end", "def update\n respond_to do |format|\n if @api_v1_reward.update(api_v1_reward_params)\n format.html { redirect_to @api_v1_reward, notice: 'Reward was successfully up...
[ "0.626324", "0.6088807", "0.5915982", "0.5883383", "0.5832474", "0.57883805", "0.5782859", "0.5778455", "0.5739232", "0.5701365", "0.56997865", "0.56784844", "0.5600901", "0.5600901", "0.5600901", "0.55465025", "0.55452824", "0.5505076", "0.5502705", "0.54882145", "0.5486272"...
0.6283514
0
DELETE /rewards/1 DELETE /rewards/1.xml
def destroy @reward = Reward.find(params[:id]) @reward.destroy respond_to do |format| format.html {redirect_to calendar_configurations_path(params[:calendar_id])} format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @award = Award.find(params[:id])\n @award.destroy\n\n respond_to do |format|\n format.html { redirect_to(awards_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @reward_profile = RewardProfile.find(params[:id])\n @reward_profile.destroy\n\n respond_to d...
[ "0.6561601", "0.65306276", "0.6523279", "0.6508404", "0.6430886", "0.643012", "0.6412977", "0.6397496", "0.6332496", "0.63255435", "0.62789005", "0.6237942", "0.6234709", "0.62235874", "0.6220713", "0.62184906", "0.6213438", "0.6211045", "0.62072414", "0.62070984", "0.6204619...
0.64590955
4
Starts up whenever the class is being called
def initialize(app_id, app_secret) @app_id = app_id @app_secret = app_secret end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start\n\t\tinit\n\t end", "def on_start(_klass, _method); end", "def startup\n end", "def startup\n end", "def startup\n end", "def startup\n end", "def start()\n\n\t\tend", "def start\n super\n end", "def start\n super\n end", "def start\n super\n ...
[ "0.7687939", "0.76685274", "0.7531607", "0.7531607", "0.7531607", "0.7517727", "0.7506383", "0.74900603", "0.74900603", "0.74900603", "0.74900603", "0.74900603", "0.7484389", "0.7484389", "0.7484389", "0.7484389", "0.7484389", "0.7484389", "0.7484389", "0.7484389", "0.7463054...
0.0
-1
Sends reward details to the given address
def send_reward_request(address, promo, rewards_token) # set the request url url = AMAX_URL # set the payload payload = { "outboundRewardRequest" => { "app_id" => @app_id, "app_secret" => @app_secret, "rewards_token" => rewards_token, "address" => a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def call(user, email, reward, shipping_address)\n @user = user\n @reward = reward\n # admin = \"astropowerbox@gmail.com\"\n admin = \"news.article.sysetm@gmail.com\"\n @shipping_address = shipping_address\n mail to: email, subject: 'Redemption details'\n end", "def ship_reward_now\n\t\t@reward...
[ "0.6388741", "0.638359", "0.6096406", "0.6027947", "0.59212494", "0.58505744", "0.5842091", "0.5838925", "0.5809055", "0.57856613", "0.57856613", "0.57856613", "0.57753736", "0.5741961", "0.5663194", "0.5611985", "0.5560379", "0.55099064", "0.5499513", "0.54711515", "0.545174...
0.745521
0
Returns every available AWS region code. => ["useast1", "uswest1", "uswest2", "apnortheast1", "apsoutheast1", "apsoutheast2", "saeast1", "euwest1", "cnnorth1"]
def regions AWS.regions.map(&:name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_region(default: [])\n return default unless params[:region]\n icao_starts = params[:region].split(/[\\-,]/)\n icao_starts.compact!\n icao_starts.uniq!\n icao_starts.map!{|s| s.upcase.tr(\"^A-Z\",\"\")}\n return icao_starts\n end", "def describe_regions(list=[])\n link = genera...
[ "0.7091739", "0.69744736", "0.6941279", "0.68828624", "0.68508303", "0.66824836", "0.6580827", "0.65608966", "0.65333754", "0.642302", "0.6412156", "0.63586795", "0.63225377", "0.62870044", "0.6265483", "0.62187886", "0.6206282", "0.61769545", "0.61562544", "0.61469287", "0.6...
0.80237633
0
Reports completion for an external task with output variable set in bpmn_perform.
def report_completion(id, variables) # Submit to Camunda using # POST /external-task/{id}/complete Camunda::ExternalTask.new(id: id).complete(variables) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def external_task\n output[:task]\n end", "def communicate_complete\n File.open(\"#{@options[:output_directory]}/finished.job\", 'w') { |f| f << \"Finished Workflow #{::Time.now} #{@options}\" }\n raise 'Missing required options' unless @options[:url] && @options[:datapoint_id] && @options[:project...
[ "0.67334294", "0.61056346", "0.5831834", "0.56680024", "0.5647997", "0.56146395", "0.5520976", "0.55004394", "0.5479265", "0.5478641", "0.5456231", "0.54524213", "0.54287994", "0.54102814", "0.54035264", "0.5350569", "0.5336016", "0.5324188", "0.53237736", "0.5293084", "0.528...
0.6297856
1
Reports external task failure to the Camunda process definition and creates an incident report
def report_failure(id, exception, input_variables) # Submit error state to Camunda using # POST /external-task/{id}/failure Camunda::ExternalTask.new(id: id).failure(exception, input_variables) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def report_failure(e)\n # We can use the activity_execution_context method which is available to all\n # classes that extend AWS::Flow::Activities to get the workflow_execution.\n runid = activity_execution_context.workflow_execution.run_id\n puts \"Run Id:#{runid}\"\n puts \"Failure in periodic tas...
[ "0.6854952", "0.6481969", "0.6481969", "0.6417628", "0.6398237", "0.59907246", "0.5813625", "0.57624257", "0.57339513", "0.5705438", "0.56463444", "0.55940384", "0.5586309", "0.55537075", "0.5541029", "0.5533398", "0.55320233", "0.55033904", "0.5498575", "0.5498575", "0.54904...
0.7904878
0
Default bpmn_perform which raises an error. Forces user to create their own implementation
def bpmn_perform(_variables) raise StandardError, "Please define this method which takes a hash of variables and returns a hash of variables" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perform\n raise Errors::AbstractMethod\n end", "def perform\n raise \"Missing implementation for #{self.class.name}#perform\"\n end", "def handle_perform_error(_e); end", "def do_workflow(message)\n raise \"Derived jobs must override do_workflow!\"\n end", "def do_execute\n ra...
[ "0.65242475", "0.651842", "0.6257025", "0.6242968", "0.6223613", "0.6214983", "0.6203808", "0.62024033", "0.62024033", "0.6156135", "0.61329746", "0.61186713", "0.6065357", "0.6062238", "0.605809", "0.60356987", "0.6017846", "0.60158134", "0.601481", "0.5929242", "0.59285146"...
0.0
-1
Use it in your layout Example: pupu :autocompleter, type: "local"
def pupu(name, params = Hash.new) comment = if params.empty? then "<!-- Pupu #{name} without params -->" else "<!-- Pupu #{name} with params #{params.inspect} -->" end [comment, pupu_page.parse(name, params).parse!, "", ""].join("\n") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def autocomplete; end", "def auto_complete_for_user_name\n @users = session[:user].get_available_users(params[:user][:name])\n render inline: \"<%= auto_complete_result @users, 'name' %>\", layout: false\n end", "def auto_complete\n @query = params[:auto_complete_query]\n @auto_complete = self.con...
[ "0.6996566", "0.6598908", "0.6422106", "0.6317095", "0.6216996", "0.6203134", "0.608376", "0.60434353", "0.60064137", "0.5997169", "0.59867024", "0.5975253", "0.5959209", "0.59428436", "0.5907082", "0.5902433", "0.58929306", "0.5808617", "0.5804173", "0.57080394", "0.5689811"...
0.0
-1
id = user_id (target's user_id)
def request_bang user_id = params[:id] raise Bang::Error::InvalidUserBang if UserBang.conbination(user_id, current_user.id).present? raise Bang::Error::InvalidUserBang if UserBang.conbination(current_user.id, user_id).present? UserBang.create!( user_id: user_id, from_user_id: current_user.i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_target\n target = User.where(:email => email).first\n self.target_id = target.id if target\n end", "def other_user(user_id)\n if user_1_id == user_id\n user_2_id\n else\n user_1_id\n end\n end", "def set_user_id\n User.stats.limit(2).each do |user|\n self.user_id = u...
[ "0.6849116", "0.67744404", "0.6761082", "0.6715883", "0.66155124", "0.65818137", "0.6547626", "0.653337", "0.6471117", "0.6368171", "0.6326065", "0.63114816", "0.6266215", "0.61984867", "0.6197187", "0.61899376", "0.6154089", "0.6154089", "0.6154089", "0.6106989", "0.6076595"...
0.0
-1
id = user_bang_id status = accept or deny
def reply_bang user_bang = UserBang.find_by(id: params[:id]) raise Bang::Error::InvalidUserBang\ if !user_bang.present?\ || user_bang.user_id != current_user.id\ || user_bang.has_replied? user_bang.status = UserBang.status_from_string(params[:status]) if user_bang.accept? create...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ban_user\n # Find user in the DB\n @user = User.find(params[:user])\n\n # Change the user's \"banned\" status\n @user.update_attribute('banned',params[:ban])\n\n respond_to do |format|\n # Case 1: User is banned \n if(params[:ban] == 'true')\n format.html { redirect_to banned_users_...
[ "0.6364847", "0.6292449", "0.617218", "0.61245674", "0.61191636", "0.6066075", "0.59918654", "0.59818166", "0.5913549", "0.5826169", "0.58086216", "0.5763126", "0.57349956", "0.57261014", "0.5722784", "0.5721481", "0.57165164", "0.5711459", "0.5703227", "0.56870455", "0.56729...
0.62091523
2
GET /organization_accounts GET /organization_accounts.json
def index @organization_accounts = OrganizationAccount.all.sort_by(&:organization_name).reverse if user_signed_in? && current_user.admin? respond_to do |format| format.html # index.html.erb format.json { render json: @organization_accounts } end else redirect_to root_p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def account_organization\n get('account/organization')\n end", "def organization\n _get(\"/account/organization\") { |json| json }\n end", "def accounts\n get('/accounts')['accounts']\n end", "def get_accounts()\n http_get(accounts_url)\n end", "def get_account\n as_j...
[ "0.841162", "0.8085151", "0.7541675", "0.7473557", "0.69683695", "0.6934686", "0.6932232", "0.6922255", "0.6860478", "0.68049186", "0.67749655", "0.6768336", "0.6768336", "0.6768336", "0.6768336", "0.6768336", "0.6768336", "0.6768336", "0.6768336", "0.6768336", "0.67549634", ...
0.7382236
4
GET /organization_accounts/1 GET /organization_accounts/1.json
def profile if organization_account_signed_in? @organization_account = current_organization_account @organization = Organization.find(@organization_account.organization_id) @overall = 0 @reviews = Review.where(:organization_id => @organization.id) if !(@reviews.count == 0) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def account_organization\n get('account/organization')\n end", "def organization\n _get(\"/account/organization\") { |json| json }\n end", "def index\n @organization_accounts = OrganizationAccount.all.sort_by(&:organization_name).reverse\n \n if user_signed_in? && current_user.admi...
[ "0.81476164", "0.78968966", "0.7152632", "0.7138171", "0.70710754", "0.6978809", "0.692052", "0.68174946", "0.6809205", "0.67787254", "0.6772418", "0.6772418", "0.67274857", "0.67109543", "0.6708351", "0.6706576", "0.6700024", "0.6622247", "0.6622247", "0.6602774", "0.6576658...
0.0
-1
GET /organization_accounts/new GET /organization_accounts/new.json
def new @organization_account = OrganizationAccount.new respond_to do |format| format.html # new.html.erb format.json { render json: @organization_account } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @organization = Organization.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @organization }\n end\n end", "def new\n @organization = Organization.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { ren...
[ "0.76284975", "0.76284975", "0.7363745", "0.731328", "0.72761506", "0.7234839", "0.7234839", "0.7234839", "0.7234839", "0.7234839", "0.7231391", "0.7196003", "0.7195772", "0.7190879", "0.713024", "0.7120045", "0.71183336", "0.71183336", "0.71183336", "0.71183336", "0.71183336...
0.8048271
0
PUT /organization_accounts/1 PUT /organization_accounts/1.json
def update @organization_account = OrganizationAccount.find(params[:id]) respond_to do |format| if @organization_account.update_attributes(params[:organization_account]) format.html { redirect_to @organization_account, notice: 'Organization account was successfully updated.' } format.json...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def UpdateOrganization params = {}\n \n APICall(path: 'organizations.json',method: 'PUT',payload: params.to_json)\n \n end", "def update\n @organization.update(organization_params)\n if @organization.save\n render json: { success: \"organization updated successfully\"}, statu...
[ "0.7297335", "0.6965225", "0.68743736", "0.6851401", "0.6848866", "0.68436915", "0.68123716", "0.6769438", "0.6767613", "0.6736271", "0.6600473", "0.65349066", "0.65349066", "0.65349066", "0.65349066", "0.65349066", "0.65349066", "0.65349066", "0.65293103", "0.65212667", "0.6...
0.72213817
1
DELETE /organization_accounts/1 DELETE /organization_accounts/1.json
def destroy @organization_account = OrganizationAccount.find(params[:id]) @organization_account.destroy respond_to do |format| format.html { redirect_to organization_accounts_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def DeleteOrganization id\n \n APICall(path: \"organizations/#{id}.json\",method: 'DELETE')\n \n end", "def destroy\n @organization.destroy\n render json: { success: \"Organization deleted successfully\" }, status: :ok\n end", "def destroy\n @organization = Organization.find...
[ "0.7571764", "0.73697597", "0.7335031", "0.7330942", "0.7330942", "0.7269745", "0.7263497", "0.7263497", "0.7263497", "0.7217885", "0.7217697", "0.71468455", "0.71413505", "0.71201324", "0.70996696", "0.7092745", "0.70760566", "0.7066031", "0.7063345", "0.70606476", "0.704699...
0.77695674
0
Only allow a trusted parameter "white list" through.
def tr_program_params params.require(:tr_program).permit(:name, :active_status, :sort) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", ...
[ "0.7121987", "0.70541996", "0.69483954", "0.6902367", "0.6733912", "0.6717838", "0.6687021", "0.6676254", "0.66612333", "0.6555296", "0.6527056", "0.6456324", "0.6450841", "0.6450127", "0.6447226", "0.6434961", "0.64121825", "0.64121825", "0.63913447", "0.63804525", "0.638045...
0.0
-1
GET /related_products/1 GET /related_products/1.json
def show @related_product = RelatedProduct.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @related_product } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n cat = @producto.categorias.first.id\n @related_products = @producto.get_related_products(cat)\n\n end", "def get_related(**params)\n related = get(\"/related/#{id}.json\", params).body[1]\n client.object_from_body(related)\n end", "def show\n @product = @person.products....
[ "0.70721334", "0.6896217", "0.68807954", "0.68043154", "0.6724241", "0.67125684", "0.6712303", "0.65624714", "0.6484363", "0.6474168", "0.64192873", "0.6410199", "0.6402448", "0.63892347", "0.6356062", "0.6336179", "0.6278342", "0.62744063", "0.62741727", "0.6263432", "0.6255...
0.76914614
0
GET /related_products/new GET /related_products/new.json
def new @related_product = RelatedProduct.new respond_to do |format| format.html # new.html.erb format.json { render json: @related_product } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @related_product = RelatedProduct.new(params[:related_product])\n\n respond_to do |format|\n if @related_product.save\n format.html { redirect_to @related_product, notice: 'Related product was successfully created.' }\n format.json { render json: @related_product, status: :cre...
[ "0.7487122", "0.71737796", "0.7106494", "0.70612055", "0.7046051", "0.70450413", "0.70450413", "0.70450413", "0.70450413", "0.70450413", "0.70450413", "0.70450413", "0.70450413", "0.70450413", "0.70450413", "0.70450413", "0.70450413", "0.70450413", "0.70450413", "0.70450413", ...
0.82435143
0
POST /related_products POST /related_products.json
def create @related_product = RelatedProduct.new(params[:related_product]) respond_to do |format| if @related_product.save format.html { redirect_to @related_product, notice: 'Related product was successfully created.' } format.json { render json: @related_product, status: :created, locat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @product = @productable.products.find(params[:product_id])\n ids = params[:products]\n reals = @productable.products.map(&:id) # Make a lambda with this\n present_prod = ids.select { |n| reals.include?(n) } # And this\n if @product.update(product_relations: present_prod)\n ...
[ "0.71131164", "0.68835706", "0.66714436", "0.66594017", "0.6578552", "0.6376841", "0.633181", "0.6275784", "0.62716836", "0.6265232", "0.62508845", "0.62134767", "0.61462694", "0.6141898", "0.61280185", "0.61265284", "0.6125172", "0.6123409", "0.6123037", "0.61223185", "0.612...
0.73633283
0
PUT /related_products/1 PUT /related_products/1.json
def update @related_product = RelatedProduct.find(params[:id]) respond_to do |format| if @related_product.update_attributes(params[:related_product]) format.html { redirect_to @related_product, notice: 'Related product was successfully updated.' } format.json { head :no_content } el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @product = Product.eager_loading.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to shop_products_path(@product.shop.uuid), notice: 'Product was successfully updated.' }\n format.json { render json: @produ...
[ "0.6760427", "0.6715912", "0.6595462", "0.6562341", "0.64990085", "0.64929956", "0.63289905", "0.62971944", "0.62706435", "0.62650716", "0.6242197", "0.6221696", "0.6190681", "0.6179813", "0.6158567", "0.61481196", "0.61122656", "0.60957", "0.60798097", "0.6065847", "0.605498...
0.7215956
0
DELETE /related_products/1 DELETE /related_products/1.json
def destroy @related_product = RelatedProduct.find(params[:id]) @related_product.destroy respond_to do |format| format.html { redirect_to related_products_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @products_purposes_relation.destroy\n respond_to do |format|\n format.html { redirect_to products_purposes_relations_url, notice: t('destroy_success') }\n format.json { head :no_content }\n end\n end", "def destroy\n @product = @person.products.find(params[:id])\n @product...
[ "0.7511947", "0.7379619", "0.72875106", "0.7272964", "0.7268691", "0.7215665", "0.7214315", "0.7114546", "0.7107601", "0.7101456", "0.7004543", "0.6995274", "0.6977128", "0.6969845", "0.6956726", "0.695149", "0.6941992", "0.69363564", "0.69363564", "0.69177556", "0.69155717",...
0.790024
0
used by blacklight_alma returns an array of IDs to query through API to get holdings for this document. This is usually just the alma MMS ID for this bib record, but in the case of boundwith records, we return the boundwith IDs, because that's where Alma stores the holdings.
def alma_availability_mms_ids fetch("bound_with_ids", [id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def alma_availability_mms_ids\n fetch('bound_with_ids', [id])\n end", "def holdings\n self.response = self.class.get(\"#{record_url}/holdings?view=full\")\n raise_error_if(\"Error getting holdings from Aleph REST APIs.\") {\n (response.parsed_response[\"get_hol_list\"].nil? or response...
[ "0.6449064", "0.62573844", "0.6255492", "0.59580123", "0.58861834", "0.5804082", "0.5717034", "0.5645991", "0.56068784", "0.54737175", "0.5448434", "0.54212624", "0.5364017", "0.5343255", "0.5290324", "0.52844685", "0.5276829", "0.5263108", "0.5254995", "0.52193135", "0.51880...
0.64838815
1
Avoid CSRF clean up for token authentication as it might trigger session creation in API environments even if CSRF prevention is not being used. Devise provides a `clean_up_csrf_token_on_authentication` option but it's not always viable in applications with multiple user models and authentication strategies.
def clean_up_csrf? false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_up_csrf?; end", "def clean_up_csrf?; end", "def disable_request_forgery_protection; end", "def clean_up_csrf?\n true\n end", "def clean_up_csrf?\n true\n end", "def auth_csrf_token\n request.env['HTTP_X_AUTH_CSRF']\n end", "def destroy\n signed_out_user = curren...
[ "0.6995407", "0.6995407", "0.66669667", "0.6633042", "0.6633042", "0.65991163", "0.652923", "0.65184224", "0.6485193", "0.64818704", "0.6395307", "0.63911974", "0.636587", "0.63579744", "0.6294511", "0.62639916", "0.62504464", "0.6247391", "0.6240694", "0.6211823", "0.6169523...
0.6548728
6
NOTE: an input of 24:00 gets converted to 20000102 00:00:00
def server_duration # TODO: MAJOR HACK! # The db can't store the year,month, day information # So when we try to store 24:00 hours it gets saved a 2000-01-01 00:00:00 # Therefore, we use the 'seconds' field to record that we rolled over # Then, when we convert back from server format to client forma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_to_usable_time(xanga_time)\n arr = xanga_time.split(\" \")\n ret = arr[0]\n ret.insert(0,\"0\") if arr[0].length == 4 #pad left-most zero\n \n if arr[1] == \"PM\" #add 12 to it\n str = ret.slice(0,2)\n 0.upto(11){ str.succ! } \n ret[0,2] = s...
[ "0.68806326", "0.6660221", "0.65796155", "0.6474295", "0.64505476", "0.6442261", "0.6439763", "0.63284576", "0.63038903", "0.6281083", "0.62548995", "0.6226508", "0.6210138", "0.6200697", "0.6191734", "0.6183688", "0.6175254", "0.6160798", "0.6156148", "0.61465454", "0.613769...
0.0
-1
Function to create the client time format string. Ensure two places for hour and minutes 01:01
def make_client_format(hr,min) hr = 0 if hr == nil min = 0 if min == nil format('%02d', hr.to_i).to_s + ':' + format('%02d',min.to_i).to_s end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_s\n \"#{hour.to_s.rjust(2, '0')}:#{minute.to_s.rjust(2, '0')}\"\n end", "def time_string\n\n\t\thours = @seconds/3600 #if not an hour will be stored as 0\n\t\tremainder = @seconds%3600 #modulo gives the amount that remains\n\t\tsprintf(\"%02d:%02d:%02d\", hours, remainder/60, remainder%60) #string...
[ "0.7587911", "0.74107236", "0.7368464", "0.72262585", "0.7212559", "0.71968603", "0.7184344", "0.70620435", "0.7043465", "0.70119166", "0.7001719", "0.69806075", "0.6978929", "0.6923772", "0.69055986", "0.6890879", "0.6852435", "0.684721", "0.68462867", "0.68135923", "0.68117...
0.74437636
1
TODO Remove this method.
def github_api(user = current_user) @github_api ||= GithubApi.new(github_token, user) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def schubert; end", "def probers; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def refutal()\n end", "def custom; end", "def custom; end", "def implementation; end", "def implementation; end", "def suivre; end", "def private_met...
[ "0.8026605", "0.6746819", "0.6704927", "0.6662315", "0.6662315", "0.6662315", "0.6662315", "0.6655722", "0.6342428", "0.6342428", "0.62656474", "0.62656474", "0.6198587", "0.6176653", "0.6070916", "0.60650855", "0.606273", "0.60610527", "0.604195", "0.60343444", "0.60343444",...
0.0
-1
GET /relationships GET /relationships.json
def index @relationships = @relationships.order(created_at: :desc).page(params[:page]) respond_to do |format| format.html { @relationships = @relationships.includes(:follower, :followed) } format.json {} end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_relationships\n end", "def get_relationship_by_id id\n headers = {\n 'Accept' => 'application/json; charset=UTF-8',\n }\n get_request 'relationship/' + id, headers\n end", "def relationships(*ids)\n perform_request_with_collection(:get, '/api/v1/accounts/relationships',\n ...
[ "0.7568152", "0.7451009", "0.7267501", "0.71861583", "0.71036917", "0.70426375", "0.7041152", "0.701358", "0.6906209", "0.6906209", "0.6860838", "0.6854994", "0.6824355", "0.67031306", "0.6658709", "0.6551664", "0.6498407", "0.64868015", "0.6467257", "0.645903", "0.6446793", ...
0.75787055
0
POST /relationships POST /relationships.json
def create respond_to do |format| if @relationship.save format.html { redirect_to @relationship.followed, notice: "Now following #{@relationship.followed.name}." } format.json { render :index, status: :created, location: @relationship } format.js else format.html { render...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @relationships = Relationship.paginate(:page => params[:page], :per_page => 30).order('updated_at DESC')\n @relationship = Relationship.create(params[:relationship])\n end", "def get_or_create_relationship(conn, node_start, node_end, type)\n data = <<\"EOS\"\n{\n \"to\" : \"#{node_end}\",\n...
[ "0.7072599", "0.67014796", "0.6696139", "0.6636808", "0.6434081", "0.643312", "0.643312", "0.643312", "0.64099956", "0.6396629", "0.6318684", "0.6227721", "0.62182003", "0.62056184", "0.6191377", "0.61736906", "0.6168153", "0.61657244", "0.6157943", "0.60911244", "0.6076791",...
0.57772994
39
DELETE /relationships/1 DELETE /relationships/1.json
def destroy @relationship.destroy respond_to do |format| format.html { redirect_to @relationship.followed, notice: "No longer following #{@relationship.followed.name}." } format.json { head :no_content } format.js end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n relationship = Relationships.find(params[:id])\n relationship.destroy\n head 204\n end", "def delete_relationship(id)\n return @client.raw(\"delete\", \"/config/relationships/#{id}\")\n end", "def destroy\n @relationship = Relationship.find(params[:id])\n @relationship.d...
[ "0.79791224", "0.7476604", "0.74007165", "0.73186785", "0.72942656", "0.72367764", "0.72367764", "0.7214565", "0.7068235", "0.7057089", "0.70516044", "0.70011026", "0.70009506", "0.69664127", "0.69541514", "0.69105667", "0.69072515", "0.6885267", "0.6814343", "0.67920077", "0...
0.64379275
42
Never trust parameters from the scary internet, only allow the white list through.
def relationship_params params.require(:relationship).permit(:followed_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
overwrite equality (because some devise tests use this for asserting model equality)
def ==(other) other.is_a?(self.class) && _id == other._id end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ==(other); false; end", "def ==(other)\n super\n end", "def ==(other)\n super\n end", "def equal?(other); end", "def ==(other)\n super\n end", "def ==(other)\n @klass == other.class && @attributes == strip_active_record(other)\n end", "def ==(other); end", ...
[ "0.67423534", "0.66888535", "0.66888535", "0.6667906", "0.66626805", "0.6612782", "0.66103446", "0.66103446", "0.66103446", "0.66103446", "0.66103446", "0.66103446", "0.66103446", "0.66103446", "0.66103446", "0.66103446", "0.66103446", "0.66103446", "0.66103446", "0.66103446", ...
0.0
-1
IST UPDATE: Since the Datadog API only accepts guage metric requests and the original logstash datadog plugin forces us to hardcode a metric value, we just count the number of events present in the queue when flushing
def construct_metric_data(events_arr) now = Time.now.to_i num_log_entries = events_arr.size metric_data = { 'metric' => @metric_name, 'host' => @host, # Gauge is the only valid metric for the API 'type' => 'gauge' } if @dd_tags metric_data['tags'] = @dd_tags end ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue_count()\n cnt = 0\n @flows.each_value { |f| cnt += f.queue_count() }\n cnt\n end", "def hits(format)\n begin\n Retain::Cq.new(retain_user_connection_parameters, to_options).hit_count\n rescue Retain::SdiReaderError => e\n logger.error(\"CMB: queue#hits e.messag...
[ "0.6999945", "0.6574076", "0.65348625", "0.63930297", "0.63810986", "0.63070035", "0.6291728", "0.6248805", "0.6212815", "0.6203712", "0.6186685", "0.6172065", "0.614794", "0.6131219", "0.6131171", "0.6130992", "0.6128493", "0.6126386", "0.61090565", "0.60883856", "0.6045571"...
0.0
-1
return length of ArrayList
def length array_list.length end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def length\r\n @list.length\r\n end", "def length\n return @list.length\n end", "def length\n # calculates the length of the list\n end", "def size\n @list.size\n end", "def size\n @list.size\n end", "def size\n self.list.length\n end", "def size\n list.size...
[ "0.8483877", "0.84697473", "0.8152299", "0.80341154", "0.80341154", "0.80110294", "0.79998803", "0.7963393", "0.782154", "0.7729976", "0.77258354", "0.7693571", "0.76794225", "0.7662269", "0.76466066", "0.7642223", "0.759703", "0.75845116", "0.75845116", "0.75845116", "0.7584...
0.84054184
2
add element to end of ArrayList
def add(element) temp_list = array_list @array_list = FixedArray.new(length + 1) (length - 1).times do |index| @array_list.set(index, temp_list.get(index)) end @array_list.set(length - 1, element) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add element\n add_last(element)\n end", "def add element\n add_last(element)\n end", "def add_at_tail(val)\n @list << val\n end", "def add_to_end(arr, element)\n arr.push(element)\nend", "def add_element_to_end_of_array(array, element)\n array << element \nend", "def add_element_to_end_...
[ "0.780481", "0.780481", "0.7635971", "0.7266983", "0.6980633", "0.6960489", "0.6842034", "0.6801879", "0.6731668", "0.6714683", "0.67081624", "0.67076474", "0.6681383", "0.66051567", "0.65398043", "0.65349746", "0.6529529", "0.65201527", "0.6511517", "0.6500612", "0.6499692",...
0.70074034
4
set an element at the specified index
def set(index, element) @array_list.set(index, element) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set(index, element)\n node_at_index = get(index)\n node_at_index.element = element\n end", "def set(index, element)\n\t\traise OutOfBoundsException if index >=@size\n\t\t@data[index] = element\n\tend", "def set(index, element)\n\t\traise OutOfBoundsException if index >= @size\n\t\t@data[index] = ele...
[ "0.8510833", "0.8477973", "0.8468687", "0.82056683", "0.81371397", "0.80025965", "0.79836965", "0.7919724", "0.78591824", "0.78213775", "0.78042877", "0.7793659", "0.77174896", "0.75466764", "0.74449944", "0.7437167", "0.7368916", "0.73422396", "0.7325153", "0.73246497", "0.7...
0.86785686
0
return an element at the specified index
def get(index) @array_list.get(index) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def at(index)\n each.with_index { |v, i| return v if i == index }\n return nil\n end", "def get_index(index)\n return self.at(index)\n end", "def at(index)\n self[index]\n end", "def get_item(index)\r\n @list[index]\r\n end", "def get_at_index(index)\n return nil if index ...
[ "0.8282886", "0.8137495", "0.8043613", "0.8036421", "0.8035406", "0.80209213", "0.79888314", "0.79625356", "0.79606223", "0.79606223", "0.7932635", "0.79199785", "0.788963", "0.7861528", "0.77889097", "0.77803576", "0.77094346", "0.77080333", "0.76819193", "0.7681828", "0.768...
0.7704325
18
insert an element at the specified index Any elements >= to the index will be shifted to the right
def insert(index, element) raise OutOfBoundsException unless valid_index?(index) temp_list = array_list @array_list = FixedArray.new(length + 1) (index -1).times do |below_index| array_list.set(below_index, temp_list.get(below_index)) end array_list.set(index,element) (index + 1).up...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert(index, element)\n oob_throw(index)\n if index == 0\n @array = [element] + @array[index + 1..-1]\n else\n @array = @array[0..index-1] + [element] + @array[index..-1]\n end\n end", "def insert_element_at_given_index(array, index, element)\n array.insert(index, element)\nend", ...
[ "0.852059", "0.80839425", "0.774723", "0.76535857", "0.7634724", "0.7567217", "0.7503685", "0.74910575", "0.7473836", "0.7452081", "0.7445067", "0.74442023", "0.7443902", "0.742171", "0.7392433", "0.7381003", "0.73753357", "0.73753357", "0.73753357", "0.73753357", "0.73753357...
0.80364615
2
returns true if index is greater than Zero or index is within the size limit of the array
def valid_index?(index) index >= 0 && index < self.length end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_range?(index)\n index >= 0 and index < size\n end", "def valid_index_in?(array, index)\n index <= (array.length - 1) && index >= (0 - array.length)\n end", "def valid_index?(array, index_number)\n if index_number >= 0 && index_number < array.length\n return true\n end\nend",...
[ "0.78402406", "0.75898796", "0.75782406", "0.7316193", "0.7172", "0.7066585", "0.7059718", "0.7039577", "0.68853474", "0.6872305", "0.6867593", "0.6785576", "0.67226523", "0.66952", "0.6637574", "0.66249293", "0.66028404", "0.6590943", "0.6493818", "0.64927125", "0.6480367", ...
0.75008833
3
Open and select simulator
def open_start @simulator = WIN32OLE.new('AutoItX3.Control') Dir.chdir(@sim_gui_path) Dir.pwd @simulator.Run("V4SingleSimulatorGUI.exe") @simulator.WinWaitActive("Emerson (Copyright 2012)") @simulator.ControlClick("Emerson (Copyright 2012)","Remote Control on Port:","WindowsForms10...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open\n # Opening the simulator with a specific UDID will boot the device\n if booted\n shutdown\n end\n sim = %x[/usr/bin/xcode-select -p].gsub(\"\\n\", \"/Applications/iOS Simulator.app\")\n %x[open -g -a '#{sim}' --args -CurrentDeviceUDID #{self.id}]\n sleep 0.5\n end"...
[ "0.78422636", "0.7537542", "0.6922103", "0.6700604", "0.65381926", "0.6385245", "0.633819", "0.6305294", "0.59312415", "0.57592136", "0.57048786", "0.568294", "0.5682583", "0.5639652", "0.56052864", "0.5594085", "0.5592013", "0.55761826", "0.5560743", "0.5497336", "0.54898924...
0.7391556
2
Internal: Stringify's the mail exchange records.
def mail_exchanges records.map { |record| record.exchange.to_s } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compose_email_details()\n\t email_details = \"From: \" + @email[:from].formatted.first + \"\\n\"\n email_details << \"To: \" + @email[:to].formatted.join(', ') + \"\\n\"\n if !@email.cc.nil?\n email_details << \"Cc: \" + @email[:cc].formatted.join(', ') + \"\\n\"\n end\n ...
[ "0.59773415", "0.5787992", "0.55759233", "0.55532515", "0.5530297", "0.5471862", "0.5388905", "0.5364263", "0.53518647", "0.5351518", "0.53140676", "0.53066504", "0.5288347", "0.5258925", "0.5229787", "0.5208722", "0.5109064", "0.50969446", "0.5087094", "0.5084382", "0.508278...
0.6432499
0
Internal: Returns the MX records for the email address.
def records dns.getresources domain, Resolv::DNS::Resource::IN::MX end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mx_records\n @mx_records ||= Resolv::DNS.open do |dns|\n records = dns.getresources(name, Resolv::DNS::Resource::IN::MX)\n records.map(&:exchange).join(\" \")\n end\n end", "def mxers\n return [[\"example.com\", \"0.0.0.0\", 1]] if @dns_disabled\n @mxers ||= Resolv::DNS.open { |dns...
[ "0.76679105", "0.7156867", "0.63225955", "0.6267466", "0.6083771", "0.6007126", "0.60036457", "0.59840816", "0.59376955", "0.5891234", "0.58755136", "0.5858621", "0.584564", "0.5835959", "0.57675016", "0.5752767", "0.57368696", "0.56799096", "0.5563733", "0.5555753", "0.55434...
0.74115855
1
Internal: Returns an open Resolv::DNS connection.
def dns @dns ||= Resolv::DNS.open end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dns\n if @dns.nil?\n begin\n @dns = Timeout::timeout(TIMEOUT) do\n without_warnings do\n Net::DNS::Resolver.start(absolute_domain).answer if domain\n end\n end\n @dns ||= false\n rescue Exception\n @dns = false\n e...
[ "0.6550621", "0.62093896", "0.6165713", "0.5918688", "0.5916433", "0.58696866", "0.5846383", "0.58384836", "0.5779404", "0.5734093", "0.5699011", "0.56807774", "0.56796783", "0.5648475", "0.56059206", "0.5598183", "0.55770224", "0.5523219", "0.55200684", "0.55169475", "0.5513...
0.7740103
0
Returns the class (either "current" or "") for a menu item in the primary navigation
def menu_item_class(menu_item_title) @current_archive == Archive.ada && menu_item_title == @title ? "current" : "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def link_class(url)\n return 'nav-item' unless current_page?(url)\n\n 'nav-item current'\n end", "def active_link_class(item)\n active_class = 'active_menu_link'\n found = false\n case item.class.to_s\n when 'Project'\n found = true if (@project && @project == item) && (@stage.blank?)\n ...
[ "0.7588065", "0.7342913", "0.72393966", "0.722923", "0.7223703", "0.72019005", "0.71410376", "0.71286154", "0.70991755", "0.7070821", "0.69593203", "0.69593203", "0.6929614", "0.6874137", "0.6862346", "0.677513", "0.6745221", "0.673281", "0.67288744", "0.67131543", "0.6617072...
0.7972165
0
outputs a deployment message for Product Owner to watch (so they know how fresh the code is)
def deploy_log if File.exists?("tmp/deploy-log.txt") log = File.read("tmp/deploy-log.txt") end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def notification_about_deployment(to, project, environment, revision, user, from = self.from, sent_on = Time.now, subject = \"New version deployed on #{sent_on.strftime('%c')} by #{user}\")\n subject subject\n recipients to\n from from\n sent_on sent_on\n body :project =>...
[ "0.68227905", "0.64813507", "0.64381576", "0.63847566", "0.6338993", "0.6214278", "0.6158373", "0.6147748", "0.6147748", "0.6085746", "0.6066357", "0.6065654", "0.6061015", "0.6045781", "0.5974786", "0.59506524", "0.5849686", "0.5802307", "0.57893753", "0.5742781", "0.5705498...
0.0
-1
this checks to see if a human readable mapping (DdiMapping) exists for the DDI element
def human_readable(ddi) mapping = ddi_mapping(ddi) mapping || ddi end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_mappings()\n return @mappings.has_data()\n end", "def tag_in_dictionary?\n !@definition.nil?\n end", "def isMapping\n @refType.kind_of?(DataMetaDom::Mapping) && !@refType.kind_of?(DataMetaDom::BitSet)\n end", "def mapped?\n\t @mapping ? true : false\n end", ...
[ "0.5967232", "0.589897", "0.58535105", "0.5850974", "0.58006674", "0.5648211", "0.5612665", "0.5522739", "0.5504238", "0.54594404", "0.54249275", "0.5385851", "0.53086776", "0.52705884", "0.5237063", "0.52351767", "0.52325386", "0.5216849", "0.5214281", "0.5197591", "0.518405...
0.610099
0
Adding 3 + 6 + 9 + 12.. 999 is the same as adding 1002 as many times as half of the elements in 3..6...999
def get_sum_through(target, piece) target -= 1 highest_multiple = target / piece * piece sum_chunk = highest_multiple + piece quantity = target / piece / 2 odd = target / piece % 2 odd_piece = odd * sum_chunk / 2 sum_chunk * quantity + odd_piece end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def brut_force_solution\n (1...1000).inject(0){|sum, digit| ((digit % 3 == 0) || (digit % 5 == 0)) ? sum += digit : sum}\nend", "def run\n (3...1000).inject(0){|sum, num| (num % 3 == 0 || num % 5 == 0) ? sum += num : sum }\nend", "def sum_multiples_3_and_5\n return 3 * 333 * 334 / 2 + 5 * 199 * 200 / 2 - 15...
[ "0.7230523", "0.70098233", "0.70083153", "0.69909525", "0.69865996", "0.69715434", "0.69158584", "0.69043833", "0.6897287", "0.68707246", "0.6862787", "0.6838802", "0.68085635", "0.68050617", "0.67818576", "0.67741454", "0.67711437", "0.6769795", "0.67590654", "0.6748635", "0...
0.0
-1
Find all Searchable Organizations which no longer meet the requirements setout in SearchableOrganization.all. Evict them from the searchables table. Also remove any searchables that can't be tied back to their Organizations
def update_or_evict_stale_organizations ids = Searchable::SearchableOrganization.all.ids urls = ids.map do |id| participant_path(id) end stale_ids = Searchable.where(document_type: 'Participant').where.not(url: urls).map do |searchable| Integer(searchable.url.gsub('/what-is-gc/participants...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_uninitialized_orgs\n Organization.find(:all, :conditions => {:uninitialized_association_member => true, :email => self.email}).each do |org|\n org.destroy\n end\n end", "def remove_access_to(organisations_to_remove)\n self.organisations = self.organisations - Array(organisations_to_remo...
[ "0.6012159", "0.56509703", "0.56509703", "0.54118496", "0.53096944", "0.5228016", "0.51857054", "0.5175699", "0.51624894", "0.5149687", "0.51406723", "0.51387864", "0.5103329", "0.50964", "0.50906694", "0.5071928", "0.5063098", "0.50350463", "0.5024625", "0.50169957", "0.4980...
0.63652915
0
TODO sepatare controller for selects
def fill_subcategory @select_data = Subcategory.ordered_by_category params[:category_id] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_list; end", "def request_select\n end", "def selected_options; end", "def selected_options; end", "def select\n self[:select]\n end", "def index\n @formularios = Formulario.search\n @select_options = Formulario.get_name_folder\n end", "def general_info_for_select\n\t\...
[ "0.698288", "0.69595313", "0.6529587", "0.6529587", "0.6457469", "0.6321194", "0.62742054", "0.62684333", "0.6246751", "0.62324166", "0.62324166", "0.6152928", "0.6133162", "0.60709745", "0.6066651", "0.6063691", "0.60188866", "0.599742", "0.5981946", "0.5962227", "0.594457",...
0.0
-1
TODO learn best practice with adding assocations
def operation_params params.require(:operation) .permit(:date, :sum, :source, :category_id, :subcategory_id, :comment) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def associations; end", "def assoc_options\n # Wait to implement this in Phase IVa. Modify `belongs_to`, too.\n @assoc_options ||= {}\n @assoc_options\n end", "def setup_associations; end", "def association(association_name); end", "def assoc(name)\n associations[name].()\n end", "d...
[ "0.6770267", "0.6590667", "0.6430838", "0.6398309", "0.6271774", "0.6152447", "0.61433405", "0.6061433", "0.6036368", "0.59918004", "0.5963872", "0.5874912", "0.5859508", "0.58488303", "0.58367974", "0.58125615", "0.5729435", "0.5707007", "0.56720084", "0.5663243", "0.5657469...
0.0
-1
Return the meaningful information about the instance of Key
def inspect 'Id: ' + @id.to_s + ', Expires on: ' + display_expiry_date + ', Level: ' + map_number_to_word_level(@level) + ', Number of days left to expire: ' + display_num_of_days_left + ', Description: ' + @description % self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inspect\n \"#<#{ self.class.name } key=#{ @key.inspect }>\"\n end", "def key\n @key.id2name\n end", "def key\n self.class._key\n end", "def key\n @key\n end", "def key\n @key\n end", "def key\n @key\n end", "def key\n @key\n end", "def key_info\...
[ "0.7421469", "0.7400594", "0.72728425", "0.72145945", "0.72145945", "0.7213651", "0.7213651", "0.71789765", "0.71773374", "0.7152583", "0.7152583", "0.703278", "0.6995864", "0.69948035", "0.69948035", "0.6988132", "0.6916816", "0.69049317", "0.69049317", "0.6838388", "0.68383...
0.0
-1
Print the instance of Key's details in a nice format
def to_s 'Id: ' + @id.to_s + ', Expires on: ' + display_expiry_date + ', Level: ' + map_number_to_word_level(@level) + ', Number of days left to expire: ' + display_num_of_days_left + ', Description: ' + @description % self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inspect\n \"#<#{ self.class.name } key=#{ @key.inspect }>\"\n end", "def inspect\n %(#<#{self.class} keys=#{keys.inspect}>)\n end", "def inspect\n %(#<#{self.class} keys=#{keys.inspect}>)\n end", "def dump_key(object)\n object.key_attribute\n end", "def inspect\n ...
[ "0.806331", "0.747056", "0.747056", "0.7089417", "0.70218456", "0.69909596", "0.6915581", "0.67583555", "0.6754837", "0.6696272", "0.66728085", "0.66728085", "0.66462386", "0.66442657", "0.66240686", "0.6609566", "0.6548257", "0.6536239", "0.65350074", "0.648962", "0.648962",...
0.0
-1
Return the meaningful word for a specified level
def map_number_to_word_level(level) case level when 0 'OK' when 1 'WARNING' when 2 'CRITICAL' when 3 'UNKNOWN' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def level_text2\n \"#{text_get(27, 29)}#@level\"\n end", "def get_new_word(level)\n\t\n\tdict_array_details = array_sort(level)\n\n\tsorted_dict_array = dict_array_details[0]\n\tsorted_dict_lengths = dict_array_details[1]\n\n\tif sorted_dict_lengths[\"end_\" + level.to_s] == nil\n\t message = \"Could n...
[ "0.7013884", "0.6796898", "0.667353", "0.6353301", "0.63280886", "0.61813056", "0.6138863", "0.6025551", "0.5982634", "0.59769005", "0.5970132", "0.5958963", "0.59497833", "0.5945773", "0.5917529", "0.5891411", "0.58830535", "0.5880532", "0.58421826", "0.5839062", "0.5839062"...
0.7461547
0
TODO: Currently somewhat unsafe. There is nothing that hinders two accounts with the same name to be initialized.
def ==(other) return self.name == other.name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize( name )\n @name = name\n @accounts = {} # Initialise accounts to an empty hash\n end", "def initialize(name)\n @name = name\n @accounts = {} # Initialize accounts as an empty hash\n end", "def new_account(name)\n account(name)\n end", "def account_name=(name)\...
[ "0.74410856", "0.7379537", "0.72254616", "0.7007688", "0.6974333", "0.68886834", "0.6799504", "0.66707355", "0.6657013", "0.6634738", "0.6601192", "0.6550599", "0.6437894", "0.6414782", "0.6414782", "0.6378013", "0.6346191", "0.6305419", "0.62950987", "0.6292779", "0.628281",...
0.0
-1
Their version of position_taken?
def position_taken?(board, index) !(board[index].nil? || board[index] == " ") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def position_taken?\nend", "def positions(passes) = passes.map { find_position(_1) }", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position_taken?(index)\n ((@boar...
[ "0.7588742", "0.6353642", "0.6224119", "0.6224119", "0.6224119", "0.6224119", "0.6224119", "0.6224119", "0.6224119", "0.6224119", "0.6207263", "0.6160737", "0.6149839", "0.6149839", "0.6149839", "0.6149839", "0.61372274", "0.6117104", "0.61160207", "0.61096793", "0.61090356",...
0.0
-1
This method smells of :reek:UtilityFunction (because it is one)
def alert_class(type) styles = { success: 'alert-success', error: 'alert-danger', alert: 'alert-warning', notice: 'alert-info' } type_sym = type.to_sym return styles[type_sym] if styles.key? type_sym type.to_s end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def anchored; end", "def suivre; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def probers; end", "def ignores; end", "def schubert; end", "def silly_adjective; end", "def too_complex; end", "def custom; end", "def custom; end", "...
[ "0.65756625", "0.5895922", "0.5888028", "0.5823276", "0.5823276", "0.5823276", "0.5823276", "0.5767998", "0.5694042", "0.5673487", "0.56497914", "0.5637733", "0.5616003", "0.5616003", "0.5608078", "0.5583271", "0.55641556", "0.5509837", "0.54962695", "0.5491811", "0.54883224"...
0.0
-1
FIXME: This needs to be made into one or more proper matchers. rubocop:disable Metrics/AbcSize, Metrics/MethodLength This method smells of :reek:DuplicateMethodCall, :reek:NestedIterators This method smells of :reek:TooManyStatements
def describe_flash_entries_for(case_env, outer_description_in, data_in) outer_description = outer_description_in data = data_in case_env.instance_eval do describe outer_description do before do data.each do |entry| flash_obj.send :[]=, entry.keys.first, entry.values.first end ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def submatchers; end", "def matcher; end", "def matcher; end", "def child_check(level, child_data, local_nesting, expected, match_value)\n matched = child_data.select do |item|\n nest_match_attributes(item, local_nesting, expected, match_value)\n end\n level[:comparison].compare(matched.count)\nend", ...
[ "0.6664394", "0.5981227", "0.5981227", "0.56516296", "0.5645376", "0.5641091", "0.5633203", "0.5633203", "0.56283444", "0.56072164", "0.54742557", "0.5429048", "0.5416748", "0.53913546", "0.5380412", "0.53632224", "0.53384346", "0.5333149", "0.53148186", "0.53126216", "0.5300...
0.0
-1
GET /user_goals GET /user_goals.json
def index @user = current_user @is_me = true @friends = Friend.where(user_id: current_user.id).try(:all) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @goals = @user.goals\n \n render json: @goals\n end", "def goals\n get(\"/user/#{@user_id}/activities/goals/daily.json\")\n end", "def goals\n get(\"/user/#{@user_id}/activities/goals/daily.json\")\n end", "def index\n @goals = goals_for_current_user\n ...
[ "0.82958657", "0.826009", "0.8258675", "0.7673709", "0.75955445", "0.7504581", "0.7502712", "0.7472143", "0.7464317", "0.74108416", "0.7353643", "0.7329418", "0.73219097", "0.73078823", "0.72618526", "0.7194915", "0.71775246", "0.71584696", "0.70967466", "0.7084127", "0.70234...
0.0
-1
GET /friends/1 GET /friends/1.json
def show @user = current_user @is_me = true @friends = Friend.where(user_id: current_user.id).try(:all) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def friends(options={})\n get('/friends', options)\n end", "def index\n @user = current_user\n render json: @user.friends\n end", "def friends\n # Requires authorization\n raise PutioError::AuthorizationRequired if authentication_required!\n\n make_get_call('/friends/list')....
[ "0.76709884", "0.7604071", "0.7600863", "0.74548936", "0.7365434", "0.73384774", "0.73283494", "0.73141056", "0.73036456", "0.7235156", "0.7219719", "0.7216787", "0.7163809", "0.7131452", "0.70871836", "0.70085126", "0.69397676", "0.6919202", "0.6908836", "0.69050354", "0.690...
0.0
-1
Return structured information about a particular ruby version or `nil` if it is not installed or `sm` itself is not available.
def query self.class.instances.any? do |provider_sm| provider_sm.properties if @resource[:name] == provider_sm.name end || nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_version_info\n if defined?(Sensu::Enterprise::VERSION)\n [\"enterprise\", Sensu::Enterprise::VERSION]\n else\n [\"core\", Sensu::VERSION]\n end\n end", "def version\n if defined?(Smml) && ( Smml.constants.member?(\"VERSION\") || Smml.constants.member?(:VERSION...
[ "0.5889671", "0.5874005", "0.58432555", "0.5837136", "0.5826575", "0.5817977", "0.5696053", "0.5633037", "0.56183237", "0.56130004", "0.56129307", "0.5588316", "0.55789864", "0.5553257", "0.5546321", "0.5541933", "0.55290145", "0.5528571", "0.55002683", "0.5479556", "0.547578...
0.0
-1