query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
37c362299e0321b1371592be71bfbd12 | write a method that accepts two parameters: title and rating the method should print the story title and the rating out of ten | [
{
"docid": "ec9210d8dbe180d459d778e8fcf62674",
"score": "0.72958857",
"text": "def print_title_and_rating(x, y)\n\tputs \"Movie title #{x} rating #{y}\"\nend",
"title": ""
}
] | [
{
"docid": "ccb750e9fbf91d9b87619f153d9cc445",
"score": "0.85719764",
"text": "def display_story(title, rating)\n\n#the method should print the story title and the rating out of ten\n puts \"#{title} Rating #{rating} out of 10\"\n\nend",
"title": ""
},
{
"docid": "f07b6d6bebad42ee31fd606a99... |
391849e455c73b0b2ecb0b83d80a9f73 | open new file 'a+': writing on existing file , if not exist create one | [
{
"docid": "b41a8721fd134d138ab6d1a859bdaaff",
"score": "0.0",
"text": "def newLogFile(theResult)\r\n currentTime = Time.now.strftime(\"%Y-%m-%d\").to_s # format by date only \r\n fileName = 'testResult' +currentTime + '.txt'\r\n f = File.open(fileName , 'a+')\r\n f.puts \"IMDB sear... | [
{
"docid": "5eebd86cd1fda46eb46e26051f94c12c",
"score": "0.7228831",
"text": "def create_file(file_created)\n file = File.new(file_created,\"a+\") \n file.close\n end",
"title": ""
},
{
"docid": "f00b7a2d21268ca7038fa11166a80578",
"score": "0.71677047",
"text": "def append_f... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "bb405d1f93b2d07b7d3e741e55a03f28",
"score": "0.0",
"text": "def set_cautelaacessorio\n @cautelaacessorio = Cautelaacessorio.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... |
3a6edf90b9470957778180bac233a4aa | Establecemos el valor del atributo flight_time de la tabla flight_sheets. Este atribuo representa el tiempo que duro un determinado vuelo | [
{
"docid": "80cb579d1bfeaf296f9add398d9196c6",
"score": "0.6413317",
"text": "def set_flight_time\n self.flight_time = (arrival_time-departure_time) / 1.hour\n end",
"title": ""
}
] | [
{
"docid": "060af26d13b8e81c14655aeb9491cd0a",
"score": "0.6177574",
"text": "def flight_time_params\n params.require(:flight_time).permit(:flight, :time)\n end",
"title": ""
},
{
"docid": "1622fda7d8c978ae9a4df2d5b2a27e73",
"score": "0.6172537",
"text": "def set_flight_time\... |
151d6b111579b351fa602011f0e250f5 | initializes the snippet in generate mode | [
{
"docid": "320c16eb2e940d5e4dc282bccdf2f8ca",
"score": "0.638541",
"text": "def initialize_generate\n super\n add_accessors\n declare_guardfile\n declare_chefignore_patterns\n end",
"title": ""
}
] | [
{
"docid": "1f72c3319019fd6649b6ac26d4984ba4",
"score": "0.6346321",
"text": "def initialize_generate\n super\n add_accessors\n declare_chefignore\n declare_gitignore\n end",
"title": ""
},
{
"docid": "24944ecb59d5d512b5f99a20574faf39",
"score": "0.634560... |
3ed38d9b4caf19c60d924e6dbc507d38 | Determine the profit from currency trade. Eg: The base currency of USD, when traded to EUR one day and increases in value for the next day, when traded back to USD on the next day would yield a $0.02 profit. | [
{
"docid": "cf71f111d92c9f09ae7aa92d5a23d6c3",
"score": "0.6403385",
"text": "def profit_in_trade(earlier_conversion, later_conversion)\n best_currency = self.best_currency(earlier_conversion, later_conversion)\n early_amount_currency = earlier_conversion.convert(earlier_conversion.source_currency... | [
{
"docid": "af8234eefdb449928db89d55debb1d11",
"score": "0.73975176",
"text": "def profit\n profit = 0\n if self.is_open?\n if market_value != position_cost\n return (self.is_buy? ? 1 : -1) * (market_value - position_cost)\n else\n return 0\n end\n else\n self.... |
e3f48b4c8136776edc534b8103cd5d3b | GET /matrices GET /matrices.json | [
{
"docid": "ed95816922dd6c9156ce5c0fc8d642c0",
"score": "0.53664255",
"text": "def index\n @matrices = Matrix.all\n @drinks = Drink.all\n end",
"title": ""
}
] | [
{
"docid": "bc148cf7681d2dcf530a85c5def90691",
"score": "0.72825336",
"text": "def index\r\n @matrices = Matrix.all\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n #format.json { render json: @matrices }\r\n format.json { render json: Matrix.tokens(params[:q]) }\r\n ... |
5ee8fbd204983ef55976d4242b9fb6f5 | This function stops the tastynoodles daemon | [
{
"docid": "6be96c1d19652b31c97e2a8b9f5e4446",
"score": "0.0",
"text": "def stop\n Process.kill(\"SIGTERM\", read_pid.to_i)\n File.open(\"./status\", \"w\") { |f| f.write \"Not tasty.\\n\" }\nend",
"title": ""
}
] | [
{
"docid": "e0cc1ec690b9c0b2118fd9469cdb87ed",
"score": "0.7497313",
"text": "def stop\n @t.kill if @t && @t.alive?\n end",
"title": ""
},
{
"docid": "02f9edc1a6af3201b9954723591d827c",
"score": "0.71765375",
"text": "def stop\n server.kill\n end",
"title": ""
}... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "14bc58f603b8302339f91f2d1962945e",
"score": "0.0",
"text": "def set_block\n @block = Block.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... |
dbdfc1edcad6b6ddeecc9b5274d5bdd3 | after_create: friend_request gets duplicated on respondee's end with an inverted user id and recieved: true. | [
{
"docid": "42db790aaedac52992b26abbf7232043",
"score": "0.0",
"text": "def destroy_other\n inverses.destroy_all \n end",
"title": ""
}
] | [
{
"docid": "abb43c76d24b79644b119fc5aa176076",
"score": "0.69690144",
"text": "def create\n @sender = User.find(params[:user])\n @reciever = User.find(params[:friend])\n\n reverse_pair = check_reverse_pair(@reciever, @sender)\n if reverse_pair.empty?\n @friend_request = @sender.friendsh... |
c6b60c5e174583f1fe16c386da773806 | The sample variance of the data | [
{
"docid": "1e7b16d0072b8e8151670031b725a443",
"score": "0.6822675",
"text": "def sample_variance\n @mutex.synchronize do\n @M_2 / (@items - 1)\n end\n end",
"title": ""
}
] | [
{
"docid": "3106896931bfb647c0cc3669ba0cbb07",
"score": "0.87313086",
"text": "def variance(sample = false)\n a = numerify\n avg = a.average\n sum = a.inject(0) { |sum, value| sum + (value - avg) ** 2}\n (1 / (a.length.to_f - (sample ? 1 : 0)) * sum)\n end",
"title": ""
},
... |
adc8529d7bbf68e8ef4a5a42ee019d72 | GET /facebook GET /facebook.json GET /facebook.xml | [
{
"docid": "063a0b80a8ee5d423e1c720b7aae7c87",
"score": "0.6618637",
"text": "def index\n @facebook_posts = FacebookPost.order(@order).paginate(@page)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @facebook_posts, callback: params[:callback] }\n ... | [
{
"docid": "e2919c6ad37ba08bce3f1c599e9721bb",
"score": "0.7243954",
"text": "def facebookGraphConnection\n friend_json = HTTParty.get(\"http://graph.facebook.com/#{input_username}\")\n return friend_json\nend",
"title": ""
},
{
"docid": "26b3de7f7326d2d28596ffa7aa76fcb1",
"score": "0.... |
22813b0c605d72ee56b56a47d49e45ba | GET /external_otrunk_activities/1 GET /external_otrunk_activities/1.xml | [
{
"docid": "44ae68d1b3134bcb20598b0d42c228eb",
"score": "0.674956",
"text": "def show\n exceptions = []\n if params[:except]\n exceptions = params[:except].split(\",\")\n end\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @external_otrunk_ac... | [
{
"docid": "e5cc5ff8d6a5a1cc84a1e02b5e14abe8",
"score": "0.64398515",
"text": "def show\n @activity = @response.activities.find(params[:id])\n # was @activity = Activity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @activity... |
7f4b0337affc255e7d28de777831aec5 | HEADS UP : Use .count("DISTINCT projects.id") if you need count of these projects. if not it will give wrong value. | [
{
"docid": "0fe13e830abbbb6db06c95d1d5304b8a",
"score": "0.0",
"text": "def self_and_managing_projects\n # Projects the user created.\n # +\n # Role Application Approved (Since this incorporates Managers As Well) - Updated to not show DRAFT Status Projects\n Project.\n joins( \"LEFT OUT... | [
{
"docid": "bd4a612781f324328c79e6456af83a9a",
"score": "0.7708261",
"text": "def project_count\n @project_count ||= attributes['project_count'] \n @project_count ||= self.projects.count\n end",
"title": ""
},
{
"docid": "450811e452f4ea0dfb3822672015b811",
"score": "0.76523215",
... |
43552c69b73d9fcc4af09ceef00f98c4 | Get graph image uri | [
{
"docid": "9b7b072df5db0edd06aec4efc5741653",
"score": "0.0",
"text": "def get_graph_uri(path, params = nil)\n params ||= {}\n params = preprocess_time_params(params) unless params.empty?\n \"#{@base_uris[id(path)]}/graph/#{uri_escape(service_name(path))}/#{uri_escape(section_name(path))... | [
{
"docid": "da7a6241575daacd12abbeb85a2b8fce",
"score": "0.72122675",
"text": "def image_url\n @image_url ||= \"#{text_from_node('icon_url_base')}#{text_from_node('icon_url_name')}\"\n end",
"title": ""
},
{
"docid": "ade1359afd491c3fe2f10ecc40b9c7e4",
"score": "0.7122234",
"... |
a9f3b7f203638cc836a9cc950c78fd18 | set building and system type | [
{
"docid": "a790ff557aae6adaa751d7c9fb0f9576",
"score": "0.6327768",
"text": "def set_bldg_and_system_type(occupancy_classification, total_floor_area, total_number_floors, raise_exception)\n # DOE Prototype building types:from openstudio-standards/lib/openstudio-standards/prototypes/common/prototyp... | [
{
"docid": "6232dd9c7c54eedc45ad0990398517df",
"score": "0.7444563",
"text": "def set_bldg_and_system_type_for_building_and_section\n @building_sections.each(&:set_bldg_and_system_type)\n\n set_bldg_and_system_type(xget_text('OccupancyClassification'), @total_floor_area, num_stories, true)\n ... |
205add3f8d8ba70120487dfd17c6ce94 | Sets the start state. | [
{
"docid": "28e657909eff193850b41672790e90ab",
"score": "0.7991844",
"text": "def start_state= x\n @start_state = x\n if x\n @start_state.stateMachine = self\n @states.each do | s |\n s.state_type = nil if s.start_state?\n end\n x.state_type = :start\n ... | [
{
"docid": "37bd79ebd9f0d2d1de8ab0d8e6427e77",
"score": "0.78143066",
"text": "def set_start(v)\n add_state(v)\n @start = v\n end",
"title": ""
},
{
"docid": "37bd79ebd9f0d2d1de8ab0d8e6427e77",
"score": "0.78143066",
"text": "def set_start(v)\n add_state(v)\n ... |
c59195062c2a3a1d74ab33b1c663dcb9 | read all documents out of /quotes | [
{
"docid": "336ebb95ae059bec86411e09eaff692d",
"score": "0.7109118",
"text": "def couch_read_quotes(limit = 5)\n server = Couch::Server.new(Couchdb_server, Couchdb_server_port, Couchdb_user, Couchdb_password)\n response = server.get(\"#{Couchdb_db_path}/_design/quotes/_view/sortedByDate?include_do... | [
{
"docid": "5d24d703e5deda22868461c7d521b3a0",
"score": "0.6080855",
"text": "def read_quotes\n tmp_quotes = []\n f = File.open(QUOTE_FILE, 'r')\n f.each_line do |line|\n tmp_quotes << line\n end\n f.close\n return tmp_quotes\n end",
"title": "... |
630dd48857bc9ecd20cd0c8a87a94ccf | To be removed in the opensource version | [
{
"docid": "bdf86af5704f80c8bb1f8ee88db17256",
"score": "0.0",
"text": "def caricature\n self.medias.caricatures.first\n end",
"title": ""
}
] | [
{
"docid": "6ab77a9219ee157923bc58599ba6aa77",
"score": "0.7107945",
"text": "def in_use; end",
"title": ""
},
{
"docid": "6ab77a9219ee157923bc58599ba6aa77",
"score": "0.7107945",
"text": "def in_use; end",
"title": ""
},
{
"docid": "b9a1cd5a3228e8bc02063b710c7c309a",
... |
e184ba774c8b828b6a4e9e62528a8735 | Transform the value by resolving it to a foriegn key | [
{
"docid": "f5779567b91dbd816dfddd149eed4d0a",
"score": "0.57720983",
"text": "def transform(name, value, row)\n fk = @collection[value]\n unless fk\n raise ResolverError, \"Foreign key for #{value} not found and no resolver specified\" unless resolver\n raise ResolverErr... | [
{
"docid": "44ea209fc1ba12de3572973b3a664be9",
"score": "0.71801627",
"text": "def transform_key(key)\n key\n end",
"title": ""
},
{
"docid": "69b0e2e269f64aacaecfe41b5fd47976",
"score": "0.7011",
"text": "def convert(key); end",
"title": ""
},
{
"docid": "6bf... |
47e5b0f9a55e47ed6807aa14b831a2c5 | I worked on this challenge [by myself]. smallest_integer is a method that takes an array of integers as its input and returns the smallest integer in the array +list_of_nums+ is an array of integers smallest_integer(list_of_nums) should return the smallest integer in +list_of_nums+ If +list_of_nums+ is empty the method... | [
{
"docid": "20ff9181c327d32e8b43a5830914732c",
"score": "0.8387209",
"text": "def smallest_integer(list_of_nums)\n while list_of_nums.length > 1\n list_of_nums[0] > list_of_nums[1] ? list_of_nums.delete_at(0) : list_of_nums.delete_at(1)\n end\n smallest_num = list_of_nums[0]\nend",
"title": ""... | [
{
"docid": "b42c92a41c88b8cd096dea2e89b2800a",
"score": "0.89521563",
"text": "def smallest_integer(list_of_nums)\n # Pseudocode\n # return nil if array is empty\n # Otherwise, initialize current minimum as the first element of the array\n # FOR each element of the array\n # IF that element is la... |
76d0c2b9892e33cf6e54b77c955b88d8 | PATCH/PUT /api/v1/users/1 def update | [
{
"docid": "bb8de0ba717876a2c50a0ffaff23402e",
"score": "0.0",
"text": "def destroy\n @current_user.destroy\n end",
"title": ""
}
] | [
{
"docid": "e8f495dfe6f2952088c1f7d38d95f2d1",
"score": "0.8132526",
"text": "def UpdateUser params = {}\n \n APICall(path: 'users.json',method: 'PUT',payload: params.to_json)\n \n end",
"title": ""
},
{
"docid": "3a5350756037d5278aacd496c179f5be",
"score": "0.7... |
315d4e093ca4111406d84ef351bae1c7 | Searches for all matching values | [
{
"docid": "4adf309e1425213421e990362c208dbd",
"score": "0.0",
"text": "def search(opts = {})\n data, _status_code, _headers = search_with_http_info(opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "93560717edd0375ca104b2aec0e65fec",
"score": "0.7016152",
"text": "def call(searching_values)\n searching_values.all? { |word| record_attribute_values.include?(word) }\n end",
"title": ""
},
{
"docid": "8d5d9315a009f89b34a36755dcc65d66",
"score": "0.6875948",
"text": "... |
284d273b6efbedcf04f158c651ed71e4 | Add_to_list refreshes LIST for each INTERVAL when an new RIDE is being processed Update items of existing INTERVALs and create new INTERVAL if necessary | [
{
"docid": "08cb79c08b2e0713fedb34cc119c82e4",
"score": "0.68911576",
"text": "def add_to_list(new_r)\n # Other Cases\n # For each INTERVAL in LIST, update items if necessary\n # 5 cases between two INTERVALs interactions\n # Case 1. A fully cover B\n # Case 2. B partically overlap A (end... | [
{
"docid": "58ec4daad7c14a33f8d22b4d561394ea",
"score": "0.67155665",
"text": "def process_ride(ride)\n new_interval = Interval.new(Time.parse(ride.start_time), Time.parse(ride.end_time), parse_items(ride.items))\n if @list.empty? \n @list.push(new_interval)\n else \n @list = add_to_l... |
5f0027387ca0f5194d8f00625d549be9 | Updates the account balance when a transaction is updated or deleted old_value float value for the old transaction amount new_value float value for the new transaction amount, default is 0 Returns a float | [
{
"docid": "a618154372cbb93325ef6e6def24139f",
"score": "0.767928",
"text": "def update_balance(old_value, new_value = 0)\n diff = old_value - new_value\n self.balance -= diff\n end",
"title": ""
}
] | [
{
"docid": "4b1a7bba731672f8545938e1ceb9b9f1",
"score": "0.74664664",
"text": "def update_balance(new_balance)\n balance = new_balance + balance\n end",
"title": ""
},
{
"docid": "fdc83902fc03545bcbe6f9306da055a3",
"score": "0.7417153",
"text": "def update_balance\n self.trans... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "8edbc0c43d37970d9f1568a7564a3d82",
"score": "0.0",
"text": "def librarian_params\n params.require(:librarian).permit(:name, :email)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.requ... |
e67f63b0139ae53efc8bebe3a2519433 | Draw the actual game to the screen | [
{
"docid": "de70bdd08670915588c3552859d211d6",
"score": "0.0",
"text": "def draw\n nil\n end",
"title": ""
}
] | [
{
"docid": "9598f4933d6fb98a4b9f948362ed01dc",
"score": "0.83271027",
"text": "def draw_game\n @background_image.render(0, 0, 0)\n @font.draw(\"SCORE: #{@score}\", 10, 10, 5, 1, 1, 0xff_00ff00)\n @font.draw(\"FPS: #{@fps}\", (width - 80), (height - 20), 5, 1, 1, 0xff_00ff00)\n @falcon.draw\n... |
fc72174d5620e3fd0721c200a7734d49 | Responds to `DELETE /institutions/:id/favicon` | [
{
"docid": "14789bafde6150288428f699f6451df5",
"score": "0.7230666",
"text": "def remove_favicon\n @institution.delete_favicons\n rescue => e\n flash['error'] = \"#{e}\"\n else\n toast!(title: \"Image deleted\",\n message: \"The favicons have been deleted.\")\n ensure\n redire... | [
{
"docid": "90e2fe4d17f1ecf13fc72005ec720a60",
"score": "0.7944693",
"text": "def destroy\n @favicon.destroy\n respond_to do |format|\n format.html { redirect_to favicons_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7702a0c0486f6239a4b... |
0a900421a42e3d0fda61f88c56981918 | then greets that name. For example: | [
{
"docid": "5629a24c6e9d9c54e1266624bd680fab",
"score": "0.0",
"text": "def greeting(name)\n return \"Hello #{name.capitalize}!\"\nend",
"title": ""
}
] | [
{
"docid": "e9822ca2d546d18b1ff11d2d187fe85a",
"score": "0.8280128",
"text": "def greet(name)\n\tif name.downcase == \"johnny\"\n\t\treturn \"I love you\"\n\telse\n\t\treturn \"Hello\"\n\tend\nend",
"title": ""
},
{
"docid": "5dc7ec9452a38c12b485e73f03a509ec",
"score": "0.8248112",
"... |
f893d91eac3f2f2c844c95d7cfa26d9f | Display form for new record | [
{
"docid": "2c48aa34cf914b67bfa03521d182e256",
"score": "0.0",
"text": "def new\n @new_user_broker = UserBroker.new\n end",
"title": ""
}
] | [
{
"docid": "793b0cd50d331b3fe80f61f290a02b8e",
"score": "0.74290025",
"text": "def new\n # TODO prepare the form if necessary\n\n\n\n end",
"title": ""
},
{
"docid": "d88f0c9cc21d2a423e0155a892df1503",
"score": "0.7283947",
"text": "def new\n render\n end",
"title": "... |
639458ec9ca4be91d9994d92cd5ca7dc | Returns the distance from another point. The other point parameter is required to have lat and lng attributes. Valid options are: :units valid values are :miles, :kms, :or :nms (:miles is the default) :formula valid values are :flat or :sphere (:sphere is the default) | [
{
"docid": "fe4f519a4caf2954f6c529b5c9a0156a",
"score": "0.6147394",
"text": "def distance_to(other, options={})\n self.class.distance_between(self, other, options)\n end",
"title": ""
}
] | [
{
"docid": "a50299546ba0c8a9dc2f2bb60ad2a78a",
"score": "0.7443891",
"text": "def distance other, units = :km\n o = Itudes.new other\n raise ArgumentError.new \"operand must be lat-/longitudable\" if (o.latitude.nil? || o.longitude.nil?)\n\n dlat = Itudes.radians(o.latitude - @latit... |
ff7101566641920ee07d0c46d16d3089 | TODO: test for content_sync deploy Helping methods | [
{
"docid": "a0ac2ba7a2224d26d0525200e26b1f1a",
"score": "0.0",
"text": "def is_deployed(module_instance)\n version = \"\"\n\n in_directory(@project_root) do\n Rays::Core.instance.reload\n version = Rays::Project.instance.version\n end\n\n unless module_instance.type.to_sym == :serv... | [
{
"docid": "903626843dd209b0935b7ca841672b06",
"score": "0.57695806",
"text": "def helm_repo\n raise NotImplementedError, 'The derived class is expected to implement this'\n end",
"title": ""
},
{
"docid": "9b8674c520b434072d6cfd94e202d992",
"score": "0.57232755",
"text": "... |
72017d894dece3618398372064c347ee | Fix known last names that have spaces (not hyphens!) | [
{
"docid": "bceaaea67aa31aa909de7ad32735de90",
"score": "0.0",
"text": "def nbsp_in_compound_name!\n COMPOUND_NAMES.each do |compound_name|\n substitute!(compound_name, compound_name.tr(ASCII_SPACE, NONBREAKING_SPACE))\n end\n\n self # Allows chaining\n end",
"title": ""
}
] | [
{
"docid": "b4d8bb37d34f5933096af891407100c1",
"score": "0.7901694",
"text": "def format_name(first, last)\n return nil if first.empty? || last.empty?\n f = first.delete(\" \")\n l = last.delete(\" \")\n username = f[0]\n username << l\n user = username.downcase\n user.gsub(/[\\W]/, '') # this is... |
06b5583fca21aa7fc34d2aa588b795bd | GET /sellers/1 GET /sellers/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "501732842943cfa213e189373709b9e7",
"score": "0.74189126",
"text": "def show\n @seller = Seller.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @seller }\n end\n end",
"title": ""
},
{
"docid": "4d75de... |
a99d8ba1710d5e70da1273d1bc60ed85 | GET /signups/new GET /signups/new.xml | [
{
"docid": "7aa77dbd1ef3c95af9672946a3853ea2",
"score": "0.71021783",
"text": "def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @signup }\n end\n end",
"title": ""
}
] | [
{
"docid": "b4ccec9b0b9c06fcb41beff45709d5af",
"score": "0.75227326",
"text": "def new\n @signup = Signup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @signup }\n end\n end",
"title": ""
},
{
"docid": "b4ccec9b0b9c06fcb41beff4... |
99dfb550fc67a8e43284f9141b4d0bf7 | def no_admin_action_type 'no' end def data_mismatch_admin_action_type 'data_mismatch' end def document_id_issue_admin_action_type 'document_id_issue' end def selfie_issue_admin_action_type 'selfie_issue' end def residency_issue_admin_action_type 'residency_issue' end admin action type qualify type start | [
{
"docid": "669262a7a4e39574576e76bc1a0f11bf",
"score": "0.5617423",
"text": "def auto_approved_qualify_type\n \"auto_approved\"\n end",
"title": ""
}
] | [
{
"docid": "9a9862f2926db3dcf782366a2ccc9bf4",
"score": "0.6717016",
"text": "def data_mismatch_admin_action_type\n 'data_mismatch'\n end",
"title": ""
},
{
"docid": "233bee93c2167db94aa228acbf58f027",
"score": "0.65836096",
"text": "def code_action_kinds; end",
"titl... |
7aec00c9399d5b7d4ce1862e6bf01418 | Time when the object starts | [
{
"docid": "0204e8bc665d359bb9c1f3d8fa2f7ae8",
"score": "0.0",
"text": "def starting_at\n @starting_at ||= parse_or_at(@attrs[:starting_at]) if @attrs[:starting_at]\n end",
"title": ""
}
] | [
{
"docid": "e03b65c89c5cd91a2ee09ce3598463ca",
"score": "0.8092042",
"text": "def start_time\n start\n end",
"title": ""
},
{
"docid": "b1bae5370282fe70dbce93f40b712234",
"score": "0.80019337",
"text": "def start_clock\n @start_time = Time.now\n end",
"title": ""
},
{... |
6c73774b98288e711559614619a12911 | Write a program that prints a greeting message. This program should contain a method called greeting that takes a name as its parameter and returns a string. | [
{
"docid": "57960bbefcf02a584c19eeefe3ae90da",
"score": "0.0",
"text": "def greetings(name)\n puts \"Hello #{name.capitalize}\"\nend",
"title": ""
}
] | [
{
"docid": "af70bac9bf3148345e740c39da4b0b8d",
"score": "0.8355077",
"text": "def greeting(name)\n puts \"Hello #{name}, welcome to the program!\"\nend",
"title": ""
},
{
"docid": "4fc040b3c5a49fa675d94e62e05f3926",
"score": "0.8237434",
"text": "def greeting(name)\n print \"hell... |
16b4fad650a640e619d381866395a77c | If a user is not 16 and above then. | [
{
"docid": "eea70fd5e65b09b8e9f14b95080ac98b",
"score": "0.0",
"text": "def not_age\r\n font = TTY::Font.new(:doom)\r\n puts clear_term\r\n puts font.write(\"WRECKED\").colorize(:red)\r\n puts \"Sorry my dude, go get your Mum to continue..\"\r\n puts \"\\n Press any ke... | [
{
"docid": "15cb545097b7ac47fff2f15075767625",
"score": "0.6728043",
"text": "def nonbusted_users\n users.find { |u| value(u.hand(self)) <= 21 }\n end",
"title": ""
},
{
"docid": "43e2d28ca83fdc8f6794e8dcbb06691a",
"score": "0.6577639",
"text": "def check_user_count\n unless @... |
b78784651b90855f5a63fb48e09e9b19 | Cf helper for ressource form Device | [
{
"docid": "0516c7d4b34a0049b8b54d7356189a87",
"score": "0.0",
"text": "def investor\n end",
"title": ""
}
] | [
{
"docid": "ca8e56718377fe9cb419321abf23f2a0",
"score": "0.6449282",
"text": "def display_resource(device)\n \"Device ##{device.to_param}\"\n end",
"title": ""
},
{
"docid": "ab596dcec3115541aac001d912867314",
"score": "0.6268821",
"text": "def resourceType\n 'DeviceDefiniti... |
beee15ec28e810b6b1f791f1988745d1 | Converts email to all lowercase. | [
{
"docid": "4a9f54c314d699abc5fbe466f8c49cfb",
"score": "0.78732336",
"text": "def downcase_email\n\t\tself.email = email.downcase\n\tend",
"title": ""
}
] | [
{
"docid": "434a53dadeb1628ebc04d7cf7c8251af",
"score": "0.8380517",
"text": "def downcase_email\n\t email.downcase!\n\t end",
"title": ""
},
{
"docid": "61c6f9455ec34c2acd15663a017f23dc",
"score": "0.8339932",
"text": "def downcase_email\n email.downcase!\n ... |
23ff1eaa4616b7da53f026f03a560a0c | (Deprecated) Download the original documents used for income verification `/income/verification/documents/download` provides the ability to download the source documents associated with the verification. If Document Income was used, the documents will be those the user provided in Link. For Payroll Income, the most rec... | [
{
"docid": "635bae86f5217fe184c09075b66bbee2",
"score": "0.77253807",
"text": "def income_verification_documents_download(income_verification_documents_download_request, opts = {})\n data, _status_code, _headers = income_verification_documents_download_with_http_info(income_verification_documents_d... | [
{
"docid": "7e07ae519e82722677c590e4775d95c0",
"score": "0.73135835",
"text": "def income_verification_documents_download_with_http_info(income_verification_documents_download_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PlaidApi.incom... |
1e2a694a749527dd5df61b54e1b7db03 | Add a Kong ratelimiting plugin | [
{
"docid": "b786bdb6160b9053bf74d30e35f54fd7",
"score": "0.7320368",
"text": "def add_ratelimiting_plugin(apikey, consumer_id, config)\n\n url = '/apis/' + apikey + '/plugins/'\n payload = {\n name: \"rate-limiting\",\n consumer_id: consumer_id,\n config: config\... | [
{
"docid": "f06539449c56cd8c0092e290f6153f0e",
"score": "0.7150662",
"text": "def create_ratelimiting_plugin(apikey, consumer_id)\n config = settings.kong[:ratelimiting]\n response = add_ratelimiting_plugin(apikey, consumer_id, config)\n end",
"title": ""
},
{
"docid": "06bf3606... |
3e3e5494f69dc893cf0daf478d4a8311 | returns true if str_val contains the substring "shellshockscan" | [
{
"docid": "b069a70c8689c5ff7d4d41702319d5a2",
"score": "0.8466498",
"text": "def contains_shellshock_scan?(str_val)\n return (str_val.downcase.include? \"shellshock-scan\" or\n str_val.downcase.include? \"\\73\\68\\65\\6c\\6c\\73\\68\\6f\\63\\6b\\2d\\73\\63\\61\\6e\")\nend",
"title": ""
... | [
{
"docid": "9b747b15a4e55da5a7ce1ce0692a80d4",
"score": "0.7116253",
"text": "def contains_shell_code?(str_val)\n shell_strings = [\"/bin/bash\", \"/2f/62/69/6e/2f/62/61/73/68\",\n \"rm -rf\", \"/72/6d/20/2d/72/66\",\n \"{ :; }\", \"/7b/20/3a/3b/20/7d\",\n ... |
0e1f4cc501380e9da7537bb8b96a55fc | display categories in a tree options : controller => choose which controller should be bind to the tree action => choose which action should be bind to the tree | [
{
"docid": "d3f6fbc48b2fe485d0d073a8af4d9890",
"score": "0.6934625",
"text": "def display_category_tree(root, recurs = {}, options = {})\n\t\t# we retrieve data that allow the recursivity\n\t\trecurs_data = { :html => \"\", :n => 0 }\n\t\trecurs_data.update(recurs) if recurs.is_a?(Hash)\n\t\t# we retrie... | [
{
"docid": "5ebd53d80015f173adf2a85272020c21",
"score": "0.7209023",
"text": "def index\n @board = \"category\"\n @section = \"index\"\n @menu_on = \"category\" \n \n @categories = Category.all(:gubun => \"template\", :order => [ :priority ])\n \n if params[:level] !=nil and param... |
130f4b6fca5a60a5d8d6b9fae12b4c24 | Returns the number of struct members. | [
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.0",
"text": "def length; end",
"title": ""
}
] | [
{
"docid": "5c30a0f86537aea7aa13df41ff71918a",
"score": "0.76550317",
"text": "def CCSIZEOF_STRUCT(structname, member)\r\n # (((int)((LPBYTE)(&((structname*)0)->member) - ((LPBYTE)((structname*)0)))) + sizeof(((structname*)0)->member))\r\n end",
"title": ""
},
{
"docid": "cdb51a3... |
f865fc4499d2a14b962c9e2fb7082f28 | PUT /ballots/1 PUT /ballots/1.xml | [
{
"docid": "a9bde36a118faeaf83abd30cb8dc9631",
"score": "0.68795043",
"text": "def update\n @ballot = Ballot.find(params[:id])\n\n respond_to do |format|\n if @ballot.update_attributes(params[:ballot])\n flash[:notice] = 'Ballot was successfully updated.'\n format.html { redirec... | [
{
"docid": "bb9eb3d884411c39ba62d0f7f047d01f",
"score": "0.68336076",
"text": "def update\n @ballot = Ballot.find(params[:id])\n\n respond_to do |format|\n if @ballot.update_attributes(params[:ballot])\n format.html { redirect_to(@ballot, :notice => 'Ballot was successfully updated.') ... |
62b49cc6ffe8d70baa3004a9df7bb7d9 | Build a class list from a toplevel class | [
{
"docid": "547ec061cf9425e4e215117b4fbe32ee",
"score": "0.68307734",
"text": "def build_class_list(from, html_file)\n @classes << create_class_context(from, html_file, @options)\n from.each_classmodule do |mod|\n build_class_list(mod, html_file)\n end\n end",
"title": ""
... | [
{
"docid": "e4f2c4c30d2195c6b1ea6622f939da92",
"score": "0.75643915",
"text": "def build_class_list(level, from, section, infile=nil)\n prefix = ' ::' * level;\n res = ''\n\n from.modules.sort.each do |mod|\n next unless mod.section == section\n next if infile && ... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "a5d6625895185e8dde0467cbb52149c4",
"score": "0.0",
"text": "def user_skill_params\n params.require(:user_skill).permit(:user_id, :years, :skill_id, :position)\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"... |
80e77795a0d209f8cd1e876d64250b3e | PUT /registration_acts/1 PUT /registration_acts/1.xml | [
{
"docid": "01e8d53aa0f6a65b4f6ca07bfd90dea5",
"score": "0.67187023",
"text": "def update\n @registration_act = RegistrationAct.find(params[:id])\n\n respond_to do |format|\n if @registration_act.update_attributes(params[:registration_act])\n flash[:notice] = 'RegistrationAct was succe... | [
{
"docid": "f7ef39722f2d1fb766176779bdb997f6",
"score": "0.6412066",
"text": "def update\n respond_to do |format|\n if @registration.update_attributes(params[:registration])\n flash[:notice] = 'Registration was successfully updated.'\n format.html { redirect_to :action => \"edit\" ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "c4cb8a9b07e361bbc03a6c7d536a57aa",
"score": "0.0",
"text": "def set_person_work\n @person_work = PersonWork.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... |
cb34f2b23ba30c4055918ea362e96390 | True if admin needs to assign a password | [
{
"docid": "bfda138d60f076931a320e11e6e01b7d",
"score": "0.75592613",
"text": "def needs_password?\n self.new_record? || !self.password.blank?\n end",
"title": ""
}
] | [
{
"docid": "aab03992588217b6a5a89f15bb8fab7b",
"score": "0.82530695",
"text": "def admin_password_required?\n return (require_admin_password)\n end",
"title": ""
},
{
"docid": "a73422078753db2a45b84fe2135dfb49",
"score": "0.80998605",
"text": "def password_required?\n admin? &... |
c459be0ca79a963418b2d55775f4e5f4 | TODO: This is what we will do. FIXME: And this is something urgant | [
{
"docid": "c68317a1f7857bbb32af264a42ad65c6",
"score": "0.0",
"text": "def sample\n n = 100\n n\nend",
"title": ""
}
] | [
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"score": "0.6421027",
"text": "def desired; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.63388366",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",... |
31be338fc5680e01ed6e573a18083dd6 | Add a single service record to the controller | [
{
"docid": "ff4f52a31a48f1c1b467372f1e71d6f1",
"score": "0.0",
"text": "def add_service(service)\n if service.kind_of?(AvahiService)\n if (not @services.has_key?(service.identifier))\n @services[service.identifier] = service\n else\n ... | [
{
"docid": "ccbaa61fe5a210a479649a7403721de1",
"score": "0.7111149",
"text": "def create\n @additional_service_record = AdditionalServiceRecord.new(params[:additional_service_record])\n\n respond_to do |format|\n if @additional_service_record.save\n format.html { redirect_to @additiona... |
d1d16af1cd13158b3f7dcec8205001f4 | This action presents the tags extracted from the AI file, with any tagspecific options, for use when creating or editing a DesignTemplate. See partials_controller_test.rb. | [
{
"docid": "13a0940dc8737ca9fe452f1fbc1218e3",
"score": "0.0",
"text": "def design_template_settings\n template_id = params[ :id ]\n @design_template = DesignTemplate.find( template_id )\n @tags = get_tags_array( @design_template )\n @images = get_image_names_array( @design_template )\n @... | [
{
"docid": "0d38dbc4de52b9d56e66914c566192dc",
"score": "0.6697597",
"text": "def index\n response_service.title = 'Tags'\n # seeker_result Tag, 'div.tag_list' # , clear_tags: true\n # -1 stands for any type\n params[:tagtype] ||= 0 if response_service.admin_view?\n params.delete :tagtype... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "aa4a9286bfafc8e027afa4679352fca1",
"score": "0.0",
"text": "def set_group_request\n @group_request = GroupRequest.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60328794",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6017492",
"text": "de... |
944413615b764b1159a570cb638512a6 | Gets the average review for an item | [
{
"docid": "82640a47c03fffb0e70e2861ef565f27",
"score": "0.7782868",
"text": "def score\n self.reviews.average('rating')\n end",
"title": ""
}
] | [
{
"docid": "1474b66c3baa3f64c2d2ff3372f8b9bd",
"score": "0.8414888",
"text": "def avg_rating\n return \"No reviews.\" if @reviews.empty?\n total = 0.0\n @reviews.each {|r| total += r.rating}\n total / @reviews.size\n end",
"title": ""
},
{
"docid": "d4d81437bdbedf750441e8be16ae4... |
f8a733735ea9ea41999fc4463008fd8b | PATCH/PUT /books/1 PATCH/PUT /books/1.json | [
{
"docid": "15a07ce5492b1f03897edeebae64796b",
"score": "0.6577711",
"text": "def update\n @book = Book.find(params[:id])\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render ... | [
{
"docid": "b80bded52d24d8d2fccc11f5506654a8",
"score": "0.7048773",
"text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n \n format.json { render json: @book, status: :created, location: @book }\n else... |
39c9f570d2ced182bddc935abdd97795 | Note that filemode is inherited from flat_file | [
{
"docid": "6ee5c3b7626d13e1598bdaab8bb1cc92",
"score": "0.0",
"text": "def initialize options={}\n # super wants a :filename in the options or it will fail. We need to get the initial filename\n # set up before we call super, so we need all of the parts of the pattern set up.\n sel... | [
{
"docid": "326288a0ee7fdeb6f5cc788fd953d532",
"score": "0.66321516",
"text": "def mode\n @values.fetch(:mode, (file? ? 0o644 : 0o755))\n end",
"title": ""
},
{
"docid": "251bfe21d85eb34c76897968b86471a1",
"score": "0.6599456",
"text": "def open0(mode)\r\n ... |
0bf1385a494741b49e784a4193d056e6 | Method to calculate fence misses from blackbox and timed request methods | [
{
"docid": "ddace52efc12b29f82f6f8c5be1c1cec",
"score": "0.5667769",
"text": "def calculate_misses (point,geo_id,shapes,speed)\n\t# In how many shapes is this point inside?\n\tknown_shapes = shapes_here(point,shapes)\n\n\tif @@vars['prev_point'] == nil\n\t\t@@vars['prev_point'] = point\n\t\t# We would m... | [
{
"docid": "078613b00afc44468a1fff93c17966cf",
"score": "0.56115603",
"text": "def get_server_latency(server, num_requests)\n\n failures = 0\n latencies = []\n @fatal_errors = nil\n # common header parts\n headers = \"GET \" +\n (CLOUD_PATH % [@settings.licence_key, '']).gsub(/\\s+/,... |
e6f17f26b43b47b3c6a6af37ed47947d | POST /notes POST /notes.json | [
{
"docid": "87ab84560b4f34a0b715558778231156",
"score": "0.65473735",
"text": "def create\n notes_params = params[:note]\n @note = Note.new(notes_params)\n @note.created_by_id = current_user.id\n\n respond_to do |format|\n if @note.save\n format.html { redirect_to @note, notice: ... | [
{
"docid": "24d2ec872aba018945dc8187176a72e5",
"score": "0.7317462",
"text": "def create\n @note = @current_user.notes.create(note_params)\n render json: @note\n end",
"title": ""
},
{
"docid": "25c896c0e39c96c6b19d1f9fb484bb7c",
"score": "0.7093732",
"text": "def create\n ... |
40b9d2d013cbe160dbf95f7770045c5e | walk through each pixel and save color means We use the medium scale for better performance. | [
{
"docid": "de194e44bc5d9523cccdff5d3a8ad661",
"score": "0.6770962",
"text": "def save_color_means\n require 'RMagick'\n img = Magick::Image::read(file_path('medium').to_s).first\n\n self.mean_red = 0\n self.mean_yellow = 0\n self.mean_orange = 0\n self.mean_green = 0\n self... | [
{
"docid": "e772d1d59c0aa4bafac0ddd966f138b2",
"score": "0.6511049",
"text": "def colour(x, y, c) \n @bitmap.image[y-1][x-1] = c \n end",
"title": ""
},
{
"docid": "3ac3f3eae2da33e0eb5d6d7cdcd5b99b",
"score": "0.6422676",
"text": "def get_color( img, count=5 )\n\n\t\... |
5e6983551167df265f742caa2a0ce13b | Returns true is the VM currently is running no jobs OR a previous job has been finished | [
{
"docid": "0f9d7c4c6ee546a23ffa4414bf9c8113",
"score": "0.0",
"text": "def free?(date, time, ignore_start_time=false)\n\t\treturn free_date_time?(parse_date_and_time(date, time), ignore_start_time)\n\tend",
"title": ""
}
] | [
{
"docid": "03fbf1e5ced1ad2983f1f67015f84d0c",
"score": "0.7955694",
"text": "def completed?\n return self.shift_jobs.count > 0\n end",
"title": ""
},
{
"docid": "5a9d21d35c0eed1a202e88dcc2a7e31c",
"score": "0.7818688",
"text": "def running?\n\t\t\treturn @jobs && !@jobs.empty?\n... |
84337e1035379190103e491f5d2a2528 | GET /foo37s or /foo37s.json | [
{
"docid": "8bffc4d701bf0c175b8262a0df5e193d",
"score": "0.0",
"text": "def index\n @foo37s = Foo37.all\n end",
"title": ""
}
] | [
{
"docid": "9d8da5209ff0e26298b2d9496f3845dd",
"score": "0.5877088",
"text": "def list_active_aos_versions(args = {}) \n get(\"/aosversions.json/\", args)\nend",
"title": ""
},
{
"docid": "cf06302bfac61e5b1a66df4691b4a72e",
"score": "0.57687044",
"text": "def GET; end",
"title": ... |
b0a8187e3dc346cc37b062369df19580 | This endpoint is deprecated. | [
{
"docid": "53cced1748207d95dce1d029ecaf551b",
"score": "0.0",
"text": "def get_project_cluster_logs_using_get_with_http_info(device_session_id, project_id, run_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AdminApi.get_project_cluster_logs_... | [
{
"docid": "77b0c109415e0f3e761fd3df7d4dff39",
"score": "0.7556771",
"text": "def deprecated; end",
"title": ""
},
{
"docid": "77b0c109415e0f3e761fd3df7d4dff39",
"score": "0.7556771",
"text": "def deprecated; end",
"title": ""
},
{
"docid": "77b0c109415e0f3e761fd3df7d4dff... |
947eea89082a3089c7cbc187f4a42563 | DELETE /counters/1 DELETE /counters/1.xml | [
{
"docid": "3d753e8176e49fa450031c08bab55688",
"score": "0.7189828",
"text": "def destroy\n @counter = Counter.find(params[:id])\n @counter.destroy\n\n respond_to do |format|\n format.html { redirect_to(counters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] | [
{
"docid": "10e2a9e962dfc35f42d912ae58535e62",
"score": "0.6815717",
"text": "def destroy\n @counter = Counter.find(params[:id])\n @counter.destroy\n\n respond_to do |format|\n format.html { redirect_to(adm_counters_path) }\n end\n end",
"title": ""
},
{
"docid": "83b5c59b8... |
33c5e5199416343df1f81735723872d7 | TODO: Unify with PackageTask | [
{
"docid": "d7df1554884dc28f58a1d8513128aaf8",
"score": "0.0",
"text": "def run_docker(os, architecture=nil)\n top_dir = File.expand_path('../.')\n id = os\n id = \"#{id}-#{architecture}\" if architecture\n docker_tag = \"#{@package}-#{id}\"\n build_command_line = [\n \"docker\",\n ... | [
{
"docid": "ddb9368a795c001b6d2a5ebffaa1f43e",
"score": "0.7034067",
"text": "def packages; end",
"title": ""
},
{
"docid": "6d51266a8d77fcca81969a42e331974e",
"score": "0.67225224",
"text": "def package(name)\n Packaged.instance self , name\n end",
"title": ""
},
{
"... |
61d6f2391bc58f0b38f660ab10dd6a28 | DELETE /cookings/1 or /cookings/1.json | [
{
"docid": "bad0792ac6e3931c9ee40c30b5930150",
"score": "0.72433203",
"text": "def destroy\n @cooking.destroy\n respond_to do |format|\n format.html { redirect_to cookings_url, notice: \"Cooking was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"tit... | [
{
"docid": "c4dba6ad2e046ad4ff83394804993fa9",
"score": "0.7345648",
"text": "def destroy\n @cook = Cook.find(params[:id])\n @cook.destroy\n\n respond_to do |format|\n format.html { redirect_to cooks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
... |
d981286bc4e15a53d863715571eef18e | validates :entregou_documentos, presence: true validates :historico_escolar, presence: true validates :numero_de_pessoas, presence: true validates_presence_of :holerites_mes1, :if => :nenhuma_renda? validates :agua_mes1, presence: true validates :luz_mes1, presence: true | [
{
"docid": "da43a1fad6d06e96fae1da276b58e589",
"score": "0.56736076",
"text": "def nenhuma_renda?\n aposentadorias.try(:empty?) || auxilios.try(:empty?)\n end",
"title": ""
}
] | [
{
"docid": "701be96f0f9a56f0f8783154a12a16da",
"score": "0.7502922",
"text": "def valida_comentario\n \t\terrors.add_to_base 'avisocomentario' if textoes.blank? and textofr.blank? || tituloes.blank? and titulofr.blank?\n\tend",
"title": ""
},
{
"docid": "ccfc8a5cd42bb91b4de2a6ed7c4f1ac5",
... |
b0d19526fcff87570c9ec9c6a50d1523 | Returns true if one of the key_symbols is down | [
{
"docid": "00797a05fd370ff8e8c0221b822bc47e",
"score": "0.80280834",
"text": "def any_key_down? *key_symbols\n key_symbols << :any_key if key_symbols.empty?\n key_symbols.each do |key_symbol|\n return true if key_down? key_symbol\n end\n return nil if key_symbols.empty?\n ... | [
{
"docid": "73a855d005a71cc3619b74a5dfed5c49",
"score": "0.84772956",
"text": "def keys_down? *key_symbols\n key_symbols.each do |key_symbol|\n return false unless key_down? key_symbol\n end\n return nil if key_symbols.empty?\n return true\n end",
"title": ""
},
{
... |
dc0c3861c01d07a044f88575b50328b6 | POST /hookups POST /hookups.json | [
{
"docid": "21c1f8ad8aff86bfdb34115c06cdf1b6",
"score": "0.63466656",
"text": "def create\n \n @hookup = Hookup.new(params[:hookup])\n @hookup.person_a = current_person\n @hookup.url = wtm\n \n respond_to do |format|\n if @hookup.save\n \n PersonMailer.date_email(@ho... | [
{
"docid": "80b4628e47c800cd00b439aa05023b4b",
"score": "0.71710575",
"text": "def create\n @hookup = Hookup.new(hookup_params)\n\n respond_to do |format|\n if @hookup.save\n format.html { redirect_to @hookup, notice: 'Hookup was successfully created.' }\n format.json { render :... |
1e114061182355e2851b3f8fa642718c | Logs an info message. | [
{
"docid": "2c3835547765b5ce0d54ce81fddeb4b3",
"score": "0.8693201",
"text": "def info(message)\n log(message, :info)\n end",
"title": ""
}
] | [
{
"docid": "2801a31f8dbb8644183a7075f752d610",
"score": "0.86628103",
"text": "def info(msg)\n log msg, :info\n end",
"title": ""
},
{
"docid": "7c4ecf56a21c03c0394afb71e4171078",
"score": "0.8620759",
"text": "def info(message)\n log(:info, message)\n end",
"titl... |
59e9f3bd4c3f1ba97392cc521b784892 | Gets the HTTP compression modes for this HTTP profile. | [
{
"docid": "df8152d62c52addae96dd4d5a77a6a6f",
"score": "0.61641204",
"text": "def compression_mode\n super\n end",
"title": ""
}
] | [
{
"docid": "d2d24c07fb21052638d8ff5642db5ab7",
"score": "0.66198057",
"text": "def compression\n if user_specified_options.has_key?(:compression)\n return user_specified_options[:compression]\n end\n case ::File.extname(uri.path).downcase\n when /gz/, /gunzip/\n :gz\n ... |
f5f19a4df93ee4927de32b6f9f14262b | receives options and evaluates block in current context | [
{
"docid": "b9490bcaaa19458b0eefbdc8aa32c436",
"score": "0.8286384",
"text": "def evaluate(options, &block)\n @current_options = options\n instance_eval(&block)\n end",
"title": ""
}
] | [
{
"docid": "d98bed064f5d3062043cb83b1004c4a8",
"score": "0.80022436",
"text": "def evaluate(options, &block)\n instance_eval(&block)\n end",
"title": ""
},
{
"docid": "f94e60f3c350c05f21c1d28972e39a3e",
"score": "0.7614224",
"text": "def options (&block)\n yield\n ... |
695237ff9031883d4979afec11989f54 | Module defines convenience methods on top of straightforward Win32 API functions: Finds toplevel dialog window by title and yields found dialog window to attached block. We work with dialog window in a block, and then we wait for it to close before proceeding. That is, unless your block returns nil, in which case dialo... | [
{
"docid": "57c29bc89e7eb9315f8c608c79cc8651",
"score": "0.74053776",
"text": "def dialog(opts={}) # :yields: dialog_window\n dialog = Window.top_level( {class: DIALOG_WINDOW_CLASS, timeout: LOOKUP_TIMEOUT}.merge opts )\n dialog.set_foreground_window if dialog\n wait = block_given? ? yield(dia... | [
{
"docid": "cf644e7e2b6a5c4047f57da3aa97f7e4",
"score": "0.75120705",
"text": "def dialog(title, seconds=3)\n d = begin\n win = Window.top_level(title, seconds)\n yield(win) ? win : nil\n rescue TimeoutError\n end\n d.wait_for_close if d\n return d\n end",
"title": ""
},
... |
02244d5529167668ac9838e473c8f5a2 | takes in a boolean | [
{
"docid": "d9b88cb94d440ddb7725712175652b89",
"score": "0.0",
"text": "def marker(bool)\n if bool\n return \"X\"\n else\n return \"O\"\n end\n end",
"title": ""
}
] | [
{
"docid": "6d2b243e5e91467886f7fe160eaae851",
"score": "0.7740589",
"text": "def make_true; end",
"title": ""
},
{
"docid": "6d2b243e5e91467886f7fe160eaae851",
"score": "0.7740589",
"text": "def make_true; end",
"title": ""
},
{
"docid": "14c6d6891ad527d77c6e8e8bde6f93d9... |
fa4ba4f528c87eae5b04c7df2a32d8fc | Get ruby project and return analysis json and zip | [
{
"docid": "3acce5ac410dc47448754bef54e0b149",
"score": "0.5176943",
"text": "def process_rb_project(filename, output_path)\n fail 'This feature is under development'.red\nend",
"title": ""
}
] | [
{
"docid": "bfad5222eb7c8107442c7d767a2fe826",
"score": "0.6185451",
"text": "def read_json\n if project.source_exists?\n JSON.parse(File.read(project.project_path))\n else\n []\n end\n end",
"title": ""
},
{
"docid": "5770e7e19a92c21ed6c5b4e060f5f849",
"score": "0.59... |
e2af02e3498f18270276bd9ca13b4bb6 | PUT /salesforce_custom_objects/1 PUT /salesforce_custom_objects/1.xml | [
{
"docid": "5aec41d527985b1cfc8aca1810efde72",
"score": "0.7392997",
"text": "def update\n @custom_object = Salesforce::CustomObject.find(params[:id])\n\n respond_to do |format|\n if @custom_object.update_attributes(params[:custom_object])\n format.html { redirect_to(@custom_object, :n... | [
{
"docid": "07b3335163f1f7915e95f588eee023ad",
"score": "0.6975075",
"text": "def update\n @custom_object_c = Salesforce::CustomObject_c.find(params[:id])\n\n respond_to do |format|\n if @custom_object_c.update_attributes(params[:custom_object_c])\n format.html { redirect_to(@custom_ob... |
9245752e89bdbc88d52fe4cf7bde2e51 | POST /funding_rounds POST /funding_rounds.json | [
{
"docid": "91f5ae7756d9fd46e9729f6a5927e8e9",
"score": "0.71706927",
"text": "def create\n @funding_round = FundingRound.new(funding_round_params)\n\n respond_to do |format|\n if @funding_round.save\n format.html { redirect_to @funding_round, notice: 'Funding Round was successfully cr... | [
{
"docid": "b1e2772ca4ddf2fce82bb0b202e7e9e6",
"score": "0.6790303",
"text": "def create\n @funding_round = @company.funding_rounds.build(params[:funding_round])\n\n respond_to do |format|\n if @funding_round.save\n format.html { redirect_to @funding_round, only_path: true, notice: 'F... |
2470cf4b1e0897e4b34ea3c4a0dc2552 | GET /homework_twos GET /homework_twos.json | [
{
"docid": "0b187402440836fcecee5ee5b97c8d5f",
"score": "0.6538184",
"text": "def index\n @homework_twos = HomeworkTwo.all\n end",
"title": ""
}
] | [
{
"docid": "d2bea0eeabcb7da04f4dbde2f5960e0c",
"score": "0.66025126",
"text": "def index\n render json: @twitts\n end",
"title": ""
},
{
"docid": "1b7298fc82aa4f8b3993f0800334caeb",
"score": "0.6340138",
"text": "def index\n @tweets = get_tweets\n resp... |
84175a2376b83d783d8bd38bcfc7a807 | It only needs to merge if the origin branch is different from the target branch (no need to merge to the same branch). | [
{
"docid": "f93e2e93142b1c97424601087c3f66f5",
"score": "0.6904771",
"text": "def needs_merge?\n origin.to_s != target.to_s\n end",
"title": ""
}
] | [
{
"docid": "a05c0eb0de8201edfdcbe527ab5fb66a",
"score": "0.7021349",
"text": "def merge!\n in_locked_and_timed_satellite do |merge_repo|\n if merge_in_satellite!(merge_repo)\n # push merge back to Gitolite\n # will raise CommandFailed when push fails\n merge_repo.g... |
b3e3cb962d1be27e18ec37545d4f932c | Kata: Lost Without A Map 8 kyu, | [
{
"docid": "6b2a2262629a2fb46797d79a17ede477",
"score": "0.0",
"text": "def maps(x)\n x.map {|x| x*2}\nend",
"title": ""
}
] | [
{
"docid": "afcfe4a140b403ceeb081d42ad833e80",
"score": "0.6355586",
"text": "def setup_complex_map\n @map.fake_init_matrix(3, 5)\n @map.matrix[0][0].bomb!\n @map.matrix[0][4].bomb!\n 5.times { |n| @map.matrix[2][n].bomb! }\n @map.fake_calculate_around_bombs\n end",
"title": ""
},
... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "65b3baab37852804a1bf3f4a8ae0440e",
"score": "0.0",
"text": "def set_complaint\n @complaint = Complaint.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163443",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.604317",
"text": "def action_hook; ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "736f3f3865b9332c9af14e32895f5ca0",
"score": "0.0",
"text": "def set_roof_set\n @roof_set = RoofSet.friendly.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... |
2145acea270c7a2d815363fd3ee266df | To toggle faulty flag | [
{
"docid": "e36b4828cdbfe8419cf0a17f75f87501",
"score": "0.7107421",
"text": "def toggle_faulty\n @item.toggle!(:faulty)\n end",
"title": ""
}
] | [
{
"docid": "3ad7a7826abbe836b51407575a2b45b1",
"score": "0.67616284",
"text": "def fail!\n @success = false\n end",
"title": ""
},
{
"docid": "3ad7a7826abbe836b51407575a2b45b1",
"score": "0.67616284",
"text": "def fail!\n @success = false\n end",
"title": ""
},
... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "b2c36b544d1d26bc7f8d1e51da244c86",
"score": "0.0",
"text": "def service_particular_params\n params.require(:service_particular).permit(:professional_detail_id, :date_from, :date_to, :type_of_service, :days, :autority)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.requ... |
c0aa982e1b01c4b460717cd41c04f7c4 | Emit a line of code wrapped between a tab and a newline. | [
{
"docid": "d4024fa63893f5f517d852bf3dded9d1",
"score": "0.7114266",
"text": "def emit(code, options={})\n tab = options.has_key?(:tab) ? options[:tab] : \"\\t\"\n @code << \"#{tab}#{code}\\n\"\n end",
"title": ""
}
] | [
{
"docid": "56981a22edcb473aa92e30808d7380ef",
"score": "0.6232095",
"text": "def put_a_line\n puts \"\\n\"\n puts \"/\\\\\" * 40\n puts \"\\n\"\n end",
"title": ""
},
{
"docid": "85548b83a07b39952453d676c93fa12e",
"score": "0.6154028",
"text": "def linebreak(amount=1)\n ... |
f1e23b4881bb5775b8afbcbdbe5ad56a | callseq: obj.instance_variable_defined?(sym) > true or false Returns true if the given instance variable is defined in obj. class Klass def initialize(a) | [
{
"docid": "35275fd3fa85f75c82c60990d0a4107f",
"score": "0.66877186",
"text": "def instance_variable_defined?(name)\n `this[name.__value__.replace('@','i$')]!=null`\n end",
"title": ""
}
] | [
{
"docid": "81431b974198b75aee18cc79123fed67",
"score": "0.7103542",
"text": "def init_defined?\n ivar_defined?(:init)\n end",
"title": ""
},
{
"docid": "2b208cca1eab50a3e7b3fedc4f5df4e2",
"score": "0.6419356",
"text": "def variable_defined?(name)\n name = atize(name)\n ... |
a77fa10270c6a4c4da2f6cb2cbd33901 | GET /empdetails or /empdetails.json | [
{
"docid": "8b8bfdd7bab3f7624229b2df67a825c7",
"score": "0.652316",
"text": "def index\n @empdetails = Empdetail.all\n end",
"title": ""
}
] | [
{
"docid": "6ca430f835b908aadea0760cbed12649",
"score": "0.6952008",
"text": "def show\n\t\n @employee = Employee.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee }\n end\n end",
"title": ""
},
{
"docid": "d20... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "54013f6bb3c43e577bc7af7125e573db",
"score": "0.0",
"text": "def cash_drop_params\n params.require(:cash_drop).permit(:amount, :number, :shift_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"... |
45e93b5b58f46033055822512f4cf728 | GET /poems/1 GET /poems/1.json | [
{
"docid": "56b34baa3b79183c5db86c6d00b3f85c",
"score": "0.7896979",
"text": "def show\n @poem = Poem.find(params[:id])\n # render json: @poems\n end",
"title": ""
}
] | [
{
"docid": "230f8122251fd32cb4fa8f8f1213f7b4",
"score": "0.75596714",
"text": "def index\n @poems = Poem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @poems }\n end\n end",
"title": ""
},
{
"docid": "c96102e7b1917b19d8aed91273... |
85bed0ebb9580d997696502ee622448b | Hash is only used for index calls so we can parse out the name and resource_uid for the inspect call All parameters are treated as read only | [
{
"docid": "28d17b37404f4ab021cd50fa7db3aa49",
"score": "0.0",
"text": "def initialize(client, resource_type, href, hash={})\n if INCONSISTENT_RESOURCE_TYPES.has_key?(resource_type)\n resource_type = INCONSISTENT_RESOURCE_TYPES[resource_type]\n end\n # For the inspect function:\n ... | [
{
"docid": "cf8e97f4f8b32dda07f3b93f6310c0d6",
"score": "0.63742346",
"text": "def hash\n [id, owner, region, render_id, provider_id, filename, url, status, created, updated].hash\n end",
"title": ""
},
{
"docid": "8cec2dd91e9faac4f22abeff872266b3",
"score": "0.62906986",
"te... |
a6370e83f5c49da5946f0013d436222e | Gary test to measure performance | [
{
"docid": "325d3b18c7da47193aaf844c5897493c",
"score": "0.0",
"text": "def brock_test(input)\n brock = Brock.new\n puts \"\\nBrock results on #{input.length} directions:\"\n profile do\n brock.catch_pokemons(input)\n end\n end",
"title": ""
}
] | [
{
"docid": "171abde0e87275d4f5d6bb3e812da47b",
"score": "0.75537944",
"text": "def bench_performance\n if ENV['BENCH']\n validation = lambda { |ranges, times|\n count_per_second = ranges.last / times.last.to_f\n assert count_per_second > 100_000, 'Count per second: %.2f' % count_pe... |
9c8c2cd67d2062039f5bcfc57c290906 | Sets the value of the `modified_network_attachments` attribute. | [
{
"docid": "4757d73160d96b42eb713552fd9b730a",
"score": "0.70363814",
"text": "def modified_network_attachments=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = NetworkAttachment... | [
{
"docid": "dcd9607ff95df936b76672b44d4b911b",
"score": "0.7705289",
"text": "def modified_network_attachments\n @modified_network_attachments\n end",
"title": ""
},
{
"docid": "be1bf8e7d6130fa94d7b2391d9c8dfe4",
"score": "0.61330545",
"text": "def network_attachments=(list)\... |
4eb4809779e78936a057ca1765895274 | The variable name used for the buffer variable. source://erubi//lib/erubi.rb50 | [
{
"docid": "09d25e8fd6ffcec2f57fcc6bcd9c61c5",
"score": "0.6718179",
"text": "def bufvar; end",
"title": ""
}
] | [
{
"docid": "9531af15a438c90e685e9f95a6fce11e",
"score": "0.7599505",
"text": "def variable_name\n \"@#{@name}\"\n end",
"title": ""
},
{
"docid": "dec3bed26b18ec089a08a8310ea57ac7",
"score": "0.7549798",
"text": "def var_name\n @var_name\n end",
"title": ""
},
... |
fb8f5cfe5a8493b288609842f2318fc5 | POST /products POST /products.json | [
{
"docid": "7fdf1e26a994a55db42374d31806ebee",
"score": "0.0",
"text": "def create\n unread\n\n @product = Product.new(params[:product])\n @sellers = Seller.all\n @branches = Branch.all\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice:... | [
{
"docid": "6e6e22738994035234ed86fee8433fa8",
"score": "0.76759267",
"text": "def create\n @product = Product.new(product_args)\n\n if @product.save\n render json: Product.all, status: :created\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
... |
7e711381b2795d3ea7f9228f24259b7d | Returns a list of methods delegated to repository class | [
{
"docid": "cb61d0fc194120b3431dd07948626558",
"score": "0.0",
"text": "def repository_scopes\n @repository_scopes ||= []\n end",
"title": ""
}
] | [
{
"docid": "cd04e8fb26db7149f0bbb58329f6bfe9",
"score": "0.7608227",
"text": "def repository_methods\n @repository_methods ||= []\n end",
"title": ""
},
{
"docid": "254a1c0a31e0f03898f000e832433cf3",
"score": "0.73804694",
"text": "def repository_class_methods(*me... |
6b823ce4563bc74abd3f56926820ab18 | get formatted SMPTE timecode | [
{
"docid": "43e70e75f0cb41973efb5ef53ec30b81",
"score": "0.0",
"text": "def to_s\n if (framerate_in_delta(fps, 24))\n WITH_FRAMES_24 % value_parts\n else\n WITH_FRAMES % value_parts\n end\n end",
"title": ""
}
] | [
{
"docid": "a143c10ae92ad3b15f6d4f47fca6c347",
"score": "0.7464148",
"text": "def code\n return \"#{\"%04d\" % @t_year}#{\"%02d\" % @t_month}#{\"%02d\" % @t_day}#{\"%02d\" % @t_hour}#{\"%02d\" % @t_min}#{\"%02d\" % @t_sec}#{\"%05d\" % @t_usec}\"\n end",
"title": ""
},
{
"docid": "2f3015f... |
d4af15e8d8a2a158cdca1f910541a54d | GET /quizzes/1 GET /quizzes/1.json | [
{
"docid": "daf45aa54d5f7ff9819d5fb85de7cff0",
"score": "0.0",
"text": "def show\n @quiz = Quiz.includes(:questions).find(params[:id])\n if !(@quiz.accessible(current_user.id, current_user.institution_id))\n respond_to do |format|\n format.html { redirect_to action: \"index\" }\n ... | [
{
"docid": "06b351da7a032973c7f0e9111e2c8694",
"score": "0.7673176",
"text": "def show\n @quizz = Quizz.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @quizz }\n end\n end",
"title": ""
},
{
"docid": "39844e99bddf89... |
22751f58e92828064bf18225a2a184e5 | Returns the next component from a DRb message +stream+ as a Marshal::Structure object. | [
{
"docid": "26f3b28e5828dc36c34a570bdfa15978",
"score": "0.52572954",
"text": "def load stream\n begin\n size = stream.read 4\n rescue => e\n raise SizeError, e.message, e.backtrace\n end\n\n raise SizeError, 'connection closed' unless size\n raise Premature, 'header' if size.si... | [
{
"docid": "2b1ee8e8651746c44c9158e308e59069",
"score": "0.6074591",
"text": "def read_one(stream)\n stream = stream_name(stream)\n result = connection.xread(stream, [0], count: 1)\n result[stream]&.first\n end",
"title": ""
},
{
"docid": "6adde958fd724a9a90b85472de... |