query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
c42c282caa188604275a203789389cf6 | Normalize any whitespace to a single ASCII space character and strip leading/trailing whitepsace. | [
{
"docid": "9cb25471d1d08cc453baf76cd474ce08",
"score": "0.7012926",
"text": "def norm_space( q )\n q.gsub(@spaces, ' ').strip\n end",
"title": ""
}
] | [
{
"docid": "93169a4b3d4dbd7c865f7806c24e3c17",
"score": "0.83414334",
"text": "def normalize_whitespace(input)\n input.to_s.gsub(%r!\\s+!, \" \").tap(&:strip!)\n end",
"title": ""
},
{
"docid": "93169a4b3d4dbd7c865f7806c24e3c17",
"score": "0.83414334",
"text": "def normalize_... |
7ab20fffce139267010d0e69726bb290 | format_versioned_package formats a pacakge name with a version to allow for better UX on the command line. For instance, a package `docker` should be called `docker` without a version but `docker1.11.3` with one, but the user only wants to provide the `1.11.3` version, not the dash as well, so a simple concat is not po... | [
{
"docid": "3070d593255546b5828ffac9d03fd65b",
"score": "0.8702857",
"text": "def format_versioned_package(name, version)\n if version\n \"#{name}-#{version}\"\n else\n name\n end\n end",
"title": ""
}
] | [
{
"docid": "c6aea1619b5664eea95d81bbf100d63d",
"score": "0.67696875",
"text": "def package_version_name\n pn = Package.get_name(self.package_id)\n \"#{pn}-#{self.name}\"\n end",
"title": ""
},
{
"docid": "e685b9c00c6b0722ad86e024c867943f",
"score": "0.66368216",
"text": "def f... |
e561e11bcf379ef5dc139c210017366b | Only allow a list of trusted parameters through. | [
{
"docid": "9ae3f891c955b8099eadfe6a5c7ee299",
"score": "0.0",
"text": "def originator_params\n merged_params = { updated_by: @user.id }\n merged_params = { created_by: @user.id } if params[:action] == 'create'\n\n params.require(:originator).permit(\n :product_category_consumer,\n :p... | [
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.69497335",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6812623",
"text": "def strong_params\n params.require(:listing_member).permi... |
779def4d823a70fd59ddcd4c0445c5a4 | delete selected item in the shopping trolley | [
{
"docid": "9b063f8efc9d4b5c87e49426e79fe6ae",
"score": "0.7314318",
"text": "def delete_item_in_trolley\n session[:item].each do |item|\n if item[\"item_buy\"].to_s.eql?(params[:id])\n session[:item].delete(item)\n end\n end\n redirect_to home_trolley_path\n end",
"title"... | [
{
"docid": "c5ec785fae7224238fae5dfa3578a2f8",
"score": "0.7301703",
"text": "def delitem\n Equipment.delete(params['id']);\n end",
"title": ""
},
{
"docid": "ca372d4b88c569db9e73213d15115bf5",
"score": "0.7267204",
"text": "def delete_item(item)\n \t@items.delete(item)\... |
6a2e9b2fb369b62122ccf39fab7f4474 | Method to add an item to a list input: item name and optional quantity steps: create a new key for the new item assign the quantity of the value to the key output:new key and value in the hash | [
{
"docid": "fdf024acec36c0ff292221a7cb82591f",
"score": "0.0",
"text": "def adder(key, value)\n new_list = {}\n new_list.store(key, value)\n new_list\nend",
"title": ""
}
] | [
{
"docid": "86885b2cc2b422e308be852d1d2ce062",
"score": "0.8833117",
"text": "def add_item(list_hash,item_name, item_qty=1)\n# steps:\n # store item in the list hash, item name will be the key, value is going to be the qty\n\tlist_hash[item_name] = item_qty\n# output: updated hash with new items (key v... |
9ab82ac04085a1ba53ee80b86e80d653 | Processing When Not Moving last_moving : Was it moving previously? | [
{
"docid": "37a40a9521be37a08e719d337cb2ca2c",
"score": "0.67706317",
"text": "def update_nonmoving(last_moving)\n return if $game_map.interpreter.running?\n if last_moving\n $game_party.on_player_walk\n return if check_touch_event\n end\n if movable? && Input.trigger?(:C)\n ret... | [
{
"docid": "4d43a4d29a0e69ed46665290534545ff",
"score": "0.7311325",
"text": "def moving?\n !self.moving_lines.empty?\n end",
"title": ""
},
{
"docid": "a4e99d9a58f854a4df24eb0d4be9fb3e",
"score": "0.698423",
"text": "def last_move\n\t\tmove[-1, 1]\n\tend",
"title": ""
... |
9b889707a6932bebbd2e7916d4d6124d | Write BIFF record FILTERMODE to indicate that the worksheet contains AUTOFILTER record, ie. autofilters with a filter set. | [
{
"docid": "44a019501fe5cf883a824545b96af36c",
"score": "0.7520932",
"text": "def store_filtermode #:nodoc:\n # Only write the record if the worksheet contains a filtered autofilter.\n return '' if @filter_on == 0\n\n record = 0x009B # Record identifier\n length = 0x0000 ... | [
{
"docid": "6b4f15d2cea4ecc0a8c88e4c626185c2",
"score": "0.68351096",
"text": "def store_autofilterinfo #:nodoc:\n # Only write the record if the worksheet contains an autofilter.\n return '' if @filter_area.count == 0\n\n record = 0x009D # Record identifier\n length = 0x000... |
1cd8f602bbadd9982602f2bf391ff44b | Print something to the output stream | [
{
"docid": "e1649cb9c152e43f31a54d5971054cd0",
"score": "0.7034597",
"text": "def write(msg)\n self.output.puts(msg)\n end",
"title": ""
}
] | [
{
"docid": "bdaab15bd2e1f97f9abe675b35b7819a",
"score": "0.77461046",
"text": "def print(output)\n @output_stream.print(output)\n end",
"title": ""
},
{
"docid": "bdaab15bd2e1f97f9abe675b35b7819a",
"score": "0.77461046",
"text": "def print(output)\n @output_stream.print(... |
d7701b5f4960ad7f3cb2f2568575233a | Data to build search filter input for countries | [
{
"docid": "093cf3e7841b8462f59e01c74784058f",
"score": "0.7326734",
"text": "def filter_countries\n {\n 'name': 'countries[]',\n 'options': @country_list.any? ? @country_list : Country.where(slug: @filter.countries),\n 'selected': @filter.countries,\n }\n end",
"ti... | [
{
"docid": "2bd46ebf153e54dab1eb165587cf55ff",
"score": "0.72417396",
"text": "def country_filter\n return if filters[:country].blank?\n\n if filters[:country] == Country::CODE_GLOBAL\n @results = @results.where(\"countries = '[]'\")\n else\n @results = @results.where('countries @> ?'... |
f603e0a6336bd8be6378e7d4fb472b28 | CDN mode Determine if the helpers should always generate absolute URL. This is useful in production mode. | [
{
"docid": "b5d4870851a0e1364e414023b5bef83d",
"score": "0.62697756",
"text": "def cdn(value = nil)\n if value.nil?\n @cdn\n else\n @cdn = !!value\n end\n end",
"title": ""
}
] | [
{
"docid": "3128ac27eec5a029da3602471786fb0e",
"score": "0.65432847",
"text": "def relative?\n self.host.nil?\n end",
"title": ""
},
{
"docid": "fefe7fc4960828345052e6c095fdfd6c",
"score": "0.6516141",
"text": "def cdn?\n self['picture']['cdn_url'] &&\n self['pict... |
a8ad5981fa332c5d76b66e7ec5e5ec9b | Include module in instance | [
{
"docid": "2d2062d0aa1348ccf09dc792dff6d049",
"score": "0.6188519",
"text": "def include(modules)\n modules = Array(modules)\n\n modules.each { |m| self.class.include m }\n end",
"title": ""
}
] | [
{
"docid": "02f38785d0f452851677a4c900a58cb3",
"score": "0.73267406",
"text": "def module_include(base, mod); end",
"title": ""
},
{
"docid": "02f38785d0f452851677a4c900a58cb3",
"score": "0.73267406",
"text": "def module_include(base, mod); end",
"title": ""
},
{
"docid":... |
8e72f976d6022d9476345e1096b16c57 | Retrieves a specific listing. | [
{
"docid": "f7adeef4a53925eef9f8ea01d6645d02",
"score": "0.0",
"text": "def listings_get(id, opts = {})\n data, _status_code, _headers = listings_get_with_http_info(id, opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "4934c47429f5b791c5d14758b376c39c",
"score": "0.7800077",
"text": "def get_listing(listing_id)\n query_and_build \"marketplace/listings/#{listing_id}\"\n end",
"title": ""
},
{
"docid": "b5d36fe5a5c0fa018df8c264a20645e7",
"score": "0.72863805",
"text": "def show\n @... |
cf1f734ffad545cfa332637a4472a92a | get_bart_estimate_departure_filter Requests current advisory information. Arguments +cmd=etd+ => Requests current advisory information (Required) +orig=+ => Only get messages for specified station. Defaults to "all". (Optional) [Note: currently only "orig=all" or leaving the orig parameter off are supported, the BART s... | [
{
"docid": "2fbf8341bf77bf0cc3583fe24927360b",
"score": "0.7787741",
"text": "def get_bart_estimate_departure_filter\n bart_estimate_departure_filter\n end",
"title": ""
}
] | [
{
"docid": "a8808570cd22a0f09cb7c8e3da99d926",
"score": "0.77648586",
"text": "def get_bart_estimate_departure\n \n client_options = {\n orig: client_params[:orig]\n #plat: client_params[:plat],\n #dir: client_params[:dir]\n }\n bart_estimate_departure(client_options)\n end",
... |
e561e11bcf379ef5dc139c210017366b | Only allow a list of trusted parameters through. | [
{
"docid": "26346a90aa7ec9892e0afc5f5e21ac66",
"score": "0.0",
"text": "def facility_type_params\n params.require(:facility_type).permit(:code, :name)\n end",
"title": ""
}
] | [
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.69497335",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6812623",
"text": "def strong_params\n params.require(:listing_member).permi... |
08cb716168dcc3ef1c491abe2eedf29c | Where the files are expected. | [
{
"docid": "e36090e9c2b7f4dbe67eb3a2ed37294e",
"score": "0.0",
"text": "def output_path\n \"build\"\n end",
"title": ""
}
] | [
{
"docid": "49c33ef6d359a1a34f8d5c9225a09af3",
"score": "0.6775362",
"text": "def test_files\n get_folder_files(TESTS_PATH)\n end",
"title": ""
},
{
"docid": "20eb57ac923026c6ecb4b400b934aaf6",
"score": "0.67448044",
"text": "def test_files\n files = tests\n files =... |
8059afc4c35bdd8288233127bc04afe6 | DELETE /product_sub_sections/1 DELETE /product_sub_sections/1.xml | [
{
"docid": "c5900a09b715a76a70f0b041f3f1112b",
"score": "0.74426484",
"text": "def destroy\n @product_sub_section = ProductSubSection.find(params[:id])\n @product_sub_section.destroy\n\n respond_to do |format|\n format.html { redirect_to(product_sub_sections_url) }\n format.xml { hea... | [
{
"docid": "67c9dcd570fcf2a6e9658e57f77730b3",
"score": "0.6977157",
"text": "def destroy\n @sub_section = SubSection.find(params[:id])\n @sub_section.destroy\n\n respond_to do |format|\n format.html { redirect_to(sub_sections_url) }\n format.xml { head :ok }\n end\n end",
"t... |
d5ad1c5e3e70b02167be0c7c99ecbd7e | reduce 580 omitted reduce 581 omitted | [
{
"docid": "b4ec0671885ea1f3af1c76ec3bb40471",
"score": "0.0",
"text": "def _reduce_582(val, _values, result)\n identifier = val[1].to_sym\n\n self.env[identifier] = :lvar\n result = \"&#{identifier}\".to_sym\n \n resul... | [
{
"docid": "dd458ee5bd7f974c08686357ef463ece",
"score": "0.7379507",
"text": "def _reduce_608(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "ad801b8250ddef70cf7a067f3e475838",
"score": "0.7302435",
"text": "de... |
6f09b0877553556cb5d7003543c505df | Return the path to a test resource (in the `testresources` directory) | [
{
"docid": "2236fb8772ab8874f35ac7548bc13ddf",
"score": "0.8282118",
"text": "def resource_path(*parts)\n File.join(File.dirname(__dir__), 'test-resources', *parts)\nend",
"title": ""
}
] | [
{
"docid": "a181c510d6647f186b5d2f782062e479",
"score": "0.81923145",
"text": "def get_test_resource(path)\n abs_path = File.join(::Config::resource_path('test'), path)\n Pathname.new(abs_path)\n end",
"title": ""
},
{
"docid": "9c36a2a57cd1d22e636a95771b80368a",
"score": "0... |
adf2596a730b30903d90c83c9c547b42 | all parametars are optional :name file name :cache client cache in seconds :content_type string type :inline sets disposition to inline if true :disposition inline or attachment :content raw file data | [
{
"docid": "1c30b4b2a8cff2a89fc97ef212d3f90c",
"score": "0.59126025",
"text": "def initialize file, in_opts={}\n opts = in_opts.to_hwia :name, :cache, :content_type, :inline, :disposition, :content\n opts.disposition ||= opts.inline.class == TrueClass ? 'inline' : 'attachment'\n opt... | [
{
"docid": "d8c8cee0c2c19be9c0a9334e48c3c3c8",
"score": "0.7077369",
"text": "def get_file\n \n @file = Datafile.find params[:file]\n send_file @file.full_filename,:type => @file.content_type,:disposition => 'inline'\n\n end",
"title": ""
},
{
"docid": "01f6cf780af2e22590926730ccc590... |
9a0efc1a481d57007bdff11de53a2e24 | Returns the currently loaded version of Action View as a Gem::Version. source://actionview//lib/action_view/gem_version.rb5 | [
{
"docid": "f8f7913d4158cf6cbeaf609f6ef1b208",
"score": "0.6797159",
"text": "def gem_version; end",
"title": ""
}
] | [
{
"docid": "859debe281fc8de075c92d87fd41dcaa",
"score": "0.7354653",
"text": "def gem_version\n Gem::Version.new VERSION\n end",
"title": ""
},
{
"docid": "71b8acd8d39e90a7a0a8c12fff3d9cac",
"score": "0.73230124",
"text": "def gem_version\n ::Gem::Version.new(VERSION... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "e435ca7bde83c81297dde8b3376ffa9f",
"score": "0.0",
"text": "def tcobrador_params\n params.require(:tcobrador).permit(:idcobrador, :clave, :correo, :celular, :direccion, :estado)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74959",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6957448",
"text": "def strong_params\n params.require(:request).permit(param_whiteli... |
efdcbede5e198527e50eebe22b7fcabf | An audit's action can be one of "create", "destroy" or "update" | [
{
"docid": "4ccd9d4f4e8446fe2ca6b6d435d279a5",
"score": "0.73593664",
"text": "def action\n @action ||= changes.keys.include?(\"state\") && audit.action == \"update\" ? STATE_CHANGE : audit.action\n end",
"title": ""
}
] | [
{
"docid": "7cbbc15767d016b3e9ade9173d82960e",
"score": "0.7387405",
"text": "def action\n @action ||= audited_changes.keys.include?(\"state\") && audit.action == \"update\" ? STATE_CHANGE : audit.action\n end",
"title": ""
},
{
"docid": "28f5b5362c3d4efd89952019af075b35",
"score... |
f3f09fde80e20e54de6c148e07ae4d7e | random Greeting chosen each time a page is reloaded | [
{
"docid": "2b60a04b33178a1b9842e1329b767d91",
"score": "0.79206085",
"text": "def greeting\n greetings = [\"Hello\", \"Hey\", \"Greetings\", \"Salutations\", \"Welcome\"]\n greetings[rand(greetings.size)]\n end",
"title": ""
}
] | [
{
"docid": "bb3ca2ba8d67a383f2e032b35557a2b5",
"score": "0.79333645",
"text": "def greeting\n\t\trandom_response(:greeting)\n\tend",
"title": ""
},
{
"docid": "f031d12915a48090b01a273a10ce112e",
"score": "0.7836935",
"text": "def greeting\n random_response(:greeting)\n end",
... |
5db16ec7ba70128436904f1b7a43c351 | Name accessors which return lists of nodes, along with the kind of node they return, if possible. Add a reader for these children Add a persistent update method to add a child Generate a `children` method | [
{
"docid": "5ed8b3c0c7799c1d3d4b3035155e5175",
"score": "0.0",
"text": "def children_methods(children_of_type)\n if defined?(@children_methods)\n raise \"Can't re-call .children_methods for #{self} (already have: #{@children_methods})\"\n else\n @children_... | [
{
"docid": "b127805966f570c30262a362f035792d",
"score": "0.71182483",
"text": "def get_children\n # Interface method\n end",
"title": ""
},
{
"docid": "9a049c1c8bc39a68028c9b2e10b35f48",
"score": "0.6912399",
"text": "def attr_children(*names)\n\n names.each do... |
7540c96e653de453e78b1ef9671e8ceb | Retrieve a single page of InsightsAssessmentsCommentInstance records from the API. Request is executed immediately. | [
{
"docid": "a38e88820b69e3911492e1bed5b19029",
"score": "0.67673874",
"text": "def page(segment_id: :unset, agent_id: :unset, token: :unset, page_token: :unset, page_number: :unset, page_size: :unset)\n params = Twilio::Values.of({\n 'SegmentId' => segment_id,\n ... | [
{
"docid": "a2b44be6e7a2a8224a9b34c1f3539c05",
"score": "0.6955879",
"text": "def get_instance(payload)\n InsightsAssessmentsCommentInstance.new(@version, payload)\n end",
"title": ""
},
{
"docid": "4f56726792c1b6e57449859034f43e7c",
"score": "0.... |
1c38a63c7f101e7fb7844e783c838e06 | Overrides AbilityHelper.render_visibility_link to fix bug reported in UMRDR issue 727: Link provided by render_visibility_link method had path that displays a form to edit all attributes for a document. New method simply renders the visibility_badge for the document. | [
{
"docid": "b9a7e7eb922ada8b4791f5890308b7a3",
"score": "0.7783333",
"text": "def render_visibility_link(document)\n visibility_badge(document.visibility)\n end",
"title": ""
}
] | [
{
"docid": "ab199c6b1591aedfb0eb9e10d8f4f366",
"score": "0.61575127",
"text": "def visibility_badge(value, public_readable_state = nil)\n PermissionBadge.new(value, public_readable_state).render\n end",
"title": ""
},
{
"docid": "fc7cdf938934913ff7f599446e21c220",
"score": "0.6046006... |
3e3d22e684cf0e559ce63fa0162dd9c4 | headings: == Level two heading (H2) === Level three heading (H3) | [
{
"docid": "77c9ff36f00050fd2380b2ccd40017d3",
"score": "0.7049192",
"text": "def headings\n end",
"title": ""
}
] | [
{
"docid": "16eb4fb00f593a6e63f25d6fac8d0bcd",
"score": "0.7479081",
"text": "def heading_level(obj, level)\n tag_do(\"h#{level}\", obj)\n end",
"title": ""
},
{
"docid": "c80673623ffb444a77e6dd5b0ac25cf3",
"score": "0.7382425",
"text": "def header text, level, _=nil\n # str... |
2d3f2f6291224ca401594a24c4ec21ba | GET /projects GET /projects.json | [
{
"docid": "42ad53d3558c6fbbf9fc83dde28cd4d8",
"score": "0.0",
"text": "def index\n @projects = Project.order(updated_at: :desc, created_at: :desc).page(params[:page]).per(20)\n end",
"title": ""
}
] | [
{
"docid": "dc8505687156cb859adc07f1e0435407",
"score": "0.88659525",
"text": "def projects\n return get(\"/projects/list\")\n end",
"title": ""
},
{
"docid": "e5cff083faf736771900db26645e7ffe",
"score": "0.873058",
"text": "def get_projects\n self.class.get(\"/projects.json... |
75eafb58c5a94c1a4d2b96ec8c9253f0 | Control how the result rows are sorted. Note that you can only sort by clustering keys, and in the case of multiple clustering keys you can only sort by the schema's clustering order or the reverse of the clustering order for all keys. | [
{
"docid": "e586dec2836ccbb2391cad794b0ec9d0",
"score": "0.0",
"text": "def order(pairs)\n clone.tap do |data_set|\n data_set.sort_order.merge!(pairs.symbolize_keys)\n end\n end",
"title": ""
}
] | [
{
"docid": "1dd7d3eb9e116c9bcd893c6adbd402ea",
"score": "0.656568",
"text": "def rows\n super.sort { |a, b| a.value.first <=> b.value.first }\n end",
"title": ""
},
{
"docid": "6dca3fd5b03324c7d9635451bb1405dc",
"score": "0.64943177",
"text": "def rows(&block)\n super(... |
2005e3ce76b1927fbf34d8a957115052 | PUT /comments/1 PUT /comments/1.json | [
{
"docid": "e58b6405496477db1fc8dd43e607c426",
"score": "0.0",
"text": "def update\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n PublicActivity::Activity.create key: 'comment.update', trackable: @comment, company_i... | [
{
"docid": "5ed2b1ff2e1fc15558d2dbf5e36b9dd6",
"score": "0.74237627",
"text": "def update\n user = User.find_by({token: env['HTTP_TOKEN']})\n comment = user.comments.find(params[:id])\n comment.update(comment_params)\n render json: comment\n end",
"title": ""
},
{
"docid... |
54afeb91f8e3fdab6884cc8c18a201a9 | Sets the log level for process +pid+ on +host+ to +level+. | [
{
"docid": "b18abe32d3b6c9226667f2c27aca263b",
"score": "0.6824089",
"text": "def set_log_level(host, pid, level)\n server = get_server host, pid\n server.log_level = level\n @res.set_redirect WEBrick::HTTPStatus::SeeOther, \"/server/#{host}/#{pid}\"\n rescue DRb::DRbConnError\n raise WEBri... | [
{
"docid": "bd6d3f4560f3ad5b9123bce565e2e46a",
"score": "0.65625596",
"text": "def log_level=(level)\n Manager.logger.level = level\n # TODO: forwarding to server, or unify loggers\n Tamashii::Server.logger.level = level\n end",
"title": ""
},
{
"docid": "75f4ace7f6... |
da865dd97f23a38b631cb65c204f00a3 | Returns the complement of this regular language | [
{
"docid": "f6e77dabe21126da4962dd8241bf77d7",
"score": "0.78959763",
"text": "def complement\n RegLang.new(to_dfa.complement)\n end",
"title": ""
}
] | [
{
"docid": "d2647d452f9afff93c42534b6e590164",
"score": "0.7213383",
"text": "def -@\n return self.invert\n end",
"title": ""
},
{
"docid": "d2647d452f9afff93c42534b6e590164",
"score": "0.7213383",
"text": "def -@\n return self.invert\n end",
"title": ""
},
{
... |
4714f53b6650eaaf6cccc4f20afd4733 | 1. Typical Price = (High + Low + Close)/3 2. Raw Money Flow = Typical Price x Volume 3. Money Flow Ratio = (14period Positive Money Flow)/(14period Negative Money Flow) 4. Money Flow Index = 100 100/(1 + Money Flow Ratio) See: | [
{
"docid": "45ac20bab3c3e6cefb8c6bc2404ca5a6",
"score": "0.0",
"text": "def calc_mfi(quotes,period=14)\n @mfis[period] = [] if @mfis[period].nil?\n if quotes.size >= 1\n bar = quotes.last\n prev_bar = quotes[ quotes.size - 2 ]\n typical_price = RealTimeStat.bar_typical_pr... | [
{
"docid": "75313db09d2307619afe7811d50ffd5a",
"score": "0.66496086",
"text": "def bottles_from_purchase(money)\n money / 2\nend",
"title": ""
},
{
"docid": "b776ecd593778607b0e960353c5c6683",
"score": "0.66470253",
"text": "def cash_flow\n self.dig_for_decimal(\"cashFlow\")\n e... |
a83b17181fa0a1287d0bd0667e4c2114 | PATCH/PUT /ft_items/1 PATCH/PUT /ft_items/1.json | [
{
"docid": "6bad71e96b3c3a78f0f080c36d8d1bba",
"score": "0.70605063",
"text": "def update\n respond_to do |format|\n if @ft_item.update(ft_item_params)\n format.html { redirect_to @ft_item, notice: 'Ft item was successfully updated.' }\n format.json { render :show, status: :ok, loc... | [
{
"docid": "37d6b28fbd29cf57200b93c22fdf2c34",
"score": "0.7038357",
"text": "def update_item token, item_id, name, description\n uri = URI.parse \"https://#{get_hostname(token)}/sf/v3/Items(#{item_id})\"\n puts uri\n \n http = Net::HTTP.new uri.host, uri.port\n http.use_ssl = true\n http.verify_... |
b5992fcd97d5624a0fd633430b084c9e | For all responses in this controller, return the CORS access control headers. | [
{
"docid": "b5df3132ab8ab931ac245dcf6d753b1b",
"score": "0.7302289",
"text": "def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"title": ""
... | [
{
"docid": "057f2386db924cfecb4f334d9575db4d",
"score": "0.764377",
"text": "def cors_set_access_control_headers\n headers[CORS_HEADER_ALLOW_ORIGIN] = request.headers[CORS_HTTP_ORIGIN]\n CORS_FIXED_HEADERS.each do |k, v|\n headers[k] = v\n end\n end",
"title": ""
},
{
"docid":... |
6314139767a70adac43def0958f28bfd | Friends friend_request request_child The child who wants the connect to the other child 'recipient_child' | [
{
"docid": "0b63e0aa8db48c4cf40c7ca97c72fe07",
"score": "0.76458067",
"text": "def friend_request(friend_request, request_child, recipient_child)\n @child = request_child\n @parent = @child.parent\n @friend_request = friend_request\n\n ::Jobs::ApproveFriendRequestReminder.new(recipient_child... | [
{
"docid": "7c61d98621a44a0d897726ad498682e9",
"score": "0.6347402",
"text": "def send_friend_request\n # Grab an object from params to make life easier\n friend = params[:friend]\n \n # Grab the two users this friend request is referring to\n @user_sender = User.find(... |
1e99811152d786cab1d9768f5198ccc9 | utile pour afficher la balance en pdf | [
{
"docid": "b072d30ca0ef212ac4689166f9aa1397",
"score": "0.0",
"text": "def show\n @anabal = Compta::AnalyticalBalance.new({period_id:@period.id}.merge @params_anabal)\n send_export_token # utile pour les formats csv, xls et pdf\n if @anabal.valid?\n respond_to do |format|\n \n ... | [
{
"docid": "bde5a0af77862eec49d569481b088552",
"score": "0.6205775",
"text": "def write_income_and_deduction(pdf,income_and_deduction)\n pdftext \"Head Salaries\" , amount_to_pdf_string(income_and_deduction.incomeFromSal)\n pdftext \"Family pension\" , amount_to_pdf_string(income_and_deduction.fam... |
aef7d7da5683523b00762bda00d60754 | Sets the sorted BAM file of the first parental It accepts the following arguments :name=>A name for thie parental 1 (optional). If not provided, :path=> | [
{
"docid": "4470960840157d1af315ca2ac7bf8d89",
"score": "0.7262819",
"text": "def parental_1(opts)\n raise BFRToolsException.new(\"Missing path for parental 1\") if opts[:path] == nil\n path = Pathname.new(opts[:path])\n raise BFRToolsException.new(\"Unable to open #{path}\") unless path.... | [
{
"docid": "13d2de8083b82987cd8f06eadf915982",
"score": "0.6665881",
"text": "def parental_2(opts)\n raise BFRToolsException.new(\"Missing path for parental 2\") if opts[:path] == nil\n path = Pathname.new(opts[:path])\n raise BFRToolsException.new(\"Unable to open #{path}\") unless path.... |
8d113f07c9ef16b76f22b7080d2d4f8c | GET /documento_interes/1 GET /documento_interes/1.xml | [
{
"docid": "8e600baf1b7260bf62add7ba3a58e690",
"score": "0.7399234",
"text": "def show\n @documento_intere = DocumentoIntere.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @documento_intere }\n end\n end",
"title": ""
}... | [
{
"docid": "2164c6685e80892ed75fa5ea5bc3a249",
"score": "0.77900887",
"text": "def index\n @documento_interes = DocumentoIntere.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @documento_interes }\n end\n end",
"title": ""
},
... |
6c5663fad6b4053bbbf98c1b569c8f7a | Owned Certifications do not have at least one student assignments(not assigned any assignment) | [
{
"docid": "c9a2f99856a6bfa66901d932838eec61",
"score": "0.65762126",
"text": "def pending_assignments(assessor,certification_id = nil)\n if certification_id.nil?\n joins(:owned).where(:issued=>false,:owned=>{:id=>assessor.students})\n else\n joins(:owned).by_certification(certif... | [
{
"docid": "186d09c085660a117f8c1f3294d78f19",
"score": "0.658261",
"text": "def unassigned?\n assignments.empty?\n end",
"title": ""
},
{
"docid": "d3474106973f9d05392ce64ec4d3e991",
"score": "0.64586425",
"text": "def manage_assignments(assessor,certification_id = nil)\n i... |
b0aae381f2fd55731b8a808077e6317d | Try parsing an expression to see if we can safely eval it | [
{
"docid": "182905825d55ecdea84587c72eebdf85",
"score": "0.63874346",
"text": "def parseable?(expression)\n begin\n Parser::CurrentRuby.parse(expression)\n rescue Parser::SyntaxError\n return false\n end\n\n return true\n end",
"title": ""
}
] | [
{
"docid": "58fe8b2dd0c0f394376e36a7ec4730ba",
"score": "0.7332825",
"text": "def safe_to_evaluate?(str); end",
"title": ""
},
{
"docid": "58fe8b2dd0c0f394376e36a7ec4730ba",
"score": "0.7332825",
"text": "def safe_to_evaluate?(str); end",
"title": ""
},
{
"docid": "6c0e9e... |
8b4cc6ecee52f317ba69a094397d9ff3 | PUT /choices/1 PUT /choices/1.json | [
{
"docid": "8557e9ebd158ba4601ea4e6fc60d1016",
"score": "0.6799294",
"text": "def update\n @choice = @choices.find(params[:id])\n\n respond_to do |format|\n if @choice.update_attributes(params[:choice])\n format.html { redirect_to @shop, notice: t(\"choices.update.notice_success\") }\n... | [
{
"docid": "15c0d0889de00c1b1d8b68456dace620",
"score": "0.6983579",
"text": "def update\n @choice = Choice.find(params[:id])\n\n respond_to do |format|\n if @choice.update_attributes(params[:choice])\n format.html { redirect_to @choice, notice: 'Choice was successfully updated.' }\n ... |
d60ee48e9e5befc557d93ad2cbfda49e | Replace all references of speed in formulas to constant. | [
{
"docid": "c1edc6265774e790e348132c598ca580",
"score": "0.57942283",
"text": "def constantize_speed(config)\n config.each do |key, value|\n if value.is_a?(String) && value.match(/\\bspeed\\b/)\n replaced = value.gsub(/\\bspeed\\b/, self['speed'].to_s)\n replaced = GameConfig.safe_... | [
{
"docid": "eb6305b51bc729c089c4de172c684709",
"score": "0.5625286",
"text": "def reinforce_speed(v)\n land_unit_power v*0.1\n end",
"title": ""
},
{
"docid": "eb6305b51bc729c089c4de172c684709",
"score": "0.5625286",
"text": "def reinforce_speed(v)\n land_unit_power v*0.1\n e... |
dbf77a2bc9688d6a6dd55b78e4011d17 | Parses list of InventoryRefresh::Target out of the given EmsEvent | [
{
"docid": "416532f52fa118d0a0232c5caadf99bf",
"score": "0.8368523",
"text": "def parse_ems_event_targets(event)\n target_collection = InventoryRefresh::TargetCollection.new(:manager => event.ext_management_system, :event => event)\n\n parse_event_target(target_collection, event.full_data)\n\n ... | [
{
"docid": "7e83e1bf5fec6b60b4dd490795eeb8ec",
"score": "0.8445093",
"text": "def parse_ems_event_targets(event)\n target_collection = InventoryRefresh::TargetCollection.new(:manager => event.ext_management_system, :event => event)\n\n parse_event_target(target_collection, event.full_data)\n ta... |
fe76f843c4f824db4b911c10b5f9df74 | POST /institutes POST /institutes.json | [
{
"docid": "b3f0e7e14293f2394ef454d825d7760c",
"score": "0.0",
"text": "def create\n @institute = Institute.new(institute_params)\n # Below - sets @area variable based on the institute's category selection so redirection can be done on Workplace Shape New page for map\n case @institute.category... | [
{
"docid": "cfb6e2649da01de72052bf1eaff7ae8e",
"score": "0.65125006",
"text": "def create\n @institute = Institute.new(params[:institute])\n\n respond_to do |format|\n if @institute.save\n format.html { redirect_to institutes_url, notice: \"Institute #{ @institute.name } was successful... |
6b9276a3537982451f750a9c7b8e1018 | Users Check the value of is_visible in the passed parameters. True if :is_visible is present and the value is "true" (note the string value) | [
{
"docid": "b51d86edf83ea4489a35f560f926787d",
"score": "0.84446496",
"text": "def params_is_visible_value(parameters)\n (parameters[:is_visible].present? and (parameters[:is_visible] == \"true\")) ? true : false\nend",
"title": ""
}
] | [
{
"docid": "9e9dd3701ac3ef69f0d89e97b26d8364",
"score": "0.7911866",
"text": "def validate_visible\n visible = params[:visible] || (params[:user] && params[:user][:visible])\n\n if visible && visible.to_s != \"true\" && visible.to_s != \"false\"\n raise ExceptionTypes::BadRequestE... |
de028aea770c387b085233bfa8149d87 | validate :check_atleast_one_order_item, unless: :in_cart? def check_atleast_one_order_item if order_items.count < 1 errors.add(:order, "need atleast one order item") end end | [
{
"docid": "b083eb4e75b79e80d36336f2594e855b",
"score": "0.0",
"text": "def total_cost\n order_items.map { |order_item| order_item.subtotal }.sum.round(2)\n end",
"title": ""
}
] | [
{
"docid": "b2607f4133da1ee717febc05c316e4a6",
"score": "0.79188794",
"text": "def validate\n errors.add_to_base \"Enter atleast one product\" if items.empty?\n end",
"title": ""
},
{
"docid": "f23502ca08c18edff54f212cec7c4dd9",
"score": "0.7047491",
"text": "def ensure_not_produ... |
5cd97110e9ffca26d73b171126d6a76d | Tables: recipes_translations, ingridients_translations, etc Walk through all translatable models Walk through each model Upload translations for each model | [
{
"docid": "66a4c65471c7e5e7f9dd14ca81d93562",
"score": "0.7186626",
"text": "def upload_translations(classes = [\"Recipe\"])\n classes.each do |class_name|\n const = class_name.constantize\n const.find_each do |model|\n upload_model(model)\n end\n end\n end",
"title": "... | [
{
"docid": "a7d9f9ccfff66a2741980d49953ae334",
"score": "0.6859491",
"text": "def migrate_translated_data(model, delete_old_translations = false)\n migrated = false\n\n sql = <<-SQL\n SELECT distinct(item_id)\n FROM globalize_translations\n where globalize_translations.type = 'ModelTranslation'\n... |
af19ee3350c48efb0e033ff1f1f13758 | = Resource reset Resets all store/raster/schema caches and starts fresh. This operation is used to force GeoServer to drop all caches and stores and reconnect fresh to each of them first time they are needed by a request. This is useful in case the stores themselves cache some information about the data structures they... | [
{
"docid": "8d4bf07cc64a9e049a8ff84619038d55",
"score": "0.61548895",
"text": "def reset\n do_url 'reset', :put\n end",
"title": ""
}
] | [
{
"docid": "94e9596eee12c40002bd4af4e42112c6",
"score": "0.699988",
"text": "def reset\n cache.clear\n end",
"title": ""
},
{
"docid": "a34e5d441dd34fde0b601d6476f12ff0",
"score": "0.697581",
"text": "def reset\n @cache.reset\n end",
"title": ""
},
{
... |
1d1f9d3f24ae689cf8e8663f14fa40a3 | Overwrite method : Remove perform damage effect | [
{
"docid": "337bf8217258a183270b90fdf322d5a5",
"score": "0.7811186",
"text": "def perform_damage_effect\n end",
"title": ""
}
] | [
{
"docid": "ee6dec1d68310c036caa217e47873dbb",
"score": "0.703227",
"text": "def discard_effect\n @game.discard_pile_cards << \"mix\"\n end",
"title": ""
},
{
"docid": "d57f2d205c33c2e8b136ecacc5de1466",
"score": "0.7017282",
"text": "def remove_debuffs\n effects_set(EFFECT_RE... |
bf3599256530a819e92f42197f396935 | Untested method with documentation | [
{
"docid": "ef8c2de8f00ce0e391312eae49f4243c",
"score": "0.0",
"text": "def untested_method(str)\n end",
"title": ""
}
] | [
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.65203106",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.65203106",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a... |
8b146f66a5f46d32d824f0061e902867 | This is a hard limit set by internet standards | [
{
"docid": "901e31b4c9fe92438a7347d44fd0a4d0",
"score": "0.0",
"text": "def sha1(encoding = :base16)\n sha_digest Digest::SHA1, encoding\n end",
"title": ""
}
] | [
{
"docid": "2877898944666f62c86ff76799c3d922",
"score": "0.6768388",
"text": "def bufete_limit\n 1\n end",
"title": ""
},
{
"docid": "d7b2d045bc01edf3f151f0f3448da8fc",
"score": "0.65432554",
"text": "def time_limit\n 62\n end",
"title": ""
},
{
"docid": "a6... |
d40aaa208865a327867ccf0da2a11b1c | Helper method to return the base expected error: ActiveModel::StrictValidationFailed, a custom error, or nil | [
{
"docid": "900baa66420c97d8b1385559b88ab8c8",
"score": "0.68559784",
"text": "def options_error(strict_error)\n return if strict_error.nil?\n\n if strict_error == true\n ActiveModel::StrictValidationFailed\n elsif strict_error.ancestors.include?(Exception)\n stric... | [
{
"docid": "d2196734e7e3ee41b90e606b3ac2e486",
"score": "0.70417094",
"text": "def validation_error(type, what, reason); end",
"title": ""
},
{
"docid": "d2196734e7e3ee41b90e606b3ac2e486",
"score": "0.70417094",
"text": "def validation_error(type, what, reason); end",
"title": ""... |
533b19dde7a56fbd923c5b5f416419b1 | The HTTP request method. This is the standard implementation of this method but is respecified here due to libraries that attempt to modify the behavior to respect POST tunnel method specifiers. We always want the real request method. | [
{
"docid": "56e6c9bc471206b562d074ecc8b0b952",
"score": "0.7401037",
"text": "def request_method\n @env['REQUEST_METHOD']\n end",
"title": ""
}
] | [
{
"docid": "5d9220c474305cc8c6100cf626d605f7",
"score": "0.8311675",
"text": "def request_method\n if post_tunnel_method_hack?\n params['_method'].upcase\n else\n @env['REQUEST_METHOD']\n end\n end",
"title": ""
},
{
"docid": "4a64a83c02620b9146264708aab20401"... |
bbced22346a3163b7e3a43d396a4d129 | make sure the maintenance type is valid | [
{
"docid": "a59a7ff1784effa8685e1acd9a00a5aa",
"score": "0.56353754",
"text": "def maintenance_help\n puts \"Valid maintenance types are:\"\n Spinneret::Maintenance.constants.each { |cls| puts \" #{cls.to_s}\" }\n puts \"Note that capitalization *is* important and that Opportunistic is\"\n puts \"n... | [
{
"docid": "585a3e447b8152da8a74c44dfc5601c4",
"score": "0.6553194",
"text": "def check_type\n \t self.type = TYPES[0] if !TYPES.include?(self.type)\n\t end",
"title": ""
},
{
"docid": "32a48faa6533e465812be5d83ea4d680",
"score": "0.62822807",
"text": "def valid?\n !type.nil?... |
bbc56054ae8f2ce80376054c07ed2f1b | PATCH/PUT /housingtypeprices/1 PATCH/PUT /housingtypeprices/1.json | [
{
"docid": "9298454bfed2d32efa1ce4622e187bdf",
"score": "0.7030163",
"text": "def update\n respond_to do |format|\n if @housingtypeprice.update(housingtypeprice_params)\n format.html { redirect_to @housingtypeprice, notice: 'Housingtypeprice was successfully updated.' }\n format.js... | [
{
"docid": "65b5b34782ba54e20f2e7ddb0e265e2f",
"score": "0.6163742",
"text": "def set_housingtypeprice\n @housingtypeprice = Housingtypeprice.find(params[:id])\n end",
"title": ""
},
{
"docid": "fc30dad73497718dc5bc1f192ccbebe2",
"score": "0.6162008",
"text": "def update\n ... |
6f5724c61c2b6b57dc78a236a4dc9059 | Methods ================================================================================= returns a hash mapping problem type names to lists of problems of that type | [
{
"docid": "e7d954b7abdf0d87eb52e44b27fae4d7",
"score": "0.65770555",
"text": "def sorted_threshold_problems\n # if there are no threshold problems, return nil\n threshold_problems = self.threshold_problems.all\n if threshold_problems.empty?\n return nil\n end\n ... | [
{
"docid": "ba97370666b2c1a9638e41c5d97874bb",
"score": "0.6061271",
"text": "def list_possible_type_ids\n\tissuetypes = @client.Issuetype.all\n\tissuetypes.each do |issue|\n\t\tputs \"#{issue.id}\\t#{issue.name}\"\n\tend\nend",
"title": ""
},
{
"docid": "e9c5f3e4ef2a8d4725bcb2d2fbb0dab5",
... |
acf78f0a32582d724a7df89d23aef1a5 | Calculo del gasto energetico total | [
{
"docid": "182c58cc2152540c18b5148efe09a8dd",
"score": "0.8566763",
"text": "def gastoEnergeticoTotal()\n \t(self.gastoEnergeticoBasal() + self.efectoTermogeno() + self.gastoActividadFisica()).round(2)\n \tend",
"title": ""
}
] | [
{
"docid": "389d0c7e69f530ca36e25e757207c109",
"score": "0.8718011",
"text": "def gasto_energetico_total\n \n gasto_energetico_basal + efecto_termogeno + gasto_actividad_fisica\n \n end",
"title": ""
},
{
"docid": "cd171aed4742a7733c972cfd2553abf6",
"score": "0.85... |
4e197f9c5f68e8bba6b79e39547ae99b | DELETE /messages/1 DELETE /messages/1.xml | [
{
"docid": "346a19c4a692eae81a2948561ea12b02",
"score": "0.7369304",
"text": "def destroy\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to(messages_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] | [
{
"docid": "222538ccd47aead88fdc9836327a0563",
"score": "0.75064015",
"text": "def destroy\n \t\n @message = Message.find(params[:id])\n @message.delete\n\n respond_to do |format|\n format.html { redirect_to(messages_url) }\n format.xml { head :ok }\n end\n end",
"title": ""... |
ad44c7ab7fe177e4a3c19ee24507c79a | DELETE /reports/1 DELETE /reports/1.xml | [
{
"docid": "0eaefc9a622b40f7e4ff2b8d5b70d273",
"score": "0.75042737",
"text": "def destroy\n @report = Report.find(params[:id])\n @report.destroy\n \n respond_to do |format|\n format.html { redirect_to(reports_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
... | [
{
"docid": "b039901841ef8dbae1ccae59f16deb22",
"score": "0.7509032",
"text": "def destroy\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to(reports_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fd3310ebe6a45757a3db34e815... |
77405d6635b75bcbd243c0af2b59d013 | Use this method to add more data into the archive hash which isn't directly accessible from the parent model. Call `visit_nodes` on each set of data you want to add. To be overridden by subclasses. | [
{
"docid": "9dc8f36ff9570b924f861dc93a9ef516",
"score": "0.5257314",
"text": "def save_additional_data\n end",
"title": ""
}
] | [
{
"docid": "e7a9944b08ad111d5ea229978cb93ea7",
"score": "0.56616074",
"text": "def add_data_elements\n \n end",
"title": ""
},
{
"docid": "b7ad6e302a03b4768e41eea11f3681cb",
"score": "0.5482924",
"text": "def add_infos(hash)\n self.custom_attributes.merge!(hash)\n end",
... |
08390fe81c35c7515306e6f45432f50f | GET /study_plans GET /study_plans.json | [
{
"docid": "8b097061ca770962a7a3473c8c7dea39",
"score": "0.7226024",
"text": "def index\n @study_plans = StudyPlan.all\n end",
"title": ""
}
] | [
{
"docid": "3c6d0de4d5260131f83ecf804f2d53d9",
"score": "0.71415156",
"text": "def index\n @plans = @project.plans\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plans }\n end\n end",
"title": ""
},
{
"docid": "5b231aaa064e3d8c5863... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "a97c30252f71b26280173dce5bda1c84",
"score": "0.0",
"text": "def stock_quote_params\n params.require(:stock_quote).permit(:security_id)\n end",
"title": ""
}
] | [
{
"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... |
80fb4abcfaaf129c6c369599739f507b | GET /test_cases/1 GET /test_cases/1.xml | [
{
"docid": "ce9a10a9b6c6bffe7094343f3b2ab78b",
"score": "0.0",
"text": "def show\n @test_case = TestCase.find(params[:id])\n permitted_to! :inspect, @test_case.problems.first\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @test_case }\n end\n ... | [
{
"docid": "d3a23231ec9919e031bd4a7e91c1c546",
"score": "0.6981415",
"text": "def show\n respond_to do |format|\n format.html { redirect_to :controller => 'testcases', :action => 'index' }\n format.xml { render :xml => @testcase_result }\n end\n end",
"title": ""
},
{
"docid... |
65ecddad61f869d0e314d25fdbad15b2 | More code from tools/reg.rb | [
{
"docid": "45b29d6861fee0a4def3f38557112410",
"score": "0.0",
"text": "def decrypt_hashes(rid, lm_hash, nt_hash, hbootkey)\n\t\tntpwd = \"NTPASSWORD\\0\"\n\t\tlmpwd = \"LMPASSWORD\\0\"\n\t\tbegin\n\t\t\t# Try to decrypt hashes\n\t\t\thashes = []\n\t\t\tif lm_hash\n\t\t\t\thashes << decrypt_hash(rid, hb... | [
{
"docid": "1c53466e9cac189998146240b4cf8da1",
"score": "0.6554758",
"text": "def get_reg( reg, pos, line )\n raise \"This doesn't look like a register: \\'#{reg}\\'\\n**#{line} in #{$file}\\n\" unless reg =~ /^\\$[a-z]?(\\d{1,2})_?.*?$/ \n num = $1.to_i # num is register number\n #print \"reg: #{reg... |
497109ef436790e476e030462f035e35 | DELETE /teacher_tickets/1 DELETE /teacher_tickets/1.xml | [
{
"docid": "1a9623678882ee7ac1af0fda77ef77e4",
"score": "0.72182673",
"text": "def destroy\n @teacher_ticket = TeacherTicket.find(params[:id])\n @teacher_ticket.destroy\n\n respond_to do |format|\n format.html { redirect_to(teacher_tickets_url) }\n format.xml { head :ok }\n end\n ... | [
{
"docid": "5b3bcf851ccf000aaae59d36df4def60",
"score": "0.6888742",
"text": "def delete_ticket id\n\t\t\t\t\tFreshdesk::Api::Client.delete_status_wrapper do\n\t\t\t\t\t\t( @connection.delete TICKETS, id ).code\n\t\t\t\t\tend\n\t\t\t\tend",
"title": ""
},
{
"docid": "eccc8860fd297628b2a95547... |
265cb2f135973735b86cc2c7c81ecb0a | Utility function to remove any duplication from the document cache. | [
{
"docid": "67fc7b7bf7b14d20a972fcb7b3aac4e4",
"score": "0.6662999",
"text": "def clean_document_cache\n @document_cache_keys.each_key do |cache_key|\n document = get_document(cache_key)\n \n document.each do |index_field,index_values|\n if index_values.size > 0\n docum... | [
{
"docid": "1503278772e4a2a32f458cbdb90b8b8a",
"score": "0.7057743",
"text": "def delete_duplicates(el)\n location = @cache.index(el)\n @cache.delete_at(location) if location\n end",
"title": ""
},
{
"docid": "92c1e5adfd945c0a745bd55d9e556548",
"score": "0.69501704",
"text": "... |
ec852889628801b7556a3b607feab701 | Convenience method to provide access to the link stack stored in the session | [
{
"docid": "35e1e8a8d277263daf4af4eedaebd718",
"score": "0.8185603",
"text": "def link_stack\n session = request.session\n return session[:link_stack] = [] if session[:link_stack].nil?\n\n # Storing the session converts the symbols to strings the below converts them back\n session[:l... | [
{
"docid": "16c0b31a9d24dc3f0b1117413ca63487",
"score": "0.6732222",
"text": "def session\n self.link.session\n end",
"title": ""
},
{
"docid": "cac447c4a41e3c8d68b8c5d511688dfc",
"score": "0.660682",
"text": "def uri_stack\n secure_session[:uri_stack] ||= []\n end",
... |
686080642eabe71d6327d8233b6ea29b | Verifies that the value of the foundation date (if any) matches the corresponding field in a given set of test data. Returns an array of mismatches. | [
{
"docid": "a0a9a6a90fb087d9b77555d40b94f132",
"score": "0.71377033",
"text": "def verify_foundation_date(test_data)\n errors = []\n text_values_match?(test_data[Org::FOUNDING_DATE.name], element_value(foundation_date_input), errors)\n errors\n end",
"title": ""
}
] | [
{
"docid": "253ffab2e93d6808e913907f00ccd1dc",
"score": "0.7232438",
"text": "def verify_use_dates(test_data)\n dates = test_data[CoreUseOfCollectionsData::USE_DATE_GRP.name] || [CoreUseOfCollectionsData.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[CoreU... |
ccc69ce2b71be2f19436007205503bf5 | For descendants to define usage message easily. | [
{
"docid": "615a0b3c35571c78889d9a5871b43413",
"score": "0.6606439",
"text": "def usage\n self.class.const_get(:USAGE)\n end",
"title": ""
}
] | [
{
"docid": "0b47c7bbf158a08945a18c5355a04daf",
"score": "0.6924396",
"text": "def usage; end",
"title": ""
},
{
"docid": "0b47c7bbf158a08945a18c5355a04daf",
"score": "0.6924396",
"text": "def usage; end",
"title": ""
},
{
"docid": "2ba20a9e62d278690364d8cab6b55996",
"... |
fab0e81981bf5b9c03b4d8b0717e2c34 | method to calculate total price | [
{
"docid": "02055d205fd5afe7ead94951bc31af0f",
"score": "0.0",
"text": "def sum\n @num1 = params[:bike.days]\n @num2 = params[:bike.price]\n @result = Calculator.total(@num1.to_i, @num2.to_i)\n end",
"title": ""
}
] | [
{
"docid": "d44d46451e9528c2ff8fd7c4ed9f3fb9",
"score": "0.83616465",
"text": "def price\n total\n end",
"title": ""
},
{
"docid": "b089e23de314a933c5e135d12f0b82c6",
"score": "0.83583796",
"text": "def total\n return @total_price \n end",
"title": ""
},
{
"d... |
6edbb84fb80aa7268838fe745188ef04 | Defines a reader that will return a new instance of the given type if one is not already present | [
{
"docid": "04b1366dc8d0a8449deec78e004f9b75",
"score": "0.653562",
"text": "def define_lazy_reader(name, type)\n define_method(name) do\n value = @attributes.get(name)\n return value if value\n\n type.new({}).tap do |val|\n @attributes.set(name, va... | [
{
"docid": "994970b86e4c82db58c4e6fca2130a06",
"score": "0.66186154",
"text": "def reader(reader_class, opts={}, &block)\n raise ArgumentError unless reader_class\n\n @config[:reader] = case reader_class\n when Symbol\n Readers.find(reader_class).new(opts, &block)\n when Class... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "521bccfde5fda50cf63e23377b88853d",
"score": "0.0",
"text": "def snapshot_params\n params.require(:snapshot).permit(:name, :snapshot)\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... |
96cf2752d3ebb8af4699a7da9e5c5649 | Select items from top of stack. peek_count number of items to select. returns list of items selected | [
{
"docid": "714b0cc830a7b7f93542574a69cff98c",
"score": "0.0",
"text": "def pop(count)\n @client.execute_udf(@key, @PACKAGE_NAME, 'pop', [@bin_name, count], @policy)\n end",
"title": ""
}
] | [
{
"docid": "2d73ab11277bb009702bfd5f0e8e3313",
"score": "0.6069361",
"text": "def peek(queue, start = 0, count = 1, mode = :ready)\n list_range(queue, start, count, mode)\n end",
"title": ""
},
{
"docid": "5ad8ee9721565b21e34baa4beb703d9c",
"score": "0.6000475",
"text": "def sele... |
50fab23ce99e02f9c6f7ad39c3591b61 | Immunogenically oriental neckcloth wealden rottock wundtian Concuss psalmodic uncordially amphicoelian pansciolist subdolichocephalic | [
{
"docid": "cd77e61d887f2166d1a4af5704c6fb99",
"score": "0.0",
"text": "def bostangi_acrostolion(unmighty, biblicism_quinquevir, considerativeness)\n collins_companionize()\n spongelet_snowflower_mamers(minorate_asthenosphere, promercantile_going, overfancy_mormonite)\n end",
"title": "... | [
{
"docid": "8ffdfeabbab52c9f676a378164348d63",
"score": "0.64755976",
"text": "def unmatrimonial(wholesome, screel, pyrrhotism_preaccommodate)\n end",
"title": ""
},
{
"docid": "6fe0d95b33dd665f2d020d0194f1b8b7",
"score": "0.63671017",
"text": "def photesthesis_wouch()\n call... |
28875a216f54786b9c598174d194f784 | DELETE /desserts/1 DELETE /desserts/1.json | [
{
"docid": "8c35f623dc2ea5fe73c6768fc824f834",
"score": "0.7288834",
"text": "def destroy\n @dessert.destroy\n respond_to do |format|\n format.html { redirect_to desserts_url, notice: 'Dessert was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title"... | [
{
"docid": "7070e4dc3849fac5852c0271c9b6d7cc",
"score": "0.7277746",
"text": "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#... |
a14f2abd760e17aeeed689d72c0f2fc0 | Works by, if not sorted yet, picking 2 random indicies and swapping the 2 elements | [
{
"docid": "35d5dd39eb2b36b30150ed791aad1390",
"score": "0.6865307",
"text": "def bozosort!(arr)\n while not arr.sort == arr\n a, b = rand(arr.length), rand(arr.length)\n arr[a], arr[b] = arr[b], arr[a]\n end\n return arr\nend",
"title": ""
}
] | [
{
"docid": "6dd68cef2576ffba107da70edbc016f7",
"score": "0.69589037",
"text": "def ordered_random_merge(a,b)\n a, b = a.dup, b.dup\n a.map{rand(b.size+1)}.sort.reverse.each do |index|\n b.insert(index, a.pop)\n end\n b\nend",
"title": ""
},
{
"docid": "d11f7fad02fe8fce237239f1de78159c... |
e76f51152ec21642b300d85ba23acf98 | Add render_file method like prawn | [
{
"docid": "ed51e6b5eff21a0a8b44cd287f9c28d8",
"score": "0.7565153",
"text": "def render_file(filename)\n to_file(filename)\n end",
"title": ""
}
] | [
{
"docid": "5427e89617bb0495ecd0f3cc61877f70",
"score": "0.7778936",
"text": "def render(_, _)\n self.class.run(@filename, @source)\n end",
"title": ""
},
{
"docid": "a8e27aacbcbd8543f94616fc725a6f63",
"score": "0.76648796",
"text": "def file_to_render\n file\n end",
... |
b0553a6696d077e77c51c4ea6e26e662 | Returns true is an entry was created by given user | [
{
"docid": "361d152f34a824c626f2ed9f83a8c340",
"score": "0.0",
"text": "def owned_by?(current_user)\n current_user && user_id == current_user.id\n end",
"title": ""
}
] | [
{
"docid": "7563dea56d136748b81acda323c4ead5",
"score": "0.7816381",
"text": "def created_by?(user)\n unless user.nil?\n userid = user.send(BigbluebuttonRails.configuration.user_attr_id)\n self.creator_id == userid\n else\n false\n end\n end",
"title": ""
},
{
"docid... |
25a3df61583734b20f0f024a6b7d5a6e | Iterate over all lines in specified file | [
{
"docid": "ec595ac093d6463b67ec2a5ccc859431",
"score": "0.727412",
"text": "def iterateOverAllLines(&myProc)\n return IO.foreach(@path, &myProc)\n end",
"title": ""
}
] | [
{
"docid": "84062635c50187b39bfe0a66bd50c980",
"score": "0.81667423",
"text": "def lines_for_file(file); end",
"title": ""
},
{
"docid": "84062635c50187b39bfe0a66bd50c980",
"score": "0.81667423",
"text": "def lines_for_file(file); end",
"title": ""
},
{
"docid": "c1634053... |
ee359659802109975c9ef7afcac55947 | For each markdown page, get the URL Then run the other script | [
{
"docid": "d5f79d0a8432ba7e36c98a746d8484bc",
"score": "0.0",
"text": "def get_url(filename)\n return YAML.load_file(filename)['original-url']\nend",
"title": ""
}
] | [
{
"docid": "e7e393eb8744decb38e9971beb50cdcc",
"score": "0.65313494",
"text": "def process_contents\n @img_tags = @contents.xpath( '//img[@src]' )\n @img_tags.each do |tag|\n download_resource(File.join('http://wiki.dublincore.org', tag[:src]), File.join(@image_dir, File.basename(tag[:src])))... |
71feebada816b3b1f6b24849809c0cdf | COMPATIBILITY Return a Hash with an unsupported indexing directive key/value to test failfast. | [
{
"docid": "a7a733585f033093c8208bb8be94a13c",
"score": "0.5501138",
"text": "def incompatible_indexing_directive\n if $client.version_support.es_version_2_x?\n {_wait_for_active_shards: 10}\n else\n {_consistency: \"all\"}\n end\nend",
"title": ""
}
] | [
{
"docid": "0ab7b750c5b099f71ed8ece12937f88c",
"score": "0.6327192",
"text": "def index_options(keys=[:background, :unique, :sparse])\n Hash[ keys.map { |k| [k, true] } ]\n end",
"title": ""
},
{
"docid": "cca99e435b35cce215a8ca02b378b0f7",
"score": "0.621455",
"text": "def m... |
544c410beeccc473cb0c4a6fe3f4d3a0 | Closes the method. Our Refactored Solution | [
{
"docid": "7b98783cb6c49e3d885b39bee0c876a8",
"score": "0.0",
"text": "def bakery_num(people, fav) \n menu = {\"pie\" => 8, \"cake\" => 6, \"cookie\" => 1} # this hash states the number of people each food feeds\n need = {\"pie\"=> 0, \"cake\" => 0, \"cookie\" => 0} # this hash states th... | [
{
"docid": "2c099ebff8d962936e791cb997d30faa",
"score": "0.7985215",
"text": "def close() end",
"title": ""
},
{
"docid": "816cccd808bad007e9344c35321bdd25",
"score": "0.78959256",
"text": "def close!; end",
"title": ""
},
{
"docid": "816cccd808bad007e9344c35321bdd25",
... |
0e22deb44f9a1d1884a6053e5be98c8c | validates :user_id, presence: true validates :attraction_id, presence: true | [
{
"docid": "31e94f3678037c3a9813f17909017782",
"score": "0.0",
"text": "def take_ride\n usr = self.user\n attract = self.attraction\n\n if usr.tickets < attract.tickets && usr.height < attract.min_height\n \"Sorry. You do not have enough tickets to ride the #{attract.name... | [
{
"docid": "08c6f8f28b7c5ad4adf80444808aa014",
"score": "0.70107347",
"text": "def valid_attributes\n {\"user_id\" => @user.id}\n end",
"title": ""
},
{
"docid": "fa763065832d83b161b6f06c1b731dcd",
"score": "0.68707913",
"text": "def validate_user\n errors.add(:user_id, 'not p... |
91e67f221d96831f847a08cf8d9fa53d | GET /requests/1 GET /requests/1.json | [
{
"docid": "2cc64ce1583fe2ab16b4fd5c05fe9ef6",
"score": "0.5954499",
"text": "def show\n @request = Request.find(params[:id])\n respond_with @requestss\n end",
"title": ""
}
] | [
{
"docid": "2573732716981fc9879cbeb694b1c172",
"score": "0.6909259",
"text": "def index\n @requests = @user.requests\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @requests }\n end\n end",
"title": ""
},
{
"docid": "fc5c52f462bbdc4... |
597cebe362858de7e3cab66f68fd6085 | GET /nodes/1 GET /nodes/1.json | [
{
"docid": "d86f774e2a2170bc9e90df56628bd2a8",
"score": "0.7065676",
"text": "def show\n @node = Node.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @node }\n end\n end",
"title": ""
}
] | [
{
"docid": "3fd56edd39c6942b87ee243dd8f04cbc",
"score": "0.7920798",
"text": "def nodes\n get 'nodes'\n end",
"title": ""
},
{
"docid": "a17bedd492a5111af05ea4fea3f86b3c",
"score": "0.727634",
"text": "def index\n @nodes = Node.all\n\n render json: @nodes\n end",
"titl... |
f6c13846741226472fca7706b4e21735 | GET /uses/1 GET /uses/1.json | [
{
"docid": "0422e966550b08bdd08c8991233d6351",
"score": "0.6152426",
"text": "def show\n @breadcrumb = 'read'\n @use = Use.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @use }\n end\n end",
"title": ""
}... | [
{
"docid": "1b0cb6dc45217890e62cb06bd3f85755",
"score": "0.6548368",
"text": "def index\n @usesrs = Usesr.all\n end",
"title": ""
},
{
"docid": "88e640f77b0968841faa0c5b58d7b4df",
"score": "0.63471204",
"text": "def index\n @usages = get_usages\n respond_to do |format|\n ... |
3f1a5a844b921004cc1cbf8c41f746ae | To be used when new'ing reviews | [
{
"docid": "4146e3a505a0309ba52f7615e7b4bd6a",
"score": "0.0",
"text": "def default_review_params\n {:form_version => \"review:mini\"}\n end",
"title": ""
}
] | [
{
"docid": "a50cab5351863d3cda1f4f41d5672671",
"score": "0.75574464",
"text": "def review\n end",
"title": ""
},
{
"docid": "4e695636c9a6c019a1cb73d23ab019fb",
"score": "0.7504624",
"text": "def new_trader_review\n \n \n end",
"title": ""
},
{
"docid": "ed8f7b2514a2... |
2e99df97cd5426e589712bff19f5da9c | table as self contained jsonready Hash | [
{
"docid": "4f80fdefc69c768f91e5ff438744db29",
"score": "0.0",
"text": "def hash_to_json_object\n\n # Also use unicode escape for the interesting (effectively,\n # non-printable) subset of moji mappings.\n moji = hash.sort.map do |kv|\n kv.map do |s|\n s.codepoints.inject(... | [
{
"docid": "e7079cc304b416235734088056cacd83",
"score": "0.79107845",
"text": "def toJson()\n return @table ;\n end",
"title": ""
},
{
"docid": "fdd16f0933fc05cd5902a3d8254795a7",
"score": "0.7873101",
"text": "def as_hash\n @table\n end",
"title": ""
},
{
"do... |
e35aa4c043c6a0599b44dd7be1c3140f | Onthefly extraction of directions preferrably with no saving in DB | [
{
"docid": "2dae32c94084938ce598ca36363b8286",
"score": "0.62171555",
"text": "def extracts_directions?\n extract_directions ? true : false\n end",
"title": ""
}
] | [
{
"docid": "221d0a21eecaeb6e4850d2458461b344",
"score": "0.64887714",
"text": "def directions\n @directions\n end",
"title": ""
},
{
"docid": "4b4808b31fb37ea8009c9c946303c938",
"score": "0.63607246",
"text": "def flr(directions)\n\nend",
"title": ""
},
{
"docid": "d9... |
7cfd8305dbf6607ee47489fb8a62978b | Map a search type to its search repository suggester. | [
{
"docid": "355fb96673ec5cba5d21bdcfc2df7c9f",
"score": "0.64326394",
"text": "def make_suggester_name(search_type)\n search_type.to_s\n end",
"title": ""
}
] | [
{
"docid": "51cb33e3df913ac38ed1af7c1eafe172",
"score": "0.59539276",
"text": "def make_suggester_name(search_type)\n \"#{search_type}Suggest\"\n end",
"title": ""
},
{
"docid": "0d778fdf3db2eef5e3c0e8f8e7a7de1b",
"score": "0.5681108",
"text": "def search_type\n type\n ... |
dc224eb14220307d5fa9b1739528cc09 | Takes any possible object and converts it to how it would be stored in the database. | [
{
"docid": "1939f03acf18ed19c7095bec71d1b946",
"score": "0.6675416",
"text": "def mongoize(object)\n case object\n when Expert then object.mongoize\n when Hash then Expert.new(object[:name], object[:quote], object[:image_url]).mongoize\n else object\n end\n end",
"title":... | [
{
"docid": "ee1c9f266867939fac42b15d1fe2a449",
"score": "0.8128067",
"text": "def convert(object); end",
"title": ""
},
{
"docid": "6b07f52b29252627201f5090aa23fbd4",
"score": "0.78715664",
"text": "def convert\n self.class.convert(object)\n end",
"title": ""
},
{
... |
04ea33ffdd08796e0034671e91b8d3bb | Return number of lists on Trello board | [
{
"docid": "428fe41fc54d9f40f591d76780504cb4",
"score": "0.7798784",
"text": "def no_of_lists\n get_list_names.size\n end",
"title": ""
}
] | [
{
"docid": "2e3db83ef46c5a9cfd801f76fa18eb7f",
"score": "0.7468992",
"text": "def count_list_size\n\n h.list_size\n end",
"title": ""
},
{
"docid": "bb64850968c5ecaf45a40dca9807ebb1",
"score": "0.72123665",
"text": "def count()\n @list_of_positions.length\n end",
"tit... |
03db4c23ac583bce0a56febaf7851cd7 | PUT /testers/1 PUT /testers/1.json | [
{
"docid": "81f463c2385acbccac49a96016b0e9ce",
"score": "0.6563973",
"text": "def update\n @tester = Tester.find(params[:id])\n\n respond_to do |format|\n if @tester.update_attributes(params[:tester])\n format.html { redirect_to @tester, notice: 'Tester was successfully updated.' }\n ... | [
{
"docid": "208376178e1062b77073a0514ca99826",
"score": "0.61199856",
"text": "def test_put_success\n put \"/blah\", @test_obj do |response|\n assert response.ok?, \"Update test object failed\"\n end\n end",
"title": ""
},
{
"docid": "32308801a2ce64d858b119cd40a9bdab",
"score... |
5c581e9ebb99e612d52b2e217f5aafab | DELETE /coordinadors/1 DELETE /coordinadors/1.json | [
{
"docid": "1a7904852b9900249b9ed6bbadbc9f37",
"score": "0.75540435",
"text": "def destroy\n @coordinador = Coordinador.find(params[:id])\n @coordinador.destroy\n\n respond_to do |format|\n format.html { redirect_to coordinadors_url }\n format.json { head :no_content }\n end\n end... | [
{
"docid": "4c1c164b581dbae14285797e584e8fb7",
"score": "0.7097134",
"text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"title": ""
},
{
"docid": "2e9a7105295a0c233cd851a59c063ca1",
"score": "0.7036337",
"text": "def destro... |
14b09aad9607c9de330da5a94abf1e07 | =begin get relations of model based on params model = Model.find(1) attributes = model.attributes_with_association_ids returns hash with attributes and association ids =end | [
{
"docid": "d4d22f8a760435af47c149f7ae06668d",
"score": "0.65229815",
"text": "def attributes_with_association_ids\n\n key = \"#{self.class}::aws::#{id}\"\n cache = Cache.get(key)\n return cache if cache\n\n attributes = self.attributes\n relevant = %i[has_and_belongs_to_many has_many]\... | [
{
"docid": "e210d77636e28fe68becdc177ca0090e",
"score": "0.7204792",
"text": "def model_attributes model, related_association\n return [] if model.send(related_association.to_sym).nil?\n construct_relationship_hash model.send(related_association.to_sym)\n end",
"title": ""
},
{
... |
0f0d0c763abf8463bb8e2c0ae7d05a56 | DELETE /authors/1 DELETE /authors/1.json | [
{
"docid": "82f0dd0ebd77a482dbcd6a731143cc85",
"score": "0.74637634",
"text": "def destroy\n @author.destroy\n respond_to do |format|\n format.html { redirect_to authors_url, notice: 'Author was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ... | [
{
"docid": "2b79fc51bd66af910ff2e0af19d10ae3",
"score": "0.77590686",
"text": "def destroy\n @author.destroy\n\n respond_to do |format|\n format.html { redirect_to authors_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b6d385335e5106dfc945b334de... |
4381162eaa87d54c73d6e6c5d735643c | Gets the label for the given language. If no labels are given, return nil | [
{
"docid": "879e05cc80beff796f70625ffc4a9fd4",
"score": "0.82211393",
"text": "def label_by_lang(labels, language = 'en')\n return nil unless(labels)\n result = nil\n labels.each do |label|\n if(match = @@lang_re.match(label)) # check if there is a \"language\" string\n if... | [
{
"docid": "b95fbaea37b51560e52f792513b600c7",
"score": "0.7318864",
"text": "def rdf_label(language = 'en')\n @labels ||= {}\n @labels[language] ||= label_by_lang(rdfs_labels, language)\n # The rdf label is cache, while the default may change\n @labels[language] ||= to_name_s\n ... |
aadbc7a5e180b19631c8f6f7f2c18a21 | GET /messages/1 GET /messages/1.json | [
{
"docid": "c6d19ce96cf3d9df70a68459d868e78d",
"score": "0.0",
"text": "def show\n @reply = Message.new\n @reply.message_id = @message.id\n @reply.subject = \"Reply to > #{@message.subject}\"\n end",
"title": ""
}
] | [
{
"docid": "7b0403c18d8a0a044bf54412d195f2ca",
"score": "0.75848913",
"text": "def show\n @v1_message = V1::Message.find(params[:id])\n\n render json: @v1_message\n end",
"title": ""
},
{
"docid": "abbd37c0579c33e8268f5fe452dd0b23",
"score": "0.75048095",
"text": "def messages... |
889d1c3ed01cc49596b07ce83ef278b5 | Compute and return the score for a match with e errors and x location. Accesses loc, score_text_length and pattern through being a closure. Args: e: Number of errors in match. x: Location of match. Returns: Overall score for match. | [
{
"docid": "b6a209ddcb9edd160143f47114ad71b5",
"score": "0.57787377",
"text": "def match_bitap_score(score_text_length, pattern, loc, e, x)\n d = (loc - x).abs.to_f\n return (e.to_f / pattern.length.to_f / self.class.match_balance) + \n (d / score_text_length.to_f / (1.0 - self.cl... | [
{
"docid": "081bf976adc90bbbcfe3fce9279205f1",
"score": "0.52019334",
"text": "def score\n #solution one\n # @score = 0\n # word.each_char do |char|\n # @score += get_value(char)\n # end\n # return @score\n\n #solution two\n # word.chars.reduce(0) do |total, char|\n # tota... |