query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
3750369b2297cfe67f4ec4015cf24d36
Update global firewall status for dfw context Update global firewall status for dfw context
[ { "docid": "20bf866532932842fbfec2d129606e4d", "score": "0.5484602", "text": "def update_firewall_status_with_http_info(context_type, firewall_status, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.update_firewall_status ...\"\n ...
[ { "docid": "68c415d4bcbda613cefb7049d15785a1", "score": "0.63131595", "text": "def update\n @firewall = Firewall.find(params[:id])\n checkaccountobject(\"firewalls\",@firewall)\n respond_to do |format|\n if @firewall.update_attributes(params[:firewall])\n @firewall.send_update\n ...
c373478f0bdb490212c674a0027ae0df
Write a method that converts its argument to weirdcase, where every odd character is lowercase and every even is uppercase, e.g. weirdcase("weirdcase") => "wEiRdCaSe"
[ { "docid": "18966d24ab1fddfa55a3f8981325c751", "score": "0.8115956", "text": "def weirdcase(str)\n (0...str.length).each do |idx|\n if idx % 2 == 0\n str[idx] = str[idx].downcase\n else\n str[idx] = str[idx].upcase\n end\n end\n str\nend", "title": "" } ]
[ { "docid": "768f7ade9433de15c9536c2fa9be4736", "score": "0.81922084", "text": "def weirdcase(str)\n new_str = \"\"\n str.chars.each_with_index do |c, i|\n if i%2==0 #reverse because odd characters have even indices\n new_str += c.downcase\n else\n new_str += c.upcase\n end\n end\n...
d882e5c9ff6591a027d2452e9d348191
GET /draws GET /draws.json
[ { "docid": "98a0d2bfbb2c44f4a06a492f8185a3b3", "score": "0.75680697", "text": "def index\n @draws = Draw.paginate(:page => params[:page], :per_page => 50)\n @winning_draws = Draw.where(:selection => \"WINNER\")\n @draw = Draw.new\n\n respond_to do |format|\n format.html # index.html.erb...
[ { "docid": "5664030b8b867d5785d8b8fab78ed253", "score": "0.6897233", "text": "def show\n @draw = Draw.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @draw }\n end\n end", "title": "" }, { "docid": "66207c1edc37defb8...
00b004c3d266007bba7933aa6148eb5a
Prints the name and count of all the Tracks in the track list
[ { "docid": "dc26a9d7c4b1966cdb321610acbb1daf", "score": "0.8165721", "text": "def printTracksAndCount\n for variable in @tracks do\n puts \"#{variable.name} which has been played #{variable.count} times\"\n end\n end", "title": "" } ]
[ { "docid": "aed20f5835507df51ba4395709fb05a8", "score": "0.7571336", "text": "def print_tracks tracks\n index = 0\n while index < tracks.length\n print_track tracks[index]\n index += 1\n end\n\t# puts('Track title is: ' + track.name)\n\t# puts('Track file location is: ' + track.lo...
f5c0f932f6e46d2009c8b3c943e4047f
Returns the size of the cached value. This could be less than value.size if the data is compressed.
[ { "docid": "6e4e56c11c485728233b32105cbac128", "score": "0.0", "text": "def size\n if defined?(@s)\n @s\n else\n case value\n when NilClass\n 0\n when String\n @value.bytesize\n else\n @s = Marshal.dump(@value).b...
[ { "docid": "7686edd8872a42ba41d900c2677cadfe", "score": "0.78496206", "text": "def cached_size\n cached? ? @cached.size : 0\n end", "title": "" }, { "docid": "838a86d3573ea4d63f794dcd0c786d0b", "score": "0.7695126", "text": "def size_of(key, cache_value)\n # Because ...
5b040dc8fc2ace8e60723681ebd11f27
Title:get_results Description:Get results for a race
[ { "docid": "28e081f75ff8b50878f8c2ebaa16c17f", "score": "0.5892013", "text": "def get_results\n\t\tstage_id = params[:id]\n\t\t\n\t\tresults = Result.get_results('stage', stage_id, {}, true)\n\t\tstage = Stage.find_by_id(stage_id)\n\t\t\n\t\tdata = []\n\t\tresults.each do |ndx, result|\n\t\t\tdata.push(...
[ { "docid": "4e2ce688954b910c305bf2c61f35976a", "score": "0.737727", "text": "def get_results\n\t\trace_id = params[:id]\n\t\t\n\t\trace = Race.find_by_id(race_id)\n\t\tresults = Result.get_race_results(race_id)\n\t\t\n\t\trender :json=>{:results=>results}\n\tend", "title": "" }, { "docid": "...
1b633c4329742762236700a60e6b1f4c
Delegate id to Grit::Commit
[ { "docid": "c4eea99066669b58e711bc7b9566b55f", "score": "0.7307059", "text": "def id\n @grit_commit.id\n end", "title": "" } ]
[ { "docid": "4bd2fd96f84be5d8afc7fabcb501b6ff", "score": "0.7583225", "text": "def commit(id = nil)\n get_object :commit, id\n end", "title": "" }, { "docid": "4bd2fd96f84be5d8afc7fabcb501b6ff", "score": "0.7583225", "text": "def commit(id = nil)\n get_object :commit, id\n end...
de2ee541fd0238cebfa047b8e7ae6df8
Start (or turn off) the Enterprise maintenance mode
[ { "docid": "4a0bef734cf8b316b6605f593439efb3", "score": "0.5473544", "text": "def edit_maintenance_status(maintenance); end", "title": "" } ]
[ { "docid": "f4dbb4e1d8740905d0caaea5e1a4aaff", "score": "0.7259447", "text": "def enter_maintenance_mode\n cmd = _cmd('enterMaintenanceMode')\n _update(_get_role(_path)) if cmd.success\n cmd\n end", "title": "" }, { "docid": "c9d00d20c1566cffc2daaf0f2e707c8d...
5361083a62f5e5b32a328fdeeb519aec
, :address_street, :address_street_number, :address_neighbourhood, :address_city, :address_state, :address_country, :address_cep, :address_phone validates_length_of :address_state, is: 2 validates_length_of :address_country, is: 3 validates_length_of :address_cep, is: 8 validates_length_of :address_phone, within: 10..1...
[ { "docid": "9aae92eba5445cf75b9c6154a94cd211", "score": "0.0", "text": "def initialize(attrs)\n self.id = attrs[:id]\n self.name = attrs[:name]\n self.email = attrs[:email]\n self.address_street = attrs[:address_street] if at...
[ { "docid": "3e828d35c6815aa0717205261c1ec7d6", "score": "0.6933975", "text": "def street_isValid?(street)\n if(street.length < 3)\n false\n else\n true\n end\nend", "title": "" }, { "docid": "caa088df7c03647deb8cfbd941a736d6", "score": "0.6823677", "text": "def validates_len...
ff053def49ff574aebf2d83a4e8f9bff
GET /ficha_ingresos/1 GET /ficha_ingresos/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "940eb6a3c5b2ba386878abfd5da38585", "score": "0.6732813", "text": "def show\n @ficha = Ficha.find(params[:id])\n \n respond_to do |format| \n format.html # show.html.erb\n format.json { render json: @ficha } \n end\n end", "title": "" }, { "docid": "7b...
ddd0d8881afa47ebbb9c4b4bcb17c586
Terminate the specified app.
[ { "docid": "1506f44d771848e8d8fbc1a2d6b2d117", "score": "0.7617514", "text": "def terminate_app(app_id, timeout: nil)\n @bridge.terminate_app(app_id, timeout: timeout)\n end", "title": "" } ]
[ { "docid": "da9aafb4b1d815956b9718a38e69279b", "score": "0.74143726", "text": "def terminate app\n app.perform :terminate\n end", "title": "" }, { "docid": "87f6ce14f8b250263602cde810e39def", "score": "0.67640394", "text": "def close_app\n @bridge.close_app\n end"...
f260b0743e3635ff851ba1fb8f391b00
GET /users/1 GET /users/1.json
[ { "docid": "a6588a8896eb04c960d600cfce79d567", "score": "0.0", "text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user, status: :ok }\n end\n end", "title": "" } ]
[ { "docid": "9f7c735ace683c5c2b12c914cc9ad8a8", "score": "0.77161324", "text": "def get\n users = User.all.as_json\n render(json: users.as_json, status: :ok)\n end", "title": "" }, { "docid": "a95dfe28d6b386aafc5fb53749e84258", "score": "0.75100034", "text": "def user...
73509e56a5de6cc87a6572a30a691076
Calculates the duration of this stream using the time of the first click and the time of the last click.
[ { "docid": "1bc092e969dfb4ac72b626f7622c5f07", "score": "0.7588248", "text": "def duration\n if self.clicks.size > 1\n self.clicks.last.created_at - self.clicks.first.created_at\n else\n 0\n end\n end", "title": "" } ]
[ { "docid": "92abf3ccaec35d0c5e5e43366737d36b", "score": "0.6875012", "text": "def duration\n (@entries.last.time - @entries.first.time) / 1000.0\n end", "title": "" }, { "docid": "4aabf01ed2daf095d82a51c4cf53821e", "score": "0.6711938", "text": "def duration\n track_...
7813dc1ef97c40282f0c89576757a75b
GET /help_requests/1 GET /help_requests/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "23b5e52b44e6fbc83b0b742d5ee390a5", "score": "0.70004886", "text": "def show\n @need_help = NeedHelp.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @need_help }\n end\n end", "title": "" }, { "docid": "7e46df994281bb25e7b9b09233792448", ...
4a815f635f627645250758de130836f9
DELETE /links/1 DELETE /links/1.json
[ { "docid": "3a4d422ac308a775301b5e5249835a56", "score": "0.72376317", "text": "def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }...
[ { "docid": "45db0dd30998091a7c52fa8553fa3637", "score": "0.75310004", "text": "def destroy\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to links_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "7ba6fbe4387588d244d7a76800c926...
21e1d2b38fc1903ed6fcc4d3ea0d834f
GET /vendors/1 GET /vendors/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "9ac693572cd7d6733b98f2d92d9bcd30", "score": "0.7244162", "text": "def show\n @vendor = Vendor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vendor }\n end\n end", "title": "" }, { "docid": "ffc91496019...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "964fb4de496cb38c055db430f33141ab", "score": "0.0", "text": "def movie_person_params\n params.require(:movie_person).permit(:role, :movie_id, :person_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...
6407cf55c4141d088b5c6479b801d9ec
New method : Setup target animation
[ { "docid": "2801dd152509140d8a9ce34aae38e3f1", "score": "0.727999", "text": "def setup_target_anim(target, ary)\n return unless target\n anim_id = target.anim_guard_id # Animation guard\n is_self = target == self # Determine if self\n # -----------------------------------------------...
[ { "docid": "f616abbc97cc03034dd975b2bcf12101", "score": "0.7097976", "text": "def setup_anim\n if $game_temp.one_animation_flag || (@acts[1].nil? && item_in_use &&\n item_in_use.one_animation)\n handler = get_spriteset.one_anim\n size = target_array.size\n xpos = target_array.in...
c7d3f0479a49d6aa713f3f2946ee0039
Mark the article in_active
[ { "docid": "864c0381fcea3bb2cc4c2e6e2342e2f1", "score": "0.7458114", "text": "def mark_in_active\n @status = STATUS[:in_active]\n reset_updated_at\n end", "title": "" } ]
[ { "docid": "16a05fa20aadfaf49a526d84f2a2882b", "score": "0.7201318", "text": "def mark_active\n @status = STATUS[:active]\n @activated_at = DateTime.now()\n reset_updated_at\n end", "title": "" }, { "docid": "18a04dbef766d147bfd7b922dc61f83b", "score": "0.6895535", "t...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "78ef52721dc2e8aea5a051ec2ae8772f", "score": "0.0", "text": "def update!(**args)\n @request_id = args[:request_id] if args.key?(:request_id)\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...
d59178acaa6655f2b33aa25c5d4bd429
Words are any sequence of nonblank characters. You may assume that the input String will always contain at least two words.
[ { "docid": "3706a7f99c1c57cd21987215c5ee264c", "score": "0.0", "text": "def penultimate(string)\n string.split[-2]\nend", "title": "" } ]
[ { "docid": "65a60c3f7912789dcc6502c9aa7269e4", "score": "0.73174953", "text": "def words(string)\n string.split(' ')\n end", "title": "" }, { "docid": "af20a57eb0e8908c6fd55675d6a364b1", "score": "0.7135184", "text": "def split_words\n @words.downcase\n .split(/\\W/)\...
47e1710e75fdf9d7d20cc5ac5d2d7cbc
Calculate days need to move all cargo.
[ { "docid": "e83f629e379e2d85fa5799492759ce2a", "score": "0.0", "text": "def get_time(cap)\n info = [\"cap = #{cap}\"]\n days = 0\n cargo = 0\n str = \"\"\n @w.each do |v|\n tmp = cargo + v\n if tmp == cap\n days += 1\n str += \"#{v}\"\n info.push(\"Day: #{days}=#{cargo} #{str}\...
[ { "docid": "555d731dc7e24cfffc9f275e5135e5db", "score": "0.69936925", "text": "def cruises_days(cruise)\n if (not cruises_needs_reduction?(cruise) and cruise.start_date and\n cruise.end_date)\n cruise.end_date - cruise.start_date\n else\n cruise.days\n ...
953e74be7ccee25004175f0403e4bfd5
Checks if user already has listing in their wishlist If not, creates a listing & adds adds association to the user
[ { "docid": "40b6ae7b7ec24f72d24cf721c1e22999", "score": "0.61795384", "text": "def add\n\n # checkIfInDatabase = Listing.find_by(domain_id: params[:domainId])\n checkIfInDatabase = User.last.listings.find_by(domain_id: params[:domainId])\n puts checkIfInDatabase\n\n if checkIfInDatabase.nil?...
[ { "docid": "02e18e5b4fc56373a89e5e0c8e014178", "score": "0.72321177", "text": "def add\n user = current_user\n \n item = user.wishlists.create(\n sneaker_id: params[:id]\n )\n if item.valid? && item.save\n flash[:notice] = \"Added to wishlist\"\n ...
2b582983ae6723af9e7ac8e014b0bbb0
GET /okrs GET /okrs.json
[ { "docid": "0164c7c24c98b765a64c7c480fd6c905", "score": "0.7008631", "text": "def index\n @okrs = Okr.all\n\n end", "title": "" } ]
[ { "docid": "4323bc0abf4ce6ba6dadeab7a33d3e5d", "score": "0.6367724", "text": "def index\n @okrs = @user.okrs.active.includes([:objectives => [:key_results]])\n @okr = @okrs.first\n end", "title": "" }, { "docid": "77890e24b58e707afb5a698bd298313e", "score": "0.6136615", "text"...
7ad00ae2435d1b1c22bc24a6d4f3cd3d
=begin EDGECASE! (simplify the expressions first (exponents, mult/division, radicals)) change everything to + so that the subtractions become adding a negative split by + sort so that like terms are next to eachother if the variables are the same, add the coefficients, delete the old terms, insert the new term =end =be...
[ { "docid": "1b29040357d5c7c8ece856b730f40130", "score": "0.7425749", "text": "def add_and_sub_like_terms(expression)\n sorted_terms = sort_by_variables(expression)\n combined_terms_hash = {}\n sorted_terms.each do |term|\n variable = get_the_variable(term)\n coefficient = get_the_coefficient(te...
[ { "docid": "20dd22a967c113af461a61684b5e86dd", "score": "0.7169498", "text": "def add_and_sub_like_terms(expression)\n\tsorted_terms = sort_by_variables(expression)\n\tcombined_terms_hash = {}\n\tsorted_terms.each do |term|\n\t\tvariable = get_the_variable(term)\n\t\tcoefficient = get_the_coefficient(te...
064a250426015db8188daaa160a24b7e
serialize the hash into json and save in a cookie add to the responses cookies
[ { "docid": "5beab8ce240726a0e7736dbd116361a8", "score": "0.6259721", "text": "def store_session(res)\n cookie = WEBrick::Cookie.new(\"__rails_lite_app\", @monster.to_json)\n res.cookies << cookie\n end", "title": "" } ]
[ { "docid": "74b129b6e46ffbb51e2975dcd455d45b", "score": "0.76695627", "text": "def store_hash(res)\n cookie = WEBrick::Cookie.new(\"_rails_lite_app_flash\", @cookie_hash.to_json)\n res.cookies << cookie\n end", "title": "" }, { "docid": "a837bdf2bdd8929c05ac3e1f077d908c", "score":...
394254469850ff5cb35717cfaca15e2b
Returns the body portion of the raw http response.
[ { "docid": "1424fed75287278fd0d90ef2988fa91e", "score": "0.6839554", "text": "def raw_body\n headless? ? @raw.to_s : @body.to_s\n end", "title": "" } ]
[ { "docid": "dfd6d08583f28840707cb535d7d0e7b9", "score": "0.8550078", "text": "def response_body\n @raw_response.body\n end", "title": "" }, { "docid": "5aa714caf74c09dfbc14e42cc9697769", "score": "0.8270886", "text": "def body\n @http_response.body\n end", "title"...
e01634faa13f88f9d8cde5279b2169d1
An item is allowed if it's whitelisted, or if it's not blacklisted.
[ { "docid": "564508c3a1df2850c2d764c9a3c82c71", "score": "0.8318958", "text": "def allow?(item)\n @whitelist.include?(item) || !@blacklist.include?(item)\n end", "title": "" } ]
[ { "docid": "3c4e5c75dc194c6c593dc30f2ee75005", "score": "0.7235757", "text": "def can_be_blacklisted?\n !self.blacklisted?\n end", "title": "" }, { "docid": "1d3bec2301d9adde3786c25edee78202", "score": "0.7028048", "text": "def request_permitted?(item)\n true\n end", "tit...
25079ebeb9f044962f8d8f6a3ebc987a
POST /userdefaults POST /userdefaults.json
[ { "docid": "3c7247e0b9f5aae76fd2e58f595a2316", "score": "0.60098773", "text": "def create\n\t\tif signed_granted?(current_user.id, 'usersdefaults','N')\n\t\t\t@usersdefault = Usersdefault.new(params[:usersdefaults])\n\t\t\t@divems = Divem.all\n\t\t\t@cajas = Caja.all\n\t\t\t@setmas = Setma.all\n\t\t\t@u...
[ { "docid": "d46127f0250e292320223887fd68efff", "score": "0.6548671", "text": "def register_default_values!\n user_defaults.registerDefaults(default_values)\n end", "title": "" }, { "docid": "672c26987822538d0238abdb5c23029b", "score": "0.63684446", "text": "def save_user_pref...
2bee244bb644ce21608c99cd209ce73b
GET /colaborations/1 GET /colaborations/1.json
[ { "docid": "a73ec79dc01a99d71319904c0041008a", "score": "0.7346756", "text": "def show\n @colaboration = Colaboration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @colaboration }\n end\n end", "title": "" } ]
[ { "docid": "d0296984de04818eed62f1d7de26bf16", "score": "0.7281027", "text": "def index\n @collaborations = Collaboration.all\n end", "title": "" }, { "docid": "0145f84d01780b9358f13a6fb8a26af0", "score": "0.7202263", "text": "def index\n @collaborations = Collaboration.wher...
34f9d1a678cbc2a3b912add51dff9c71
Parameterize a string only if it does not contain UTF8 characters
[ { "docid": "0d288b8be823588702c6a024c5cf1866", "score": "0.6945169", "text": "def safe_parameterize(str)\n if str.chars.all? { |c| c.bytes.count == 1 }\n str.parameterize\n else\n # At least change spaces to dashes\n str.gsub(/\\s+/, '-')\n end\n end"...
[ { "docid": "ba302c41c72ab71417d1cdfe89791cec", "score": "0.6724022", "text": "def can_encode?(str, charset: BASIC_CHARSET)\n !str || !!(regex(charset) =~ str)\n end", "title": "" }, { "docid": "e700820e73d5f49fa1cc0b633cc399be", "score": "0.6642433", "text": "def isutf8(str)\n ...
f7dab73124d1a3424f4f9bfa14eb5bb2
Method that retun the full cost of the coffee
[ { "docid": "0c839051050ef5898dc73ee56c470df1", "score": "0.6928091", "text": "def cost\n super + 0.10\n end", "title": "" } ]
[ { "docid": "665352b58ce3bd7d382c3a36333a49c7", "score": "0.7806135", "text": "def cost\n # Todo pull this from the DB\n 1000\n end", "title": "" }, { "docid": "cb7bedaa3ca707a0320140384a69045a", "score": "0.77131206", "text": "def cost\n 1.99\n end", "title": "" ...
adb7220635151e136ea5e26cf43234aa
Determine key=>value entry in StringifyHash, remove both value at String key and value at Symbol key
[ { "docid": "c43c70d6aab08eaa1d70737c6ed4b6f6", "score": "0.5521306", "text": "def delete k\n super(k.to_s) || super(k.to_sym)\n end", "title": "" } ]
[ { "docid": "31d6b167df86feb467aabffb08739542", "score": "0.690882", "text": "def hash_remove_when_starts_with_s(hash)\n hash.delete_if { |key, value| key.to_s[0] == 's' }\nend", "title": "" }, { "docid": "8843b42480bd3ab2d116d5987d817ffe", "score": "0.6766855", "text": "def cleanup_...
017eaa69f2c110460786a9e651b51697
GET /retroaspectos/new GET /retroaspectos/new.json
[ { "docid": "23fc4a1a6185bb7a3a8cb704b0298332", "score": "0.8114554", "text": "def new\n @retroaspecto = Retroaspecto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @retroaspecto }\n end\n end", "title": "" } ]
[ { "docid": "242e0eceddcc17fb36e8264ed6af905e", "score": "0.7411531", "text": "def create\n @retroaspecto = Retroaspecto.new(params[:retroaspecto])\n\n respond_to do |format|\n if @retroaspecto.save\n format.html { redirect_to @retroaspecto, notice: 'Retroaspecto was successfully create...
aa026fadda9599a5a279c600ecbb8830
unique identifier for each contact
[ { "docid": "faa55787ec6812eedce3f4343ab66860", "score": "0.0", "text": "def initialize(first_name, last_name, options = {})\n @first_name = first_name\n @last_name = last_name\n @email = options[:email]\n @notes = options[:notes]\n\n @id = @@id\n @@id += 1\n end", "title": "" } ...
[ { "docid": "836145390c1aef9e0974a1dcc185fff0", "score": "0.69785243", "text": "def contact_id\n attributes[:contact] && attributes[:contact][:contact_id]\n end", "title": "" }, { "docid": "546f98eff114c7e3556eb8336f0ae0b4", "score": "0.69302", "text": "def contact_id\...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "b1217c90f6d335262e4f4ee14627fddb", "score": "0.0", "text": "def section_params\n params.require(:section).permit(:name, :grade_level, :term_id, :period, :subject_id, :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...
a86ee62c9bd40194630ce8e92f1b0433
check if the word is capitalized
[ { "docid": "1c268357e7fd1535e76995af995c497b", "score": "0.87955827", "text": "def is_capitalized?(word)\n return true if word == word.upcase\n return false\n end", "title": "" } ]
[ { "docid": "eef50b3ad882571a5823adefbff13281", "score": "0.8373473", "text": "def detect_capital_use(word)\n var1 = word.upcase\n var2 = word.downcase\n var3 = word.capitalize\n return true if word == var1\n return true if word == var2\n return true if word == var3\n false\nend", ...
5330a3fa266ebceb9bb904cd0399be2b
submit information to create an account
[ { "docid": "0209d3e822395236728709e67463b3d6", "score": "0.0", "text": "def submit\n @@driver.find_element(:id ,'submitAccount').click\n return ConfirmationPage.new(@@driver)\n end", "title": "" } ]
[ { "docid": "22ef608beac60b30a9b1f45fd766cd58", "score": "0.7425376", "text": "def create_account(firstname, lastname, password, cfpassword)\n confirm_create_account_form.cf_firstname_input.set firstname\n confirm_create_account_form.cf_lastname_input.set lastname\n confirm_create_account_form.c...
3bb24326ff565d56516a252427afbc62
CLI get user input for Articles on species (Enter 2 at menu)
[ { "docid": "516dd148e0c36549398b0e4298f11f1e", "score": "0.0", "text": "def make_articles\n EndangeredSpecies::Scraper.new.make_articles\n end", "title": "" } ]
[ { "docid": "780dcd62646d78d1eb21c873d350be98", "score": "0.71849716", "text": "def menu\n puts \"EEG query app\"\n puts \"1: return EEG value\"\n puts \"2: return attention value\"\n puts \"3: return meditation value\"\n gets.chomp\nend", "title": "" }, { "docid": "a6bab17f4a3c379702668...
1c6306ccc545fcfa0d30d55afb76112d
GET /posts/new GET /posts/new.json
[ { "docid": "d77db384f70feee3cadf3a0898103677", "score": "0.0", "text": "def new\n @categories = Category.all\n @post = Post.new\n @user_list = User.order('last_name ASC').all.collect { |user| [user.full_name, user.id] }\n respond_to do |format|\n format.html # new.html.erb\n format...
[ { "docid": "9a65d24456bf206af61094fdc537fdb9", "score": "0.81230724", "text": "def new\n setupForNewPost\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "9d4679d873961b6e74061b6b59a371bc"...
a1e76e00373611ee626a9abb6c6e9f6c
Based on population density, calculates the speed of spread (months it takes to spread across a state)
[ { "docid": "95151946d02cebc972bf881f6b3eb45e", "score": "0.8703939", "text": "def speed_of_spread #in months\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 speed = 0.0\n\n if @population_density >...
[ { "docid": "d15548cc05c9302e41087b61fa1229d5", "score": "0.9105358", "text": "def speed_of_spread #in months\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 speed = 0.0\n\n STATE_FORMULA.each do |s...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "2f78c46c923ac3ef12d517c55a269a9f", "score": "0.0", "text": "def set_company_practice\n @company_practice = CompanyPractice.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...
d5c5ddcf9c1824d62d974424d74fb57d
The root of theme definitions.
[ { "docid": "4b9668d70419edad434533e5d1ab4633", "score": "0.68289965", "text": "def themes_root(path)\n @themes_root = path\n end", "title": "" } ]
[ { "docid": "27879b252b0e726b6227be7e402ad443", "score": "0.67051876", "text": "def initial_definitions\n definitions = Definition::RubyObject.new(\n :name => 'root',\n :type => :root,\n :parents => [RubyLint::VirtualMachine.global_constant('Kernel')],\n ...
d6ab36f839ecb9b785fdba27fc304e88
Lists DeliveryReceiptInstance records from the API as a list. Unlike stream(), this operation is eager and will load `limit` records into memory before returning.
[ { "docid": "7367086ad9ef7e64143cbc29f0dc00e8", "score": "0.0", "text": "def list(limit: T.unsafe(nil), page_size: T.unsafe(nil)); end", "title": "" } ]
[ { "docid": "a9c66823cc6063f85623f1ea34d13e1b", "score": "0.6677797", "text": "def list(limit: nil, page_size: nil)\n self.stream(limit: limit, page_size: page_size).entries\n end", "title": "" }, { "docid": "a9c66823cc6063f85623f1ea34d13e1b", "score": "0.6677797", ...
2a1aa7241f4f74e569947732b0c5ecbf
GET /thetags GET /thetags.json
[ { "docid": "115b366637daec84eb0ab2035949f2ad", "score": "0.6804964", "text": "def index\n @thetags = Thetag.all\n end", "title": "" } ]
[ { "docid": "9d177f96bf2a2dd934c13b30278ded70", "score": "0.80703336", "text": "def tags\n get('tags')\n end", "title": "" }, { "docid": "5c478618c108b7ba12b26d9685e913a4", "score": "0.77547807", "text": "def get_tags_by_url\n url = Url.find_by(id: params[:id])\n tag...
24c485d3edd6ef32f031305c86f82915
The site's search engine: TODO: Figure out how to search on related fields (ProductDocument.product.name)
[ { "docid": "40b547edacf9c2477363ee94ee69932a", "score": "0.67841566", "text": "def search\n @page_title = t('titles.search_results')\n @query = params[:query]\n query = @query.to_s.gsub(/[\\/\\\\]/, \" \")\n ferret_results = ThinkingSphinx.search(\n Riddle.escape(query),\n page: pa...
[ { "docid": "69a47f21141de302947f053ca53ebb13", "score": "0.6667404", "text": "def search\n sort_init 'name'\n sort_update\n \n @search_term = params[:term]\n\n if !@search_term then\n @search_term = session[:last_search_term]\n end\n # Save this for after editing\n session[:...
026872c31e8e576387818fcff22febf6
GET /education_steps/1 GET /education_steps/1.json
[ { "docid": "75573eec6974648269584edca03127ba", "score": "0.74838954", "text": "def show\n @education_step = EducationStep.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @education_step }\n end\n end", "title": "" } ]
[ { "docid": "4ed91ff39ec3a652d06ed6e40daafdfc", "score": "0.7441223", "text": "def index\n @education_steps = EducationStep.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @education_steps }\n end\n end", "title": "" }, { "doci...
2d47dc4ee57770e2a222e9002b377b06
useful for grouping installsection attributes
[ { "docid": "5933ccbf9d96a4e82866e03604b26f89", "score": "0.0", "text": "def install\n yield\n end", "title": "" } ]
[ { "docid": "4347c485ee582f16b38c031673265017", "score": "0.5625974", "text": "def config_sections; end", "title": "" }, { "docid": "58d58d8d3c5b916a58cb1ec72b548dfe", "score": "0.54769576", "text": "def iiif_manifest_attributes\n super.merge iiif_manifest_exhibit\n end", "tit...
e1a471aea4eaadcf1027a2d1445b18e6
prend un pack de vie en fonction du tirage
[ { "docid": "73ad54e776c8de5a8486c63e3fc297b1", "score": "0.0", "text": "def search_health_pack\n use_health_pack = rand(1..6)\n #pas de vie\n if use_health_pack == 1\n puts \"rien ne ce passe\"\n puts \"\"\n #un gros pack de vie verif life ne depasse pas...
[ { "docid": "5a5cf39457a1185f64334a2505dc5d2f", "score": "0.65468615", "text": "def pack(p0) end", "title": "" }, { "docid": "cc69b0f693badc99e2476826a2215d47", "score": "0.64101034", "text": "def pack\n end", "title": "" }, { "docid": "88cfadd26c5b14e685cefbe989d4d2e8"...
573b358e3734b712d62d69fb909259d5
coords is a RedstoneBot::Coords object or an array of numbers. The y value is ignored.
[ { "docid": "42dcf941e4832367d0c66fd6693fd186", "score": "0.0", "text": "def chunk_id_at(coords)\n [coords[0].floor/16*16, coords[2].floor/16*16]\n end", "title": "" } ]
[ { "docid": "1dc29712f64377ccb9490bcebbcab88d", "score": "0.77471566", "text": "def xy=(coords)\n raise ArgumentError if !coords.is_a?(Array) ||\n coords.size != 2 ||\n coords.any? { |c| !c.is_a?(Numeric) }\n @xy = coords\n end", "title": "" ...
14c55d0c56802743dc5b8eadeb1f2cfb
DELETE /reviews/1 DELETE /reviews/1.json
[ { "docid": "de58f83ca11aabc92b4d38b05e2ccfd2", "score": "0.7354971", "text": "def destroy\n @review.destroy\n\n head :no_content\n end", "title": "" } ]
[ { "docid": "841f80fe4ab54e7f152518db2d41a92c", "score": "0.78339803", "text": "def _reviews_delete(id)\n delete id.to_s\n _response_status(204, last_response)\n end", "title": "" }, { "docid": "349db52007f251f9d59ce565fdf20f80", "score": "0.7793395", "text": "def destroy\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "a296d2c4b2b278febcc220048506ee72", "score": "0.0", "text": "def set_guia_despacho_compra\n @guia_despacho_compra = GuiaDespachoCompra.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...
3f0642d02d23aaa28984647bad4860d6
You should implement your methods in this file. Feel free to use the debugger when you get stuck.
[ { "docid": "4b1e4d00aa28a2ce182dbee493685afc", "score": "0.0", "text": "def largest_prime_factor(n)\n def prime?(x)\n if x < 2\n return false\n else\n (2..x-1).each do |e|\n if x % e == 0\n return false\n end\n ...
[ { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.70461094", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.70461094", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a...
90d4c7419ddc3122864058b8ddcd36b5
API operations Make a payment. If the payment is approved the PaymentResponse will be returned. If for any reason the payment is declined or if there is a connection error an exception will be thrown. This will accept a PaymentRequest Hash as defined by getTokenPaymentRequestTemplate(), getCardPaymentRequestTemplate(),...
[ { "docid": "c0b56873a5ec4a321c96b2a235f8e052", "score": "0.684739", "text": "def make_payment(payment)\n transaction_post('POST', make_payment_url, Beanstream.merchant_id, Beanstream.payments_api_key, payment)\n end", "title": "" } ]
[ { "docid": "073bbed7c8cae83cd03d9228569c4548", "score": "0.7021497", "text": "def make_payment! amount, due_at = Time.now\n rack_payment = Rack::Payment.instance.payment\n rack_payment.amount = amount\n rack_payment.credit_card = credit_card # use the encrypted credit card\n ...
978a91d85d0ca3f6c74d65bfa50851cf
Returns a formatted string containing detailed information about this disk.
[ { "docid": "6af8c47529620f7693fc9b163656f8d3", "score": "0.7583157", "text": "def pretty_info\n s = ''\n dev = self.device\n return \"Disk image: #{self.image_path.basename} (na, detached, na)\\n\" if dev.nil?\n return dev.pretty_info\n end", "title": "" } ]
[ { "docid": "3bd617e55e0be9265eee968defffa06e", "score": "0.7226892", "text": "def pretty_info\n volinfo = self.info\n mountpoint = volinfo['MountPoint']\n mountpoint = 'Not mounted' if mountpoint.empty?\n rw = volinfo['WritableVolume'] ? 'writable' : 'read-only'\n ownership = se...
e75471e5a1dba885d69394b166076482
DELETE /responses/1 DELETE /responses/1.xml
[ { "docid": "3aeabb1979818c939af201c4095cfd47", "score": "0.7279832", "text": "def destroy\n @response = Response.find(params[:id])\n @response.destroy\n\n respond_to do |format|\n format.html { redirect_to(responses_url) }\n format.xml { head :ok }\n end\n end", "title": "" ...
[ { "docid": "5923e377dd32d40ec444cbf5cd0e9447", "score": "0.7100648", "text": "def destroy\n @response = Response.find(params[:id])\n @response.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_responses_url, :notice => 'successfully deleted') }\n format.xml { head ...
42b212d7928f3711e44244689e6781ee
Returns item from a list of todos or from a list of lists
[ { "docid": "6cc66394a5a489e7284c20c02c1d2f42", "score": "0.0", "text": "def find_item(idx, list)\n list.find { |item| item[:idx] == idx }\n end", "title": "" } ]
[ { "docid": "7ec415dc6598b4706a3b2f44f5b53f53", "score": "0.691848", "text": "def load_todo(list, id)\n list[:todos].find { |todo| todo[:id] == id }\nend", "title": "" }, { "docid": "ff5b1546ff916d0622aa78bb0aecf763", "score": "0.65560794", "text": "def load_todo(id)\n @list[:todos]...
b3415c7aefa752ab0400a3b33ce7af7f
The contents of the file stored in the blob, broken up into lines.
[ { "docid": "887989a89d1d223b079a7174d2a21782", "score": "0.0", "text": "def data_lines\n @data_lines ||= [\"Subproject commit #{gitid}\".freeze].freeze\n end", "title": "" } ]
[ { "docid": "33793b71101161b89d7897529aed052b", "score": "0.73153496", "text": "def file_content\n self.lines.join\n end", "title": "" }, { "docid": "454d6ee88764bff06d6f4f5164235d34", "score": "0.70795417", "text": "def read_contents\n\t\treturn File.open(self.file_name).read.lin...
14fedb793c7527a020bbfd5096636d3f
Flags (9 bits) (aka Control bits)
[ { "docid": "6cd845cee61caff8340f2b9814988a1a", "score": "0.5643791", "text": "def [](flag)\n bit = { NS: 8, CWR: 1, ECE: 2, URG: 3, ACK: 4, PSH: 5, RST: 6, SYN: 7, FIN: 8 }\n Stream::bit_set?(@binhdr[flag.eql?(:NS) ? 12 : 13], bit[flag])\n end", "title": "" } ]
[ { "docid": "83628f9d56a9ba9d157a4ee1e8c429d9", "score": "0.72968775", "text": "def flags; end", "title": "" }, { "docid": "6613f751f02d642bce2c28e4cb69ea85", "score": "0.72716886", "text": "def flags\n @flags\n end", "title": "" }, { "docid": "6613f751f02d642bce2c...
113fdb1d5bb1d64f054741b0cb9fd980
Implement the 'look and say' function. 'Look and say' takes an input array and outputs an array. The output describes the count of the elements in the input. 11222123 => [2,1], [3,2], [1,1], [1,2], [1,3]
[ { "docid": "7513c5adcfef28c8cf582092176f5ab9", "score": "0.69486684", "text": "def look_and_say(array)\n # Step 0: intialize variables\n result = []\n count = 1\n cur_num = array.first\n \n # Step 1: iterate array\n array.each.with_index do |num, idx|\n # Step 2: next if num ...
[ { "docid": "b6c0597dbb9dd76ef7473ffddf38179b", "score": "0.7593882", "text": "def look_and_say(array)\n output = []\n count = 1\n current = array[0]\n (1...array.length).each do |index|\n if array[index] == current\n count += 1\n else\n output << [count, current]\n current = arr...
986b9ca1764088a7a20520da81f97824
This is main method handle file upload and delete functionality
[ { "docid": "5dd873d5e3d23c6542577084607637fb", "score": "0.66286343", "text": "def handle_file_upload(overrides = {})\n # Clear the cache if indicated but not for an add or delete\n clear_resource_items if overrides[:clear_cache]\n\n initialise_fileupload_variables\n\n # If adding files then...
[ { "docid": "041c1675b36e52dacf0b07540159f134", "score": "0.71492094", "text": "def upload\n end", "title": "" }, { "docid": "041c1675b36e52dacf0b07540159f134", "score": "0.71492094", "text": "def upload\n end", "title": "" }, { "docid": "f5df94d4d910b5f005c075202c3bfa89...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "a878be52567307803d3eb666a2267652", "score": "0.0", "text": "def set_participacao\n @participacao = Participacao.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...
2e9830d14b0baebd7ecc4c86c26fd9bb
attr_accessor :name replaces these methods def get_name
[ { "docid": "3ebd5f886dc0179d8dff72f6c62cc828", "score": "0.0", "text": "def run\n puts \"Hey i'm running\"\n end", "title": "" } ]
[ { "docid": "3ed0615d230e9abeac85dc81631ada30", "score": "0.85550106", "text": "def get_name; end", "title": "" }, { "docid": "8d1c9cb3fc5311ffe8a0ce6a5997692e", "score": "0.8500728", "text": "def get_name\n\treturn @name\nend", "title": "" }, { "docid": "8d1c9cb3fc5311ffe...
656e606f5cd34768aaeee5b426828b47
POST /companies POST /companies.json
[ { "docid": "140dc6a9c35b76d10e087c0a88dc972e", "score": "0.0", "text": "def create\n @company = Company.new(company_params)\n @company.user = current_user\n\n authorize @company\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, success: t('active...
[ { "docid": "ba8e67048804bdf832261e78aabb42f9", "score": "0.77965146", "text": "def create_companies(model) path = \"/api/v2/companies\"\n post(path, model, {}, AvaTax::VERSION) end", "title": "" }, { "docid": "63dc7663332383f54a31f8d5f4a6cc37", "score": "0.76847976", ...
43d10b6b388ef6ee53282138afe9a99b
Perform a shallow clone of this residue
[ { "docid": "650d3ca921cb06f49beee23446d6fece", "score": "0.71264154", "text": "def shallow_clone\n cloned = self.clone\n cloned.remove_relations\n return cloned\n end", "title": "" } ]
[ { "docid": "dff8fbdb0fc858a53a97c76c6c624001", "score": "0.7949445", "text": "def clone\n Marshal.load(Marshal.dump(self))\n end", "title": "" }, { "docid": "dff8fbdb0fc858a53a97c76c6c624001", "score": "0.7949445", "text": "def clone\n Marshal.load(Marshal.dump(self))\n ...
1820ba1764e45cb0dd2059c41e34c5ee
GET /feeds GET /feeds.json
[ { "docid": "937496834f9cc0960bde985d2a8e78d1", "score": "0.6736456", "text": "def index\n @feeds = Feed.all\n end", "title": "" } ]
[ { "docid": "b3d510a24aa62a476241e4f58d6b786d", "score": "0.76903415", "text": "def index\n feed_urls = Feed.all.collect(&:feed_url)\n @feeds = fetch_all_feeds(feed_urls)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @feeds }\n end\n end", ...
4b53b9d5806be39823ac801dad1c5ca4
TODO: Ugly hack, refactor.
[ { "docid": "9c6a904a71ac1c743f1f38685fe15543", "score": "0.0", "text": "def username\n if self.person_id\n person = Person.unscoped.find(person_id)\n person.try :kth_username\n else\n \"\"\n end\n end", "title": "" } ]
[ { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.65170145", "text": "def desired; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.6144186", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",...
ab7fde1a4bbc971e0b449c15b3461d86
Search input for tag
[ { "docid": "332b758b7cad28ef3ed8786377513e60", "score": "0.0", "text": "def tags \n sidebar\n @tags = Tag.joins(:posts).group(\"tags.name\").select(\"tags.id, tags.name, count(posts.id) as\n total_posts\").map { |t| {name: t.name, total_posts: t.total_posts}}\n\n\n tag = params[:tag]\n @p...
[ { "docid": "bddf6b6fd5c73735f00cd854ccbe1690", "score": "0.7458169", "text": "def find(tag); end", "title": "" }, { "docid": "881b285a87405970fc3c0bcd5e01d280", "score": "0.717528", "text": "def tag_search_term\n params[:tag]\n end", "title": "" }, { "docid": "b775b76...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "7603081f120ab61ca7286e609179c024", "score": "0.0", "text": "def set_offert\n @offert = Offert.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60320485", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6013371", "text": "de...
977a4aef8e1c62a0c16d37976a4ebbeb
Test the URL and return the response code
[ { "docid": "5c06254128a792202e737b570141d360", "score": "0.72424203", "text": "def response_code (url)\n\t\tputs \"Check the http response code on the url: #{url}\" if @verbose\n\t\tcode = 10000\t# All unknown url connection exceptions go here\n\t\traise \"Invalid url: #{url}\" unless is_url?(url)\n\t\t...
[ { "docid": "282ebc549333dd20854ce26e2dc5da7a", "score": "0.8170688", "text": "def responseCode(url)\n uri = URI.parse(url)\n http = Net::HTTP.new(uri.host, uri.port)\n if(uri.scheme == \"https\")\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n request = Net::HTTP:...
d4a1edaae4d92d004632cf64501ce2e7
DELETE /users/1 DELETE /users/1.json
[ { "docid": "52ad648f3c5c808937657129d48656c3", "score": "0.0", "text": "def destroy\n @user.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Usuario borrado correctamente.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "be9d8ff5c0124f1d5efc98ec2baa3fc1", "score": "0.7590564", "text": "def test_delete_user\n delete '/users/2'\n data = JSON.parse last_response.body\n\n assert_equal 'Daniel', data['name'], 'Propiedad name incorrecta'\n assert_equal 'Arbelaez', data['last_name'], 'Propiedad last_nam...
40df2994b9589e408df6f5c59d18ff91
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Object Initialize ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ { "docid": "d1158f68f6ea9a965301922e99135fd6", "score": "0.0", "text": "def initialize(event_id = 0)\n @event_id = event_id\n clear\n end", "title": "" } ]
[ { "docid": "fec4ee38380924b06580ebf1137d6d95", "score": "0.8917673", "text": "def initialize\n\t\tself.initializeObject\n\tend", "title": "" }, { "docid": "30db4e5d165a6098d1aeb8f8dd7b66e8", "score": "0.88088745", "text": "def initialize() end", "title": "" }, { "docid": ...
62db53c29f0b90b8a72b54eb6561492e
def validate error.add(:page_width, "must be a greater than zero") if self.page_width and self.page_width < 0 and self.page_width == 0 error.add(:page_length, "must be a greater than zero") if self.page_length and self.page_length < 0 and self.page_length == 0 error.add(:columns, "must be a greater than zero") if self....
[ { "docid": "9586e89f31a4e9074b921d78fc7aba0f", "score": "0.0", "text": "def add_line(label_text)\n label_texts << label_text\n end", "title": "" } ]
[ { "docid": "7b23b37067a9bcf375d11785cb45b72d", "score": "0.68218195", "text": "def valid?\n border_applies_to_validator = EnumAttributeValidator.new('String', [\"AllPages\", \"FirstPage\", \"OtherPages\"])\n return false unless border_applies_to_validator.valid?(@border_applies_to)\n bord...
754cdb6275cf6573b38c4d22ea02b6c5
Find score of best move self could play
[ { "docid": "2dbc7e73fb82537c6839475580787dc4", "score": "0.6542826", "text": "def max(board)\n #Generate moves array\n moves = minmax_moves(board, self)\n #Placeholder for max score, even the worst score is > -2\n max = -2\n #Find terminal and check terminal nodes and delete them from mov...
[ { "docid": "2224b380788590a0a922a988aee52791", "score": "0.7936109", "text": "def most_likely_play\n @must_learn = true\n best_move = nil\n max = 0\n\n search_space = SearchSpace.new(@board, @most_alike_board, @color)\n search_space.each do |move|\n prob = pro...
8e6efecf120355e593f2b4f19db3df3d
Returns true if the account is logging out, false otherwise.
[ { "docid": "e4a88595ea5366c028d5a197cfddf70b", "score": "0.78373665", "text": "def logging_out?\n current_account.present? && controller_name == 'sessions' && action_name == 'destroy'\n end", "title": "" } ]
[ { "docid": "fe33d6730e715872afc62843a3c70481", "score": "0.7238421", "text": "def logged_in?\n !current_account.nil?\n end", "title": "" }, { "docid": "fe33d6730e715872afc62843a3c70481", "score": "0.7238421", "text": "def logged_in?\n !current_account.nil?\n end", "title"...
774c35884ade7d1eb65a23c65c8ee71a
=begin Dada una fecha generada al azar, permite al usuario ingersar una fecha, informando cuales fueron acertadas =end
[ { "docid": "b8061c033a0b7060e1bec95e1a6f0323", "score": "0.5982629", "text": "def adivinarfecha(fecha_control)\r\n puts \"Adivine la fecha, por favor :\"\r\n contador=0\r\n begin\r\n puts \"Ingrese la fecha:\"\r\n fecha_ing=ingresgar_fecha()\r\n acierto_parcial(fecha_ing,fe...
[ { "docid": "94e7897ac5abe9f7ba69f6d2b1cb80f0", "score": "0.6352144", "text": "def arrival_date; return \"\"; end", "title": "" }, { "docid": "fdd3ad48001295a351a6b46e93ac5023", "score": "0.6161736", "text": "def get_date(fecha)\n \nif fecha != nil\n ds = fecha.strftime(\"%w\") #...
e5c6eefe5f1d235a64ffa454e0b823fd
method to access the currently loggedin user "helper_method" means this is available for use in views
[ { "docid": "dfc38341c7fa96644374b0367ff1f67b", "score": "0.0", "text": "def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n end", "title": "" } ]
[ { "docid": "a4c446d69b4431ff18162de282fd4d9a", "score": "0.8473778", "text": "def current_user\n helpers.current_user\n end", "title": "" }, { "docid": "04c3d100240496e5c14d3779bf2eb080", "score": "0.83168006", "text": "def current_user_helper\n @current_user ||= User.find_by(...
d4da0b932f4e19006735816acfaf75b0
Splits a URI into its components
[ { "docid": "747e432064b12ad586410fa242eb1155", "score": "0.57604754", "text": "def components\n @components ||= @string.split('/').reject{|x| x == '' || x == nil} rescue []\n end", "title": "" } ]
[ { "docid": "444eaf04c03102ff3d019427d89daa68", "score": "0.80238026", "text": "def split(uri)\n case uri\n when ''\n # null uri\n\n when @regexp[:ABS_URI]\n scheme, opaque, userinfo, host, port,\n registry, path, query, fragment = $~[1..-1]\n\n # URI-referenc...
ed1d88770180ce0ca9f3e04c332634d4
Kills the music process and the looping thread.
[ { "docid": "d388b92c4e170c7659181e033f76934f", "score": "0.846166", "text": "def stop_music\n return unless @@playback\n\n Process.kill(\"SIGKILL\", @@pid) if @@pid\n @@pid = nil\n\n @@thread.kill if @@thread\n @@thread = nil\n\n @@file = nil\n end", "title": "" } ...
[ { "docid": "0444bb3f4813c1aaa1e41a3bfbd0dbfd", "score": "0.7524424", "text": "def stop_music\n MSPhysics::Music.stop\n end", "title": "" }, { "docid": "d877592b7769a41d145a489dbc96e0d5", "score": "0.73360324", "text": "def stop_playing\n unless @pid.nil?\n ::Proce...
295e431091c1afe9a5a0d1c8188b83aa
Use callbacks to share common setup or constraints between actions. Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "56c16f557c0326fd36aaf5e62be98e9d", "score": "0.0", "text": "def game_params\n params.require(:game).permit(:category, :speeds, :levels)\n end", "title": "" } ]
[ { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60858154", "text": "def action_hook; end", "title": "" }, { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6080073", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n...
1e5cd386289804d53502a1d7034ffe71
GET /courses/1 GET /courses/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "ac29ec1c64f22e52fd6ae72b9fdecd55", "score": "0.7656567", "text": "def get_courses\n @prof = Professor.find(params[:pro_id])\n\n render json: @prof.courses\n end", "title": "" }, { "docid": "e1f73287e9734365a25fd8739fb24301", "score": "0.76272476", "text": "def inde...
d17fa30225e5feed5e00c287d710190e
PUT /response_domain_texts/1 PUT /response_domain_texts/1.xml
[ { "docid": "111e38d024d538f3f01d9dfd424a655d", "score": "0.71501935", "text": "def update\n @response_domain_text = ResponseDomainText.find(params[:id])\n\n respond_to do |format|\n if @response_domain_text.update_attributes(params[:response_domain_text])\n format.html { redirect_to(@r...
[ { "docid": "cd8783ee990d6a4e783c679e42235a60", "score": "0.6140707", "text": "def create\n @response_domain_text = ResponseDomainText.new(params[:response_domain_text])\n @response_domain_text.init\n\n respond_to do |format|\n if @response_domain_text.save\n format.html { redirect_t...
5e56b1306ccc6ea3f70ff6b341c2033f
GET /listas/1 GET /listas/1.json
[ { "docid": "7b8f1758fd91e91b19f35c711843db22", "score": "0.7144859", "text": "def show\n @lista = Lista.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lista }\n end\n end", "title": "" } ]
[ { "docid": "8c01a38c2559f5c24de0a917f8c0a416", "score": "0.686981", "text": "def index\n @listes = Liste.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @listes }\n end\n end", "title": "" }, { "docid": "0dd1bb712db03478cabcad3b2...
c78fac6338766b3d5f36266f741cad91
Go through all the nodes in this topology and build the requested links between each of them, according to the link definitions set in the topology graph interface = is the interface for which the link should be set. Currently, we use the actual interface, e.g. "ath0". This will eventually be changed to be consistent w...
[ { "docid": "051104d52fa5df9e2835abe044309a60", "score": "0.8312452", "text": "def build_links(interface)\n raise \"Cannot build links for this topology '#{@uri}', no vertices \"+\n \"and/or edges were defined\" if !@graph \n @edges = getGraphEdges(@graph) \n @graph.vertices.each { |sou...
[ { "docid": "ab2ff797a9a2d4fc7ad071b5939ab3f9", "score": "0.640767", "text": "def setup_links(nodes)\n super\n @attributes['links'].keys.each do |name|\n spawn(\"ip link set #{name} master br0\")\n end\n end", "title": "" }, { "docid": "b3b2d36e5ef6343e3059f7cadc8ca7d...
0bd803aefdc872d6272798cd3153ae6a
Return if has active processed clients
[ { "docid": "b394f5afbbf5b1cbf6ea5fbf4aba4162", "score": "0.6366815", "text": "def processings?\n @processings.any?\n end", "title": "" } ]
[ { "docid": "c02dd89e3b07632422d63a8d834d338d", "score": "0.74624693", "text": "def clients_active\n socket = _make_connection # might fail\n message = {status: true} # special message type\n result = request(socket, message)\n return 0 if result.nil?\n result[:clients]\n end"...
58dc98d01dec4b97cc2deae2cff1c714
Will send GCM message to android devices registered to patient Informs patient their appointment is ready TODO also add iphone support for future iphone app
[ { "docid": "c03d0ded49a2cc72fde92fbf028e0fbe", "score": "0.7634347", "text": "def push_notify_ready\n droid_destinations = patient.devices.map do |device|\n device.token if device.platform == 'android' && device.enabled\n end\n data = {:type => \"READY\", :message =>\n \"Your appoin...
[ { "docid": "b17edeafb5ad41227120be02204fb09b", "score": "0.66475344", "text": "def push_fire(title, msg)\n if Rails.env == \"production\"\n# GCM.host = 'https://android.googleapis.com/gcm/send'\n# GCM.format = :json\n# GCM.key = \"AIzaSyBWx7Nh7iUJpTXVQlgRjYD89a8gMxQz5Cc\"\n# push_...
aeda9cd023cc14a84c1369510215c1f3
Gets a shopping list by ID.
[ { "docid": "88133f1f57f912c4d92f7fcb46761269", "score": "0.6023566", "text": "def get_shopping_list_by_id_with_http_info(project_key, id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.get_shopping_list_by_id ...'\n end\n # v...
[ { "docid": "6756007d5c219d9a13f3a127d64c7ac1", "score": "0.71557397", "text": "def show_list(id)\n get(\"lists/#{id}\")\n end", "title": "" }, { "docid": "63242291456566e7638e756f8e856b44", "score": "0.7149072", "text": "def get_my_shopping_list_by_id(project_key, id, opt...
0637102f9956551bcfc8e1b9edbf379f
def student_asc render json: Student.all.order('last_name ASC') end
[ { "docid": "e09610970d0951089e1679a0c4e70209", "score": "0.0", "text": "def create\n checkin = @student.checkins.new(checkin_params)\n if checkin.save\n render json: checkin\n else \n render json: {message: \"Unable to create checkin.\"}\n end\n end", "title": "" } ]
[ { "docid": "6b16cb6828bc3f92c041bd78ace230ae", "score": "0.79844236", "text": "def index\n if request.format == \"json\"\n @students = Student.all.order(:last_name)\n end\n end", "title": "" }, { "docid": "6f63914b46ad24a905564a2048112772", "score": "0.79222023", "text": ...
769403419bb6d95dde0c9db442cd7ad2
Instance Method ============================================================================== All additional/complex filter goes here
[ { "docid": "283d9fbe5e9e73eee97683a527d9d60e", "score": "0.0", "text": "def filter(arg, contests)\n total_contests = 0\n begin\n\n # Don't display contest not active and draft\n if arg[:status_id].blank?\n contests = contests.where(:status.nin => [ContestStatus.draft, Co...
[ { "docid": "255d18245f542f51e271dc75c2e8d3c9", "score": "0.84358084", "text": "def filters; end", "title": "" }, { "docid": "255d18245f542f51e271dc75c2e8d3c9", "score": "0.84358084", "text": "def filters; end", "title": "" }, { "docid": "255d18245f542f51e271dc75c2e8d3c9",...
7bcd4992c8775361653f00191e15dfc8
Try to pull an author name out of the git global config.
[ { "docid": "c49826308c7dbb4a0bc7fc9bee161796", "score": "0.7637093", "text": "def default_value_for_author\n git_global_config_for(\"user.name\") do |author_val|\n warn(\"Using author from git as: #{author_val}\")\n end\n end", "title": "" } ]
[ { "docid": "66abff4d1dec63df88b85e3b19e1fc79", "score": "0.81899583", "text": "def extract_author_name\n `git config user.name`.strip\n end", "title": "" }, { "docid": "dab460db18c2eab3833d61eff4bb21b4", "score": "0.7054004", "text": "def guess_maintainer\n text = Fi...
c677e2ccb36ab955c74a7bce3764b9f6
POST /people POST /people.json
[ { "docid": "dbad5ad283a36f0a1b822c14479c311f", "score": "0.6255823", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html do\n flash_message(:success, I18n.t('person.created'))\n redirect_to @person\n ...
[ { "docid": "63eb33eee2d2c0fe5c733bc487e74e90", "score": "0.70495903", "text": "def add_new_person(api, cookie, person)\n pers = nil\n option_hash = { content_type: :json, accept: :json, cookies: cookie }\n res = api[\"people\"].post person.to_json, option_hash unless $dryrun\n if res&.code == 201\n ...
49da1f866ad149ad8015b219e795e3d7
Custom attribute writer method with validation
[ { "docid": "fe3f86cac735b09057b437ec2becb0e2", "score": "0.0", "text": "def city=(city)\n\n if !city.nil? && city.to_s.length > 80\n fail ArgumentError, \"invalid value for 'city', the character length must be smaller than or equal to 80.\"\n end\n\n @city = city\n end", "ti...
[ { "docid": "5a0bcdaca95c21b13aacca36f9fad742", "score": "0.6955513", "text": "def _write_attribute(attr_name, value); end", "title": "" }, { "docid": "5812dd7a37c0eccc3d9481c23d74c649", "score": "0.69278884", "text": "def write_attribute(attr_name, value); end", "title": "" }, ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "f0984e0d1f92518b9bc9c65057e73280", "score": "0.0", "text": "def set_customer\n @customer = Customer.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;...
61657162d33f9a6b2c778a051114bdc7
Search for the friend to start chat
[ { "docid": "0ef6a031522abef88279c701c6c31da0", "score": "0.0", "text": "def user_autocomplete\n @users = @users.order(:username).where(\"username like ?\", \"%#{params[:value]}%\")\n respond_to do |format|\n format.js\n end\n end", "title": "" } ]
[ { "docid": "41947297d3a3350461bc1641842a1efa", "score": "0.6333283", "text": "def search\n user = User.qa_app_user\n text = URI.decode(params[:search])\n @chatouts = Qa.search_feed(user, Qa::GROUP_ID , text)\n end", "title": "" }, { "docid": "607ecf3e3a920bbb439222fd527f0455", ...
847ac4c3e857a1bb515f4b534e8977f9
has digital option_type as true
[ { "docid": "592c8b2e053a24557f25fdf7b337a776", "score": "0.6980516", "text": "def has_true_digital_option?\n # self.option_values.select{|a|a.option_type.name.eql?('digital') && a.name.eql?('true')}.present?\n self.option_values.joins(:translations, option_type: :translations).where(\"spree_op...
[ { "docid": "5ccfe3a38442780b138d0544906baf16", "score": "0.75471944", "text": "def is_optionable?\n false\n end", "title": "" }, { "docid": "2b639e91e7e35f8d194ca12f91e119b6", "score": "0.73532236", "text": "def has_digital_option?\n self.option_values.any? { |a| a.option_type...
44bff90bed7ab16ec856bdb017797f2c
DEPRECATED: Please use find instead.
[ { "docid": "330e6dd30f15e9c06316f2d991d6153c", "score": "0.0", "text": "def retrieve(id)\n instance = self.new(id)\n url = instance.url\n requestor = Requestor.new\n response = requestor.request(:get, url)\n instance.load_from(response)\n instance\n ...
[ { "docid": "6e542ee4b6b5fc7562b5fd013ef5f30d", "score": "0.70903206", "text": "def find(path); end", "title": "" }, { "docid": "6e542ee4b6b5fc7562b5fd013ef5f30d", "score": "0.70903206", "text": "def find(path); end", "title": "" }, { "docid": "62057304fbc2009a66cb3be6b570...
a06e55b6495f01d5f6a9ef7299cc14c2
Saves each key value pair to the redis data store
[ { "docid": "2e75a817c823057fc238b87725a9c9c8", "score": "0.0", "text": "def update_attributes(resources)\n resources.each do |resource|\n resource.attributes.each do |property, value|\n next if resource.key.include?(property)\n @redis[\"#{resource.model.to_s.downcas...
[ { "docid": "e7be01dce1ed1a9bd266f46cb8b89a76", "score": "0.7166174", "text": "def save\n @dirty.each { |key| save_key(key) }\n end", "title": "" }, { "docid": "72201b7e0f249e14228af7b8df9b7ef7", "score": "0.71276486", "text": "def persist\n redis.persist key\n end...
6ad743daa58700841653fd3c7c54769c
List Contacts in Group
[ { "docid": "6498b9a4cdd6098ede97144d3a3f59ae", "score": "0.0", "text": "def get_contacts_by_group_id_with_http_info(group_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ContactsApi.get_contacts_by_group_id ...\"\n end\n # verify th...
[ { "docid": "565d1ad1f85f8d3c877d9fe48d6c0e4d", "score": "0.808173", "text": "def groups()\n get('contactGroupList')\n end", "title": "" }, { "docid": "8f3de5a9498aac493166f2b8de2de25f", "score": "0.7678339", "text": "def get_contact_group_contacts(group_id)\n get(\"contact...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "a2662dcdc7dbf08115804c3b91f9b37c", "score": "0.0", "text": "def set_constraint\n @constraint = Constraint.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;...
5ff6abb81e52162c0ca023c2ff1252f8
Get the list of properties and their various options for the supplied Entity name.
[ { "docid": "5b37d171837b4206ff5b7368fdbdb059", "score": "0.6906916", "text": "def properties_for_entity(entity_name)\n namespace, _, entity_name = entity_name.rpartition('.')\n raise ArgumentError, 'Namespace missing' if namespace.nil? || namespace.empty?\n schemas[namespace].properties_f...
[ { "docid": "126dc1114768b3552b4a514ec5a04645", "score": "0.69161546", "text": "def properties_for_entity(entity_name)\n type_definition = metadata.xpath(\"//EntityType[@Name='#{entity_name}']\").first\n raise ArgumentError, \"Unknown EntityType: #{entity_name}\" if type_definition.nil?\n ...