query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
2647b5eb8c67b8841ffd4942d5ac0937 | Polls up to (maxtime) seconds checking if the society is running maxtime:: [Integer=nil] Maximum poll time in seconds | [
{
"docid": "26d6f47fe7d435d379c1f9b36505c241",
"score": "0.744456",
"text": "def wait_until_running(maxtime=nil)\n start_time = Time.now.to_i\n until running?\n sleep 10\n raise \"Could not thaw society\" if maxtime && Time.now.to_i - start_time > maxtime\n end\n return... | [
{
"docid": "73f2b55785a3b0db0fe76d1df9b67e2b",
"score": "0.7387841",
"text": "def wait(max_time=nil, poll=2)\n elapsed = 0\n while running?\n sleep poll\n if not max_time.nil?\n elapsed += poll\n if elapsed > max_time\n raise VeritableError.new(\"Wait... |
1cfb03ec7d8ad65618e5587bf96b58a5 | List Tier1 interfaces Paginated list of all Tier1 interfaces | [
{
"docid": "c0da1878f65b0e010e39b19a915698d3",
"score": "0.6136207",
"text": "def list_tier1_interfaces_0_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterf... | [
{
"docid": "32dba696c767faf2adced96fda66f1b3",
"score": "0.62104803",
"text": "def list_tier1_interfaces_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfa... |
78fd6dc49bc6686b5e2ef4e3395c440e | PATCH/PUT /rank_comments/1 PATCH/PUT /rank_comments/1.json | [
{
"docid": "bbd4324b40afa56e7c3070ecbd0dd6d0",
"score": "0.7325645",
"text": "def update\n respond_to do |format|\n if @rank_comment.update(rank_comment_params)\n format.html { redirect_to @rank_comment, notice: 'Rank comment was successfully updated.' }\n format.json { render :sho... | [
{
"docid": "8e39c81746b7a598c24e5e34f302ceae",
"score": "0.66893446",
"text": "def update\n @comment = Comment.find(params[:comment_id])\n @comment.update(comment_params)\n render json: @comment\n end",
"title": ""
},
{
"docid": "99d72b1455026940514746bc963101a1",
"score": "0.6... |
aa73c3eb9ec749ad6fa4edf667b865ac | Checks to see if this vendor is restricted by locations | [
{
"docid": "3dc3d01d2160f83e04fc9171528d44f4",
"score": "0.66865057",
"text": "def uses_locations?\n @use_locations\n end",
"title": ""
}
] | [
{
"docid": "a2016ba174f164ec6511cf57c112c470",
"score": "0.7439772",
"text": "def current_user_can_see_all_locations?\n current_user_admin? || current_user_agent?\n end",
"title": ""
},
{
"docid": "d3bae48eeeb05d1d922055b746c0a73b",
"score": "0.74190444",
"text": "def precise_loc... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "57c8680dfe3d938f5d2e8a364de81dba",
"score": "0.0",
"text": "def set_pokemon\n @pokemon = Pokemon.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... |
6938f6d365c166233f3298c426174543 | Returns hash with all tagged commits as keys (SHA1) and versions as values. | [
{
"docid": "2ce56de1b403d303fd1b0a5cc7179dfc",
"score": "0.6586111",
"text": "def tagged_commits_mapping\n @commits ||= github_api_authenticated_get(\"/repos/#{repository_slug}/tags\").each_with_object({}) do |x, memo|\n memo[x.fetch('commit').fetch('sha')] = Gem::Version.new(x.fetch('name'))\n end... | [
{
"docid": "9e565febc5fcbcf0197a0c50afe33f2e",
"score": "0.7529599",
"text": "def commit_hashes\n log.map {|entry| entry['version']}\n end",
"title": ""
},
{
"docid": "9e565febc5fcbcf0197a0c50afe33f2e",
"score": "0.7529599",
"text": "def commit_hashes\n log.map {|entry| ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "70bd31778f231ccb898d4499c508ff37",
"score": "0.0",
"text": "def set_fdisk\n @fdisk = Fdisk.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60310465",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60152966",
"text": "d... |
e780beb8cb4490c4e9e7fb24a8f5c50e | Sets the attribute session_options | [
{
"docid": "c230bd1d7a826af6db9a354b3e2a1ff2",
"score": "0.7768559",
"text": "def session_options=(_arg0); end",
"title": ""
}
] | [
{
"docid": "ad127269b0fd815751e139053b39e230",
"score": "0.7953743",
"text": "def session_options\n @session_options ||= {}\n end",
"title": ""
},
{
"docid": "75ceb44e8f01390829831168d086f498",
"score": "0.7758569",
"text": "def session_options; end",
"title": ""
},... |
dc63669d2ed0c8a56d1eebce5b2a8953 | TODO: Refine this list to get the most useful quotes | [
{
"docid": "781c223618e1ce67f89f8ed40a73e501",
"score": "0.0",
"text": "def quote_bag\n QuoteBag.new quotes\n end",
"title": ""
}
] | [
{
"docid": "72162247e69da47019dbc1df1b5b615d",
"score": "0.7813891",
"text": "def quotes; end",
"title": ""
},
{
"docid": "8a17314603fce87d8d470eee09e2cd64",
"score": "0.7415617",
"text": "def quotes\n end",
"title": ""
},
{
"docid": "02b2c07c7787fedb38ab6b29c6fb93dc",
... |
c0cf1c6aa6900cde05fe5d132795f76a | Loads configurations from yaml | [
{
"docid": "5580abbf2dd50ae4cde768cf9df38a15",
"score": "0.0",
"text": "def load()\n\n # Get the project root directory\n @root_dir = locate_root\n\n if File.file? File.join(@root_dir, SETTINGS_FILE)\n settings = YAML.load_file File.join(@r... | [
{
"docid": "0d6b678af2a27f10c776961810efdaf1",
"score": "0.76481",
"text": "def load_config_from_yaml(path)\n config = load_config(path)\n\n # validate loaded yaml data\n validate_config config\n\n config.each do |key, value|\n Mihari.config.send(\"#{key.downcase}=\".to_sym, v... |
ba582504daeeda4c731a8823efcba555 | Adds a custom discount to the cart Permissions Needed: SHOPPING_CARTS_ADMIN | [
{
"docid": "31f68af94066cddc2da118c48064e360",
"score": "0.6344277",
"text": "def add_custom_discount(id, opts = {})\n add_custom_discount_with_http_info(id, opts)\n return nil\n end",
"title": ""
}
] | [
{
"docid": "eb560b657a75b2bd383727b5fe4b30fc",
"score": "0.73074657",
"text": "def discount_for cart\n discount_for_fixed(cart) / 100.0\n end",
"title": ""
},
{
"docid": "6fb438d4c18bd542fee5b8ddadbc920b",
"score": "0.7117887",
"text": "def discount\n discount = self[:discount... |
93be804a1439cb1be4efe2b2dc3513d7 | Get the default value of the custom field. ==== Returns Returns the default value. | [
{
"docid": "ab33a22831d99c02ddfe4295e815eabd",
"score": "0.78113127",
"text": "def getDefaultValue\n\t\t\t\n\t\t\t\t\treturn @defaultValue\n\t\t\t\n\t\t\t\tend",
"title": ""
}
] | [
{
"docid": "ac3e203b71a958cdb721bd6641995f6d",
"score": "0.7803364",
"text": "def default_value\n return @default_value\n end",
"title": ""
},
{
"docid": "ac3e203b71a958cdb721bd6641995f6d",
"score": "0.7803364",
"text": "def default_value\n re... |
1da44a386bc59fef717d860314405944 | PATCH/PUT /compras/1 PATCH/PUT /compras/1.json | [
{
"docid": "baf7f1aea52eb05f53acf3207dd7e4f2",
"score": "0.0",
"text": "def update\n\n end",
"title": ""
}
] | [
{
"docid": "3eeada2a66f5b60ca71aca81ef05eab7",
"score": "0.6567724",
"text": "def update\n @composante = Composante.find(params[:id])\n\n respond_to do |format|\n if @composante.update_attributes(params[:composante])\n format.html { redirect_to @composante, notice: 'Composante was succ... |
7e544e8567d73c5efd75f3619e4f9c10 | Gets the rectanlge for the 'master' location | [
{
"docid": "0fa724d57a7e77ff1360b7a94646d27b",
"score": "0.0",
"text": "def get_active_rect\n x = screen[:width_in_pixels] * 0.5\n y = screen[:height_in_pixels] * 0.5 \n \n x,y = center_on(x,y,active_client_width,active_client_height)\n \n return x,y,active_client_width,... | [
{
"docid": "b3ae024877989758c452ee03850b6f51",
"score": "0.646086",
"text": "def master\n @master\n end",
"title": ""
},
{
"docid": "639288d16fff431d3510baddd8fd2037",
"score": "0.6245357",
"text": "def master_uri\n call('getMasterUri', caller_id)\n ... |
bad0804f9c5bc5b0a249dbfb5b385a33 | Create our application's ESPs | [
{
"docid": "a37af024bb697324a2260b02aee12ae8",
"score": "0.0",
"text": "def processors(db_connection, tracker)\n [\n EventSourceryTodoApp::Projections::CompletedTodos::Projector.new(\n tracker: tracker,\n db_connection: db_connection,\n ),\n EventSourceryTodoApp::Projections::Outstan... | [
{
"docid": "c5180eb1132cf1517d095e4dbb9f32ac",
"score": "0.6475459",
"text": "def new\n puts \"Creating new blank Praxis app under #{app_name}\"\n create_root_files\n create_config\n create_app\n create_design\n create_spec\n create_docs\n end",
"title": ""
},... |
569cad785c2be1251ac9aad26d1c2783 | GET /t_odos/1 or /t_odos/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "a9f95d6224e58027497fd887406a9ccb",
"score": "0.6401195",
"text": "def show\n @os = Os.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @os }\n end\n end",
"title": ""
},
{
"docid": "3b3333ff09797eecee6dfe5... |
a6e38d21089c9194778bab2a527e8b9e | Gets the tokenEncryptionKeyId property value. Specifies the keyId of a public key from the keyCredentials collection. When configured, Azure AD issues tokens for this application encrypted using the key specified by this property. The application code that receives the encrypted token must use the matching private key ... | [
{
"docid": "fca1e9aef3af8c2f853f9584ba13e825",
"score": "0.7209305",
"text": "def token_encryption_key_id\n return @token_encryption_key_id\n end",
"title": ""
}
] | [
{
"docid": "a98bbb3a91bb5f2b92162e9d2acd375b",
"score": "0.67102814",
"text": "def token_encryption_key_id=(value)\n @token_encryption_key_id = value\n end",
"title": ""
},
{
"docid": "45e449fcfa18d5bc5d14e25d6030c170",
"score": "0.5918154",
"text": "def kms... |
5d36bc33edef60c98df7f0892620d00d | TODO: support double quoted identifiers | [
{
"docid": "16d75915b84d17186b08d9a06d76f700",
"score": "0.0",
"text": "def initialize()\n end",
"title": ""
}
] | [
{
"docid": "fbbe036840c9d4ce25a59ac74b34a4e5",
"score": "0.7458709",
"text": "def identifier(str); end",
"title": ""
},
{
"docid": "ba5bacc93e1ca52d4e3407102f241a80",
"score": "0.7259434",
"text": "def quoted_identifier(name)\n \"\\\"#{name.to_s.gsub('\"', '\"\"')}\\\"\"\n en... |
a2cc16ca31f0b3a549d2a3fe5757df16 | Public: Ensures the questionable path is prefixed with the base directory and prepends the questionable path with the base directory if false. base_directory the directory with which to prefix the questionable path questionable_path the path we're unsure about, and want prefixed Returns the sanitized path. source://jek... | [
{
"docid": "8875c9d808010913177e400e2b9fe1ee",
"score": "0.77860844",
"text": "def sanitized_path(base_directory, questionable_path); end",
"title": ""
}
] | [
{
"docid": "fa1701f10a6fd14806dee32553202c3c",
"score": "0.79840904",
"text": "def sanitized_path(base_directory, questionable_path)\n return base_directory if base_directory.eql?(questionable_path)\n\n clean_path = File.expand_path(questionable_path, \"/\")\n clean_path = clean_path.sub(... |
26a5d8d6d288c7718825d84af1c13852 | def to_miles(km_value) km_value / 1.6093 end | [
{
"docid": "2b74f30099f907300e60d63d904736ec",
"score": "0.0",
"text": "def average_speed_in_kph\n total_distance_in_km / total_time_in_seconds * 3600\n end",
"title": ""
}
] | [
{
"docid": "7540fb9fb68bf51bd4fdc82137301228",
"score": "0.93424696",
"text": "def to_miles(km); end",
"title": ""
},
{
"docid": "c7cc64f38d7b95aac088c8286df0a351",
"score": "0.9261874",
"text": "def to_miles(km)\n km * km_in_mi\n end",
"title": ""
},
{
"docid": "1b99... |
f45462ce6d83ab7960db65f902029dd3 | Override CanCan's find it won't properly search by zoned date | [
{
"docid": "74958bca1c816b9ac3d70e21e1fab7f2",
"score": "0.0",
"text": "def init_price_policy\n @start_date = parse_usa_date(params[:id] || params[:start_date])\n\n @price_policy = @product\n .price_policies\n .for_date(@start_date)\n .first... | [
{
"docid": "b0b447eddb9161a7bf299c018c788d69",
"score": "0.5195559",
"text": "def can_find_using_where_clause_and_be_sorted\n Movie.where('release_date > 2002').order('release_date desc')\nend",
"title": ""
},
{
"docid": "6262cc28abfed3242648d90f6392d8f9",
"score": "0.51442635",
"te... |
81f7df523fb9c92da81c25b8f5abb4cd | PUT /fuentes/1 PUT /fuentes/1.xml | [
{
"docid": "3a67e291444babf32376b8471fa305df",
"score": "0.6311567",
"text": "def update\n @fuente = Fuente.find(params[:id])\n\n respond_to do |format|\n if @fuente.update_attributes(params[:fuente])\n flash[:notice] = 'Fuente was successfully updated.'\n format.html { redirect... | [
{
"docid": "23b5f5e4dacfb330cb1e0ffd4590ef63",
"score": "0.6487486",
"text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post opts.fetch(:path, update_path), opts\n end",
"title": ""
},
{
"docid": "fbd7c46b15ae2792fd842ba0d764b7d0... |
7a78266305d5677635f813bf4d59b675 | GET /skies GET /skies.json | [
{
"docid": "629c5e03e509e629d42bc0cfe7eb2d17",
"score": "0.6875771",
"text": "def index\n @skies = Sky.all\n end",
"title": ""
}
] | [
{
"docid": "5c095376904a89497a99ae147634095f",
"score": "0.67623144",
"text": "def get_skus()\n\tputs \"Getting skus\"\n\tresponse = request_get(\"/api/sku\")\n\tputs response.body\nend",
"title": ""
},
{
"docid": "f4778b977254735c05948bec43b21062",
"score": "0.6559958",
"text": "def... |
fe990ff1e5ff2986f3975f97f58ad3ef | Initializes form name = form name saved_data = existing data on the server form_data = data displayed on the form live_data = existing data from deployment manifest | [
{
"docid": "2ef993da6ffbabf31552687b642cf606",
"score": "0.6447264",
"text": "def initialize(name, saved_data, form_data, live_data)\n @name = name\n @saved_data = saved_data\n @form_data = form_data\n @live_data = live_data\n @volatile_data = nil\n\n @screens = []\n\n ... | [
{
"docid": "a2ca9e3170d03afb236736158c65072e",
"score": "0.6337217",
"text": "def set_new_form_information\n @information[:form_url] = budgets_path(@budget)\n @information[:filter_form_url] = new_budget_path\n @information[:subtitle] = t('view.budgets.new_title')\n @information[:button_text]... |
2e4b1f08ccc71aa5485223c237424d5b | PATCH/PUT /disponibilites/1 PATCH/PUT /disponibilites/1.json | [
{
"docid": "fd85f41201e233fa695ce0bf8cf6b942",
"score": "0.7074159",
"text": "def update\n respond_to do |format|\n if @disponibilite.update(disponibilite_params)\n format.html { redirect_to @disponibilite, notice: 'Disponibilité bien mise à jour.' }\n format.json { render :show, s... | [
{
"docid": "d9989e48c6a20e50a7ba22578f066054",
"score": "0.7366413",
"text": "def update\n @disponibilite = Disponibilite.find(params[:id])\n\n respond_to do |format|\n if @disponibilite.update_attributes(params[:disponibilite])\n format.html { redirect_to @disponibilite, notice: 'Disp... |
c7defcf9fbbf8e64187e82b64c679f54 | GET /comments/1 GET /comments/1.json | [
{
"docid": "b6e695d840f73def61bfa1ea063dda42",
"score": "0.72470427",
"text": "def show\n # comment = Comment.find_comment\n render json: @comment\n end",
"title": ""
}
] | [
{
"docid": "db20166192f49f573bb8746e971d1bf0",
"score": "0.8280257",
"text": "def comments\n client.get(\"/#{id}/comments\")\n end",
"title": ""
},
{
"docid": "2d7ceb879edc63d117e7ddc1136c4c54",
"score": "0.74416476",
"text": "def comments\n @list.client.get(\"#{url}/com... |
65f06377d2e1b11b76d41f6b4f41459a | args format for array: sound_file, invalid_file, min = 0, max = 10, tries = 3, timeout = 7000, terminators = [""], chan_var = "fsr_read_dtmf", regexp = '\d' | [
{
"docid": "df6a9922283c092b20df2655c242cedb",
"score": "0.61104554",
"text": "def initialize(sound_file, invalid_file, *args)\n #puts args.inspect\n if args.size == 1 and args.first.kind_of?(Hash)\n arg_hash = DEFAULT_ARGS.merge(args.first)\n elsif args.size > 0\n ... | [
{
"docid": "47de9506db07563b3d65038387a8b72c",
"score": "0.5360855",
"text": "def senddtmf(options={})\n check_state\n\n base_uri = 'http://hosting.tropo.com/49767/www/audio/dtmf/'\n options[:args][0].split(//).each do |char|\n case char\n when '1', '2', '3', '4', '5', '6', ... |
95cd46db760099aabfb72d43cea6b454 | want to pluck all the words out of the sentencecan't use .split, etc. | [
{
"docid": "8f9052164a1287b3ff967c45f3fde95d",
"score": "0.6793797",
"text": "def words\n arr = []\n counter = 0\n string = \"\"\n while counter < self.length\n if self.text[counter] == \" \" #a space means a word has ended which means we need to push a new one in\n arr.push(stri... | [
{
"docid": "55b2db708ce983114042e16be39eb1fb",
"score": "0.77765435",
"text": "def words\n @phrase.split(' ')\n end",
"title": ""
},
{
"docid": "a28181b1f485808fe65c6ff139545f2f",
"score": "0.77374357",
"text": "def words\n phrase.split\n end",
"title": ""
},
{
"d... |
3f2d49c61c52c68c5fa3ccd6c513c2d4 | Find and return the dock application | [
{
"docid": "39a847d190e7e85ed9f90d074071e6c7",
"score": "0.64528334",
"text": "def dock\n new 'com.apple.dock'\n end",
"title": ""
}
] | [
{
"docid": "34414f5a27717082ffad874310ac6a98",
"score": "0.6393752",
"text": "def application\n Accessibility::Element.application_for pid\n end",
"title": ""
},
{
"docid": "b699afce0fb5c9778863dbfab7543078",
"score": "0.6362145",
"text": "def local_app_name\n [File.expand... |
98c68a95bc0656c6570ff62a14eb6b83 | A method that might be used in the future, but isn't currently def score | [
{
"docid": "d8e1e4d33697e5ce0631fd9b427a20ce",
"score": "0.0",
"text": "def draw\n self.image.draw_rot((@x+0.5)*60, (@y+1.5)*60, ZOrder::Piece, @angle)\n end",
"title": ""
}
] | [
{
"docid": "8ecaf647f536b0bd12fb07d6e189ff9d",
"score": "0.87415296",
"text": "def score; end",
"title": ""
},
{
"docid": "8ecaf647f536b0bd12fb07d6e189ff9d",
"score": "0.87415296",
"text": "def score; end",
"title": ""
},
{
"docid": "8ecaf647f536b0bd12fb07d6e189ff9d",
... |
d629bc42316b554a95d65d17c03db1ba | post method when paid button is click | [
{
"docid": "31a446c83bbe2a2e3b3d4f4c1cd4bbc6",
"score": "0.0",
"text": "def receive_donation\n donation = Donation.find(params[:donation_id])\n if donation.update(paid: true)\n respond_to do |format|\n format.html {redirect_to users_chair_path, notice: \"donation received\"}\n f... | [
{
"docid": "bda0a9c779b47ddfa623bd173b9f11cb",
"score": "0.7664195",
"text": "def mark_as_paid_button\n @template.button_to 'Mark as paid', mark_as_paid_effort_path(self, :uid => self.id), :method => :post, data: { confirm: 'Are you sure?' }\n end",
"title": ""
},
{
"docid": "ed21afda8be... |
607ef8ed4cf5882daf6b2153dbd9a7b4 | GET /provider_accounts/new GET /provider_accounts/new.xml | [
{
"docid": "0074099226371c6e07518d67b1ef11c6",
"score": "0.74458814",
"text": "def new\n\t\t@provider_account = ProviderAccount.new\n\t\t@users = User.find(:all, :order => :login)\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml { render :xml => @provider_account }\n\t\... | [
{
"docid": "41d3b707bd7f2e7af0fc1188e7bbdef5",
"score": "0.7334351",
"text": "def new\n @account = Account.new_named\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"title": ""
},
{
"docid": "4f0bef714f3b8868... |
7d761213983a530ebd0bed790a487898 | UNIT TESTS FOR METHOD get_hash() | [
{
"docid": "ce63b2018ca0aabfd2748cb9850b6cbe",
"score": "0.7576859",
"text": "def test_get_hash_test_string\r\n\t\tassert_equal @bc.get_hash('test'), 'f3f2' \r\n\tend",
"title": ""
}
] | [
{
"docid": "d5db449918e4bf88c6ce33a68de5903c",
"score": "0.772417",
"text": "def get_hash(*params); raise('Stub or mock required.') end",
"title": ""
},
{
"docid": "727b40f9aeaf16679278f4e7e7c6a588",
"score": "0.76852226",
"text": "def hash()\n #This is a stub, used for indexi... |
e36086a58ad1b293b875b481dbbbc812 | DELETE /player_item_stats/1 DELETE /player_item_stats/1.json | [
{
"docid": "013e9542fd6f50d24a887aac6a3ff6ba",
"score": "0.76522267",
"text": "def destroy\n @player_item_stat.destroy\n respond_to do |format|\n format.html { redirect_to player_item_stats_url, notice: 'Player item stat was successfully destroyed.' }\n format.json { head :no_content }\n... | [
{
"docid": "c331826f6c8e836228dfa418016c2ce3",
"score": "0.7189387",
"text": "def destroy\n @player_stat = PlayerStat.find(params[:id])\n @player_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to player_stats_url }\n format.json { head :no_content }\n end\n end",... |
69a8f5aeaf0985ea690ce33e744d7a62 | Get Rates with Shipment Details | [
{
"docid": "8a0a535dbbaa7b11b524d68aa926cca6",
"score": "0.6839806",
"text": "def get_rates_with_shipment_details(shipment_details, config = {})\n @rates.get_rates_with_shipment_details(shipment_details, config)\n end",
"title": ""
}
] | [
{
"docid": "465439dc4a9e71190b878876066ef9dd",
"score": "0.7121323",
"text": "def shipment_rates\n order.shipments.flat_map do |shipment|\n calculate_rates(shipment)\n end\n end",
"title": ""
},
{
"docid": "5c7eb4e8285927935b83d1690c4b58c0",
"score": "0.626249... |
d66b4c5f2ac273f23487ab726a93ac79 | DELETE /pitches/1 DELETE /pitches/1.json | [
{
"docid": "286ce3afd034ae077e62bc40f915b58c",
"score": "0.6664212",
"text": "def destroy\n @pitch.destroy\n respond_to do |format|\n format.html { redirect_to pitches_url, notice: 'Projeto destruído com sucesso.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}... | [
{
"docid": "0af354043041a2cd60d427a369516b6b",
"score": "0.7051979",
"text": "def destroy\n @pitch = Pitch.find(params[:id])\n @pitch.destroy\n\n respond_to do |format|\n format.html { redirect_to pitches_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
... |
b6b1600178046ca9cbc34e9194b36555 | just a nicer alias for Ruby's own sleep | [
{
"docid": "f7221eddbbdefa3ee14a0c3d095917ee",
"score": "0.0",
"text": "def keep_going(duration)\n Kernel::sleep duration\n end",
"title": ""
}
] | [
{
"docid": "2cdaf22be53fc159991d2d8017f8796c",
"score": "0.8376403",
"text": "def put_sleep(time)\r\n\tsleep(time)\r\nend",
"title": ""
},
{
"docid": "a22ad261bbc3fb758116529f95ba6f04",
"score": "0.82045156",
"text": "def sleep_example(seconds)\n\tputs \"From now\"\n\tp sleep(seconds... |
e81fe427871b8e78dcb2ac2c461b06d9 | size of the file in bytes. see Filesize | [
{
"docid": "665f123d25807b0bc83a8af66848484c",
"score": "0.8059351",
"text": "def size\n @size = File.size(self.path) unless @size\n @size\n end",
"title": ""
}
] | [
{
"docid": "c30f6d0273555c2694b76185aa803b98",
"score": "0.87965727",
"text": "def size_in_bytes\n ( file_length * 16 ) / 8\n end",
"title": ""
},
{
"docid": "f5db59cb191775922da7c169b811c138",
"score": "0.8710147",
"text": "def size\n file.size\n end",
"title... |
f4da41ae32bc38d9a6d89937a458afc2 | fetches all objects in order of their succession | [
{
"docid": "7aec45960c9960015fa71565f200ffd1",
"score": "0.0",
"text": "def all_in_succession\n all = []\n object = self.first_in_succession\n while object do\n all.push(object)\n object = object.successor\n end\n all\n end",
"title": ""
}
] | [
{
"docid": "a212dd8149abba459bee148ccc75fd06",
"score": "0.7069825",
"text": "def all\n ordered @objects\n end",
"title": ""
},
{
"docid": "17946cf672f70b49a04d3acc915e8f83",
"score": "0.6733282",
"text": "def fetch!\n collection.fetch_objects!\n end",
"title": ""... |
2fff2eefcfb12256ee79cb22c4f193ef | Describes the return value (and type or types) of a method. You can list multiple return tags for a method in the case where a method has distinct return cases. In this case, each case should begin with "if ...". | [
{
"docid": "ab14e6233a9e912a427b0d6105dd1a1a",
"score": "0.5047738",
"text": "def return_tag(text); end",
"title": ""
}
] | [
{
"docid": "e502b5fd556a7443474986364c4c9904",
"score": "0.6182931",
"text": "def capture_return_type\n matches = @code.scan(/^\\s*[+-]\\s*\\(([^\\(\\)]*)\\)/)\n return nil if matches.size != 1\n type = matches[0][0].to_s.gsub(TAILMATCH, '')\n\n if type == 'void' || type == 'IBAction... |
be8a1f3648dfd1274cdadfadeace5ff7 | read a yaml file of defaults and write out the options | [
{
"docid": "e4bed6b131215dec64c1aaad44085cfd",
"score": "0.6326813",
"text": "def read_defaults(config_file)\n begin\n defaults = YAML.load_file(config_file)\n\n unless defaults == false\n defaults.each do |k, v|\n if self.respond_to?(k.to_sym)\n self.instance_var... | [
{
"docid": "6aa3a81ed636ba662fe577eb15e9e8c9",
"score": "0.66716",
"text": "def load_settings\n attributes = YAML.load_file(\"defaults.yml\")\n begin\n custom_attributes = YAML.load_file(\"config.yml\")\n attributes = simple_deep_merge(attributes, custom_attributes)\n rescue\n end\n attribute... |
5d6a02e4deed39d3757000c74e156d81 | Find the folders that don't contain this document | [
{
"docid": "0bde33f3c567459bc2d1fd81d38579b2",
"score": "0.51622546",
"text": "def without_document(document)\n where(\"id not in (#{membership_query(document)})\")\n end",
"title": ""
}
] | [
{
"docid": "986380c3b35bd010ead97b050053a624",
"score": "0.65173745",
"text": "def documents_without_folder\n documents.unfolded\n end",
"title": ""
},
{
"docid": "0b0c46596115cb57b803db00bbb84d78",
"score": "0.6392908",
"text": "def unneeded_files_in_destination\n request... |
8e03c83fe481342bfb112e57331c7d5b | Private, for the test suite. source://activesupport//lib/active_support/inflector/inflections.rb84 | [
{
"docid": "fd6582765aeef195d5bd746b42b494b5",
"score": "0.0",
"text": "def initialize_dup(orig); end",
"title": ""
}
] | [
{
"docid": "ff7ad4bba7e3559fc9519de0aa5af67e",
"score": "0.80171406",
"text": "def inflector; end",
"title": ""
},
{
"docid": "ff7ad4bba7e3559fc9519de0aa5af67e",
"score": "0.80171406",
"text": "def inflector; end",
"title": ""
},
{
"docid": "70eada24a98fb99f8b7e2ef48aa70c... |
fb263526de4cbdd79b184f9176d0ea24 | BasicObject is so basic that this part is missing too | [
{
"docid": "2d18a6d28e8e1d4e7b3e1840f8417bd3",
"score": "0.0",
"text": "def class\n Proxy\n end",
"title": ""
}
] | [
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73352844",
"text": "def object; end",
"title": ""
},
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73342746",
"text": "def object; end",
"title": ""
},
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
... |
07fc68648ea4e11825e2cf1b47393e13 | method allow_private? Generates a description of the matcher expectation. | [
{
"docid": "ab0f767bc63498600d84e55ee5c0fd23",
"score": "0.58308864",
"text": "def description\n \"have writer :#{@expected}\"\n end",
"title": ""
}
] | [
{
"docid": "836ff835379405d5651d9c64bd8ce86a",
"score": "0.6567819",
"text": "def test_is_private_keyword\n verify_method :is_private_keyword?, with: [\n {param: 'private', expect: true},\n {param: ' private', expect: true},\n {param: 'private ', expect: true},\... |
a88e249efdfd9af19d305dabd3e15a03 | GET /pois/guest/1 GET /pois/guest/1.json | [
{
"docid": "75295532e708029a5ec5cfbd0b0440b4",
"score": "0.0",
"text": "def guest\n #get sum of all importances\n @guest = Guest.where(:id => params[:id]).first!\n\n @sum = Importance.where(:guest_id => params[:id]).sum('importance')\n\n #query all interests that have an impo... | [
{
"docid": "a62a6bf40caeda4e8af2cce0bcd95a3b",
"score": "0.7248676",
"text": "def get_a_guest(args = {}) \n get(\"/guestaccess.json/#{args[:guestId]}\", args)\nend",
"title": ""
},
{
"docid": "a62a6bf40caeda4e8af2cce0bcd95a3b",
"score": "0.7248676",
"text": "def get_a_guest(args = {}... |
4dea0a4ec7882392ef0b08d272d4e1ec | This method executes on Apply Tariffs | [
{
"docid": "fe6baf262f02361f05c00ccdb237fb57",
"score": "0.0",
"text": "def index\n @billers = billers_dropdown\n\n if params[:bills]\n @bills = PreBill.where(pre_group_no: params[:bills]).paginate(:page => params[:page] || 1, :per_page => per_page || 10)\n else\n if session... | [
{
"docid": "a18186567d58d46fbcb43c48faf2ab4b",
"score": "0.58946514",
"text": "def apply\n\t\t\n\tend",
"title": ""
},
{
"docid": "a18186567d58d46fbcb43c48faf2ab4b",
"score": "0.58946514",
"text": "def apply\n\t\t\n\tend",
"title": ""
},
{
"docid": "d9857d32314645121121c1... |
efca4a8a367b48063d1e4574f9e26ff7 | This breaks the rails MVC pattern, but the functionality needed trumps blind adherance to the pattern, IMHO Hans for CTMRoles | [
{
"docid": "7cb6fc5a620a061b002ba590496ab243",
"score": "0.0",
"text": "def expose_session_to_models\n $_SESSION = session\n end",
"title": ""
}
] | [
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"score": "0.6831048",
"text": "def role; end",
"title": ""
},
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"score": "0.6831048",
"text": "def role; end",
"title": ""
},
{
"docid": "d15d02899f81226e726dd6e078127243",
"sc... |
91058cb3e2ab2271ab979aeb1af54200 | Convert an xml fragment to a hash. | [
{
"docid": "50cde67c990f1881e3682c0957b71dc5",
"score": "0.52362275",
"text": "def from_xml(xml)\n Hash::XML.from_xml(self, xml)\n end",
"title": ""
}
] | [
{
"docid": "08f8d18a8f608916364352f5f8ca9df5",
"score": "0.6720629",
"text": "def to_hash\n Utils.xml_to_hash xml\n end",
"title": ""
},
{
"docid": "4628683133ef3d576ab2743c900dfc93",
"score": "0.66989696",
"text": "def generate_xmlhash\n self.xmlhash = Digest::SHA256.... |
6a0a2fa4b8bae81f64205c15a9448184 | Some OpenID Connect IDP change their encryption keys frequently. For example, Google rotates daily: To assure we always have current copies of the public keys, we'll force hourly reconfiguration. | [
{
"docid": "a50dfd664dfa343cb24df786f98d9588",
"score": "0.72321117",
"text": "def public_keys_for(provider)\n if provider.updated_at < 1.hour.ago\n logger.debug 'Forcing IDP reconfiguration to update public keys.'\n provider.reconfigure\n provider.save\n e... | [
{
"docid": "7ea8500c7b924d20327057d5545eabad",
"score": "0.68488115",
"text": "def regenerate_crypto\n info 'Regenerate crypto key'\n \n @session.configuration(:enforce_save) do\n zeroize 'crypto key'\n begin\n generate 'crypto key', 'rsa general-keys modulus 2048'\n rescu... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "8254ec44eee03dfe1c9cb48920354244",
"score": "0.0",
"text": "def set_task\n @task = Task.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163754",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6045816",
"text": "def action_hook;... |
edaa0e0808045b4bd900e4b419fda6c8 | Returns the UID for the username on the host. | [
{
"docid": "ff59dccd2ec89dfa0ac5ae7293c6005e",
"score": "0.77411574",
"text": "def get_uid(username)\n Etc.passwd { |u| return u.uid if u.name == username }\n end",
"title": ""
}
] | [
{
"docid": "d4ad0fc325570ce343150b17ac973ad1",
"score": "0.8262799",
"text": "def username\n real_uid = uids[:real]\n begin\n return Etc::getpwuid(real_uid).name\n rescue ArgumentError\n return real_uid.to_s\n end\n end",
"title": ""
},
{
"docid": "438cdef32c5a959dd2bc... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "3c3b752ff580c6c99787a9a1dc5cf95d",
"score": "0.0",
"text": "def casket_params\n params.require(:casket).permit!\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... |
ce3f86057a9d7a3597a7f89b52485cf4 | Set an environment variable in a user's shell instance We don't have direct access to this, so we must request it Parameters `key` : the key of the environment variable `value` : the value of the environment variable | [
{
"docid": "d09a0fd9ec9ad519c60ede44fc163b03",
"score": "0.7718396",
"text": "def setenv(key, value)\n @setenv ||= {}\n @setenv[key] = value\n end",
"title": ""
}
] | [
{
"docid": "3c6a3eb3e24bbc86ed7ac814b207278e",
"score": "0.80110884",
"text": "def enviroment_set(key, value)\n cmd1 = \"set #{key}=\\\"#{value}\\\";\"\n cmd1 << \"export #{key}=\\\"#{value}\\\"\"\n # fallback\n # sash style\n cmd2 = \"setenv #{key} \\\"#{value}\\\"\"\... |
db4d1560e7efb770a18df065e54aa347 | POST /accommodation_categories POST /accommodation_categories.json | [
{
"docid": "911d38b0f6f6abddb18227dbe832a680",
"score": "0.72065306",
"text": "def create\n @accommodation_category = AccommodationCategory.new(accommodation_category_params)\n\n respond_to do |format|\n if @accommodation_category.save\n format.html { redirect_to @accommodation_categor... | [
{
"docid": "2e413155a54df8bd90ccd162b27efc30",
"score": "0.6839374",
"text": "def CreateCategory params = {}\n \n APICall(path: 'categories.json',method: 'POST',payload: params.to_json)\n \n end",
"title": ""
},
{
"docid": "9667f5248a9d1608325dd16ffdd42c28",
"sc... |
17b6865bdf8f4da664ad148fc200c97c | End Method: Update Method: Delete | [
{
"docid": "c501b0d574850fbf28a03bfe6ef840ec",
"score": "0.0",
"text": "def delete\n\t\tTaxcategory.find(params[:id]).destroy\n\t\tredirect_to :action => 'list'\n\tend",
"title": ""
}
] | [
{
"docid": "85731848a0e037564c3713a67c422435",
"score": "0.80373126",
"text": "def delete\n #TODO\n end",
"title": ""
},
{
"docid": "039a8c1fd873a2c0705fb7babbb73702",
"score": "0.80103457",
"text": "def delete\n end",
"title": ""
},
{
"docid": "65cb602... |
ea5819c769e00d9c341d667376e0a7b2 | Extract data from the RSS feed | [
{
"docid": "be9bb98ae0e52f42fdcfcb8cd7a7328e",
"score": "0.7065321",
"text": "def scrape\n open(@url) do |rss|\n feed = RSS::Parser.parse(rss)\n\n feed.items.each do |item|\n # Remove the p tag and retrieve image url from the description\n # if it exists\n p_tag = item.... | [
{
"docid": "a0d07425ade2b2e9903fe50960ddddfa",
"score": "0.7480618",
"text": "def loadRSSFeeds \n @raw_data = RSS::Parser.parse('http://www.nachrichten.at/storage/rss/rss/weltspiegel.xml', false)\n end",
"title": ""
},
{
"docid": "819477ca26d99edc3f048689ce0938b3",
"score": "0.737451... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "0ee62ba45ca6ffe9a72e93c03370c7f2",
"score": "0.0",
"text": "def set_item_unit\n @item_unit = ItemUnit.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... |
a9f33d1ab83951633bbe0bab96ec913e | Return the most recent move. | [
{
"docid": "4d7ca7aac4beff4eb88e7d6c46924793",
"score": "0.77240956",
"text": "def last_move\n move_queue.last\n end",
"title": ""
}
] | [
{
"docid": "dce9826d0dc60706d61a85d8e78f2bd5",
"score": "0.7947677",
"text": "def last_move\n #the last line is always returned... Learn your shiz.\n self.moves.first(:conditions => [\"move = ?\", self.moves.maximum(\"move\")])\n end",
"title": ""
},
{
"docid": "2a8de491d04b... |
0079daf29b4e46b788abc7c076e8a3e8 | DELETE /user_account_apps/1 DELETE /user_account_apps/1.json | [
{
"docid": "6904e7a0c8fc4515dc2904a4a51b478d",
"score": "0.7671787",
"text": "def destroy\n @user_account_app = User.find(params[:id])\n @user_account_app.destroy\n\n respond_to do |format|\n format.html { redirect_to user_account_apps_url }\n format.json { head :no_content }\n end... | [
{
"docid": "d6fb45090adacee8da4ca9c486c981eb",
"score": "0.7375535",
"text": "def destroy\n @user_app = UserApp.find(params[:id])\n @user_app.destroy\n\n respond_to do |format|\n format.html { redirect_to user_apps_url }\n format.json { head :no_content }\n end\n end",
"title"... |
3990a86c5c181e5d8b83355c5a4438cc | add migration class definition and up migration | [
{
"docid": "b1a30eec591c98eb86f2cc79057c37a2",
"score": "0.0",
"text": "def individual_header(view, stream)\n stream.puts <<HEADER\nclass Create#{view.camelcase} < ActiveRecord::Migration\n def self.up\nHEADER\n end",
"title": ""
}
] | [
{
"docid": "1350df962a3dae5b43513faa3a5221b1",
"score": "0.7617033",
"text": "def schema_migration; end",
"title": ""
},
{
"docid": "4853d7c5f5d4f8ccd71178af47db6e83",
"score": "0.7292758",
"text": "def run_migration; end",
"title": ""
},
{
"docid": "248c2985c5beb7181dc13... |
a24eea1fee6da65df8a9421ec0d83fe0 | =begin Role assignment related =end | [
{
"docid": "37285fb26afc4506e85b20d7f38d4b90",
"score": "0.0",
"text": "def has_role?(role_sym)\n roles.any? { |r| r.name.underscore.to_sym == role_sym }\n end",
"title": ""
}
] | [
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"score": "0.6888322",
"text": "def role; end",
"title": ""
},
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"score": "0.6888322",
"text": "def role; end",
"title": ""
},
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"sc... |
954c2ed9e295775cd63c4115a133fdd7 | POST /seller_goals POST /seller_goals.json | [
{
"docid": "b17c75cd9e0fd6c8fd7b492b8dde7789",
"score": "0.7580957",
"text": "def create\n @seller_goal = SellerGoal.new(seller_goal_params)\n\n respond_to do |format|\n if @seller_goal.save\n format.html { redirect_to @seller_goal, notice: 'Seller goal was successfully created.' }\n ... | [
{
"docid": "4cdf9260cfefa8f301926f1bf7d19be8",
"score": "0.6616069",
"text": "def index\n @seller_goals = SellerGoal.all\n end",
"title": ""
},
{
"docid": "b865b39314d7fcc16b295d3ae93c3ddd",
"score": "0.65742755",
"text": "def create\n @goals = goals_for_current_user\n @goa... |
0b1b0ba4fa2dd2192e46e2015df6e9c7 | Get information about loggedin user. The permissions parameter of the NsxRole has been deprecated. Get information about loggedin user. The permissions parameter of the NsxRole has been deprecated. | [
{
"docid": "15b40732da3362445d1105847249200f",
"score": "0.0",
"text": "def get_current_user_info_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiAaaApi.get_current_user_info ...'\n end\n # resource path\... | [
{
"docid": "86974926393e4c9b598346561687a695",
"score": "0.706729",
"text": "def get_user_info\n response = send_method(:get_user_info)\n user_from(response)\n end",
"title": ""
},
{
"docid": "0c2e1fb243ef0c2a58078e150424c831",
"score": "0.6808185",
"text": "def info()\n... |
c75a8544986d53d318c5e6c957cff412 | GET /rewards/1 GET /rewards/1.json | [
{
"docid": "b83568c1af52e5fa08ad1f04efe20be1",
"score": "0.7137614",
"text": "def show\n @reward = Reward.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reward }\n end\n end",
"title": ""
}
] | [
{
"docid": "020aef71b87f0ddcd0322c32ab233f7c",
"score": "0.7578631",
"text": "def show\n @reward = current_user.rewards.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reward }\n end\n end",
"title": ""
},
{
"docid"... |
1d1df44e376ca7b2e23d4ee24dcb3540 | PUT /messages/1 PUT /messages/1.json | [
{
"docid": "a2b4268690003fcc255d620365e9a2d9",
"score": "0.664994",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, :notice => 'Message was successfully updated... | [
{
"docid": "0721a62a337f3985296b73ef8cc0c937",
"score": "0.71835774",
"text": "def update\n respond_to do |format|\n @message.update!(message_params)\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "86404a152661843b6ec98c0576bc26c3",
"score": "... |
4b8aa8f135b3f11edd025a2fc7416ed0 | Converts degrees, minutes and seconds to a Rational. | [
{
"docid": "395e129b6b483207d85e93097e77a7b1",
"score": "0.8074667",
"text": "def dms_to_rational(sign, degrees, minutes, seconds = nil)\n degrees = degrees.to_i\n minutes = minutes.to_i\n sign = sign == '-'.freeze ? -1 : 1\n\n if seconds\n Rational(sign * (degrees *... | [
{
"docid": "c891c1efad82f1d4ad526a2dfc80c6f5",
"score": "0.7963859",
"text": "def dms_to_rational(sign, degrees, minutes, seconds = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "cdba8c2015c450bf43c921ba3ae231b9",
"score": "0.78841656",
"text": "def dms_to_rational(sign, degrees, m... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "ac5c2898bbf25e449534d61b781372c2",
"score": "0.0",
"text": "def set_juese\n @juese = Juese.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... |
2a778c1eba38da2aa55d54f2a1285e6b | Creates a new account associated with a user | [
{
"docid": "d7cf5a904332887fd33de56a4cd04308",
"score": "0.0",
"text": "def create_account(user)\n account = Account.to_adapter.get!(user.id)\n update_status = account.update_with_password({ \"email\" => user.email, \"name\" => user.username })\nend",
"title": ""
}
] | [
{
"docid": "47a075acad456a76ca2b72b74cbe7748",
"score": "0.8249613",
"text": "def create_account_user(options = {})\n post('accountuser?_method=PUT', options)\n end",
"title": ""
},
{
"docid": "9057a97cf9a1f347310d32bb331848bd",
"score": "0.8177913",
"text": "def create\n... |
5a946bab6e095b2261317d594905af50 | show works that are in the active state. | [
{
"docid": "24e207d04767f877d9e042907d70407e",
"score": "0.0",
"text": "def show_only_active_records(solr_parameters)\n solr_parameters[:fq] ||= []\n solr_parameters[:fq] << '-suppressed_bsi:true'\n end",
"title": ""
}
] | [
{
"docid": "1061492db8acb1bc910e37c53d1d44ea",
"score": "0.62816906",
"text": "def show\n @task_items = @task_list.items.active\n end",
"title": ""
},
{
"docid": "dfa55c3b8d1e89ee1a4d3b1c20fc41b7",
"score": "0.6179334",
"text": "def show\n\t\t@works = @anthology.works.decorate\n\... |
68b22053b76f6c9d76caaebbed29382b | Adds form field to paragraph, returns added form field's data. | [
{
"docid": "727c52dbd22257b3e36a313e9c999624",
"score": "0.0",
"text": "def put_form_field(request)\n data, _status_code, _headers = put_form_field_with_http_info(request)\n request_token if _status_code == 401\n data\n end",
"title": ""
}
] | [
{
"docid": "caed7e14af74916ced34508960c8480e",
"score": "0.63744414",
"text": "def add_field\n if request.get?\n @info = Hash.new\n @field_hash = Hash.new\n session[:count] = 1\n else\n @fields = []\n @field_hash = Hash.new\n session[:field_hash] = @field_hash\n ... |
6e139f584d26fc7e0a73d87d990d3768 | Set the value of the RowEnd input for this Choreo. | [
{
"docid": "2e05cce681780dd5577d004f6e0026f3",
"score": "0.7819764",
"text": "def set_RowEnd(value)\n set_input(\"RowEnd\", value)\n end",
"title": ""
}
] | [
{
"docid": "2ea80ab79ed6e3fc760516a06ae69462",
"score": "0.60769826",
"text": "def end_cell=(value)\n @end_cell = value\n end",
"title": ""
},
{
"docid": "2f427f91ba782c875bac6fffddc0e6ba",
... |
49010d84e365151df643cf164ccaab8f | PUT /warmups/1 PUT /warmups/1.xml | [
{
"docid": "cbfd0573c4245f5ac3e600457dda19bf",
"score": "0.71528786",
"text": "def update\n @warmup = Warmup.find(params[:id])\n\n respond_to do |format|\n if @warmup.update_attributes(params[:warmup])\n format.html { redirect_to(@warmup, :notice => 'Warmup was successfully updated.') ... | [
{
"docid": "2b84dec63886ffea9aeaa0a7a353ad23",
"score": "0.6523417",
"text": "def create\n @warmup = Warmup.new(params[:warmup])\n\n respond_to do |format|\n if @warmup.save\n format.html { redirect_to(@warmup, :notice => 'Warmup was successfully created.') }\n format.xml { ren... |
8ebfe7e208fa14203eded373c276be97 | If user is logged in, returns them as json object else returns null TODO: (performance) don't need to return full user object | [
{
"docid": "fb7aa68ab2bf6ade5de74d2cb8949dd2",
"score": "0.7386238",
"text": "def get_cur_user\n @user = nil\n if is_logged_in session\n @user = User.find_by_sunet(session[:user_hash][\"username\"])\n end\n render json: @user\n end",
"title": ""
}
] | [
{
"docid": "a0103122c5e780e06e24c462b16e5a37",
"score": "0.75193197",
"text": "def logged_in\n #checks to see if a current user is available \n \n if @current_user\n render json: {\n logged_in: true,\n user: @current_user\n }\n else \n render json: {\n log... |
7c8143a25ed065b39e708fa98c853274 | Add a note Adds a new note | [
{
"docid": "10314c8739ebb4b180eaa4a6730a8b04",
"score": "0.0",
"text": "def notes_post(content, opts = {})\n notes_post_with_http_info(content, opts)\n end",
"title": ""
}
] | [
{
"docid": "0c2305a0f781540ff064d469b7658e99",
"score": "0.8902171",
"text": "def addNote(note)\n @note = note\n end",
"title": ""
},
{
"docid": "5ad358b10197aef260f2aeaa3128651e",
"score": "0.86830425",
"text": "def add_note(note)\n notes << note\n end",
"tit... |
201e9cdb7ac095d18a85fec4658bb252 | Overriding so that we have pagination by default | [
{
"docid": "d478807b75265f0bd5eec3d305f32503",
"score": "0.0",
"text": "def collection\n get_collection_ivar || set_collection_ivar(end_of_association_chain.paginate(:page => params[:page]))\n end",
"title": ""
}
] | [
{
"docid": "9e416762c92907672b35ecb5ab650dc9",
"score": "0.83754426",
"text": "def auto_paginate; end",
"title": ""
},
{
"docid": "1c1d8a2397d80198dde923f9cfb160bb",
"score": "0.8072182",
"text": "def paginate; false; end",
"title": ""
},
{
"docid": "a34d32d5402182ca4f53d... |
0e0a862b9b210a3b7adea8173639a3dc | PATCH/PUT /detail_invoices/1 PATCH/PUT /detail_invoices/1.json | [
{
"docid": "45d29b9814ea4e3b26d3bc5d479ab797",
"score": "0.72761405",
"text": "def update\n respond_to do |format|\n if @detail_invoice.update(detail_invoice_params)\n format.html { redirect_to @detail_invoice, notice: 'Detail invoice was successfully updated.' }\n format.json { re... | [
{
"docid": "ef9c9b31edbf325f824f5ac91b9f3318",
"score": "0.731254",
"text": "def update\n @invoice_detail = InvoiceDetail.find(params[:id])\n\n respond_to do |format|\n if @invoice_detail.update_attributes(params[:invoice_detail])\n format.html { redirect_to @invoice_detail.invoice, no... |
1344cc2921c6275c469a17abead044ad | Return instance role (i.e., app, utility, db, db_master, app_master | [
{
"docid": "ca2a78b12d3bbc4cf10902798f18c009",
"score": "0.74625564",
"text": "def role\n @instance['role']\n end",
"title": ""
}
] | [
{
"docid": "0e7d1d825ff55742102c4c6599f561c0",
"score": "0.7990451",
"text": "def role\n @role ||= begin\n _, role, _ = *I.parse_instance\n role || raise(Missing, \"Cannot determine role, INSTANCE env value is #{I.from_environment(\"INSTANCE\").inspect}\")\n end\n end",
"title": ""
... |
a503bb01d49a3218316b2f212cb71991 | Load our values from the file(s) specified during creation, in order, respecting the :secure option to only load safe settings files if so specified. | [
{
"docid": "94e6bb58fc1bbf2fb0d7589972a8a45f",
"score": "0.0",
"text": "def load\n super\n @paths.each {|p| load_file(p) }\n end",
"title": ""
}
] | [
{
"docid": "51191d3ddd7a503b8b2eca6b9c27e306",
"score": "0.6583093",
"text": "def load_settings(settings)\n\t\t@credentials = JSON.load(File.read(settings[:credentials_filename])) \n\t\t@config = JSON.load(File.read(settings[:config_filename]), nil, symbolize_names: true)\n\tend",
"title": ""
},
... |
35462e1ebc99ffd5f9a1aa0f568edc8f | GET /folder2s/1 GET /folder2s/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "615e7ee407b642a2a6d85bc787c5c696",
"score": "0.6977759",
"text": "def index\n @folder2s = Folder2.all\n end",
"title": ""
},
{
"docid": "c2d79da5ac66ffaaa1b7526d4a5b1dea",
"score": "0.66519",
"text": "def set_folder2\n @folder2 = Folder2.find(params[:id])\n en... |
8d7d07c6e4f620a7eb435f37364f8efc | Return the IDs of all children recursively. | [
{
"docid": "0ccd78813be5b08b75266d7f11bdee0f",
"score": "0.83859193",
"text": "def child_ids\n ids = [self.id]\n self.children.each do |child|\n ids += child.child_ids\n end\n ids\n end",
"title": ""
}
] | [
{
"docid": "ff421380f3353923d21c09366a024760",
"score": "0.8937491",
"text": "def get_children_ids_recursive\n ids = []\n children.each do |c|\n\t\t\t\tif !c.children.empty?\n\t\t\t\t\tids += c.get_children_ids_recursive\n\t\t\t\tend\n\t\t\t\tids << c.id\n\t\t\tend\n return ids\n\t\tend",... |
4f21aae2bb1730fc7e48e15883d7d6a9 | Overwriting the sign_out redirect path method | [
{
"docid": "747a6923b041c93ccae5d7fc5fd9f36a",
"score": "0.0",
"text": "def after_sign_out_path_for(resource_or_scope)\n # root_path\n demo_path\n end",
"title": ""
}
] | [
{
"docid": "9f04e62b663f6477f6c1d68d1b288eeb",
"score": "0.82528174",
"text": "def after_sign_out_path_for(resource)\n super\n end",
"title": ""
},
{
"docid": "82427fe165aea1e420f5e1332636a243",
"score": "0.81517977",
"text": "def sign_out\n redirect_to root_path\n end",
... |
25b4b4d18a8fe51c5afaca9d5196d986 | This class method is used to access entries used by the localized application feature. Since the +app+ section of the language file is reserved for this feature this method restricts the scope of the entries available to the +app+ section. The method should only be used for application localization and therefor there i... | [
{
"docid": "750f4cc92a6d1b49b3202d89fa0d8097",
"score": "0.692771",
"text": "def app_not_scoped(*keys)\n self.entry(:app, *keys) || begin\n substitution_args = if keys.last.kind_of?(Array)\n keys.pop\n elsif keys.last.kind_of?(Hash)\n [keys.pop]\n ... | [
{
"docid": "b0da8508ccc93297729283bd6a7983bb",
"score": "0.55182457",
"text": "def app_scoped(*keys)\n self.app_not_scoped(*(@@app_scope_stack.flatten + keys))\n end",
"title": ""
},
{
"docid": "f0e6e508a476a5ddccab861b23d21f36",
"score": "0.5399737",
"text": "def app_sco... |
43a1f2e52a298213793a3c75960bf424 | Test if a Pokemon can Mega Evolve | [
{
"docid": "f9da72d2e162ee3df9ca311a874f64d8",
"score": "0.78617215",
"text": "def can_pokemon_mega_evolve?(pokemon, bag)\n return false unless MEGA_EVOLVE_TOOLS.any? { |item_db_symbol| bag.contain_item?(item_db_symbol) }\n\n return !@mega_evolved_trainer_ids.include?(pokemon.trainer_id) && pokemo... | [
{
"docid": "e1437f27768d11103643b9491a566f84",
"score": "0.6620153",
"text": "def superShiny?\n return self.pokemon && self.pokemon.superShiny?\n end",
"title": ""
},
{
"docid": "d99fe1568a87d91562815cfbad186a49",
"score": "0.6596971",
"text": "def can_loot?\n false\n end",
... |
71815dcae6418d8c78e8ba3358f1d2dd | Provides cleanup_and_setup_workflow_dirs Called before every test method runs. Can be used to set up fixture information. | [
{
"docid": "6881252ec44527f51f2c96c2975505eb",
"score": "0.0",
"text": "def setup\n @rblog = Log.new(__FILE__)\n CLASSLOG.debug \"Running #{self.to_s}.\"\n end",
"title": ""
}
] | [
{
"docid": "51f1036d4e9cf9a7356011398bce0aad",
"score": "0.66712755",
"text": "def prepare\n [@build_dir, @log_dir, @local_tmp_dir].each do |dir|\n if not File.directory?(dir)\n FileUtils.mkdir_p dir\n end\n end\n... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "be75e219caa852b50008152e67f0f9f3",
"score": "0.0",
"text": "def set_call\n @call = Call.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163163",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6045976",
"text": "def action_hook;... |
a93649f9d1b9f092cb2e5ec6c19a51da | TODO: add unit to scope | [
{
"docid": "0c55f419d83bb618ef44845f0c76b2e6",
"score": "0.0",
"text": "def pds_meters_digitals\n @data_list = PdsMetersDigital.where(Project: project.ProjectID)\n .includes({ hw_ic: [:hw_ped, pds_project_unit: :unit] }, :system,\n ... | [
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.69340616",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.69340616",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
... |
86aee864caa0f60c3516918d2aa63d77 | Get Marketing Companys Count | [
{
"docid": "b8bca7ea6ef2dfaeb81f5c649aa5dceb",
"score": "0.0",
"text": "def marketing_groups_id_companies_count_get(id, opts = {})\n data, _status_code, _headers = marketing_groups_id_companies_count_get_with_http_info(id, opts)\n return data\n end",
"title": ""
}
] | [
{
"docid": "fe38254436f27ab98b04ae975f39c6da",
"score": "0.6702017",
"text": "def collaboration_count\n (attributes['collaboration_count'] || mixables.size).to_i\n end",
"title": ""
},
{
"docid": "d5e73b68d4f2de778b74162f7a0c0a15",
"score": "0.6609296",
"text": "def get_departmen... |
da561ab4b72659db3f4faf8df3050178 | Stop editing a specified table. | [
{
"docid": "e87bd86824b0ed56d049e30dc694b61f",
"score": "0.84721625",
"text": "def stop_table_edit(table)\n append_to_script \"stop_table_edit \\\"#{table}\\\"\"\n end",
"title": ""
}
] | [
{
"docid": "3284d9f1ddad3d161fd66dfbd16a4e2f",
"score": "0.7772735",
"text": "def cancel_table_edit(table)\n append_to_script \"cancel_table_edit \\\"#{table}\\\"\"\n end",
"title": ""
},
{
"docid": "7dc47351dfba2f9fb3d4ab9607cba098",
"score": "0.5646206",
"text": "def drop_table... |
f6bc0e135f5905e573099fe6e706ed4a | Dominant Octopus O(n log n) time | [
{
"docid": "a4c68d2f039b19b8de6574cb47a6c562",
"score": "0.5481362",
"text": "def dominant(arr, &prc)\n prc = Proc.new { |fish1, fish2| fish2.length <=> fish1.length }\n arr.merge_sort(&prc).first\nend",
"title": ""
}
] | [
{
"docid": "b08f5deb31c83ce23944ff90b4b3103f",
"score": "0.73875254",
"text": "def dominant_octopus(fish)\n merge_sort(fish)[-1]\nend",
"title": ""
},
{
"docid": "c637c60259879b3abdfb319320d055ed",
"score": "0.7310864",
"text": "def dominant_octopus(arr)\n return arr if arr.size ... |
66e21a458b23cce0f48c359b9d8b7d7d | Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context | [
{
"docid": "9af871686ca12996803b30d65f00cba2",
"score": "0.656113",
"text": "def context\n unless @instance_context\n @instance_context = ConfigurationContext.new(@version )\n end\n @instance_context\n ... | [
{
"docid": "1000791e0ba8e96e55a94da3f03ac616",
"score": "0.68387127",
"text": "def context\n unless @instance_context\n @instance_context = ApplicationContext.new(@version , @params['account_sid'], @params['sid'])\n end\n ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "109116eb91ffac1136aa2bc32a317aa9",
"score": "0.0",
"text": "def set_project\n @project = Project.includes([:elements, clusters: :elements]).find(params[:project_id])\n if current_user.nil? or @project.user_id != current_user.id\n render status: :unprocessable_entity\n e... | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163443",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.604317",
"text": "def action_hook; ... |
213879f587015be244513915b5591122 | Question1 Declare one array arr1 and method with array as parameter return sum of elements in arr1 using each loop | [
{
"docid": "0aba056f3624e9d4db89a07a1c1de009",
"score": "0.75327975",
"text": "def sum_of_arr(arr)\n arrsum = 0\n arr.each do |ele|\n arrsum += ele\n end\n arrsum\nend",
"title": ""
}
] | [
{
"docid": "25e120c69f701a3ab3fc22aa139a06ab",
"score": "0.7816587",
"text": "def sum(arr); arr.sum end",
"title": ""
},
{
"docid": "189e35451f7a27748ff5820f0b6bdcd3",
"score": "0.7809265",
"text": "def array_plus_array(arr1, arr2)\n#loop through arr1 return sum\n#loop through arr2 ... |
495c8c563b6e1764627702fcd8b60bc9 | Examples: palindromic_number?(34543) == true palindromic_number?(123210) == false palindromic_number?(22) == true palindromic_number?(5) == true Question: Write a method that takes an integer and sees if it's a palindrome, that is if the integers are the same in both directions. Input vs Output: Input: Integer Output: ... | [
{
"docid": "a9dfc9a2bce7174dcfa18e4c1c95d498",
"score": "0.8785539",
"text": "def palindromic_number?(integer)\n string = integer.to_s\n string == string.reverse\nend",
"title": ""
}
] | [
{
"docid": "aa671bfe4c20cad5c1d590441375b249",
"score": "0.8762623",
"text": "def palindromic_number?(number)\n palindrome?(number.to_s)\nend",
"title": ""
},
{
"docid": "f31010315ca7ebb4349ea46c5255ab9e",
"score": "0.8761096",
"text": "def palindromic_number?(int)\n str = int.to_s... |
44a67a11b7e93a2689888e187ef737d8 | A dynamic widget may open a web socket back to this service. Connect to the respective table and feed back any changes. BUG ALERT: We send the entire content of the data table initially and only start monitoring the table for new stuff when the web socket connects. Any data added in between is not covered. | [
{
"docid": "2fb431ec91907cb5a2ea257dbb100d36",
"score": "0.6250242",
"text": "def on_ws_open(ws)\n #puts \">>>> ON_WS_OPEN\"\n @ws = ws\n @data_sources.each do |name, table|\n table.on_row_added(self.object_id) do |row|\n begin\n # may want to queue events to gr... | [
{
"docid": "3d7c7fb091bfa30477fc8bee9b31e86f",
"score": "0.57948047",
"text": "def push_to_web_sockets\n if created_at_changed?\n ActionCable.server.broadcast(\"posts\", \n data: json_view\n )\n end\n end",
"title": ""
},
{
"docid": "88bde231efaf8f3b98700c40bd0654cf",... |
17ae095d94d7ce817487cafcc9dbb291 | TODO: refactor, duplicated in projects_controller | [
{
"docid": "d5828c4a7156c2519a53d4abb0eece3c",
"score": "0.0",
"text": "def find_optional_project\n return true unless params[:id]\n @project = Project.find(params[:id])\n authorize\n rescue ActiveRecord::RecordNotFound\n render_404\n end",
"title": ""
}
] | [
{
"docid": "dfda27747394b2bf6d76ca669d0843f4",
"score": "0.69635",
"text": "def projects ; get_projects ; end",
"title": ""
},
{
"docid": "40c825fb8f5d44b04deeefb589ac9a6a",
"score": "0.6679006",
"text": "def index\n # Get the projects to display according to the role of the user\... |
61bcb811c1b63bddea10233cd9c32573 | Renders a form for a new presentation attachment type. | [
{
"docid": "be9c857b068df0795f0b0830132cca65",
"score": "0.71642476",
"text": "def new\n @presentation_attachment_type = PresentationAttachmentType.new\n add_breadcrumb t('.new')\n end",
"title": ""
}
] | [
{
"docid": "da98c7035a9cc2be270cc08130997ad2",
"score": "0.7222342",
"text": "def create # rubocop:disable Metrics/MethodLength\n @presentation_attachment_type = PresentationAttachmentType.new presentation_attachment_type_params\n\n if @presentation_attachment_type.save\n re... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "522e60a78342b97b41c288228cf9d39f",
"score": "0.0",
"text": "def compra_params\n filtered_params = params.require(:compra).permit(:nombre, :descripcion, :tipo,\n :fecha_inicio_compras => [:year, :month, :day, :hour, :minute],\n :fecha_fin_compras => [:year, :month, :day, :h... | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7493595",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6954758",
"text": "def strong_params\n params.require(:request).permit(param_white... |
97cb72e474ffaca1aaf8f75551817c8c | [[foobar:dudcwcrnzgodqmaupfzgbzmyzuqkvndg]]the deal[[foobar:dudcwcrnzgodqmaupfzgbzmyzuqkvndg]] becomes the deal ^foobar | [
{
"docid": "ae15d110845bd31ef333b8ab48b3918c",
"score": "0.0",
"text": "def transform_named_block(input)\n already_processed = {}\n result = input.gsub(section_regex(remove_space: false)) do\n name = Regexp.last_match(1)\n if ! already_processed.key?(name)\n already_processed[name... | [
{
"docid": "bd0e8b3885aebfb4cbe786d1792f453d",
"score": "0.5700813",
"text": "def kesha_maker(array)\n new_array = []\n array.each do |string|\n string[2] = \"$\"\n new_array << string\n end\n new_array\nend",
"title": ""
},
{
"docid": "2822ee2d30e109760913dc29083bcfaa",
"score... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "74b6452517b4f9fd1991c51deb355584",
"score": "0.0",
"text": "def set_welcome_page\n @welcome_page = WelcomePage.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163163",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6045976",
"text": "def action_hook;... |