query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
8f3d0c131fdbedaeb5d57a6522aad5d6 | Returns where the macro was used (used in Glyph::Analyzer) | [
{
"docid": "78877a2814e13a8c54663d453737d9de",
"score": "0.0",
"text": "def source\n\t\t\ts = self[:source][:file] rescue nil \n\t\t\ts ||= self[:source][:name] rescue nil\n\t\t\ts\n\t\tend",
"title": ""
}
] | [
{
"docid": "a56f6b0e4bba2b1aa5237d03f83b95eb",
"score": "0.635976",
"text": "def find(macro_name); end",
"title": ""
},
{
"docid": "85108e921004305bea08417c99a5eda3",
"score": "0.6218797",
"text": "def here\n __FILE__\n end",
"title": ""
},
{
"docid": "84d1fcd... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "d90f9616906fd238b955c61524e7d584",
"score": "0.0",
"text": "def home_params\n\t\tparams.require(:home).permit(:name, :address1, :city, :postalCode, :province, :country, :description, :image)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7495027",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.69566035",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "08c52a9cfb70cf6b86dd55604cf3e96c",
"score": "0.0",
"text": "def update!(**args)\n @path = args[:path] if args.key?(:path)\n end",
"title": ""
}
] | [
{
"docid": "184b1b1ed771473d3eb9f338c0734c38",
"score": "0.73066413",
"text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end",
"title": ""
},
{
"docid": "5076c5a88404ae72986f958710f5687a",
"score": "0.72631145",
"text": "def update... |
0a4f9810b03ea88d4a684095bb4de3ca | Formats the proper alert string when the +pvid+ attribute of the SEA does not match the Port VLAN ID of the +pvid_adapter+. | [
{
"docid": "f65256256994ea552ecc9f2369608314",
"score": "0.6961495",
"text": "def pvid_mismatch(sea, sea_pvid, pvid_adapter, adapter_pvid)\n t = \"pvid attribute for #{sea} of #{sea_pvid} mismatches \" +\n \"#{pvid_adapter}'s Port VLAN ID of #{adapter_pvid}\"\n end",
"title": ... | [
{
"docid": "6526589536d8fdf2f869f2ca253e70af",
"score": "0.6039585",
"text": "def vid_conflict(ent1, ent2, vid, vswitch)\n \"#{ent1} and #{ent2} both use VLAN #{vid} on #{vswitch}\"\n end",
"title": ""
},
{
"docid": "d5d0bedba8f1180d0651d734ee2cb53f",
"score": "0.59320503",
... |
3f287194e2b0860829a13230c7d324af | Mock default batch url | [
{
"docid": "44b468a1fd58724de81ec87442cc4750",
"score": "0.6572095",
"text": "def mock_batch(options)\n method = options.delete(:method) || :post\n options[:status] ||= %w(200 OK)\n stub_request(method, configuration.batch_url).to_return(options)\n end",
"title": ""
}
] | [
{
"docid": "ca2c7a84f4576cf5c8ded5c8dfc984ec",
"score": "0.6246664",
"text": "def stub(base_url); end",
"title": ""
},
{
"docid": "41ff2d9f6594f3e2e0322e36bd655bcc",
"score": "0.60455847",
"text": "def test_url\n 'http://localhost:4567'\nend",
"title": ""
},
{
"docid": "... |
d10717d54fe60dc5fcc648255cd4ee03 | Find and output feeds related to the given query query: A tag or search query to pass to Google. Google will find feeds that match this value. content_id: Name of the div that will hold the widget google generates. If this method is called more than once on a given page then you will need to specify different content_i... | [
{
"docid": "da0e16db953b924cd2218af08abaa1da",
"score": "0.74185514",
"text": "def google_feed_search(query, content_id = 'feed_search_content')\n render :partial => 'google/feed_search', :locals => { :query => query, :content_id => content_id }\n end",
"title": ""
}
] | [
{
"docid": "11bb8a1fce1f27c6d834574c364dafbf",
"score": "0.6159269",
"text": "def google_combined_feeds(feeds, content_id = 'google_combined_feed', javascript_callback = nil)\n render :partial => 'google/combined_feed', :locals => { :feeds => feeds, :content_id => content_id, :javascript_callback => ... |
3e1dc3063a92c5a757d4d8592bc23bf4 | valid options are :as_panel or :as_frame | [
{
"docid": "d7a1c83f9cec5175d1a8761012b5825f",
"score": "0.6258792",
"text": "def form(*options, &block)\r\n\r\n sync_swing_thread do\r\n \r\n is_panel = false\r\n\r\n if options.length == 0\r\n is_panel = false\r\n elsif options[0] == :as_panel\r\n is_panel = true\r... | [
{
"docid": "99da97f1fb8fde74af1fb6a660030008",
"score": "0.62279785",
"text": "def panel(content_or_options_with_block = nil, options = nil, &block)\n if block_given?\n panel_string capture(&block), content_or_options_with_block || {}\n elsif content_or_options_with_block.is_a?(Hash) &&... |
c87826163ce7cede36d5c24bce92b92a | Convert a geometry to a GeoJSON String | [
{
"docid": "ce2b30a9cd13a2982335e9c63eaa79e5",
"score": "0.6581404",
"text": "def to_geojson\n ::MultiJson.dump(as_geojson)\n end",
"title": ""
}
] | [
{
"docid": "4b8d35d809b47a5752344611c5eadbb7",
"score": "0.79486156",
"text": "def geom_from_json(geometry)\n RGeo::GeoJSON.decode(geometry.to_json).as_text\n end",
"title": ""
},
{
"docid": "03081ef06d4cb03eb353a6fe82b7e51c",
"score": "0.74351406",
"text": "def to_json_objec... |
21d65617f732c5912fb53f8f2ac1bf54 | TODO long if jungle but how to make it short/work around it | [
{
"docid": "917168d10365b1218c019fcbca7d48bc",
"score": "0.0",
"text": "def mouse_motion\n motion do |x, y|\n c = @code_para.hit_sloppy(x, y)\n if c\n if self.cursor == :arrow\n self.cursor = :text\n end\n if self.mouse[0] == 1 and @clicked\n if @code_... | [
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"score": "0.6126157",
"text": "def desired; end",
"title": ""
},
{
"docid": "bc658f9936671408e02baa884ac86390",
"score": "0.59942317",
"text": "def anchored; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",... |
73cc4e0bf5f6951f7f2ab41c0c5ef43a | Method to handle guessing logic. | [
{
"docid": "f954cf2a2992167add849406d33c65e8",
"score": "0.6448814",
"text": "def guess(letter)\n raise(ArgumentError, \"You must enter a letter\") if (letter =~ /[^a-z]/i) \n raise(ArgumentError, \"You must enter a letter\") if !letter || letter.empty? #for some reason letter.blank? doesn't wor... | [
{
"docid": "b93e95e4f952a7858684fce07951694f",
"score": "0.75919604",
"text": "def make_guess; end",
"title": ""
},
{
"docid": "92d1bf7b2ea0d0b25ab1f7f3b02c117f",
"score": "0.7354619",
"text": "def guesses_so_far\n end",
"title": ""
},
{
"docid": "4fa43629bdf55e29158ea3a... |
bdddbe8d72965d2432966d78d0a560e6 | Locate the indicated file in the given archive. | [
{
"docid": "2833539a34b0d71da0ddb2bb140231b1",
"score": "0.5175709",
"text": "def find_zip_path(ext, file)\n return if ext.blank? || file.blank?\n ext = \".#{ext}\" unless ext.start_with?('.')\n Archive::Zip.open(file) do |archive|\n archive.each do |entry|\n name = entry.zip_path.t... | [
{
"docid": "267b93b8a1cacf39ed5e322d7e9da016",
"score": "0.64002055",
"text": "def find_file_in_path(file, path)\n find_file(path + \"/\" + file)\n end",
"title": ""
},
{
"docid": "c7b7aaf5e2dffbe9b9f2a664a9cb5174",
"score": "0.5981348",
"text": "def search_for_file(relpa... |
37c3ddc57fe84eae966cf0921b353f16 | returns true if user just had a previous captcha attempt fail | [
{
"docid": "ee73f8361fe781ed710d1cc546f53229",
"score": "0.8452143",
"text": "def previous_captcha_attempt_failed?\n flash[:captcha_failed]\n end",
"title": ""
}
] | [
{
"docid": "f4f553ce650433537232d9bf72aa5e77",
"score": "0.83527803",
"text": "def last_captcha_attempt_failed?\n flash[:failed_captcha]\n end",
"title": ""
},
{
"docid": "97d09da3c541f5370bf89bd5e98fe4ea",
"score": "0.8149992",
"text": "def captcha_passed?\n if captcha_previo... |
73505dff8d7811c660cf7b4a158e480f | Gets the activity prefix name | [
{
"docid": "9fc409df376244acc4ca168df7dda055",
"score": "0.88897777",
"text": "def activity_name\n @prefix_name\n end",
"title": ""
}
] | [
{
"docid": "74cfc0fad54acc02c8a0acd32a1416d4",
"score": "0.7642332",
"text": "def activity_name=(value)\n @prefix_name = value\n end",
"title": ""
},
{
"docid": "454e042b7aabd001334faa04f073745f",
"score": "0.6718653",
"text": "def prefix\n \"#{name}::\"\n end... |
1de14fb525069c21e9cfdda927869584 | PUT /student_payments/1 PUT /student_payments/1.json | [
{
"docid": "9e5afc3a05b8d92910e55091b2810218",
"score": "0.7261052",
"text": "def update\n @student_payment = StudentPayment.find(params[:id])\n\n respond_to do |format|\n if @student_payment.update_attributes(params[:student_payment])\n format.html { redirect_to @student_payment, noti... | [
{
"docid": "1f7db9daca5265f81d795b2e2e931b93",
"score": "0.6849401",
"text": "def update\n @student_payment = StudentPayment.find(params[:id])\n\n respond_to do |format|\n if @student_payment.update_attributes(params[:student_payment])\n flash[:notice] = 'StudentPayment was successfull... |
9c9afd8031676266c9aa453dd2619020 | Get a string of input from the user (up to the next newline character). | [
{
"docid": "35a018ef5730928bc90e8ba940d93bce",
"score": "0.0",
"text": "def get\n @io.gets\n end",
"title": ""
}
] | [
{
"docid": "06cda41d87589bf757e7fd80e95acdd3",
"score": "0.8058386",
"text": "def input(prompt=\"\", newline=false)\n prompt += \"\\n\" if newline\n ret = nil\n begin\n ret = Readline.readline(prompt, true).squeeze(\" \").strip\n rescue Exception => e\n return nil\n end\n return ret\nend",
... |
3fb29602a252c3b18dbbd2c369cdc1f4 | Returns an integer release year | [
{
"docid": "d66c959ddf207ce938cf09a892c71c37",
"score": "0.7321912",
"text": "def year\n doc.search(\"table.info a[href*='/m_act%5Byear%5D/']\").text.to_i\n end",
"title": ""
}
] | [
{
"docid": "53efe1d2568992735ba1db9e94cf52f6",
"score": "0.8637797",
"text": "def release_year\n release_date.year\n end",
"title": ""
},
{
"docid": "99cbb6d124db5adbc7d9f86779a0b34e",
"score": "0.8619",
"text": "def year\n @year ||= release_date.year if release_date\n end",
... |
69a4b6b75713f3a6562ac04671fc3ccb | require_relative 'Wagon' require_relative 'Coach' require_relative 'CargoWagon' | [
{
"docid": "12f0cd48f925704f4820dbf064bb114d",
"score": "0.0",
"text": "def start\n puts \"--Система управления железной дорогой--\"\n puts \"\"\n main_menu\nend",
"title": ""
}
] | [
{
"docid": "ac15b56a4ca48844a1faf6f8f56ecf89",
"score": "0.66948926",
"text": "def require(name)\n Kernel.require \"#{File.dirname(__FILE__)}/../#{name}.rb\"\nend",
"title": ""
},
{
"docid": "b5336713090e54c820aa728251a2a282",
"score": "0.6575979",
"text": "def require_in_tree(name)... |
4deac88408b096976cc4b57f60dd74b6 | Returns a human readable string | [
{
"docid": "393366b0c3878c95c8b163d6ac628e37",
"score": "0.0",
"text": "def inspect\n \"\\#<#{self.class}>\"\n end",
"title": ""
}
] | [
{
"docid": "846f2deacda09e74e1079c108f74cb65",
"score": "0.749111",
"text": "def to_human\n \"\"\n end",
"title": ""
},
{
"docid": "77e9fc6141ff2660c553c381fdd89f7d",
"score": "0.73210835",
"text": "def to_s\n human_name\n end",
"title": ""
},
{
"docid": "4eb2b8f5... |
92e3110ac06e2742166c953f31c4529c | DELETE /positions/1 DELETE /positions/1.json | [
{
"docid": "165e8b252e52eb1098124746c31647aa",
"score": "0.7007951",
"text": "def destroy\n device = @position.device\n @position.destroy\n respond_to do |format|\n format.html { redirect_to device_positions_url(device), notice: 'Position was successfully destroyed.' }\n format.json {... | [
{
"docid": "1a889571c7def7dbbb01c82212fae396",
"score": "0.77685696",
"text": "def destroy\n @position.destroy\n\n respond_to do |format|\n format.html { redirect_to positions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d6dee72ea7f65b... |
6b632d52bbc12be1f47b14a211814a05 | Site SMTP Alert Retrieves the specified SMTP alert. | [
{
"docid": "347ffd79b9fa853a8f3e34b0a9c013a7",
"score": "0.67934686",
"text": "def get_site_smtp_alert(id, alert_id, opts = {})\n data, _status_code, _headers = get_site_smtp_alert_with_http_info(id, alert_id, opts)\n return data\n end",
"title": ""
}
] | [
{
"docid": "2b67696e6bdb58f9f635e44325ac1b26",
"score": "0.68825716",
"text": "def get_site_smtp_alert(id, alert_id, opts = {})\n data, _status_code, _headers = get_site_smtp_alert_with_http_info(id, alert_id, opts)\n data\n end",
"title": ""
},
{
"docid": "e4549db9cff33c47f1fa0... |
a5b41bf422efdb4c7c5ce2f9743e35fa | POST /packages POST /packages.xml | [
{
"docid": "2af13d77fd0f4c342ceea02f732784dc",
"score": "0.57103103",
"text": "def create\n @pagetitle = \"New package\"\n @package = Package.new(params[:package])\n @package[:slug] = @package[:title].to_slug\n\n respond_to do |format|\n if @package.save\n format.html { redirect_... | [
{
"docid": "fc26a2ed493799cf9acde2e67567d6f6",
"score": "0.623592",
"text": "def upload_packages(packages)\n test_payload.set(:packages, packages)\n end",
"title": ""
},
{
"docid": "ba0b9fb4a6bfa2b22485336196ee72a7",
"score": "0.6209002",
"text": "def create\n @package = P... |
fdc622597614c0e0e628808c54dfb246 | play a card from a public template or user is member of private tmeplate GET play/:token | [
{
"docid": "e10c9adebcc457afd4c7de5136abef12",
"score": "0.0",
"text": "def new\n @template = Template.find_by(token: params[:token])\n @organization = @template.organization\n \n if @template.is_public || is_member?\n @card = @template.cards.build(user: current_user)\n CreateCircl... | [
{
"docid": "226222a099560e1940b9d587fce0c546",
"score": "0.68471694",
"text": "def play(card)\n end",
"title": ""
},
{
"docid": "8c8d1c4aa4fa4fbf1c47e97f6a4bfe09",
"score": "0.65779513",
"text": "def play_card\n raise 'TODO: implement me!' # TODO: implement this\n end",
"tit... |
34ad3bdf4d2c06525eccbbf377e48905 | same as above but using sort block x (0) x n3 (3) n2 (1) n4 (0) n5 | [
{
"docid": "3bb03dc2b6d490f645f1978b7c9690d0",
"score": "0.0",
"text": "def test_sort_by_ancestry_with_block_paginated_missing_parents_and_children\n AncestryTestDatabase.with_model :extra_columns => {:rank => :integer} do |model|\n _, n2, n3, n4, n5, _ = build_ranked_tree(model)\n\n record... | [
{
"docid": "363b79c86a49eadf9d3f67235a753e93",
"score": "0.68206614",
"text": "def block_sort(arr)\n return arr if arr.size < 2\n\n block_start = 0\n block_stop = MIN - 1\n while block_stop < arr.size\n sorting = arr[block_start..block_stop]\n arr[block_start..block_stop] = insertion_sort(sort... |
0698055fe8d9e43f9aff7559ce30fdea | Set `site.url` and `site.baseurl` if unset and in production mode. | [
{
"docid": "0509c71e06cb869923162751ccf5a74c",
"score": "0.8340198",
"text": "def set_url_and_baseurl_fallbacks!\n return unless Jekyll.env == \"production\"\n\n repo = drop.send(:repository)\n site.config[\"url\"] ||= repo.url_without_path\n if site.config[\"baseurl\"].to_s.... | [
{
"docid": "2176e0c904b11387098b04c872d15aab",
"score": "0.6901489",
"text": "def site_url\n if Rails.env.production?\n # Place your production URL in the quotes below\n \"http://www.ezonline.com/\"\n else\n # Our dev & test URL\n \"http://ezonline-dev.com:3000\"\n end\n en... |
4170b076bbd9e63af47ce734e642269e | reduce 256 omitted reduce 257 omitted reduce 258 omitted reduce 259 omitted | [
{
"docid": "aeed4cde136fe9d066fc48d186180d94",
"score": "0.0",
"text": "def _reduce_260(val, _values, result)\n result = args val\n\n result\nend",
"title": ""
}
] | [
{
"docid": "7a6f344f7a0a328fc14ecffdaad52f78",
"score": "0.6704825",
"text": "def _reduce_263(val, _values, result); end",
"title": ""
},
{
"docid": "7a6f344f7a0a328fc14ecffdaad52f78",
"score": "0.6704825",
"text": "def _reduce_263(val, _values, result); end",
"title": ""
},
... |
726099db88b820b50a4c13fc1e0630e9 | intersect double dispatch for LineSegments | [
{
"docid": "dd493477ef55879ec349fed72e7776d4",
"score": "0.77356064",
"text": "def intersectWithSegmentAsLineResult seg\n seg\n end",
"title": ""
}
] | [
{
"docid": "1ec6a94dd43ddf516beadec41a52af8d",
"score": "0.8342776",
"text": "def intersectWithSegmentAsLineResult seg # seg is e1, self is e2 (a line) - receive dynamic dispatch\n seg # the segment e1 is on the line e2 because they coincide\n end",
"title": ""
},
{
"docid": "5ca779d52... |
e1939e247bc65620cd67ae4345362698 | Sets the status of this application based on a name value (which is a unique key in the ApplicationStatusType model) and return the ApplicationStatus object of the new status. If the ApplicationStatusType doesn't already exist, we create it. Otherwise, just find that type. If this is already the current status type for... | [
{
"docid": "cd8cd3f1e1af02c3c5cdceb0d2791a56",
"score": "0.7023066",
"text": "def set_status(name, deliver_emails_now = true, options = {})\n name = name.to_s if name.is_a?(Symbol)\n @type = ApplicationStatusType.find_or_create_by_name(name)\n @status = self.application_statuses.find_by_applica... | [
{
"docid": "9e1e0f72d74be81540780982d9773796",
"score": "0.5940427",
"text": "def set_app_status\n @app_status = AppStatus.find(params[:id])\n end",
"title": ""
},
{
"docid": "ab450d161820f99a2658c982ff86eeb0",
"score": "0.5661082",
"text": "def status=(val)\n unless [ni... |
7cbe95720c4c23a98da926e12ed472a6 | Define "env" task which will cause the Rails app to be loaded in subprocess. | [
{
"docid": "f40a7390389157c67a69a32cf6230a12",
"score": "0.68251175",
"text": "def install_env\n task 'test:engine:env' => 'test:engine:setup' do\n ENV['BUNDLE_GEMFILE'] = gemfile_path.to_s\n ENV['RUBYOPT'] = \"-r./#{app_path}/config/environment\"\n ENV['RAILS_ENV'] = 'test'\n end\n... | [
{
"docid": "ec1cd64c13565da8a63b9c8162fd845d",
"score": "0.7037184",
"text": "def define_environment_task\n task :environment do\n begin\n require(File.join(@config.rails_root, 'config', 'environment'))\n rescue\n raise 'Rails environment could not be loaded'\n ... |
0a73eaa6809ba33d960d19fe5b902122 | Get authentication method name | [
{
"docid": "abb4c6592f8d0630615d1a44cc85df5b",
"score": "0.7975542",
"text": "def human_auth_method\n self[:auth_method].to_human\n end",
"title": ""
}
] | [
{
"docid": "6a87e450fcd53a91e0f0f0df089eec7e",
"score": "0.8909435",
"text": "def method_auth_name\r\n method_info[:method_auth_name]\r\n end",
"title": ""
},
{
"docid": "a5a61902d1fb72e4161e7f4d6dfbf8e6",
"score": "0.77261126",
"text": "def authentication_method\n @attr... |
e561e11bcf379ef5dc139c210017366b | Only allow a list of trusted parameters through. | [
{
"docid": "781b486f3a53deabb86a0ee5953c9783",
"score": "0.0",
"text": "def task_status_params\n params.require(:task_status).permit(:name)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74768823",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.71700543",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist... |
94888015afcb91904b19f40ae1fe7a17 | Creates a new User and signs user in. Receives params as parameters. | [
{
"docid": "1da4c48667935a9340d18403bb597aee",
"score": "0.0",
"text": "def create\n \t@current_user = User.new(user_params) \t\n\t if @current_user.save && @current_user.authenticate(params[:user][:password])\n\t \tsession[:user_id] = @current_user.id\n\t \tflash[:success] = \"Welcome... | [
{
"docid": "95ed107f4045b50e9fa33d41bc8e111d",
"score": "0.82949585",
"text": "def create\n User.create(user_params)\n redirect_to log_in_path\n end",
"title": ""
},
{
"docid": "95ed107f4045b50e9fa33d41bc8e111d",
"score": "0.82949585",
"text": "def create\n Us... |
35f2f61801d2bd49d0a04c0eaf28f1ca | Get the list of SystemPresences | [
{
"docid": "807dddef771d7bc007a1a1ccf4c13737",
"score": "0.734721",
"text": "def get_systempresences(opts = {})\n data, _status_code, _headers = get_systempresences_with_http_info(opts)\n return data\n end",
"title": ""
}
] | [
{
"docid": "d7052f24e89a6e9d2462e0a1ba7a5c8d",
"score": "0.69341284",
"text": "def presences\n return @presences\n end",
"title": ""
},
{
"docid": "27c8db45aa184c32a7d84063bc5dfbb8",
"score": "0.67475563",
"text": "def get_systempresences_with_http_info(opts... |
a50617b8ca8453e680801096cd3d5283 | Converts nested properties into flat properties and updates the indentation of the prop node based on the nesting level. | [
{
"docid": "aed7f52a8422551d1b3ec6f74fa7a755",
"score": "0.63471943",
"text": "def visit_prop(node)\n if parent.is_a?(Sass::Tree::PropNode)\n node.resolved_name = \"#{parent.resolved_name}-#{node.resolved_name}\"\n node.tabs = parent.tabs + (parent.resolved_value.empty? ? 0 : 1) if node.sty... | [
{
"docid": "bad219445debef07e9ad8b211dfe9fde",
"score": "0.5935531",
"text": "def indentation(properties)\n @options[:indentation] = properties\n end",
"title": ""
},
{
"docid": "50c34d43a473e921f877e377f0a5b368",
"score": "0.5807421",
"text": "def doc_property_yaml(prop,... |
c5d2e5a71683bf52d3a7e79610ca7b0a | POST /projects POST /projects.json | [
{
"docid": "26e1d087a04fe9f69eeab649668deccf",
"score": "0.0",
"text": "def create\n if user_signed_in?\n categories = project_create_params[:categories_names]\n @project = Project.new(project_create_params.except(:categories_names))\n respond_to do |format|\n if @project.save\n... | [
{
"docid": "5b64ba9f9faea58bb5af65892c2ea3db",
"score": "0.7589564",
"text": "def post_new_project\n self.class.params\n options = {:body =>{:project=>\n {:title => @@params[\"title\"],\n :description => @@params[\"description\"]}}}\n self.class.post(\"/projects.json\", opti... |
22c14320fcaae7870ae2558f567ec9ef | GET /item_comments/1 GET /item_comments/1.json | [
{
"docid": "e997f63843142895bcea9a04ae4d4bfb",
"score": "0.6908617",
"text": "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: {item_comment: @item_comment, item: @item_comment.item.more_json, user: @item_comment.the_other_user} }\n end\n en... | [
{
"docid": "e870c16b7da2b077bca294d1883707a9",
"score": "0.74841195",
"text": "def list_item_comments(item_id, params = nil, headers = nil)\n get(\"/api/v2/items/#{item_id}/comments\", params, headers)\n end",
"title": ""
},
{
"docid": "ed59ebf1be23717774b9b95c7785dc41",
"score":... |
f26b675ccab9b886e53bb0c93c579c46 | GET /test_questions/1 GET /test_questions/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "72714598a48023023e92ad0ae2f0ab12",
"score": "0.7627346",
"text": "def index\n render json: @test_module.test_questions, status: :ok\n end",
"title": ""
},
{
"docid": "82fc080dea262a79e0a7089773f9a8e2",
"score": "0.76192075",
"text": "def questions\n self.clas... |
81ee6e1476b241fa518c7c25d1808435 | DELETE /saved_recipes/1 DELETE /saved_recipes/1.json | [
{
"docid": "8c7a964d8c420abc1f416c049827c9d0",
"score": "0.7045289",
"text": "def destroy\n @saved_recipe.destroy\n respond_to do |format|\n format.html { redirect_to '/users/' + session[:user_id].to_s, notice: 'Saved recipe was successfully destroyed.' }\n format.json { head :no_content... | [
{
"docid": "5f5b6c6e05c9c2eb62b85555320e5697",
"score": "0.767658",
"text": "def delete\n @recipe = Recipe.find(params[:id])\n @recipe.delete\n render :json => {\n message: \"recipe deleted\"\n }\n end",
"title": ""
},
{
"docid": "c912de81e2b36a2c072806955e886093",
"sco... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "658acef2630214761552c0203cae6090",
"score": "0.0",
"text": "def set_rollcage\n @rollcage = Rollcage.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;... |
fec6825ef125b754556818fb4f10237d | GET /temazos/1 GET /temazos/1.json | [
{
"docid": "44cf81034ea58cc01bcf56bea6975d23",
"score": "0.625196",
"text": "def show\n @temazo = Temazo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n end\n end",
"title": ""
}
] | [
{
"docid": "4063bc1c2414a108fb9c8fe84918326e",
"score": "0.7006658",
"text": "def show\n @terapia = Terapia.find(params[:id])\n @terapias = Terapia.all(:order => \"created_at desc\", :limit => 5)\n @title = @terapia.nombre_corto\n \n respond_to do |format|\n format.html # show.html.e... |
f2da6a16fe4d6ac3603845b25cbcd08e | Retrieve the value for the "DeleteMarker" output from this Choreo execution | [
{
"docid": "6fcba0a80e362998814fe8ea947c9c18",
"score": "0.7654278",
"text": "def get_DeleteMarker()\n \t return @outputs[\"DeleteMarker\"]\n \tend",
"title": ""
}
] | [
{
"docid": "0a03d3f03a8dbccbdce186834007d323",
"score": "0.77486384",
"text": "def delete_marker\n data[:delete_marker]\n end",
"title": ""
},
{
"docid": "1e2a28079adb704213d6ca17eaebbe3c",
"score": "0.76110387",
"text": "def get_DeleteMarker()\n \t return @outputs[\"De... |
21c7bd9a9b21acd888902313211ef6a3 | S3 already wraps the ETag around quotes | [
{
"docid": "47daec11f8beea47beef25394cb3c94e",
"score": "0.6251571",
"text": "def format_etag(etag)\n etag\n end",
"title": ""
}
] | [
{
"docid": "1b863c281aa91c92f48516cd5508283b",
"score": "0.67868173",
"text": "def etag\n '\"' + Digest::SHA1.hexdigest(@contents) + '\"'\n end",
"title": ""
},
{
"docid": "a53366e32a733ede775c8a74552867df",
"score": "0.6717084",
"text": "def etag\n end",
"title": ... |
7c69afe7aad3fb8ffed0a57f50800c6c | datetime Line item updated at | [
{
"docid": "420103d91519c90db452438b7c408eeb",
"score": "0.6835753",
"text": "def updated_at\n @attributes[:updated_at]\n end",
"title": ""
}
] | [
{
"docid": "e16be4cd3690b2ec40635ff78c0b2e7a",
"score": "0.7248667",
"text": "def date() updated; end",
"title": ""
},
{
"docid": "c785ebca0572b6b068a9a6f23669ccf0",
"score": "0.71950644",
"text": "def updated_at\n datetime\n end",
"title": ""
},
{
"docid": "30... |
aa6da677deaaf0ec3b5b7f7ca47de284 | Returns a list of forums a user has been active on. | [
{
"docid": "4fa948e4a8b54d0d35cb302af47d18e8",
"score": "0.66027457",
"text": "def listActiveForums(*args)\n options = args.last.is_a?(Hash) ? args.pop : {}\n response = get('users/listActiveForums', options)\n end",
"title": ""
}
] | [
{
"docid": "a6068de40fa084981a979cd65632f98f",
"score": "0.72558576",
"text": "def forums\n @forums ||= retrieve_forums\n end",
"title": ""
},
{
"docid": "add2386d6236b9f29bb1a39a4124ba20",
"score": "0.7192312",
"text": "def list\n @forums = Forum.find( :all ) \n end",... |
f3fb9b66ea6984ab39ff55e2d94dbb50 | This method is meant to be as compatible as possible to the FmriStudy API; NYI: any options! | [
{
"docid": "199725800891aaab72ceeddf64b0b225",
"score": "0.0",
"text": "def list_sessions(options = {})\n all_sessions\n end",
"title": ""
}
] | [
{
"docid": "20efc55da65b42c82abad7aff43776dd",
"score": "0.55032736",
"text": "def specific_data\n\t\t\t\t\traise \"Method not implemented.\"\n\t\t\t\tend",
"title": ""
},
{
"docid": "7e3ba0c964792c985596b60d375269eb",
"score": "0.53827506",
"text": "def self(options = {}",
"titl... |
bb18b3d1dc67c5e0ff6d29938d8ad177 | ============== = Properties = ============== | [
{
"docid": "823ac78e8941bf8b68e3cc87fbfb0b58",
"score": "0.0",
"text": "def moreInfoButton\n @moreInfoButton ||= begin\n moreInfoButton = UIButton.buttonWithType(UIButtonTypeCustom)\n moreInfoButton.backgroundColor = UIColor.blackColor.colorWithAlphaComponent(0.7)\n moreInfoButton.font... | [
{
"docid": "fe704db3d40ab3204f14f147617fc26f",
"score": "0.87489915",
"text": "def properties; end",
"title": ""
},
{
"docid": "fe704db3d40ab3204f14f147617fc26f",
"score": "0.87489915",
"text": "def properties; end",
"title": ""
},
{
"docid": "fe704db3d40ab3204f14f147617f... |
7605acc6918fbdadfa23d40aa918e7b8 | Optimize file from src to dst, return boolean representing success status | [
{
"docid": "5157b43418d0d8a78206e9fa2f8c1ba8",
"score": "0.7827483",
"text": "def optimize(src, dst)\n execute(bin, *command_args(src, dst)) && dst.size? && dst.size < src.size\n end",
"title": ""
}
] | [
{
"docid": "1a1ab996e3b57205c86a959dfff43565",
"score": "0.6361028",
"text": "def optimize!\n puts \"FILE ALREADY OPTIMIZED\" if get_missing_settings.empty?\n return true if get_missing_settings.empty?\n File.open(new_file_path, 'w') do |fo|\n get_missing_settings.each { |settings| fo.puts... |
e500f174f821ed1c234adb6d15b89bed | Supplies information common to all services of a claim | [
{
"docid": "00b780450e14db7f72ed4df56545c5a4",
"score": "0.5390744",
"text": "def claim_payment_information\n clp_elements = []\n clp_elements << 'CLP'\n clp_elements << patient_account_number\n clp_elements << claim_type_weight\n clp_elements << eob.amount('total_submitted_charge_for_cla... | [
{
"docid": "da366e787b6347bd7cca5aa7e1d665f8",
"score": "0.6106018",
"text": "def service_payment_information(eob = nil,service = nil,check = nil,is_claim_eob = nil,payer = nil)\n @service = @service.nil?? service : @service\n ['SVC', composite_med_proc_id, @service.amount('service_procedure_char... |
f4a1b0fc016d5d08b9477e2ebdc4f980 | Return the number of objects cached in the registry. | [
{
"docid": "c6fb980add569efda52b2d1af6faf3b3",
"score": "0.6736185",
"text": "def size\n @objects.size\n end",
"title": ""
}
] | [
{
"docid": "85872367927bd596a2055cb535433573",
"score": "0.74885285",
"text": "def count_objects\n count = 0\n @objects.keys.each do |key|\n count += @objects[key].length\n end\n\n return count\n end",
"title": ""
},
{
"docid": "35d436a76a98cd8392bc0f096f351942",
"score... |
fdd4e3fc52c63e19a003ccc871480f41 | PM performance during the whole benchmark period is for internal usage only | [
{
"docid": "01973ae7db168d98e4b097668d277bff",
"score": "0.59846044",
"text": "def pm_performance\r\n if Pmp.count == 0\r\n\t\t\tflash[:notice] = \"Portfolio managers haven't been trained.\"\r\n\t\t\treturn\r\n end\r\n \t\t\r\n # Adjusted half year T-bill rate TODO: get from historical rfr t... | [
{
"docid": "171abde0e87275d4f5d6bb3e812da47b",
"score": "0.71584225",
"text": "def bench_performance\n if ENV['BENCH']\n validation = lambda { |ranges, times|\n count_per_second = ranges.last / times.last.to_f\n assert count_per_second > 100_000, 'Count per second: %.2f' % count_pe... |
909e575648e95a9e7fb01c8ddeff37d2 | visible bell (may not move cursor) | [
{
"docid": "8a690f62c039ed7db8880821cfda33d5",
"score": "0.0",
"text": "def flash_screen\n Kernel.raise NotImplementedError\n end",
"title": ""
}
] | [
{
"docid": "63bddba5031838618ff47caff0d92b92",
"score": "0.69407636",
"text": "def cursor_visible\n configure insertbackground: '#ddd',\n insertborderwidth: 1\n end",
"title": ""
},
{
"docid": "f131b65544e06c0174727ec0b0233767",
"score": "0.66354334",
"text": "... |
edf26f1089484bb7c8a8234b262a1299 | Read a 'virtualization.VmwareDistributedNetwork' resource. | [
{
"docid": "5477d4e2488c01b08417a02eed0874f0",
"score": "0.52955145",
"text": "def get_virtualization_vmware_distributed_network_by_moid(moid, opts = {})\n data, _status_code, _headers = get_virtualization_vmware_distributed_network_by_moid_with_http_info(moid, opts)\n data\n end",
"tit... | [
{
"docid": "df95919af42e3be348705d2e76aa0513",
"score": "0.5588246",
"text": "def get_network(network_id)\n get(\"cloud-instances/#{guid}/networks/#{network_id}\")\n end",
"title": ""
},
{
"docid": "21338d3bb499769d3677a1e4f2e6f78a",
"score": "0.55864006",
"text": "de... |
04a905e6dffa555eec0710548693b4b3 | number of divisors: nth / 2 must greater than 500 | [
{
"docid": "fb4720193dd101cbe7ae663b14817fbf",
"score": "0.6274182",
"text": "def triangle_num\n num = 0\n i = 1\n while (num_of_divisors num) < 500\n # get triangle number\n num += i\n i += 1\n end\n num\nend",
"title": ""
}
] | [
{
"docid": "1133588cd93d3db2cbbd2c8dcdba35a8",
"score": "0.81018925",
"text": "def divisors(n)\n (1.upto(n ** 0.5).select { |d| (n % d).zero? }.size * 2) - 1\nend",
"title": ""
},
{
"docid": "3aa9be6ee507ed5e07580c30b7cf6f34",
"score": "0.7842035",
"text": "def number_of_divisors\n ... |
552870489dfad17c66940269b451c40b | Render the Glider pattern with inlined size and position attributes This trick brought to you by Firefox's suboptimal SVG renderer. | [
{
"docid": "0f13d9eb2eb9b2e57b05c5fe3b3a13c6",
"score": "0.6298454",
"text": "def glider_svg(**opts)\n\t\tgb = Builder::XmlMarkup.new(indent: 2)\n\t\tscale = opts[:scale] || 48\n\n\t\tgliders = Tomlrb.load_file(\"data/glider.toml\", symbolize_keys: true)\n\n\t\tgb.svg(\n\t\t\txmlns: \"http://www.w3.org/... | [
{
"docid": "385366e1b9e619e6fdffc342143ac49d",
"score": "0.5941807",
"text": "def render_direct(xfrag)\n \n\n # calculate scaling factors\n range_options_x = parent.get_global_option(:scaling_x,:auto)\n rx = parent.modelgroup.effective_range_x(range_options_x)\n\n return unless rx... |
0cde9a5f3ad1e4b7d192204978593c0a | Sets the compliantAppsList property value. List of apps in the compliance (either allow list or block list, controlled by CompliantAppListType). This collection can contain a maximum of 10000 elements. | [
{
"docid": "ddd87ef419a428a0d1dc4c7c7bcc0a96",
"score": "0.86824846",
"text": "def compliant_apps_list=(value)\n @compliant_apps_list = value\n end",
"title": ""
}
] | [
{
"docid": "c545d08501e7d0a6c5e483f57a948287",
"score": "0.7279902",
"text": "def compliant_apps_list\n return @compliant_apps_list\n end",
"title": ""
},
{
"docid": "c545d08501e7d0a6c5e483f57a948287",
"score": "0.7279902",
"text": "def compliant_apps_list\n... |
4b9e11f18124d0d0f068a7e46c18b087 | Attempt to make an I18n translation, but return `true` or `false` if no translation found | [
{
"docid": "a3da266a3bf3c2b22d1f6abafac2cf3f",
"score": "0.55114466",
"text": "def translate_boolean(boolean)\n I18n.translate!(boolean)\n rescue I18n::MissingTranslationData\n boolean.to_s\n end",
"title": ""
}
] | [
{
"docid": "b47d445398c8248076c3f282fe24accb",
"score": "0.71864593",
"text": "def translated?\n return false if obsolete? || fuzzy?\n not untranslated?\n end",
"title": ""
},
{
"docid": "d1bcac2b1d23ee7fa41ad885b92805cb",
"score": "0.70589423",
"text": "def translated?(... |
843c8e882a7bbe4722505628cc0ff4d3 | Standardized variables queried from +y_field+. | [
{
"docid": "511322ce411933d0e400ff737be538f2",
"score": "0.81472576",
"text": "def y\n @y ||= SpatialStats::Queries::Variables.query_field(@scope, @y_field)\n .standardize\n end",
"title": ""
}
] | [
{
"docid": "2e12a347f97f6e7427162848e3355a8f",
"score": "0.6716391",
"text": "def x\n @x ||= SpatialStats::Queries::Variables.query_field(@scope, @field)\n .standardize\n end",
"title": ""
},
{
"docid": "2499fb5a3e68d150f88a7f16e407b5... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "03786c734c22491e6fce261d98e3d7d9",
"score": "0.0",
"text": "def human_tribe_params\n params.require(:human_tribe).permit(:name, :abilities, :history_and_culture, :geographic_area_id, :skills_and_professions, :appearance, :alliances, :enemies, :trade_and_commerce, :political_structure, :... | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74968386",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6958337",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
f4d4759813616e94bed39ef23bf8b663 | my_method3(c: 'test', x: 1,y: 2,z: 100,a: 42) | [
{
"docid": "df830a6c07e998fcb688470f91e0ef10",
"score": "0.6352338",
"text": "def my_method4(**args)\r\n p args\r\nend",
"title": ""
}
] | [
{
"docid": "28ebaed446e5baa66ccc69689b58c8bc",
"score": "0.8012039",
"text": "def method(a,b,c)\nend",
"title": ""
},
{
"docid": "1ad5c1bde48a1ec53411536a207d3d7d",
"score": "0.78884643",
"text": "def method ( a ,b ,c ) \nend",
"title": ""
},
{
"docid": "7d40ec8e5f4f68813... |
ed520029a8f322d38b053d8e1dd16fd3 | PUT /invitations/1 PUT /invitations/1.json | [
{
"docid": "d39a950b27f9de3a91e03dc513da4a47",
"score": "0.70071346",
"text": "def update\n @invitation = Invitation.find(params[:id])\n\n respond_to do |format|\n if @invitation.update_attributes(params[:invitation])\n format.html { redirect_to @invitation, notice: 'Invitation was suc... | [
{
"docid": "5bdb04f9fbea0d2f9de16576761098a2",
"score": "0.74240243",
"text": "def update\n invitation = invitable.find(params[:id])\n respond_to do |format|\n if invitation.update(invitation_params)\n format.json { render json: invitation, status: :ok }\n else\n format.jso... |
454ab096d839a09fae2987bf2e07149d | return the the COMMENT property which will be an array of instances of RiCal::PropertyValueText [purpose (from RFC 2445)] This property specifies nonprocessing information intended to provide a comment to the calendar user. see RFC 2445 4.8.1.4 pp 8081 | [
{
"docid": "13a08feef0b9d504e2029905b8c022a1",
"score": "0.7654149",
"text": "def comment_property\n @comment_property ||= []\n end",
"title": ""
}
] | [
{
"docid": "586d5ac841a08aea4fd17ee7897720f8",
"score": "0.78495383",
"text": "def comment\n comment_property.map {|prop| prop ? prop.ruby_value : prop}\n end",
"title": ""
},
{
"docid": "586d5ac841a08aea4fd17ee7897720f8",
"score": "0.78495383",
"text": "def comment\n ... |
a2ec4db7b0985dd7e2c8705f3f259950 | Calls the after load callback | [
{
"docid": "ec441822536b27ff1d15d69528f4620c",
"score": "0.80046606",
"text": "def after_load!\n @after_load.call unless @after_load.nil?\n end",
"title": ""
}
] | [
{
"docid": "e692d597bade15ce04caffb430d5220b",
"score": "0.82482547",
"text": "def post_load\n \n end",
"title": ""
},
{
"docid": "462f660db193e8894824ce01a14e88fd",
"score": "0.80938685",
"text": "def during_after_load; end",
"title": ""
},
{
"docid": "b5ec5d207417d9... |
194009ac8683a1511ee39875e4370236 | This method is to edit, which we are not gonna use here. | [
{
"docid": "c150baf15b71cfeba422d7d06fdd2957",
"score": "0.0",
"text": "def edit\n #@logins = Login.all\n session[:userName] = nil\n session[:id]= nil\n redirect_to(:controller => \"logins\", :action => \"index\")\n #logout();\n end",
"title": ""
}
] | [
{
"docid": "2c1cd84ad68a2dd16afba470e9c7f5e7",
"score": "0.8143636",
"text": "def edit\n #defunct. not in use\n end",
"title": ""
},
{
"docid": "03269b7353e60e7e373ef0b15969a043",
"score": "0.8035564",
"text": "def edit() end",
"title": ""
},
{
"docid": "03269b7... |
297c5f5d9a732d78e6daee47bdefb65f | def collection_currency card_prices = [] current_user.cards.each do |card| next if card.usd_price.nil? price = reformat(card.usd_price) if card.quantity > 1 card_prices << Money.new((price.to_i card.quantity).to_i) else card_prices << Money.new(price) end end card_prices.inject(:+).format end | [
{
"docid": "0cf2363dadc91e21ec3f5bc7e309e0cb",
"score": "0.9274489",
"text": "def collection_currency\n card_prices = []\n current_user.cards.each do |card|\n price = remove_dot(card.usd_price)\n card_prices << Money.new(price) * card.quantity \n end\n # call `format`\n card_pri... | [
{
"docid": "251308445e0a5b143ce39fb516610baf",
"score": "0.71376354",
"text": "def format_price(user, card)\n if current_user && Card.last(user_id: user.id, scryfall_id: card['id'])\n multiply_quantity(user, card)\n else \n json_price(card)\n end \n end",
"title": ""
},
{
... |
152b6d1b1bfc1e0be860809039825f53 | When using lazy combination, the adjacency list graph representation may have duplicate clusters, or clusters which have already been swallowed by a larger one. `cluster_set` returns only the most current, highest level graph nodes | [
{
"docid": "f69106cddd41cd0ae0014935e4a90c5d",
"score": "0.7456022",
"text": "def cluster_set\n clusters = Set.new\n clusters << @final_cluster if @final_cluster\n @adjacency_list.each do |cluster_tuple, priority|\n cluster_tuple.each do |cluster|\n cluster... | [
{
"docid": "ed86e60bdea1ef93b86bae1931eb1b78",
"score": "0.64874196",
"text": "def cluster(relevant_nodes, nodes, num_of_clusters)\n nodes.each_key do |a|\n relevant_nodes.each do |b|\n if find(a, nodes) != find(b, nodes)\n union(a, b, nodes)\n num_of_clusters -= 1\n end\n ... |
b7fa357d77e5c5c1fd2afbae2fa09afe | Determine if message is a "leave" message (xxx left the room) | [
{
"docid": "c5ac2934a9e9f3a26dd1e7d9c7291231",
"score": "0.8938857",
"text": "def is_leave?\n type == 'LeaveMessage'\n end",
"title": ""
}
] | [
{
"docid": "78c7664d02d051e6ba806cc3e3cee7d5",
"score": "0.6964213",
"text": "def local_leave(body)\n room = body.dup\n room = @var[:room] unless room.length >= 1\n room_hash = MD5::digest(room)[0,8]\n room_hash = EMPTY_ROOM if room == 'chat'\n unless room == 'chat'\n @connection.room_names.dele... |
22949905e6708ac8257be246561c014c | STRETCH word_count takes in a string counts how many times a word appears in a string ignores case ignores characters that are not in the sequence az returns a hash with all the words and their counts | [
{
"docid": "9779e11f2770b79cf1da8b6437ca1fd4",
"score": "0.0",
"text": "def word_count(sentence)\n word_counts = {}\n sentence.split(\" \").each do |word|\n word = word.downcase.gsub(/[^a-z]/i, \"\")\n if word_counts[word].nil?\n word_counts[word] = 1\n else\n word_count... | [
{
"docid": "ea0310df18126497a82e115000835d48",
"score": "0.83520913",
"text": "def count_words_hash_create(string)\n res = Hash.new(0)\n string.downcase.scan(/\\w+/).map{|word| res[word] = string.downcase.scan(/\\b#{word}\\b/).size}\n return res\nend",
"title": ""
},
{
"docid": "94b977cb5... |
c18f7337894707c74159be1ffbb22576 | merge default options and options from _config.yml turn into string with named args, e.g. fig.width=10 | [
{
"docid": "ffd24e295c642beb5fcf463b16769ea2",
"score": "0.6314706",
"text": "def options\n opts = { \"root.dir\" => nil,\n \"fig.show\" => \"hold\",\n \"fig.path\" => \"#{@config['destination']}figures/\",\n \"fig.width\" => 10,\n \"fig.height\" => 7,\... | [
{
"docid": "ec2e75df8a267fbbc577e5524d71c5ac",
"score": "0.64653665",
"text": "def configure_with_args(args)\n args.select { |k,v| DEFAULT_CONFIGURATION_OPTIONS.keys.include?(k) }.each do |key,val|\n instance_variable_set \"@#{key.to_s}\", val\n end\n end",
"title": ""
},
{
... |
6eca7a004314e0949d3ae988f9fb76df | Is it confusing how I use until and while? Is there a way for me to write this more consistently? It feels like I'm working it out in what may be an idiosyncratic way. It's not that it's idiosyncratic. I use until interval > bank.size because interval has not been converted to an index. It is being used for another pur... | [
{
"docid": "eec55bcf06cfa7ac5958e734085a9963",
"score": "0.643706",
"text": "def toggle_sequence(bank)\n interval = 1\n\n until interval > bank.size\n position = interval - 1\n\n while position < bank.size\n bank[position] = !bank[position]\n position += interval\n end\n\n if int... | [
{
"docid": "dab4011ae1c17681a9639d3b5ab09d47",
"score": "0.5997171",
"text": "def using_until\n levitation_force = 6\n until levitation_force == 10\n puts \"Wingardium Leviosa\" \n levitation_force += 1\n\tend\nend",
"title": ""
},
{
"docid": "75606f85312bdc29ec30b2b230e931d8",
"... |
7e4ad16d2b10db10a161d029ff972c9e | Adds a new item to a plan | [
{
"docid": "d155d62a3cba527386ddf72277e98ae3",
"score": "0.68013215",
"text": "def create_plan_item(plan_id,\r\n body,\r\n idempotency_key = nil)\r\n # Prepare query url.\r\n _path_url = '/plans/{plan_id}/items'\r\n _path_url = APIHelper.app... | [
{
"docid": "25d0104e1f360ad00cea43b525df3bbd",
"score": "0.70174533",
"text": "def add_item(new_item)\n item = Item.new(new_item)\n items.push(item)\n end",
"title": ""
},
{
"docid": "da3fe2c43815d8ee08d4edeef40172e8",
"score": "0.69946676",
"text": "def add_item(new_item)\n ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "392805ac95b48d66a82d381848426b72",
"score": "0.0",
"text": "def set_checkin\n @checkin = Checkin.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60322535",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6012846",
"text": "de... |
929479841502629658083210d2e5d4f8 | What does the roll method do? | [
{
"docid": "5030b50f5133b0458fe6657896285fe6",
"score": "0.0",
"text": "def roll \n @labels[rand(@labels.length) + 1]\nend",
"title": ""
}
] | [
{
"docid": "c520555b7f4b5433edad532b6565652d",
"score": "0.8391541",
"text": "def roll\n value\n end",
"title": ""
},
{
"docid": "73bd10acbb2128cec9dd9011e5eab774",
"score": "0.82541674",
"text": "def roll!\n roll(true)\n end",
"title": ""
},
{
"docid": "7... |
11b7b92f3a57b4f8406d24109d6a751e | Returns whether the cache has been modified since being loaded. | [
{
"docid": "6f17c2f8e97f97f265910edf42c41afa",
"score": "0.0",
"text": "def dirty?\n @is_dirty\n end",
"title": ""
}
] | [
{
"docid": "35da964502fc37857a94ed0c2b167e66",
"score": "0.9044535",
"text": "def has_been_modified?\n mtime > cache_mtime\n end",
"title": ""
},
{
"docid": "37c314297c5a621e14a12cc5a2c67dae",
"score": "0.7887408",
"text": "def modified?\n resources_loaded? && (@dirty || @mo... |
6e4e64da7c8d06cf7c2449b58f84d004 | Calculates lines required for part. | [
{
"docid": "3bd34acd281631a149849bdcffbafe96",
"score": "0.7966347",
"text": "def calc_part_lines(part)\n\n # Initialize to number of lines of part name, description, and process specification.\n blocks = 0\n lines = 0\n [:part_name, :part_description, :process_specification].each do |proper... | [
{
"docid": "7319191bcd1c73f24c9cd686f6717ba5",
"score": "0.6508797",
"text": "def calc_part_height(part, has_effective_date, has_confirmation_message, text_remarks_length)\n return 1.45 + (has_confirmation_message ? 0.25 : 0) + (has_effective_date ? 0.375 : 0) + self.calc_part_lines(part) * @line_hei... |
beb90f096d78986818e29d14d1a19759 | Create a +Procfile+ entry. | [
{
"docid": "6c128a30faf4ffff7060f8802a7b827d",
"score": "0.0",
"text": "def []=(name, command)\n delete name\n\n @entries.store name, command\n end",
"title": ""
}
] | [
{
"docid": "6a49c6973ded6af4dcacb27cb6c61982",
"score": "0.6699459",
"text": "def init\n path = File.expand_path('./Procfile')\n if File.file?(path)\n raise Error, \"Procfile already exists at #{path}\"\n else\n template_path = File.expand_path('../../Procfile.template', __F... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "5d315ea09a2263c36392139e46727d81",
"score": "0.0",
"text": "def wanted_item_params\n params.require(:wanted_item).permit(:user_id)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7495027",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.69566035",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
a9bf48c1537c8f067f4b43067372e5d8 | The ID of the `Project` containing this table. | [
{
"docid": "7e3316686ca2a308e0a5cb6c12433d35",
"score": "0.83564633",
"text": "def project_id\n return reference.project_id if reference?\n @gapi.table_reference.project_id\n end",
"title": ""
}
] | [
{
"docid": "5c88cbd3f1a653b05a695fbd3526d51e",
"score": "0.8777184",
"text": "def project_id\n @gapi.table_reference.project_id\n end",
"title": ""
},
{
"docid": "5bb1d8aaa32a4e4bc56bfcfdf6424765",
"score": "0.87202126",
"text": "def project_id\n @gapi.table_refe... |
c4136ccd2a4406e3291f1e7a59417c24 | Evaluate given block in context of base class, so that you can write class macros here. When you define more than one +included+ block, it raises an exception. | [
{
"docid": "1520c5a2b28c05c8f645eb6592d7ffc6",
"score": "0.69857746",
"text": "def included(base = nil, &block)\n if base.nil?\n if instance_variable_defined?(:@_included_block)\n if @_included_block.source_location != block.source_location\n raise MultipleIncludedBlocks\... | [
{
"docid": "91f53dab4d7c579dd11697c606136dc7",
"score": "0.6333361",
"text": "def when_inherited(&block)\n @cautious_inherited_block = block\n end",
"title": ""
},
{
"docid": "806d2dca2df9eedb4bff2718b7afb65f",
"score": "0.62739456",
"text": "def block(block)\n @components[:__... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "6c106d457ed51601955f7fc5021f0e11",
"score": "0.0",
"text": "def set_gadget\n id = params[:id].split(\"-\").last\n @gadget = Gadget.find(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;... |
0e40dc7236ff305fb7de74816bc35120 | DELETE /product_categories/1 DELETE /product_categories/1.json | [
{
"docid": "647050f8e18837c0b4a3fa98955c57f2",
"score": "0.0",
"text": "def destroy \n \n if has_order_associated\n respond_to do |format|\n format.html { redirect_to product_categories_url, notice: 'Não é possível remover a categoria pois há produtos da mesma que estão associados a... | [
{
"docid": "305852c0d9654ae13e0f30b2130a5aeb",
"score": "0.7573966",
"text": "def destroy\n @product_cat = ProductCat.find(params[:id])\n @product_cat.destroy\n\n respond_to do |format|\n format.html { redirect_to product_cats_url }\n format.json { head :no_content }\n end\n end",... |
90ace70c3269f8b86a1065c10763a72f | DELETE /schooldata/1 DELETE /schooldata/1.json | [
{
"docid": "99c400924f4639cab07f78fea0c10617",
"score": "0.7213898",
"text": "def destroy\n @schooldatum.destroy\n respond_to do |format|\n format.html { redirect_to schooldata_url, notice: 'Schooldatum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
... | [
{
"docid": "7756cea176591c4a479f61cf6d4a17d3",
"score": "0.72852886",
"text": "def destroy\n @school = School.find(params[:id])\n @school.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},... |
4550b23b35ac08f70be752c75ed3ab1c | repopulate the next n_weeks weeks of posts for this category this handles shuffling, reshuffling, and unshuffling | [
{
"docid": "03144db6c9626314a4cbb38027a8160f",
"score": "0.6226891",
"text": "def repopulate_queue(n_weeks = 2)\n clear_queue\n populate_queue(n_weeks)\n end",
"title": ""
}
] | [
{
"docid": "8bc6a848395a67be262907b4b6618c6f",
"score": "0.6627488",
"text": "def populate_queue(n_weeks)\n n_weeks.times do |i_week|\n schedules.sort_by{|s| s.distribution_time(i_week)}.each do |schedule|\n schedule.schedule_assignments.each do |schedule_assignment|\n\n ... |
6bab480ba469f5eacce945a3de72a7a3 | Public: Useful helper method for tracking GraphQL context data to pass along to the network adapter. | [
{
"docid": "72c72a155e4de460ece892b3a2d6679f",
"score": "0.0",
"text": "def client_context\n # Use static access token from environment. However, here we have access\n # to the current request so we could configure the token to be retrieved\n # from a session cookie.\n { access_token... | [
{
"docid": "0a6d9c12e311864f9ad87e8e23d3a460",
"score": "0.6645614",
"text": "def usage_tracker_context(data)\n self.usage_tracker_context = data\n end",
"title": ""
},
{
"docid": "0a6d9c12e311864f9ad87e8e23d3a460",
"score": "0.6645614",
"text": "def usage_tracker_context(dat... |
0ce4ec0d5a005a34cd74b50baef7a40d | callseq: first => [time_rt, time_lg, data] Returns the first sample in the stream, or nil if the stream is empty It differs from rewind as it always decodes the data payload. After a call to first, sample_index is 0 | [
{
"docid": "597c9cd5ee9d3e9c6a9f29dc7e687a9b",
"score": "0.58911735",
"text": "def first\n\t rewind\n self.next\n end",
"title": ""
}
] | [
{
"docid": "c33c7954f8ae21f43116cc7b89b3687e",
"score": "0.69623077",
"text": "def first_sample_pos(stream)\n @global_pos_first_sample[stream] \n end",
"title": ""
},
{
"docid": "d7a76d952ca648e4abf96b5f663242af",
"score": "0.6632469",
"text": "def first_sample_pos(... |
237d86690b6dcdd72a759d0718cbe9a2 | given a microsoft tenant, a registered application and its secret, and a video teleconference id, this script grabs an oauth2 token for your application and reads the onlineMeetings graph api for the vtc id | [
{
"docid": "02d9817b62e0106a30397312b9c6628d",
"score": "0.5480612",
"text": "def app_only_access_token(tenant, client_id, client_secret)\n token_conn = Faraday.new(\n url: \"https://login.microsoftonline.com/#{tenant}/oauth2/v2.0/token\",\n headers: {\n 'Content-Type' => 'application/x-www-... | [
{
"docid": "8661695e2b78ccb2ef27dbf9222c517c",
"score": "0.61539876",
"text": "def show\n @client = Twilio::REST::Client.new(ENV['ACCOUNT_SID'], ENV['AUTH_TOKEN'])\n unless @room.room_sid.present?\n # create room in twilio\n twilio_room = @client.video.rooms.create(type: 'peer-to-peer',u... |
74ce69c7d4b34cb7293c2f22fb0a5c71 | Discriminator's property name (OpenAPI v3) | [
{
"docid": "5f36219641499d674ae89fef1c017244",
"score": "0.56833136",
"text": "def openapi_discriminator_name\n :'type'\n end",
"title": ""
}
] | [
{
"docid": "7bf591ae16dbcdc29ec2731a87c43bbc",
"score": "0.6999018",
"text": "def descriminator\n @obj['descriminator']\n end",
"title": ""
},
{
"docid": "f6809a5204d52200a13ca8311ad67914",
"score": "0.63500464",
"text": "def property_name\n property.identifing_name\n end... |
58852b05bd9249d8d465e551b6e818b5 | PATCH/PUT /measurement_types/1 PATCH/PUT /measurement_types/1.json | [
{
"docid": "18adf80bacb3f771a5902618c17e0ad8",
"score": "0.7124304",
"text": "def update\n respond_to do |format|\n if @measurement_type.update(measurement_type_params)\n format.html { redirect_to @measurement_type, notice: 'Measurement type was successfully updated.' }\n format.js... | [
{
"docid": "8ae3938017e980ff7855b36086c3054c",
"score": "0.7117422",
"text": "def update\n @measurement_type = MeasurementType.find(params[:id])\n\n respond_to do |format|\n if @measurement_type.update_attributes(params[:measurement_type])\n format.html { redirect_to @measurement_type,... |
9a7cc4c6ee5671fee8fc609f04aa5f47 | Returns the best name possible; in order of preference: nickname real_name generated username with id | [
{
"docid": "6f6daf4a1f8e704366a646b869ecc082",
"score": "0.8457472",
"text": "def best_name_possible\n nickname || real_name || \"user_#{id}\"\n end",
"title": ""
}
] | [
{
"docid": "3a97c1d0824d4db2e1f527ba362b215a",
"score": "0.72067106",
"text": "def best_name\n trading_name ||\n other_trading_name ||\n main_name ||\n legal_name ||\n legal_name2 ||\n \"Name unknown\"\n end",
"title": ""
},
{
"docid": "802246b8a225... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "e50e79d36c27787e12e22deefa64adf3",
"score": "0.0",
"text": "def set_categoria\n @categoria = Categoria.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;... |
f260b0743e3635ff851ba1fb8f391b00 | GET /users/1 GET /users/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "4152fb6556ae83f7cdd6c362f17ad9bf",
"score": "0.8105006",
"text": "def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/users.json\"\t \n ... |
3dee0be2cea7cdaa57c7daf565b94d28 | Checks if an active sender has any workers. A sender doesn't have any workers only in two cases: when it was closed or when all workers crashed. An active sender doesn't have any workers only when something went wrong. Workers are expected to crash when you +fork+ the process the workers are living in. In this case we ... | [
{
"docid": "b65a13166f9618093e6263f906362c09",
"score": "0.7069108",
"text": "def has_workers?\n @mutex.synchronize do\n return false if @closed\n\n if @pid != Process.pid && @workers.list.empty?\n @pid = Process.pid\n spawn_workers\n end\n\n !@closed &... | [
{
"docid": "45eec213df17411ef9fa016ba5672ade",
"score": "0.7091732",
"text": "def check_for_available_workers\n workers >= working_count\n end",
"title": ""
},
{
"docid": "f34d6250075f6b767e09ce294fd07422",
"score": "0.7049544",
"text": "def workers_available?\n @worker.ni... |
3d1c928e117315baad3e9a2ac363011a | GET /scrolls/1 GET /scrolls/1.json | [
{
"docid": "a634abe34e54d5a2a5a0406f5f1a31ac",
"score": "0.7416608",
"text": "def show\n @scroll = Scroll.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @scroll }\n end\n end",
"title": ""
}
] | [
{
"docid": "293dcd7fe2d5c82f6a32704db63de8cd",
"score": "0.71757084",
"text": "def index\n @scrolls = Scroll.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @scrolls }\n end\n end",
"title": ""
},
{
"docid": "616ec68cf595d38681... |
2a72aa061b64ab1775e564ea89c017c1 | returns array in sorted order | [
{
"docid": "93c8132ff04e04b356730cde36171052",
"score": "0.0",
"text": "def using_reverse(array)\narray.reverse\nend",
"title": ""
}
] | [
{
"docid": "8fac982a7d3c3ded9649b2f8013badad",
"score": "0.8184107",
"text": "def get_sorted_array\n @ary.sort\n end",
"title": ""
},
{
"docid": "567f57a43621530952e99bbd654d5ab3",
"score": "0.7785481",
"text": "def to_sorted_array\n sort.collect(&:last)\n end",
"title"... |
5695936a7041aa8943c3e18a20abac64 | GET /headaches GET /headaches.json | [
{
"docid": "5632b0cd68d9946ff139b46a99c0a66f",
"score": "0.7673886",
"text": "def index\n # TODO - this should only be enabled for an admin, no user should ever see everyone's headaches\n @headaches = Headache.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json... | [
{
"docid": "1b60e5104b6ce22828f073ff2890bc70",
"score": "0.6383082",
"text": "def index\n # @coaches = Coach.all\n end",
"title": ""
},
{
"docid": "3301a1178ea67934f0581e9d0a5884d2",
"score": "0.63155174",
"text": "def index\n @coaches = Coach.all\n end",
"title": ""
},... |
43a2b5599667492e8a4b8b0b74b99a52 | Returns the set of movies the user liked | [
{
"docid": "6868e45da1c35f95e5a649aaa7897bc2",
"score": "0.63490176",
"text": "def movies_liked\n REDIS.smembers movies_liked_key\n end",
"title": ""
}
] | [
{
"docid": "30439b0decaaaf7653500c4623ef8e67",
"score": "0.75374836",
"text": "def movies(user)\n movies_he_watched = []\n @training_set.each do |record|\n if record.user == user.to_i\n movies_he_watched.push(record.movie)\n end\n end\n return movies_he_watched\n end",
... |
d3197833d9da06c072b881c02f7b153f | Include various macports patches: I didn't write the macports patches, but they seem to be necessary. Associated discussions: | [
{
"docid": "888c6fbe5b48fdd03b5707406e962d6f",
"score": "0.7799516",
"text": "def patches\n { :p0 => [\n 'http://trac.macports.org/export/61709/trunk/dports/net/ettercap-ng/files/patch-configure',\n 'http://trac.macports.org/export/61709/trunk/dports/net/ettercap-ng/files/patch-src-interfac... | [
{
"docid": "f3fbc93ccb7d50698b1baa169c3c4c0a",
"score": "0.7654889",
"text": "def patches\n { :p0 => [\n \"https://trac.macports.org/export/56498/trunk/dports/print/a2ps/files/patch-contrib_sample_Makefile.in\",\n \"https://trac.macports.org/export/56498/trunk/dports/print/a2ps/files/patch-... |
2de98224df4b2e48cede4095ee292ffb | Kills the realtime thread | [
{
"docid": "e1b0b5075dd81e6b2194964d166ac68c",
"score": "0.71325886",
"text": "def kill\n @queue << nil\n stop()\n Cosmos.kill_thread(self, @process_thread)\n @process_thread = nil\n end",
"title": ""
}
] | [
{
"docid": "b01eadea1155276b3c4bfe9592acd6b1",
"score": "0.8199062",
"text": "def kill\n thread.run\n end",
"title": ""
},
{
"docid": "b01eadea1155276b3c4bfe9592acd6b1",
"score": "0.8199062",
"text": "def kill\n thread.run\n end",
"title": ""
},
{
"docid":... |
7b702097ebaa1839b861fae87fa40d4d | Returns the Impact Studio link for a given user | [
{
"docid": "b4256cf004a6ef40bcf07a5b0701f72a",
"score": "0.5703004",
"text": "def user_profile_link(user)\n link_element(xpath: \"//a[contains(.,'#{user.full_name}')]\")\n end",
"title": ""
}
] | [
{
"docid": "c6ccb10f4c7934c09d49b9e87c29d1ae",
"score": "0.7274229",
"text": "def userhelp_identity_url( user )\n return auto_link( h( user.identity_url ) )\n end",
"title": ""
},
{
"docid": "6ca4779f52d1a2df23e37ae427e66e63",
"score": "0.6608442",
"text": "def user_link(user_id)... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "516e852f481508f78b456a64963af726",
"score": "0.0",
"text": "def set_storage_product\n @storage_product = StorageProduct.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... |
100e0d678469ba4ed97697f199c070cd | GET /requests GET /requests.json | [
{
"docid": "0e4f3e16a2c73e7dc68e969054b6c5aa",
"score": "0.6333824",
"text": "def index\n @requests = Request.all\n end",
"title": ""
}
] | [
{
"docid": "ff35d8a60fdbaad33b71eebbd3c9889b",
"score": "0.71195513",
"text": "def index\n @requests = Request.all\n\n render json: @requests\n end",
"title": ""
},
{
"docid": "cc1985fd610ad530de1d9e3afb35c84c",
"score": "0.6854284",
"text": "def index\n @requests = Request... |
f2de69fc77c951be8f188090ca8fad65 | Overrides `respond_to?` method so as to it will return true when asked for any of term colorizer methods. | [
{
"docid": "9327bcc2b6dde6f3f4f481d461e7e260",
"score": "0.77347064",
"text": "def respond_to_missing?(method, include_private = false)\n term_colorizer_methods.include? method || super\n end",
"title": ""
}
] | [
{
"docid": "fb335efb320f8b0dfafbc40d63305a1f",
"score": "0.6512008",
"text": "def colorize?\n @colorize\n end",
"title": ""
},
{
"docid": "82118d0b24d5eed3eff02b1a14565e79",
"score": "0.6243724",
"text": "def method_missing(method, *args, &block)\n super unless term_colori... |