query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
1084dd45abe9350061dc989703de9f89
PUT /experts/1 PUT /experts/1.xml
[ { "docid": "215a75a1539b66a4d05cd0d9529f4996", "score": "0.72476035", "text": "def update\n @expert = Expert.find(params[:id])\n\n respond_to do |format|\n if @expert.update_attributes(params[:expert])\n format.html { redirect_to(@expert, :notice => 'Expert was successfully updated.') ...
[ { "docid": "68d14143b04f545d40404e93e9ce829f", "score": "0.70226", "text": "def update\n @expert = Expert.find(params[:id])\n\n respond_to do |format|\n if @expert.update_attributes(params[:expert])\n format.html { redirect_to @expert, notice: 'Expert was successfully updated.' }\n ...
7e9280392e29d674d36834be0684ad93
Returns an array of 4 String tokens by splitting +query_string+
[ { "docid": "363e93d6e59dba79ee75f4a76bac155d", "score": "0.74627364", "text": "def tokenize(query_string)\n query_string.strip!\n if match = query_string.match(QUERY_PATTERN)\n match.captures\n else\n raise \"Bad query: '#{query_string}'\"\n end\n end",...
[ { "docid": "9a332bbe48a668c6ea7ce8a0ff00e56b", "score": "0.7650261", "text": "def tokenize(query_string)\n query_string.scan(QUERY_REGEXP).map do |match|\n create_token(*match)\n end\n end", "title": "" }, { "docid": "9993c94929e85d1ee79627386910a7ec", "score": "0.740...
6821397268faea69c54e94b57b81cd9e
Find a way to accumulate the :worldwide_grosses and return that Integer using director_data as input
[ { "docid": "5e77566817aab24ce81a5977ddc0fd46", "score": "0.78402203", "text": "def gross_for_director(director_data)\n total = 0\n movies = director_data[:movies]\n movies.length.times do |movie_idx|\n total+=movies[movie_idx][:worldwide_gross]\n end\n return total\nend", "title": "" } ]
[ { "docid": "78129262a5d48c085cf6cb4e93eafdb3", "score": "0.8031094", "text": "def gross_for_director(director_data)\n movie_index = 0\n worldwide_grosses = 0\n while movie_index < director_data[:movies].length\n worldwide_grosses += director_data[:movies][movie_index][:worldwide_gross]\n movie_...
f8665ed6d8395b38fea489257ee9c17b
Create an application for the group and start it
[ { "docid": "72ba1b20acdb46c3aa8d0a8dbbe831ff", "score": "0.6464211", "text": "def exec(name)\n create_resource(name, type: 'application', binary_path: name)\n\n e_uid = SecureRandom.uuid\n\n e_name = \"#{self.name}_application_#{name}_created_#{e_uid}\"\n\n resource_group_nam...
[ { "docid": "e2ec0c650d0874e700023a94b3596996", "score": "0.71195596", "text": "def startApplication(app_name, show_std=true)\n if @app_contexts.find { |v| v.orig_name == app_name }\n run_application(app_name, show_std)\n else\n warn \"No application with name '#{app_name}' define...
f9b54372977f73c43a72d6365d4c8b4e
Timeout the task after the given time.
[ { "docid": "cec36d55a7410924c97a15467b1af35d", "score": "0.81887186", "text": "def timeout_after (time)\n @timeout = time\n\n pool.timeout_for self, time\n\n self\n end", "title": "" } ]
[ { "docid": "24873beae4b7fd94b94fae06952080d6", "score": "0.8216288", "text": "def timeout_after time\n @timeout = time\n \n pool.timeout_for self, time\n \n self\n end", "title": "" }, { "docid": "6cb6f0d0b0856a057f2a23fc0bb70808", "sco...
bfd22d553f358e2f115bf8710e7ffed9
converts a & surrounded by optional whitespace or a nonbreaking space to the HTML entity and surrounds it in a span with a styled class
[ { "docid": "4ee6c04f11772ef45e16a840aae90847", "score": "0.51684463", "text": "def amp(text)\n # $1 is an excluded HTML tag, $2 is the part before the caps and $3 is the amp match\n text.gsub(/<(code|pre).+?<\\/\\1>|(\\s|&nbsp;)&(\\s|&nbsp;)/) {|str|\n $1 ? str : $2 + '<span class=\"amp\">&amp;...
[ { "docid": "09549b3ad36408fd5f617212cfbab1c5", "score": "0.61944", "text": "def smart_quote_entity(el); end", "title": "" }, { "docid": "af475d624aaec013871f3fd7e9337274", "score": "0.6166944", "text": "def clean(text = nil, escape_ampersands_twice = false)\n text.gsub!(\"&nbsp;\"...
37fe2ab6ec42fa955640bb9bee333ee6
Mosaic target if creating a raster and there's either one file or the given file has _cropped in the name.
[ { "docid": "530e11d3a8dab7f021efd92e8ba78cd9", "score": "0.72808164", "text": "def mosaic_service_target?\n return false unless raster_resource_parent?\n return true if file_paths.length == 1\n basename.to_s.include?(\"_cropped\")\n end", "title": "" } ]
[ { "docid": "7c66be4558ff871c28f902cf4159cddb", "score": "0.61826015", "text": "def recreate_cropped_image\n if image.exists?\n img = ThumbMagick::Image.new(image.path('tocrop'))\n img.\n thumbnail(\"#{resize * 100}%\").\n crop(\"#{crop_w}x#{crop_h}\", crop_x, crop_y).\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.0", "text": "def set_line_item\n @line_item = LineItem.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;...
051109e0d0a34a14b90042a3b404e3fb
GET /yanluns/new GET /yanluns/new.json
[ { "docid": "fb38fdb9cf256f9b702293e8aeeaf964", "score": "0.779794", "text": "def new\n @yanlun = Yanlun.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @yanlun }\n end\n end", "title": "" } ]
[ { "docid": "ceee4ba6910af2cfdd5af07ef2195c12", "score": "0.7791142", "text": "def new\n @lt = Lt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lt }\n end\n end", "title": "" }, { "docid": "d89d88dcb488b2acf0e3af27a9893512", ...
248c23bf76d80930d1dc3dcef875e633
The start date of the month
[ { "docid": "aa42e7936fb422ac2d6c1ef19e70735a", "score": "0.7673062", "text": "def start_of_month(year, month_param)\n merch_month = get_merch_month_param(month_param)\n date_calc.start_of_month(year, merch_month)\n end", "title": "" } ]
[ { "docid": "b07bde1e3cb22fcd744e0fe905e416aa", "score": "0.89462245", "text": "def start_date\n weekday = beginning_of_month.cwday\n offset = weekday == 1 ? 0 : (weekday - 1).days\n beginning_of_month - offset\n end", "title": "" }, { "docid": "ed26bac1ef298eae2dc5ee561f7ee...
62944f62837c2e4813b8571601daaeb2
DELETE /cultural_heritage/transfers/1 DELETE /cultural_heritage/transfers/1.xml
[ { "docid": "06f1db31d54c31986bf67e1d4c104bf0", "score": "0.0", "text": "def destroy\n if (user_signed_in? && ([4].include?(current_user.role)))\n @title_view = 'Traslados'\n @cultural_heritage_transfer = CulturalHeritage::Transfer.find(params[:id])\n @cultural_heritage_transfer.destroy\n\n ...
[ { "docid": "b97f68aafee6ebbb2070c3fac8251880", "score": "0.6774147", "text": "def destroy\n @transfer.destroy\n end", "title": "" }, { "docid": "e1d6f603cb5ea1e475ea71422432aeae", "score": "0.64989793", "text": "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}....
f1cd28bb2aae5ff3c4d241eb14b0761c
DELETE /decks/1 DELETE /decks/1.json
[ { "docid": "b9cc6a94ad650e5f2d7fb78c9fc7cd9f", "score": "0.724722", "text": "def destroy\n @deck = Deck.find(params[:id])\n @deck.destroy\n\n respond_to do |format|\n format.html { redirect_to decks_url }\n format.json { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "f4cc7539860f347016ad7b9bab804b41", "score": "0.7390399", "text": "def destroy\n @duck.destroy\n respond_to do |format|\n format.html { redirect_to ducks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "32e7f24368d6a34c721dc4ca3...
05938b789c592d2b5b08841d48779928
Delete is an action command that deletes a single record An argument error is thrown if the record key does not exist Examples: Artist.delete(4)
[ { "docid": "aedabe20c0f93e98e3b35d78ab57cd35", "score": "0.0", "text": "def delete(key)\n result = @rarray.get(key)\n if result\n @rarray.delete(result)\n store\n else\n raise ArgumentError,'Cannot delete - no matching id', caller \n end\n end", "title": "" } ]
[ { "docid": "79f6c1dc625b7028742c1da69decc7cf", "score": "0.72408104", "text": "def delete\n \n end", "title": "" }, { "docid": "18eabf26b1c7709e81b9725921afe154", "score": "0.72238386", "text": "def delete record\n db_name = database_name_for(record)\n coll_...
124754dbb272353a965e2aef33a73244
Test if Emacs with running server is available.
[ { "docid": "d8ca97b749740b1629533f96a8b0860b", "score": "0.0", "text": "def available?(silent = false, options = {})\n result = `#{ DEFAULTS[:client] } --eval \"(require 'guard)\" 2> /dev/null || echo 'N/A'`\n\n if result.chomp! == 'N/A'\n false\n else\n true\n ...
[ { "docid": "40b61b0be117f9d08b5aa86388678896", "score": "0.73819757", "text": "def has_available_server?\n server && !(server.unavailable? rescue true)\n end", "title": "" }, { "docid": "129503cdaede843f4f4677913b164764", "score": "0.7173052", "text": "def server_running?\n ...
68d59ed6f391232c45849976d20a0bd8
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.notifier.reset_password.subject
[ { "docid": "bc632380da5c0197226bc4f73d56eda8", "score": "0.0", "text": "def reset_password\n # TODO: Implement actual functionality -- Wed Jun 13 15:26:53 2012\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "title": "" } ]
[ { "docid": "f88ce5d7aca9a41a22b4857ad5c13749", "score": "0.6762878", "text": "def notify_password_reset!\n with_user_locale do\n reset_single_access_token!\n UserMailer.password_reset(self).deliver!\n end\n end", "title": "" }, { "docid": "5c49df176c0d8b63b317043e3510b06b", ...
bfc31d7ec49c287c97d10f3780091370
DELETE /services/1 DELETE /services/1.json
[ { "docid": "587e00afd4a5a38a4da6959ca893c8e7", "score": "0.70940655", "text": "def destroy\n\t\t@service = Service.find(params[:id])\n\t\t@service.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to services_url }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend", "title": ...
[ { "docid": "69b647d0fba19caa74d6918b92ba2528", "score": "0.7644181", "text": "def destroy\n service.destroy\n render json: service, status: 200\n end", "title": "" }, { "docid": "f771df7d19346fc235fe7bb3807d51c9", "score": "0.7445268", "text": "def destroy\n @service = Serv...
e617ee11fddf372926c6f302a7f7728f
PATCH/PUT /special_promotions/1 PATCH/PUT /special_promotions/1.json
[ { "docid": "a5c48c39b9763d646f091cd9ca5fcac6", "score": "0.6289826", "text": "def update\n respond_to do |format|\n if @special_promotion.update(special_promotion_params)\n format.html { redirect_to @special_promotion, notice: 'Special promotion was successfully updated.' }\n forma...
[ { "docid": "f31d51fa59423df5067ae63071fe3afd", "score": "0.6294379", "text": "def update_special_off\n\n respond_to do |format|\n if @promotion.update(promotion_params)\n format.html { redirect_to show_special_off_backend_shop_branch_promotion_path(@current_shop.slug, @current_branch, @pr...
35eb461d3c233ff092fc3e1595130642
When not closed but current time period is closed
[ { "docid": "7a95bec80c177bdb521c4792d4a47003", "score": "0.6987588", "text": "def maybe_build_reopened_time_period\n return if closed?\n return unless current_time_period&.closed?\n\n reconcile_time_period(:reopened)\n\n true\n end", "title": "" } ]
[ { "docid": "b7b671b8f90f25b803b594771bc0f915", "score": "0.7476847", "text": "def closed?\n !closed_at.blank?\n end", "title": "" }, { "docid": "ba50fcdd9499e61fe7614b140bebc6a7", "score": "0.7440737", "text": "def is_closed?(timeslot)\n !self.is_open?(timeslot)\n end", "...
f31bb9834d4c3d3c7c4f91983408f555
GET /cart_items/1 GET /cart_items/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "18435c8b319cf3e78c08e2c11b96d1c2", "score": "0.7769855", "text": "def index\n @cart_items = CartItem.all\n\n render json: @cart_items\n end", "title": "" }, { "docid": "6d2204244eaed56c3a80295fed07d816", "score": "0.7608788", "text": "def show\n render json: @ca...
6a1206ec6b494e7b1a910db152c05d22
Different districts export assessment data in different ways, and import different specific assessments or use different code to process it.
[ { "docid": "7ea8c58006fd0a81453889c97628f909", "score": "0.5247276", "text": "def choose_assessment_importer_row_class(row)\n if @district_key == SOMERVILLE\n case row[:assessment_test]\n when 'MCAS' then McasRow\n when 'ACCESS', 'WIDA', 'WIDA-ACCESS' then AccessRow\n when '...
[ { "docid": "a87f06f1cb62f2e10f0499f570dcfd20", "score": "0.5704015", "text": "def test_diploma_export\n assert_equal %w( start end sign duration teacher responsible description contents ),\n @net.export_check\n\n @net.start = '01.02.03'\n @net.end = '04.05.03'\n @net.sign = '...
84535ce0dbd3ed96f08dccfa545ff4d6
Sign Out (Clear Token)
[ { "docid": "7e9aa56a9905dd2fb5c6de548afbf82e", "score": "0.0", "text": "def destroy\n @user.update_attributes(:api_authtoken => nil, :authtoken_expiry => nil)\n render_success_message(200, \"Token cleared\")\n end", "title": "" } ]
[ { "docid": "8da00f87c7bf8b7983c3887016a10c17", "score": "0.8765521", "text": "def logout\n clear_token\n end", "title": "" }, { "docid": "e72b4c15768d8a31c2bfb55d6a03346c", "score": "0.8651306", "text": "def sign_out\n @current_user = nil\n cookies.delete(:auth_token)\n...
fa5917fcd4d8c9c39d712649480df6cf
Instantiation === Parameters: :admin from :candidates to
[ { "docid": "0bb6c99a2cc61dcf8f3731c988676eef", "score": "0.7841136", "text": "def initialize(admin, candidates)\n @admin = admin\n @candidates = candidates\n @email_index = -1\n end", "title": "" } ]
[ { "docid": "24fc19b9f5a23b5603d93b20179957ff", "score": "0.588829", "text": "def initialize(uid, options={})\n @uid = uid\n @admin_acting_as = options[:admin_acting_as]\n @admin_by_ccns = options[:admin_by_ccns]\n @admin_term_slug = options[:admin_term_slug]\n @canvas_course_id ...
d7ebd1f1b4c6559eade7bd2e34d56490
HARD Define a method that accepts an array of words and returns an array of those words whose vowels appear in order. You may wish to write a helper method: ordered_vowel_word?
[ { "docid": "f564e19602b19016c7ff854d28e7976b", "score": "0.8518763", "text": "def ordered_vowel_words(words)\n words.select {|word| ordered_vowel_word?(word)}\nend", "title": "" } ]
[ { "docid": "8b5c359d42ed318c30a6f5e7f8e70265", "score": "0.88117325", "text": "def ordered_vowel_words(words)\n result = Array.new\n words.each do |el|\n if ordered_vowel_word?(el)\n result << el\n end\n end\n result\nend", "title": "" }, { "docid": "800531538b8c06371925a6a8e2...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "f856e75c0452884974d86780d219e37a", "score": "0.0", "text": "def set_customer\n @user = User.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60310596", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6014974", "text": "de...
91ac5e00ad1ab957937a59d68211811c
Finds categories by their title. This method is necessary because categories are translated which means the title attribute does not exist on the categories table thus requiring us to find the attribute on the translations table and then join to the categories table again to return the associated record.
[ { "docid": "29006101ebc8fb12217d8bbc1d56858f", "score": "0.742012", "text": "def by_title(title)\n Products::Categories::Finder.by_title(title)\n end", "title": "" } ]
[ { "docid": "e84a6ca6a6e49b2e0ca9a972290f3a5b", "score": "0.74376136", "text": "def by_title(title)\n Categories::Finder.by_title(title)\n end", "title": "" }, { "docid": "09d9475c5535a5a9bb9e3d746f04d0f6", "score": "0.57255036", "text": "def category_title_filter\n\n ...
82c97e89259bc94a4f68f0bd05855fc4
Validates that a network name exists. If it does not exist, an exception is raised.
[ { "docid": "4e9f4cc8435832863a648d4cd49c0858", "score": "0.84132564", "text": "def validate_network_name!(network_name, env)\n if !env[:machine].provider.driver.existing_named_network?(network_name)\n raise Errors::NetworkNameUndefined,\n network_name: network_name\n ...
[ { "docid": "ba22c6cd782a242fe1e1147ea0ce908f", "score": "0.7739829", "text": "def network_exists?(name)\n net_obj = Com::Vmware::Vcenter::Network.new(vapi_config)\n filter = Com::Vmware::Vcenter::Network::FilterSpec.new(names: Set.new([name]))\n net = net_obj.list(filter)\n\n ...
11a9019e087bcc3067506b019af9cee1
Return link code for editing this piece.
[ { "docid": "d496494004d0345b057c70be23a59989", "score": "0.7492851", "text": "def link_4edit()\n html = ''\n return html if @opts[:edit_mode] < 2\n @opts[:editparams].merge!( { table: 'dc_piece', \n form_name: 'dc_piece', \n controller: 'cms...
[ { "docid": "0b2c9b4dbcb16d65ad4fe64078bdf609", "score": "0.7301902", "text": "def get_EditLink()\n \t return @outputs[\"EditLink\"]\n \tend", "title": "" }, { "docid": "0b2c9b4dbcb16d65ad4fe64078bdf609", "score": "0.7301902", "text": "def get_EditLink()\n \t return @...
ee1b7d29e9a1bc0889b774cf7c6d21ae
use only uniq keys! or zk_map_keys will fire an error! if transition is not one to one zk_map_keys would also fire an error
[ { "docid": "8aa5f1cfcb530dc62738a0372ca47196", "score": "0.6552781", "text": "def zk_map_keys(keys)\n keys.map{ |key| [zip_key(key), key] }.to_h\n .tap{ |result| raise ArgumentError.new( \"Key zipping is not one to one! #{result.keys} != #{keys}\" ) if result.length != keys.length }\n end", ...
[ { "docid": "c10d6a8845db2e4be014b80347458099", "score": "0.6541017", "text": "def update_key_map; end", "title": "" }, { "docid": "b8070cd17ebe9d569d57898918b75c1c", "score": "0.6080686", "text": "def fix_mapping_key_required(nodes)\n nodes.reverse.each do |node|\n ...
d8801eccecb6c9da161646b9b40c697d
/catalog/import Import a custom set of recipes in the catalog to be used by a single project
[ { "docid": "f8f0c9803ff5b9dadb122adc59ea2ddd", "score": "0.6833783", "text": "def importCustomCatalog\r\n require 'fileutils'\r\n require 'find'\r\n require 'uri'\r\n\r\n @project = Project.find(params[\"project_id\"])\r\n @role = Role.find_by_actor_id_and_project_id(current_actor.id, @pr...
[ { "docid": "764750373b1dcd3c2459150dfdcf3671", "score": "0.7153511", "text": "def import\n search_word = @view.ask_for_import\n recipes = @scraper.get_recipes(search_word)\n chosen_one = @view.pick_import(recipes)\n difficulty = @view.ask_for_difficulty\n recipe = Recipe.new(chosen_one[:t...
7342865ca3bd6d3dc674efec5982e3f8
GET /financials GET /financials.json
[ { "docid": "c7979de794df0ab2951895e6aa551602", "score": "0.0", "text": "def index\n respond_to do |format|\n format.html{ redirect_to socioeconomic_record_path + \"#tabs-financial\" }\n format.js{ render 'application/index' }\n format.pdf{}\n format.csv{ params[:length] = 500\n ...
[ { "docid": "f36f6e17ae25fb2d83bebc5ceab6e79b", "score": "0.8358205", "text": "def get_financials\n response = RestClient.get(\"https://api.iextrading.com/1.0/stock/#{self.ticker}/financials\")\n JSON.parse(response.body)\n end", "title": "" }, { "docid": "73a9b8a89d0ccc6aa3143ceb3b...
69beaa3e957d1fc356539d0314d703e1
Custom attribute writer method checking allowed values (enum).
[ { "docid": "6bf7e22280b8bc4396265dc2b8c393e0", "score": "0.0", "text": "def employee_comp_not_exceed=(employee_comp_not_exceed)\n validator = EnumAttributeValidator.new('String', [\"Billing\", \"Percent\", \"Amount\"])\n unless validator.valid?(employee_comp_not_exceed)\n fail ArgumentE...
[ { "docid": "af6d0e33773bc681443214ce777b13e1", "score": "0.7088127", "text": "def write_attribute_with_enum(attr, value)\n write_attribute_without_enum attr, converted_enum(attr, value)\n end", "title": "" }, { "docid": "85eec95603dc239e3d18923b2c672b31", "score": "0.6482...
46327d2a2a4602d42b527c75f622d2ae
TODO: reimplement let as a macro def test_let assert_evals_to 2, "(let ((n 2)) n)" assert_evals_to 5, "(let ((n 2) (m 3)) (+ n m))" end def test_shadowed_vars_dont_stay_in_scope assert_evals_to Cons.new(:a.sym, :b.sym), "(let ((f (let ((x (quote a))) (lambda (y) (cons x y))))) (let ((x (quote nota))) (f (quote b))))" e...
[ { "docid": "db90dde3fb0728fe5a264b6146bd8480", "score": "0.5398007", "text": "def test_nested_function_calls_dont_affect_caller\n eval! \"(define fib (lambda (x)\n\t (if (< x 3)\n\t\t 1\n (+ (fib (- x 1)) (fib (- x 2))))))\"\n\n assert BusScheme.in_scope?(:fib.sym)\n asser...
[ { "docid": "9e951043dd64b9b62194cf181d1151c8", "score": "0.65063477", "text": "def test_check_var_sym\n @process.let('A', [5])\n assert_equal 5, @process.replace('A')\n end", "title": "" }, { "docid": "c1070bf515aa27c04afb63ace5752b38", "score": "0.64038557", "text": "def test...
3092b2fba60219aed7d59e27e262b205
Update a content partial content
[ { "docid": "2d6f36f6171c8dfeb89ee89659158968", "score": "0.8087959", "text": "def update_content_partial(id, data)\n put \"content_partials/#{id}\", data\n end", "title": "" } ]
[ { "docid": "d389fdc05adb9fc3f75812370c2a156f", "score": "0.74769706", "text": "def update_content(*args); end", "title": "" }, { "docid": "ac2acd13b2802d31218098a8b4de689b", "score": "0.7391196", "text": "def component_content_update\n obj_content = if params[:obj_content][:id].bl...
678a9182b40ee594c61cfac39aead5e9
Sets the allowFormatColumns property value. Represents the worksheet protection option of allowing formatting columns.
[ { "docid": "2fd9864784d673963318f3a2220d27e1", "score": "0.7967862", "text": "def allow_format_columns=(value)\n @allow_format_columns = value\n end", "title": "" } ]
[ { "docid": "e941206cd60c75f3604b1a8e247fdf15", "score": "0.7059938", "text": "def allow_format_columns\n return @allow_format_columns\n end", "title": "" }, { "docid": "4509848578a35b9dc7b73f209782d02d", "score": "0.6725619", "text": "def allow_format_cells=...
828df8f862c3f853056421f3d6ac715e
Inserts two records into 'sequence_test' and returns the generated id values session: the active Session table: name of the table which is to be tested
[ { "docid": "c05091136305ccd648f8bd8ab8f4562c", "score": "0.7463359", "text": "def get_example_sequence_values(session, table = 'sequence_test')\n session.left.insert_record table, { 'name' => 'bla' }\n id1 = session.left.select_one(\"select max(id) as id from #{table}\")['id'].to_i\n session.left.ins...
[ { "docid": "d150ee02bfea1048ad33d844a438df69", "score": "0.6709008", "text": "def test_auto_increment_with_step\n s1 = FirstSequencedModel.create\n\n s = FirstSequencedModel.next_sequence('auto_increment', 3)\n s2 = FirstSequencedModel.create(auto_increment: s)\n assert_not_equal s2.auto_inc...
1ad303a4f631184eac46a9cdc7c04f73
POST /measurements POST /measurements.xml
[ { "docid": "d7ab061b514c5e9e259de64c451f81a1", "score": "0.5439311", "text": "def create\n unless current_user.measurements.find_date(params[:measure_date]).nil?\n update_all\n else\n @measurement = Measurement.new(params[:measurement])\n @measurement.user = current_user\n resp...
[ { "docid": "e3892cf2e81c3cea927f65d6cdb67204", "score": "0.6839911", "text": "def measurements_post(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: MeasurementApi#measurements_post ...\"\n end\n \n # resource path\n path = \"/measuremen...
09f002cb4b2785237f27da1447d2ecc1
DELETE /prezzos/1 DELETE /prezzos/1.json
[ { "docid": "79f28292025716803ee59dbafff20114", "score": "0.6800706", "text": "def destroy\n @prezzo.destroy\n respond_to do |format|\n format.html { redirect_to prezzos_url, notice: 'Prezzo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "...
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.70942205", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": ...
431f7eeb4e3aec5cfa780844961b289c
This method combines the output of both predicted deaths and speed of spread. This is used because the other two instance methods are private and cannot be called on their own.
[ { "docid": "0aea1ff6270ed24ee8d362f8d72bccff", "score": "0.0", "text": "def virus_effects\n predicted_deaths\n speed_of_spread\n end", "title": "" } ]
[ { "docid": "5a5eb616489297c88972b3b42ba49c91", "score": "0.746386", "text": "def deaths_and_speed\n # We are still perfecting our formula here. The speed is also affected\n # by additional factors we haven't added into this functionality.\n\n #Convert the local variable speed to an instance var...
c09594fd8918955d778a156a6eb409b3
Update banner across all translations.
[ { "docid": "717b096f931eafc13d1447d51b26f876", "score": "0.6366463", "text": "def change_banner\n if !in_admin_mode?\n flash_error(:permission_denied.t)\n redirect_to(action: \"list_rss_logs\")\n elsif request.method == \"POST\"\n @val = params[:val].to_s.strip\n @val = \"X\" i...
[ { "docid": "51bbf43d3c6452a5b4af2fd0ac7a3dcf", "score": "0.6216502", "text": "def change_banner # :root: :norobots:\n if !is_in_admin_mode?\n flash_error(:permission_denied.t)\n redirect_to(action: \"list_rss_logs\")\n elsif request.method == \"POST\"\n @val = params[:val].to_s.stri...
47d267c3ed3477af9b2f36b0e7b1cd57
define distance between two vectors
[ { "docid": "0bff5b6d53e438bbbf28312211cb31fd", "score": "0.6727952", "text": "def distance(v_)\n (self - v_).r\n end", "title": "" } ]
[ { "docid": "1e382c0174f308c7f74760f96be0c2c8", "score": "0.8082479", "text": "def distance(vector)\n end", "title": "" }, { "docid": "1e382c0174f308c7f74760f96be0c2c8", "score": "0.8082479", "text": "def distance(vector)\n end", "title": "" }, { "docid": "960abc98b9...
a2295a5a61427526484e90106878c3a4
The "Subject" text field page element definition.
[ { "docid": "51a89b55cb3ed10a93428f34620032ec", "score": "0.72359544", "text": "def subject_element\n current_div.text_field(:id=>\"comp-subject\")\n end", "title": "" } ]
[ { "docid": "0aa1cc7584224f23051efac49931c5e7", "score": "0.7823229", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "0aa1cc7584224f23051efac49931c5e7", "score": "0.7823229", "text": "def set_Subject(value)\n ...
41488da96198763cca87c8ff569b2dd8
assists in user edit path
[ { "docid": "fe6e419f4f4591ddbe6f43110f179df0", "score": "0.0", "text": "def user_path\n \"users/#{@current_user.id}\"\n end", "title": "" } ]
[ { "docid": "3fb211158bbbef1f0ec5d5d4b4e11f9f", "score": "0.74137396", "text": "def user_edits\n redirect_to home_path if current_user != User.find(params[:id])\n end", "title": "" }, { "docid": "b238158da6dfc4ee53a70858e64413ff", "score": "0.71376675", "text": "def edit\n requ...
49a5188949e5552e5256fcc72cc14174
This method takes a `Logstash::Event` object and converts it into a hash that is acceptable by the Timber API. Each event is converted into a JSON document that conforms to the Timber log event JSON schema: This realized by the following steps: 1. Timber will look for specific keys and map them to the appropriate keys ...
[ { "docid": "4887d4b6906898d849ed1bc3241dec15", "score": "0.826364", "text": "def event_hash(e)\n timber_hash = {\"$schema\" => JSON_SCHEMA}\n event_hash = e.to_hash\n\n # Delete unused logstash specific attributes\n event_hash.delete(\"@version\")\n\n # Map the timber key first ...
[ { "docid": "352ce6b50717c82d380dba3ce5b210a9", "score": "0.7012914", "text": "def event_to_hash(event)\n corrective_change = defined?(event.corrective_change) ? event.corrective_change : nil\n {\n \"status\" => event.status,\n \"timestamp\" => Puppet::Util::Puppetdb.to...
5092af8daf91b3fb0f19395b835dfa48
select a specific element on the page. You may implement selector_for in your subclass
[ { "docid": "f155c55ab71c76307e4386f50de0c5f1", "score": "0.7014355", "text": "def select(*a)\n page.select selector_for(*a)\n end", "title": "" } ]
[ { "docid": "c6839d8b10fa31d4cea3714ac4c820dc", "score": "0.7340588", "text": "def select(*selector)\n self.class.selector_framework.new(self, *selector)\n end", "title": "" }, { "docid": "8caff2f4ed1a648125e28210603deacf", "score": "0.7164567", "text": "def element(select...
834382127c933280e559a19016eac14a
TOOD: Rails 4 upgrade, remove when tests pass def title for PaperTrailManager's RSS output taxt end
[ { "docid": "5bea77bb33399aa4b062666dc84d9a47", "score": "0.0", "text": "def update_taxt_from_editable editable_taxt\n update_attributes taxt: Taxt.from_editable(editable_taxt)\n rescue Taxt::ReferenceNotFound => e\n errors.add :base, \"The reference '#{e}' could not be found. Was the ID changed?\...
[ { "docid": "ccf7ccf6ffe845787718c5467070dbb6", "score": "0.7637508", "text": "def title_name; end", "title": "" }, { "docid": "d0b3e2be6e8f69b3a3d4c0459644f520", "score": "0.7611759", "text": "def page_title; end", "title": "" }, { "docid": "018eeb80f07f7ec1877c9cae04f8f4...
b086178e561fcfc9a57dbc2c8f6a2e29
Initializes a new Player object
[ { "docid": "35bc050fc1cec8a49874062024275fb7", "score": "0.7947314", "text": "def initialize(raw_player)\n @raw_player = raw_player\n end", "title": "" } ]
[ { "docid": "17e4c4f4f815fcd223f30f02158303a0", "score": "0.8098467", "text": "def initialize_player\n\n Player.new\n\nend", "title": "" }, { "docid": "02571d1d58eae8e65b45fa954d1357d9", "score": "0.80475974", "text": "def initialize(player)\n @player = player\n end", "title...
1d2ff55ef2f524f0507a5ad8c2642ac9
create Creates a new campaign with the provided properties. See how to launch your first campaign [here](
[ { "docid": "56502c2acf70d6e133a60c0c7762bd7d", "score": "0.0", "text": "def campaign_create_with_http_info(campaign_writable, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CampaignsApi.campaign_create ...'\n end\n # verify the required...
[ { "docid": "c967dbd8eb84deee8e9cc03791164d28", "score": "0.7783037", "text": "def create(params)\n post(\"#{domain}/campaigns\", params)\n end", "title": "" }, { "docid": "e8d9e4905554853dbf11d13cb7b9eaf4", "score": "0.7717297", "text": "def create\n return nil if cr...
4f8a28994baddbef71ff339e432440c8
DELETE /indexed_activities/1 DELETE /indexed_activities/1.json
[ { "docid": "d1c0f8569cb30cd0c6e5fe278df55d4c", "score": "0.7885128", "text": "def destroy\n @indexed_activity.destroy\n respond_to do |format|\n format.html { redirect_to indexed_activities_url, notice: 'Indexed activity was successfully destroyed.' }\n format.json { head :no_content }\n...
[ { "docid": "0119fe8dee723c5901d00a56515cb2bf", "score": "0.68790466", "text": "def delete_object_activity(id)\n @client.raw('delete', \"/helpers/object-activities/#{id}\")\n end", "title": "" }, { "docid": "41cb664d51ff8e7cd7cf2d37f2e3535e", "score": "0.681682", "text": "def dest...
2d8541b204266512c67fcce803d2e21a
def get_result_date(hit) end def get_result_annotation(hit) end def result_has_annotation(hit) end def get_result_tags(hit) end
[ { "docid": "f9b7f873b2754525eb2c96157f6b018a", "score": "0.0", "text": "def get_saved_searches(username)\n user = User.find_by_username(username)\n return user.searches.find(:all).sort { |a,b| b.id <=> a.id }\n end", "title": "" } ]
[ { "docid": "150d3cb430f6e51627e6d26860cb51ec", "score": "0.6437307", "text": "def results; end", "title": "" }, { "docid": "150d3cb430f6e51627e6d26860cb51ec", "score": "0.6437307", "text": "def results; end", "title": "" }, { "docid": "150d3cb430f6e51627e6d26860cb51ec", ...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "8706060681d727a9431bb029067a51ce", "score": "0.0", "text": "def persontype_params\n params.require(:persontype).permit(:persontype)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title"...
33d1704e8120690bf915db3df1461122
If this is a tender (second conditional), then nonsupplied materials can't have a price
[ { "docid": "9241aa9bec2e228441598d2edd5674b6", "score": "0.59623194", "text": "def check_supplied\n if !self.supplied? && self.section && self.section.document.document == nil\n self.price = nil\n end\n end", "title": "" } ]
[ { "docid": "520a338875571e197d5c906dd012acf2", "score": "0.6732988", "text": "def priceless?\n price == 0\n end", "title": "" }, { "docid": "5e306959cca4f2643e54fb35d44a2c64", "score": "0.6682662", "text": "def has_price_modifier?\n !(price_modifier_type.nil? || price_modifi...
8e1ac01d6fb40864d396f8eb840023ba
GET /comments GET /comments.xml
[ { "docid": "49ca28a9dad77b185d48297aa65cc768", "score": "0.65127254", "text": "def index\n @comments = Comment.find(:all, :conditions => ['published = ?', false], :order => 'created_at DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @commen...
[ { "docid": "85d82f5086bd638b99c7f497cac5ab7e", "score": "0.726993", "text": "def get_comments\n Comment.build_from_xml(@xml['comments'])\n end", "title": "" }, { "docid": "3f6dd876e9c56f95f45055d241b43d00", "score": "0.7148502", "text": "def comments tag\n path = \"/comm...
4b4ef9d1bc183e3012c7a5791b7283d2
creates a new session token for the user
[ { "docid": "57329ba6da8930cd04c59cd11a5ff1bb", "score": "0.657381", "text": "def create_remember_token\n remember_token = User.hash(User.new_remember_token)\n end", "title": "" } ]
[ { "docid": "c8b6641edcf544fd2a8aee7f8bbbdd4a", "score": "0.77772325", "text": "def generate_session_token!\n update_attribute(:session_token, self.class.generate_token(:session_token)) unless session_token\n session_token\n end", "title": "" }, { "docid": "159ba5b7e1ae062f...
d17882bbee20435901616f4fd286116d
Gathers the models attributes
[ { "docid": "b8397e46adde0962677b1e809030c736", "score": "0.7445284", "text": "def attributes\n attributes_block.call model\n end", "title": "" } ]
[ { "docid": "2ad2a25a0146db97185322a5c2a0fd78", "score": "0.74860066", "text": "def get_attributes\n self.class.attributes.each do |attr|\n write_attribute(attr, model_instance.public_send(attr))\n end\n end", "title": "" }, { "docid": "0aa12fe78587eae167c999cab7059a58", "scor...
13567753eeb144557c4ceae97dc62077
If this is a preflight OPTIONS request, then shortcircuit the request, return only the necessary headers and return an empty text/plain.
[ { "docid": "b96f261ce0ac7dfb30fc9386ff4750af", "score": "0.69418806", "text": "def cors_preflight_check\n cors_headers\n render :text => '', :content_type => 'text/plain'\n end", "title": "" } ]
[ { "docid": "9e36f0e05c194cf638c1399a231c6c79", "score": "0.7639121", "text": "def handle_options_request\n head(:ok) if request.request_method == \"OPTIONS\"\n end", "title": "" }, { "docid": "18fd73266177c195768a536fc446d0e8", "score": "0.7632858", "text": "def handle_option...
ab941da932450b8a05d4ccb596e7ef93
GET /flavors GET /flavors.json
[ { "docid": "ae9e558ae2f45b4bf1c16a6a6a067196", "score": "0.0", "text": "def index\n @flavors = Flavor.where(instock:[\"Yes\"]).order('name ASC')\n @outstock = Flavor.where(instock:[\"No\"]).order('name ASC')\n set_meta_tags title: \"Flavors\",\n site: \"B's Ice Cream\",\n ...
[ { "docid": "1456e7381c1fe0365cee7301c70e4d10", "score": "0.81710523", "text": "def flavors\n login\n\n uri = @services['compute'] + 'flavors/detail'\n\n body = get uri\n\n body['flavors'].map do |flavor|\n Flavor.new flavor\n end\n end", "title": "" }, { "docid": "25d2b4...
bb41053e1f4e5a43d553cb8acd6c5131
Send an error notification to New Relic
[ { "docid": "aa3cfc84ffa71fbc21e8151121f35598", "score": "0.0", "text": "def log(log)\n # Send error messages as Runtime exceptions\n exception =\n if log.exception\n log.exception\n else\n error = RuntimeError.new(log.message)\n error.set_...
[ { "docid": "6a7d1518bd1870dffb794ab2aca3371c", "score": "0.69033", "text": "def error\n NotificationMailer.error\n end", "title": "" }, { "docid": "abb1447df9d269f382bc18be84c3a373", "score": "0.6799402", "text": "def log_error(error)\n ::NewRelic::Agent.logger.error \...
84e7c108cfb1d26d8783fb7264366cfd
GET /albums/new GET /albums/new.xml
[ { "docid": "5cbefb835fc9161782529ea0890c22e1", "score": "0.7020873", "text": "def new\n @album = Album.new\n @album.album_photos.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end", "title": "" } ]
[ { "docid": "ff91011b4f9d665c77ddb75c8acc00a4", "score": "0.7923828", "text": "def new\n @album = current_account.albums.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end", "title": "" }, { "docid": "4163cbd1ddb...
2f8f66f5df2f41f072b0f2688f86f966
If labeled attribute has xpath with it
[ { "docid": "92db14806ab2ab6d610ff8c8d20d48a1", "score": "0.66821724", "text": "def xpath\n attr_value('xpath')\n end", "title": "" } ]
[ { "docid": "757fe82dfbe7c3d29e1ecd5c67e567c2", "score": "0.6587439", "text": "def is_xpath(value)\n value.start_with?(\"fhir:\") && value.include?(\"@\")\n end", "title": "" }, { "docid": "d28fc322426424ce1997b9a60873635c", "score": "0.64256877", "text": "def label\n ...
89029c70f2bc06ecd66fccbb1f791ebc
returns/lbtt/ads_amount step in the ADS wizard tax is re calculated
[ { "docid": "b00f9c855af257e52e7b70f0109537b9", "score": "0.86181664", "text": "def ads_amount\n wizard_step(STEPS) { { after_merge: :update_tax_calculations } }\n end", "title": "" } ]
[ { "docid": "54bd79e42ca3ef65cd3d6785441fafa1", "score": "0.7234702", "text": "def payment_amount\n amount - tax\n end", "title": "" }, { "docid": "bedb589a6728d5ca61dada08a6c36b8f", "score": "0.70396155", "text": "def tax_shown_adjustment\n line[:total!] - sum_lines(4, 8)\n e...
9468f6df306c48b31ce42f159c866351
Internal: If the node feeds energy into an aggregator, set the share of the edges entering the aggregator so that any deficit of demand from the producer will be met on the aggregator by its other input edge. production The total amount of energy output by the producer in MWh. For example [Producer] [Deficit] \ / [Aggr...
[ { "docid": "4c01ad4a20813da7d709a847c8e843d6", "score": "0.74898374", "text": "def inject_aggregator_attributes!(production)\n conv = @node.node\n\n return unless conv.groups.include?(:aggregator_producer)\n\n demand = participant.demand\n edge = conv.output(:useabl...
[ { "docid": "b3831601f1f3ba143aeab93092fb4dd2", "score": "0.6664484", "text": "def share\n edge = @node.node.output(:useable_heat).edges.first\n\n if edge.lft_node.key.to_s.include?('aggregator')\n edge.lft_node.output(:useable_heat).edges.first.share\n else\n ...
3cc1b21d47742c260f85968202a6cca7
Input: + Create user without ldap setting id + password or password confirmation is not length enough Output: Failed to create
[ { "docid": "e8000827b48f128535a191862fcc68c3", "score": "0.6114847", "text": "def test_ut_t1_la_user_003\n User.delete_all()\n new_user = User.new(:account_name => ACCOUNT,\n :ldap_setting_id => nil,\n :password => \"abc\",\n :p...
[ { "docid": "b2848a3525c35f57fb1564ab30c2e6d4", "score": "0.74856216", "text": "def create\n ldapPassword=File.open('config/password','r').first.split(\"\\n\")[0]\n auth = {:method=>:simple, :username=>\"cn=admin,dc=cws,dc=net\", :password=>ldapPassword}\n ldap=Net::LDAP.new(:host=>'ldap.cws.net...
08a1995fe57bbc9a81770f94d159bf32
Returns the complete list of addresses for this account.
[ { "docid": "94e0e31ae5f3e4a92a9fb3e980681ff1", "score": "0.8435397", "text": "def addresses\n @client.request('getaddressesbyaccount', name)\n end", "title": "" } ]
[ { "docid": "07c26ef25b23726f857e76158428a851", "score": "0.8415047", "text": "def addresses\n collect { |a| a.address }\n end", "title": "" }, { "docid": "8c26bed6c95e61fd7303804d72a52592", "score": "0.78163344", "text": "def addresses\n @addresses ||= init_address...
bcdefa3832aec3944d22cda53e6612bb
Clear all paths and start fresh. There is no mechanism for reordering paths, so its best to completely wipe the paths list and reappend them in the order you want.
[ { "docid": "e4b55b75470ed5ea2cfd1b498b9fa2e7", "score": "0.7382582", "text": "def clear_paths\n @trail.paths.dup.each { |path| @trail.remove_path(path) }\n end", "title": "" } ]
[ { "docid": "3f6f28d46b6b6535449a2b572f96c8d4", "score": "0.789757", "text": "def clear!\n @paths = []\n end", "title": "" }, { "docid": "02f2a5d45ae4a3724d2a95d8fe7c3ee2", "score": "0.76791525", "text": "def clear_paths\n @paths.clear\n end", "title": "" }, { ...
cca799c58814fd15310f649b8ceb4a3e
variants without & must avoid bridge methods to call& and instead use the directly generated Bc_CALL_SEND bytecodes
[ { "docid": "c8312fe17b4721baf197641986371a23", "score": "0.0", "text": "def call\n @_st_block.call\n end", "title": "" } ]
[ { "docid": "739495b9a06a319eb9c45d6a388c7995", "score": "0.72147506", "text": "def send(call)\n\n end", "title": "" }, { "docid": "f91ac962e3ba170b1aa09800870052f2", "score": "0.64354736", "text": "def send_call(opts = {})\n nsock = opts[:sock] || sock\n ca...
91c46601fd753dc9493cd9292f84f968
strong params post controller must accept :author_id as a param for a post strong params = security practice to help prevent allowing users to update sensitive model attributes author_id allowed for mass assignment in the create action
[ { "docid": "6374f44ed18d8a075db6e7434ac7ddd2", "score": "0.7620737", "text": "def post_params\n params.require(:post).permit(:title, :description, :author_id)\n end", "title": "" } ]
[ { "docid": "2bb72961cbe5f98b30a56927161ea9ef", "score": "0.79174757", "text": "def author_post_params\n params.require(:author_post).permit(:post_id, :author_id)\n end", "title": "" }, { "docid": "857c8de4e365a451ed85d9bf3cf5c81f", "score": "0.7662387", "text": "def post_para...
275bfc94b72815f96aa751f3db99c563
last_page_list => URL that will take us to the last page of our list of packages (subject to our filters)
[ { "docid": "5b65390878bd006ba3702c82eb2dceb3", "score": "0.8240426", "text": "def last_page_list\n\n sql = Utils.setup_basic_filters(SqlAssembler.new, @params.merge('site_id' => @site[:id]))\n\n sql.set_select 'SELECT id FROM islandora_packages'\n sql.set_order 'ORDER BY id DESC'\n sql.set_...
[ { "docid": "5716ef9b339b8f12d0ca66e743044380", "score": "0.6636063", "text": "def last(num = nil, filters = {}, headers = {})\n filters[:ending_before] = 'last'\n if num.nil?\n filters[:limit] = 1\n response = Clever.request :get, url, filters, headers\n ...
f7275f15627ea49c5ea197b18e0ab7e1
Patch a user's CallForwarding
[ { "docid": "35277a655dc0da67403c0610126a4c10", "score": "0.72009873", "text": "def patch_user_callforwarding(user_id, body, opts = {})\n data, _status_code, _headers = patch_user_callforwarding_with_http_info(user_id, body, opts)\n return data\n end", "title": "" } ]
[ { "docid": "bd1401b5f3cba954d8a22cb19605dc6e", "score": "0.6805415", "text": "def patch_user_callforwarding_with_http_info(user_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UsersApi.patch_user_callforwarding ...\"\n end\n \...
a399cef14700f68ee23cfc42c797662b
Render a JS window.location redirect (and metarefresh fallback)
[ { "docid": "7eba19b0945d1f83f6dab78fea1136c2", "score": "0.0", "text": "def render_js_redirect_to_receipt sim_response, transaction_saved, error_msg = nil\n url = payments_receipt_url(\n :transaction_saved => transaction_saved,\n :error_msg => error_msg,\n :only_path => false)\n ren...
[ { "docid": "b3b1d7087b85c03f30baf53fb8baa433", "score": "0.7641516", "text": "def script_redirect(location) \"<script> document.location=\\\"#{location}\\\"</script>\" end", "title": "" }, { "docid": "2adaa11dfeceea2372904104c68df1e1", "score": "0.7452937", "text": "def js_redirect(o...
c805bd739ac40c991048bbda371730fd
Expects your Amazon keys to be in the environment, something like export AWS_KEY="KEY" export AWS_SECRET="SECRET" Usage: ruby sample/s3.rb [bucket name] [file to use] This script will upload the file, show that the file is up, then remove the file
[ { "docid": "653a9c0382f1e7512a8f8d6b2edaea4b", "score": "0.67177886", "text": "def bad_usage\n puts \"\"\n puts \"Usage:\"\n puts \" ruby sample/s3.rb [bucket name] [file to use]\"\n exit 1\nend", "title": "" } ]
[ { "docid": "64d3231fb87252dcac6115ade46f27fa", "score": "0.6982586", "text": "def run_me\n file_name = 'my-file-1.txt'\n bucket_name = 'doc-example-bucket'\n folder_name = 'my-folder/'\n region = 'us-west-2'\n s3_client = Aws::S3::Client.new(region: region)\n\n puts 'Checking whether the specified...
348f9283b507eae0bdec9539fb03913b
GET /sudokus/new GET /sudokus/new.json
[ { "docid": "4d3f2f9cf6a2c60f0c366b9bac1dcedc", "score": "0.0", "text": "def new\n @sudoku = Sudoku.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sudoku }\n end\n end", "title": "" } ]
[ { "docid": "7e22a81a487f74bcff9ed990be2ebec8", "score": "0.7705423", "text": "def new\n @su = Sus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @su }\n end\n end", "title": "" }, { "docid": "2d20d62dcb8ffe2f9b7144a89fb8af12", ...
e92f285de81e471d5c569a537b0f30c7
GET /zip_msas GET /zip_msas.json
[ { "docid": "8340f101da086eab65b6f00a0fb66b07", "score": "0.76392174", "text": "def index\n @zip_msas = ZipMsa.all\n end", "title": "" } ]
[ { "docid": "0e4e3f16fe188beb8eec2ab8b48af7a1", "score": "0.64158803", "text": "def set_zip_msa\n @zip_msa = ZipMsa.find(params[:id])\n end", "title": "" }, { "docid": "0d666a98210ba5ffb3288a2288ce6e85", "score": "0.6359716", "text": "def show\n @zip = Zip.find(params[:id])...
98d2ee36fe2023732ef33112bc1bebc5
DELETE /sitegroups/1 DELETE /sitegroups/1.xml
[ { "docid": "1e3e84c9bd51197a791db53a85d641e2", "score": "0.73688203", "text": "def destroy\n @sitegroup = Sitegroup.access(current_user).find(params[:id])\n @sitegroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(sitegroups_url) }\n format.xml { head :ok }\n fo...
[ { "docid": "2cd6dbd3d8dfc6a97f28e5aa64b7226f", "score": "0.6675472", "text": "def test_set3_04b_delete_group()\n group = \"test_group\"\n user = \"test_user\"\n \n @test_acl.create_principal(user)\n @test_acl.create_group(group, [\"ALL\"], [user])\n \n query = \"doc(\\\"#{@col_path}...
e8b6d8331a1d3d78350b2e3d3501c91b
Retrieve a section of the source path
[ { "docid": "18a9e667aa4c92e71d451bca732c365c", "score": "0.0", "text": "def path_part(part)\n @_path_parts ||= app.blog.drafts.path_matcher.match(path).captures\n\n @_path_parts[app.blog.drafts.matcher_indexes[part]]\n end", "title": "" } ]
[ { "docid": "6dd3f4f10eaa51137ef0906f083b5f01", "score": "0.722931", "text": "def section\n @section || path_section\n end", "title": "" }, { "docid": "59d54c8b729c207b3b8585dc5cae7bf2", "score": "0.70111966", "text": "def path_section\n $1 if @basename.to_s =~ /\\.(\\d\\...
8cdf9a17bb1726768e682efbd736f1c7
Provide a user friendly representation source://twilioruby//lib/twilioruby/rest/conversations/v1/conversation.rb326
[ { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.0", "text": "def to_s; end", "title": "" } ]
[ { "docid": "e0ecd09bbcbcebfc56e0a7dd00df5618", "score": "0.7497514", "text": "def to_s\n '<Twilio::REST::Conversations::V1>';\n end", "title": "" }, { "docid": "9114014ec03e778a04d7682c6e7c8f28", "score": "0.73569745", "text": "def to_s\n '#<T...
b7c5a9c8615ba5f1c6a75012efc27fcb
Returns each element of the header joined with table tags.
[ { "docid": "56defd1b9bc1752c00f21ea16c9ef183", "score": "0.688262", "text": "def generate_header_row\n \"<table>\\n<tr>#{(@header.map {|x| \"<th>#{generate_header_item(x)}</th>\"}).join}</tr>\\n\"\n end", "title": "" } ]
[ { "docid": "c89ac6ea7c71df91ec2657a357ff5418", "score": "0.7299083", "text": "def header_items\n get_row_items(quip_sheet.at_css(\"tr\").children)\n end", "title": "" }, { "docid": "5c41bc56b0738599d36c359793375030", "score": "0.72535044", "text": "def generate_header_row\n ...
55b95891a387082e2e525e5533ba3593
Parse any other arguments used by agent
[ { "docid": "0c36b7a23d61eec6f0fd6bb77105c3e1", "score": "0.7149949", "text": "def parse_other_args(opts, options)\n end", "title": "" } ]
[ { "docid": "9a4708b3fb6165f5109a98d693196748", "score": "0.7965469", "text": "def parse_args(args); end", "title": "" }, { "docid": "3467c2a830c3cc1b5cc0027c98e7273e", "score": "0.72011936", "text": "def parse_arguments\n @parser.parse\n @cmd = @parser.command\n end", ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "db0129448cee0ac5b898c1f83f80824f", "score": "0.0", "text": "def location_params\n params.require(:location).permit(:name)\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...
360f29e62703dfb54ebaecf7f2334ae0
Assigns a tag to a user on a specific day.
[ { "docid": "061d2c10d600384ea4297f50f80b08a1", "score": "0.6502899", "text": "def add_tag_to_user\n payload = {}\n \n if session[:level] == 2 # Make sure this is an admin user. \n # Extract email and time from post parameters.\n email = params['email']\n time = Time.at param...
[ { "docid": "3f1e909d4f6f60e35a461b8a96998ca2", "score": "0.59915775", "text": "def set_tdee(date = Time.now)\n tdee_today = user_activities.find_by_name('Daily Energy Expenditure', :conditions => ['activity_date = ?', Time.now.beginning_of_day.utc])\n \n if !tdee_today && calorie_intake > 0\n ...
ba9d8fda8b2b0451ae97735974ebbeb0
Selects the auther id from the meme id
[ { "docid": "4d97e2c5b2f07b0823c8c6741326b9dd", "score": "0.75663626", "text": "def match_id(memeid)\n db = connect_to_database()\n return db.execute(\"SELECT MemeAutherId FROM memes WHERE MemeId = ?\", memeid).first[\"MemeAutherId\"]\n end", "title": "" } ]
[ { "docid": "b6bdf62f255152f6efd5d24f8dcfb21e", "score": "0.66046673", "text": "def auth_user_id\n auth[:user_id]\n end", "title": "" }, { "docid": "9df6f2e01f465f020a68b6af10298cfa", "score": "0.6365507", "text": "def setme\n # retrieve the user name\n id = %x{id}.chomp\n ...
9360524d6b2b55d68484878a678f7ffb
if they're not the admin user and they try to hit index or destroy they get redirected
[ { "docid": "ef6f6db405ff0dd92df04b547908b879", "score": "0.0", "text": "def show \n \t@user = User.find(params[:id]) # redirect to @user goes to show because of a rails convention\n \trender :layout => 'bootstraplayout.html.erb' # just until I get the regular layout made\n end", "title": "" } ]
[ { "docid": "2f07bf7eaafe9b0c12baf9cee153fbb9", "score": "0.78821397", "text": "def admin\n redirect_to \"/index.html\" unless !current_user.nil? && (current_user.id==1 || current_user.id==4)\n end", "title": "" }, { "docid": "eb089e960093f3c9571910a3201b0c48", "score": "0.787008...
9a75d8f9594b56e23b75891cbf9354f5
A Ruby object that describes the value
[ { "docid": "53424df9c058d0d57e3fa31666d5fe9c", "score": "0.0", "text": "def calc_type!(env)\n type = case value\n when true, false\n TyRaw[\"Bool\"]\n when Integer\n TyRaw[\"Int\"]\n when Integer\n TyRaw[\"F...
[ { "docid": "5035c74df3043c73cee522e84b078df0", "score": "0.7591507", "text": "def object\n @value\n end", "title": "" }, { "docid": "5035c74df3043c73cee522e84b078df0", "score": "0.7591507", "text": "def object\n @value\n end", "title": "" }, { ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "00e47a706b960a35e61663f439ffeb04", "score": "0.0", "text": "def set_petition_review_member\n @petition_review_member = PetitionReviewMember.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163443", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.604317", "text": "def action_hook; ...
b12105b4ae8cfd580c5cc2b549c451b1
GET /capsule_learners GET /capsule_learners.json
[ { "docid": "fe2fba55da586cfc41a70ed493d957c4", "score": "0.7685104", "text": "def index\n @capsule_learners = CapsuleLearner.all\n end", "title": "" } ]
[ { "docid": "321dbd7409d093df04a712064323d31c", "score": "0.69941765", "text": "def set_capsule_learner\n @capsule_learner = CapsuleLearner.find(params[:id])\n end", "title": "" }, { "docid": "c0ba802c05f7f54127db81ec32aca4d4", "score": "0.58871675", "text": "def show\n @le...
3cea2cba1b3b6601549364cbb45ef741
for chicken in chicken_hashes p chicken[:name] + " has laid " + chicken[:eggs].to_s() + " eggs" if chicken[:eggs] > 0 p "Whoop! Eggs!" end end
[ { "docid": "621405f6c0065c966f772cc05da395d4", "score": "0.6140553", "text": "def count_eggs(chicken_array)\n total_eggs = 0\n for chicken in chicken_array\n total_eggs += chicken[:eggs]\n end\n return total_eggs\nend", "title": "" } ]
[ { "docid": "e73a1fb85e1fdb49f005b2351676e8da", "score": "0.71530175", "text": "def look_pretty(grocery_hash)\n grocery_hash.each do |grocery, quantity|\n puts \"We need #{grocery}: #{quantity}\"\nend\n \nend", "title": "" }, { "docid": "9f9dae941e806f33644eb7c3ca9de3cc", "score": "0.65...
c789be2a6b1310f83fb6e01ca1cb8009
Takes the current search query and adds metadata TODO: there is probably no need to return animals and plants separately
[ { "docid": "edbca4af4e8ed6f7413b7069e79ebbf0", "score": "0.0", "text": "def generate\n @animalia, @plantae = cached_results.partition { |item| item.kingdom_position == 0 }\n if @output_layout == :taxonomic\n injector = Checklist::HigherTaxaInjector.new(@animalia)\n @animalia = injector.r...
[ { "docid": "295feca7763f904ab962cf03b052aca6", "score": "0.6427846", "text": "def index\n if params[:query].present?\n @animals = Animal.search_by_species(params[:query])\n if params[:search].present?\n @animals = @animals.where(care_level: params[:search])\n end\n else\n ...
f2977a75a19e7cbbe50a6a8b63e4e6e2
Parse tree to be compatible with jstree input data
[ { "docid": "70e9a06b7ebc64916022eb5455642334", "score": "0.66898245", "text": "def jstree_data\n Resource.tree.ordered.roots.map { |res| parse_jstree_node(res) }\n end", "title": "" } ]
[ { "docid": "8583f7809d0f7143ba111b7e607c49c3", "score": "0.7659295", "text": "def parsed_tree; end", "title": "" }, { "docid": "cfa6b7668a7eb3602553bcd8c2cf653b", "score": "0.686717", "text": "def parse(data)\n @tree = instance.parse(data)\n raise Error, instance unless...
131de06dd4cfd4790f5394da24289e92
compute event for execution by computing whatever the jig backend needs
[ { "docid": "b38d806f5ec636ee9d5f44fb23305a36", "score": "0.0", "text": "def prepare_for_execution(evt,config)\n # here for sub-classes to override.\n end", "title": "" } ]
[ { "docid": "56d60e6ddfee0be763518502cadcf86b", "score": "0.59101313", "text": "def apply(raw_event); end", "title": "" }, { "docid": "53e5752ccf8265a391d4d45d284e2e7f", "score": "0.5835086", "text": "def result\n main_event\n end", "title": "" }, { "docid": "0e276...
f0088bad92e03ed5ff023ce7262149a2
Remove raw message tables in order order until size is under the given size (given in MB)
[ { "docid": "e5bde90e8fce57fd617793ac96755f7b", "score": "0.7515886", "text": "def remove_raw_tables_until_less_than_size(size)\n tables = self.raw_tables(nil)\n tables_removed = []\n until @database.total_size <= size\n table = tables.shift\n tables_removed << tabl...
[ { "docid": "a4e9e8c157398a473d041335dfc5e255", "score": "0.60374284", "text": "def remove_raw_table(table)\n @database.query(\"UPDATE `#{@database.database_name}`.`messages` SET raw_table = NULL, raw_headers_id = NULL, raw_body_id = NULL, size = NULL WHERE raw_table = '#{table}'\")\n @data...
0f562463d5cedc75908657f3b84f9594
Deploy the clusterwide client configuration.\n\nFor each service in the cluster, deploy the service&39;s client configuration\nto all the hosts that the service runs on.\n\nAvailable since API v2.
[ { "docid": "a408fc21785073b6b15ef8f9fbee0d3a", "score": "0.0", "text": "def api_v11_clusters_cluster_name_commands_deploy_client_config_post(cluster_name, opts = {})\n api_v11_clusters_cluster_name_commands_deploy_client_config_post_with_http_info(cluster_name, opts)\n return nil\n end", ...
[ { "docid": "969d80472736af37fced831c973ed7be", "score": "0.6487035", "text": "def deployClusters\n\n $cluster = @parsed_obj['environment_cluster']\n\n # for each layer in --deploy parameter.\n @opt.deploy.each do |d|\n case d\n when 'batch'\n if !@opt.nofacts\n ...
650c9e309697ba08f2748d68b41d7ada
Create a payment URL. Use this to generate an embedding payment link.
[ { "docid": "901de167526de219fe40c111c862c29d", "score": "0.6741646", "text": "def create_payment_url(content_type, client_request_id, api_key, timestamp, payment_url_request, opts = {})\n data, _status_code, _headers = create_payment_url_with_http_info(content_type, client_request_id, api_key, time...
[ { "docid": "ed7f78aa994514c2bc020c7728f5f37c", "score": "0.6612736", "text": "def create\n order = current_user.orders.find(params[:order_id])\n @payment = Payment.new\n @payment.price = order.price\n @payment.order_id = order.id\n @payment.variable_symbol = order.id.to_s + rand(1..100).t...
bb967b70e6046d051972b67d9a0165e5
Return start time for this element, relative to the beginning of the production.
[ { "docid": "10ae7e0ecbe120e38d0c260423f5cbb3", "score": "0.0", "text": "def t1\n _absolute(enter)\n end", "title": "" } ]
[ { "docid": "561119d6a9eced699716cde7842a94fd", "score": "0.82547283", "text": "def start_time\n return @start_time\n end", "title": "" }, { "docid": "82d5d969ed7fa0b655ed99339377cf53", "score": "0.8158939", "text": "def start_time\n @start_tim...
a21ef1993fdb81d576a95607d78e9e41
:callseq: dh.compute_key(pub_bn) > string Returns a String containing a shared secret computed from the other party's public value. This method is provided for backwards compatibility, and calls derive internally. === Parameters _pub_bn_ is a OpenSSL::BN, not the DH instance returned by DHpublic_key as that contains th...
[ { "docid": "d41b7cb9778bfd64dca210e9e9a6317b", "score": "0.80366784", "text": "def compute_key(pub_bn)\n peer = dup\n peer.set_key(pub_bn, nil)\n derive(peer)\n end", "title": "" } ]
[ { "docid": "2c11101be279889cd7b6f4f973cb784a", "score": "0.70482284", "text": "def dh_compute_key(pubkey)\n peer = OpenSSL::PKey::EC.new(group)\n peer.public_key = pubkey\n derive(peer)\n end", "title": "" }, { "docid": "2c11101be279889cd7b6f4f973cb784a", "score": "0.70...
397f2748a8ae8a3baf95741b74897ae7
GET /members/1 GET /members/1.json
[ { "docid": "3004b574d95a1c30a15c076b01bf29f6", "score": "0.7146131", "text": "def show\n @member = Member.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @member }\n end\n end", "title": "" } ]
[ { "docid": "d743f502b758a7352730ff7d6044c6b3", "score": "0.80884856", "text": "def my_members(params = {})\n get(\"/members\", params)\n end", "title": "" }, { "docid": "2eb3a656ce97b066f36c71fd7f539be3", "score": "0.7862207", "text": "def show\n members = MemberRepo.f...
1a09aa880962e32abeadceaafdac270d
Q: Write a test that will fail if list and the return value of list.process are different objects.
[ { "docid": "8b024f1bba4dd2684d84362728dcef4f", "score": "0.7964352", "text": "def test_same_object\n assert_same(list, list.process)\nend", "title": "" } ]
[ { "docid": "522ad8f28e6dfe15d31314c7329bc1f2", "score": "0.75329316", "text": "def test_same_object\n assert_same(@list, @list.process)\n\n # LS Solution\n # assert_kind_of Numeric, value\n end", "title": "" }, { "docid": "0c33371a26e61de6b65aa5e13c34dbb6", "score": "0.64089394...
3b7c3dc465cb2c09389afb5d9555f35d
Called on file(s) additions that the Guard plugin watches.
[ { "docid": "e9050d4e3037ca179091cdfe134fc2d7", "score": "0.0", "text": "def run_on_additions(paths)\n run_partially(paths)\n end", "title": "" } ]
[ { "docid": "1a26a135e9cd540938154bed95e57d75", "score": "0.67840475", "text": "def watchable_files; end", "title": "" }, { "docid": "99b9a307bcb1b5c8d928c82e24cbe740", "score": "0.6669997", "text": "def start_watch_files\n watched_files.each do |file|\n @notifier.watch(fi...
5af92868181187d56140b2bd8ab77f31
used to filter the generic GET responses based on a 'filter_str' containing a set of name/value pairs (where the names are fieldnames in the response to match against and the values are comparisonvalues that the values from those fieldnames must match for an object in the response to pass through the filter). The filte...
[ { "docid": "e571b75cefeeb0283656c95da5907fb4", "score": "0.63020056", "text": "def filter_hnl_response(response, filter_string)\n # if response is not an array or if all of the elements in the array are not hashes,\n # then throw an error\n raise ProjectHanlon::Error::Slice::InputEr...
[ { "docid": "599ddad93cf2c868d698a7e1179ac6d5", "score": "0.6626165", "text": "def parse_filter_string(filter_string)\n name_val_pairs = filter_string.split('+')\n comparison_hash = {}\n name_val_pairs.each { |name_val|\n comparison_pair = Hash[*name_val.split('=').flatten]\...
bba5066d0a2819796ec2fa4b307b81ae
Methods return_value finds record for given id, then returns value associated with key
[ { "docid": "3b39c26a764429fbe7583d9027ac2bb1", "score": "0.7259998", "text": "def return_value(db, table, id, key)\r\n\tvalue_array = db.execute(\"SELECT #{key} FROM #{table} WHERE id=#{id}\")\r\n\r\n\t# If not defined, return nil\r\n\tif value_array.empty?\r\n\t\treturn nil\r\n\tend\r\n\tif value_array...
[ { "docid": "8f6aa8ff35874065f4aecef7e4fa9474", "score": "0.67510444", "text": "def fetch_value( oid, key )\n\t\toid = normalize_oid( oid )\n\t\tkey = normalize_key( key )\n\t\tdata = @storage[ oid ] or return nil\n\n\t\treturn data[ key ]\n\tend", "title": "" }, { "docid": "f22563706184fc495...
ef30104dab890f7489acd40c24485837
PATCH/PUT /conversations/1 PATCH/PUT /conversations/1.json
[ { "docid": "84d71f1ef5e7403502d2e39b6fb98c25", "score": "0.66328156", "text": "def update\n respond_to do |format|\n if @conversation.update(conversation_params)\n format.html { redirect_to @conversation, notice: 'Conversation was successfully updated.' }\n format.json { head :no_c...
[ { "docid": "3e54d05f63dfa852336c0059fb7719a7", "score": "0.70295537", "text": "def update_conversation(id, data)\n put(\"conversations/#{id}\", { body: data })\n end", "title": "" }, { "docid": "fdb300fd8bd8024b3443cbdfc63a3ed1", "score": "0.69650495", "text": "def update_convers...
f5d89b0fdbdca8f90196a5aba96fa331
Defines a country with an ISO 31661 alpha2 country code and name.
[ { "docid": "572af35f16c1e994487fce9f628fcdbb", "score": "0.7671598", "text": "def country(code, name); end", "title": "" } ]
[ { "docid": "09d29886b74da88db24ee91f79fc73c5", "score": "0.72336644", "text": "def country\n @country ||= IsoCountryCodes.find(alpha2)\n end", "title": "" }, { "docid": "c50579e61b9473c49200d80918955763", "score": "0.7165545", "text": "def country=(value)\n @country = value\n\...