query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
d5958810f97cc9d22dec209f29807d0c | Coding all? is optional. | [
{
"docid": "d6c43af120e3cd46ab24da5c6fb6be3a",
"score": "0.5842437",
"text": "def all?(array)\nend",
"title": ""
}
] | [
{
"docid": "0a2f9db7f82e1baf16989471df9783e1",
"score": "0.7014059",
"text": "def all?\n is?(:all)\n end",
"title": ""
},
{
"docid": "a795c6a4e334fb38c0157ed4b1461751",
"score": "0.6992598",
"text": "def all_or_nothing?\n true\n # TODO: - read in from configration\n ... |
77bc8150e501d82b37c7ae634b3debf0 | guardado de las cartas | [
{
"docid": "2e2d5649bc862c437992007a2073830d",
"score": "0.0",
"text": "def news_element(new)\n\tfile = File.open(\"cartas_elegidas.txt\",\"w\") do |file|\n\tfile.puts \"#{new}\"\n\tend\nend",
"title": ""
}
] | [
{
"docid": "2bfaf33b8d5e30e25d0df86de154d293",
"score": "0.74045795",
"text": "def pesca_carta\r\n @log.info \"pesca_carta\"\r\n carte_player = []\r\n briscola_in_tavola = true\r\n if @mazzo_gioco.size > 0\r\n # ci sono ancora carte da pescare dal mazzo \r\n @round_players.each d... |
611b1264a498215f7b2fab8cb8791e97 | (ie. "Never eat shredded wheat" would return 4). Words will be separated by single spaces. | [
{
"docid": "5f4d65cf712f2897e855c1fe021f27d6",
"score": "0.0",
"text": "def WordCount(str)\n\n arr=str.split\n return arr.length\nend",
"title": ""
}
] | [
{
"docid": "39c88801bbe223b9848fa499d9cb9f8e",
"score": "0.73887926",
"text": "def nwords(s)\n n = @options[:nwords].to_i\n words = 0\n s.split(\" \").inject(\"\") do |res,word|\n if words < n\n res << \" \" << word\n words += 1 if word.size > 2\n end\n ... |
2ea73226ca0393354ac3d6b5f480a302 | starts cycle and washes load | [
{
"docid": "3ea8cb0207ddbcc244b059756234a837",
"score": "0.686142",
"text": "def start\n super\n load.wash!\n end",
"title": ""
}
] | [
{
"docid": "e4c1cd50a2d7941e5b2848cb82882795",
"score": "0.73231214",
"text": "def waivers_load_start; end",
"title": ""
},
{
"docid": "e4c1cd50a2d7941e5b2848cb82882795",
"score": "0.73231214",
"text": "def waivers_load_start; end",
"title": ""
},
{
"docid": "7b5a3477f01e... |
d8ffd077d8b9691c1f405b612d5b1f23 | PATCH/PUT /flights/1 PATCH/PUT /flights/1.json | [
{
"docid": "e7b6ef9df5f2e6383367bdf432f09628",
"score": "0.7166179",
"text": "def update\n respond_to do |format|\n if @flight.update(flight_params)\n format.html { redirect_to @flight, notice: 'Flight was successfully updated.' }\n format.json { render :show, status: :ok, location... | [
{
"docid": "67c94d14e85ce2e3d08c5e661afaa3c3",
"score": "0.75230956",
"text": "def update\n @flight = Flight.find(params[:id])\n\n if @flight.update(params[:flight])\n head :no_content\n else\n render json: @flight.errors, status: :unprocessable_entity\n end\n end",
"title": "... |
efd475c72a6eb518d9fbc2f41c23df05 | Moves a forum to the bottom using an acts_as_list helper. | [
{
"docid": "39c9439f0410f0780981f3aa7a6e8738",
"score": "0.77652603",
"text": "def move_to_bottom\n @forum.move_to_bottom\n flash[:notice] = t(:moved_to_bottom, :thing => \"Forum\")\n redirect\n end",
"title": ""
}
] | [
{
"docid": "de34752594b803a61f56b610ebf30644",
"score": "0.68872184",
"text": "def move_to_bottom\n return unless in_list?\n acts_as_list_class.transaction do\n decrement_positions_on_lower_items\n assume_bottom_position\n end\n end",
"title": ... |
95ce91b60c0bf1d9b65d09c652351cd8 | put this in the body after a form to set the input focus to a specific control id at end of rhtml file: Thanks to Dana Jones from Sterling Rose Design (sterlingrosedesign.com) | [
{
"docid": "b52da823c463651eddf0cd64c0349c1e",
"score": "0.62031627",
"text": "def set_focus_to_id(id)\n javascript_tag(\"$('#{id}').focus()\") unless flash[:error]\n end",
"title": ""
}
] | [
{
"docid": "17518420b58447550a9020c4ee6887ec",
"score": "0.69761986",
"text": "def set_focus_to(id)\n javascript_tag(\" $(document).ready(function(){$('##{id}').focus()});\");\n end",
"title": ""
},
{
"docid": "17518420b58447550a9020c4ee6887ec",
"score": "0.69761986",
"text": "de... |
20c5105f87d70508f54304d921a33442 | Write a method that returns the `n`th prime number. Recall that only numbers greater than 1 can be prime. Difficulty: medium. You may use our `is_prime?` solution. | [
{
"docid": "b942feff93208ba01ede1bc558814f34",
"score": "0.848887",
"text": "def nth_prime(n)\n result = 0\n i = 2\n while result < n\n result += 1 if is_prime?(i)\n return i if result == n\n i += 1\n end\nend",
"title": ""
}
] | [
{
"docid": "007cb5a167b4018a3a51c746fd3a8485",
"score": "0.8627745",
"text": "def nth_prime(n)\n return nil if n == 0 \n count = 0\n i = 0\n while count < n\n if is_prime?(i)\n count += 1 \n end\n i +=1\n end\n i - 1\nend",
"title": ""
},
{
"docid": "c9ae43010bd8930896833... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "2c4ed415b16c1c651883b15e71395789",
"score": "0.0",
"text": "def set_patient\n @patient = Patient.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163163",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6045976",
"text": "def action_hook;... |
2d7c2fde9e749cffe7f11a3c5fd4b647 | % to_sym : () > Symbol | [
{
"docid": "e7d916b1671cebcfd28d6d942c4761fd",
"score": "0.8747047",
"text": "def to_sym() end",
"title": ""
}
] | [
{
"docid": "acac1275aed399c2b78d836fe5d41f0c",
"score": "0.8636326",
"text": "def to_sym; end",
"title": ""
},
{
"docid": "c6635e229ff91292d473513722226498",
"score": "0.8259791",
"text": "def to_sym\n to_s.to_sym\n end",
"title": ""
},
{
"docid": "8f48a4c201ccaa5... |
81cd1f41090f1aa99be79493789babeb | PUT /donation_lines/1 PUT /donation_lines/1.json | [
{
"docid": "db8e99a8e3ec47b1c63c110aed2e0d51",
"score": "0.75554067",
"text": "def update\n @donation_line = DonationLine.find(params[:id])\n\n respond_to do |format|\n if @donation_line.update_attributes(params[:donation_line])\n format.html { redirect_to @donation_line, notice: 'Dona... | [
{
"docid": "c7e0997b7e31148b7b194da874e9f723",
"score": "0.66414714",
"text": "def update\n @line = Line.find_by_no(params[:id])\n\n respond_to do |format|\n if @line.update_attributes(params[:line])\n format.html { redirect_to @line, notice: 'Line was successfully updated.' }\n ... |
2b9c16c597ec59c5e181498f2ea215f8 | DELETE /bests/1 DELETE /bests/1.json | [
{
"docid": "19e46dfd13355b942e5c62507c7222e9",
"score": "0.73326784",
"text": "def destroy\n @best.destroy\n respond_to do |format|\n format.html { redirect_to bests_url, notice: 'Best was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}... | [
{
"docid": "8b406e90169ab6b4524de97d43e6e155",
"score": "0.68153393",
"text": "def destroy\n @best_ever.destroy\n respond_to do |format|\n format.html { redirect_to best_evers_url, notice: 'Best ever was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
... |
fa1c98ecfab699e9c300b90ddf7fd885 | multiplication multiplies two numbers together | [
{
"docid": "9832b8a85815d7681c55bdd57ba6d665",
"score": "0.7515736",
"text": "def multiplication(num1, num2)\n\tproduct=num1*num2\nend",
"title": ""
}
] | [
{
"docid": "9d00279a9284d144f4321dc739f8fee2",
"score": "0.81459343",
"text": "def multiply(first_number, second_number)\n first_number.to_f * second_number.to_f \n end",
"title": ""
},
{
"docid": "b8943457603ebd5f914c41fcdf9a5f4b",
"score": "0.8101064",
"text": "def multipl... |
207bfade1f807b0c37a5a6e2ee09395f | function used to create auth code for SOAP requests 'userkey' is either user's Panopto admin's username, or the username decorated with the the external provider's instance name if it is an external admin user. 'servername' is the domain name of the Panopto server to make the SOAP request to (e.g. demo.hosted.panopto.c... | [
{
"docid": "2ae432d2c02d9bbc900cabdfab615354",
"score": "0.7568115",
"text": "def generate_auth_code(username, servername, shared_secret)\n payload = \"#{username}@#{servername}\"\n signed_payload = \"#{payload}|#{shared_secret}\"\n p signed_payload\n (Digest::SHA1.hexdigest signed_payload).upcase\n... | [
{
"docid": "4797404c73914f04b62e756389dc16ab",
"score": "0.63152695",
"text": "def build_request( identity, next_service, username, hostname,\n client_username )\n # begin\n buf = @buffers.writer\n buf.write_byte USERAUTH_REQUEST\n buf.write_string... |
dd5f2a9f722e7b80da0594e3d57cd977 | Update a team link. | [
{
"docid": "606a5ba025861599be2ac564a28175cc",
"score": "0.0",
"text": "def update_team_link(team_id, link_id, body, opts = {})\n data, _status_code, _headers = update_team_link_with_http_info(team_id, link_id, body, opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "72ebda76733431e3a80cc05e277de8eb",
"score": "0.6715291",
"text": "def update_team\n \n end",
"title": ""
},
{
"docid": "bb9aaa008e00f8e0387f4ff1bdf57055",
"score": "0.6554813",
"text": "def update_team\n @team.update(team_params)\n end",
"title": ""
},
{
... |
58186799bb10d4a1c9a4a7cce1018439 | Returns the corresponding key from "body". | [
{
"docid": "3978334c301e74cbfeb627948615fbb8",
"score": "0.6983269",
"text": "def [](key)\n body[key]\n end",
"title": ""
}
] | [
{
"docid": "eb9a7c0372f9b0ab3501f6cdf7bd2f78",
"score": "0.6430983",
"text": "def [](key)\n if self.body.is_a?(Array)\n self.body[key]\n else\n self.body.send(:\"#{key}\")\n end\n end",
"title": ""
},
{
"docid": "4cd4fbb49106d126f1204f1eb37e31a4",
"score":... |
b745b567478bb708e1cfffdcc458ce8b | This shows a user information. This comes in handy For our profile screen on the frontend | [
{
"docid": "8c64834d6172a1d4d6668ce29f7fe70f",
"score": "0.0",
"text": "def show\n render json: @current_user, status: :ok\n end",
"title": ""
}
] | [
{
"docid": "e3f2467b58957e4dd55097f06f9d2203",
"score": "0.7730053",
"text": "def show\n @user = User.get_user_info_by_id(session[:user_id])\n end",
"title": ""
},
{
"docid": "4aac6d8c5a0b445522def88c2389626e",
"score": "0.7684514",
"text": "def info\n hash = {:username => @... |
5f5fe830e45c02f5c27b297bee4c2cb8 | GET /buying_histories/new GET /buying_histories/new.json | [
{
"docid": "9d7cc4ccb911b2a22ea64d4e6ef2a556",
"score": "0.78791",
"text": "def new\n @buying_history = BuyingHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @buying_history }\n end\n end",
"title": ""
}
] | [
{
"docid": "9a1dba32dad889a18394edb90f65d63e",
"score": "0.74871314",
"text": "def new\n @historical = Historical.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @historical }\n end\n end",
"title": ""
},
{
"docid": "1eca232ae6beb8... |
f91ab8e4c622f36eb9c970556dc75f61 | Helper Methods start here | [
{
"docid": "96fd7556a4a4d3f23327ea07b8f6963f",
"score": "0.0",
"text": "def pause\n \tsleeper(25)\n end",
"title": ""
}
] | [
{
"docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1",
"score": "0.7428582",
"text": "def private; end",
"title": ""
},
{
"docid": "65ffca17e416f77c52ce148aeafbd826",
"score": "0.66444254",
"text": "def schubert; end",
"title": ""
},
{
"docid": "62158baafece84b452b305badc5dd98c",... |
f2f5fe42e8779480e8aa7f5d6218ac02 | Produce a single character. | [
{
"docid": "3fe3b55a307287c450b2c94ef3724dc0",
"score": "0.6649974",
"text": "def char(v)\n v.is_a?(Integer) ? v.chr(Encoding::UTF_8) : v.chr\n end",
"title": ""
}
] | [
{
"docid": "3b49f0d89e82fe1830eb261ab9627cd1",
"score": "0.73327553",
"text": "def getChar(c)\n c.chr\nend",
"title": ""
},
{
"docid": "45d116808bb56cdfc006a6360c5514bb",
"score": "0.7310014",
"text": "def character\n byte.chr\n end",
"title": ""
},
{
"docid": "adc... |
13cad7c074783dbad171ab5655d81fef | PATCH/PUT /user_bets/1 PATCH/PUT /user_bets/1.json | [
{
"docid": "b8434f6bb4c5dc067c5004c9aba27053",
"score": "0.6476136",
"text": "def update\n respond_to do |format|\n if @user_bet.update(user_bet_params)\n format.html { redirect_to @user_bet, notice: 'Bet was successfully created' }\n format.json { render :show, status: :ok, locati... | [
{
"docid": "d7cc473692da4ca4e8bf3d55a97fbb61",
"score": "0.6591378",
"text": "def update\n @bolt_user = Bolt::User.find(params[:id])\n\n respond_to do |format|\n if @bolt_user.update_attributes(params[:bolt_user])\n format.html { redirect_to :action=>'index', notice: 'User was successf... |
b8f850ce263bff4e2acc4c4150f605bc | syncs a single user's messages | [
{
"docid": "d7a14d25bb32ad99b8a293fa8a69df2a",
"score": "0.6427305",
"text": "def sync_messages\n @client = Slack::Web::Client.new(token: @user.token)\n message_count_before = Message.count(user_id: @user.id)\n dm_channels = @client.im_list[\"ims\"]\n dm_channels.each do |dm_channel|\n ... | [
{
"docid": "89ffb211476fbbc7c6521fee7c46cdc1",
"score": "0.6595525",
"text": "def user_sync\n @user = User.find(params[:id])\n if params[:m]\n m = params[:m]\n else\n m = 1\n end\n command =\"mosquitto_pub -p 3333 -t #{@user.edutorid} -m #{m.to_i} -i Edeployer -q 2 -h 173.255.2... |
13dcd666a8b7a8e895c7c460f39d11a7 | Creates +count+ records for Specify::Model::CollectionObject with the attributes of +self+. | [
{
"docid": "2fd3eab4056459913e39fd3766333cdd",
"score": "0.6520786",
"text": "def create(count)\n @record_set = collection.add_record_set Name: dataset_name,\n user: cataloger.user\n count.times do\n stub = create_stub\n @rec... | [
{
"docid": "459607b72e6ba108c05281a000d8c6cb",
"score": "0.7191601",
"text": "def count\n self.class.collection_builder_strategy.count(self)\n end",
"title": ""
},
{
"docid": "043cedf26da28300f734e7b056ecae33",
"score": "0.6957686",
"text": "def count\n collection.coun... |
d8699b308de13811774b8b497da91d85 | Converts to Google GLatLng | [
{
"docid": "d1b0f9f94a252d052504628e1b993fbe",
"score": "0.7746184",
"text": "def to_g_lat_lng\n 'new GLatLng(' + @lat_dec.to_s + ' , ' + @lon_dec.to_s + ')'\n end",
"title": ""
}
] | [
{
"docid": "e0098f89ee7782c1ba1759e412429d36",
"score": "0.6634306",
"text": "def gga\n # if lat = @gnss[:lat_raw]\n # lat = degree(lat)\n # lat = -lat if @gnss[:ns] == 'S'\n # end\n # if lng = @gnss[:lng_raw]\n # lng = degree(lng)\n # lng = -lng if @gnss[:ew] ... |
f399252235946bbdfca0e38641c1cc10 | Is this creature friendly to the player? PLACEHODER | [
{
"docid": "7ec6d7c942bdc0f8ff14876fcf51549e",
"score": "0.6588765",
"text": "def friendly?\n return false\n end",
"title": ""
}
] | [
{
"docid": "c4c0e4d16486002f3dc7c0ff21e7f272",
"score": "0.7029746",
"text": "def hungry?\n\t\t\t@health < @world.options[:af]/2\n\t\tend",
"title": ""
},
{
"docid": "086c07d3a549c6f180670626199f8d73",
"score": "0.69676274",
"text": "def friendly?\n return true\n end",
"title... |
380ef9be13786602e11cc68912ce5796 | allow strings to set key/value pairs, and return (a little ugly) self | [
{
"docid": "66711e5101c01ff6caf7debb843ceafa",
"score": "0.6030943",
"text": "def setfields(s) \n s.split(\"&\").collect{|k| k.split(\"=\")}.each{|i,j| self[i]=j}; self\n end",
"title": ""
}
] | [
{
"docid": "2561dc850c712b935748d7db1172df18",
"score": "0.6903233",
"text": "def set_string(key, value)\n fail NotImplementedError\n end",
"title": ""
},
{
"docid": "4669d7abdc94a4ed2eda569e880c826c",
"score": "0.6847625",
"text": "def _set(kv)\n case kv.first.to_... |
6f0c0dcece2a3e23b9776980ab4aab13 | Gets a list of tickets via RT_Client::list | [
{
"docid": "c272b74beaea7b6757de2af1c0f66b6b",
"score": "0.58909744",
"text": "def list(struct)\n struct.remapkeys!\n if struct.has_key? :user and struct.has_key? :pass\n rt = RT_Client.new(:user => struct[:user], :pass => struct[:pass])\n struct.delete(:user)\n struct.delete(:pass)... | [
{
"docid": "82b074c02696e719ed00527055b9fed0",
"score": "0.7159341",
"text": "def tickets\n AssemblaApi::Ticket.all(self.id)\n end",
"title": ""
},
{
"docid": "d1907bacfd8724aa392859c7c85977a4",
"score": "0.7108987",
"text": "def get_tickets\n Ticket::RESULTS.tickets\n en... |
de4f4b78936ea3f154bc080c6cd8da62 | Returns the cache used for storing compiled content. | [
{
"docid": "7a2f62b9d387d067a2527884010dc08d",
"score": "0.8528924",
"text": "def compiled_content_cache\n @compiled_content_cache ||= begin\n cache = CompiledContentCache.new(COMPILED_CONTENT_CACHE_FILENAME)\n cache.load\n cache\n end\n end",
"title": ""
}
] | [
{
"docid": "10da4fd31935170f70c693bf0b65bdeb",
"score": "0.76525563",
"text": "def cache_content\n with_path local_repository_path do\n @@cache_content ||= (YAML::load_file(cache_file) || {}).to_hash\n end\n end",
"title": ""
},
{
"docid": "4efcd38fc6206a230b3dd10... |
c1150150ab9c5ef9cae47cd8fbf56451 | Takes the provided data and sets it back on the proxy. | [
{
"docid": "a5d3e9f9b0b6a4a755ddeb36c889b8ec",
"score": "0.0",
"text": "def marshal_load(data)\n @base, @target, @metadata = data\n end",
"title": ""
}
] | [
{
"docid": "1446b69b935c74ccbc25b0fc6d21da2b",
"score": "0.6950801",
"text": "def set_data(data)\n @data = data\n end",
"title": ""
},
{
"docid": "8db67ed6a65b666d4f44b730fe9b7894",
"score": "0.69250345",
"text": "def set_data(data)\n @data = data\n return self\n end",... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "cd825abe35b22f427a8f60b95a1cbd52",
"score": "0.0",
"text": "def update!(**args)\n @request_method = args[:request_method] unless args[:request_method].nil?\n @request_url = args[:request_url] unless args[:request_url].nil?\n @request_size = args[:request_size] unle... | [
{
"docid": "184b1b1ed771473d3eb9f338c0734c38",
"score": "0.73066413",
"text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end",
"title": ""
},
{
"docid": "5076c5a88404ae72986f958710f5687a",
"score": "0.72631145",
"text": "def update... |
75bc088786db03f07d57041d050a40e0 | DELETE /case_studies/1 DELETE /case_studies/1.json | [
{
"docid": "9b4013e6be3e1d70c113c690fcb1df11",
"score": "0.7717751",
"text": "def destroy\n @case_study.destroy\n respond_to do |format|\n format.html { redirect_to :delete, flash: { message: 'Case study was successfully deleted.' } }\n format.json { head :no_content }\n end\n end",
... | [
{
"docid": "b0a1ac17fc0d2db938a66f713cb33238",
"score": "0.7973681",
"text": "def destroy\n @case_study = CaseStudy.find(params[:id])\n @case_study.destroy\n\n respond_to do |format|\n format.html { redirect_to case_studies_url }\n format.json { head :ok }\n end\n end",
"title... |
15d615dc6a4345a5bc5edc396fa80400 | Get the direction for a specific gpio gpio : the gpio to get | [
{
"docid": "77f6547ff7aa8c0e1c9a65139187cbb9",
"score": "0.87098813",
"text": "def direction_get_gpio(gpio)\n\n # validate the gpio\n gpio_ = ValidateGpio.new gpio\n return gpio_.error_message unless gpio_.valid?\n\n # get the direction\n UdooNeoRest::Base.cat_and_statu... | [
{
"docid": "5e2adbfc1d015adfcb4d2d6b9c9c8e28",
"score": "0.6983567",
"text": "def direction_get_pin(pin)\n\n # Validate the pin\n pin_ = ValidatePin.new pin\n return pin_.error_message unless pin_.valid?\n\n # Get the value after translating to gpio\n direction_get_gpio pin_.to_... |
651ecb630cf068fa7e0afe8147312fae | POST /thermostats POST /thermostats.json | [
{
"docid": "1e1333d1a51d8b634d118cfac4a9b40c",
"score": "0.5432704",
"text": "def create\n @thermostat = @location.thermostats.new(thermostat_params)\n respond_to do |format|\n if @thermostat.save\n format.html { redirect_to :controller => 'schedules', :action => 'new', :id => @thermost... | [
{
"docid": "ac2323ecef052932a0fdf60105f2e0c3",
"score": "0.7180685",
"text": "def create\n\t if @thermostat.save!\n\t \trender status: 200, :json=>{:thermostats => @thermostat.thermostat_hash} and return\n\t else\n\t \trender status: 400, :json=>{:error => \"something wrong\"} and return\n\t end\n\... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "7af573d1df126de9defedf3c44c4479f",
"score": "0.0",
"text": "def user_params\n params.permit(\n :email,\n :login,\n :password,\n :password_confirmation,\n :avatar,\n :country,\n :city,\n :address,\n :birth_d... | [
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.7121987",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.70541996",
"text": "def expected_permitted_parameter_names; end",
"title": "... |
71b817b230fe9bfd71e400201a418445 | DELETE /initial_values/1 DELETE /initial_values/1.json | [
{
"docid": "8ee171856399d6c1662cb80c03f693a3",
"score": "0.725049",
"text": "def destroy\n @initial_value.destroy\n respond_to do |format|\n format.html { redirect_to initial_values_url, notice: 'Valores iniciales eliminados con exitó.' }\n format.json { head :no_content }\n end\n en... | [
{
"docid": "7c91d9e549c7a982aee1ed6357246d5b",
"score": "0.6761892",
"text": "def destroy\n @value = Value.find(params[:id])\n @value.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid... |
dff278c6a910a067a7e0431d52026d0f | Set Display Position. [REP] | [
{
"docid": "cb2e4cc8c0cbf2ed9f68626f485723f6",
"score": "0.7309474",
"text": "def set_display_pos(x, y)\n to_update_events = $game_map.effectus_events_to_update\n x = [0, [x, width - screen_tile_x].min].max unless loop_horizontal?\n y = [0, [y, height - screen_tile_y].min].max unless loop_vert... | [
{
"docid": "395e92b5767e20b2302ea43a041f1b96",
"score": "0.7387462",
"text": "def update_display_position\n @viewport_map.ox = @viewport_map_cursor.ox = @viewport_map_zones.ox = @viewport_map_markers.ox = @map_display_ox + @map_display_ox_offset\n @viewport_map.oy = @viewport_map_cursor.oy = @... |
bdf691bdb38d8aa4a3989dc06e071150 | Reset the fast primary key lookup SQL when the simple_table value changes. | [
{
"docid": "9c19c085a9965ed8b2ed7f71b748683a",
"score": "0.74597526",
"text": "def simple_table=(t)\n @simple_table = t\n reset_fast_pk_lookup_sql\n end",
"title": ""
}
] | [
{
"docid": "f21b99edf6e637c7ee15af59b3cd3481",
"score": "0.828495",
"text": "def reset_fast_pk_lookup_sql\n @fast_pk_lookup_sql = if @simple_table && @simple_pk\n \"SELECT * FROM #@simple_table WHERE #@simple_pk = \".freeze\n end\n @fast_instance_delete_sql = if @simple_tab... |
e2595f4800325d43e4f4d769bbc44496 | GET /states GET /states.json | [
{
"docid": "4e3077bc050207e12faeb00606416fc3",
"score": "0.70230395",
"text": "def index\n @states = State.all\n end",
"title": ""
}
] | [
{
"docid": "73add5abc336870dd1b8c083a35777ee",
"score": "0.8080235",
"text": "def index\n @states = states.all\n json_response(@states)\n end",
"title": ""
},
{
"docid": "a419a34e2f7803efc3f8b0e7a1c62597",
"score": "0.78229785",
"text": "def states\n response = ... |
a9f3c8c2fe719f7ceb5a96a665e5f811 | Sends email to admin | [
{
"docid": "c41b4a61abc98a722a545edfcfd4785e",
"score": "0.785475",
"text": "def send_admin_mail\n AdministratorMailer.new_user_waiting_for_approval(self).deliver_now\n end",
"title": ""
}
] | [
{
"docid": "a65ec301f814c378e5fcce664a6e512c",
"score": "0.851764",
"text": "def send_mail_to_admin\n \tNotification.send_mail_to_admin(self).deliver!\n end",
"title": ""
},
{
"docid": "44ddcc3ac0ecedb46a9f39d599468bd2",
"score": "0.8124613",
"text": "def admin\n UserMailer.... |
c4ccd8436ac6311b2f065af146efa892 | GET /pokemonlists/1 GET /pokemonlists/1.json | [
{
"docid": "2ea9ffd56c5acaf62017eb22190726e2",
"score": "0.75694895",
"text": "def show\n @pokemonlist = Pokemonlist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pokemonlist }\n end\n end",
"title": ""
}
] | [
{
"docid": "c2c6c7fb0c49180e9474b8eff2409fd5",
"score": "0.71359754",
"text": "def lists\n\tget('/lists.json')\nend",
"title": ""
},
{
"docid": "422dd1d5abe90059fd21a937236f6867",
"score": "0.7112134",
"text": "def index\n pokemons = Pokemon.order(:id).page(params[:page]).per(para... |
775d3d959bc59caf9e56b867b409421d | POST /whyuscols POST /whyuscols.json | [
{
"docid": "5aa26d71fab6541cff1b1c4f31725560",
"score": "0.52651954",
"text": "def create\n @whyuscol = Whyuscol.new(params[:whyuscol])\n\n respond_to do |format|\n if @whyuscol.save\n format.html { redirect_to [:admin, @whyuscol], notice: 'Whyuscol was successfully created.' }\n ... | [
{
"docid": "bfc47cd3f10423b04abc78e96e1a1982",
"score": "0.6446353",
"text": "def post_column_style( post_column_style_request, opts = {})\n\n data, _status_code, _headers = post_column_style_request.create_http_request(@api_client,opts )\n return data\n end",
"title": ""
},
{
... |
7eba01bbe37f8592bd0d428fb9f661be | creates an object of type CliTest::Execution | [
{
"docid": "8b29ecf56090a3520c4ad27409ced9c2",
"score": "0.0",
"text": "def initialize(stdout, stderr, status)\n @stdout = stdout\n @stderr = stderr\n @status = status\n end",
"title": ""
}
] | [
{
"docid": "ac4263d7b31c705049be95d8fffa3a4d",
"score": "0.61429185",
"text": "def create_execution_context()\n app_ctx = self.application_context\n app_ctx ||= VAPI::Core.create_default_application_context()\n sec_ctx = self.security_context\n sec_ctx ||= VAP... |
d4df66bfa7db794a9155237cf2d16c82 | Convert the HTTP response body to a pure String object. | [
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.0",
"text": "def to_s; end",
"title": ""
}
] | [
{
"docid": "39362da14cca401122d3cbfdd09055c4",
"score": "0.76509005",
"text": "def raw_body\n @response.body.to_s\n end",
"title": ""
},
{
"docid": "4bc4035570356065635dfbb281ac48d0",
"score": "0.7611703",
"text": "def body\n response&.body.to_s\n end",
... |
f85e83d18b6eb8dd4b7687b208bcd6d6 | Add a server to the machine. The server will be started when the machine starts. If the machine is already running, the server will be started immediately. | [
{
"docid": "b4d53a0a523cc4f0183d59acf332ed88",
"score": "0.5910651",
"text": "def prepare server\n server.add_observer self\n servers.push server\n server.start unless stopped?\n end",
"title": ""
}
] | [
{
"docid": "aa9904f9b8fe9b2034677c03e6fe97ca",
"score": "0.79608124",
"text": "def add_server server\n @servers << server\n end",
"title": ""
},
{
"docid": "d1f9684e542411add5c2d6019d1d1266",
"score": "0.74970126",
"text": "def add(server)\n servers.push(server)\n end... |
40918eeef54fc1a5f69c662fccc12467 | Convert the value stored in the database to a string matching how it would be retrieved through the REDCap API. | [
{
"docid": "47643f7a3a3423082f39a3d12976671b",
"score": "0.707815",
"text": "def cast_stored_value_to_redcap_string(value)\n if default_variable_type == 'dichotomous'\n case value\n when true\n '1'\n when false\n '0'\n else\n ''... | [
{
"docid": "b6aa67d0be0b3d374ea2585048062d4a",
"score": "0.7010561",
"text": "def database_to_internal(value); value.to_f; end",
"title": ""
},
{
"docid": "e268c67a819e7c854101af0a226ef7cc",
"score": "0.67083097",
"text": "def typecast_to_string(value)\n value.to_s\n ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "f287f435ca9a99f1650141fa56491dc2",
"score": "0.0",
"text": "def set_box_login\n @box_login = BoxLogin.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.61642385",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.60448",
"text": "def action_hook; ... |
69db8ab54ffcc1826b43c34f6403fc78 | Returns the columns in the result set in their original order. Generally, this will used the columns determined via the database schema, but in certain cases (e.g. models that are based on a joined dataset) it will use Datasetcolumns to find the columns, which may be empty if the Dataset has no records. | [
{
"docid": "bb141bbbad1cca0e63e227ae413aa398",
"score": "0.7504876",
"text": "def columns\n @columns || set_columns(dataset.naked.columns)\n end",
"title": ""
}
] | [
{
"docid": "5cdaa3d0ad18f673e7c77ad52f6b1e8d",
"score": "0.7773586",
"text": "def columns!\n ds = clone(opts.merge(:sql => \"SELECT TOP 1 [T1].* FROM (#{opts[:sql]}) \\\"T1\\\"\"))\n ds.each{break}\n\n if cols = ds.cache[:_columns]\n self.columns = cols\n else\n ... |
c09a92e052317ec21464d0828e219c12 | Method called via Gosu. If the escape key is pressed, then the window closes. | [
{
"docid": "4d8454d43e4a054c00a96f9e1875494a",
"score": "0.65559846",
"text": "def button_down id\n close if id == Gosu::KbEscape\n end",
"title": ""
}
] | [
{
"docid": "0cdcdc3a11adcd5d73e7406c1807147f",
"score": "0.74883497",
"text": "def exit\n @window.pause = true\n @window.close\n end",
"title": ""
},
{
"docid": "0cdcdc3a11adcd5d73e7406c1807147f",
"score": "0.74883497",
"text": "def exit\n @window.pause = true\n @window.... |
6f50225c0d3a395c7d5f02439fe670a8 | PATCH/PUT /konfirmasi_displays/1 PATCH/PUT /konfirmasi_displays/1.json | [
{
"docid": "6aaffaf789f63839bc394de53861f2f0",
"score": "0.7281202",
"text": "def update\n respond_to do |format|\n if @konfirmasi_display.update(konfirmasi_display_params)\n format.html { redirect_to @konfirmasi_display, notice: 'Konfirmasi display was successfully updated.' }\n f... | [
{
"docid": "3aac470ee6146dfaf1c143bad9331be8",
"score": "0.65251327",
"text": "def update\n respond_to do |format|\n if @konfirmasi.update(konfirmasi_params)\n format.html { redirect_to @konfirmasi, notice: 'Konfirmasi was successfully updated.' }\n format.json { render :show, stat... |
4742af0e46fea82e9081a30fa4910fbf | Provides the string with all options for display | [
{
"docid": "422f21f29681dd8078f2b43045fd74b1",
"score": "0.7385705",
"text": "def get_curr_options_string\r\n res = []\r\n @curr_game_opt[:opt].each do |k,v|\r\n valore = v[:val]\r\n valore = \"Si\" if valore == true\r\n valore = \"No\" if valore == false\r\n res << \" #{v[:nam... | [
{
"docid": "a570bb573d72148f9e4627bcc91b8ff1",
"score": "0.8152952",
"text": "def options_text\n options\n end",
"title": ""
},
{
"docid": "286e945d0ee88fbd1d729868808466a0",
"score": "0.81362885",
"text": "def display_string\n long_str = \"\"\n @options.each_with_i... |
67bd40f047fb82b3b5039617363703d8 | PATCH/PUT /ois/1 PATCH/PUT /ois/1.json | [
{
"docid": "f9848937f6eb74af16bd3296bdb1371d",
"score": "0.58775556",
"text": "def update\n respond_to do |format|\n if @oi.update(oi_params)\n format.html { redirect_to @oi, notice: 'Oi was successfully updated.' } \n else\n render :edit \n end\n end\n end",
"tit... | [
{
"docid": "4e0e59715d19dce2a47fccc2c67326dd",
"score": "0.66862315",
"text": "def patch!\n request! :patch\n end",
"title": ""
},
{
"docid": "8d6a61f3186174209e44862cb0ae05d7",
"score": "0.65718037",
"text": "def patch\n headers = {\"If-Match\" => @version}\n response ... |
0a402b8088da0ab2de6f45417ddb5a43 | True if the user filled in value is a rebus | [
{
"docid": "ea3e35ba8aa08be79fab79f528903deb",
"score": "0.71473587",
"text": "def rebus_fill?\n rebus_value?(fill)\n end",
"title": ""
}
] | [
{
"docid": "c782f00bf4587410b174666e6ac54431",
"score": "0.7009583",
"text": "def rebus_value?(v)\n v && v.size > 1\n end",
"title": ""
},
{
"docid": "4dce9289d533e49607b2c1bdfc35ce6e",
"score": "0.68520373",
"text": "def in_us1?\n self.nro_remision.to_s == \"\"\n end",
... |
afed7ce2f736a457799753c082f6e46c | Yields this instance to block. Use RS.start. | [
{
"docid": "bd327e13490740871b2b407dfed3112d",
"score": "0.7403113",
"text": "def run()\n yield self\n end",
"title": ""
}
] | [
{
"docid": "8d80de9271b2a318c549227af9200ee4",
"score": "0.76952183",
"text": "def run\n start\n yield self\n ensure\n stop\n end",
"title": ""
},
{
"docid": "237eb1696f54d6480044e46e07017906",
"score": "0.70094687",
"text": "def loop\n yield(self) while sel... |
c66f8835c724c5b51c54aa43f29cb94a | Utilities for manipulating instance variables in synchrony. | [
{
"docid": "ffaf1c792c9ca0d00e98535e6488d9c1",
"score": "0.0",
"text": "def link_in(active_record)\n assert(@active_records.has_key?(active_record.job) == false)\n assert(@all_records.record_with_id(active_record.persistent_id).nil?)\n @active_records[active_record.job] = active_rec... | [
{
"docid": "8b1a703dc1d7361c4ccf5390bb486182",
"score": "0.67344826",
"text": "def instance_var\r\n @instance_var = @local_var\r\n end",
"title": ""
},
{
"docid": "1b3be412f0b2a62060170e9c5f94e5c1",
"score": "0.6594538",
"text": "def sync=(*) end",
"title": ""
},
{
"d... |
14c55d0c56802743dc5b8eadeb1f2cfb | DELETE /reviews/1 DELETE /reviews/1.json | [
{
"docid": "8667b8b7f9dc231520b2cff9d25ac75b",
"score": "0.0",
"text": "def destroy\n @review.destroy\n respond_to do |format|\n format.html { redirect_to controller: 'plans', action: 'show', id: @plan.id, notice: 'Review was successfully destroyed.' }\n format.json { head :no_content }\... | [
{
"docid": "5ba0dedae2c3b9d3a8a58b468d3d130c",
"score": "0.7783508",
"text": "def destroy\n @review = Review.find(params[:id])\n @review.destroy\n\n respond_to do |format|\n format.html { redirect_to reviews_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "1081c26b94f9d4889507f1fedbfceb16",
"score": "0.0",
"text": "def payment_params\n params.require(:payment).permit(:user_id, :project_id, :payment_system_id, :amount, :currency, :status_id)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7498391",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6958937",
"text": "def strong_params\n params.require(:request).permit(param_white... |
a3e369441b1559921a1f541071d1c8d1 | POST /rblogs POST /rblogs.json | [
{
"docid": "346dd1807cc955f2b335859032c54f2e",
"score": "0.62068796",
"text": "def create\n authorize_action_for Rblog\n @rblog = Rblog.new(rblog_params)\n @rblog.writer = current_user\n\n respond_to do |format|\n if @rblog.save\n format.html { redirect_to @rblog, notice: 'Rblog ... | [
{
"docid": "e2f6b610107effa2a185a79573b9e81a",
"score": "0.6832274",
"text": "def create\n # If the request body contains a single log (request body is not an array)\n if ( !JSON.parse(request.body.read).is_a?(Array) )\n log_data = JSON.parse(request.body.read)\n status, log = cr... |
245d10fd0371e4c4f2c2311f5f1ad439 | accounting date on accrual basis (order placed not necessarily paid) for polymorphism | [
{
"docid": "293a76de2deaa33d3e85f9076b00a71d",
"score": "0.7024306",
"text": "def accounting_date()\n return cash_date()\n end",
"title": ""
}
] | [
{
"docid": "b15b237a47072311e9ca39a2c4dc21a1",
"score": "0.6460121",
"text": "def date_accounting(date, date_accounting)\n return date unless date_accounting\n\n if date.month == 1 && date_accounting[0..1] == \"12\"\n year = date.year - 1\n else\n year = date.year\n end... |
269f6293b8c0fa9432e91d5afc9a2363 | GET /test_comments GET /test_comments.json | [
{
"docid": "b89151f819657159cbf15885ce770dcd",
"score": "0.70160335",
"text": "def index\n @test_comments = TestComment.all\n end",
"title": ""
}
] | [
{
"docid": "934b852e3aa55b01ef52fac23c4b87b5",
"score": "0.7274069",
"text": "def get_comments\n url = params[:ifq_url]\n \n comments_id = get_comments_id(url) \n unparsed_comments = get_unparsed_comments(comments_id)\n comments = parse_comments(unparsed_comments)\n respond_to do |f... |
351554be8a2e7534ab8bc7bb0791686c | define the subject line for alerts sent to the user | [
{
"docid": "2a08bdc3ab763b345844f43a4ccf4b62",
"score": "0.0",
"text": "def alert_subject\n if @in_effect == true\n message = \"Seasonal parking ban issued from the city!\"\n else\n message = \"Seasonal parking ban retracted from the city!\"\n end\n end",
"title": ""
}
] | [
{
"docid": "dc0e2948b8652d7848b464a5ec15a020",
"score": "0.6966741",
"text": "def subject(string)\n self << \"SUBJECT\" << string\n end",
"title": ""
},
{
"docid": "a1179e39288e26836f33134c481774a5",
"score": "0.66634023",
"text": "def alert_subject\n \"Time to take your B... |
e565d5cfcf345846006fd4958275cf0a | Bar sprites creation background_bitmap: bitmap for empty back bar foreground_bitmap: bitmap for bar sprite | [
{
"docid": "e3d1917f55c09b41b2613a41757295c6",
"score": "0.8019292",
"text": "def create_sprites(background_bitmap, foreground_bitmap)\n @background = Sprite.new\n @mid_bar = Sprite.new\n @foreground = Sprite.new\n @background.bitmap = background_bitmap\n @mid_bar.bitmap = mid_bitmap\n ... | [
{
"docid": "912d899b5c17d7890f245dd6d372f0a3",
"score": "0.76618785",
"text": "def create_bar(update)\n @bar.bitmap.clear if update #pulisci se si deve agg.\n bitmap = Bitmap.new(1,@lb)\n @color = $game_system.generic_bar_settings(@bar_name)[5]\n bitmap.fill_rect(0,0,1,... |
84cca2879df95811ad0fb40694cea275 | Replace a child of this value. CAUTION if replacement is null, delete the child, which may also delete the parent, or make the parent into a noncontainer. | [
{
"docid": "e89b0e21bce6cd2a6a2f884809896097",
"score": "0.7175189",
"text": "def replace_child(child, replacement)\n raise Hocon::ConfigError::ConfigBugOrBrokenError, \"subclasses of `Container` must implement `replace_child` (#{self.class})\"\n end",
"title": ""
}
] | [
{
"docid": "4f07124644eb1d04c34d661e95bcf25d",
"score": "0.79134613",
"text": "def replace_with( child )\n @parent.replace_child( self, child )\n self\n end",
"title": ""
},
{
"docid": "1a858d2a35e4bc8ab0cad4b8bf399ef9",
"score": "0.7870297",
"text": "def replace_child( ... |
027898de84033f5649055328717c5ffb | Display name used by Alfalfa | [
{
"docid": "b160b47c7f01d665eb547fc273ac12b2",
"score": "0.78546506",
"text": "def display_name\n @hash['display_name']\n end",
"title": ""
}
] | [
{
"docid": "6e9ee22da6c76e946ed08a7627a916cd",
"score": "0.82691014",
"text": "def display_name\n name\n end",
"title": ""
},
{
"docid": "6e9ee22da6c76e946ed08a7627a916cd",
"score": "0.82691014",
"text": "def display_name\n name\n end",
"title": ""
},
{
"d... |
4ff7a3b3ed36a348cee5341f2c288637 | DELETE /sub_collection_images/1 DELETE /sub_collection_images/1.json | [
{
"docid": "b69d8f3a5e56cf4335b5e927b8eabc60",
"score": "0.79724056",
"text": "def destroy\n @sub_collection_image.destroy\n respond_to do |format|\n format.html { redirect_to sub_collection_images_url, notice: 'Sub collection image was successfully destroyed.' }\n format.json { head :no... | [
{
"docid": "e0d5a0eeed8c6c73ae200a9436de9052",
"score": "0.77512836",
"text": "def delete_image\n if request.post? == false\n render :json => { :message => \"Error\" }\n return\n end\n image = Image.new\n image.byId( params[ :image_id ] )\n collection = Collection.new\n colle... |
a2a1c8ca5cf7429195eb30ab4ab4f31a | Changes the Serializer from the default. Returns self to accommodate method chaining. | [
{
"docid": "1b82017be339482af727786473ecd707",
"score": "0.71685165",
"text": "def with_serializer(serializer)\n @serializer = serializer\n self\n end",
"title": ""
}
] | [
{
"docid": "3697883c630fcfd0e2d0a206593c552f",
"score": "0.64952856",
"text": "def serializers\n self._additional_serializers # standard:disable Style/RedundantSelf\n end",
"title": ""
},
{
"docid": "4faaa286d77dae1a54c2fedb82d6af85",
"score": "0.6472357",
"text": "def se... |
d146e68ef84bc1593bc71d39706f1479 | Executes a command on the virtual machine and returns a Result object that may be used to retrieve the output or return code. | [
{
"docid": "30317c2ab018eae6c793628c8b211ea8",
"score": "0.0",
"text": "def execute(command, live_stream = false)\n machine = @chef_provisioning.connect_to_machine(name, @current_chef_server)\n machine.execute_always(command, stream: live_stream)\n end",
"title": ""
}
] | [
{
"docid": "7e478157a0bdb678b1f349b2d80b758e",
"score": "0.69753677",
"text": "def remote_command(type, command, options)\n # If the VM is not running, then we can't run SSH commands...\n raise Errors::VMNotRunningError if @vm.state != :running\n\n # Initialize the result object, ex... |
22a174639091467957a65fcaaa483632 | Attempt to clean up the project following the push. Warning: this is destructive! path is the path of an upload of a BFG object map file. It contains a line per rewritten object, with the old and new SHAs spaceseparated. It can be used to update or remove content that references the objects that BFG has altered | [
{
"docid": "8512614b7971288bf7964a3c9cb542d9",
"score": "0.57684416",
"text": "def execute\n apply_bfg_object_map!\n\n # Remove older objects that are no longer referenced\n GitGarbageCollectWorker.new.perform(project.id, :gc)\n\n # The cache may now be inaccurate, and holding onto i... | [
{
"docid": "4208623ff41bfe797d74f700dad3f92a",
"score": "0.64747167",
"text": "def clean(workspace_path, xcodeproj_path)\n backyard = XCBackyard::BackyardBuilder.new(xcodeproj_path)\n backyard.remove_backyard_from_workspace(workspace_path)\nend",
"title": ""
},
{
"docid": "95d7d53453ac... |
380d5d328e4bfc1d41ccedf124abba73 | Generate the repository dists | [
{
"docid": "f1107260fc783f0d0fd712ab75bd42cc",
"score": "0.678255",
"text": "def generate_dists(pkg_hash)\n pkg_hash.each do |origin_name, dists|\n dists.each do |dist_name, dist_args|\n dist_args[:components].each do |component_name, arches|\n packages = arches.v... | [
{
"docid": "1578aa1a661446cf2679ef7804412f3c",
"score": "0.58840704",
"text": "def repo_dir; end",
"title": ""
},
{
"docid": "f0a08de32a8f645c5aa3f49679e8e28c",
"score": "0.5864802",
"text": "def repositories\n # TODO : merge with current data\n load_repos\n end",
"t... |
27ad8301df7bcdd10905bfdf7fa91e72 | def deleteQueryEngine Arguments: iid: ObjectID of the RenderEngine to delete ( Long ) | [
{
"docid": "eb32fd0ef63aedcb123a1996109c071e",
"score": "0.8165606",
"text": "def deleteRenderEngine( iid )\n\n # parameter TypeCheck\n #BIMserverAPI::TypeCheck::Long( iid )\n\n # BIMserver request\n request( { iid: iid } )\n end",
"title": ""
}
] | [
{
"docid": "ad8d3cb891690b1c024e4e0a19744176",
"score": "0.8578199",
"text": "def deleteQueryEngine( iid )\n\n # parameter TypeCheck\n #BIMserverAPI::TypeCheck::Long( iid )\n\n # BIMserver request\n request( { iid: iid } )\n end",
"title": ""
},
{
"docid": "49e4d3f5a20... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "dcee152b695af9c7670ab783766d345a",
"score": "0.0",
"text": "def mascot_params\n params.require(:mascot).permit(:name, :age, :location, :description, :gender, :friendly_with_kids, :friendly_with_other_dogs, :friendly_with_cats, :species, :race)\n end",
"title": ""
}
] | [
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.7121987",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.70541996",
"text": "def expected_permitted_parameter_names; end",
"title": "... |
bc27379cd814e36c672542c5320f1745 | source and source_link are optional and saved as NULL in database if blank | [
{
"docid": "c34c64221288913559cc8f45656587b4",
"score": "0.6908472",
"text": "def convert_empty_strings_to_nil\n self.source = nil if self.source.blank?\n self.source_link = nil if self.source_link.blank?\n end",
"title": ""
}
] | [
{
"docid": "19127dc34d963e1b3c5843e61fe8e289",
"score": "0.7344903",
"text": "def clean_source \n self.source = self.source.to_url unless self.source.blank?\n end",
"title": ""
},
{
"docid": "017ab4974ab1104589f3e7f16c1a5181",
"score": "0.6734912",
"text": "def set_source_from... |
45f4757bb88f88e2aa3c0d4f6eee7a6b | Opens fake connection from proxy to transmitter. Just returns self. | [
{
"docid": "4fea3e631544510c093601f724b21351",
"score": "0.63339084",
"text": "def accept\n while true\n soc = @proxy_socket.accept\n break if (@acl ? @acl.allow_socket?(soc) : true)\n soc.close\n end\n\n if Global.show_communication\n puts \"prox... | [
{
"docid": "152752bf4cb1e7876e48f33e8071ba54",
"score": "0.64092433",
"text": "def connect_using_proxy(socket); end",
"title": ""
},
{
"docid": "08aa945864a53d6d61168fbf8b9464f0",
"score": "0.61992836",
"text": "def setup_connection\n connection = Net::HTTP::Proxy @config[:proxy... |
9d8d4b027ad92a86b602f796246cd72a | Parse dollar related values using the XPath configured | [
{
"docid": "f2095cce046bd25abc57cb913d621310",
"score": "0.0",
"text": "def parse_values(doc)\n [@blue, @official, @bolsa].each do |type|\n type.extract_values(doc)\n end\n end",
"title": ""
}
] | [
{
"docid": "556936678cf731a80add6a4d2a6766f8",
"score": "0.65134495",
"text": "def prices(parsed)\n\n crypto_prices = parsed.xpath(\"/html/body/div/div[1]/div[2]/div/div[1]/div/div[2]/div[3]/div/table/tbody/tr/td[5]/div/a\")\n \n ary_crypto_prices = []\n\n crypto_prices.each do |element|\n ... |
5a48c4c7ee9ae65e804f2662c29b50af | There should be an error if the of song is less or equal than 0 | [
{
"docid": "92736360c1a784985d1ba6944f6d9825",
"score": "0.69651717",
"text": "def should_be_wrong_on_n_album_value(wrong_song = @wrong_song)\n validate_column_errors(wrong_song, :n_album, false, 'errors.messages.greater_than', :count=>0)\n end",
"title": ""
}
] | [
{
"docid": "cadf7d8570354bbbeefe467feb1ff217",
"score": "0.66608953",
"text": "def check_song_length\n if self.length > 10 then\n self.errors.add(:length, \"is longer than 10 minutes...Calm down Free Bird.\")\n elsif self.length < 1 then\n self.errors.add(:length, \"is shorter than 1 min... |
eecfd2c62d92ce027b6621dc751ca673 | Given a story path, splits in category and story ID split("category/story") => ["category", "story"] split("category", "story") => ["category", "story"] | [
{
"docid": "f90ca97bee31603a706ed384333bcede",
"score": "0.79633033",
"text": "def split(*path) \n category = \"\"\n id = \"\"\n if path.length == 1\n path = path.first.split(\"/\")\n end\n [path.first, path.last]\n end",
"title": ""
}
] | [
{
"docid": "7f0b9a9cc08f46622e29bfc4103df0d0",
"score": "0.68438995",
"text": "def split_path(path); end",
"title": ""
},
{
"docid": "7f0b9a9cc08f46622e29bfc4103df0d0",
"score": "0.68438995",
"text": "def split_path(path); end",
"title": ""
},
{
"docid": "101868e0b7da5fcc... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "82e46cce8436d2401e2e11c4415adbb7",
"score": "0.0",
"text": "def set_group_leader\n @group_leader = GroupLeader.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60339177",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60135007",
"text": "d... |
e31af39b3de0e823035e25fc38c8ce0e | DRIVER CODE p search_array(arr, 1) returns => 3 p search_array(arr, 24) returns => nil RELEASE 1 | [
{
"docid": "eca738b624f4c567510e8d10f93d4723",
"score": "0.0",
"text": "def fib(int)\n number = [0,1]\n while number.length < int\n number << number[-2] + number[-1]\n end\n return number\nend",
"title": ""
}
] | [
{
"docid": "2e7fd1b9b783682ae917bc4b59062724",
"score": "0.8262334",
"text": "def search_array (arr, search)\n\tarr.each do {|num|\n\t\tif |num| == search\n\t\t\treturn search\n\t\telse\n\t\t\treturn nil\n\t\tend\n\t}\nend",
"title": ""
},
{
"docid": "f62c4c42011d3d79e88a5448a419243a",
"... |
de5fea86591cf4c2681925c2de78026e | Initializer with authentication and configuration parameters | [
{
"docid": "1c07a5c08dd975c5db0658b6963452ba",
"score": "0.0",
"text": "def initialize(o_auth_access_token, environment)\r\n domain = environment == 'production' ? 'rewardsciences.com' : 'rslsandbox.com'\r\n\r\n Configuration.o_auth_access_token = o_auth_access_token\r\n Configuration.bas... | [
{
"docid": "e033d2a1ccae359cb09022bb97959c12",
"score": "0.7579709",
"text": "def initialize\n @auth = { username: Rails.configuration.x.ch_endpoint.uid, password: Rails.configuration.x.ch_endpoint.pwd }\n end",
"title": ""
},
{
"docid": "a56e6868fb41cb870f3a668cb35aceba",
"score": "... |
6b9637b5d6b512c155908368ce320d05 | TODO: create other fixtures for grouping having submissions TODO:test method get_submission_used | [
{
"docid": "14b0a993a3824b99b3fe52ceca488a17",
"score": "0.0",
"text": "def setup\n setup_group_fixture_repos\n end",
"title": ""
}
] | [
{
"docid": "da897b609a60422f20e72052d95cecba",
"score": "0.7024945",
"text": "def groups_with_submissions\n Group.where(:course_instance_id => self.course_instance_id)\n .includes([:reviewers, {:group_members => :user}, {:submissions => {:reviews => :user}}])\n .where(:submissions => {:exer... |
94a52d7be3c057c3d1a15bb853453dc6 | Write a method that takes an Array of numbers and then returns the sum of the sums of each leading subsequence for that Array. You may assume that the Array always contains at least one number. Examples: | [
{
"docid": "a9cf30344f706f38ab11cfc01b440e8c",
"score": "0.0",
"text": "def sum_of_sums(array_of_int)\n result = 0\n final_index = 0\n loop do\n result += array_of_int[0..final_index].sum\n final_index += 1\n break if final_index == array_of_int.size\n end\n \n result\nend",
"title": ... | [
{
"docid": "4f633b9a25effc106296643778de9291",
"score": "0.83264226",
"text": "def sum_of_sums(array)\n \n total_sum = 0\n subsequence_sum = 0\n array.each do |num|\n subsequence_sum += num\n total_sum += subsequence_sum\n end\n total_sum\nend",
"title": ""
},
{
"docid": "3cda469... |
0ed72e2511911946b45cd993765f3022 | GET /subscribers/new GET /subscribers/new.json | [
{
"docid": "410450e0a41490a3703e5d6b7487d47e",
"score": "0.8033186",
"text": "def new\n @subscriber = Subscriber.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscriber }\n end\n end",
"title": ""
}
] | [
{
"docid": "70c024ccf65e117794d0fd9571c0a685",
"score": "0.80588835",
"text": "def new\n @breadcrumb = 'create'\n @subscriber = Subscriber.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscriber }\n end\n end",
"title"... |
7cee8f70437bec79ccf4ec0d9da0fbac | Author: Kareem Ali Description: invokes record_synonym method of the Vote class Params: synonym_id: which is the synonym id of the synonym for which the gamer is voting. Success: returns true when a vote is saved for the selected synonym Failure: returns false when the vote is not saved | [
{
"docid": "0f6dcc1e9f429928c65767cfd54730e5",
"score": "0.6963235",
"text": "def select_synonym(synonym_id)\n if Vote.record_vote(self.id,synonym_id)[0]\n return true\n else\n return false\n end\n end",
"title": ""
}
] | [
{
"docid": "6e69ef73463c9d6b7eca5c94746593a3",
"score": "0.7803594",
"text": "def record_vote\n @synonym_id=params[:synonym_id]\n end",
"title": ""
},
{
"docid": "885122469f9456fd3f574278a7abc0c3",
"score": "0.72019374",
"text": "def record_synonym\n @record_output = current_g... |
0e3bdb9429a20069852bb224adacd040 | def senders_email ["payload"]["headers"][15].fetch("value").match("(]+>)")[1].gsub("","") end | [
{
"docid": "a34babe54b1c732eb323e6040c6078dc",
"score": "0.5814511",
"text": "def from(message)\n message[\"payload\"][\"headers\"][15].fetch(\"value\").match(\"(<[^>]+>)\")[1].gsub(\"<\",\"\").gsub(\">\",\"\")\n end",
"title": ""
}
] | [
{
"docid": "9601dc54b82722654578085d96316a0b",
"score": "0.62036264",
"text": "def extract_reply(body, sender_email)\n body.strip\n .gsub(/\\n^[^\\r\\n]*#{sender_email}.*:.*\\z/m, '')\n .strip\n end",
"title": ""
},
{
"docid": "44ca2b6fb3cde302ff6fd50b8d1a97e9",
"score": "0... |
a28c90dbc00f5231b7235dd54951051e | Define a Calligraphy route that only recognizes HTTP PROPPATCH. proppatch 'bacon', to: 'foodbacon' | [
{
"docid": "3cd3da94efcc4048d1d058f7112cca23",
"score": "0.0",
"text": "def proppatch(*args, &block)\n args = web_dav_args args\n map_method :proppatch, args, &block\n end",
"title": ""
}
] | [
{
"docid": "4e962e401504aa7d0ba3e8890b5f486f",
"score": "0.58927184",
"text": "def route\n #TODO\n end",
"title": ""
},
{
"docid": "d17909487dcf3656933e62d4bd9d7684",
"score": "0.57490194",
"text": "def route() request.route end",
"title": ""
},
{
"docid": "564a69... |
1cfd1028961762a9a1d977528fbeea77 | Authentication Failure Renders a 401 error | [
{
"docid": "ffc2fc7011aeb58b0d44dbf2a29ccbd2",
"score": "0.76342016",
"text": "def authenticate_error\n render \\\n json: { message: t('devise.failure.unauthenticated') },\n status: :unauthorized\n end",
"title": ""
}
] | [
{
"docid": "15237f51eb93033472bfb090d58433e2",
"score": "0.838106",
"text": "def invalid_authentication\n render_error(401, 'Authorize Error', 'Unauthorized')\n end",
"title": ""
},
{
"docid": "ac37888c4a696b644280cef41a3f539f",
"score": "0.8348645",
"text": "def render_faile... |
c334c8a27b65c4475310728fad843175 | Returns the image gallery's year. | [
{
"docid": "7528f34e57e0205fc820ccd9fa4f7b52",
"score": "0.831871",
"text": "def gallery_year(gallery)\n gallery.identifier[8..11]\nend",
"title": ""
}
] | [
{
"docid": "6f5e05a616de92f0c5ae9b9ed27b3fd8",
"score": "0.77469397",
"text": "def year\n @year ||= details.at(\"h1.header a[href^='/year/']\").text.parse_year rescue nil\n end",
"title": ""
},
{
"docid": "f15a39a8dc93ee4bd6eeaf2f0a185c5e",
"score": "0.751727",
"text": "def y... |
ec9dc8cad1e412a1337346a1edaed374 | PATCH/PUT /last_data/1 PATCH/PUT /last_data/1.json | [
{
"docid": "b57c52ea44dafbed763f5baa90bbdb67",
"score": "0.647565",
"text": "def update\n if @last_datum.update(datum_params)\n render json: @last_datum\n else\n render json: @last_datum.errors, status: :unprocessable_entity\n end\n head :no_content\n end",
"title": ""
}
] | [
{
"docid": "ae4d0aa8335fe571a4fcc90ded621164",
"score": "0.61730975",
"text": "def do_update_Json(data, *rest)\n obj, res = REST.put(\"#{self.class.path}/#{id}\",data)\n maybe_json_die(obj,res)\n @blob = obj\n self\n end",
"title": ""
},
{
"docid": "ae4d0aa8335fe571a4fcc90ded621... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "1b548060f955cd44bb768014e440402d",
"score": "0.0",
"text": "def user_message_params\n params.require(:user_message).permit(:result)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.79428834",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.6957111",
"text": "def permitted_params\n params.permit!\n end",
"title"... |
7e0a3f8d9ad925802c0d7428b8319be1 | Set the value for a given key and optionally with an expire time Default expiry time is 86400. | [
{
"docid": "62f63a1ab9a2ffe909e20d7ae6602dc9",
"score": "0.0",
"text": "def set(key, value, opts = nil)\n warn opts ? 'cache.set(key, value, opts) has been deprecated in favour of cache.store(key, value, opts)' :\n 'cache.set(key, value) has been deprecated in favour of cache[key] = valu... | [
{
"docid": "6e4131a43034ae940a81259accf20eab",
"score": "0.8376534",
"text": "def set(key, value, expires_in = 0)\n\n end",
"title": ""
},
{
"docid": "ccd360d29638aedff7478f2e968bf305",
"score": "0.8127241",
"text": "def set(key, value, expiry_time = nil)\n do_with_logging(:set... |
be4ccb7e244f52a2cc9f5bcc2798c4c4 | retrive method. This just simplify usage of the class. | [
{
"docid": "a90de23c96815312e56c959c6c908ca4",
"score": "0.0",
"text": "def retrieve(nb)\n connect\n find(nb)\n filter!\n end",
"title": ""
}
] | [
{
"docid": "72feecf48bb43ccc76c9ceba10bf782a",
"score": "0.7736926",
"text": "def retrieve\n # TODO\n end",
"title": ""
},
{
"docid": "72feecf48bb43ccc76c9ceba10bf782a",
"score": "0.7736926",
"text": "def retrieve\n # TODO\n end",
"title": ""
},
... |
67e5a382b4675244b05de42dab039b1c | Send email with with delay or schedule Send an email using a delay. Will place the email onto a scheduler that will then be processed and sent. Use delays to schedule email sending. | [
{
"docid": "3df629644042088b7fe18ada1c56c502",
"score": "0.0",
"text": "def send_with_schedule_with_http_info(inbox_id, send_email_options, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: InboxControllerApi.send_with_schedule ...'\n end\n ... | [
{
"docid": "90888689eab4f7ec804a9257094adb51",
"score": "0.72377",
"text": "def send_delay_email\n PatientMailer.appointment_delayed_email(patient,\n appointment_delayed_time).deliver_later\n end",
"title": ""
},
{
"docid": "e9a2ff06de53e5b286398a5... |
e561e11bcf379ef5dc139c210017366b | Only allow a list of trusted parameters through. | [
{
"docid": "ddc5286a1f97952b758a84da855fbfac",
"score": "0.0",
"text": "def panier_params\n params.require(:panier).permit(:name)\n end",
"title": ""
}
] | [
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.69497335",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6812623",
"text": "def strong_params\n params.require(:listing_member).permi... |
e5424f5c96be2214c5183393f13fbbf2 | Returns a new Value with all string values converted according to the given filter(s). | [
{
"docid": "f801a53c1dff758445d83b67acb06570",
"score": "0.60436916",
"text": "def convert (*filters)\n dup.convert!(*filters)\n end",
"title": ""
}
] | [
{
"docid": "083b679d5a6fd21514eb4661778b2a57",
"score": "0.63086003",
"text": "def filters_conversion(message)\n if message[:filter]\n message[:filter] = message[:filter].join(' ')\n end\n if message[:filterNeg]\n message[:filterNeg] = message[:filterNeg].join(' ')\n end\n\n ret... |
fdcda618e833a4aefe1acded97b82144 | Given EC2 host and ELB data, construct unqualified DNS entries to make a zone, of sorts. | [
{
"docid": "2241150693616580665211b9840afb89",
"score": "0.7226393",
"text": "def zone(hosts, elbs)\n host_records = hosts.map do |id,info|\n name = \"#{id}.inst.\"\n priv = \"#{info[:priv]}.priv.\"\n [ Zonify::RR.cname(name, info[:dns], 86400), # Long TTLs for host records.\n Zonify::RR.... | [
{
"docid": "e52537b99857a6bf04072902c54b77c2",
"score": "0.63879627",
"text": "def zone(hosts)\n host_records = hosts.map do |id,info|\n name = \"#{id}.inst.\"\n priv = \"#{info[:priv]}.priv.\"\n [ Zonify::RR.cname(name, info[:dns], '600') ] +\n info[:tags].map do |tag|\n k, v = tag\n ... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "0c0ae57f2506d91729ed31436a63c514",
"score": "0.0",
"text": "def chat_params\n params[:first_user_id] = @user.id\n params[:second_user_id] = params[:user_id]\n params.permit(:first_user_id, :second_user_id)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7943618",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.69572574",
"text": "def permitted_params\n params.permit!\n end",
"title"... |
34a94a7566808c1eb0c04ed0ac834dd5 | Public: Loads the configuration file omniauthmayday.yml If it's a rails application it will take the file from the config/ directory env Environment. Returns a Config object. | [
{
"docid": "1beceb78f24e801ea724787406354416",
"score": "0.7370038",
"text": "def initialize env = nil\n if env\n # For non-rails apps\n @config_filepath = File.join(File.dirname(__FILE__), \"..\", \"..\", \"config\", \"omniauth-mayday.yml\")\n load(env)\n else\n... | [
{
"docid": "4313414630a15c8922bc718c5f5e5de5",
"score": "0.67897093",
"text": "def load_config\n conf = YAML.load_file(File.expand_path('../config.yml', File.dirname(__FILE__)))\n\n unless %w[basedir master filesync_cert filesync_cert_key filesync_ca_cert].all? { |s| conf.key?(s) && !conf[s].nil? ... |
1051f470088562981570ce8a3161be2e | Extra methods create notification | [
{
"docid": "6f2850447a7fce0b884ef8cf6162c74f",
"score": "0.7179777",
"text": "def create_notification\n \tNotification.create(:from_id => self.person.id, :job_id => self.id)\n end",
"title": ""
}
] | [
{
"docid": "8302487dfb3dc53b6391ebb0ae6fdaad",
"score": "0.87598073",
"text": "def create_notification; end",
"title": ""
},
{
"docid": "703df1814bb211ad806d667849368c7d",
"score": "0.7688276",
"text": "def message(notification); end",
"title": ""
},
{
"docid": "703df1814... |
25820c5dd9b2c5200611d4c579afd376 | DELETE /resposts/1 DELETE /resposts/1.json | [
{
"docid": "5d08db133e64d9c0ced957890a59470a",
"score": "0.74579567",
"text": "def destroy\n @respost.destroy\n respond_to do |format|\n format.html { redirect_to resposts_url, notice: 'Respost was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title... | [
{
"docid": "174b723f9e43bfa7501a9cdc389e4c1b",
"score": "0.74418014",
"text": "def delete\n @response = self.class.delete(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end",
"title": ""
},
{
"docid": "b1a17c1ee1af05c79fe156622df44818",
"score": "0.73109365",
"text": "def... |
05394dadbc388a0e0a218df3a5e28006 | Uses pry extension/gem to enter an interactive console when an exception happens so that we can inspect things. Uses 'exit' to continue. | [
{
"docid": "1226a48a2834dda61ad7d219166376fb",
"score": "0.0",
"text": "def debug_block \n begin\n yield\n rescue Exception => e\n binding.pry\n end\n end",
"title": ""
}
] | [
{
"docid": "9b31e0c3c00dc47eaf417c17cb40466b",
"score": "0.71401644",
"text": "def console\n require 'pry'\n binding.pry\n exit(0)\n end",
"title": ""
},
{
"docid": "5d2ff666d83d0459abebf954600fba01",
"score": "0.6833164",
"text": "def go_to_exit\n puts \"Byebye!\"... |
4fa991571e849b087a21917ae7c055e4 | Place player on paternity list | [
{
"docid": "400114f7d8e25322ce15a14dd1d3b138",
"score": "0.0",
"text": "def to_paternity_list(start_date=Date.today, reason=\"Placed on paternity list\")\n\t\treturn false if on_paternity?\n\t\tdeactivate(3, start_date, reason)\n\t\tupdate({on_paternity: true})\n\tend",
"title": ""
}
] | [
{
"docid": "bc7f9151e8328a537c09997e31e0316e",
"score": "0.68178797",
"text": "def place_player(position)\n @board[position-1].place_player\n end",
"title": ""
},
{
"docid": "9556ef1b17d9d9fc7dffe21a6f6d72de",
"score": "0.6702804",
"text": "def place_players_on_grid\n set_pc_p... |