query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "94487d9153a144ddd2df729790e9caf1", "score": "0.0", "text": "def set_aws_security_group_egress\n @aws_security_group_egress = AwsSecurityGroupEgress.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6165152", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60463154", "text": "def action_hook...
23de88cb7c3c2d2aa1678b2e92666612
ensure user account is active
[ { "docid": "36a0b0b6fd7b332b28aef6574d8e9be6", "score": "0.0", "text": "def active_for_authentication?\n super && !deleted_at\n end", "title": "" } ]
[ { "docid": "645b5be9fd22302a28e8e64a0ac2e825", "score": "0.7623216", "text": "def user_active!\n \t\tif current_user && current_user.active == false\n \t\t\tsign_out current_user\n \t\t\tredirect_to new_user_session_path, notice:\"You don't have permissions.\"\n \t\tend\n end", "title": "" }, {...
9057506172fe653bea1d183896774faa
=== GET /manifest/edit/(:id) Redirects to edit_select if :id is not given.
[ { "docid": "3f3e718c159ed89494e2f8e9414601af", "score": "0.74852884", "text": "def edit\n __log_activity\n __debug_route\n return redirect_to action: :edit_select if identifier.blank?\n @item = edit_record\n manifest_authorize!\n prm = paginator.initial_parameters\n found = find_o...
[ { "docid": "e6d874717c312a00f594527ac4706ff5", "score": "0.6605349", "text": "def update\n @manifest = Manifest.find(params[:id])\n\n respond_to do |format|\n if @manifest.update_attributes(params[:manifest])\n format.html { redirect_to @manifest, notice: 'Manifest was successfully upd...
c5347933d62259717d6037fb97eff854
Identify the processor for the record, then add it
[ { "docid": "ddc8c2deb9126787a6c17faedd3557fd", "score": "0.56235", "text": "def add_row_to_sales_records(row)\n processor = get_processor(row)\n processor.add_sales_record(row)\n end", "title": "" } ]
[ { "docid": "37189a3679579b65c3ba7c2703fe5024", "score": "0.70600915", "text": "def AddProcessor(processor)\n if(!@ChainProcessors[processor.to_s()])\n @ChainProcessors[processor.to_s()] = processor\n end\n end", "title": "" }, { "docid": "d49b4f382d47a18cda7ddd5fc1d1b3d7"...
0b18c6f3c56f590dcc445695cf2d531a
Instantiates a new RSync Syncer object and sets the default configuration specified in the Backup::Configuration::Syncer::RSync. Then it sets the object defaults if particular properties weren't set. Finally it'll evaluate the users configuration file and overwrite anything that's been defined
[ { "docid": "e7179fa40a1ce825f1b3e0751f4e5dab", "score": "0.5151193", "text": "def initialize(&block)\n load_defaults!\n\n @directories = Array.new\n @additional_options ||= Array.new\n @path ||= 'backups'\n @port ||= 22\n @mi...
[ { "docid": "6b342a2adbe5b1f28ac9b471f342d598", "score": "0.63583463", "text": "def configure\n super()\n syncer_klass.configure(settings) if syncer_klass\n end", "title": "" }, { "docid": "be4d1ce76c6c1273da08ffe1c2702f0a", "score": "0.6356012", "text": "def rsync(...
243631733070c55f81eadb8ad1fc46fd
GET /ideas/new GET /ideas/new.json
[ { "docid": "5fa58c9f1c46871ba7158d61c420a1e5", "score": "0.71817195", "text": "def new\n @idea = Idea.new(:user_id => @user.id)\n\t@idea.user = current_user\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @idea }\n end\n end", "title": "" ...
[ { "docid": "fbc9bbfe7c2d8cf4fb8d11155b86f1f3", "score": "0.7842594", "text": "def new\n @Userideas = Userideas.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @Userideas }\n end\n end", "title": "" }, { "docid": "becd2d6dce48777ce3...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "40aed92fc271695b7dcc06b52326a9dc", "score": "0.0", "text": "def set_unidad\n @unidad = Unidad.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...
871a8dee8fa1fa928b7b80128519ef9d
GET /images/getimagelistforuser?userid=... GET /images/getimagelistforuser.json?userid=...
[ { "docid": "51c798d3f391359c69a23fe48241ebc5", "score": "0.8068273", "text": "def getimagelistforuser\n @images = Image.joins(:user).where(user_id: params[:userid]).select(\"images.id, users.username, description, privacy, time_stamp\").order(\"time_stamp DESC\")\n\n respond_to do |format|\n ...
[ { "docid": "4a4206313ee25af435627a1ab297df9e", "score": "0.7788031", "text": "def get\n img_id = request.headers['imageid']\n user_id = request.headers[Constants::HEADER_ID]\n if img_id != nil\n images = Image.where(author_id: @public_id.to_s, image_id: img_id.to_s)\n elsif user_id != nil\n im...
560f0d8aedd01632c45a7c7131f42cf7
Returns the custom group code for this lockbox by taking in the dollar amount field name in db
[ { "docid": "572cfe8b10251cffde9b1789beabef65", "score": "0.6752919", "text": "def group_code(amount_column)\n case amount_column\n when 'denied'\n 'OA'\n when 'service_no_covered'\n 'OA'\n end\n end", "title": "" } ]
[ { "docid": "5843d5e93d6b04b56644e304aa8d9a69", "score": "0.6697131", "text": "def group_code(amount_column)\n case amount_column\t\n when 'service_discount'\n 'PI'\n when 'denied' \n 'OA'\n when 'service_no_covered'\n 'OA'\n end\n end", "title": "" }, { "docid"...
68ff02952513c2b53ca36be1b334e844
Returns the body of get request, with option for passing a hash for filtering parameters
[ { "docid": "a430820b132b2b29b80fcf6fa0ab1f98", "score": "0.0", "text": "def get_table(scaffold, **filters)\n get_url = \"#{@device_address}/admin/scaffolds/#{scaffold}/index.json?api_key=#{@device_api_key}\"\n json_body = JSON.parse(Excon.get(get_url).body)\n\n if filters.any?\n filters.ea...
[ { "docid": "722fd08f16930d96bf0bf64d8af22657", "score": "0.63484734", "text": "def get\n request_object.get_query\n end", "title": "" }, { "docid": "e261b0377b95666ae35e84de6daf674e", "score": "0.6285159", "text": "def body_params(request)\n body = request.body.read\n r...
2f29b53709746ed667264b911b9d97ec
DELETE /todos/1 DELETE /todos/1.json
[ { "docid": "5c1a98bbf68f6eb432c175ebf533d991", "score": "0.7369491", "text": "def destroy\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to todos_url }\n format.json { head :no_content }\n format.xml { render xml: @todo }\n end\n end", "title": "" } ]
[ { "docid": "edb1a55951817c40c3f0a2a6c4172354", "score": "0.78317076", "text": "def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1be68e43980093e1ba24c40d34d4e56...
6703aa1ef4d2011f77f9727988924b79
The hand's score is an array starting with the base score, followed by the kickers.
[ { "docid": "0a9603dd6a79afc72f5fd79a76d952cf", "score": "0.80977213", "text": "def score\n [base_score] + kickers\n end", "title": "" } ]
[ { "docid": "5e6a0dfb7aee540ac522b6663a76224a", "score": "0.77740926", "text": "def score\n @score = [straight_flush, four_of_a_kind, full_house, flush, straight, three_of_a_kind, two_pair, one_pair, high_card]\n end", "title": "" }, { "docid": "450fc6aabb846df2e2df29a58d2bd6fb", "sco...
bd3a7dfddc30bc69012064ac1ec450c4
Given a hash with numeric values, return the key for the smallest value
[ { "docid": "11425eef7e689469ebcf343eaf7af4d7", "score": "0.0", "text": "def key_for_min_value(name_hash)\n\tif name_hash.empty?\n\t\treturn nil\n\tend\n\ttemp=nil\n\tname_hash.each do |key, val|\n\t\tif temp == nil || name_hash[temp] > val\n\t\t\ttemp = key\n\t\tend\n\tend\n\ttemp\nend", "title": ""...
[ { "docid": "10348c0f7efbf074c6402f6f47742839", "score": "0.88214123", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |key, value|\n if value < lowest_value\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\nen...
2b358a095673f0ac64896961650dac86
Sign user in. This method will set user auth token and user id.
[ { "docid": "3c44ca7353b05ad2e75fb4177e76767b", "score": "0.67049146", "text": "def login\n debug 'Trying to login'\n _response = self.signed_request '/api/v1/login', 'POST', {\n user: $config.get_username,\n password: $config.get_password\n }\n\n if _response['status'] != 'succ...
[ { "docid": "12db2346c020038b5418d7a12ded2285", "score": "0.77951324", "text": "def sign_in(user)\n user.regenerate_auth_token\n cookies[:auth_token] = user.auth_token\n @current_user = user\n end", "title": "" }, { "docid": "12db2346c020038b5418d7a12ded2285", "score": "0.779513...
06a44e2e2a96ad075370b2e8a6c46296
Write batch out to Solr and clear it
[ { "docid": "5a849d067e5e7bbaaa24cc769aafcbb2", "score": "0.68422115", "text": "def flush_batch\n add_documents(batcher.end_current)\n end", "title": "" } ]
[ { "docid": "e113ade412e230707b4a854a570626c5", "score": "0.6348058", "text": "def clear\n @lock.write_lock.lock\n @batch = []\n @batch_size_bytes = 0\n @lock.write_lock.unlock\n end", "title": "" }, { "docid": "f91bba222332eef60ff88557efeed440", ...
fb0dca9a59338a3bdf646c7d6c703bfb
GET /competitions/1 GET /competitions/1.json
[ { "docid": "fd9735b2e3fe2cb3bbca53b645c43c13", "score": "0.72155654", "text": "def show\n @competition = Competition.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @competition }\n end\n end", "title": "" } ]
[ { "docid": "6379638e957514df29efd4372e4a43b8", "score": "0.7821303", "text": "def index\n @competitions = Competition.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @competitions }\n end\n end", "title": "" }, { "docid": "1d8188...
f9fc2628388b43991e3c91e588bcff10
[String] the closing declaration of the heredoc source://syntax_tree//lib/syntax_tree/node.rb5939
[ { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.0", "text": "def value; end", "title": "" } ]
[ { "docid": "46821fa7e24d3d691f1013ed0b0b5e3e", "score": "0.82970256", "text": "def visit_heredoc_end(node); end", "title": "" }, { "docid": "80e0525c8b03a5bc725362995d23df36", "score": "0.78453785", "text": "def HeredocEnd(value); end", "title": "" }, { "docid": "b3f0f477...
a8fb49f4e7bee7e7a54515612d5f2cce
Sets weight variations from attribute list.
[ { "docid": "15fd2a867d9333ea680506bc11ef26db", "score": "0.7289543", "text": "def weights=(list)\n self.weights.clear\n for variation in list do\n v = OrderShippingWeight.create(variation)\n self.weights << v\n end\n end", "title": "" } ]
[ { "docid": "ceeff0da0ad56f7830b0710ad772486d", "score": "0.6759229", "text": "def set_weights(weights)\r\n # Current index of 'weights'\r\n index = -1\r\n # There might be a better way to do this...\r\n @layers.each do |layer|\r\n layer = layer.map {index += 1; we...
2557b9f1d8f5c3a7f518ea9018ac4c8e
Ths retrieves the rule mode
[ { "docid": "842962024cba8467e8d97f94377c4751", "score": "0.69011706", "text": "def get_mode\n @mode\n end", "title": "" } ]
[ { "docid": "0f497c8ad1765afb2dbcc46fa859983d", "score": "0.71372575", "text": "def get_mode\n @situation[:mode]\n end", "title": "" }, { "docid": "132cdcdd26434eb7458f09f53fb45882", "score": "0.70013225", "text": "def rule_type; end", "title": "" }, { "docid": "d9957d...
635e88399844f69c604d4228b62f1770
With backtrace capturing do
[ { "docid": "2fdd43c7352ded017f8df8c5b742fdc1", "score": "0.60402036", "text": "def with_backtrace(&block)\n begin\n log \"Yielding backtrace block\"\n yield if block_given?\n Snooze::Post.snooze!\n rescue Exception => detail\n handle_post_response { Snooze::Post.exception!(@clo...
[ { "docid": "8d510d204857c8b08237bfe03c7e858b", "score": "0.82707137", "text": "def backtrace; end", "title": "" }, { "docid": "836e4098f4956448508e2a3d1241024a", "score": "0.80889213", "text": "def backtrace\n end", "title": "" }, { "docid": "7b5c97cac650483de851ecfe52d8...
604b35a9cfee66508260364c4241cc96
Removes given contact from a list.
[ { "docid": "c6899497372cfc899eb9ac7a4e2d971a", "score": "0.0", "text": "def api_segments_id_contact_lead_id_remove_post(id, lead_id, opts = {})\n api_segments_id_contact_lead_id_remove_post_with_http_info(id, lead_id, opts)\n nil\n end", "title": "" } ]
[ { "docid": "35d41d76d05bd3aeffe8387f0eca437f", "score": "0.79662585", "text": "def delete_contact_from_list(contact, list_id)\n @api.delete_contact_from_list(contact.id.to_i, list_id.to_i) if in_list?(contact, list_id)\n find(contact.id)\n end", "title": "" }, { "docid": "30cd0b70627c...
63871a2d9995427a609810208208d3bd
POST /instructions POST /instructions.json
[ { "docid": "7358321181a81480b89de65dac950f4b", "score": "0.6342881", "text": "def create\n @instruction = Instruction.new(instruction_params)\n\n respond_to do |format|\n if @instruction.save\n format.html { redirect_to @instruction, notice: 'Instruction was successfully created.' }\n...
[ { "docid": "d76f03818d7036aa6466f1a9f749ad18", "score": "0.6589161", "text": "def create\n @instruction = Instruction.new(params[:instruction])\n\n respond_to do |format|\n if @instruction.save\n format.html { redirect_to @instruction, notice: 'Instruction was successfully created.' }\...
5d056d834ddba747b3e10b4f7c3c1add
Get Product Serial Numbers of a particular product
[ { "docid": "1eff35371ad3ee659e327f105a3953cc", "score": "0.528294", "text": "def selected_description\n response = []\n begin\n @products = Product.find(params[:id], :conditions => \"is_enable = TRUE\")\n if @products.is_serial_number\n @serials = @products.product_serial_numbers....
[ { "docid": "3904dd806e76e043b15eab83dbfa54e9", "score": "0.65298414", "text": "def part_number\n productnum\n end", "title": "" }, { "docid": "923bdf97dbd4572b7af56785f9907e68", "score": "0.63994986", "text": "def get_serial_number(data)\n data['product']['serial_number'] || '...
97b4a1ce388daae34f821df783fa8969
required parameters: name: alert_name, type: String name: project_name, type: String optional parameters: name: _region, type: String name: page, type: Integer name: page_size, type: Integer
[ { "docid": "2321dc98dfee8219ec1663db9d68b589", "score": "0.50617385", "text": "def list_dimensions(alert_name, project_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'GET'\n\t\targs[:path]['AlertName'] = alert_name\n\t\targs[:path]['ProjectName'] = project_name\n\t\targs[:patt...
[ { "docid": "b38528d548750ee4b2b146f04e86d349", "score": "0.6436682", "text": "def list_alert(project_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'GET'\n\t\targs[:path]['ProjectName'] = project_name\n\t\targs[:pattern] = '/projects/[ProjectName]/alerts'\n\t\targs[:query]['Ac...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "10a46d81ec62e9c97572fe10be5a6233", "score": "0.0", "text": "def set_post\n @post = Post.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;...
ba5fc629f12a6fb42308028d6fa76db5
A single iteration of the loop above
[ { "docid": "9b165bff3107eabe23e8e7e3ec65eaac", "score": "0.0", "text": "def produces(state12, cfg)\n\t\tprod = []\n\t\tcfg.each do |key, values|\n\t\t\tvalues.each do |one_value|\n\t\t\t\tif one_value == state12\n\t\t\t\t\tprod << key\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tprod\n\tend", "title": "" ...
[ { "docid": "54f970ee5768d76a8818f20a25600939", "score": "0.7691001", "text": "def looping", "title": "" }, { "docid": "17966ac7ffda6a58d4fd24706fc4ee23", "score": "0.68770325", "text": "def iterations; end", "title": "" }, { "docid": "9cf2ed47c53c7d5e549943c11ba95011", ...
1e190a152b3ebc129aaf4a60b36d31a6
pins info from users boards
[ { "docid": "406617df35673cf942bb9c70d43e22dd", "score": "0.5984332", "text": "def get_pin_info_from_board(pin_html, index, args)\n pin = Pin.new\n puts \"Crawling #{index}th pin of board #{@current_user_slug}/#{args[:slug]}\" if args[:slug]\n\n source_of = pin_html.css(\".convo.attribution .NoI...
[ { "docid": "c7e7ea8e5aa405bf78cf4237fdc00714", "score": "0.6503155", "text": "def boards\n return @boards if @boards\n \n @boards = {}\n res = get \"http://pinterest.com/#{username}/\"\n soup = Nokogiri::HTML(res.content)\n\n div_boards = soup.css(\"div[class=\\\"pin pinBoard\\\"]\")\n...
1ecc4f179cd1e9cbc201c54575fe27e5
Deletes a Self tax provider postalCode Deletes a Self tax provider postalCode.
[ { "docid": "8221cb7862e24619c473c2110abcf1d3", "score": "0.73005986", "text": "def delete_tax_provider_self_postal_code(postal_code, tax_postal_code, opts = {})\n delete_tax_provider_self_postal_code_with_http_info(postal_code, tax_postal_code, opts)\n nil\n end", "title": "" } ]
[ { "docid": "87f4e77ad612b03ca6df303fb56d094b", "score": "0.6666764", "text": "def delete_tax_provider_self_postal_code_with_http_info(postal_code, tax_postal_code, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TaxApi.delete_tax_provider_self_pos...
aecffdca28599a078cda98593af0da93
Get list of existing zones
[ { "docid": "1daab0dac8375a6539b5b6eba9893451", "score": "0.8543254", "text": "def list_zones(headers = {})\n get!(\"zones\", {}, headers)\n end", "title": "" } ]
[ { "docid": "6309a59333c1972d4bec41d98ad6c5c3", "score": "0.8607116", "text": "def list_zones\n params = {\n 'command' => 'listZones',\n 'available' => 'true'\n }\n json = send_request(params)\n json['zone'] || []\n end", "title": "" }, { "docid": "630...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "918740afef95213f6b669a2fbadd22a7", "score": "0.0", "text": "def bookmark_params\n params.require(:bookmark).permit(:user_id, :url, :title, :description, :votes)\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...
542366b3fedb845ed495c64833cd76b1
Return an ordered array of pairs where the first item is a TieBreak instance and the second is true or false according to whether the tie break is selected for the current tournament.
[ { "docid": "4e5f9418d22d5853b811fd8f1842be27", "score": "0.686753", "text": "def tie_break_selections\n selected = (tie_breaks || '').split(',')\n selections = []\n used = Hash.new\n selected.each do |tb|\n rule = ICU::TieBreak.identify(tb)\n if rule\n selections << [rule, t...
[ { "docid": "461b76eb8d6b7350ddd835fb73abc225", "score": "0.58751136", "text": "def array_with_true_if_win(first, second, winning_hash)\n array = []\n winning_hash.each do |key, value|\n array << (first.to_sym == key && second.to_sym == value[0])\n array << (first.to_sym == key && second.to_sym =...
ec457abe60c9a27d3e089971f3a7f492
moved into app/helpers/sessions_helper.rb (removed to eliminate code duplication) def signed_in_user to require users to be signed in, we define a signed_in_user method and invoke it using before_filter unless signed_in? store_location redirect_to signin_url, notice: "Please sign in." end end
[ { "docid": "e81db31c43b8d23605e6d6810b9cea11", "score": "0.0", "text": "def correct_user # to require correct user\n @user = User.find(params[:id])\n redirect_to(root_path) unless current_user?(@user)\n end", "title": "" } ]
[ { "docid": "73c328968ea47db1fd69ef80700cce2f", "score": "0.88931847", "text": "def signed_in_user\n # Listing 9.18: Adding store_location to the signed-in user before filter.\n # redirect_to signin_url, notice: \"Please sign in.\" unless signed_in?\n unless signed_in?\n store_location\n ...
ca014175f77233924a109c734997fa01
GET /songs/new GET /songs/new.json
[ { "docid": "7300130da5d38e5d86e9b511fda84b52", "score": "0.73255026", "text": "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n end\n end", "title": "" } ]
[ { "docid": "509ef7b6cddbac159a7b1eaecf297b51", "score": "0.82548463", "text": "def new\n @song = @playlist.songs.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @song }\n end\n end", "title": "" }, { "docid": "7a3883413125f92dbc19d...
7a2bd7a9fdfe2efc89e2b3b918707dbf
GET /comm_types GET /comm_types.json
[ { "docid": "9de496c6250609b3f19d8a899bb3f218", "score": "0.74115497", "text": "def index\n @comm_types = CommType.all\n end", "title": "" } ]
[ { "docid": "2e3a95ae2c5493eb37db0cd2a130ebf0", "score": "0.6509708", "text": "def index\n respond_to do |format|\n format.html # index.html.erb (no data required)\n format.ext_json { render :json => find_contract_types.to_ext_json(:class => ContractType, :count => ContractType.cou...
e6c4a6e1cec1cc94fc8dda768a983465
GET /foo59s/1 or /foo59s/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "66ccbf17c31a1d47d3a12a1560789c8d", "score": "0.61231667", "text": "def get_aos_version(args = {}) \n get(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "title": "" }, { "docid": "719f324fd7e76ace60f0d241da747193", "score": "0.60954785", "text": "def get_aos_ve...
5b5f09a1445e26345826ce84f425eef0
Format an amount using the formatter
[ { "docid": "890bd4d1e0fb5981d43af76e283b5cae", "score": "0.7089891", "text": "def format_amount(amount, locale)\n l = R18n.locale(locale)\n l.localize(date, amount)\n end", "title": "" } ]
[ { "docid": "2f30275fe0366336855b51536f68df60", "score": "0.777912", "text": "def format_amount\n number_to_currency(self.amount, precision: 2)\n end", "title": "" }, { "docid": "4a67824d18e5a78a6d483c5e4f66604d", "score": "0.7765337", "text": "def amount\n format_amount(@amo...
7a9cf9daf4deefcbf66d88cd215dca1d
Sends an API request to start (resume) the server. Returns true if the API call succeeds. >> server.start() => true
[ { "docid": "ccf274a520ba3b5b8841c2474625656c", "score": "0.6317673", "text": "def start()\n data = JSON.generate(:resume => nil)\n response = @compute.connection.csreq(\"POST\",@svrmgmthost,\"#{@svrmgmtpath}/servers/#{URI.encode(self.id.to_s)}/action\",@svrmgmtport,@svrmgmtscheme,{'content-typ...
[ { "docid": "18ff3e410556eba2cc58a1bad4c400f0", "score": "0.6953328", "text": "def start\n api = @settings[:api] || {}\n bind = api[:bind] || \"0.0.0.0\"\n port = api[:port] || 4567\n start_http_server(bind, port)\n super\n end", "title": "" }, { "docid...
c17c81973a0226fbf206a2e4be1f23af
Grades into the given +Course::Assessment::Answer::AutoGrading+ object. This assigns the grade and makes sure answer is in the correct state.
[ { "docid": "735d1b91df85ceffb11864ef519511cd", "score": "0.55897254", "text": "def assign_maximum_grade(answer)\n answer.correct = true\n answer.evaluate!\n\n if answer.submission.assessment.autograded?\n answer.publish!\n answer.grade = answer.question.maximum_grade\n ...
[ { "docid": "2575dd81ecf33e49fb0fa34cd788d9dc", "score": "0.67928755", "text": "def grade(answer)\n grade = evaluate(answer)\n answer.evaluate!\n\n if answer.submission.assessment.autograded?\n answer.publish!\n answer.grade = grade\n answer.grader = User.system\n end\n answ...
d316350c0ee73e39d3377f87ff906a19
DESCRIPTION Get a message based on a particular message code. PARAMETERS message_code (Symbol) A message_code. RETURN Return a status message.
[ { "docid": "2dad677a23cd156cd7672c03f5765fb7", "score": "0.7799584", "text": "def get_message(message_code)\n message = case message_code\n when :save_ok then 'File saved.'\n else 'This message code was not recognised.'\n end\n end", "title": "" } ]
[ { "docid": "f617b9ae4d03f4fd164e734e5c7c2aa0", "score": "0.67561316", "text": "def message\n RESPONSE_MESSAGES[code]\n end", "title": "" }, { "docid": "d4f94675dad65d5957c8e9bb93d8ec74", "score": "0.6641151", "text": "def get_message(message_id)\n results = @client.get...
aaa39096141663fbde81f9f571f68140
= Layers List of available layers
[ { "docid": "9b44ebabf4a1c83b4d157e669d398f48", "score": "0.56051064", "text": "def each_layer options = {}\n doc = Nokogiri::XML(self.search :layers => nil)\n ap({:each_layer_doc => doc, :xpath => Layer.root_xpath}) if $DEBUG\n doc.xpath(Layer.root_xpath + '/name/text()').each { |l|\n ...
[ { "docid": "0b44ca6869edc528ae22fc0f9d46a530", "score": "0.7649333", "text": "def layers\n stack_layers.map(&:name)\n end", "title": "" }, { "docid": "9839f374eedb246423afa884fee64645", "score": "0.75647193", "text": "def layers\n result = []\n @config_layers.ea...
e24df31ed581003f9c84219b4cc577f9
DELETE /profile/1/tags DELETE /profile/1/tags.json
[ { "docid": "6444ff9b0914c7d9ae5bf6d0f67b2e7f", "score": "0.7555454", "text": "def destroy\n tag = params[:id] # 'tag'\n old_tags = @profile.relations_from(current_profile) # ['tag1', 'tag2', ...]\n new_tags = old_tags - [tag] # ['tag1', 'tag2', ...] - ['tag']\n current_profile.tag(@profile, ...
[ { "docid": "d67c29208071bc07677edfe1b1e5ef52", "score": "0.74303764", "text": "def tagDelete(tag)\n http, req = initReq(\"tags/#{tag}\", \"DELETE\")\n http.request(req).body\nend", "title": "" }, { "docid": "d67c29208071bc07677edfe1b1e5ef52", "score": "0.74303764", "text": "def tag...
e91c77f0c2e5100388cbfb8a25489259
Create a new element action:: Action URL method:: Action URL method keyword_args:: additional attributes
[ { "docid": "0b4a11d5df308bab0dc45134c575bbbc", "score": "0.0", "text": "def refer(action: T.unsafe(nil), method: T.unsafe(nil), **keyword_args); end", "title": "" } ]
[ { "docid": "455f9faa66f4ff2c7457d124e64da188", "score": "0.7027219", "text": "def create_element(params)\n end", "title": "" }, { "docid": "0fe29655b15e58374694f56437504a06", "score": "0.6249005", "text": "def create\n #Each element could be tied to an ApiKey or set of ApiK...
f647a8364bc4391bfcec4f3c5304b05b
Returns a Boolean indicating whether this character is a fullwidth latin character. (This string must contain only one character.)
[ { "docid": "9e60cfd572701b6e4dbded81deedad9b", "score": "0.671197", "text": "def wide_latin?\n codepoint.wide_latin?\n end", "title": "" } ]
[ { "docid": "f84cf7563c592ca59c861ecbdd05141e", "score": "0.7055126", "text": "def is_latin_only?(input)\n !!(input.match(LATIN_ALPHABET_PLUS_SYMBOLS))\n end", "title": "" }, { "docid": "cd88224827ba4ac31bfbf0a8984fc2a8", "score": "0.70407486", "text": "def unicode?\n self.lo...
423045e8f2b5615e5c8c82990745d628
convert blocked flag from String (rally side) to true bool; simplifies coding
[ { "docid": "e7d2dd832255e69254340093a27e4a38", "score": "0.0", "text": "def blocked?\n return (@ref.blocked == \"true\") ? true : false\n end", "title": "" } ]
[ { "docid": "02f81346f5289a4b3b2c57e4cf46133e", "score": "0.6848934", "text": "def convert_rule_flag(value)\r\n if value == 'ignore'\r\n return value\r\n end\r\n if value == 'IGNORE'\r\n return value\r\n end\r\n return (value) ? false : true\r\n e...
270244e650e7a57459e965c3b0ca9347
rtn a specific list of todo items; equiv to
[ { "docid": "ef80686be1f5dc7b1a324be19da08baa", "score": "0.5886146", "text": "def get_todos(data_store, id, list, mode)\n mode ? data_store.find_todos(id) : list[:todos]\nend", "title": "" } ]
[ { "docid": "6786eaeb6ba98d3cf40bd0235123c957", "score": "0.70962286", "text": "def get_items(projectid, todolistid)\n get(\"projects/#{projectid}/todolists/#{todolistid}.json\")\n end", "title": "" }, { "docid": "6d6c288bbdf2d6eec492dc52784eeef2", "score": "0.69148654", "text": "...
3482cb75706cc894fab57f24fb51aa84
Check that the preconditions fail when you are over the defined limit of the maximum number of nodes in each way.
[ { "docid": "d801a36aac4b6f570bcf363854089063", "score": "0.69190884", "text": "def test_max_nodes_per_way_limit\n node_a = create(:node)\n node_b = create(:node)\n node_c = create(:node)\n way = create(:way_with_nodes, :nodes_count => 1)\n # Take one of the current ways and add nodes to i...
[ { "docid": "115bc630cc23fcf888ed0cffa90c55bb", "score": "0.6401719", "text": "def node_limit(_, __)\n true\n end", "title": "" }, { "docid": "7e32c290a36fcc176bf07caf155e7a0f", "score": "0.6173368", "text": "def check_maximum_table_count\n if @state.opened_table_coun...
d7167de5e063c11b7e3c42512c082bfa
push the template onto the key
[ { "docid": "2ef8ab5eaf405a56945800a9f977ff53", "score": "0.86589235", "text": "def push(key, template)\n self[key.first][key.last] = template\n end", "title": "" } ]
[ { "docid": "ead4526bd8d3172d1372f0aee65fb0fb", "score": "0.6812763", "text": "def update_template(key, value)\n t = { key => value }\n raw = read_attribute(\"template\") \n d = raw.nil? ? {} : JSON.parse(raw) \n merged = d.deep_merge(t)\n self.template = JSON.generate(merged)\n self.s...
b4b379932ef6e1cd18f4d1786f694f82
Searches for eBay items by various query parameters and retrieves summaries of the item
[ { "docid": "4b675988f4284c22a5a4cf928b3e60a8", "score": "0.743362", "text": "def search(params = {})\n url = build_url('item_summary', 'search')\n http.headers(build_headers).get(url, params: params)\n end", "title": "" } ]
[ { "docid": "79bc80eabc6b4da7fc6f6851d918842f", "score": "0.71084386", "text": "def search(params={:SearchIndex => :Books, :ResponseGroup => :Medium})\n response = call(params.merge(:Operation => :ItemSearch))\n arrayfy(response['ItemSearchResponse']['Items']['Item']).map {|item| handle_type(it...
4e43c68089b031a27aa269f866522b95
Provide a user friendly representation source://twilioruby//lib/twilioruby/rest/chat/v2/service/user.rb143
[ { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.0", "text": "def to_s; end", "title": "" } ]
[ { "docid": "c6fc9887c7052e008bd35abd43a1f109", "score": "0.7255443", "text": "def to_s\n s = \"User:\"\n s += \"\\n\\tuser_id: \" + user_id.to_s\n s += \"\\n\\tname: \" + name.to_s\n s += \"\\n\\treal_name: \" + real_name.to_s \n s += \"\\n\\tsubscribers: \" + subscribers.to_s\n s += \...
be72bb485c0687b638ca670db435f04f
GET /frbr_expressions/1 GET /frbr_expressions/1.json
[ { "docid": "15aae9277cb055df14560002d0950de1", "score": "0.6647428", "text": "def show\n screen_name(\"Admin-Mostrar-Expresion-FRBR\")\n @frbr_expression = FrbrExpression.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @frbr_expr...
[ { "docid": "4e036f218bb825d30289b40af917b5d3", "score": "0.6858074", "text": "def index\n screen_name(\"Admin-Indice-Expresiones-FRBR\")\n @frbr_expressions = FrbrExpression.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @frbr_expressions }\...
8f395f95abfebf2093bb205424cd1b4a
prefix id with V (for virtual) if using id from answers table
[ { "docid": "3c998fb8b2c1a6b6685ec377c9153b43", "score": "0.6498025", "text": "def answer_id answer\n answer.id || \"V#{answer.answer.id}\"\n end", "title": "" } ]
[ { "docid": "4fe525bd68f98322e2536fbf44e3d0bf", "score": "0.58349323", "text": "def answer_lookup_field\n :inverse_answer_id\nend", "title": "" }, { "docid": "a26108a84601b0f7c24d8290fdb3bb5c", "score": "0.53342336", "text": "def set_v1_answer\n @v1_answer = V1::Answer.find(para...
01c11dae01bef78dd649674526701a1f
Return the cloud object's idea of where it lives (project, account, etc) in the form of an identifier. If not applicable for this object, we expect to return +nil+.
[ { "docid": "5b97e6dea0d6b74e4dc8f4fee9f79cb6", "score": "0.0", "text": "def habitat(nolookup: true)\n return nil if [\"folder\", \"habitat\"].include?(self.class.cfg_name)\n if @cloudobj \n @cloudparentclass.habitat(@cloudobj, nolookup: nolookup, deploy: @deploy)\n ...
[ { "docid": "a3fdf50a7d5e7a569c1fd83be30547e6", "score": "0.65958655", "text": "def object_id() end", "title": "" }, { "docid": "4046d75454fc40e0a2a7e5529b63db79", "score": "0.650722", "text": "def object_id\n object.object_id\n end", "title": "" }, { "docid": "b45fe4e...
326a9724b14978c805c70d332a15a411
Sets validation this step uses to verify that this step is completed
[ { "docid": "d16b63137865934c2a7764640114a0d7", "score": "0.0", "text": "def is_complete(&block)\n self._is_complete = block\n\n self\n end", "title": "" } ]
[ { "docid": "f2fe3a4c74be44a7db5f2c228aba7cf3", "score": "0.7061669", "text": "def validation=(value)\n @validation = value\n end", "title": "" }, { "docid": "de736179d9fab6f38771978e84e8e8b0", "score": "0.7054799", "text": "def validate\n @ran_validation ...
563ede799b74bd1d1c6cec451f6ff503
create method for seeing all users
[ { "docid": "2a0dac98c73965a8f60c1b90808a823d", "score": "0.0", "text": "def display_all_users\n #returns the users hash. Ideally this is in a better list format, next step to research better formatting\n return $users\n end", "title": "" } ]
[ { "docid": "4f63c095708266ac4f3a8500581a8cc4", "score": "0.8664079", "text": "def all_users\n \n end", "title": "" }, { "docid": "d670be7af797ffc96c3f1e4caac8841f", "score": "0.7995714", "text": "def index\r\n get_users \r\n end", "title": "" }, { "docid": "2...
8b25dcd7ac134ad881ad1d8ad41beab6
Mark message as read and associate it to the reader object.
[ { "docid": "0bd77e23f43c52f74c3b846f4d4996a7", "score": "0.56905615", "text": "def read_by!(reader)\n readings.create(:reader => reader) unless read_by?(reader)\n end", "title": "" } ]
[ { "docid": "605e7327b1c82d69b0d7d67e05b6de21", "score": "0.8088847", "text": "def mark_as_read reader\n self.received_messages.where([\"recipient_id = ? \", reader]).each { |each| each.mark_as_read }\n end", "title": "" }, { "docid": "13637d7a18fee2947e0e9f540c47fa0d", "score...
1c3e4c25b26d4dd5bd242e7d612b7351
Returns the value of attribute keys. source://capybara//lib/capybara/selenium/node.rb635
[ { "docid": "2b1d968915b6d34d86fd4721378f550b", "score": "0.0", "text": "def keys; end", "title": "" } ]
[ { "docid": "fc4e485b436aadb1800f3cb7f50f894b", "score": "0.72050524", "text": "def keys\n attribute_nodes.map(&:node_name)\n end", "title": "" }, { "docid": "7a62a777bb688bfea990649684c6cb3b", "score": "0.7036889", "text": "def attributes\n node.attributes[key]\n ...
5eb25d38f5f868d9a3cfc3b80c8575dd
GET /skill_builds/new GET /skill_builds/new.xml
[ { "docid": "47645ff9375b259de4599f11f5d6c332", "score": "0.7165869", "text": "def new\n @skill_build = @strategy_guide.build_skill_build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @skill_build }\n end\n end", "title": "" } ]
[ { "docid": "e59e713e959bf2de6bc70c4b64d2f84a", "score": "0.7066206", "text": "def new\n expire_page :action => :index\n expire_page :action => :show\n \n @hudson_build_status = HudsonBuildStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :...
4d15d0952231303bfeee5c92911fb271
Sum up all stat fields within the collection and return the result as a hash
[ { "docid": "171eacf2031c29e4b0a5ae17302003e6", "score": "0.698351", "text": "def summarize\n sums = Hash.new\n @batting_stats.each do |stat|\n @keys.each do |key|\n if sums[key]\n sums[key] += stat[key] if stat[key]\n else\n sums[key] = stat[key]\n end\n...
[ { "docid": "e0b4e4ad40d539c340b1c238b72b39f9", "score": "0.69116986", "text": "def sumas_for(attribute)\n stats = send(\"by_%s_suma\" % attribute, :reduce => true, :group => true)\n h = {'all' => 0}\n stats['rows'].each {|s|\n h[s['key']] = s['value']\n h['all'] +=...
fdd6e35b43d3317cba8db03bc8fe9e9c
Returns the value of the xth nodeName, returns "" if not found
[ { "docid": "d77dfd7b5f1effdf61f8a3f5ee44131f", "score": "0.6174497", "text": "def searchForValueAtPos(xml, nodeName, index)\n\n if xml.name == nodeName\n if @searchForValueAtPosCount == index\n xmlTemp = xml.children[0]\n if xmlTemp != nil\n if xm...
[ { "docid": "96ef30723d8615e66c076e6514172e53", "score": "0.71431744", "text": "def value_of_node(node_name)\n value_of_nodes(node_name).first\nend", "title": "" }, { "docid": "be8e4bcce1c89ea14c1559314aa882d6", "score": "0.6862125", "text": "def nodeName\n @name\n end", ...
0bea32d4041ecc53106ce5df6256eb9c
PATCH/PUT /park_profiles/1 PATCH/PUT /park_profiles/1.json
[ { "docid": "505024463a3826c733de8f5a124bdc59", "score": "0.71774304", "text": "def update\n respond_to do |format|\n if @profile.update(park_profile_params)\n # format.html { redirect_to @profile.user, notice: 'Profile was successfully updated.' }\n format.html { redirect_to users_ur...
[ { "docid": "abcf5b2299ddc866d6582157a3e71248", "score": "0.6859643", "text": "def update \n profile = Profile.find(params[:id])\n profile.update(profile_params)\n render json: profile, status: :created \n end", "title": "" }, { "docid": "89a7f5b52a77e894f6bd...
e75157d99af199d563d8601fa49e1209
GET /activities GET /activities.xml
[ { "docid": "a8a9b644c312d17e0a05f9315a152d1f", "score": "0.0", "text": "def index\n @filter = ActivityFilter.new(params[:filter])\n unless params[:filter]\n @activities = current_user.activities.includes([:target, :object, :user, :object, :actor, :tags]).order(\"posted_time desc\").all\n e...
[ { "docid": "21b623c965d25101ab1fde88c8821fca", "score": "0.82440776", "text": "def activities\n get_call(\"1/activities.json\")\n end", "title": "" }, { "docid": "66e0ea9ac48ce37079941ace7e88de8e", "score": "0.79941064", "text": "def activities(params = {})\n scope 'defa...
4219af5eb6e9ed2dd7392da10ef228b9
Construct exact hash we want
[ { "docid": "e05c8cdd6b266130ace6ab24318f4a84", "score": "0.0", "text": "def convert_to_hash(node)\n { id: node.content[:id], name: node.name, parent_folder_id: node.parent.content[:id] }\n end", "title": "" } ]
[ { "docid": "ff7f2a6fa6dca9d9a76baf55582b7135", "score": "0.715929", "text": "def build_hash_for(body)\n hasher = OpenSSL::Digest.new('sha256')\n hasher.hexdigest(body)\n end", "title": "" }, { "docid": "bdbb505fbcaa069311601830ee4b7f7b", "score": "0.7015735", "text...
250c1fd2fc6ec7508bf621545db7a067
Access the result of the task without waiting. May be nil if the task is not completed. Does not raise exceptions. source://async//lib/async/task.rb147
[ { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.0", "text": "def result; end", "title": "" } ]
[ { "docid": "7ce09f5b546666a31638983e88b1f56a", "score": "0.7813824", "text": "def result\n raise 'Task has errored out' if has_errored?\n raise 'Task has not completed' unless is_finished?\n @thread[:result]\n end", "title": "" }, { "docid": "5c5735af049ce2bb14961fcd0a5f6409", ...
bfbcddcc918ef40f76e5014276919dbc
Preview this email at
[ { "docid": "c9592a2ad4fd5c17c1a9665d8276bc00", "score": "0.0", "text": "def shipped\n OrderNotifierMailer.shipped\n end", "title": "" } ]
[ { "docid": "f4f01bf0c4f6341760a71d13d7b6cc72", "score": "0.7310511", "text": "def preview_email\n email = UserMailer.emailing(@emailing)\n mail_inliner = Roadie::Rails::MailInliner.new(email, Rails.application.config.roadie)\n mail = mail_inliner.execute\n\n mail.html_part.decoded.gsub /http...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ff57559d470adf8673db9ccdf61cd03b", "score": "0.0", "text": "def set_avisodetail\n @avisodetail = Avisodetail.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...
d44db06bb30b57505bc73e04a5d2456c
GET /sale_details/new GET /sale_details/new.json
[ { "docid": "485a61f3e4bc0b3ed491c20d9824bfca", "score": "0.7874768", "text": "def new\n get_data\n @sale_detail = @sale.details.new\n @sale_detail.quantity = \"\"\n @sale_detail.price = \"\"\n @sale_detail.discount = \"\"\n end", "title": "" } ]
[ { "docid": "2dfc2bb805c8346acb37567aa0a8536a", "score": "0.8255745", "text": "def new\n @sale = Sale.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sale }\n end\n end", "title": "" }, { "docid": "2dfc2bb805c8346acb37567aa0a8536a"...
f0a8c4b21a0803230a40d33e729014c6
Wait for all available bus events and notifications to be processed
[ { "docid": "f89cff099b525e4a5d4d29ba83c562d1", "score": "0.0", "text": "def wait_for_queues_to_complete_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: TestApi.wait_for_queues_to_complete ...\"\n end\n # resource path\n ...
[ { "docid": "b867a82153ccaefebd9e0594ced89ea5", "score": "0.67977667", "text": "def wait\n\t\t\t\t@notification.wait\n\t\t\tend", "title": "" }, { "docid": "765a899c7d9f99ba54c71f8c291c5022", "score": "0.65596783", "text": "def monitor_events\n event_monitor_handle.start\n event...
529482c414c5426db829c7fe9842248f
edit_library_address method edits library address +selected integer: identifes the selected library
[ { "docid": "095aa84f0fae1a9cbab83db42d1df065", "score": "0.7986386", "text": "def edit_library_address(selected)\n\tl = Library.find(selected)\n\tprint \"To edit the library address please enter here: \"\n\taddress = gets.chomp\n\tl.update_attributes(address: address)\nend", "title": "" } ]
[ { "docid": "144a0fe903e2f0f4523551a053da195e", "score": "0.76596457", "text": "def edit_library(selected)\n\tedit_library_name(selected)\n\tedit_library_address(selected)\n\tedit_library_phone(selected)\nend", "title": "" }, { "docid": "4bd1095d9c24f67220d3ea68acb4a5a4", "score": "0.6985...
b6ad3d00ab18a50cf64bf3c44d78bd27
POST /users POST /users.json
[ { "docid": "e1fc12ba3ae60556c260551f9580bd08", "score": "0.0", "text": "def create\n @user = User.new(user_params)\n\n if @user.save\n redirect_to users_path, notice: \"ユーザが保存されました\"\n else\n render :new\n end\n end", "title": "" } ]
[ { "docid": "4794c3e6e2db462f4d8769453efddedd", "score": "0.77179813", "text": "def post_users(users)\n self.class.post('https://api.yesgraph.com/v0/users', {\n :body => users.to_json,\n :headers => @options,\n })\n end", "title": "" }, { "docid": "a3973850c21e121410e2101...
fcf4682bbbc2ce9c33d773875f73f3df
PATCH/PUT /dish_categories/1 PATCH/PUT /dish_categories/1.json
[ { "docid": "f6975ad076d1954946e9a62334eb7a87", "score": "0.6871107", "text": "def update\n respond_to do |format|\n if @dish_category.update(dish_category_params)\n format.html { redirect_to @dish_category, notice: 'Категория блюда обновлена.' }\n format.json { render :show, status...
[ { "docid": "d042a4b8d67e19e968d8c4f929e81e33", "score": "0.74128443", "text": "def UpdateCategory params = {}\n \n APICall(path: 'categories.json',method: 'PUT',payload: params.to_json)\n \n end", "title": "" }, { "docid": "64342e33d137990e24b5fa224c350bd3", "sc...
43dbd0a24237f4e4d36b7c5ca9708f73
tests whether pub refuses service based on drunkenness level (10 or above)
[ { "docid": "1aa511f7dc93fa3003db7268a7be0105", "score": "0.0", "text": "def test_checks_customer_is_too_drunk__true\n assert_equal(true, @pub1.customer_is_too_drunk(@customer3))\n end", "title": "" } ]
[ { "docid": "4b99b15ab19cca4d55393d5595b02fcb", "score": "0.5880011", "text": "def supports_incomplete_services?\n Puppet::Util::Package.versioncmp(Facter.value(:operatingsystemrelease), '11.1') >= 0\n end", "title": "" }, { "docid": "557735e23d90225b0a029c2158878f3d", "score": "0.580...
36501ccbb34f1cf7c462278e300833d0
Clear the root directory's contents.
[ { "docid": "259ed0707cb152724e53d429a41b5e5b", "score": "0.8218371", "text": "def clear\n FileUtils.rm_rf(@root)\n FileUtils.mkdir(@root)\n end", "title": "" } ]
[ { "docid": "73a03994f7117be23f9ae09582460c87", "score": "0.85133356", "text": "def clear\n return unless File.exist? @root_dir\n\n FileUtils.rm_r @root_dir\n FileUtils.mkdir_p @root_dir\n end", "title": "" }, { "docid": "2bbc0c6839d3ecdc71d3dcedc318a88a", "score": "0.8421086", ...
4122d556dc9a636cdde446a272fcce32
DELETE /sales/1 DELETE /sales/1.json
[ { "docid": "bee300bf97ea72c82b5aec40b5ebb8d6", "score": "0.75435835", "text": "def destroy\n @sale = Sale.find(params[:id])\n @sale.destroy\n\n respond_to do |format|\n format.html { redirect_to sales_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "addf656e18aa09da07f4106e8ee7da56", "score": "0.75393915", "text": "def destroy\n @sale.destroy\n\n respond_to do |format|\n format.html { redirect_to sales_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "eabf457236b2437fb8c231...
cff15a17dcbafe1836f9de788caa6e2a
Returns a duplicate of this resource without the attributes +attrs+ set.
[ { "docid": "e112e27027b1558fa42e22dd842a9c0f", "score": "0.6788764", "text": "def delete(*attrs)\n ret = self.dup\n attrs.each { |a| ret.attrs.delete(a) }\n ret\n end", "title": "" } ]
[ { "docid": "6db14d6109b6a0fb4357477053b675b7", "score": "0.7476156", "text": "def dup\n new(attrs.each_with_object(Attributes::Hash.new) do |(k, v), obj|\n obj[k] = v.dup\n end)\n end", "title": "" }, { "docid": "614ea381e5e649a76c5b97caa1a2ed67", "score": "0....
c16ab53c3f2e20b5441ec2d21ee59c05
POST /workstatuses POST /workstatuses.json
[ { "docid": "6ec07547eefb55a789090f379a19f3c0", "score": "0.62947893", "text": "def create\n @workstatus = Workstatus.new(workstatus_params)\n\n respond_to do |format|\n if @workstatus.save\n format.html { redirect_to @workstatus, notice: 'Workstatus was successfully created.' }\n ...
[ { "docid": "2a38b92ba7cd2209d1e5edf62b4e4044", "score": "0.651775", "text": "def create \n respond_to do |format|\n format.json { render \"create\", :status => status_for(get_tweets) }\n end\n end", "title": "" }, { "docid": "981b7360678bb44bea71f5632e6464a8", "score": "0....
1768ee59f15f3c25dc6b839a7927bd87
DELETE /pmsets/1 DELETE /pmsets/1.json
[ { "docid": "5187f370786990242801f9c1f411c20b", "score": "0.7647809", "text": "def destroy\n @pmset.destroy\n respond_to do |format|\n format.html { redirect_to pmsets_url, notice: 'Pmset was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" ...
[ { "docid": "d66e8b055b4dcc0acef6e4d18db6c613", "score": "0.71246165", "text": "def delete(set_name)\n url = @uri + \"#{set_name}?api-version=#{api_version}\"\n url\n end", "title": "" }, { "docid": "b6890fe5009de2a4197d286916201e47", "score": "0.7116129", "text": "...
931edf97b455020fb181538d51b17595
A callback for when the player receives their hole cards
[ { "docid": "13b19c290192974c36627a6f38ae7b6c", "score": "0.798345", "text": "def hole_cards_received\n\t\t\t\tconn.write_hole_cards(self)\n\t\t\tend", "title": "" } ]
[ { "docid": "9c263ef5b35fbf2705bf40c6bd0ab3c7", "score": "0.84815174", "text": "def hole_cards_received\n\t\tend", "title": "" }, { "docid": "35044ac7ee47c20ce5b7b41e548916ce", "score": "0.72088486", "text": "def hole_card\n # here we have a chance to return a card that will match ...
1ef001639b7551538c662dcaab00e318
Handle scalarday/scalarmonth/scalaryear formats: dd/mm/yyyy, dd.mm.yyyy
[ { "docid": "71fc329a0a74f0dc7e31e155890b5de7", "score": "0.0", "text": "def handle_sd_sm_sy\n handle_sd_sm\n next_tag\n handle_sy\n @precision = :day\n end", "title": "" } ]
[ { "docid": "395a9a8b79e5246e1d2c6613a24a90b4", "score": "0.6788163", "text": "def fix_single_date(str)\n str = str.gsub(/\\/0\\//,'/')\n @mos.each {|k,v| str.gsub!(k,v) if /^#{k}/.match(str)}\n\n # set aside any time-modifying prefix (between, circa, etc.) for later\n if /^\\w+\\s/.match(str)\n u...
6ad308405418f8293b5bf1145c5c8cb5
POST /books POST /books.json
[ { "docid": "2cc131210b27f45d35c88acfaed9c21d", "score": "0.0", "text": "def create\n @book = Book.new(book_params)\n\n params[:book][:courses].split(',').each do |course_id|\n @book.courses << Course.find(course_id)\n end\n\n # Validation code\n charset = [('a'..'z'), ('0'..'9'), ('A...
[ { "docid": "3622d3bdcdce424b7485f979c9b796eb", "score": "0.73855305", "text": "def create\n @books = Books.new(params[:books])\n\n respond_to do |format|\n if @books.save\n format.html { redirect_to @books, :notice => 'Book was successfully created.' }\n format.json { render :js...
d7fbfaa956d9b2d723267bbc26919987
Run command setting priority and hiding output
[ { "docid": "ff3d6753e547bc38db5c1022a8b10df5", "score": "0.0", "text": "def execute(bin, *arguments)\n command = build_command!(bin, *arguments)\n\n start = Time.now\n\n success = run_command(command)\n\n $stderr << \"#{success ? '✓' : '✗'} #{Time.now - start}s #{command}\\n\" if @im...
[ { "docid": "7737d48f12f27e09868db891e6d840bf", "score": "0.59496415", "text": "def run\n _cmd = built_in_command( options[:args] )\n _cmd ||= options[:command] ? CommandRunner.new(options[:command]) : 0\n if _cmd.class == CommandRunner\n _cmd.run do |item|\n puts \"%s:\\n %s\\n\\n\...
08305a4b4fe63f031840c4ae4d64e295
Slightly different form a normal path in that we use rails formatting in that if the last part of the path is a number we remove it
[ { "docid": "716ed3df0d397e5140e65fd1b843c90f", "score": "0.6132508", "text": "def url_path(url)\n u = URI.parse(url)\n u.path.sub(%r{/\\d+$},'')\n end", "title": "" } ]
[ { "docid": "5fe9b7d6484423f5740370ed7a10948d", "score": "0.75785977", "text": "def format_path(path)\n path[1..-1]\n end", "title": "" }, { "docid": "9641ab755d3676f657537dfa06df96ce", "score": "0.7524686", "text": "def format_path(path)\n path.blank? ? '' : path.gsub(%r...
58afa3e432ace5adf83803eae085c6a8
Return the leap days in y year.
[ { "docid": "ed62c0a2591f79348c9580963dca2392", "score": "0.82931376", "text": "def leap_days(y)\n if (leap_month(y) != 0)\n if ((@@lunar_info[y - 1900] & 0x10000) != 0)\n return 30\n else\n return 29\n end\n else\n return 0\n end\n ...
[ { "docid": "1d09ff5a5b1d604f7e27935b31ddcee4", "score": "0.7933914", "text": "def daysInYear\n if leapYear?\n return 366\n else\n return 365\n end\n end", "title": "" }, { "docid": "850bc70308119f7098f137adb9233e69", "score": "0.7771888", "text": "def days_in_luna...
b82dd1a539e976d90c2442547fa42bbe
Returns a hash of player's champion statistics: spec_user The LeagueSpec user associated with the profile data. summoner The currently logged in player's summoner profile. top_played Top 5 champions that player has played the most games with. top_kd Top 5 champions that player has best kill/death ratio with. top_wl Top...
[ { "docid": "bcf0231fe8e3169896a5c1aaf774c707", "score": "0.6808297", "text": "def featured_stats\n player_data = {\n spec_user: @user,\n summoner: @player.summoner,\n top_played: filter_champs(top_played_champs, TOP_FIVE),\n top_kd: filter_champs(top_kd_champs, TOP...
[ { "docid": "6fed2996988c0695853da9dab9695841", "score": "0.75898564", "text": "def basic_stats\n if @player_champs_list.present?\n {\n spec_user: User.find_by(name: @player.summoner.name.downcase),\n summoner: @player.summoner,\n top_played: first_champ(top_playe...
bed2921d2bad14d457b43c3c613b420e
Get the projects that start with the specified prefix and accessible by the caller.
[ { "docid": "c3e198c82e5fd5ead184e93926761450", "score": "0.53967243", "text": "def find_project(name)\n get(\"/projects/#{name}\")\n end", "title": "" } ]
[ { "docid": "4b751588617208a27b3186f16b46822b", "score": "0.64078456", "text": "def get_projects\n me = request('/services/v5/me')\n me['projects']\n end", "title": "" }, { "docid": "4e78119d0f3e092dc4944625506210aa", "score": "0.6221989", "text": "def projects(params = {})\n ...
35733748489e2e35aedda06c4b138609
method to initialize yearly interest payments on an account
[ { "docid": "bfbcd4569f8759f38042e729a57e7b63", "score": "0.77826065", "text": "def init_yearly_interest_for(account)\n @task_manager.every '1y' do\n pay_interest_on account\n end\n end", "title": "" } ]
[ { "docid": "db246e22379a8755ba1aa2d87bc2a1f5", "score": "0.66343695", "text": "def calculate_years(principal, interest, tax, desired)\n# principal amount\n year = 0\n while principal < desired\n year += 1\n income = principal * interest\n principal += income - income * tax\n end\n year\nend...
f3f46d4f4f185021eb3d309cd9cbd516
This action is performed while user want to
[ { "docid": "aa72c08a5f6f9359e5f17c0933339e8d", "score": "0.0", "text": "def all_requests\n frd_status=FriendshipStatus.select(\"value\").find(4)\n @mypending_friends=User.select(\"users.id,users.email, users.first_name ,users.last_name,users.photo_file_name,users.photo_file_size,friends.user_i...
[ { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.7253704", "text": "def action_run\n end", "title": "" }, { "docid": "8f8d268370792dcc71429769c392c01c", "score": "0.6843017", "text": "def act\n end", "title": "" }, { "docid": "8f8d268370792dcc7142976...
5db4ca7215dab73ad6545a5fdd5f81d1
Test that the API is correctly defined
[ { "docid": "cdf250b40fb240033b2d336cfbf52b19", "score": "0.0", "text": "def testAPI\n setupAppDir do\n @Installer.access_plugin('Installers', @InstallerPluginName) do |ioPlugin|\n assert(ioPlugin.is_a?(RDI::Model::Installer))\n assert(ioPlugin.respond_to?(:get_possi...
[ { "docid": "41954bd66fe6f2c5c3e1b5125dddf52f", "score": "0.749492", "text": "def test_api_correctness\n @loader = SwaggerLoader.new\n @formatter = Formatter.new\n\n test_200_for_routes_with_no_required_parameters\n test_sample_values_for_path_params_on_get_routes\n end",...
8fa35f32391dddfd873fab2f638b6e7a
Move JalaliDate object forward by n months
[ { "docid": "6054b081a39bce0dccb952f1b1baca77", "score": "0.54592234", "text": "def >>(months)\n y, m = (@year * 12 + (@month - 1) + months).divmod(12)\n m, = (m + 1) .divmod(1)\n d = @day\n d -= 1 until self.class.valid?(y, m, d)\n self.class.new(y,m,d)\n end", "...
[ { "docid": "b5690d33608e76f5e4feab0146f87833", "score": "0.72234565", "text": "def move_to_next_month\n self.date = self.date + 1.month\n self.save!\n end", "title": "" }, { "docid": "7d6614eabfa1ffe828bd229719ff6a27", "score": "0.7129949", "text": "def advance_months(months)\...
719c1492790eafb2e792e0db4335c369
Finds an empty position given that the other 2 positions are both filled with play_symbol.
[ { "docid": "00e4f98c7f7e7da733b39232d7553b6f", "score": "0.78158295", "text": "def find_empty_position(filled_positions, desired_play_symbol)\n actionable_cells = @board.representation.select {|k,_| filled_positions.include?(k)}\n\n if actionable_cells.values.select {|p| p == desired_play_...
[ { "docid": "3c1dc98a50eb3165fdf771588fc13137", "score": "0.66886336", "text": "def find_empty_position(item, position)\n\n if [:arm, :leg, :wield, :wrist, :foot, :ankle, :ring_finger, :ear, :hand].include? position\n return find_empty_position(item, \"left_#{position}\".to_sym) || find_empty_pos...
ec33c78d370fd88291008071fa11c1c8
get every test to pass before coding runner below calls on the welcome method, then on the initial_round method, then calls hit? and display_card_total methods until the card sum is greater than 21, then calls on the end_game method"
[ { "docid": "dcb5d15f5e11c0b47314cfd21794ff59", "score": "0.0", "text": "def runner\n # code runner here\n # total=0\n welcome\n input=initial_round\n until input > 21 \n input=hit?(input)\n display_card_total(input)\nend\nend_game(input)\nend", "title": "" } ]
[ { "docid": "eab213f95e417684b0f83023e63c225b", "score": "0.85320914", "text": "def runner\n # code runner here\n welcome\n sum=initial_round\n until sum > 22\n sum=hit?(sum)\n display_card_total(sum)\n end\n end_game(sum)\nend", "title": "" }, { "docid": "1fd6804e62bb0444d885e9c4631d...
349fe333282e86b9c50601202c998209
Provides access to a lazy authN object from Warden.
[ { "docid": "13bd27570e0608ef0e6f03e733b9e95a", "score": "0.54965293", "text": "def warden\n request.env['warden']\n end", "title": "" } ]
[ { "docid": "ee4ad33a30e17110a497a2d448580811", "score": "0.6081507", "text": "def auth_store; end", "title": "" }, { "docid": "606f1bdb91edfe7a7729ce96ebae363d", "score": "0.573688", "text": "def auth\n cfg_get(:auth)\n end", "title": "" }, { "docid": "cc4...
ff928fee170d8cbc6897630c5fd86325
Mark and time the app.
[ { "docid": "fd250e3687b95045292ffd2a435080f3", "score": "0.0", "text": "def handle_request( request )\n\t\tMetriks.meter( \"#@metriks_key.requests\" ).mark\n\n\t\tresponse = nil\n\t\tMetriks.timer( \"#@metriks_key.duration.app\" ).time do\n\t\t\tresponse = super\n\t\tend\n\n\t\tself.log.debug \"Returnin...
[ { "docid": "437ad6b2844bf1d0e82da5e5ea1d87c8", "score": "0.63704723", "text": "def mark\n @last_time = Time.now.to_f\n end", "title": "" }, { "docid": "e32535320dde17dba13a50ca57d53a8e", "score": "0.635424", "text": "def mark_task\n\n end", "title": "" }, { "doci...
3651d852bb08885824f3341ee19329df
Get connection additionnal informations
[ { "docid": "cb6031d8156ba53f1bfb3daa1e1a1fd0", "score": "0.0", "text": "def users_id_user_connections_id_connection_informations_get(id_user, id_connection, opts = {})\n data, _status_code, _headers = users_id_user_connections_id_connection_informations_get_with_http_info(id_user, id_connection, op...
[ { "docid": "f9018db4747b0983ca920e7593473712", "score": "0.784758", "text": "def connect_info\n [self[:host], self[:username], self[:password], self[:key]]\n end", "title": "" }, { "docid": "71e490ceb2c8f60ea37b83fc884bc094", "score": "0.77642", "text": "def conninfo(...
258ddadff6908fe53a3c3e83ef6e427a
GET /survey_responses/new GET /survey_responses/new.json
[ { "docid": "c65c192481209eefa2c91f60f6d10cea", "score": "0.8149596", "text": "def new\n @survey_response = SurveyResponse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @survey_response }\n end\n end", "title": "" } ]
[ { "docid": "10bc67d64aaabf38df88f2f04bd01a74", "score": "0.79313403", "text": "def new\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.slim\n format.json { render json: @survey }\n end\n end", "title": "" }, { "docid": "57c65b6ad0bdf735c882b5d955a88f...
ec5673324907ef14ba739f792f0eace7
Writes out a element for the given field. Options: :required: text to indicate that field is required. Optional: if not given, field is not required. If set to true instead of a string, default indicator text is '(required)'. :label: text wrapped by the . Optional (default is field's name). :suffix: appended to the lab...
[ { "docid": "e4dc21914200c3fee82a2f709640d5c4", "score": "0.6378934", "text": "def label_element(field, options = {}, html_options = {})\n return '' if options.has_key?(:label) && options[:label].nil?\n text = options.delete(:label) || field.to_s.humanize\n suffix = options.delete(:s...
[ { "docid": "1ed5b1139fdbaaee82c793ebb0f59b99", "score": "0.61118686", "text": "def format_with_label(field, options, tag_output, &block)\n # see if we have an error on the field\n errors_on = object.send(:errors).send(:on, field)\n has_error = true unless errors_on.blank?\n\n # set f...
e1039ff82d62ed784b41a6dbf3b61667
GET /tickets GET /tickets.json
[ { "docid": "c035d4daef0ed467a52ffc3b73d77b1b", "score": "0.0", "text": "def index\n # debugger\n if ! params[:search].blank?\n @ticket = Ticket.find_by slug: params[:search].downcase\n redirect_to ticket_path(@ticket) unless @ticket.nil?\n end\n @tickets = Ticket.all\n\n end", ...
[ { "docid": "bca922a42971ac7e819a20e8b5f19079", "score": "0.812432", "text": "def GetTickets params = {}\n\n params = params.merge(path: 'tickets.json')\n APICall(params)\n\n end", "title": "" }, { "docid": "485d99e64672b1c96f45b9fa9ff259cb", "score": "0.7915244", "...
848f6a4aea1588763db9c19e97dd87dd
Construye una lista con una cabeza y una cola
[ { "docid": "0a4796549e612b486c0d4725ff2f2dee", "score": "0.0", "text": "def initialize (head, tail)\n @head_ = head\n @tail = tail\n @sz_ = 0\n end", "title": "" } ]
[ { "docid": "013586c21715e985aff115300f5834fa", "score": "0.60497385", "text": "def reconstruir_palabras\n palabras = []\n @trie.reconstruir_palabras_nodo('', palabras)\n palabras\n end", "title": "" }, { "docid": "2bf427868b66ccd65f037eddc6b8ea9c", "score": "0.5948405", "te...
f4682d97e87c88f3bae18cee6c168b2c
PATCH/PUT /main_themes/1 PATCH/PUT /main_themes/1.json
[ { "docid": "0b9f5b4062c35bba599e2635432034f3", "score": "0.68698376", "text": "def update\n respond_to do |format|\n if @main_theme.update(main_theme_params)\n format.html { redirect_to main_themes_path, notice: 'Tema Principal Atualizado Com Sucesso.' }\n format.json { render :sho...
[ { "docid": "ac4c0fd436d9ddf6fd7f8dcffb61acee", "score": "0.70440376", "text": "def patch_theme(theme_id, request)\n start.uri('/api/theme')\n .url_segment(theme_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .patch()\n .go()\n end", "title...
205c74c47daed47d847a28274e32baf0
Write a method opposite_count that takes in an array of unique numbers. The method should return the number of pairs of elements that sum to 0 Solution 1
[ { "docid": "1a8ef63af517913ca75163407fd0cb7a", "score": "0.86713094", "text": "def opposite_count(array)\n count = 0 \n array.combination(2).to_a.each do |nums|\n count += 1 if nums.sum == 0\n end\n\n count\nend", "title": "" } ]
[ { "docid": "a3f8bec89107f351847a5a06a3276fa7", "score": "0.8342218", "text": "def opposite_count(nums)\n pairs = 0\n nums.each do |num1|\n nums.each do |num2|\n if num1 + num2 == 0\n pairs += 1\n end\n end\n end\n return pairs / 2\nend", "title": "" }, { "docid": "...
fad658be5265353b866568750334621d
PUT /notifications/1 PUT /notifications/1.xml
[ { "docid": "336be20810d741c5787bd3caca605586", "score": "0.6415497", "text": "def update\n @notification = Notification.find(params[:id])\n\n respond_to do |format|\n if @notification.update_attributes(params[:notification])\n flash[:notice] = 'Notification was successfully updated.'\n...
[ { "docid": "dca535f27c32c80442127dd519b689f1", "score": "0.67968845", "text": "def updateNotification\n read = convertToBoolean(read)\n delivered = convertToBoolean(delivered)\n\n parameters={id_user: params[:id_user].to_i, subject: params[:subject].to_s, content: params[:content].to_s, r...