query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
6a1183457bd408ff8c968d0932bfe18f | TODO: This is obviously incomplete. I've just been adding the most common stuff I find. | [
{
"docid": "67bd0e3f5ca6e40d67dd185d82e3027d",
"score": "0.0",
"text": "def scan_file(pathname)\n headers = Set.new()\n first = true\n lineno = 0\n file = File.new(pathname.to_s)\n file.each_line do |line|\n lineno += 1\n # TODO: Remove C-style comments, even multiline\n ... | [
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"score": "0.6348169",
"text": "def desired; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6103269",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "a5c868f592ff1fd72b7386a19172f71a",
"score": "0.0",
"text": "def check_permission\n if (session[:admin_current_user].nil?)\n redirect_to \"/registration_home/index\"\n end\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60326946",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6015941",
"text": "de... |
e4c4bfe22b61161440d1e560976cc073 | Return all nodes included in this group. If a +nodeSet+ is provided, nodes will be added to it otherwiste a new node set is being created | [
{
"docid": "94d94fde78d1642dfb1c96099043aee1",
"score": "0.83898264",
"text": "def nodes(nodeSet = Set.new)\n @@groups.each_value do |g|\n g.nodes(nodeSet)\n end\n return nodeSet\n end",
"title": ""
}
] | [
{
"docid": "8c92393ccaf4b1125a35614a9932adf9",
"score": "0.834414",
"text": "def nodes(nodeSet = Set.new)\n @nodeSets.each do |g|\n g.nodes(nodeSet)\n end\n return nodeSet\n end",
"title": ""
},
{
"docid": "6c2913f9cc0d3066ed36a7753267869e",
"score": "0.7061134",
"text... |
fb9c73e99f0a130d3e04e52c3bba880b | Handles records which are changed a little bit for tests. | [
{
"docid": "c4e4c6ea29c566706126443beaa1b629",
"score": "0.0",
"text": "def process(parsed)\n if(parsed[\"@id\"].include?(\"991234563506421\"))\n # We change the language to fr to make sure non-eng languages are parsed in\n # the test suite.\n parsed[\"title\"][0][\"@language\"] = \"fr\"\n end\n r... | [
{
"docid": "9989c048128ed07b6bb54b3db2738e17",
"score": "0.66646016",
"text": "def update_records(table_name, old_records, new_records)\n raise \"implement in subclass\"\n end",
"title": ""
},
{
"docid": "08b6138f5e40e6176e44b545d9b39fb8",
"score": "0.64828426",
"text": "def ... |
46ff3739ae6e222515a5d807a52b596e | Is the cell formatted as a Time? | [
{
"docid": "f37f734bf3898074e42f086a0f45ddbd",
"score": "0.7710974",
"text": "def time?\n !number? && matches_format?(:time)\n end",
"title": ""
}
] | [
{
"docid": "f9d98fccc641e607d0f95863b629104b",
"score": "0.7523818",
"text": "def is_time t\r\n return false unless t.instance_of? Time\r\n return true\r\n end",
"title": ""
},
{
"docid": "522de118568fd63cb69301b4816b2c08",
"score": "0.74178934",
"text": "def is_time?(te... |
7c2df962666f177d71148a78e15eadd8 | config is hosted right here | [
{
"docid": "e035b5106ecb520ee277516e1f094b3b",
"score": "0.0",
"text": "def config\n Reco::Helper\n end",
"title": ""
}
] | [
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.82117665",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.82117665",
"text": "def config; end",
"title": ""
},
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
... |
7a323e7912c2105bc99f9453d3a33c25 | def total object.orders_wares.sum(&:total) end | [
{
"docid": "b6a7f140a1f16348a7552fb18ec4533e",
"score": "0.0",
"text": "def balance\n object.total - object.payments.sum(&:total_paid)\n rescue\n 0\n end",
"title": ""
}
] | [
{
"docid": "2a59bd25787d7034aa2fc1e52683d03b",
"score": "0.8058371",
"text": "def total\n total = 0\n self.orders.each do |order|\n total += order.subtotal\n end\n return total\n end",
"title": ""
},
{
"docid": "1245c9373bbcbbd9bbc425ed69429068",
"score": "0.8055851",
"t... |
18537d9993191e448edcba796b2c56e3 | If answered yes create backup | [
{
"docid": "382c7291b705e76424e7b574aaa1995a",
"score": "0.6788295",
"text": "def create_backup(file_name)\n if @backup == 'y' || @backup == 'yes'\n new_file = file_name + '.bak'\n FileUtils.cp file_name, new_file\n end\n end",
"title": ""
}
] | [
{
"docid": "a52999d102a15d848e2a7230775c6ea4",
"score": "0.68988836",
"text": "def create_backup\n run_script(\"backup\", s_one)\n wait_for_snapshots\n end",
"title": ""
},
{
"docid": "05c7dede32dcb89afad3e478d64aa742",
"score": "0.6858314",
"text": "def backup\n en... |
2d757527dffd0ab5c078d3499e4171b7 | GET /instant_customers/1 GET /instant_customers/1.json | [
{
"docid": "865ff4d76e7697b63dd1a8f9fd8cb4d4",
"score": "0.7752054",
"text": "def show\n @instant_customer = InstantCustomer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @instant_customer }\n end\n end",
"title": ""
}
] | [
{
"docid": "44d5c99d89ab374d2baf04ebcdda12b5",
"score": "0.7547481",
"text": "def getcustsjson\n render :json => @customers\n end",
"title": ""
},
{
"docid": "bce6853b21d51915cf2953720f94ffc5",
"score": "0.7512166",
"text": "def customer(id)\n get \"customers/#{id}\"\n ... |
a7db96138d596c0132677b66d4c1ea7f | property_qualifiers(property_name) => Hash return a hash with all qualifiers for +property_name+ | [
{
"docid": "848ebfe2debe1a7a328de093034190ea",
"score": "0.8766265",
"text": "def property_qualifiers(property_name)\n ret = {}\n each_property_qualifier(property_name) { |key, value| ret[key] = value }\n ret\n end",
"title": ""
}
] | [
{
"docid": "5f24ef6f625e72bf4be6abc846b459ab",
"score": "0.7269233",
"text": "def qualifiers\n ret = {}\n each_qualifier { |key, value| ret[key] = value }\n ret\n end",
"title": ""
},
{
"docid": "6da4c0cbc89fea7fb38823d473995dbe",
"score": "0.68049836",
"tex... |
4f61a0d24c61342e25e07b5342c68fc7 | VWO get_settings method to get settings for a particular account_id It will memoize the settings to avoid another http call on reinvocation of this method | [
{
"docid": "e26c964612b5a83e29b29b6842d41b41",
"score": "0.6943684",
"text": "def get_settings(settings_file = nil)\n @settings ||=\n settings_file || VWO::GetSettings.new(@account_id, @sdk_key).get\n @settings\n end",
"title": ""
}
] | [
{
"docid": "778c2aa198791e8fc9f75dbdd43dbeb8",
"score": "0.7360469",
"text": "def get_account_settings\n acc_settings = self.quote.project.account.account_setting\n end",
"title": ""
},
{
"docid": "8f49ceab271a71065a239f49b097ccc6",
"score": "0.7078189",
"text": "def get_se... |
5f1bc8d9d1255070d97e4b3032bc9fed | GET /alert_ranges GET /alert_ranges.json | [
{
"docid": "f52fa977dce0be8fcb755668a8800b45",
"score": "0.7543952",
"text": "def index\n @alert_ranges = AlertRange.where(user_id: current_user.id)\n end",
"title": ""
}
] | [
{
"docid": "210b412a2c36f11218d4d1e1c2c8fad5",
"score": "0.6644373",
"text": "def ranges\n @ranges\n end",
"title": ""
},
{
"docid": "1ced6eece850967a8a1d6e6fe0aeb85c",
"score": "0.65775084",
"text": "def set_alert_range\n @alert_range = AlertRange.find(params[:id])\n ... |
4fc1d4d43fb4bec6cf7a3cdecb90db71 | delete removes a resource from the cluster | [
{
"docid": "3fe8f81e6c93cf36973df2533bdfe026",
"score": "0.0",
"text": "def delete(name, namespace, kind, version: 'v1')\n return unless exists?(name, kind, namespace, version)\n\n @client.api(version).resource(kind, namespace: namespace).delete_resource(name)\n end",
"title": ""
}
] | [
{
"docid": "87632d2a9296136aa9adabc240e424ba",
"score": "0.72793967",
"text": "def delete(resource)\n\t\t\tend",
"title": ""
},
{
"docid": "87632d2a9296136aa9adabc240e424ba",
"score": "0.72793967",
"text": "def delete(resource)\n\t\t\tend",
"title": ""
},
{
"docid": "1080... |
e778844dcaf5a2f5ee4b3143b8b5c270 | NOTE: if you use lightweight edges (they are on by default), g.e will only return edges that have been reified by having properties added to them. | [
{
"docid": "9c76c432e3c9e132c6c39d5106b72d25",
"score": "0.6733689",
"text": "def lightweight_edges\n blueprints_graph.useLightweightEdges\n end",
"title": ""
}
] | [
{
"docid": "54d82e8386aa6bf90d9414a65c7fab7d",
"score": "0.6704763",
"text": "def all_edges\n\t\t@e.uniq\n\tend",
"title": ""
},
{
"docid": "d7ab2b8ee34f8acd9cb4cbfb929621ef",
"score": "0.65677077",
"text": "def edges\n @vertices.reduce(Set.new) { |edges, vertex| edges + vertex.ed... |
85c78a15b585a6eb3037fdefa165416c | The convert method runs the convert binary with the provided arguments. See Paperclip.run for the available options. | [
{
"docid": "b2ff586e965a4bf26120d1dbfac3a853",
"score": "0.54362744",
"text": "def pdftoppm(arguments = \"\", local_options = {})\n Paperclip.run('pdftoppm', arguments, local_options)\n end",
"title": ""
}
] | [
{
"docid": "a52d5e6c4aba42c221febc0f3434e2b1",
"score": "0.78987426",
"text": "def convert(arguments = \"\", local_options = {})\n Paperclip.run(\n Paperclip.options[:is_windows] ? \"magick convert\" : \"convert\",\n arguments,\n local_options\n )\n end",
"title": "... |
161d18a9b78849d9063c900574fb6def | Fetch issuers for a given issuer type | [
{
"docid": "14fb21e868bdce4375092be4df915d01",
"score": "0.7207875",
"text": "def issuers_by_issuer_type(query_terms)\n response = search_by_columns(\n column_hash: { 'issuer_type' => query_terms[:issuer_type],\n 'issuer_group' => query_terms[:issuer_group] },\n select: ... | [
{
"docid": "65dd3e4e1280d3255690cc93e00f2641",
"score": "0.83719915",
"text": "def fetch_issuers_by_issuer_type(issuer_type, issuer_group)\n fetch_data(\n cache_name: \"#{issuer_type}_#{issuer_group}_issuer_data\".to_sym,\n method_name: :issuers_by_issuer_type,\n query... |
41b88a19d5de3c7e4037f1e18a29c67f | GETs a list of search results from Search.gov web results API | [
{
"docid": "6fc3336913fb5b101ac2f03ee32d497a",
"score": "0.77216333",
"text": "def results\n with_monitoring do\n response = perform(:get, results_url, query_params)\n Search::ResultsResponse.from(response)\n end\n rescue => e\n handle_error(e)\n end",
"title": ""
... | [
{
"docid": "403a6ffae543b58d1ffc6846dcc2a5a0",
"score": "0.7583689",
"text": "def results\n raw_input = params[:search].to_s\n formatted_input = raw_input.gsub(\" \", \"+\")\n\n @client = HTTParty.get(\"http://api.shopstyle.com/api/v2/products?pid=uid5001-30368749-95&fts='#{formatted_input}'&of... |
4cb79d9ac915c413fb0a0679101e33f8 | Run the setup tasks defined for a single test file. | [
{
"docid": "9f7547d93941fc2fcc7608fdf0911643",
"score": "0.0",
"text": "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"title": ... | [
{
"docid": "4714d4a7a86aab4e53181dae40b29c36",
"score": "0.7520559",
"text": "def setup_test_files\n project.test_sources.each do |src|\n compile_task objectsify(src), src\n end\n end",
"title": ""
},
{
"docid": "b1270d0dc0a8065c805c1ffc3e398ed0",
"score": "0.7176611"... |
5b34684946722fbcad4c838a58e42ec1 | For the layer lookup. Reminder: eql? is for Hash equality: returns true if obj and other refer to the same hash key. | [
{
"docid": "9f74424013a1403a37e5a532ce322d63",
"score": "0.0",
"text": "def eql?(o); end",
"title": ""
}
] | [
{
"docid": "652ee47ae615282b97fb1badc000a2bf",
"score": "0.7237144",
"text": "def eql?(other)\n # @note Facets::Kerenl::respond munges the object_id\n if other.respond_to?(:__getobj__)\n if strict_eql?\n self.__getobj__.object_id.eql? other.__getobj__.object_id\n else\n ... |
46ff2fcbb7517854c0c70625b2464440 | Gets the list of server identities where this gear cannot be hosted == Returns: | [
{
"docid": "f297333911c783532ddc51d744c731b2",
"score": "0.75280946",
"text": "def restricted_server_identities\n restricted_nodes = []\n if !Rails.configuration.openshift[:allow_multiple_haproxy_on_node] and self.application.scalable and self.component_instances.select { |ci| ci.is_web_proxy? }.p... | [
{
"docid": "a2e45e05233202a6d58e02ab9fd49359",
"score": "0.78311527",
"text": "def non_ha_server_identities\n group_instance.server_identities.uniq\n end",
"title": ""
},
{
"docid": "7df6885bece0928cb9d41d7d74e4029d",
"score": "0.69528365",
"text": "def list_unknownservers\n ... |
deabdc208b6ebd0505d90eb320612d57 | A quick hack to grab email from RFC822 From: headers | [
{
"docid": "28f689ef4b9175a247b4d8e109b7a31e",
"score": "0.0",
"text": "def ingest text\n parts = text.split(/\\s+/).map { |l| l.gsub(/[><]/,'') }.map {|l| '\"' + l + '\"' }\n email = parts.last\n first_name = '\"\"'\n last_name = '\"\"'\n organisation = '\"\"'\n if parts.count > 2\n first_name... | [
{
"docid": "05ae38f008a66ce9236ee246ca17091c",
"score": "0.7403428",
"text": "def from\n @from ||= @email.from.to_a.first.to_s.strip\n end",
"title": ""
},
{
"docid": "0ca6b343bbf8d4940f5f4067898f2673",
"score": "0.70680475",
"text": "def parse_name(email)\n email.scan(/From: \\... |
27ad67dd78ff14e57b894ca974cab3a7 | Retrieve the distributor id given a profile id | [
{
"docid": "d368ef7139cb8dcce840a88347d8ede0",
"score": "0.80104876",
"text": "def get_active_profile_distributor_id(profile_id)\n active_profile_request = \"#{@base_url}/services/conf/brokerConfigurations/#{profile_id}\"\n response = Faraday.get do |req|\n req.url active_profile_reques... | [
{
"docid": "f64dd2965eb0369326eb3a342d56cf33",
"score": "0.78106934",
"text": "def get_active_profile_harvester_id(profile_id, distributor_id)\n harvester_request = \"#{@base_url}/services/conf/brokerConfigurations/#{profile_id}/distributors/#{distributor_id}\"\n response = Faraday.get do |req... |
af8d12844eddebc2b9698a4f0701c37a | RETURN A SPECIFIC REVISION WITH A SPECIFIC TAG | [
{
"docid": "a648dec3a785a4914a7f1ee0fbe09a60",
"score": "0.0",
"text": "def tagged(tag)\n\t\t\tself.class.where(:token=>self.token,:tag=>tag).first\n\t\tend",
"title": ""
}
] | [
{
"docid": "93764faae194c84283d6d8014d12ab62",
"score": "0.61034805",
"text": "def get_summary_version\n Moebooru::CacheHelper.get_version(\"tag\")\n end",
"title": ""
},
{
"docid": "5aa2cb54f43db0f0474f3bc8f7e81b01",
"score": "0.6061793",
"text": "def released_version\n /\\... |
5259c09ebe7c9440cf8a72ae023f87a3 | Iteration 0 Translate English to ciphertext lowercase letters $ caesar = Caesar.new => $ caesar.eng_to_cipher("the quick brown fox jumps over the lazy dog", 3) => "qeb nrfzh yoltk clu grkmp lsbo qeb ixwv ald" | [
{
"docid": "6f42491856be3e0dd40cfe6022e725d9",
"score": "0.0",
"text": "def test_it_ordinates\n assert_equal [116, 101, 115, 116], @cipher.eng_to_cipher(\"test\", 0)\n end",
"title": ""
}
] | [
{
"docid": "3eedb622f9a88fe1bf2a7f74e391b8eb",
"score": "0.80311435",
"text": "def caesar_cipher\t\t\t\t\t\t\t\t\t# method to cipher\n\n## gsub is used to substitute the character in the string - using pattern match to substitute\t\t\n\t\ttext.gsub!(/([a-zA-Z])/){ |char|\n## If the shift in character re... |
2a81b77d137553c455d81ef124f97a45 | Devuelve si el viaje puede ser accedido por un determinado usuario. | [
{
"docid": "51a2513a43f15bfce73bc1dffecee84d",
"score": "0.0",
"text": "def readable?(user)\n publicx || user == self.user || authorizations_users.include?(user) || user&.admin?\n end",
"title": ""
}
] | [
{
"docid": "f6dd2b7db84569f15662e9ce0b2417af",
"score": "0.7071576",
"text": "def ha_accedido?\n\t\t!usuario_actual.nil?\n\tend",
"title": ""
},
{
"docid": "f78afb55022531170f67ba4f01197549",
"score": "0.6758297",
"text": "def sender?(user)\n user.role == 'Envio' || user.role == '... |
024148e5801e012490d51d0fddbd6e1b | The values of these attributes are codes which are mapped via their corresponding lookup (see below) | [
{
"docid": "dd372655f9a90a386931d8d8415dee0e",
"score": "0.550628",
"text": "def lookups\n {\n 'web_status' => 'property_status',\n 'furnished' => 'furnished_status'\n }\n end",
"title": ""
}
] | [
{
"docid": "c42f49f0215e3ca7a871bcf1a7df6628",
"score": "0.6639377",
"text": "def attributes_for_code(code, code_system)\n @attributes.find_all { |e| e.send(:code) == code && e.send(:code_obj).send(:system) == code_system }\n end",
"title": ""
},
{
"docid": "094bac501827972a148f50965... |
7ccfba2ebd99ebde2835a7b5e83aeb7d | CRM OBJECT_ = "mf_account__c" | [
{
"docid": "8f925e5424d520866944297e10e6a033",
"score": "0.8342066",
"text": "def getMfAccountObjName\r\n\t\t return \"mf_account__c\"\r\n\t\tend",
"title": ""
}
] | [
{
"docid": "9879185b2e6ef145967808f7eef9452b",
"score": "0.75435245",
"text": "def getMfAccountTypeObjName\r\n\t\t return \"mf_account_type__c\"\r\n\t\tend",
"title": ""
},
{
"docid": "aaa5ac77f4399a2704bff23807bf89ef",
"score": "0.70863867",
"text": "def getLoanAccountObjName\r\n\t... |
c1dfe1e1e48e70183a8cff4b93c5ae36 | options[:sanitizable_content_types] Array options[:additional_content_types] Array | [
{
"docid": "3d467e4e8f0330fb344c7f95e5e36ba7",
"score": "0.5649508",
"text": "def initialize(app, options={})\n @app = app\n @strategy = build_strategy(options)\n @sanitizable_content_types = options[:sanitizable_content_types]\n @sanitizable_content_types ||= SANITIZABLE_CONTENT_TYP... | [
{
"docid": "ec43fec385f67c5d76a9766ae315476e",
"score": "0.69022024",
"text": "def valid_content_types\n content_type = respond_to?(:content_type_allowlist, true) ? content_type_allowlist : []\n content_type += alias_content_type if respond_to?(:alias_content_type, true)\n content_type\n end",... |
57935b8448321809e55ac0bce9cc0491 | Replace all variable references in the given string. Variable references are recognized per the regular expression passed to the constructor. If a referenced variable is not found in the resolver, this method either: throws a +VariableNotFoundException+ (if +safe+ is +false+). substitutes an empty string (if +safe+ is ... | [
{
"docid": "61f7b40ef303d2aa2a888589d0b72279",
"score": "0.51326185",
"text": "def substitute(s)\n # Kludge to handle escaped \"%\". Temporarily replace it with\n # something highly unlikely to be in the string. Then, put a single\n # \"%\" in its place, after the substitution... | [
{
"docid": "51568818146ef2035ff7a2026075e5d2",
"score": "0.66050017",
"text": "def substitute(s)\n\n def substitute_variable(var, s)\n end_string = var.iend == s.length ? \"\" : s[var.iend..-1]\n value = get_variable(var.name, var.default)\n transformed = \n ... |
85a8d55708921dba773660de0aaf2622 | GET /reminders GET /reminders.json | [
{
"docid": "0e549be14ee7551e39e4eb7631b8c1f5",
"score": "0.0",
"text": "def index\n @reminders = Reminder.order(sort_column + \" \" + sort_diection)\n end",
"title": ""
}
] | [
{
"docid": "f8d75a72d654270116bad179afd8415e",
"score": "0.7823191",
"text": "def index\n reminders = Reminder.all\n\n render json: reminders, each_serializer: V1::RemindersSerializer\n end",
"title": ""
},
{
"docid": "f0db2b1e3b7cb4539ed4a0cadf9e5355",
"score": "0.7526172",... |
7785a7d6ec327fb7e9c8ba01bbed1cfb | DELETE /libraries/1 DELETE /libraries/1.json | [
{
"docid": "5ef381c511d16467a878252fea6ae5a0",
"score": "0.6894216",
"text": "def destroy\n @library.destroy\n respond_to do |format|\n format.html { redirect_to libraries_url, notice: 'Library was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title... | [
{
"docid": "a97f9bfd19fa167d7b48810545abe97f",
"score": "0.7144322",
"text": "def destroy\n @library.destroy\n\n respond_to do |format|\n format.html { redirect_to libraries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4cba1ccc294c2f07... |
d4961f4c5fa929a8370602e05981a55b | PUT /views/1 PUT /views/1.xml | [
{
"docid": "d9e655a905307c56c0a74cc539520710",
"score": "0.6608972",
"text": "def update\n @view = View.find(params[:id])\n\n respond_to do |format|\n if @view.update_attributes(params[:view])\n flash[:notice] = 'View was successfully updated.'\n format.html { redirect_to(@view)... | [
{
"docid": "d46c7869013d3100b0344461a44764e6",
"score": "0.6757633",
"text": "def UpdateView params = {}\n \n APICall(path: 'views.json',method: 'PUT',payload: params.to_json)\n \n end",
"title": ""
},
{
"docid": "4b82603630c93f1ef7fb9375c4c9bf11",
"score": "0.6... |
c41bf37c8473a75f33e3f059f02ed4dd | Locates the service corresponding to the given path. | [
{
"docid": "04142557bc75e4b91e7366ceb99126a6",
"score": "0.0",
"text": "def service(path)\n if path.nil? || path == ''\n return self\n end\n index = path.index('/')\n if index.nil?\n return statistic_service(path)\n end\n return statistic_service(path[0..(inde... | [
{
"docid": "e8e807e295b3bc4c300490e3f7c21425",
"score": "0.72740424",
"text": "def service(path)\n if path.nil? || path == ''\n return self\n end\n index = path.index('/')\n if index.nil?\n return operating_system_service(path)\n end\n return operating_system_... |
eb7b9dc7a9f3fff1a324d0c8da3f47bf | This will be overwritten with Sorcery::OrmAdapters::ActiveRecord in railtie.rb | [
{
"docid": "4385985dec2cde987191528930d665e7",
"score": "0.79131424",
"text": "def sorcery_orm_adapter\n ::Sorcery::OrmAdapters::Base.from(self)\n end",
"title": ""
}
] | [
{
"docid": "fda2463627efe549145e70759401c1cc",
"score": "0.7268729",
"text": "def orm_class; end",
"title": ""
},
{
"docid": "f99a0fe938825e37b18013edc3941482",
"score": "0.7223572",
"text": "def define_sorcery_orm_adapter!\n # Including the super methods on this check is intent... |
6a6899601de92ae20d250ae884655c96 | creating a variable in sessions called source and we'll equalit it to the params :q in the routes, and store it there. so that i'll be available in our local session. source is a random name given to it and q is also random, | [
{
"docid": "c8f472dfbe4483e436d1adaa846b73d8",
"score": "0.73470306",
"text": "def set_source\n session[:source] = params[:q] if params[:q]\n end",
"title": ""
}
] | [
{
"docid": "a55e501906763d216377fd6b23d2dc70",
"score": "0.7109785",
"text": "def set_source\n session[:source] = params[:q] if params[:q]\n end",
"title": ""
},
{
"docid": "eda9252290df55b8c5f7497c217cbd77",
"score": "0.58583736",
"text": "def set_source_from_session\n ... |
89a5249745e88138e48449fb78df69fa | DELETE /caterers/1 DELETE /caterers/1.json | [
{
"docid": "4f48f2749e640eec621c423a3edbf047",
"score": "0.7158707",
"text": "def destroy\n @caterer.destroy\n respond_to do |format|\n format.html { redirect_to caterers_url, notice: 'Caterer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title"... | [
{
"docid": "f1449a6157876839b0ebb1a712326091",
"score": "0.75070024",
"text": "def destroy\n @caterer = Caterer.find(params[:id])\n @caterer.destroy\n\n respond_to do |format|\n format.html { redirect_to caterers_url }\n format.json { head :no_content }\n end\n end",
"title": ... |
e95adc25a02938ab375ef147ad7ca610 | Converts from a string value (perhaps off the wire) to an instance of this enum type. | [
{
"docid": "9254f8a7b489aad395237cc470d16d71",
"score": "0.64387304",
"text": "def from_string(value)\n const_get(value)\n rescue NameError\n LocationType.send(:new, 'UNKNOWN', value)\n end",
"title": ""
}
] | [
{
"docid": "af3972b63affaa3440a597374c93c1ae",
"score": "0.7494852",
"text": "def from_string(value)\n const_get(value)\n rescue NameError\n Type.send(:new, 'UNKNOWN', value)\n end",
"title": ""
},
{
"docid": "af3972b63affaa3440a597374c93c1ae",
"score": "0... |
87d93efd1dd041d894f63decefcd19dd | =begin Function that gets the input refactoring =end | [
{
"docid": "fadf2a90fe876fdf9c20fbb29b26af8f",
"score": "0.0",
"text": "def getBasic(operation)\n puts \"Introduce a \" +operation\n return gets.delete!(\"\\n\")\n end",
"title": ""
}
] | [
{
"docid": "b9960478999684c2b536f76e22f6fc63",
"score": "0.63530797",
"text": "def solution4(input)\n end",
"title": ""
},
{
"docid": "95c5d00f6fd8f5d6f4b7368744a1a4b6",
"score": "0.6345183",
"text": "def solution2(input)\n end",
"title": ""
},
{
"docid": "95c5d00f6fd8f... |
d0d7996ee6174beda04b70f4d21c2e70 | def new if else for user roles | [
{
"docid": "4ac76201dfbd503954d51478a337c752",
"score": "0.0",
"text": "def show \n\t\t@patient = current_user\n\t\t@medicalrecord = MedicalRecord.find_by(id: params[:id])\n\tend",
"title": ""
}
] | [
{
"docid": "8b257260a6904f1523ec0be506458619",
"score": "0.74617106",
"text": "def create_eligable_roles\n @user.premium? ||\n @user.admin? ||\n @user.standard?\n end",
"title": ""
},
{
"docid": "03ae0793ff49ed1a16eed31b4800192a",
"score": "0.73724115",
"text": "def adm... |
1aa68737b87d0bb48e032bb7b7df2a99 | GET /entries/tags/:tag GET /entries/tags/:tag.json | [
{
"docid": "c01fd903ab2f4764237aad79d8601f8c",
"score": "0.76218444",
"text": "def tag\n @entries = Entry.where({oauth_id: @oauth.id}).tagged_with(params[:tag]).order(\"id DESC\").page(params[:page])\n end",
"title": ""
}
] | [
{
"docid": "be16e2921e8961ce4e3377fe162cde11",
"score": "0.7517264",
"text": "def show\n @tag = Tag.find(params[:id])\n @entries = Entry.find_by_tag(@tag, :order => 'created_at DESC')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tag }\n end... |
3f2683b635940ab93a5834660aed4562 | default_scope :order => 'posts.created_at DESC' | [
{
"docid": "8ca11238397ce47d2a1ed3ee00835051",
"score": "0.0",
"text": "def tag_names \n @tag_names || tags.map(&:name).join(' ')\n end",
"title": ""
}
] | [
{
"docid": "f6ffac14a3d27ce53c614e228871953f",
"score": "0.7384352",
"text": "def index\n @posts = Post.order('posts.created_at DESC').all\n end",
"title": ""
},
{
"docid": "448de2b20eb40a8e85c9e8e37c99c1fc",
"score": "0.72928876",
"text": "def index\n @posts = Post.order(\"cr... |
9abaaa90c8bcd23a5b47b98a53c69e8d | PATCH/PUT /certagencies/1 or /certagencies/1.json | [
{
"docid": "4e4850926eea44b269ede3004e7ed1a4",
"score": "0.65625125",
"text": "def update\n respond_to do |format|\n if @certagency.update(certagency_params)\n format.html { redirect_to certagency_url(@certagency), notice: \"Certagency was successfully updated.\" }\n format.json { ... | [
{
"docid": "d78fa09d44c214e2c158ca4fb95fe279",
"score": "0.6536155",
"text": "def update\n authorize! :create, @cert\n respond_to do |format|\n if @cert.update(cert_params)\n format.html { redirect_to @cert, notice: 'Cert was successfully updated.' }\n format.json { render :show... |
ff63b8b6a172082f9a9d34f83bbeea43 | Remove leading and trailing whitespace from a block string. See "Block Strings" in source://graphql//lib/graphql/language/block_string.rb7 | [
{
"docid": "7e8088348e7e68adcab2004ababed2f4",
"score": "0.62707525",
"text": "def trim_whitespace(str); end",
"title": ""
}
] | [
{
"docid": "b4a091d32e1227046dd7a701f908526c",
"score": "0.78220654",
"text": "def strip_block(block)\n block.strip\n end",
"title": ""
},
{
"docid": "e2075d5d5e80a10cc82e7b56b858793f",
"score": "0.7814517",
"text": "def strip_block(str)\n match = str.match(/\\A[\\t ]*\\n?... |
6a6ad00a7657d2bc95f672178d2b22db | Makes sure there are no session token conflicts (however small that chance may be) | [
{
"docid": "4e490b9c90482fa70c7dadbee817c4eb",
"score": "0.6390446",
"text": "def generate_unique_session_token\n token = SecureRandom.urlsafe_base64(16)\n ##\n # Just in case there is a session_token conflict, make sure\n # not to throw a validation error at the user!\n ##\n # checks ... | [
{
"docid": "603c756f495e88b2c57571c5e744760d",
"score": "0.79176813",
"text": "def ensure_session_token_uniqueness\n \twhile User.find_by(session_token: self.session_token)\n \t\tself.session_token = new_session_token\n \tend\n end",
"title": ""
},
{
"docid": "dede0a8f28ebbe17abf1fda7236... |
304cb9f4d8872e28acbf1e6106c74b3d | findMax([2, 5, 6, 8, 10]) 6. Get Average | [
{
"docid": "01e32b866e708847ccde5872b67dc5bc",
"score": "0.0",
"text": "def getAverage(arr)\n\tsum = 0\n\tarr.each { |i| sum += i }\n\tputs \"The average is #{sum/arr.length}\"\nend",
"title": ""
}
] | [
{
"docid": "da2c3958c61f6dc81c712314062f3efd",
"score": "0.7612781",
"text": "def maxMinAvg(arr); puts arr.max; puts arr.min; puts arr.reduce(:+)/arr.length end",
"title": ""
},
{
"docid": "a2b32ca163350f225a72ecda3f767bb0",
"score": "0.7539231",
"text": "def find_max_average(nums, k... |
5cd28ea636f0bcf260cee87fe3830e73 | local_parent_map Get parent to local map for parent instance. | [
{
"docid": "1eee2ff6d0f0b508aa7b55fb08569190",
"score": "0.84848195",
"text": "def local_parent_map( parent_array )\n \n return @local_parent_maps ? @local_parent_maps[ parent_array.__id__ ] : nil\n \n end",
"title": ""
}
] | [
{
"docid": "f67658f9dea1a9bcfc994e2c48be644f",
"score": "0.8320245",
"text": "def parent_local_map( parent_array )\n \n return @parent_local_maps ? @parent_local_maps[ parent_array.__id__ ] : nil\n \n end",
"title": ""
},
{
"docid": "7f1ceee0e258215b688a7dbf91f354b0",
"score": ... |
c70fffdf12d341bcf1b29d000c3702df | GET /events/1 GET /events/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "2d5580b43c7c18bcd8a06713fa4be0f1",
"score": "0.75926495",
"text": "def show\n\t\tevent_id = params[:id]\n\t\tif event_id.present?\n\t\t\t@event = Com::Nbos::Events::Event.active_events.where(:id => event_id)\n\t\t\trender :json => @event\n\t\telse\n\t\t\trender :json => {status: 400, message... |
85607eeb6793e019dd1e60c74325fbe0 | Returns the value of attribute config. | [
{
"docid": "2a8a06514acfc42e4e9bd17aa7026d42",
"score": "0.0",
"text": "def config; end",
"title": ""
}
] | [
{
"docid": "bbec1ec3f2ea557c0bcd568b894d1fcf",
"score": "0.7430055",
"text": "def get_model_attr_value attr\n config.send(\"#{attr.to_s}\".to_sym)\n end",
"title": ""
},
{
"docid": "af05a9a21a8cc1c22bf4f086e2076d43",
"score": "0.73670924",
"text": "def [](attr)\n confi... |
edd663fde43b177ec6c52503bc14e278 | GET /presentacions/1 GET /presentacions/1.json | [
{
"docid": "c0f08aa1b85f545ed0e2dd3c2b59e5aa",
"score": "0.7274404",
"text": "def show\n @presentacion = Presentacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @presentacion }\n end\n end",
"title": ""
}
] | [
{
"docid": "a3d7893d81d0646bb15d02e617bef990",
"score": "0.75837564",
"text": "def show\n @present = Present.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @present }\n end\n end",
"title": ""
},
{
"docid": "fb5ac99... |
7910d8d64239caf9eb65fdcce0e7994d | Shortens a git id. | [
{
"docid": "dc208691b70b1fca6c83919d29019958",
"score": "0.75737673",
"text": "def git_id(id)\n\t\t\tid[0...8]\n\t\tend",
"title": ""
}
] | [
{
"docid": "055c1ab683f0b3b58177203fe5ebc5d5",
"score": "0.7471644",
"text": "def short_id\n si = id.to_s.tr('-', \"_\")\n si = si.gsub(project.full_id_name, '') if project\n si.gsub('__', '_').gsub(/^_|_$/, '')\n end",
"title": ""
},
{
"docid": "1b9d429c9cccdd758e86b65485837e66",
... |
5907a0731f7819ffd99e702880d27be5 | GET /job_offers/1 GET /job_offers/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "081070f97affcef1d84534ea9f34ec3c",
"score": "0.77445453",
"text": "def index\n #@job_offers = JobOffer.find_by(id: params[:id])\n @job_offers = JobOffer.where(\"job_request_id = ?\", params[:job_request])\n end",
"title": ""
},
{
"docid": "0924a0470cb40bab76dc87bbe201dfb0"... |
6c8253c454e59945fac26b757acf1f1d | GET /employee_psas/new GET /employee_psas/new.json | [
{
"docid": "f03349ddd7153ddbbd6e73280a0e307a",
"score": "0.8152996",
"text": "def new\n @employee_psa = EmployeePsa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee_psa }\n end\n end",
"title": ""
}
] | [
{
"docid": "80a7857d8562f6c5b309e95a7e65d86e",
"score": "0.76525855",
"text": "def create\n @employee_psa = EmployeePsa.new(params[:employee_psa])\n\n respond_to do |format|\n if @employee_psa.save\n format.html { redirect_to @employee_psa, notice: 'Employee psa was successfully create... |
f790675dbacd6409bc119ed5ee81c1d4 | GET /course_rosters GET /course_rosters.json | [
{
"docid": "8bba6200643457411c8c2446b464f7ff",
"score": "0.7235813",
"text": "def index\n if params[:course_id]\n @course_rosters = CourseRoster.where course_id: params[:course_id]\n else\n @course_rosters = CourseRoster.all\n end\n end",
"title": ""
}
] | [
{
"docid": "193af583792b4d628c7697d2d6afd744",
"score": "0.64214844",
"text": "def index\n @rosters = @race.rosters \n end",
"title": ""
},
{
"docid": "d1a6c04faae9f9392b74cc6c62170733",
"score": "0.63409895",
"text": "def course(roster_id)\n self.rosters.find(roster_id).... |
a171843388cc4c48032c3abcfd1e4b2c | Sets the contentInfo property value. Optional. A custom piece of data JSONLD extensible description of content according to schema.org syntax. | [
{
"docid": "04b054d3d41fbd998f7f5584341ae8e2",
"score": "0.8262015",
"text": "def content_info=(value)\n @content_info = value\n end",
"title": ""
}
] | [
{
"docid": "9383f855536930b0c80cecdb666fa041",
"score": "0.6390848",
"text": "def set_information_content\n @information_content = InformationContent.find(params[:id])\n end",
"title": ""
},
{
"docid": "22f38e4335d987fb0c022f0b7574a6f6",
"score": "0.6253518",
"text": "def con... |
1d7bacb03a46282ee91c6e3a1f877ac6 | Tests that it can get the indentation of a method def line | [
{
"docid": "ea7cbac8de7be7e5acb3b177df186284",
"score": "0.0",
"text": "def test_get_method_end\n verify_method :get_method_end, with: [\n {param: ' def method', expect: /^ end(\\s*#.*|\\s*)$/},\n {param: ' def method', expect: /^ end(\\s*#.*|\\s*)$/},\n ]\n en... | [
{
"docid": "deaf937c473d357673708a04d53b251f",
"score": "0.7782245",
"text": "def indentation; end",
"title": ""
},
{
"docid": "deaf937c473d357673708a04d53b251f",
"score": "0.7782245",
"text": "def indentation; end",
"title": ""
},
{
"docid": "deaf937c473d357673708a04d53b... |
ef59f0382da9a9d8dcb91310f1b92cce | Sets the attribute leeway | [
{
"docid": "713f78ad1532fd1d02707c4324748dac",
"score": "0.6120898",
"text": "def leeway=(_arg0); end",
"title": ""
}
] | [
{
"docid": "ef0ae9c9373faf99d8a862b7242b88be",
"score": "0.5862655",
"text": "def leeway; end",
"title": ""
},
{
"docid": "ef0ae9c9373faf99d8a862b7242b88be",
"score": "0.5862655",
"text": "def leeway; end",
"title": ""
},
{
"docid": "e188ecfaaa1f57c52ff6483225318da9",
... |
fafebdd5474b4b4b51e92e8bda301b78 | Prints no of requests by day | [
{
"docid": "5942e6e5ab38361dc2b24f91300ef521",
"score": "0.7481298",
"text": "def no_of_requests_by_day(requests_per_day_hash)\n requests_per_day_hash.each { |date, item_list|\n # Invalid dates comes as nil. Skip those items\n next if date == nil\n puts \"#{date} -> #{item_list.count}\... | [
{
"docid": "94da623125d9fc40b31e7df52f0285cf",
"score": "0.72827005",
"text": "def report_total_requests(data_list, f)\n Utils.report_title(f, \"Number of Requsts Servered by Day\")\n f.printf \"%-#{FIELD_LENGTH}s%-#{FIELD_LENGTH}s\\n\", \"Date\", \"Requests\"\n data_list.each do |d... |
7012384f1abe75c7bf7ae68dc573f58d | Returns true if step is the first one of the flow | [
{
"docid": "fadf2d52ed267f201bd9846ea1750801",
"score": "0.69550127",
"text": "def start_step?\n params_hash[\"start\"]\n end",
"title": ""
}
] | [
{
"docid": "201e0306903fa0e9fced9ccfb86a8d8a",
"score": "0.87505245",
"text": "def first_step?( step = self.step )\n step == first_step\n end",
"title": ""
},
{
"docid": "4c21e423ff2ecb9c902df070d84c8bc0",
"score": "0.87042713",
"text": "def first_step?\n current_step == s... |
ae31b5064257fa37c4e3330aaa18ca46 | determine whether the change set relate to this channel | [
{
"docid": "aece0ee51e72023184b41fe721ade74b",
"score": "0.0",
"text": "def create_job(change_set)\n # all room types id in this change set\n room_type_ids = change_set.room_type_ids\n pool = change_set.pool\n\n room_type_ids.each do |rt_id|\n channel_mapping = RoomTypeChannelMapping.find_by... | [
{
"docid": "4a115cf826c6f758ba4810b1405f6933",
"score": "0.6893729",
"text": "def channel?\n self.channel_referent_id > 0\n end",
"title": ""
},
{
"docid": "8d6eda08a67f95a25b1f3b0f195c217c",
"score": "0.6571284",
"text": "def changed?\n changes.changed?\n end",
"... |
65b8227981b59a2e90b3d701a4e79139 | You shouldn't really use this one yourself it's called by the controller's 'force_forget_me!' method. | [
{
"docid": "06657a4a7e96d1e890aacff56dcef9d3",
"score": "0.7355587",
"text": "def force_forget_me!\n sorcery_orm_adapter.update_attributes(\n sorcery_config.remember_me_token_attr_name => nil,\n sorcery_config.remember_me_token_expires_at_attr_name => nil\... | [
{
"docid": "eff622e71a2c26bbc272b117111d1dd8",
"score": "0.7767782",
"text": "def forget_me!\n data = self.class.remote_request( 'forget_me!', {\n id: self.id\n })\n remember_data = data['remember_data']\n# return unless persisted?\n# self.re... |
253826e19ef6fbaa662569f67a3af00c | Delete all items of a single kind of domain metadata. | [
{
"docid": "e370044f35ba14c66baf82ba49dd846a",
"score": "0.0",
"text": "def delete_metadata_with_http_info(server_id, zone_id, metadata_kind, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ZonemetadataApi.delete_metadata ...'\n end\n # ... | [
{
"docid": "c80490dedbe09a0a176bbe9a4a5d34b4",
"score": "0.6726591",
"text": "def destroy_all\n content_type.entries.destroy_all\n end",
"title": ""
},
{
"docid": "9a05809c6e344d8aad1be5f79c8ffe80",
"score": "0.65574175",
"text": "def delete_all\n\t\tputs \"Delete all entries... |
29ea4c80fea1981b26dff0bb9ae0aca4 | Produces a random quarter wind azimuth | [
{
"docid": "e477e7d73a87992b535a0488165fe170",
"score": "0.7291121",
"text": "def quarter_wind_azimuth\n fetch('compass.quarter-wind.azimuth')\n end",
"title": ""
}
] | [
{
"docid": "dd394ca3aa5a9d86b7b9ec1081a2054a",
"score": "0.5974573",
"text": "def generate_target_rotation\n random(-(TWO_PI*20), (TWO_PI*20))\n end",
"title": ""
},
{
"docid": "ab0f2e4ecf1f629770c1faab848563ce",
"score": "0.59397095",
"text": "def get_random_angle\n rand ... |
f5d25c0b0604a11ff0e80cdb5d4318a1 | unlink Unlink this NodeSet and all Node objects it contains from their current context. | [
{
"docid": "7d0e75f901eb90d2a1160b80226d4108",
"score": "0.6598201",
"text": "def unlink()\n #This is a stub, used for indexing\n end",
"title": ""
}
] | [
{
"docid": "270ca1ac65c343ada5db732dba0aee6e",
"score": "0.80773026",
"text": "def unlink\n each { |node| node.unlink }\n self\n end",
"title": ""
},
{
"docid": "4daba97ce54ede119047f92f7c340a82",
"score": "0.70070386",
"text": "def unlink(node)\n @nodes.delete(... |
9e8c51e31b74b1ff295b4c83b7f6fa38 | Hash wrapper for compiler instances, defaults to display currently enabled tester platform. If none is set then user must supply a valid tester platform argument | [
{
"docid": "a2dd9e5fdef8b5b4c5b55946cf6bf3dd",
"score": "0.0",
"text": "def pattern_compilers(id = nil)\n @pattern_compilers ||= begin\n hash = {}\n PLATFORMS.each { |platform| hash[platform] = {} }\n hash\n end\n if id.nil?\n @pattern_compilers[platform]\n ... | [
{
"docid": "b6a1fe1631cc0c6ed89e8c6331c3d3c0",
"score": "0.65739703",
"text": "def platform\n \"#{@vm}-#{@os}-#{@impl}-#{@arch}\"\n end",
"title": ""
},
{
"docid": "3bc6b3dd1111246fa8e153ab7f740730",
"score": "0.6472281",
"text": "def platform(platform_key)\n case platform_key... |
f260b0743e3635ff851ba1fb8f391b00 | GET /users/1 GET /users/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "4152fb6556ae83f7cdd6c362f17ad9bf",
"score": "0.81046426",
"text": "def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/users.json\"\t \n ... |
8cd24e8cfeef5bba0eaa3bfef7365904 | PUT /pages/1 PUT /pages/1.json | [
{
"docid": "6d9620e127a00bb1c758f73eb8a04a67",
"score": "0.0",
"text": "def update\n params[:page][:related_file_ids] ||= []\n @page = @site.pages.find(params[:id])\n @page.update_attributes(params[:page])\n record_activity(\"updated_page\", @page)\n respond_with(:site_admin, @page)\n en... | [
{
"docid": "7e2ed6388a7afc09296e603ff3f61a2c",
"score": "0.6833546",
"text": "def update\n @page = current_user.pages.with_slug!(params[:id])\n @page.attributes = params[:page]\n\n respond_to do |format|\n if @page.valid?\n @page.sections.destroy_all\n @page.update_attributes... |
d7f932c0bab2c842204d1c2dffba0337 | main_insurance return the insurance associated with this book. main insurance must contain only one element. | [
{
"docid": "33ebe7960ed30eac3a861c508df6010b",
"score": "0.77911925",
"text": "def main_insurance\n\t\tself.insurances.main.limit(1).first\n\tend",
"title": ""
}
] | [
{
"docid": "7694c1086a29cdd30f03c32c16821e56",
"score": "0.7031606",
"text": "def main_insurances\n\t\tself.insurances.where(is_main: true)\n\tend",
"title": ""
},
{
"docid": "8e4b5af97117d4a7de8e6d91cfd41ac2",
"score": "0.6723044",
"text": "def has_main_insurance?\n\t\tself.insuranc... |
fc6c6ce5055c83381da0c7764adce741 | DELETE /driversandcars/1 or /driversandcars/1.json | [
{
"docid": "ea641d85f0fdfba6e9c6579b926a086c",
"score": "0.6885269",
"text": "def destroy\n @driversandcar.destroy\n respond_to do |format|\n format.html { redirect_to driversandcars_url, notice: \"Driversandcar was successfully destroyed.\" }\n format.json { head :no_content }\n end\... | [
{
"docid": "b445c184893647d3482f8fbc6a507a52",
"score": "0.73330903",
"text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end",
"title": ""
},
{
"docid": "b1a17c1ee1af05c79fe156622df44818",
"score": "0.71663... |
4ffaa770cdad5570fd73a8ab92028e2f | Public: Calculates the NOT of the current key | [
{
"docid": "98c58218b4ff8cde9c9c4b71c8e9f526",
"score": "0.79254746",
"text": "def -@\n bit_operation(\"NOT\", key)\n end",
"title": ""
}
] | [
{
"docid": "8e253e122235615b7d968a53aef0aa2f",
"score": "0.78360873",
"text": "def -@\n operation(\"NOT\", key)\n end",
"title": ""
},
{
"docid": "ad3b182991ef11d6e1f135139ec3d952",
"score": "0.65621614",
"text": "def ~\n KeyPath.new [self], true\n end",
"titl... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "7d6bc229b48079d9586bf68d602c7d33",
"score": "0.0",
"text": "def problem_params\n params.require(:problem).permit(:course_id, :statement, :description, :solution, :references)\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"... |
23f45cd75898858ff262b4be5d2148b9 | Copies files from a given set of directories into a given destination directory. | [
{
"docid": "7b91ceb8e7052e79bf06d9dd3a932f1c",
"score": "0.7995846",
"text": "def copy_directories_to(destdir, directories, ant)\n ant.copy(:todir => destdir.to_s) {\n directories.each do |directory|\n ant.fileset(:dir => directory.to_s)\n end\n } unless director... | [
{
"docid": "ed10da3bec8f10e29bd0647996bb28c4",
"score": "0.7960511",
"text": "def copy_directories_to(destdir, directories, ant, excludes='')\n ant.copy(:todir => destdir.to_s) {\n directories.each do |directory|\n ant.fileset(:dir => directory.to_s, :excludes => excludes)\n end\n ... |
c16fea60cadf4eb22decd6f2327d5540 | p permutations([1, 2, 3]) | [
{
"docid": "6b5aa8740f0e47e253ac090cdc111da3",
"score": "0.0",
"text": "def bsearch(array, target)\n return 0 if array[0] == target\n return nil unless array.include?(target)\n position = 0\n #iterative thing\n middle_pos = array.length / 2\n if target > array[middle_pos]\n position += middle_p... | [
{
"docid": "2bb690084c0aa489c344441985afc981",
"score": "0.8417156",
"text": "def permutations(arr)\nend",
"title": ""
},
{
"docid": "2fcd028c369dc6d9dc4e7d27e797317b",
"score": "0.841276",
"text": "def permutations(arr)\n \nend",
"title": ""
},
{
"docid": "68a3eea1561... |
cea863d925f074073a164f4d6c26a007 | GET /service_cancels/new GET /service_cancels/new.xml | [
{
"docid": "cb997e98ec9e8c4d294bf7b14a2e6548",
"score": "0.71009874",
"text": "def new\n @service_cancel = ServiceCancel.new\n 1.times{@service_cancel.service_cancel_service.build}\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @service_cancel }\n... | [
{
"docid": "eaf484592a4cd87dc8078e7a60231963",
"score": "0.737193",
"text": "def new\n @service_cancel_service = ServiceCancelService.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @service_cancel_service }\n end\n end",
"title": ""
}... |
3a19ef96f8adf75630b1dbe63e0860d5 | Initialize with a default_grid with blank values | [
{
"docid": "eda74f6fc57eb2c69d7706d4789329b8",
"score": "0.6034882",
"text": "def initialize\n\t\t\t@grid = default_grid\n\t\t\t@solution = random_solution\n\t\tend",
"title": ""
}
] | [
{
"docid": "e17c696eab1198e48bd9d4cfdd2b1811",
"score": "0.7913608",
"text": "def initialize_grid\n plain_grid_matrix = []\n rows.to_i.times do |y|\n cols.to_i.times do |x|\n plain_grid_matrix.push(CELL_EMPTY)\n end\n end\n self.update_attribute('grid', plain_grid_matrix.joi... |
d7aadda2861f2a6ef56d3a1ecf1ae69c | PATCH/PUT /dies/1 or /dies/1.json | [
{
"docid": "c24069b3ea74af8d298d2554cb607194",
"score": "0.62625664",
"text": "def update\n respond_to do |format|\n if @dy.update(dy_params)\n format.html { redirect_to @dy, notice: \"Die was successfully updated.\" }\n format.json { render :show, status: :ok, location: @dy }\n ... | [
{
"docid": "d814ccfff3e23c74b4fa9861ecd93c5c",
"score": "0.6516816",
"text": "def update\n @diddy = Diddy.find(params[:id])\n\n respond_to do |format|\n if @diddy.update_attributes(params[:diddy])\n format.html { redirect_to @diddy, notice: 'Diddy was successfully updated.' }\n ... |
45b1d008c4739b8e2118377f19174997 | PUT /pages/1 PUT /pages/1.xml | [
{
"docid": "901cc3e97a0b921455cef5bd46fa2057",
"score": "0.6274846",
"text": "def update\n @page = Page.find(params[:id])\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n format.html { redirect_to(@page, :notice => 'Page was successfully updated.') }\n fo... | [
{
"docid": "90fdc60037bb0818a8c51046ce6e4c6c",
"score": "0.66303974",
"text": "def update\n @page = Page.find(params[:id])\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n format.json { head :no_content }\n format.xml { head :no_content }\n else\n ... |
d3ad6d6d15aec834bd54fa297ed85fbf | Place raw failed response from gateway here | [
{
"docid": "7b1eece8ac0646a2c32f7944a5a44cc7",
"score": "0.6376436",
"text": "def failed_purchase_response\n build_response(\n :TxnResponseCode => '3',\n :TransactionNo => '654321'\n )\n end",
"title": ""
}
] | [
{
"docid": "742703034a6a8329e6d771cfce9ad04f",
"score": "0.71565604",
"text": "def bad_response(response)\n puts 'ERROR:' \\\n \"\\nCode: #{response.code}\" \\\n \"\\nBody: #{response.body}\" unless response.is_a?(Net::HTTPSuccess)\n end",
"title": ""
},
{
"docid": ... |
53b002a50229f087cd8bf26c2debe740 | catalog_product_attribute.currentStore Set/Get current store view Return: int Arguments: mixed storeView store view id or code (optional) | [
{
"docid": "cf4107635c3266d5fd0ebff43d5321bf",
"score": "0.57577306",
"text": "def current_store(*args)\n commit(\"currentStore\", *args)\n end",
"title": ""
}
] | [
{
"docid": "0f2d5b7d2bd8869788e608c1ab1f0d42",
"score": "0.60056204",
"text": "def set_store\n @store = current_user.sellers.first.store\n end",
"title": ""
},
{
"docid": "ab79775755ad1a3688f779fc3824a7c5",
"score": "0.59903806",
"text": "def set_store\n @store = current_... |
174af108b04ce87e5c7a3057216ccd62 | GET /gui/view_key_infos/new GET /gui/view_key_infos/new.json | [
{
"docid": "4af49e33f4c9a5b5bda0dd190ae37e27",
"score": "0.83832777",
"text": "def new\n @gui_view_key_info = Gui::ViewKeyInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gui_view_key_info }\n end\n end",
"title": ""
}
] | [
{
"docid": "aa3f85026e26289dd92dec04f74235f8",
"score": "0.78989655",
"text": "def new\n @key = Keys.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @key }\n end\n end",
"title": ""
},
{
"docid": "b665e4dc9d1db80615f8e0e4df33c357",... |
3e11e1089c57d94cbf1378452bfffbae | Function to validate or not a flag | [
{
"docid": "44d6497110fb62d1edfc8acdba33d1b0",
"score": "0.6529549",
"text": "def validateTheFlag(survivor, flagger)\n conditionToValidate = false\n if survivor == flagger\n message = 'A survivor can not give his own flag'\n elsif flagger.status == true\n message = 'An abducted survivor can not... | [
{
"docid": "a1c7ac2cb73fa5eac7e58a979021b5c5",
"score": "0.740068",
"text": "def valid_flag?(flag)\n if flag.length == 1\n @opts.keys.any? { |opt| opt[0] == flag[0] }\n else\n @opts.include?(flag)\n end\n end",
"title": ""
},
{
"docid": "c0887904ffdfaafb988f8d162765d1eb",... |
9dcd4a1186a5268bc75bf8645cfa6d98 | POST /referralmedicals POST /referralmedicals.json | [
{
"docid": "496ff279cfa3d1fd5eeb48d4c9385a23",
"score": "0.7563148",
"text": "def create\n @referralmedical = Referralmedical.new(referralmedical_params)\n\n respond_to do |format|\n if @referralmedical.save\n format.html { redirect_to @referralmedical, notice: 'Referralmedical was suc... | [
{
"docid": "b7f4e38db068a7e59a5bbdcbc2b15d2d",
"score": "0.6857774",
"text": "def create\n @referral = Referral.new(params[:referral])\n\n respond_to do |format|\n if @referral.save\n format.html { redirect_to @referral, notice: 'Referral was successfully created.' }\n format.js... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "00c7b180910ce0bdd520a84de1c5332e",
"score": "0.0",
"text": "def set_station\n @station = Station.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... |
94e4eab04cecfe3e54ba4737788a4eaf | Stores the events in the EventStore and publishes the events to the registered event_handlers. Streams_with_Events is an enumerable of pairs from `StreamRecord` to arrays of uncommitted `Event`s. | [
{
"docid": "55b09dd4767a78c6884d27ff42d3c6e9",
"score": "0.6542154",
"text": "def commit_events(command, streams_with_events)\n store_events(command, streams_with_events)\n publish_events(streams_with_events.flat_map { |_, events| events }, event_handlers)\n end",
"title": ""
}
... | [
{
"docid": "9db70e92bcf2dfdc723626d921f73c89",
"score": "0.63499236",
"text": "def commit_events(command, streams_with_events)\n fail ArgumentError, 'command is required' if command.nil?\n\n Sequent.logger.debug(\"[EventStore] Committing events for command #{command.class}\")\n\n st... |
2c468313653e49c225209431575fbcfa | Write a function that returns the smaller of 2 numbers smallest_number | [
{
"docid": "2b211c854ffe13a59033702290ead73b",
"score": "0.8560605",
"text": "def smallest_number first_Num, second_Num\n\t[first_Num, second_Num].min\nend",
"title": ""
}
] | [
{
"docid": "476911ff0df6de82063753c5e7a453fd",
"score": "0.8964837",
"text": "def smallest_number num1, num2\n if num1 < num2\n return num1\n end\n num2\nend",
"title": ""
},
{
"docid": "ffe1791da347b0e9f3a30b53f4febc7b",
"score": "0.88823885",
"text": "def smallest_num... |
8036db944733df3196ab3d7fd3fe6def | Render a dropdown filled with actions | [
{
"docid": "369bc2ea63ad0edb9f1a21d846ca0eb0",
"score": "0.7896362",
"text": "def record_actions_dropdown actions\n tag.div class: 'ui floating dropdown icon button' do\n concat tag.i class: 'dropdown icon'\n concat record_actions_items(actions)\n end\n end",
"title": ""
... | [
{
"docid": "932c171a120e4f13ecd77a5e71b2ed7e",
"score": "0.7058949",
"text": "def render\n select(@menu_attributes.merge({name: @name, id: \"#{@name}-dropdown\"})) do\n @choices.component_map do |c|\n option(@item_attributes.merge({value: c})) {@block ? @block.call(c) : c}\n end\n ... |
997231685dff3f0d9d909375e1ec504d | Write a method named print_me that prints "I'm printing within the method!" when invoked. print_me | [
{
"docid": "2101279042189d9d00466f18d345b223",
"score": "0.87478375",
"text": "def print_me\n puts \"I'm printing within the method!\"\nend",
"title": ""
}
] | [
{
"docid": "b682c086fd8581511a8d751f147d0b29",
"score": "0.8795935",
"text": "def print_me\n print \"I'm printing within the method!\"\nend",
"title": ""
},
{
"docid": "c8a00e6533a39a83cb2a0a3e35c622d6",
"score": "0.8780953",
"text": "def print_me \n \"I'm printing within the met... |
21ef3a73aad737894d5d741f4080e930 | GET /user/1 GET /user/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "a95dfe28d6b386aafc5fb53749e84258",
"score": "0.76197636",
"text": "def user\n get(ROBINHOOD_USER_ROUTE, return_as_json: true)\n end",
"title": ""
},
{
"docid": "6092373544781919e42a7f56772b8bba",
"score": "0.74161625",
"text": "def show\n # user = User.find(params)... |
ac925de39782477102e44fe15ec6b9c8 | Creates entry in the ledger. Creates entries in both credit and debit account and linking transaction between those two entries. Credit and debit accounts and given amount have to be in the same currency otherwise an exception is raised. | [
{
"docid": "e6673d875d1687bc3d6dae8b6c05d8aa",
"score": "0.75308734",
"text": "def create_entry(amount, options)\n Aloe::LedgerEntry.new(amount, options).create!\n end",
"title": ""
}
] | [
{
"docid": "a46359173e8862f9f283aa911b955955",
"score": "0.7021896",
"text": "def create_entry(cents_amount)\n with_lock(true) do\n if cents_amount < 0 && !debit_possible?(-cents_amount)\n raise Aloe::InsufficientBalanceError.new(self, -cents_amount)\n end\n entry = en... |
a9075a247789e38ac05491b2dd1e47b0 | is this a witness script(witness_v0_keyhash or witness_v0_scripthash) | [
{
"docid": "00d727e131c0332c0d531dcea3040305",
"score": "0.7577398",
"text": "def is_witness?\n is_witness_v0_keyhash? || is_witness_v0_scripthash?\n end",
"title": ""
}
] | [
{
"docid": "8bf403b63610968a56bb4ee38d23c819",
"score": "0.7761903",
"text": "def is_witness_v0_scripthash?\n @chunks.length == 2 &&@chunks[0] == 0 && @chunks[1].is_a?(String) && @chunks[1].bytesize == 32\n end",
"title": ""
},
{
"docid": "b8049f439fd96a7a24dcc1e87ad03998",
"score": ... |
9ec68f21f66ae942ac2be924cd257e52 | DELETE /lead_sources/1 DELETE /lead_sources/1.json | [
{
"docid": "83c6dc5b1d52c63fa15550edc1158b7e",
"score": "0.78750193",
"text": "def destroy\n @lead_source = LeadSource.find(params[:id])\n @lead_source.destroy\n\n respond_to do |format|\n format.html { redirect_to lead_sources_url }\n format.json { head :no_content }\n end\n end"... | [
{
"docid": "499848d7b4d1af349898e2e3035692db",
"score": "0.722608",
"text": "def destroy\n @source.destroy\n respond_to do |format|\n format.html { redirect_to sources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f36e76a8b05c81c07903db... |
ea3b8831d3adb0e085caa1afc5c533d6 | Consumes n characters from the input, returning them as a slice of the input. source://parslet2.0.0/lib/parslet/source.rb:41 | [
{
"docid": "032a97a4c059873330e6fb915bd98c6b",
"score": "0.5580201",
"text": "def consume(n); end",
"title": ""
}
] | [
{
"docid": "734a359e151f07645f6524cc0d0894f6",
"score": "0.69114393",
"text": "def nextchars(n)\n raise \"substring bounds error\" if (@index + n > @source.length)\n i = @index\n @index += n\n return(@source[i,n])\n end",
"title": ""
},
{
"docid": "909fa5771eeb878b3510... |
8086a66676c6908ee8dc02297fce9b92 | POST /students POST /students.json | [
{
"docid": "5ad12723648a2a0c03b2bf11e7c536f8",
"score": "0.0",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n #ExampleMailer.send_email(@student).deliver_now\n format.html { redirect_to @student, notice: 'Student was ... | [
{
"docid": "2befafcc6f076a73b42fca9ccbe2e9dc",
"score": "0.7812279",
"text": "def create\n require 'net/http'\n require 'json'\n\n student = Student.new(student_params)\n\n uri = URI('http://localhost:3000/students.json')\n\n request = Net::HTTP::Post.new uri, { 'Content-Type' => 'applica... |
17641efffd58945db38db02138038228 | Process a pubmed records | [
{
"docid": "9f6d01ed0fbff84f27a00838c76db5f5",
"score": "0.5232264",
"text": "def process_pmid(author, pmid)\n pub = PubmedSourceRecord.get_pub_by_pmid(pmid)\n # Make sure author is assigned\n author.assign_pub(pub)\n end",
"title": ""
}
] | [
{
"docid": "dd5f0adfcdbaf2bae719e12609890546",
"score": "0.70621145",
"text": "def post_process(_records)\n end",
"title": ""
},
{
"docid": "87a5cce89e240b6e645930fedda6fb75",
"score": "0.648356",
"text": "def process *args, &block\n raise \"override the process method in... |
de60ddb927a3761c7d7e5a34e5c45a1d | Broadcasts an enumerate request. All devices will respond with an enumerate callback. | [
{
"docid": "cf9f7263da695f5d63aa08aba8c0787c",
"score": "0.6957986",
"text": "def enumerate\n request, _, _ = create_packet_header nil, 8, FUNCTION_ENUMERATE\n\n send_request request\n end",
"title": ""
}
] | [
{
"docid": "f31a14550d77d722f69ba157444b2f28",
"score": "0.7597091",
"text": "def enumerate(&block)\n @enumerate_callback = block\n\n send pack([BROADCAST_ADDRESS, FUNCTION_ENUMERATE, 4], 'C C S')\n end",
"title": ""
},
{
"docid": "63c21a01457c6529bae3e422d2bd2ce0",
"score":... |
9989c368630c33d02ac48692822dc88a | DELETE /rappers/1 DELETE /rappers/1.json | [
{
"docid": "c591f9010f35beb29ba08df63bd21ffe",
"score": "0.6663377",
"text": "def destroy\n @rapper.destroy\n respond_to do |format|\n format.html { redirect_to rappers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "990377999ad16a878038f0e13b56d8d5",
"score": "0.64709085",
"text": "def destroy\n @url_mapper.destroy\n respond_to do |format|\n format.html { redirect_to url_mappers_url, notice: 'Url mapper was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
... |
4bf6e487b5523f48d11dd97b7577f10e | POST /funds POST /funds.json | [
{
"docid": "a9725ac6fae0040dd444681765d7ab25",
"score": "0.6341187",
"text": "def create\n @fund = Fund.new(fund_params)\n\n respond_to do |format|\n if @fund.save\n FundMailer.fund_confirmation(@fund,current_user).deliver\n format.html { redirect_to @fund, notice: 'Fund was suc... | [
{
"docid": "18085d8b32378c0d9c4ae243d90b9b26",
"score": "0.73681676",
"text": "def create\n @fund = Fund.new(fund_params)\n\n respond_to do |format|\n if @fund.save\n format.html { redirect_to funds_path, notice: 'Fund was successfully created.' }\n format.json { render :index, ... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "79b3fe341df0d9bcaf230e25b6ef915e",
"score": "0.0",
"text": "def location_params\n params.require(:location).permit(:name, :address, :saved, :checkin, :checkin_time, :description, :URL, :lat, :lon, :review => [:comments], :activity => [:name], :location_type => [:name], activity_ids: [],... | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7495027",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.69566035",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
5bdd100238cff1b8af7f2743a03b1234 | POST /network_models POST /network_models.xml | [
{
"docid": "d90af3ba2e5fa99bd010b191d6533636",
"score": "0.6899103",
"text": "def create\n @network_model = NetworkModel.new(params[:network_model])\n\n respond_to do |format|\n if @network_model.save\n flash[:notice] = 'NetworkModel was successfully created.'\n format.html { re... | [
{
"docid": "25cc4ed328e9c859f2c57ca5c5489b4c",
"score": "0.6212317",
"text": "def create\n \t@title = \"Create Networks\"\n @network = Network.new(params[:network])\n respond_to do |format|\n if @network.save\n flash[:notice] = 'Network was successfully created.'\n format.html ... |
d20957483db1846bcbec42d30f98758f | GET /taches/new GET /taches/new.json | [
{
"docid": "30a6b1c2957bcade6bfa10ef66665437",
"score": "0.6999052",
"text": "def new\n @tache = Tache.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tache }\n end\n end",
"title": ""
}
] | [
{
"docid": "c60e0c2f3fad9d7923d0d4ed7bd95436",
"score": "0.72921103",
"text": "def new\n @title = t 'view.teaches.new_title'\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @teach }\n end\n end",
"title": ""
},
{
"docid": "0998b2be4519... |
07845a310ee5dd9ca20ea3c09cbf269b | GET /set_lists GET /set_lists.xml | [
{
"docid": "49d3d0e311534bdd0e9f1b7bdb336de7",
"score": "0.715449",
"text": "def index\n @set_lists = SetList.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @set_lists }\n format.json { render :json => @set_lists }\n end\n end",
... | [
{
"docid": "c2c6c7fb0c49180e9474b8eff2409fd5",
"score": "0.7729043",
"text": "def lists\n\tget('/lists.json')\nend",
"title": ""
},
{
"docid": "f551724494c644ea0e6e368d06e26eda",
"score": "0.7719085",
"text": "def get_lists\n return base_uri('get', 'lists')\n end",
"title": "... |