query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
b00faa4fb78cfa9fa35b55bcd8192a76 | Returns the byte size of this certificate. | [
{
"docid": "6092aa925491fd62082b0c74a4213ba2",
"score": "0.0",
"text": "def size\n 1 + 2 + (payload ? payload.size : 0)\n end",
"title": ""
}
] | [
{
"docid": "24702561b6e27f91194c5666e67a4032",
"score": "0.7749923",
"text": "def size\n bytes.length\n end",
"title": ""
},
{
"docid": "8ea9b5cff6c1bf4893dd893c7995e542",
"score": "0.77140766",
"text": "def size_in_bytes\n data[:size_in_bytes]\n end",
"title": ""... |
2ade272de972bf091020168cae776970 | Insert the item at the given position (defaults to the top position of 1). | [
{
"docid": "0bb2bb5dca11e071ac4268a670cb834d",
"score": "0.8157259",
"text": "def insert_at(position = 1)\n insert_at_position(position)\n end",
"title": ""
}
] | [
{
"docid": "bf439293c19f98b1e68851846819d687",
"score": "0.7897052",
"text": "def insert(pos,item)\n end",
"title": ""
},
{
"docid": "7dad42b151a1ce1b1b0ec88bd7ca7bce",
"score": "0.7878173",
"text": "def insert_at_position(position)\n remove_from_list\n increme... |
a9897b84c7820494fe315c99e3ba48fb | Returns the dollar amounts used to verify the ACH account | [
{
"docid": "86cfefe18ad634ff1fc708f35b2a937a",
"score": "0.0",
"text": "def get_fundingsources_ach_fundingsourcetoken_verificationamounts_with_http_info(funding_source_token, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FundingSourcesApi.get_fu... | [
{
"docid": "015832cd5420305db35dc5773edff0c7",
"score": "0.6818716",
"text": "def tc_amount(accounting_element)\n\t\t\t\t payment_form = accounting_element[:payment_info][:payment][:form]\n\t\t\t\t if payment_form == \"CC\" then\n\t\t\t\t return (ticket_base_fare(accounting_element).to_f + ticket_tax(... |
7834e4ad46a72fb286890bb43d771406 | Stop the given machine. | [
{
"docid": "818c546b9d996f381cf22aea2cb02b43",
"score": "0.7385274",
"text": "def stop_machine(action_handler, machine_spec, machine_options)\n instance = instance_for(machine_spec)\n if !instance.nil?\n action_handler.perform_action \"powered off machine #{machine_spec.name... | [
{
"docid": "851026dfe7d9b218b1d4317e662c3718",
"score": "0.82992697",
"text": "def stop(machine_spec)\n machines(machine_spec).each do |machine|\n Operations::Stop.new(machine).run\n end\n end",
"title": ""
},
{
"docid": "e8e64796083c39997ea609cad9dfce5e",
"score": "0.8124517... |
85eda5f9d7ae3d7be5f84734658dedd2 | current navbar menu :collection, :charms, :chains, :brand, :shopping_cart | [
{
"docid": "79c95a4120d11bcb4ffac39ab5afa07d",
"score": "0.72777754",
"text": "def navbar_active\n # reset in controller for active navbar menu item\n @navbar_active = :shopping_cart\n end",
"title": ""
}
] | [
{
"docid": "275dd2b5ffbf750be1488ff3dc49c15b",
"score": "0.69894993",
"text": "def menu(current)\n Model::MENU.map{ |m|\n li_class =\n [current == m[:section] ? \"active\" : \"\", m[:cls].to_s].join(\" \")\n \"<li class=\\\"#{li_class}\\\"><a href=\\\"#{m[:href]}\\\">#{m[:label]}</a>\"... |
c83389513563057f6e97391ebce34298 | Halt processing and return a 404 Not Found. | [
{
"docid": "08b085179287cc31e84a333d388ba2f5",
"score": "0.0",
"text": "def not_found(body=nil)\n error 404, body\n end",
"title": ""
}
] | [
{
"docid": "4f2b6809f006dbdb87b9358783b00fe9",
"score": "0.8612811",
"text": "def not_found\n halt 404\n end",
"title": ""
},
{
"docid": "35e765f736186001334f7e9290477bbd",
"score": "0.83274025",
"text": "def not_found!\n res.status = 404\n render \"public/shared/404\"\... |
353ad31ea6b64e51db746bca13c551f1 | DELETE /block_of_questions/1 DELETE /block_of_questions/1.json | [
{
"docid": "cd60780c6d4cc2b48b77a78820f07581",
"score": "0.77780855",
"text": "def destroy\n @block_of_question.destroy\n respond_to do |format|\n format.html { redirect_to block_of_questions_url, notice: 'Block of question was successfully destroyed.' }\n format.json { head :no_content ... | [
{
"docid": "0e58c1f434aef253eded8d41b3f2d994",
"score": "0.73924065",
"text": "def destroy\n @block_of_answer.destroy\n respond_to do |format|\n format.html { redirect_to block_of_answers_url, notice: 'Block of answer was successfully destroyed.' }\n format.json { head :no_content }\n ... |
fed80f7c1ebb070ce1fe09df0c6c5887 | Implementing this is required for basic functionality. +value+ is the model's attributes hash, or the output of an "out" serializer if one is being used. | [
{
"docid": "98d79cc9a4992266fbdc9485afa4807d",
"score": "0.0",
"text": "def put(key, value)\n raise NotImplementedError\n end",
"title": ""
}
] | [
{
"docid": "11ef7f822f77a1beab1f8771b7d37a3d",
"score": "0.69203234",
"text": "def serialize; @value; end",
"title": ""
},
{
"docid": "068047de54dee65932a57c428a1e5c3e",
"score": "0.68711597",
"text": "def serialize(value)\n value\n end",
"title": ""
},
{
"doc... |
56b397cc5c7c12e2a5250c04d44a4710 | Initialize the mailer via the given +method_name+. The body will be rendered and a new SMS::Message object created. | [
{
"docid": "78dca7bc0e06d9ee501bb95036bbebc0",
"score": "0.73867846",
"text": "def create!(method_name, *parameters) #:nodoc:\n initialize_defaults(method_name)\n __send__(method_name, *parameters)\n\n unless @message === String\n template_exists ||= template_root[\"#{mailer_name}/... | [
{
"docid": "0f1d5e872bf07a22ec230f685267eb0b",
"score": "0.7529662",
"text": "def initialize(method_name, *args)\n @message = MailParams.new\n self.send(method_name, *args)\n end",
"title": ""
},
{
"docid": "96939d83943d0f000a5c7f0eac3eaf64",
"score": "0.7373786",
"text"... |
e311946f2b145e60981b7c7d5b133e50 | GET /campaign_user_account_infos/1 GET /campaign_user_account_infos/1.json | [
{
"docid": "2b75cd1d43d66a49c9f70501642b954f",
"score": "0.7842728",
"text": "def show\n @campaign_user_account_info = CampaignUserAccountInfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @campaign_user_account_info }\n end\n ... | [
{
"docid": "6a22cfeb743d7a42d118e82ec7375876",
"score": "0.71811277",
"text": "def index\n @campaign_user_account_infos = CampaignUserAccountInfo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @campaign_user_account_infos }\n end\n end",
... |
269ca0052133beb1b01e703d853ebcbb | If the invited group member is already a user then simply add them as a member to the group they were invited to If invited user is new to the site then they need to register first before they are added as a group member | [
{
"docid": "f9e5d3052d516d0312cf9f07583e0aa7",
"score": "0.6911477",
"text": "def check_if_group_invitation_is_to_new_or_existing_user(group_invitation)\n if User.find_by_email(group_invitation.friend_email)\n user = User.find_by_email(group_invitation.friend_email)\n GroupInvitationHandler... | [
{
"docid": "4133ee047dd2e8920dae2fbae94eb68a",
"score": "0.7639569",
"text": "def invite_to_group(user_group, user)\n if user_group.is_member?(self) and not user_group.is_member?(user)\n membership = Membership.create_with_notification!(:user => user,\n ... |
d9fee895a2ff84c191aeb7f9916aaa91 | defines if the user has access to the mailbox | [
{
"docid": "9f2cd170f1940b6870dfc7baddc1a061",
"score": "0.82946706",
"text": "def has_mailbox_access\n # we only want to allow merchants and general users\n # merchant = merchant\n # general user = not merchant, not admin, not article_publisher, not merchant_rep\n if self.merchant || (!self... | [
{
"docid": "0ac6334bd5f6dcb26c5da0bb18eea653",
"score": "0.7141281",
"text": "def check_user_identity\n render :text => 'You cannot access this mailbox.', :status => :forbidden unless (current_user == @user) || current_user.is_admin?\n end",
"title": ""
},
{
"docid": "4476412616b2b0e34ca... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "241586a9170431e82ff4fb986c0bf471",
"score": "0.0",
"text": "def set_poll\n @poll = current_user.polls.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;... |
17c9505b160cb736a48b8e30bedbf20b | 'choose', 'player', or 'computer' | [
{
"docid": "717919860d75fbc23624f28151ce018e",
"score": "0.0",
"text": "def prompt(msg)\n puts \"=> #{msg}\"\nend",
"title": ""
}
] | [
{
"docid": "5ef395414961c7efe607dbe9e6c309a7",
"score": "0.73943377",
"text": "def first_player_set?(const)\n const == 'player' || const == 'computer'\nend",
"title": ""
},
{
"docid": "905ed2175029448806e164ec8c601a96",
"score": "0.73645806",
"text": "def get_player_2_type\n us... |
228b9e9e5dceefa3ea29b668779a86a5 | let the api use add additional relationships to this call | [
{
"docid": "a4710671c082ccd9d43b6015b5d43a94",
"score": "0.0",
"text": "def includes\n @includes ||= params[:include].to_s.split(',')\n end",
"title": ""
}
] | [
{
"docid": "9f561c15822939dd0a41003f0c0cd16b",
"score": "0.7913606",
"text": "def relationship_add\n\t\t\t\t\tunless @jsonapi_relationship[:definition][:type] == :to_many\n\t\t\t\t\t\tjsonapi_render_errors 403, 'Operation allowed for to-many relationships only.'\n\t\t\t\t\t\treturn\n\t\t\t\t\tend\n\t\t\... |
f260b0743e3635ff851ba1fb8f391b00 | GET /users/1 GET /users/1.json | [
{
"docid": "8bd7b8ca4c08192bb154bf7530c2e358",
"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 }\n end\n end",
"title": ""
}
] | [
{
"docid": "9f7c735ace683c5c2b12c914cc9ad8a8",
"score": "0.77172285",
"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... |
e5d765031d5745f4d5421899cf084d79 | Internal: Accumulate asset source to buffer and append a trailing semicolon if necessary. buf String buffer to append to source String source to append Returns buf String. source://sprockets//lib/sprockets/utils.rb100 | [
{
"docid": "a40b61e60e5a259c0692314770f18cb3",
"score": "0.6956074",
"text": "def concat_javascript_sources(buf, source); end",
"title": ""
}
] | [
{
"docid": "fa863e0122b15c97a6ca3158f4def75e",
"score": "0.7496032",
"text": "def concat_javascript_sources(buf, source)\n if string_end_with_semicolon?(buf)\n buf + source\n else\n buf + \";\\n\" + source\n end\n end",
"title": ""
},
{
"docid": "3d724194049d7... |
b23a66109684d65d365b808369b3ea20 | PUT /all_registrations/1 PUT /all_registrations/1.json | [
{
"docid": "0df3df4c266fa6f71d1e2421a69665b5",
"score": "0.6470971",
"text": "def update\n @all_registration = AllRegistration.find(params[:id])\n\n respond_to do |format|\n if @all_registration.update_attributes(params[:all_registration])\n format.html { redirect_to @all_registration,... | [
{
"docid": "f785bdbb43909db1950f6195ba99d9b1",
"score": "0.63603795",
"text": "def index\n @registrations = current_user.registrations\n end",
"title": ""
},
{
"docid": "2892c6e129f62a9f612fbf7e15b06f2a",
"score": "0.6336335",
"text": "def index\n @registrers = Registrer.all\n... |
aef80ae7ed9e852890b5e23aedd1c4e5 | PATCH/PUT /orders/1 PATCH/PUT /orders/1.json | [
{
"docid": "5f5f24a91db211a1491edfa9fda1dbda",
"score": "0.0",
"text": "def update\n respond_to do |format|\n if @order.update(order_params)\n format.html { redirect_to user_order_path(@order.user,@order), notice: 'Order was successfully updated.' }\n format.json { render :show, st... | [
{
"docid": "5475e478e362598519f05ab929db4ab8",
"score": "0.72097707",
"text": "def update\n @order = Order.find(params[:id])\n @order.update_attributes(order_params)\n render :json => @order\n end",
"title": ""
},
{
"docid": "66c979dede895693d89bd15161614588",
"score": "0.70306... |
6c7cdf4147366b334ca35f8d99e49a8e | POST /videos POST /videos.json | [
{
"docid": "774db727dbbefa1755e1461b4fff9eab",
"score": "0.0",
"text": "def create\n @video = Video.new(params[:video])\n respond_to do |format|\n if @video.save\n format.html { redirect_to hall_video_path(@hall,@video), notice: 'Video was successfully created.' }\n format.j... | [
{
"docid": "38ef8c4ba7ff346545eff130cd8a7b20",
"score": "0.7559166",
"text": "def create\n @video = Video.new(video_params)\n @video.save!\n render json: @video\n end",
"title": ""
},
{
"docid": "f74c5df4d30ec248d6de9a9990d5ec83",
"score": "0.72561485",
"text": "def create\... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "af38b8f2492f856c90b934cc79372e75",
"score": "0.0",
"text": "def update!(**args)\n @query = args[:query] if args.key?(:query)\n end",
"title": ""
}
] | [
{
"docid": "150fa2bdc1fc43d28ac45e2278a1f797",
"score": "0.7012263",
"text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"t... |
cf3c692d0a3806203fbf003217b782ba | The token to be used to report progress. | [
{
"docid": "cbd55dfe34f089d2b7d09e5a7caef285",
"score": "0.0",
"text": "def token; end",
"title": ""
}
] | [
{
"docid": "196dcc47f4180b323e5df31b194ad6c0",
"score": "0.7469372",
"text": "def token\n ensure_token\n @token\n end",
"title": ""
},
{
"docid": "196dcc47f4180b323e5df31b194ad6c0",
"score": "0.7469372",
"text": "def token\n ensure_token\n @token\n ... |
83e785886e92344e54153004ebec8d28 | Bad name It only adds new/unseen Should take in a hash or array | [
{
"docid": "797af3a3f845e847eb215c31dfc7c16d",
"score": "0.0",
"text": "def add(uri, referer, checksum)\n @items_mutex.synchronize do\n id = unique_id(uri)\n unless @crawled.include?(id)\n @items << [uri, referer, checksum]\n ... | [
{
"docid": "533cc20378c42fe207ffb2688095c17c",
"score": "0.66134566",
"text": "def create_list (name)\n name = Hash.new\nend",
"title": ""
},
{
"docid": "be3a7925da1c8ab36713503c04875445",
"score": "0.6553682",
"text": "def store_the_names(normal_name, sec_name, hash)\n\thash[normal... |
80a93544d33f6fb1c21a5c8b116e97e1 | Gets the automationId property value. Unique identifier for the attack simulation automation. | [
{
"docid": "761c79b8275b97fc18fddd223249da21",
"score": "0.8377365",
"text": "def automation_id\n return @automation_id\n end",
"title": ""
}
] | [
{
"docid": "586ddd39544ee8310eada298b5df6696",
"score": "0.8114502",
"text": "def automation_id\n @attributes[:automation_id]\n end",
"title": ""
},
{
"docid": "71702ca0b25b5ade57923bd2a64279eb",
"score": "0.7586519",
"text": "def automation_id=(value)\n @autom... |
c6c5859e9d75575e8bd62d2724fc5af7 | Returns the counted length. Can only be called after the end of the enumerator has been reached. | [
{
"docid": "e7990719be17b397e01a92d427ae6757",
"score": "0.7076803",
"text": "def length\n raise CannotCallBeforeEnd, \"Cant call length before the end has been reached.\" unless @end\n return @length_cache\n end",
"title": ""
}
] | [
{
"docid": "3d993db51ce5f9b6eaaaa7cc6ee92cd8",
"score": "0.77859384",
"text": "def length\n each.count\n end",
"title": ""
},
{
"docid": "618cf3965cbaa8bbfbf32101dbb6d164",
"score": "0.75392175",
"text": "def length\n count\n end",
"title": ""
},
{
"docid"... |
4b1503cf0f47747115643e4db68e2ea9 | PUT /trips/1 PUT /trips/1.json | [
{
"docid": "631b1de6f7486241766d05b3b4f54867",
"score": "0.60592437",
"text": "def update\n @trip = Trip.find(params[:id])\n \n \n params[:trip][:category_ids] ||= []\n params[:trip][:type_ids] ||= []\n \n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n ... | [
{
"docid": "0f814dc42346ebcca2298b72a121d5bb",
"score": "0.66057086",
"text": "def update\n @trip = Trip.find(params[:id])\n\n if @trip.update(trip_params)\n render :json => {:success => true}\n else\n render :json => {:success => false, :errors => [\"Trip update failed.\"]}\n end\... |
9928c503199025e53f5c1ff6080ef1bb | def self.new_user_invite(invite, signup_url) subject 'Invite' recipients invite.recipient_email | [
{
"docid": "00ce4fb758a75878186ac66772d86587",
"score": "0.8534533",
"text": "def new_user_invite(invite, signup_url)\n @signup_url = signup_url\n #invite.update_attribute(:sent_at, Time.now)\n mail(to: invite.email, subject: 'Invite')\n end",
"title": ""
}
] | [
{
"docid": "f7e290b2117c3ac25d8e94f273627bce",
"score": "0.8310339",
"text": "def new_invite(invite)\n @invite = invite\n @sender = invite.user\n @action = \"Join me on #{CONFIG[:name]}\"\n @source = \"email_invite\"\n\n admin = User.first\n\n generate_a... |
af428951acd3d5f47b7ad8d42ac9f71a | Returns the maximum number of worker threads. This value is set upon initialization and cannot be changed afterwards. wq = WorkQueue.new() wq.max_threads=> Infinity wq = WorkQueue.new(1) wq.max_threads=> 1 | [
{
"docid": "850d507180ffd2ae59f9848c3830f904",
"score": "0.82488793",
"text": "def max_threads\n @max_threads\n end",
"title": ""
}
] | [
{
"docid": "1a989ef8b55f6300a0d665fbbfacd990",
"score": "0.82857615",
"text": "def max_threads\n @max_threads\n end",
"title": ""
},
{
"docid": "b668a61db677664826986a1c8fcac2db",
"score": "0.794258",
"text": "def max_threads\n @max_threads || 16\n end",
"ti... |
974652bc7615426985ba54ee75805934 | Connects a wire to an input port | [
{
"docid": "be7fa317ffcdd80b9370fe5a26fcf8de",
"score": "0.6949914",
"text": "def connect_input(conn)\n input, output, component = conn.input, conn.output, conn.comp_out\n return unless input.between?(0, input_count-1) && output.between?(0, component.output_count-1)\n disconnect_input(inp... | [
{
"docid": "7be3ab12fcfe805b62b6b968f7b73b52",
"score": "0.7055533",
"text": "def connect!; raise NotImplementedError, 'Raw ports do not know which direction to connect'; end",
"title": ""
},
{
"docid": "d97c57c1fd4f9ada72e25e36045e4ea0",
"score": "0.70122343",
"text": "def connect!;... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "33ce3f5cf50d8634a4512e50824f159e",
"score": "0.0",
"text": "def accommodation_charge_params\n params.require(:accommodation_charge).permit(:company_id, :name, :amount)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.6981273",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6783789",
"text": "def strong_params\n params.requi... |
313cc16b2419c96d86e2eac1673a659d | DELETE /spookers/1 DELETE /spookers/1.json | [
{
"docid": "c3c417ec1128e10f66e6cadb5fdd33d1",
"score": "0.73103046",
"text": "def destroy\n @spooker.destroy\n respond_to do |format|\n format.html { redirect_to spookers_url, notice: 'Spooker was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title... | [
{
"docid": "2f20ceef41cb1b9a7f246ebd8edf74ff",
"score": "0.6309041",
"text": "def destroy\n @hookup = Hookup.find(params[:id])\n @hookup.destroy\n\n respond_to do |format|\n format.html { redirect_to hookups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "8102c1e069e9671ee221cb701874c161",
"score": "0.0",
"text": "def update!(**args)\n @spoke_state_counts = args[:spoke_state_counts] if args.key?(:spoke_state_counts)\n @spoke_state_reason_counts = args[:spoke_state_reason_counts] if args.key?(:spoke_state_reason_counts)\n ... | [
{
"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... |
5e2494a29493b1afec25fd3701d10f02 | whether arg months are continuous | [
{
"docid": "54621d9e0ebd038ff12b3fe822e2be1a",
"score": "0.8199054",
"text": "def continuous_months?(months)\n discrete_months(months).empty?\n end",
"title": ""
}
] | [
{
"docid": "8559721aa1126fb526fb6ecabafb429f",
"score": "0.7600921",
"text": "def monthly?\n interval == 'month'\n end",
"title": ""
},
{
"docid": "aa896cf89f7c26b5eb5e8dd40ffb826a",
"score": "0.74570715",
"text": "def in_months; end",
"title": ""
},
{
"docid": "aa896... |
f089fcb24661eb835929387428ee6de4 | GET /places GET /places.json | [
{
"docid": "00e54c071e308c1bffd92069c873b5c5",
"score": "0.0",
"text": "def index\n @halalfoodhunt_seos = HalalfoodhuntSeo.all\n @search_place = Place.ransack(params[:q])\n @places = @search_place.result.where(draft: false)\n @search_ecommers = Ecommer.ransack(params[:q])\n @ecommers = @search... | [
{
"docid": "7ffe0f9631141c12ec4e224e94ba1ae1",
"score": "0.7823826",
"text": "def index\n @places = Place.all\n json_response(@places)\n end",
"title": ""
},
{
"docid": "618d86be414b93db61e8f27d42e4f64d",
"score": "0.7742781",
"text": "def index\n @places = Place.all\... |
39933ce57a9a3acd7d9fd3b4101f2118 | GET /image_objects/1 GET /image_objects/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "9dac3d3d8052036617f7c40dd8026e1f",
"score": "0.7333621",
"text": "def show\n render json: Image.find(params[\"id\"])\n end",
"title": ""
},
{
"docid": "215503117264a4f72c2efc09e8f45853",
"score": "0.7185136",
"text": "def show\n @image = Image.find(params[:id])\n\n... |
e5b32ca60b149a59fabbfd19bf9dd9d7 | GET /historials GET /historials.json | [
{
"docid": "f7356718039a4f18d1ad4c74fee90212",
"score": "0.77498806",
"text": "def index\n @historials = Historial.all\n end",
"title": ""
}
] | [
{
"docid": "9c102b8f8c5709940b8906e1bd7414bf",
"score": "0.7232338",
"text": "def index\n @historics = Historic.all\n end",
"title": ""
},
{
"docid": "22151ccc95c2e0aa97509e463ac351b3",
"score": "0.69664985",
"text": "def index\n @fundamentals_histories = @company.fundamentals... |
b357a7d2e9d0b34906afb890039df5f9 | override this as needed for subclasses. Size should be in GB. | [
{
"docid": "7d8a1ef87ed1994dc2ea1f81667c49ed",
"score": "0.0",
"text": "def file_size\n self.total_file_size || 0\n end",
"title": ""
}
] | [
{
"docid": "1f02ed8f1d2a892655ff378b526d7f0f",
"score": "0.765435",
"text": "def size\n super\n end",
"title": ""
},
{
"docid": "735fddcb0dc4a5c799b06468239ee157",
"score": "0.7594642",
"text": "def default_size= size \n \n end",
"title": ""
},
{
"docid"... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "86c12db5ce44c1faf1d9444922166164",
"score": "0.0",
"text": "def set_binnacle\n @binnacle = Binnacle.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... |
7dff6de251f59a404bfd5b08f2d93518 | Return the proxied keyvalue hash tree visible from this vertex via its edges and all its ancestors. Calling to_hash instead will return a regular hash tree, without any special properties, e.g. for serializing as YAML or JSON. | [
{
"docid": "fcadfc2a03ea6825ce9143e7f6bbd90f",
"score": "0.7252692",
"text": "def to_hash_proxy\n result = @dag.hash_proxy_class.new\n edges.each do |edge|\n result.merge!(edge.to_hash_proxy)\n end\n result.merge!(@attrs)\n end",
"title": ""
}
] | [
{
"docid": "7cc7e07074789be34261146a6f16880d",
"score": "0.67202413",
"text": "def to_tree_hash\n TreeHash.new(self)\n end",
"title": ""
},
{
"docid": "bd56331c5e151f10079d400ee3327f8d",
"score": "0.6601087",
"text": "def hash\n to_h.hash ^ self.class.hash\n end",
"ti... |
83ed53f956a917e71d6af82f5286662f | Part II count questions where everyone answered yes | [
{
"docid": "6817a785980913f24f1ec652a3ac2034",
"score": "0.70781785",
"text": "def count_questions_all_yes(raw_input)\n group_forms = raw_input.split(/\\n\\n/).map { |group| group.split(/\\n/) }\n yes_answers = 0\n\n group_forms.each do |group|\n yes_answers += count_group_yes_answers(group) || 0\... | [
{
"docid": "4b2ad06db561ef1e33422c6b3df1e3bc",
"score": "0.7562657",
"text": "def question_count\n return people.first.answered.size if people.length == 1\n\n people_answering = people.length\n questions = Hash.new 0\n people.each do |person|\n person.answered.each do |char|\n qu... |
b76df27ae16fe85ba1a43e7f05d0bb5a | Get the edge version report. The report will not have consistent data about the edge version(s) until all edges have been reset. | [
{
"docid": "d690653e28022da35ae90ec69ae964aa",
"score": "0.7126574",
"text": "def get_telephony_providers_edges_edgeversionreport(opts = {})\n data, _status_code, _headers = get_telephony_providers_edges_edgeversionreport_with_http_info(opts)\n return data\n end",
"title": ""
}
] | [
{
"docid": "2df38fc86f26aa29b78b3e460d3ef6fb",
"score": "0.6788994",
"text": "def get_telephony_providers_edges_edgeversionreport_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: TelephonyProvidersEdgeApi.get_telephony_providers_edg... |
cc8cc217f79b0b85620e323c3f4830c2 | GET /projects/1/stages/1/deployments/1 GET /projects/1/stages/1/deployments/1.xml | [
{
"docid": "8c83336532491b8b384afd279892a893",
"score": "0.6050932",
"text": "def show\n @deployment = @stage.deployments.find(params[:id])\n set_auto_scroll\n \n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @deployment.to_xml }\n format.js ... | [
{
"docid": "8bb207ec5895b9df6fd73d4cb7ed4fbc",
"score": "0.72618926",
"text": "def index\n @deployments = @stage.deployments\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @deployments.to_xml }\n end\n end",
"title": ""
},
{
"docid":... |
fff4600cfb105166bfa7dde7f6b3e1c8 | prints out a greeting | [
{
"docid": "b0611bab31b29f9929803003808c76c0",
"score": "0.0",
"text": "def hello\n puts 'hello world'\nend",
"title": ""
}
] | [
{
"docid": "2902237beaed3cf68feb69c809b4b5e9",
"score": "0.8037403",
"text": "def greeting(name)\n\tp \"hello\" + \" \" + name\nend",
"title": ""
},
{
"docid": "2902237beaed3cf68feb69c809b4b5e9",
"score": "0.8037403",
"text": "def greeting(name)\n\tp \"hello\" + \" \" + name\nend",
... |
b5fd821e6416f3bc3d0ea40e2c5f8bf7 | Sets the subject property value. The subject property | [
{
"docid": "6e74d38982d77ab2d4f1247a232115b0",
"score": "0.88394845",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
}
] | [
{
"docid": "23eff6c61a6c900432383b9130c65add",
"score": "0.88464147",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "09fd44300aaaa367f6fa38dd31fcbb56",
"score": "0.8800616",
"text": "def subject=(value)\n @subject = value\n ... |
6201162075ab73f9e8424f0d7c4c492e | DELETE /items/1 DELETE /items/1.json | [
{
"docid": "c9672d4cc2245d206e008c21ce1c26eb",
"score": "0.75289726",
"text": "def destroy\n @item.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "86faa8c555419d7144a0c7003f760dff",
"score": "0.7906602",
"text": "def delete\n render json: Item.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "119acbd53f246ab3b80d6d093babf58b",
"score": "0.7688396",
"text": "def delete(items)\n item_ids = items.c... |
93be02c6d5e867c193e5d643a09f37a2 | TODO: Should this use the escape character or not? | [
{
"docid": "f3ca92d98638cfdf8912091a79bdc584",
"score": "0.0",
"text": "def to_s\n @to_str.gsub(ESC, @re)\n end",
"title": ""
}
] | [
{
"docid": "8e22c0f879a16d3af4720504301d32ec",
"score": "0.75405574",
"text": "def escaped_char(escape); end",
"title": ""
},
{
"docid": "16f8e011b71159fb7107190d9fd7ade8",
"score": "0.70396036",
"text": "def escapee()\n end",
"title": ""
},
{
"docid": "7766c025853d1e6... |
c16460643a0ad87406b79697635a9dec | This is performing n+1 network calls. We need content type of the s3 object in LXP A feature change required on LXP end to remove this call. | [
{
"docid": "f9c0318c53a1b0b3eab23fbb01d57008",
"score": "0.0",
"text": "def list_objects(bucket_name:, fetch_object_content_type: false, **opts)\n response_objects = s3_client.list_objects(bucket: bucket_name, **opts)\n formatted_objects = response_objects.contents.map do |obj|\n metadata = {... | [
{
"docid": "7a410816f8a69e3d42ac98d5c302ad99",
"score": "0.5513588",
"text": "def destroy\n @method3 = Method3.find(params[:id])\n @method3.destroy\n\n respond_to do |format|\n format.html { redirect_to(method3s_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
... |
f4da521d52ab997d236378295181e989 | Get file from GridFileSystem or passthru | [
{
"docid": "e114789e4982f9f1548814f033f4a923",
"score": "0.0",
"text": "def call(env)\n begin\n gfs_path = extract_gfs_path(env)\n file = Mongo::GridFileSystem.new(Mongoid.database).open(gfs_path, 'r')\n etag, last_modified = file.instance_variable_get(:@md5), Time.at( file.upload_date... | [
{
"docid": "9d9d280b6ec1ee9d3d935b378ce25551",
"score": "0.6697263",
"text": "def get_file(path)\n server.api.server_get_file(server, path)\n end",
"title": ""
},
{
"docid": "fd2d04dcb769d7fa1aecb1b38b8b1dbc",
"score": "0.6657451",
"text": "def get_file(file)\n @file... |
360704c4c3c22cd0a0e459d36f78524c | pops first node off of array | [
{
"docid": "24b9f772103f5a9e8e8867977ee13a74",
"score": "0.680642",
"text": "def remove_front\n if empty\n return nil\n else\n #pop top off stack and return it\n @size = @size - 1\n return @nodes.shift\n\n end\n end",
"title": ""
}
] | [
{
"docid": "6e46f4be2cc98e30da77df0281f0c530",
"score": "0.79052037",
"text": "def pop\n node = @array.shift\n replacement = @array.pop\n @array.unshift replacement if replacement\n self.sift_down(0)\n node\n end",
"title": ""
},
{
"docid": "e6e4d73d2f2785e9d8b0adc836c230c3",... |
bb2bb466e3abdbbad90303854826a77f | Declares the action to be taken when a particular state is entered. The argument is the state name and should be a Symbol. A block must be provided. If this state is already declared, the given block will be executed after the previous declarations. | [
{
"docid": "b34b122508ecf49abcd2201480f40e76",
"score": "0.72309315",
"text": "def declare(state, &block)\n (@states[state.to_sym] ||= [ ]) << block\n end",
"title": ""
}
] | [
{
"docid": "9a3abbbb5b1ebbb472183457bdc73092",
"score": "0.70062697",
"text": "def action(action_name,states_for_action,&block)\n # convert to array if we were called with a single state\n states_for_action = arrayify(states_for_action)\n @actions[action_name] = Struct.new(:block,:legal_states)... |
55d4ff0c136da8b8980ead5b329d2cf5 | FIXME: assumes text filter; does not support all agGrid filter options | [
{
"docid": "5a0cd6b1c42ffc97861fa7e5d5a8425a",
"score": "0.0",
"text": "def parse(filter_model)\n JSON.parse(filter_model).map do |column, filter|\n column = column.split('_').first.underscore\n if filter.key?('condition1')\n parse_multi(column, filter)\n els... | [
{
"docid": "a7da09ef78f38ec444e8aaf5f22d6aa9",
"score": "0.7478553",
"text": "def filter_text; end",
"title": ""
},
{
"docid": "26afb0cdd48b6ee267bc60e579a60632",
"score": "0.70490944",
"text": "def filter_text\n attributes.fetch(:filterText)\n end",
"title": ""
... |
649c0a65e88005f699b38ae6b370baca | Vraci pocet volnych mist pro uskladneni hotovych luzek. | [
{
"docid": "aad3b2b3274b920bbbb589ba9d66ff0f",
"score": "0.5680356",
"text": "def volne_misto_luzka\r\n return @kap_luzka - @luzka.length\r\n end",
"title": ""
}
] | [
{
"docid": "06b1c0afbe4fcd0a21272fac694688e6",
"score": "0.62336224",
"text": "def unico_lugar\n\t\tif self.establecimiento.present? && self.otro_lugar.present?\n\t\t\terrors.add(:base, \"Seleccione unico lugar.\")\n\t\telsif !self.establecimiento.present? && !self.otro_lugar.present?\n\t\t\terrors.add(... |
19175d296dbe1bcc261cf58eadb78b96 | 1. [x] do flashcards 2. [ ]run 2k | [
{
"docid": "62f20b310890351fd1fa8e94eedb3a93",
"score": "0.0",
"text": "def show_tasks(tasks)\n tasks.each_with_index do |task, index|\n status = task.done? ? \"x\" : \" \"\n puts \"#{index + 1}. [#{status}] #{task.name}\"\n end\n end",
"title": ""
}
] | [
{
"docid": "95b3176336f4c6d9580a1d751e57b0b3",
"score": "0.68728626",
"text": "def play_as_master_first\r\n @pending_points = 0\r\n w_cards = []\r\n curr_points_me = @team_mates.inject(0){ |result, name_pl| result + @points_segno[name_pl] }\r\n @cards_on_hand.each do |card_lbl|\r\n card... |
cd4dfdc5eeefe26dda9fe813ba4040ae | Various statistics for the pull request. Returned as Hash with the following keys: :lines_added, :lines_deleted, :files_added, :files_removed, :files_modified, :files_touched, :src_files, :doc_files, :other_files. | [
{
"docid": "08347436070e2671ce0e2dd3fb07d5db",
"score": "0.7263666",
"text": "def pr_stats(pr)\n pr_id = pr[:id]\n raw_commits = commit_entries(pr_id)\n result = Hash.new(0)\n\n def file_count(commits, status)\n commits.map do |c|\n c['files'].reduce(Array.new) do |acc, y|\n ... | [
{
"docid": "7daa887ab319cd2221f0d63a0a47196a",
"score": "0.73151946",
"text": "def pr_stats(pr_id)\n\n raw_commits = commit_entries(pr_id)\n result = Hash.new(0)\n\n def file_count(commits, status)\n commits.map do |c|\n c['files'].reduce(Array.new) do |acc, y|\n if y['stat... |
e8065232efdfd3812511be7ad0170035 | DELETE /quantile_settings/1 DELETE /quantile_settings/1.json | [
{
"docid": "c4d04494b3126c5551083acda1bccd03",
"score": "0.76078224",
"text": "def destroy\n @quantile_setting = QuantileSetting.find(params[:id])\n @quantile_setting.destroy\n\n respond_to do |format|\n format.html { redirect_to quantile_settings_url }\n format.json { head :no_conten... | [
{
"docid": "6f987bfd002e4dd1b6704f0d758fc6f1",
"score": "0.62478",
"text": "def destroy\n @quantile_period = QuantilePeriod.find(params[:id])\n @quantile_period.destroy\n\n respond_to do |format|\n format.html { redirect_to quantile_periods_url }\n format.json { head :no_content }\n ... |
8484ac62a12587466ebec55926fc3659 | validates :user_id, presence: true GET /posts GET /posts.json | [
{
"docid": "2016f0d15ca23381f2f30c87a95533e1",
"score": "0.0",
"text": "def index\n #debugger\n if params[:search] && !params[:type].equal?(nil)\n #debugger\n @post = Post.search(params[:search], params[:type]).order(\"created_at DESC\").paginate(page: params[:page], per_page: 10)\n\n ... | [
{
"docid": "58aa2b2736379fe6319c4d6da2f6d7b6",
"score": "0.73812246",
"text": "def posts\n @user = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "c36def3eeda4f34e4e4bd7e3e7e0905d",
"score": "0.71881175",
"text": "def show\n @user = User.find(params[:user_id])\n @... |
728df5d580a9b047c664bd884704051f | Returns the managed object context for the application (which is already bound to the persistent store coordinator for the application.) | [
{
"docid": "bfadd77a35de369b762578ca01ab040d",
"score": "0.77008754",
"text": "def managedObjectContext\n unless @managedObjectContext\n coordinator = self.persistentStoreCoordinator\n if coordinator\n @managedObjectContext = NSManagedObjectContext.new\n @managedObjectContext.... | [
{
"docid": "62c439199cd524a0c970ab80ddaf1eab",
"score": "0.7297759",
"text": "def managedObjectContext\n return @managedObjectContext if @managedObjectContext\n \n coordinator = self.persistentStoreCoordinator\n if coordinator\n @managedObjectContext = NSManagedObjectContext.alloc.init\... |
05ca9c7933dcc27106f48cfe09c500ae | POST /vacations POST /vacations.json | [
{
"docid": "65d431462f88143f1c1726a0cd53bd1f",
"score": "0.7832214",
"text": "def create\n @vacation = Vacation.new(vacation_params)\n\n if @vacation.save\n render json: @vacation, status: :created, location: @vacation\n else\n render json: @vacation.errors, status: :unprocessable_ent... | [
{
"docid": "7cbc81e2aec88615187a7386261f3c4f",
"score": "0.7364782",
"text": "def create\n @vacation = Vacation.new(vacation_params)\n\n respond_to do |format|\n if @vacation.save\n format.html { redirect_to @vacation, notice: 'Vacation was successfully created.' }\n format.json... |
1c662267fae43beef1aa8d0287458bc3 | Creates and assigns the activation token and digest. | [
{
"docid": "7014b00c51b5f479882d0286411b5e03",
"score": "0.0",
"text": "def create_activation_digest\n self.activation_token = User.new_token\n self.activation_digest = User.digest(activation_token)\n end",
"title": ""
}
] | [
{
"docid": "c3df1d3ca9735cd6ad7ef6e8056593e0",
"score": "0.8704495",
"text": "def create_activation_digest\n self.activation_token = new_token\n self.activation_digest = digest(activation_token)\n end",
"title": ""
},
{
"docid": "7a93a50a66b3bcb1519ceb13ef72f036",
"score": "0.869... |
5a234df822a17d7de784739cfb80e758 | Attempts to set attributes on the object only if they've been explicitly defined by the class. | [
{
"docid": "9ffb369897b11d98aab3b68db9c1acde",
"score": "0.0",
"text": "def attributes=(attributes)\n if attributes\n attributes.each do |attr, value|\n self[attr] = value\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "b749f4c8d48efcea5046fd465ee81619",
"score": "0.68670034",
"text": "def set_a_attributes\n Kernel.raise NotImplementedError\n end",
"title": ""
},
{
"docid": "dca8a3166f8590c0626984baf28d58ac",
"score": "0.6841911",
"text": "def bypass_set_attrs?\n bypass_set_at... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "e25559cfeffbc070a576bc9b05b2bc9b",
"score": "0.0",
"text": "def subctegory_params\n params.require(:subctegory).permit(:name, :description, :category_id)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.requ... |
359437ebf86942f1639c00fccdbb87c5 | Use autoloading in development environment | [
{
"docid": "13fa627f9f9a99784c967b4248b68e62",
"score": "0.0",
"text": "def find_by_trying(class_name)\n @namespaces.find do |namespace|\n begin\n break namespace.const_get(class_name)\n rescue NameError\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "71c3f4e0ca7fe3c61969a3be30ed27cf",
"score": "0.7538627",
"text": "def autoloader; end",
"title": ""
},
{
"docid": "535b9d19bfa0522c9d4ac560f8bfbcd6",
"score": "0.72955626",
"text": "def autoloaders; end",
"title": ""
},
{
"docid": "113a9723fa7ba77a9187449f18e3... |
17abe399652e3944db5fe15859654895 | The to_utm method converts a LatLong object to a UTM object. | [
{
"docid": "799d7affb9b33499a5937711d46cd20f",
"score": "0.6149923",
"text": "def to_utm\n end",
"title": ""
}
] | [
{
"docid": "78914ea52229ad9fd477c68cbba17357",
"score": "0.59522766",
"text": "def to_latlong\n end",
"title": ""
},
{
"docid": "c7b8da4b99b851fa41465da240bd57d5",
"score": "0.54353786",
"text": "def utm_zone\n if !@utm_zone\n @utm_zone, @utm_north ... |
aa5151495171e3c49658aa0e4fbc9901 | Instance methods begin here. | [
{
"docid": "0599b60d463588f30b7288ef50ad88f5",
"score": "0.0",
"text": "def line_items\n @line_items ||= self.send(self.class.line_items_table_name)\n end",
"title": ""
}
] | [
{
"docid": "40769f9969d33ad71cb2389a7e574114",
"score": "0.74638015",
"text": "def institucional\n\t\t\n\tend",
"title": ""
},
{
"docid": "413eb7a7781383c931819b4af16b7ad0",
"score": "0.7355083",
"text": "def initialize\n \n end",
"title": ""
},
{
"docid": "413eb7... |
1ddc46ccab63f1acb9c37d52592a3ad3 | Returns if model is dirty(some field were changed but model still not saved) | [
{
"docid": "f58ce1fb915703bac02ef2bdd1ce27e4",
"score": "0.7625896",
"text": "def dirty?\n return_value = false\n @_attributes.each_value do |attr_value|\n return_value = true if attr_value[:dirty?]\n end\n return_value\n end",
"title": ""
}
] | [
{
"docid": "b0e53a81aa672eb40e63bb9f50379ed7",
"score": "0.7988837",
"text": "def dirty?\n if dirty_attributes.any?\n true\n elsif new?\n model.identity_field || properties.any? { |property| property.default? }\n else\n false\n end\n end",
"title": ""
},... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "90a7cc6b869c0f1d901088a45684b896",
"score": "0.0",
"text": "def set_science_instance\n @science_instance = ScienceInstance.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;... |
30dd6bba77267c03eb311616ea820d66 | PUT /music_likes/1 PUT /music_likes/1.json | [
{
"docid": "9d655b65a6bc5306600134bef12054ad",
"score": "0.7140193",
"text": "def update\n @music_like = MusicLike.find(params[:id])\n\n respond_to do |format|\n if @music_like.update_attributes(params[:music_like])\n format.html { redirect_to @music_like, :notice => 'Music like was su... | [
{
"docid": "794495f68d6716a6ac9bc54cae684c30",
"score": "0.71963614",
"text": "def update\n render json: Like.update(params[\"id\"], params[\"like\"])\n end",
"title": ""
},
{
"docid": "ecbd2c19c50a2598bbd8ceaaf2ca5d8e",
"score": "0.71672773",
"text": "def update\n if params.h... |
1d9b7070d1970e89e6e4a986eaf36041 | Test the successful search returns | [
{
"docid": "98f07801417069227130541ddad8e638",
"score": "0.0",
"text": "def test_successful_search_for_courses\n assert_equal(1, CisSubject.search_for_course('CS22').size())\n assert_equal(1, CisSubject.search_for_course('math ').size())\n assert_equal(1, CisSubject.search_for_course('CS'... | [
{
"docid": "371a6967b59ec365fdba39291fad70b2",
"score": "0.697173",
"text": "def verify_search_results(found)\n # wait up to 30 seconds for search busy indicator to disappear\n wait_not_busy(30)\n # search results expected\n if found\n search_data = FlightSearch.current\n # wait fo... |
bde124734485638118b3f61179f7cd32 | POST /release_notes POST /release_notes.json | [
{
"docid": "130df9082a1fab37ba5875fce4f4a74c",
"score": "0.6372512",
"text": "def create\n\n @release_note = ReleaseNote.new(release_note_params)\n if @release_note.save\n flash[:success] = \"Release criada com sucesso !\"\n redirect_to edit_release_note_path @release_note, tab:\"descric... | [
{
"docid": "fe49e5846b5e046409ec780e7089c6d0",
"score": "0.72040194",
"text": "def get_release_notes\n path = '/v3/release-logs.json'\n\n header = {\n 'Content-Type' => 'application/json',\n 'User-Agent' => Config.user_agent\n }\n request = Net::HTTP::Get.new(path, head... |
8bdb7d2752670f171cb1b1ef7e29ee1e | Get the field size | [
{
"docid": "d8b9284e423a2a8ced3733c328a1e612",
"score": "0.0",
"text": "def fbe_size\n 4\n end",
"title": ""
}
] | [
{
"docid": "5b43a93b963f6ae84dcf5cacc31aff46",
"score": "0.9111969",
"text": "def size\n field_size\n end",
"title": ""
},
{
"docid": "9986dcc44f6d1323709e2a503c9acf3b",
"score": "0.83995366",
"text": "def field_size\n if self[:field_size].present? && self[:field_s... |
c93062dd57613a51ec716ad61fa50e49 | test that constructing a base node from a decimal results in the correct value and type | [
{
"docid": "a57f8241d54f0a9445cbdbaeb91ea9bc",
"score": "0.68482894",
"text": "def DISABLED_test_decimal_base_node\n assert_decimal_with_value PI, B_PI\n assert_decimal_with_value E, B_E\n end",
"title": ""
}
] | [
{
"docid": "75d4d53b7b34933b3b10f5c6ee093653",
"score": "0.6430737",
"text": "def assert_decimal_with_value(value, node)\n assert_in_epsilon value, node.value\n assert_equal :decimal, node.type\n end",
"title": ""
},
{
"docid": "8e07590fb6198efc488e10d1acb2bd72",
"score": "0... |
6bc8dfee7d99ce161683da13f1a5cd3f | PATCH/PUT /profile_answeres/1 PATCH/PUT /profile_answeres/1.json | [
{
"docid": "98c5186d4118bbd2d470d372bc8af4d4",
"score": "0.7363169",
"text": "def update\n respond_to do |format|\n if @profile_answere.update(profile_answere_params)\n format.html { redirect_to @profile_answere, notice: 'Profile answere was successfully updated.' }\n format.json {... | [
{
"docid": "bf49981a1bfca46c8565f286c36b2726",
"score": "0.7434985",
"text": "def update\r\n respond_to do |format|\r\n if @profile_answer.update(profile_answer_params)\r\n format.html { redirect_to @profile_answer, notice: 'Respostas atualizadas com sucesso.' }\r\n format.json { r... |
0a6b83d2c75297182a7a9ba467b771a3 | POST /tipo_despesas POST /tipo_despesas.json | [
{
"docid": "3c06b88778e751465cda65eb4bd1c5dd",
"score": "0.66275096",
"text": "def create\n @tipo_despesa = TipoDespesa.new(tipo_despesa_params)\n\n respond_to do |format|\n if @tipo_despesa.save\n format.html { redirect_to tenant_tipo_despesas_path(tenant_id: @tenant.id), notice: 'Tip... | [
{
"docid": "e03cfa89b46c3601d6dcbf045b44b163",
"score": "0.67029357",
"text": "def desafio_params\n params.require(:desafio).permit(:tipo, :titulo, :descripcion, :puntos)\n end",
"title": ""
},
{
"docid": "086561688445a54f33bb4b450d5c790f",
"score": "0.6579706",
"text": "def ... |
a5c1f4d4f939b6eed5792a79f3fa9a8e | validates_presence_of :fullname, :address, :phone, :province, :city, :post_code after_validation :fill_in_post_code | [
{
"docid": "bb212ee3c10771f4a0ba3e4ebd64ae89",
"score": "0.0",
"text": "def to_s\n \"#{fullname}: #{address}\"\n end",
"title": ""
}
] | [
{
"docid": "f140cad01c856125b2264b7b37d3bf99",
"score": "0.76384854",
"text": "def validate\n errors.add(:post_office, \"- must be filled for postalcode #{self.postal_code}\") if self.post_office.blank? && !self.postal_code.blank?\n errors.add(:postal_code, \"- must be filled for #{self.post_offic... |
4d343c8eaa27321cce14695da7e7cc10 | Make a HTTP request. | [
{
"docid": "d9ea981983ab766fd4391bf9951a937c",
"score": "0.0",
"text": "def request(method, path, params = {}, options = {})\n\n # Check the HTTP method us supported\n unless METHODS.include?(method)\n fail ArgumentError, \"unknown HTTP method: #{method}\"\n end\n\n # Open a c... | [
{
"docid": "054075da802fb3d951592d5ea499d40d",
"score": "0.82087797",
"text": "def do_http_request # :nodoc: internal use only\n http.do_request request # Some URLs can throw an exception here\n end",
"title": ""
},
{
"docid": "8a13af25dedcf141bd88bc51a5f9fee3",
"score": "0.78614... |
8250e0535df10f3ffa7a6292dc1d4291 | Special avatar for header1 | [
{
"docid": "f6a6103696ff0c290d4d958c8a6d7115",
"score": "0.73523825",
"text": "def header_avatar_for(user, options = { size: 80 })\n\n if (user.picture?)\n image_tag(user.picture.url, alt: user.name, \n class: \"avatar header avatar-size-#{options[:size]}\")\n else\n image_tag(\"/... | [
{
"docid": "58f94b058c30446c457c9e24a4c2223f",
"score": "0.73779565",
"text": "def avatar\n h.image_tag(\"avatars/#{object.avatar_image_name}\", class: \"avatar\")\n end",
"title": ""
},
{
"docid": "9839d43d01f9bceb308c0b285a7fb75a",
"score": "0.7280941",
"text": "def avatar\n ... |
42a31789582f8e0dd892eada5d082b9f | Add all required product dependencies | [
{
"docid": "8665f6b864db840e50475ef946a5b99a",
"score": "0.0",
"text": "def extend_template(products)\n dependences = create_dependences(products)\n main_products = create_main_products(products) # main_products is plugins\n if !main_products.empty?\n new_products = products.clone\n n... | [
{
"docid": "309cba58f97d8d1025557929e2de7851",
"score": "0.718942",
"text": "def install_dependencies\n @dependencies.each { |d| install_dependency(d)}\n end",
"title": ""
},
{
"docid": "faf62df4b403f1f9894b2c05ed35f6ea",
"score": "0.6972897",
"text": "def dependencies\n\... |
fcea5323e2cd6f48a1c71869a80d56d3 | Set the new email address and create an activation code so the user can confirm the new email account | [
{
"docid": "725bfb627a6f745f90844bc1b52001ca",
"score": "0.789486",
"text": "def new_email=(new_email)\n unless email == new_email\n self[:new_email] = new_email\n @updated_email = new_email\n make_activation_code\n end\n end",
"title": ""
}
] | [
{
"docid": "f2668b57aeb39fc5226f6890fd8247a3",
"score": "0.8463491",
"text": "def activate_new_email!\n self.email = self.new_email\n self.new_email = nil\n self.activation_code = nil\n save\n end",
"title": ""
},
{
"docid": "e2ce2e0ec822506bff914bbf8b767075",... |
247bde3ff244d2d361f1307802de8d1e | Event action. Remove customer from checkout, and tell checkout to advance next customer in line. Record departure time for stats. | [
{
"docid": "d18e78905f442123ed4bb25d0abd26a2",
"score": "0.63460404",
"text": "def run\n SoopaStore.checkout.occupied = false\n SoopaStore.checkout.start_next_checkout\n @customer.departure_time = SoopaStore.current_time\n puts \"Time #{SoopaStore.current_time} : Customer #{@customer.custo... | [
{
"docid": "08517d84d86e252945266e6c9c679280",
"score": "0.7604965",
"text": "def start_next_checkout\n unless @line.empty?\n customer = @line.pop\n self.occupied = true\n customer.time_to_checkout = @cashier.time_for_items(customer.num_groceries)+1\n event = CustomerDepartureEven... |
973665f05bf2da06e1d45158b7447242 | Retrieve current instance state === Return state(RightScale::OperationResult):: Success operation result containing instance state | [
{
"docid": "e1627ad65fd2c67cf82ebf868d263d8d",
"score": "0.76911205",
"text": "def report_state\n state = RightScale::OperationResult.success(RightScale::InstanceState.value)\n end",
"title": ""
}
] | [
{
"docid": "6fb0a53c29f6fb56402e8623768af6c5",
"score": "0.748774",
"text": "def status\n state\n end",
"title": ""
},
{
"docid": "275107278189c65717e42c960906d455",
"score": "0.7374873",
"text": "def state\n status.state\n end",
"title": ""
},
{
"doci... |
066675d4dedb4f6f6bebce652b9d552f | Execute the Choreo using the specified InputSet as parameters, wait for the Choreo to complete and return a ResultSet containing the execution results. | [
{
"docid": "1bb1abd0063aadc7c665d8dbf9172ed5",
"score": "0.0",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = USPostalCodesResultSet.new(resp)\n return results\n end",
"title": ""
}
] | [
{
"docid": "c4ca32683e8ce75eb6a187d63df8fa77",
"score": "0.76645887",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = DoneResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "6f7a7d9be674ad4cf17d6743eb1f7836",
"scor... |
a4a1890b99827df03b09a4cf15ce957b | momentum is a PVector | [
{
"docid": "2fcbcbbe54e4f8138b8fae92091f0335",
"score": "0.69058144",
"text": "def apply_momentum(mom)\n dv = mom.get # deep copy\n dv.div(@mass)\n @vel.add(dv);\n if $show_vectors\n stroke(0xDE6445);\n drawVector(dv,@loc,20);\n end\n end",
"title": ""
}
] | [
{
"docid": "b884e2d3b1df12f1ec7d49d1a3a962fb",
"score": "0.6298759",
"text": "def angular_momentum(moment_of_inertia, angular_velocity)\n return moment_of_inertia * angular_velocity.to_f\n end",
"title": ""
},
{
"docid": "aac2284a462740894f4ce63cd2a2e08b",
"score": "0.60967875",
... |
2922e141b3f45b6ba7fa917858e9c02f | Check for a valid skill name This will also automatically add the skill to the player if the skill exists, but the player does not have it. Returns the skill object if it exists, else returns nil. | [
{
"docid": "5407d1171d80f7c2164c6670cfd621b9",
"score": "0.81452525",
"text": "def skill_exists?(skill_name)\n # Check if the player has that skill\n ps = self.plyrskills.where(name: skill_name).first\n # We are done if the the player has that skill\n return ps if ps != nil\n\n # Now we n... | [
{
"docid": "9d1befa880139bf7530d2f3d6e4b930c",
"score": "0.69412714",
"text": "def skill_name\n skill ? skill.name : nil\n end",
"title": ""
},
{
"docid": "a29dc7409b7f16e28e48d8e84e6b2cc0",
"score": "0.65995014",
"text": "def create_skill(name)\n\tskl = Skill.find_or_create_by(n... |
0a2b874d692ce8d14f524f2ccd349fb3 | Public: Returns the `Variant` matching `name`, or nil if no such variant exists. | [
{
"docid": "7eb3605ed4e8c0ece91a9476c9a4f8fe",
"score": "0.79112685",
"text": "def variant(name)\n variants[name.to_s]\n end",
"title": ""
}
] | [
{
"docid": "37302f5b64bc2233b6a280d12dcf917b",
"score": "0.70291257",
"text": "def variant?(name)\n variants.key?(name.to_s)\n end",
"title": ""
},
{
"docid": "b870cfa900faa27812caa77038ff5e20",
"score": "0.6926985",
"text": "def find_by_name(name)\n nil_or_object(... |
fc04d4f425df4221ec532d063e06663f | validate card via transaction | [
{
"docid": "68d0021b44d28b50b5beca9d26dd73a5",
"score": "0.7887958",
"text": "def validate_card( credit_card, options ={})\n options[:order_id] ||= unique_order_number\n # authorize $1\n amount = 100\n result = process( 'validate', amount ) do |gw|\n gw.authorize( am... | [
{
"docid": "b8aaad41bad1d6320b24d570880737ab",
"score": "0.7537075",
"text": "def validate_card\n unless credit_card.valid?\n credit_card.errors.full_messages.each do |message|\n errors.add_to_base message\n end\n end\n end",
"title": ""
},
{
"docid": "903f98d386ac58c... |
48be73de0240bdf6ae36160a445b6f01 | POST /my_links POST /my_links.json | [
{
"docid": "34a5769eb3112d7d8e50b04164923dfe",
"score": "0.67806154",
"text": "def create\n @my_link = current_user.my_links.new(my_link_params)\n\n respond_to do |format|\n if @my_link.save\n format.html { redirect_to @my_link, notice: 'My link was successfully created.' }\n fo... | [
{
"docid": "8dd9616369f765ad57dcb5feed5e810e",
"score": "0.6855687",
"text": "def create\n @link = Link.new(link_params)\n\n if @link.save\n render json: @link, status: :created\n else\n render json: @link.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "1b277d7e217b0812d8c09bfba3ee82aa",
"score": "0.0",
"text": "def warranty_contract_params\n params.require(:warranty_contract).permit(:name, :description, :vendor_id, :warranty_type_id, :expiry)\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... |
47643f4d6cc1b907cce9ba326c5d7998 | N.B. So pretty print doesn't display huge xml doc | [
{
"docid": "ca9a6b2b1e4d42711160d67800c5eb6e",
"score": "0.0",
"text": "def pretty_print_instance_variables\n super - [:@doc]\n end",
"title": ""
}
] | [
{
"docid": "85e01d9c95cdc4299ab258626a736f28",
"score": "0.6968553",
"text": "def to_pretty_xml(indent=2, line_length=0, encoding='utf-8', preserve_base_uri=true)\n baos = Lang::ByteArrayOutputStream.new \n serializer = XOM::Serializer.new(baos, encoding)\n serializer.indent = indent... |
fb8f5cfe5a8493b288609842f2318fc5 | POST /products POST /products.json | [
{
"docid": "24ba14cf6aec7e09958e09c3ba045819",
"score": "0.0",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n else\n format.html... | [
{
"docid": "407bb6093aa234f76822a55ce5f56b4c",
"score": "0.76166385",
"text": "def create\n Product.create!(product_params)\n json_response(product_params, :created)\n end",
"title": ""
},
{
"docid": "3ddcbf5081b4581931f5cffb5d1126c4",
"score": "0.7605046",
"text": "def create... |
519ae73cd2bd408d84a8c42971f19a37 | update :last_login_date and :last_login_ip | [
{
"docid": "0655bc3c9ac80cd2aaad309444cf839a",
"score": "0.8144116",
"text": "def touch_login(ip)\n self.update_attribute(:last_login_date, DateTime.now)\n self.update_attribute(:last_login_ip, ip)\n self.save\n self\n end",
"title": ""
}
] | [
{
"docid": "c4818af753d15e2a9ceb99b5896ee88e",
"score": "0.746123",
"text": "def update_last_login_time()\n \tself.update_columns(:last_sign_in_at => Time.now)\n end",
"title": ""
},
{
"docid": "c7d43c45e44d6a9e3a0b74a8987ef942",
"score": "0.73608553",
"text": "def update_last_lo... |
829690f73f578b61171493492a08494b | Stops the immediate propagation of the event | [
{
"docid": "8c052e6b93746acd636171bb42223060",
"score": "0.8199583",
"text": "def stop_immediate_propagation\n `#{@event}.stopImmediatePropagation()`\n end",
"title": ""
}
] | [
{
"docid": "c4b8008b2c2c6eaaec6deb6da3852e3e",
"score": "0.780478",
"text": "def stop_propagation\n `#{@event}.stopPropagation()`\n end",
"title": ""
},
{
"docid": "3aad6170d345e4e9771913751f4d37d6",
"score": "0.73563296",
"text": "def stop\n `#@native.stopPropagation()`\n... |
33a682e35214061b13fcce56f23dfc60 | Problem Statement: Create a method 'random_select' which, when given an array of elements (array) and a number (n), returns n randomly selected elements from that array. | [
{
"docid": "9fc0ca2a5531c669dbeac6e7107fefbb",
"score": "0.86173946",
"text": "def random_select(array, n)\n result = []\n n.times do \n result << array[rand(array.length)]\n end\n result\nend",
"title": ""
}
] | [
{
"docid": "176dbd1a87b4bdbb7f06f082594e2bda",
"score": "0.8722239",
"text": "def random_select(array, n)\n random_elements=[]\n n.times do\n i=rand(array.length)\n random_elements.push(array[i])\n end\n return random_elements\nend",
"title": ""
},
{
"docid": "4a8f2fd2e6a7008c13bf5... |
f379a0be580d3984ea249ccfadc81d20 | GET /buy_and_keeps GET /buy_and_keeps.json | [
{
"docid": "7521269b9a322ddb21172cfb362eb531",
"score": "0.6989621",
"text": "def index\n @buy_and_keeps = BuyAndKeep.all\n end",
"title": ""
}
] | [
{
"docid": "66f15c7a9c503fe589711fa191582b4a",
"score": "0.685141",
"text": "def show\n @buy = Buy.find(params[:id])\n render json: @buy\n end",
"title": ""
},
{
"docid": "148cc8cd41ea830c69449e7cd21e4259",
"score": "0.6646158",
"text": "def market_buy(params = {})\n requ... |
71e9b80c4db043f3117b67d0d347b59f | override knock entity checking column on db | [
{
"docid": "63fccd7ba456db8a7533dbffe31890e8",
"score": "0.0",
"text": "def entity\n @entity ||=\n if entity_class.respond_to? :from_token_request\n entity_class.from_token_request request\n else\n entity_class.find_by username: auth_params[:username]\n end\n e... | [
{
"docid": "f630cce37cf39d1d5aef2574e327107c",
"score": "0.6187496",
"text": "def check_record; end",
"title": ""
},
{
"docid": "d7e93706a55d57f6cf59fde0f4b42d54",
"score": "0.61800534",
"text": "def has_attribute?(name)\n return true if self.class._has_virtual_column?(name)\n ... |
a30ca19820e22accb95df5ad38498d33 | Reset all rules for another run | [
{
"docid": "cc20c8a06e2c105654cecdaf8d105a9f",
"score": "0.7764716",
"text": "def reset\n @all_recurrence_rules.each(&:reset)\n @all_exception_rules.each(&:reset)\n end",
"title": ""
}
] | [
{
"docid": "b193e9a60978cb25ebb40aab08666267",
"score": "0.7461615",
"text": "def reset_rule_counts\n rules_collection.rules.each(&:reset_counter)\n end",
"title": ""
},
{
"docid": "8db31c8e625ddb3e638858bed9e186fc",
"score": "0.7235274",
"text": "def clean!\n @rules = {... |
643bab4ff8ebb44532ac3a28fa9c80a0 | Compare two strings with each other by extracting the digits | [
{
"docid": "11f5fb3c6796c3337a9ec3fb10748474",
"score": "0.78292465",
"text": "def stringnum_comparison(str1, str2)\n extract_digits(str1) <=> extract_digits(str2)\n end",
"title": ""
}
] | [
{
"docid": "1d79655ecdb13ce1d5bfe765602a601d",
"score": "0.72146195",
"text": "def same_digits?(a, b)\n return a != b &&\n a.to_s.split(/(?=.)/).sort == b.to_s.split(/(?=.)/).sort\nend",
"title": ""
},
{
"docid": "41f146520dbce5ec30e485cd7cc5e56c",
"score": "0.6791027",
"text": "... |
d709e2785a39a820f5071ba5c84ebb44 | Method to format detect labels reponse Author: Pankaj Date: 28/09/2018 Reviewed By: | [
{
"docid": "60c28fc720973d465008aac7b57d0cd6",
"score": "0.7360666",
"text": "def format_detect_labels_response(req_params)\n start_time = current_time_in_milli\n begin\n resp = client.detect_labels(req_params).to_h\n resp.merge!(request_time: current_time_in_milli-start_time)\n\... | [
{
"docid": "0296a0b93d9fecb2a974f438f7673580",
"score": "0.6539257",
"text": "def label\n tmp = JSON.parse(@analyzed_data.to_json)\n label = tmp['responses'][0]['labelAnnotations'][0]['description']\n label\n end",
"title": ""
},
{
"docid": "394d737b4b9932f8... |
b30115969a9b05954bd6719206792d34 | vi: set ft=ruby : | [
{
"docid": "fcb44ffca6cba9a9d28992e99abc2e4b",
"score": "0.0",
"text": "def shell_provision(node, command)\n node.vm.provision \"shell\", inline: command\nend",
"title": ""
}
] | [
{
"docid": "ec2907787e72211b44cc2c00733e16a4",
"score": "0.5803009",
"text": "def result_of_executing_the_commands\n @commands = \":set ft=ruby\r\" + @commands\n RobotVim::Runner.new.run(:input_file => @input, :commands => @commands)\nend",
"title": ""
},
{
"docid": "63222735a92c89aa22057d... |
84e389e5e71249531410110819082b58 | Set which adapter to use. Pass the adapter class directly. Example: LiveValidation.use(LiveValidations::Adapters::JQueryValidations) | [
{
"docid": "dd624f4fae5248dc10557f6349206fe3",
"score": "0.81499785",
"text": "def use(adapter_klass, options = {})\n @options = options.symbolize_keys\n \n case adapter_klass\n when String, Symbol\n adapter_name = \"LiveValidations::Adapters::\" + adapter_klass.to_s.camelize\n sel... | [
{
"docid": "e4746d269ef7d638c6497d6075b5da38",
"score": "0.8231112",
"text": "def adapter=(adapter)\n Adapter.use = adapter\n end",
"title": ""
},
{
"docid": "68b5305fe18c94ee0381d2c05ae35e1e",
"score": "0.75938666",
"text": "def default_adapter=(adapter); end",
"title": ... |
15f2401f845633f675ea6c4b63ed1e83 | the id here is the user id related to the resource being shown this is probably a bad idea e.g ticket.user.id = id then compare to session[:id] refactor: maybe use two methods: restricted_access (which checks user id's) and admins_only (which checks only for the admin role) | [
{
"docid": "0a3ccb5f832152c3107bb583184e0329",
"score": "0.77390957",
"text": "def restrict_access(id = nil)\n # whitelisting approach\n authorised = false\n\n # not checking for ownership, just role\n if session[:role] == 'admin'\n authorised = true\n\n # checking for ownership\n ... | [
{
"docid": "2706e5fa88d1f3b396a78a6723ba1e26",
"score": "0.77547187",
"text": "def check_if_admin_or_accessible\n if current_user.admin?\n return\n else \n ids = get_accessible_user_ids(current_user) \n if !ids.include?(params[:id])\n flash[:error] = \"You Do Not Ha... |