query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
016c00ba83bb51fb06ccfccc89745112 | Delete files at keys starting with the +prefix+ on all services. | [
{
"docid": "72ae41e6498428346dbc286885feae9f",
"score": "0.7263962",
"text": "def delete_prefixed(prefix)\n perform_across_services :delete_prefixed, prefix\n end",
"title": ""
}
] | [
{
"docid": "f5dc7dd702b49cebd5be072e1c3ccfdd",
"score": "0.7275687",
"text": "def delete_keys_with_prefix (prefix)\n\n call_misc(\n 'outlist', lib.abs_fwmkeys(@db, prefix, Rufus::Tokyo.blen(prefix), -1))\n # -1 for no limits\n\n nil\n end",
"title": ""
},
{
"doci... |
db2e56cff9bc6994da63faa5deacc09a | control which backup directories to read through TODO more than one backup directory TODO more than one database type | [
{
"docid": "995c7209b102188fce0f5c0b4449b0f0",
"score": "0.6197013",
"text": "def read_backups\n Dir.foreach(@backup_path) do |file_name|\n full_name = File.join(@backup_path, file_name)\n unless File.directory?(full_name) \n if is_sqlite3?(full_name)\n @conversati... | [
{
"docid": "df366cad38b0ed4c5aeb50372d73f7d2",
"score": "0.6831566",
"text": "def backup_dirs\n backup = OneCfg::Common::Backup.backup_dirs(\n OneCfg::CONFIG_BACKUP_DIRS,\n nil, # backup name autogenerated\n @prefix\n )\n\n On... |
d8ecb1e96d235fd247948e0cd92f2f77 | def audit_destroy write_audit(action: 'destroy', audited_changes: audited_attributes, comment: audit_comment) unless new_record? end Method defination changed by Vikash | [
{
"docid": "8710069a0f941b1298febed8f15a90e1",
"score": "0.78445643",
"text": "def audit_destroy\n write_audit(action: 'deleted permanently', audited_changes: audited_attributes, comment: set_audit_comment,\n username: set_username, user_id: set_user_id, module_name: set_module_name, dom... | [
{
"docid": "63e8ff3f8859e80c43b164f37433c4cc",
"score": "0.81187993",
"text": "def log_destroy_for_audit\n if switched_on? and not new_record?\n cur_version = Audit.with_item_keys(self.class.base_class.name, id).last\n cur_version = build_version if cur_version.nil?\n ... |
e507eb4be90459916c3efb290d51c067 | add :name to strong params | [
{
"docid": "039f59a08b948e090a5d763588aadc27",
"score": "0.0",
"text": "def update_resource_params\r\n params.require(:devise_model).permit(:email, :password,:password_confirmation, :invitation_token)\r\nend",
"title": ""
}
] | [
{
"docid": "b7d5332183777851b18bd2cb4131d395",
"score": "0.7602263",
"text": "def name_params\n params.require(:name).permit(:name, :year_start, :year_end, :viaf_id, :comment)\n end",
"title": ""
},
{
"docid": "5f74be762938c0f6c65dfc6a7d42b636",
"score": "0.7577712",
"text": ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "a7641bf52479dfa05878ecc2d5d93f12",
"score": "0.0",
"text": "def set_appointment\n @appointment = Appointment.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... |
b682023e81005f1c7046bae54b1c1f4e | This is used to mock an LDAP server for local development, test and for the demo site. The behavior here is different by districts. | [
{
"docid": "f8aaa6ee779ad8f5dbd66fb59785bf5e",
"score": "0.0",
"text": "def find_educator_for_mock_ldap_login(ldap_login)\n raise_not_handled! unless MockLdap.should_use?\n\n if @district_key == BEDFORD\n login_name = ldap_login.split('@').first\n Educator.find_by_login_name(login_name)\... | [
{
"docid": "e22c5a3e0d714177f689459b7a8838ad",
"score": "0.6811244",
"text": "def i_need_ldap\n return if @ldap_running\n\n @ldap_server = Ladle::Server.new(\n quiet: false,\n ldif: Rails.root.join('spec', 'fixtures', 'tufts_ldap.ldif')\n ).start\n\n @ldap_running = true\n end",
... |
073f199baf17448e50b9bbbfe8db368a | DELETE /dia_eventos/1 DELETE /dia_eventos/1.json | [
{
"docid": "6d987bfef2e1407b6053eade7f80e55b",
"score": "0.67979217",
"text": "def destroy\n @dia_evento.destroy\n end",
"title": ""
}
] | [
{
"docid": "f955252f902c753816feb5fc1cc0c7e3",
"score": "0.7274483",
"text": "def delete_event\n if params[:id]\n @e = Evento.find(params[:id]).destroy\n end\n render :json => msj = { :status => true, :message => 'ok'}\n end",
"title": ""
},
{
"docid": "be82dcfa54a4e1f407a060d... |
de735c5a8e5f31d0420f4c76315c29e8 | Strips a comment from a line | [
{
"docid": "b6d16083bd2012e266fa902750a99df8",
"score": "0.7916108",
"text": "def strip_comment\n gsub(/#([^{].*\\n)?/, \"\\n\")\n end",
"title": ""
}
] | [
{
"docid": "49195d167c7546b941b659cc770a9a1b",
"score": "0.87807226",
"text": "def strip_comment(line, opts); end",
"title": ""
},
{
"docid": "5dafa8cf8f35059b893641a62544db5e",
"score": "0.8627427",
"text": "def strip_comment(line)\n line.partition('//').first\n end",
"t... |
0b5ee865961f36d128b89eefcbaf3315 | True of the message data payload is empty | [
{
"docid": "ec3677ad48b4c1f2e6675808e79efd4e",
"score": "0.82700723",
"text": "def is_empty?(message)\n message[:data].nil? || message[:data] == ''\n end",
"title": ""
}
] | [
{
"docid": "4fa71cae251cbdc152c3cf450ea9771e",
"score": "0.8458186",
"text": "def has_data? ; self.payload.size.zero? ? false : true ; end",
"title": ""
},
{
"docid": "4fa71cae251cbdc152c3cf450ea9771e",
"score": "0.8458186",
"text": "def has_data? ; self.payload.size.zero? ? false : ... |
834143eecc7dc032c30d8bd6a4415ad1 | Internal: Conceal parts of the string. Example: conceal "thisismysensitivestring" => "thisring" Returns a string with only the first and last 4 characters visible. | [
{
"docid": "daf1f647e11ef2b075a7133528507b5d",
"score": "0.6615928",
"text": "def conceal(string)\n front = string[0, 4]\n back = string[-4, 4]\n \"#{front}****#{back}\"\n end",
"title": ""
}
] | [
{
"docid": "4d6bf8dcb8bd0f8abf3eda4246b47bbf",
"score": "0.57154393",
"text": "def cleanup(string)\n final = \"\"\n string.chars.each_with_index {|char| (\"a\"..\"z\").include?(char.downcase) ? final += char : final += \" \"}\n final.squeeze(\" \")\nend",
"title": ""
},
{
"docid": "659e38... |
481ebd650343f73f573dd1e5c76143cf | Convert a string of commaandwhitespaceseparated words into tags (creating any that don't already exist) | [
{
"docid": "0e74f8957a555922ffec93c0818127cf",
"score": "0.0",
"text": "def assign_tags\n if @tag_names\n # Split our tag name string on commas surrounded by any amount of\n # whitespace\n names_coll = @tag_names.split(/\\s*,\\s*/)\n self.tags = Address.clean_tag_names(names_coll)... | [
{
"docid": "5c9620355cb7258f79283f5ab0bb5578",
"score": "0.73174447",
"text": "def replace_or_build_tags(tags_string)\n tags = tags_string.split(\",\")\n self.tags = tags.map do |tag|\n # tag = Tag.find_or_create_by(name: tag.strip)\n tag = Tag.where('lower(name) = ?', tag.strip.downcase... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "280354be2d54cd1c0826c966f179cfb5",
"score": "0.0",
"text": "def adminagentfamily_params\n params.require(:adminagentfamily).permit(:a_family)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7496716",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6956598",
"text": "def strong_params\n params.require(:request).permit(param_white... |
59c5804c8c4154616d9f2df00cc02083 | Registers manipulators which inherit from this class. | [
{
"docid": "527d98501b342a7989197da3fd0165d4",
"score": "0.6664968",
"text": "def inherited( manipulator_klass )\n Request::Manipulators.register(\n Request::Manipulators.path_to_name( caller.first.split( ':' ).first ),\n manipulator_klass\n )\n end",
"title": ""
}
] | [
{
"docid": "0d1e3a20b3dd48bd8ad5144c060fc3fa",
"score": "0.54321754",
"text": "def rwreg(reg_name, *aliases) # :nodoc:\n roreg(reg_name, *aliases)\n method_name = reg_name.to_s.gsub('/', '_')\n instance_eval <<-\"_end\"\n class << self\n def #{method_name}=(v,off=0); write... |
09d0c3b5210543290e964400ed059c28 | Returns String path to manifest.json file. source://sprockets//lib/sprockets/manifest.rb77 | [
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.0",
"text": "def path; end",
"title": ""
}
] | [
{
"docid": "150b10cd90989e8e73e08479ae54f9f1",
"score": "0.83931345",
"text": "def generate_manifest_path\n \".sprockets-manifest-#{SecureRandom.hex(16)}.json\"\n end",
"title": ""
},
{
"docid": "4bc1ef937060bfce26e2722d626dedea",
"score": "0.8209185",
"text": "def manifest_f... |
3075e13a42cc557d7050cccf6f51ece2 | Verify active connections and remove and disconnect connections associated with stale threads. | [
{
"docid": "353997e29bbf8717a6af8233a44512fd",
"score": "0.7664885",
"text": "def verify_active_connections! #:nodoc:\n clear_stale_cached_connections!\n @connections.each do |connection|\n connection.verify!\n end\n end",
"title": ""
}
] | [
{
"docid": "ff331788758244de5481ac405eb52504",
"score": "0.7649213",
"text": "def verify_active_connections! #:nodoc:\n synchronize do\n clear_stale_cached_connections!\n @connections.each do |connection|\n connection.verify!\n end\n end\n end",
... |
6214cd9c95094a3fd44cf2cebe11f9fa | adds one part to the parts array arguments are a hash array of column name (underscored symbols) to values | [
{
"docid": "82ba23d9659e0711221f7268d5f15ef8",
"score": "0.7305231",
"text": "def add_part(*args)\n value_hash = args.extract_options!\n \n test_for_invalid_columns(value_hash.keys)\n test_for_required_columns(value_hash)\n \n raise \"Sequence ID alr... | [
{
"docid": "3505612df8bf3f84de355fdaa800e3fd",
"score": "0.7014252",
"text": "def add_part(part); end",
"title": ""
},
{
"docid": "4a9b937a7745e5c34d1d49de99f40ef0",
"score": "0.63191724",
"text": "def add_part(part)\n \n @parts.push(part)\n \n end",
"title": ""
},
... |
9e915bb8001e3ed8a77d0a928f50ed11 | Go walk in the nature | [
{
"docid": "0ebdda83ddfd73201250c16ddcdf0080",
"score": "0.0",
"text": "def make_a_hero_walk_and_print(id)\n return puts 'You need to provide an id' if id.nil?\n\n interact = hero_walk(id)\n\n return puts 'Hero not found :(' if interact.nil?\n\n puts \"#{interact[:name]} have take a good time outsid... | [
{
"docid": "bbecc45e6b0e98ba498c640c415f9d0c",
"score": "0.81846714",
"text": "def walk_by\n #\n end",
"title": ""
},
{
"docid": "59e3c7d64ea38cd40488707fa61c6ae9",
"score": "0.7558599",
"text": "def traverse; end",
"title": ""
},
{
"docid": "67be6e6ba8ef83a76e7a265c6... |
5823c75f7437cf9f59a185b6d2ebf8b8 | GET /posts/1 GET /posts/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "915c0178f9e4347098d8a463c2cbe6b0",
"score": "0.77119195",
"text": "def show\n @posts = Post.find(params[:id])\n render json: @posts\n end",
"title": ""
},
{
"docid": "ad221611c85e1ec63d3385d6179e41a2",
"score": "0.73543334",
"text": "def show\n render json: Post... |
37f6e05ac513028f3700dd49f9570399 | When passed a block, yields FieldTypeInstance records from the API. This operation lazily loads records as efficiently as possible until the limit is reached. source://twilioruby//lib/twilioruby/rest/preview/understand/assistant/field_type.rb68 | [
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.0",
"text": "def each; end",
"title": ""
}
] | [
{
"docid": "ab31f014379332f59d9b09a7c8281666",
"score": "0.6281998",
"text": "def each_entry_type( &block )\n field_types.each &block\n end",
"title": ""
},
{
"docid": "9bc3521ae0d5cfcc5c117f37107a9b20",
"score": "0.5962134",
"text": "def each_field\n return en... |
7b42b15d0ccabe2b185835f964b8754f | Performs a force restart of Jenkins server | [
{
"docid": "89e6fa59464d43a7fa32eb6ffe8ad53f",
"score": "0.6672782",
"text": "def restart!\n restart(true)\n end",
"title": ""
}
] | [
{
"docid": "3c7a6abf66bf12776a5d8790cb96cd55",
"score": "0.79646415",
"text": "def action_srestart\r\n jenkins_cli \"safe-restart\"\r\nend",
"title": ""
},
{
"docid": "02da3b564086a89b6c0fe5ea566b8240",
"score": "0.79167074",
"text": "def restart(force = false)\n if force\n ... |
9305e42be2de8d3dfcd228469d19948a | => This is called by the game, it takes an argument of the destination and updates the destination spot's object with itself as its occupant, as well as updates itself with the object it now occupies => If the piece is taking an opponent, the oppenent's spot is not refreshed and therefore cannot be selected anymore sin... | [
{
"docid": "12b1b6a1d104b23061022a8e6f7232ae",
"score": "0.603906",
"text": "def change_spot(spot)\n spot.update_occupied_by(self)\n @spot = spot\n @moved = true\n end",
"title": ""
}
] | [
{
"docid": "29dacafa6c02180ab8ca558d38ed5ea6",
"score": "0.6780536",
"text": "def move_piece(org,dest)\n # remove catured piece if capture move\n if (dest[0] - org[0]).abs == 2\n captured_box = [org[0] + (dest[0]-org[0])/2 , org[1] + (dest[1]-org[1])/2]\n @pieces[captured_box[0]][capture... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "23306d107f59202eda67362bfab9ed74",
"score": "0.0",
"text": "def set_user\n @user = User.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163927",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6046165",
"text": "def action_hook;... |
8dac56058ccb192170fe122debfdf39e | PATCH/PUT /rations/1 PATCH/PUT /rations/1.json | [
{
"docid": "324f4aba9cf13644aabc492931d0b61b",
"score": "0.0",
"text": "def update?\n @current_user.permission('Ration', :clerk)\n end",
"title": ""
}
] | [
{
"docid": "4e0e59715d19dce2a47fccc2c67326dd",
"score": "0.6525014",
"text": "def patch!\n request! :patch\n end",
"title": ""
},
{
"docid": "e7663d0348b74542ff1d2f4fd96156fe",
"score": "0.64887923",
"text": "def api_patch(path, data = {})\n api_request(:patch, path, :data =... |
4404025b4abc59ba0be9f69fc6272e4e | Wrap an HTTP request in a Maglev transaction. Does an abort_transaction (to start a new transaction) before passing the request down to the next Rack app. On return, it checks the status code from the underlying app, and if it is success (2xx), then it commits the transaction. | [
{
"docid": "f4cd8e8af7af2d05c32cb6c59e546bbe",
"score": "0.64557755",
"text": "def call(env)\n MUTEX.lock\n Maglev.abort_transaction\n r = @app.call env\n ensure\n # Don't abort if ! committable? since next request will abort anyway\n Maglev.commit_transaction if committable? r[0]\n M... | [
{
"docid": "3dd0e2396e25b1ece25cdfe89cb8a808",
"score": "0.714951",
"text": "def finish_request\n if transactional? && !db.outside_transaction?\n if response.code < 400\n db.commit_db_transaction\n else\n db.rollback_db_transaction\n end\n end\n supe... |
079e9163a12e3ceb8b84c5e9aaba0b82 | POST /restaurant_highlights POST /restaurant_highlights.json | [
{
"docid": "d3b5dc006213d8402d8fb08bc65a3513",
"score": "0.77477854",
"text": "def create\n @restaurant_highlight = RestaurantHighlight.new(restaurant_highlight_params)\n\n respond_to do |format|\n if @restaurant_highlight.save\n format.html { redirect_to @restaurant_highlight, notice:... | [
{
"docid": "270a54726206950675490498c993b855",
"score": "0.7461246",
"text": "def rest_highlight_params\n params.require(:rest_highlight).permit(:restaurant_id, :highlight_id)\n end",
"title": ""
},
{
"docid": "d0ff8ae0d4792d52d7ce24c124fcc655",
"score": "0.7321364",
"text": ... |
28c64f66bcb57703ef1019293255952f | POST /use POST /use.json | [
{
"docid": "1d8204d06d55bf5ab2535908356cee1c",
"score": "0.0",
"text": "def use\n #TODO: should validate?\n\n flash = case @device.use current_user\n when :using, true\n {notice: 'device locked for you'}\n when :used\n {alert: 'another user locked'}\... | [
{
"docid": "08d3bdb955ed54784eb08395dd254b63",
"score": "0.61340433",
"text": "def create\n @breadcrumb = 'create'\n @use = Use.new(params[:use])\n @use.created_by = current_user.id if !current_user.nil?\n\n respond_to do |format|\n if @use.save\n format.html { redire... |
8300b5b71a49d256c553b387ad065127 | gnssgga => GNSS::GGA get GGA data none. GNSS::GGA GGA data | [
{
"docid": "e0098f89ee7782c1ba1759e412429d36",
"score": "0.7401995",
"text": "def gga\n # if lat = @gnss[:lat_raw]\n # lat = degree(lat)\n # lat = -lat if @gnss[:ns] == 'S'\n # end\n # if lng = @gnss[:lng_raw]\n # lng = degree(lng)\n # lng = -lng if @gnss[:ew] ... | [
{
"docid": "198ae48d70b1dd5367a44147d6da4499",
"score": "0.6221168",
"text": "def getgm; end",
"title": ""
},
{
"docid": "198ae48d70b1dd5367a44147d6da4499",
"score": "0.6221168",
"text": "def getgm; end",
"title": ""
},
{
"docid": "198ae48d70b1dd5367a44147d6da4499",
"... |
b9a1ce78c2e5f1c7be33429eacc051d0 | quicksort: inplace implementation with medianofthree pivot selection | [
{
"docid": "fdbbf5878f448034d689ab2398246ded",
"score": "0.64595854",
"text": "def quicksort(data, left, right)\n return if left+1 >= right\n #ai, bi, ci = left, (left+right)/2, right-1\n\tai = left\n bi = (left+right)/2\n\tci = right-1\n #a, b, c = data[ai], data[bi], data[ci]\n\ta = data[a... | [
{
"docid": "e5f2efc3baf8b90d2786ba3b0c406d7f",
"score": "0.81246316",
"text": "def quick_sort_using_median_of_three(list)\n if list.size <= 1\n list\n else\n middle_index = (list.size/2).floor\n middle_value = list[middle_index]\n\n possible_pivots = {\n 0 => list.first,... |
e267f1d7e3266d7d8c7d3bda2c4fb2c2 | Retrieve the node at the given index, returns nil if the index is not in_range?. O(n) | [
{
"docid": "ada783a82d6fa7324f270ade097b670e",
"score": "0.74814814",
"text": "def get_node(index)\n return [nil, @tail] if index == @size\n return [nil, nil] unless in_range? index\n \n previous = nil\n current = @head\n current_index = 0\n \n while current_index <... | [
{
"docid": "da5c228352141d6143c6c51acac8358a",
"score": "0.8022891",
"text": "def node_at(index)\n if index >= self.size\n puts \"index out of range.\"\n else\n each_with_index do |node, i|\n return node if index == i \n end\n end\n end",
"title": ""
},
{
"do... |
6c316382edb6921d99c0c1fa0e408186 | helper method for delete: | [
{
"docid": "172a81f5d53fe87e4f853cb2743f25e9",
"score": "0.0",
"text": "def maximum(tree_node = @root)\n if tree_node.right\n maximum(tree_node.right)\n else\n return tree_node\n end\n end",
"title": ""
}
] | [
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
"score": "0.83331484",
"text": "def delete; end",
"title": ""
},
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
"score": "0.83331484",
"text": "def delete; end",
"title": ""
},
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
... |
5ecbf17b62adff07080738b49e693888 | POST /purchase_orders POST /purchase_orders.json | [
{
"docid": "10c58a9c5622588f035282ccfb4cab76",
"score": "0.7129446",
"text": "def create\n @purchase_order = PurchaseOrder.new(purchase_order_params)\n\n if @purchase_order.save\n render :show, status: :created, location: @purchase_order\n else\n render json: @purchase_order.errors, s... | [
{
"docid": "1d43ddc0c92545c073c0861e0a477051",
"score": "0.704949",
"text": "def create_order(order_params)\n res = request('post', \"https://#{orders_path}\", order_params)\n parse_response res\n end",
"title": ""
},
{
"docid": "5e8839b2d7a993fcc4d3720732ff458c",
"score": "... |
00651546fbe9e27b4177c99fb756adae | recupere les emails de chaque ville | [
{
"docid": "b8f675558eba26e67241b964ad85a420",
"score": "0.0",
"text": "def get_email_town(array)\n city_email_hash = {}\n array.each do |c| \n #permet de lire la page de chaque villes\n c_open = Nokogiri::HTML(open(\"http://annuaire-des-mairies.com/95/#{c}.html\"))\n email = ... | [
{
"docid": "6a990dc6a6e1ddd58efc9a2b7740653a",
"score": "0.7334512",
"text": "def get_mail(url)\n\t\tmail = []\n\t\turl.each do |ville|\n\t\t\t\turl_ville = ville.downcase.gsub(' ', '-')\n\t\t\t\tpage = Nokogiri:: HTML(open(\"http://annuaire-des-mairies.com/50/#{url_ville}\"))\n\t\t\t\tmail << page.css(... |
e3ba09c4b33f997142472b3c4fa6b946 | Normalizes a request path. Raises an exception if the path cannot be normalized. | [
{
"docid": "01d6de83134d435e717996fd3d7d5c38",
"score": "0.8176214",
"text": "def normalize_path(path); end",
"title": ""
}
] | [
{
"docid": "87924b6781ecb74e4c2bbc8af3e2b50b",
"score": "0.7971041",
"text": "def normalize_path path\n normalize_path! path.dup\n end",
"title": ""
},
{
"docid": "8a3ccdda9f17beec0adff4fd24d58d69",
"score": "0.78517365",
"text": "def normalize_path(path)\n path\n ... |
521ac045f1b02e03b854b6b8cdc36a95 | returns the number of items left in the stack | [
{
"docid": "12e04d85aa548dedef599e4f8fd3a2df",
"score": "0.7954689",
"text": "def length\n @stack.length\n end",
"title": ""
}
] | [
{
"docid": "27ea6409d4524838735b55e1429892d0",
"score": "0.7987313",
"text": "def length\n @the_stack.length\n end",
"title": ""
},
{
"docid": "4ca393aa83b624110eccf15dd3508080",
"score": "0.79611355",
"text": "def count\n return @stack.size\n end",
"title": "... |
69d099387a6e88f6fe5fa250a7acd38a | Helpers methods to handle actions on the page | [
{
"docid": "55c6f79f712e116c3f0926bf4b6c08c3",
"score": "0.0",
"text": "def load_all_products(response)\n puts \"😨 Loading Products...\"\n count = response.css('.product-tile').count\n loop do\n trigger_load_button if response.css('.show-more').any?\n response = browser.current_respo... | [
{
"docid": "af62f103378bd953628950fc729b956e",
"score": "0.6868538",
"text": "def page\n end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.6866824",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
... |
50dde92f17d87ba238ad2f0faff4f345 | method initialize return a string containing the xy values | [
{
"docid": "82c776d9bff704b1ec9c71698aa8f305",
"score": "0.6521627",
"text": "def to_s\n return \"x: #{@x}; y: #{@y}\"\n end",
"title": ""
}
] | [
{
"docid": "6cb36a74797d1340449ad9a06606e10e",
"score": "0.70687956",
"text": "def initialize(str)\n @x, @y, @z = coords(str)\n end",
"title": ""
},
{
"docid": "4230db060fb2920e8fc399b55e386e8c",
"score": "0.70298564",
"text": "def initialize(value:, x:, y:)\n @value = value... |
0c237d3fdc53f195407efa37ce499d24 | move to the last store_location call or to the passed default one | [
{
"docid": "993ce0ea710c59825a6da40341dad385",
"score": "0.6420553",
"text": "def sl_redirect_to_stored_or_default(default)\r\n if session['sl-return-to'].nil?\r\n redirect_to default\r\n else\r\n redirect_to_url session['sl-return-to']\r\n session['sl-return-to'] = nil\r\... | [
{
"docid": "8234971d386cfaf6a89355790867f09e",
"score": "0.6712107",
"text": "def store_location_before\n store_location :user_return_to\n end",
"title": ""
},
{
"docid": "1678851dd05a8d8ca6e633299bb3eeeb",
"score": "0.66378975",
"text": "def redirect_back_or(default)\n redi... |
d4a1edaae4d92d004632cf64501ce2e7 | DELETE /users/1 DELETE /users/1.json | [
{
"docid": "15bbd6148634eeae1703a9d0983f5a27",
"score": "0.0",
"text": "def destroy\n @user.destroy\n respond_to do |format|\n format.html { redirect_to users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "be9d8ff5c0124f1d5efc98ec2baa3fc1",
"score": "0.7590564",
"text": "def test_delete_user\n delete '/users/2'\n data = JSON.parse last_response.body\n\n assert_equal 'Daniel', data['name'], 'Propiedad name incorrecta'\n assert_equal 'Arbelaez', data['last_name'], 'Propiedad last_nam... |
f7c4a5073e3f38bb97da7a8cb1f01114 | Update CloudFormation stack on AWS | [
{
"docid": "aa04bf88d1680b8c656e7e158a1d7cd9",
"score": "0.77462554",
"text": "def update(template_url)\n puts \"Updating stack (#{@name})\"\n\n puts @parameters\n\n @cloudformation.update_stack(\n stack_name: @name,\n# template_url: template_url,\n template_body: F... | [
{
"docid": "67be4d7f45ea59ae0d728e1cb15f2604",
"score": "0.7948578",
"text": "def update(resource_name)\n res = read_resource(resource_name)\n cf_client.update_stack(\n stack_name: res['name'], capabilities: res['capabilities'],\n template_body: read_template(res[... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "9731c82812246de1977eba9efc089bb4",
"score": "0.0",
"text": "def notice_params\n params.require(:notice).permit(:title, :category_id, :text)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.6978086",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6780264",
"text": "def strong_params\n params.requi... |
26a5da4ad1be3accfd273aa0e3beeb12 | use .each_with_object to transform hash into new empty hash use .each for the hash value to find inner_key or detailed values use .each to find the names in the array check to see if name exists as a key in the new hash if name is not a key, create new key with an empty hash value check to see if the description/key ex... | [
{
"docid": "d1120f236ce1cb66bf268d10193644e3",
"score": "0.0",
"text": "def nyc_pigeon_organizer(data)\n final_results = data.each_with_object({}) do |(key, value), final_array|\n value.each do |inner_key, names|\n names.each do |name|\n if !final_array[name]\n final_array[name]... | [
{
"docid": "0bf9d724e2a5b2bf0d2483297f2e05be",
"score": "0.58337253",
"text": "def hash_merger(query_vals)#another hash that is nested)\n merged_hash = Hash.new\n # for each key_val_set\n # check if key exists in merged_hash\n # if not - add in the value\n # if yes - key into merged_hash with k... |
dd8d60b85b2e739460fc312cbd246a66 | returns the maximum possible monetary price for a reward offer in sender's currency | [
{
"docid": "a61084b5ffd1a6eefa998fb882925de7",
"score": "0.78613126",
"text": "def max_price\n Money.new(MAX_OFFER_CENTS, self.default_currency)\n end",
"title": ""
}
] | [
{
"docid": "5a0178e1df6064cc71469752a9630ab4",
"score": "0.82912105",
"text": "def max_reward_price\n @max_reward_price_cache ||= if self.offers_reward?\n result = Money.new(0, self.default_currency)\n self.rewards.visible.each {|reward| result = Money.max(result, reward.price)} # # .conver... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "36342b7d5697ee7567302ec76329f53f",
"score": "0.0",
"text": "def tag_params\n params.require(:tag).permit(:name)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74954116",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6956924",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
0010b9d9518b8ff1e27a1b56dccc8de9 | Get the results of the text search as documents. | [
{
"docid": "008205e61f6166e072226d98a3cae86a",
"score": "0.6944819",
"text": "def documents\n results[\"results\"].map do |attributes|\n Factory.from_db(criteria.klass, attributes[\"obj\"], criteria.object_id)\n end\n end",
"title": ""
}
] | [
{
"docid": "995421bddaca674fd9a54549ad90f47a",
"score": "0.7526166",
"text": "def search\n @documents = api.form(\"everything\")\n .query(%([[:d = fulltext(document, \"#{params[:q]}\")]]))\n .submit(ref)\n end",
"title": ""
},
{
"docid": "a7403afe3dd... |
4d8f818d6b31c357e9380d4f428a498d | def first_and_last_name_employee(name) full_name = name.split(" ").map(&:to_s) f_name = full_name.first[0] l_name = full_name.last return f_name+"." + " " + l_name end wil print an icon | [
{
"docid": "bc2faa55b877a029d365ad81d5992872",
"score": "0.0",
"text": "def icon(options = {})\n content = \"\"\n icon = options.delete(:icon).to_s.split('_at_')\n if icon.present?\n options[:\"#{icon.pop}\"] = icon.join('_at_')\n end\n\n if options[:gly_icon].present? || options[:gl... | [
{
"docid": "12e49897c1ee803f86e5d339e079605d",
"score": "0.7901342",
"text": "def employee_name\n \"#{first_name} #{middle_name} #{last_name}\"\n \n end",
"title": ""
},
{
"docid": "575ef229d7ecb675279bd612bb0138ed",
"score": "0.7728128",
"text": "def employee_name\n... |
27e00f49f7aa825ccca3428b70483100 | Edit a batch of entities. | [
{
"docid": "db68feffcd68450d2236c53bc1f8c353",
"score": "0.0",
"text": "def api_categories_batch_edit_patch(opts = {})\n api_categories_batch_edit_patch_with_http_info(opts)\n nil\n end",
"title": ""
}
] | [
{
"docid": "32a7d82063aee9c6fc05c28b068233db",
"score": "0.67419845",
"text": "def batch_edit\n @photos = Photo.find(params[:ids])\n end",
"title": ""
},
{
"docid": "437d5e669a4dd3b6652a6e8347f0ff2b",
"score": "0.67187345",
"text": "def bulk_edit\n __log_activity\n __debug_... |
7a386835169bbba05caf26f9be9d6f01 | PATCH/PUT /plans/1 PATCH/PUT /plans/1.json | [
{
"docid": "b5074a4b0a2cb9ae568a3b5471d3cc39",
"score": "0.6678879",
"text": "def update\n respond_to do |format|\n if @plan.update(plan_params)\n format.html { redirect_to @plan, notice: '基本情報を編集しました' }\n format.json { render :show, status: :ok, location: @plan }\n else\n ... | [
{
"docid": "a6fe8effb634ca0799fddeb27f27c257",
"score": "0.7363205",
"text": "def update\n if @plan.update(plan_params)\n render json: @plan\n else\n render json: @plan.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "7afb7aa95baf3e45cef439a6... |
bbbce2d904052d514ff0fc0041ef9465 | Return genre of this song | [
{
"docid": "85b2825a8d6fdbf38dd5a001bc3448e3",
"score": "0.75456303",
"text": "def get_genre_name\n self.genre.name\n end",
"title": ""
}
] | [
{
"docid": "92f587b3aa8af2b6c450a4af405c1fe1",
"score": "0.84559876",
"text": "def genre\n fetch('game.genre')\n end",
"title": ""
},
{
"docid": "481bdd54728e53dc6efa8273f14847bc",
"score": "0.79059607",
"text": "def genre\n @genre\n end",
"title": ""
},
{
... |
f2d790a9399568a247ac84273df27b52 | Requires that the key simply be present The hash can contain any value for these keys | [
{
"docid": "c79491bdd014926572db993700f57b29",
"score": "0.6104815",
"text": "def requires_keys_are_present(*_keys)\n invalid_keys = _keys - self.keys\n unless invalid_keys.empty?\n raise ArgumentError, \"Missing keys=#{invalid_keys.join(',')} in opts=#{self.inspect}\"\n end\n end",
"... | [
{
"docid": "63787b9a16ae14e8b5ce8a07ff76da8c",
"score": "0.7131512",
"text": "def hash_key_valid?(hash, key)\n key && hash.key?(key) && hash[key].is_a?(String) && hash[key].size > 0\n end",
"title": ""
},
{
"docid": "214e4c5eb32150a6424ab23ef427a0e3",
"score": "0.70837253",
... |
495922a4745078075c6c71859fb3436f | This method is called via AJAX to add a comment to a photo | [
{
"docid": "7fe803220146e5eb497258c0f3e4c315",
"score": "0.7981424",
"text": "def add_comment\n @photo = Photo.find(params[:photo_id])\n comment = Comment.new\n comment.comment = params[:comment][:comment]\n comment.user = current_user\n @photo.comments << comment\n respond_to do |form... | [
{
"docid": "a15423e650534d1462e0c08a89f42099",
"score": "0.7623479",
"text": "def post_photo_comment\n @pic = Image.find(params[:image_id].to_i)\n @comment = PhotoComment.new(:comment=>params[:comment],:user_id=>@login_user.id,:discussable_id=>params[:image_id],:discussable_type=>\"Image\")\n i... |
cd3b322eb679eeed38cf628e88edad43 | Populates letters column based on the word's text attribute | [
{
"docid": "f766e305d4fd38e3f37d4982ae0d3f6f",
"score": "0.64486474",
"text": "def add_letters\n\tcharacters = self.text.chars\n\talphabetized_characters = characters.sort\n\tself.letters = alphabetized_characters.join\nend",
"title": ""
}
] | [
{
"docid": "e289ce953177e9262fecfac070d62ff7",
"score": "0.6610711",
"text": "def update_indicies(letter)\n words = phrase.content.split(' ')\n words.each_with_index do |word, index|\n word.split('').each_with_index do |char,i|\n self.phrase_indicies[index][i] = char if char == letter\... |
8f2085b83e8c41e206da0d9d3996dbef | Even though this seems way more complicated to me, I really wanted to see if I could do it pretending I never knew about arrays (since we didn't cover them today). This is how I'd group without being able to story the Fizzes, the Buzzes, or the FizzBuzzes anywhere. And I feel like it's still technically one loop. (Nest... | [
{
"docid": "a1248377530604acf0dc92da03985ee5",
"score": "0.6593939",
"text": "def simple_fizzy(start_num, end_num)\n (start_num..end_num).each do |number|\n puts \"Fizz: \" + number.to_s if fizzbuzz(number) == \"Fizz\"\n if number == end_num\n (start_num..end_num).each do |number|\n p... | [
{
"docid": "a4a673e09ba3cd4f9318bd349fa18399",
"score": "0.7056035",
"text": "def super_fizzbuzz(array)\n fizzbuzz_array = []\n counter = 0\n while counter < array.length\n if array[counter] % 3 == 0 && array[counter] % 5 != 0\n fizzbuzz_array << \"Fizz\"\n elsif array[counter] % 5 == 0 &&... |
94fbc32601b42b8e0b9d8b2d862eeeee | auto_updates true app 'Translator.app' uninstall pkgutil: 'com.jinxiansen.Translator' | [
{
"docid": "0a8112dd5efc15f475de969fe048ba09",
"score": "0.0",
"text": "def install\n bin.install \"translator\"\n end",
"title": ""
}
] | [
{
"docid": "8cbe939158be9b0873e6e4b1d1e477c7",
"score": "0.629166",
"text": "def uninstall\n end",
"title": ""
},
{
"docid": "9d70018ff844742a25682d6b815ef964",
"score": "0.6196128",
"text": "def uninstall\n yaourt \"--noconfirm\", \"-R\", @resource[:name]\n end",
"title": "... |
1c0ac0ce22fcf9be6d97e027879c014f | Get the initial role of the user | [
{
"docid": "1f9c5194da1abf3021a2258c7ccafdc8",
"score": "0.0",
"text": "def get_role player_name\n\t\tprompt = \"Enter your initial role, codemaker or codebreaker (M/B): \"\n\t\twhile true\n\t\t\trole = Mastermind::get_user_input(prompt)\n\t\t\tcase role.strip.downcase\n\t\t\twhen 'm', 'codemaker', 'co... | [
{
"docid": "4bdfe1ee5fc98d03d204a81cbd598922",
"score": "0.7668843",
"text": "def primary_role\n return nil if user.person_role.blank?\n user.person_role\n end",
"title": ""
},
{
"docid": "0f2a04aa7bab1d13f4186b96b123e880",
"score": "0.73394316",
"text": "def role\n if !i... |
5b6111d5df6f2ec4eb1e7e55d9d12f23 | =begin def count_sentences if self.end_with?(".", "?", "!") self.split.count I can do it this way I just can't seem to get the complex sentence test to pass. Hmm else self.split.length end =end | [
{
"docid": "86aaab92dd7b29317667a38590e1cb64",
"score": "0.8176155",
"text": "def count_sentences\n arr = self.split(/[.?!]/).reject {|string| string.empty?}\n return arr.length\n end",
"title": ""
}
] | [
{
"docid": "1eee74fe98956664ed468beba8b0ddcf",
"score": "0.8766068",
"text": "def count_sentences\n self.split.count do |num|\n num.end_with?(\".\", \"?\", \"!\")\n # binding.pry\n end\n end",
"title": ""
},
{
"docid": "db55e26965ceebddeca61905cf9b8c9e",
"score": "0.8391... |
56819da5e1e7af4aab1647bfc075bf3b | email to media contact | [
{
"docid": "2ac696d998729d99b5a9541099de029f",
"score": "0.6128512",
"text": "def deliver_release(release, user_from, media_contact)\n @release = release\n @user_from = user_from\n @media_contact = media_contact\n mail :to => @media_contact.email, :subject => \"BXG Press Release\"\n end",
... | [
{
"docid": "94ba29b9b920eab51decc059e25614c7",
"score": "0.69063795",
"text": "def contact_message(contact_email)\n @contact_email=contact_email\n \n\n mail to: \"amfsg@aol.com\", subject: \"Message Sent From raisebusinessomeony.com: #{contact_email.subject}\", from: contact_email.email, reply_... |
4a35ff6a0b471eb9d25ff13a53afad00 | play starts the game of tic tac toe | [
{
"docid": "0547273ff6f234a914d3a76fa15f6f0d",
"score": "0.0",
"text": "def play(board)\n until over?(board)\n turn(board)\n end\n victor = winner(board)\n if (victor == 'X')\n puts \"Congratulations X!\"\n elsif (victor == \"O\")\n puts \"Congratulations O!\"\n else\n puts \"Cat's Gam... | [
{
"docid": "0aeff943412b940a942238784a786d46",
"score": "0.8503789",
"text": "def start_tic_tac_toe\n\t\topening_dialogue\n\t\tnew_game\n\tend",
"title": ""
},
{
"docid": "3a5bf2a13c4b64bcf1e498c681699c2f",
"score": "0.82881814",
"text": "def play\r\n #binding.pry\r\n puts \"We... |
5025dbf206dbc288aaef7c57e8678a0d | Base initialization for this endpoint done whether or not the endpoint is enabled to check whether it is truly available for use | [
{
"docid": "a0a532e40c6b5d62745b671e4f2835b6",
"score": "0.0",
"text": "def connect\n client_error = enable_client\n port_error = initialize_port\n @resource = API.MIDIEntityGetDestination(@entity.resource, @resource_id)\n !@resource.address.zero? && client_error.zero? && port_error.... | [
{
"docid": "18ae5f86264259edd4f5fd4c4bc83355",
"score": "0.6651654",
"text": "def initialize\n @endpoint = DEFAULT_ENDPOINT\n end",
"title": ""
},
{
"docid": "4ad5abed8e644faeed202508d965df43",
"score": "0.66321725",
"text": "def initialize\n @endpoint = DEFAULT_ENDPOI... |
d24b7a13cd9ea41e5cc940142553ba47 | Opens the umin_file and returns each row as a UminRow object wrapperd in a RowWrapper object. | [
{
"docid": "5929e111a6e50e1d5e7cdee6585b8e90",
"score": "0.72249633",
"text": "def umin_rows_each\n umin_file_lines_each do |line|\n umin_row = @parser_class.parse(line)\n next unless umin_row.is_valid_submission?\n yield RowWrapper.new(umin_row)\n end\n end",
"titl... | [
{
"docid": "8264f194619fdd4f9247046164cba900",
"score": "0.58238834",
"text": "def read_entries_from_open_file!(file)\n while line = file.gets\n line.chomp!\n fields = line.split(\"\\t\")\n\n if fields.size == 1 # List of rows.\n # Create a row.\n self.create_empty_row!(f... |
5399004b1597072da6d1ea43a1285d35 | Display a link if user is authorized, otherwise nothing +name+ : String to be displayed +options+ : Hash containing options for authorized_for and link_to +html_options+ : Hash containing html options for the link or span | [
{
"docid": "7633ddb49dda96fb06e529cb7ba3a21c",
"score": "0.85698575",
"text": "def display_link_if_authorized(name, options = {}, html_options = {})\n enable_link = html_options.has_key?(:disabled) ? !html_options[:disabled] : true\n if enable_link and authorized_for(options)\n link_to(name, ... | [
{
"docid": "ea1b40e1e654c519d9059940e432199b",
"score": "0.7955201",
"text": "def link_to_if_authorized(name, options = {}, html_options = {})\n enable_link = authorized_for(options)\n if enable_link\n link_to name, options, html_options\n else\n link_to_function name, nil, html_optio... |
7e4889f08105e07a9cffd53920a118a7 | GET /stocks GET /stocks.json | [
{
"docid": "f2e16ecb7751866ea99b1db947740ba7",
"score": "0.7172102",
"text": "def index\n headers['Last-Modified'] = Time.now.httpdate\n session_id = nil\n\n if !params[:symbols].nil?\n syms = params[:symbols].split(\",\")\n @stocks = params[:latest] ? [] : Stock.where(symbol: syms)\n... | [
{
"docid": "101460710b669b67f96b513d093ffd0c",
"score": "0.7824659",
"text": "def show\n @stock = Stock.find(params[:id])\n\n render json: @stock\n end",
"title": ""
},
{
"docid": "fb8ef170ca6d7cf7b8232fc76bb1a2b1",
"score": "0.7670839",
"text": "def index\n @product = Prod... |
0e69dfdfb0f71d5c9ede8be4bc2651ed | This is especially great with a long array. Lazy initialized attribute | [
{
"docid": "4cdb5c02dc1268aba834ac23b3bf6243",
"score": "0.0",
"text": "def Person\n def initialize\n @name\n @friends\n end\nend",
"title": ""
}
] | [
{
"docid": "e57e0f681c7f0b1e46ec99a3ed4708c4",
"score": "0.65585274",
"text": "def old_array; end",
"title": ""
},
{
"docid": "06954dda96405aae3c94b23c368f4d14",
"score": "0.65523076",
"text": "def get_lazy_array\n LazyArray.new(self)\n end",
"title": ""
},
{
"doc... |
d5746fdc4bb0b81746eecdb26c354a53 | Author: Donia Magdy, Hanan Hosny Description: this action displays the Spa centers and the results of the search filtering Params: q (this contains a hash of the search parameters that the user passes in) Success: The user gets the list of the Spa centers specified in the search params Failure: The user gets a message ... | [
{
"docid": "7d8570e4f6bd7707aee598dff6578a12",
"score": "0.64051485",
"text": "def indexSpa\n @q = Vendor.where(entry:'Spa').ransack(params[:q])\n\n @per_page = params[:per_page] || Vendor.per_page || 20\n @vendors = @q.result(:distinct=>true).paginate( :per_page => @per_page, :pa... | [
{
"docid": "a2b12c4fe072d43ea584ebaff1a39266",
"score": "0.6818575",
"text": "def index\n if params[:page].nil?\n # ページ繰り以外\n @searched = Hash.new()\n session[:searched] = @searched\n if params[:commit].nil?\n @searched[:month] = Date.today.month\n else\n # 検索ボタ... |
aa3e24554d5e860006bc65b921d4879d | Try to block ads. Enabling this option can produce smaller output and speed up the conversion. +value+ Set to true to block ads in web pages. Returns The converter object. | [
{
"docid": "91e0a1b8c70a93bb3c4d2ece69787864",
"score": "0.5676096",
"text": "def setBlockAds(value)\n @fields['block_ads'] = value\n self\n end",
"title": ""
}
] | [
{
"docid": "e3899ffb70ffec0d48ad601d5a438c42",
"score": "0.5399935",
"text": "def set_ad_blocking_enabled(enabled:)\n {\n method: \"Page.setAdBlockingEnabled\",\n params: { enabled: enabled }.compact\n }\n end",
"title": ""
},
{
"docid": "c375a0c329abac54... |
f199b0ac489187c00c94e00fc2775955 | extend value_of to handle intervals and PitchClasses | [
{
"docid": "01c0bd69696b20d124ba9fff03290856",
"score": "0.6716242",
"text": "def value_of element\n element = super # eval Procs\n case element\n when Numeric then @value.transpose(element) if @value # add interval\n when PitchClass then @value.nearest(element) if @value... | [
{
"docid": "499b1b80226db4b9e31478421b8760ba",
"score": "0.55944824",
"text": "def lenient_value_coercions; end",
"title": ""
},
{
"docid": "0cd39333bd2740c237c79d2594cae40e",
"score": "0.54674745",
"text": "def transform(value, instance); end",
"title": ""
},
{
"docid": ... |
af1a7fe0d8e7e88fc9b26d76de909335 | Gets the userId property value. Calling user's ID in Graph. GUID. This and other user info will be null/empty for bot call types (ucapin, ucapout). | [
{
"docid": "48225f4ab282761b1bca769fa5e8721e",
"score": "0.5905856",
"text": "def user_id\n return @user_id\n end",
"title": ""
}
] | [
{
"docid": "6668a3d24079d5fe96f2cb4efb2c943b",
"score": "0.6874167",
"text": "def user_id\n @variables[\"user\"][\"userId\"]\n end",
"title": ""
},
{
"docid": "9302c93f76eba9a19d9e3da189f70c56",
"score": "0.6592236",
"text": "def user_id()\n\t\t\treturn @user_data['user_id']\... |
424124d35d24da124bc2584b50571b34 | To a string of html | [
{
"docid": "5e591e5928c21555a10f5c6b2a9eba88",
"score": "0.0",
"text": "def to_s\n inserts_html = partition(@tracks).inject('') do |html, tracks|\n html += Insert.new(@album_title, tracks).to_s\n end\n Template % [inserts_html]\n end",
"title": ""
}
] | [
{
"docid": "af93814ad8b4dd1f5778965e1ca2c17b",
"score": "0.7996482",
"text": "def html_string\n @html.join(\"\")\n end",
"title": ""
},
{
"docid": "aeb3fb530db3da0b5554cd42e88da560",
"score": "0.7857791",
"text": "def to_html\n map { |x| x.output(\"\") }.join\n end",
... |
3fb10faac08c5e0c0e5c36800a34c3a1 | ('a', '') => ['a'] ('a', 'b') => ['ab', 'ba'] ('a', 'bc') => ['abc', 'bac', 'bca'] | [
{
"docid": "2d790156caeb3a69931856e79aab011e",
"score": "0.0",
"text": "def permutations_with_character(c, string)\n permutations = Array.new(string.size.succ) { string.chars }\n permutations.map.with_index do |p, i|\n p.insert(i, c)\n p.join\n end\n end",
"title": ""... | [
{
"docid": "032ef47b9269243ccb02b9e4004c1277",
"score": "0.61097157",
"text": "def find_combos(word)\n return [word] if word.length == 1\n combos = []\n word.each_char.with_index do |char, idx|\n word_dup = word.dup\n word_dup.slice!(idx)\n find_combos(word_dup).each do |combo|\n combos... |
70c8b2a3ce3f516ffbae227e5248c59b | save all of the fields and fieldsets in the values hash for this fieldset associator | [
{
"docid": "6623c193efcbfc298cdbdc8f0a06c4f9",
"score": "0.6373671",
"text": "def save_fsa(key, fsa_values)\n key_id = key.gsub(/^#{DynamicFieldsets.config.form_fieldset_associator_prefix}/, \"\")\n\n if(key_id == \"\")\n fsa = DynamicFieldsets::FieldsetAssociator.create(\n ... | [
{
"docid": "faa36eb75fdd585dd027ec878d94ea80",
"score": "0.745975",
"text": "def save_dynamic_fieldsets\n values = self.dynamic_fieldset_values\n if !values.nil?\n values.keys.each do |key|\n if key.start_with?(DynamicFieldsets.config.form_fieldset_associator_prefix)\n ... |
d086977cc6737d16502b6e394103e87e | `Lynr::Controller::Basebefore_POST` Placeholder method for preprocessing of POST requests that makes sure | [
{
"docid": "eb433b49868c8b2d216be62014f3f843",
"score": "0.7331185",
"text": "def before_POST(req)\n @posted = req.POST.dup\n end",
"title": ""
}
] | [
{
"docid": "d29ecfefdd2068daa7cce69f160b0d0f",
"score": "0.72749436",
"text": "def before_POST(req)\n super\n @errors = validate(req)\n get(req) if has_errors?\n end",
"title": ""
},
{
"docid": "9fd3771cef1cdb22c59c400112c1c958",
"score": "0.65350145",
"text": "def ... |
7b743dbfbc028ab126cdc3bd2f54f8c1 | Strong parameter of model UserToken | [
{
"docid": "2611533cc9d22dc5551f7d8a91a64ac6",
"score": "0.0",
"text": "def credential_params\n params.require(:credential).permit(:email, :password)\n end",
"title": ""
}
] | [
{
"docid": "8c085ff86f046d988db1efa1940dd47a",
"score": "0.76444083",
"text": "def token_for(user)\n Auth::TokenManager.encode(user.id)\nend",
"title": ""
},
{
"docid": "a6571ab46bd2cc9bd4ec295a0b110963",
"score": "0.7552941",
"text": "def user_token_params\n params.require(:us... |
a28e478681ac9d29c5dd796aa824781d | PATCH/PUT /users/1 PATCH/PUT /users/1.json | [
{
"docid": "a9317ced2efa2176f7f308585ae29137",
"score": "0.0",
"text": "def update\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
}
] | [
{
"docid": "f0686f191a0def3b6c3ad6edfbcf2f03",
"score": "0.7242611",
"text": "def update_user(email)\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users/2.json'\n ).to_s\n\n puts RestClient.patch(\n url,\n { user: { email: email } }\n ... |
0159c8aee71e15c4ef5bb3e9feed3cfb | Rolls back the given transaction. | [
{
"docid": "75b9611736e5345d76e7496ee685c336",
"score": "0.75931996",
"text": "def rollback_transaction(tx)\n tx.rollback\n end",
"title": ""
}
] | [
{
"docid": "1618e983fd9c8e056debf6b44bed78b8",
"score": "0.803333",
"text": "def rollback\n current_transaction.rollback\n last_transaction = @all_transactions.pop\n end",
"title": ""
},
{
"docid": "d1ed199cb56635e9504fb4c5eada0403",
"score": "0.7607869",
"text": "def rollback... |
a6aac88d730b155d425a895e305c23db | Years From the XQuery function [fn:yearsfromduration]( | [
{
"docid": "65a144b499410a0ed71beba200fe04d2",
"score": "0.6953628",
"text": "def years; Integer.new(to_h[:yr] * (to_h[:si] ? -1 : 1)); end",
"title": ""
}
] | [
{
"docid": "c551ac3b0e86b8b9f71a88b640f6c9bd",
"score": "0.75891405",
"text": "def years\n Volt::Duration.new(self.to_i * 365.25.days, [[:years, self.to_i]])\n end",
"title": ""
},
{
"docid": "877768635a5220ae1df5828902d25d74",
"score": "0.7494311",
"text": "def seconds_to_year s... |
15e5d05bed1e063afceeb500cbb5b06a | DELETE /partner_user_details/1 DELETE /partner_user_details/1.xml | [
{
"docid": "c1705b0571de60b7046c6bf7b0d320e4",
"score": "0.72843146",
"text": "def destroy\n @partner_user_detail = PartnerUserDetail.find(params[:id])\n @partner_user_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_partner_user_details_url) }\n format.xml ... | [
{
"docid": "d29aa233ddb4837c263e69069aaa2550",
"score": "0.66951513",
"text": "def user_delete(username)\n make_request(:delete,\"#{user_url(username)}.xml\")\n end",
"title": ""
},
{
"docid": "31be2fbd2b5aedc5e7088866cdb5f8a3",
"score": "0.66218185",
"text": "def delete_user... |
0fb585f2072edeaaa95969527122eb57 | auth:logout clear your Trello credentials Example: $ trello_standup auth:logout "Local credentials cleared." | [
{
"docid": "fd4704f710a17893ab6de44ec43aa811",
"score": "0.9073527",
"text": "def logout\n TrelloStandup::Auth.logout\n display \"Local credentials cleared.\"\n end",
"title": ""
}
] | [
{
"docid": "244c5184d7afcd16fefbd58bda1969e5",
"score": "0.8856723",
"text": "def logout\n validate_arguments!\n\n Pebbles::Auth.logout\n display \"Local credentials cleared.\"\n end",
"title": ""
},
{
"docid": "b3b2af1a170424fb0fa1fda27a2b3bc4",
"score": "0.8769397",
"text... |
b644921b93d07c900c09f2bf62f048cc | Return the HTML ID for field I'm using to filter TODO: Override if passed in | [
{
"docid": "d98004ea89dae406fcbb4d40d156bc48",
"score": "0.74353147",
"text": "def filter_input_id\n \"#{self.form.object_name}_#{self.filter_field}\"\n end",
"title": ""
}
] | [
{
"docid": "c6846dab69b12f21e6c8cb3f2e1aac75",
"score": "0.7222389",
"text": "def field_html_id(\n name = 'field',\n base: nil,\n field: nil,\n label: nil,\n index: nil,\n group: nil,\n **opt\n )\n base ||= model_html_id(field || label)\n # noinspection RubyMismatchedA... |
32ef232252e8909455f5ec65aa8065c7 | since this is built to be a simulation, main memory should just be filled with hex values from 0 to FF, then repeated until full. | [
{
"docid": "177f5db82604b74a14567faf36d02598",
"score": "0.6336629",
"text": "def initialize_content\n content = []\n num = 0\n (0..@size).each do\n num = 0 if (num != 0 && num % ((@size+1)/8) == 0)\n content << num.to_s(16)\n num+=1\n end\n content\n end... | [
{
"docid": "edc535782186c24490ba2109a53f3bd1",
"score": "0.6292234",
"text": "def main\n\trun \"100011 00000 10001 0000000000000100\"\n\trun \"100011 00000 10010 0000000000010000\"\n\trun \"100011 00000 10011 0000000000100000\"\n\trun \"100011 00000 10100 0000000000010100\"\n\trun \"101011 00000 10001 0... |
50df0fc3f8921780d1ed8f9a7ec13d93 | GET /compute_nodes/1 GET /compute_nodes/1.json | [
{
"docid": "1d97bc92288b004a1ddfcf607c97c8ed",
"score": "0.72550684",
"text": "def show\n @compute_node = ComputeNode.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @compute_node }\n end\n end",
"title": ""
}
] | [
{
"docid": "fa0f35aeff74d974eb16d742d2416c63",
"score": "0.7493889",
"text": "def __get_nodes\n JSON.parse(Net::HTTP.get(URI(\"#{__cluster_url}/_nodes/process\")))\n end",
"title": ""
},
{
"docid": "5a40593a209110e4a8d694e666048fdd",
"score": "0.68700296",
"text":... |
f239bbc043779b9d378ee1d089b0a0eb | PUT /mailing_lists/1 PUT /mailing_lists/1.json | [
{
"docid": "b6fd84ffa33595524169ada7adcd9b69",
"score": "0.7221327",
"text": "def update\n params[:mailing_list][:query] = {} if params[:suppress_query_form]\n @list = MailingList.find(params[:id])\n\n respond_to do |format|\n if @list.update_attributes(mailing_list_params)\n format... | [
{
"docid": "95f9708544a8f83850c0129c5aa4b8d7",
"score": "0.73727065",
"text": "def update\n @mailing_list = MailingList.find(params[:id])\n\n respond_to do |format|\n if @mailing_list.update_attributes(params[:mailing_list])\n format.html { redirect_to @mailing_list, notice: 'Mailing l... |
5c124b06c44405257759a5eb0324905a | The resource class based on the controller | [
{
"docid": "538db916c1be895564579c30a8a75436",
"score": "0.8063839",
"text": "def resource_class\n @resource_class ||= resource_name.classify.constantize\n end",
"title": ""
}
] | [
{
"docid": "ec7ea1415f0e4585e839276dd0a8ac6d",
"score": "0.8934459",
"text": "def resource_class\n controller_name.classify.constantize\n end",
"title": ""
},
{
"docid": "294d4eaca23d5acfa43d3ce97d8916aa",
"score": "0.8890157",
"text": "def resource_class\n @resource... |
c88ad69a145e234c1daa6fe7dbcd706e | GET /feedback_assignments/1 GET /feedback_assignments/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "e4a1b3479f2aedfd1d2cf3c21cb4505f",
"score": "0.74373025",
"text": "def index\n @feedback_assignments = FeedbackAssignment.all\n end",
"title": ""
},
{
"docid": "de17ab4c2a8a69fc10d9a8c5595cba33",
"score": "0.68289155",
"text": "def feedback\n @assignment = Assignme... |
1ef99e02950f2332b77c9ba3adc1841c | Remove mask flag it will still be present in payload | [
{
"docid": "4203e93dc3b48af56e163f38179dcb49",
"score": "0.72315395",
"text": "def unset_mask\n @masking_key = nil\n end",
"title": ""
}
] | [
{
"docid": "9f9672f6102a365c001ea227666723f5",
"score": "0.68096995",
"text": "def mask\n # + - - - - - - - - - - - - - - - +-------------------------------+\n # | |Masking-key, if MASK set to 1 |\n # +-------------------------------+---------------------... |
b55e1c0a07764dbe4503a755abcfb6e2 | PATCH/PUT /person_events/1 PATCH/PUT /person_events/1.json | [
{
"docid": "b5d78b4a6c9533dd2e26edb368cc1e6f",
"score": "0.7365932",
"text": "def update\n respond_to do |format|\n if @person_event.update(person_event_params)\n format.html { redirect_to @person_event, notice: 'Person event was successfully updated.' }\n format.json { head :no_co... | [
{
"docid": "6e0e5a5a3ebbcaf678ab0086d33a8170",
"score": "0.70747346",
"text": "def update\n respond_to do |format|\n if @events_person.update(events_person_params)\n format.html { redirect_to @events_person, notice: 'Events person was successfully updated.' }\n format.json { render... |
2f1ab3da426f907c0dfc5ba9b215721a | Used by automatic recovery machinery. | [
{
"docid": "c4374e4ee236224ede0e30a59c83a94c",
"score": "0.0",
"text": "def rebind(&block)\n @bindings.each { |b| self.bind(b[:exchange], b[:routing_key], true, b[:arguments]) }\n end",
"title": ""
}
] | [
{
"docid": "7567722cb6c5ce9eca9cdcff199626e1",
"score": "0.8079275",
"text": "def recovery()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "708099ec54ca8edd90fb9744f3f6dddc",
"score": "0.7712987",
"text": "def auto_recover\n ... |
30ba9cf1a33e502b1d26c16f003d4815 | Internal: Compute digest for a set of paths. paths Array of filename or directory paths. Returns String digest bytes. source://sprockets//lib/sprockets/path_digest_utils.rb43 | [
{
"docid": "7ba1b17594531d0f3e4df991a7a0d79c",
"score": "0.77839375",
"text": "def files_digest(paths); end",
"title": ""
}
] | [
{
"docid": "81a1b5e598873aba223e8c895a2c0a34",
"score": "0.69506985",
"text": "def dependencies_hexdigest(paths)\n digest = Digest::SHA1.new\n paths.each { |path| digest.update(file_hexdigest(path).to_s) }\n digest.hexdigest\n end",
"title": ""
},
{
"docid": "81a1b5e598873a... |
87c7cb6f307af59d699e1a7e42ad286a | PUT /processos/1 PUT /processos/1.xml | [
{
"docid": "ddce101c870b169b24aac5c88ae1b491",
"score": "0.61811626",
"text": "def update\n @processo = Processo.find(params[:id])\n\n respond_to do |format|\n if @processo.update_attributes(params[:processo])\n flash[:notice] = 'Processo was successfully updated.'\n format.html... | [
{
"docid": "cf3d0629494899ea3de82beecd351e29",
"score": "0.6118881",
"text": "def update\n @processo = Processo.find(params[:id])\n\n respond_to do |format|\n if @processo.update_attributes(params[:processo])\n format.html { render :json => {:success => true} }\n format.xml { r... |
da9f52786cab78e931e2ec6453d3be33 | Returns webpage objects as array | [
{
"docid": "5383327ca1e0addcc412a99d93ba92cf",
"score": "0.60179424",
"text": "def get_webpages(tweet)\n webpage_object_array = []\n webpage_string_array = parse_webpages(tweet)\n webpage_string_array.each do |url|\n nailer = LinkThumbnailer.generate(url)\n if Webpage.where(url: url).... | [
{
"docid": "8b274d53a109f751358b181568e3457a",
"score": "0.7219179",
"text": "def webpages\n @data[\"webpage\"]\n end",
"title": ""
},
{
"docid": "f50b14ce3eefef7fc78b7fc892be82f7",
"score": "0.69817495",
"text": "def to_array\n [@url, @html, @charset]\n end",
"ti... |
7c73d1db680f9f6d148c0437ee7cd0ca | Outputs the actor's name in the format 'firstname lastname' | [
{
"docid": "b667cc04386e5909fbb2508c4410502d",
"score": "0.0",
"text": "def name\n \"#{firstname} #{lastname}\"\n end",
"title": ""
}
] | [
{
"docid": "6679d18a9c6c42d9bd095c1e1b28a5d7",
"score": "0.8165108",
"text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n #...that returns the first and last name of an actor.\n end",
"title": ""
},
{
"docid": "1e47f8753d838bf8c7230f35c07bca49",
"score": "0.7641066"... |
bb98daec45a26905cb9a270326f74c6d | DELETE /exams/1 DELETE /exams/1.json | [
{
"docid": "508091edc30a1eaaff835bb34a0224f0",
"score": "0.70567095",
"text": "def destroy\n @exam.destroy\n respond_to do |format|\n format.html { redirect_to exams_url, notice: 'Exam was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}... | [
{
"docid": "ad86927f1fcde37e80086f508ce163d0",
"score": "0.7685275",
"text": "def destroy\n @exam = Exam.find(params[:id])\n @exam.delete\n respond_to do |format|\n format.html { redirect_to exams_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
... |
62121f57ee4f7b7cfb385fa0d5224671 | Decodes an Open Location Code(Plus+Codes) into a [CodeArea]. | [
{
"docid": "489446f0f6f7c7643e06544d78303d79",
"score": "0.8205441",
"text": "def decode(code)\n unless full?(code)\n raise ArgumentError,\n \"Open Location Code(Plus+Codes) is not a valid full code: #{code}\"\n end\n\n code = code.gsub(SEPARATOR, '')\n code = cod... | [
{
"docid": "b702edc90df8f48fb5b32000ed1d7989",
"score": "0.7315842",
"text": "def process\n unless full?\n raise OLCError, \"Passed Open Location Code is not a valid full code: #{code}\"\n end\n\n # Strip out separator character (we've already established the code is\n # valid... |
19a5090892fa2ba3a25228de0440cd48 | Returns a String suitable for display | [
{
"docid": "056f08ae4b2817fc12dea5061fc6fee9",
"score": "0.0",
"text": "def to_s\n \"#{@customer}: #{@body}\"\n end",
"title": ""
}
] | [
{
"docid": "4d850aa3a213bc9a8989dec696d4bebc",
"score": "0.7637922",
"text": "def to_s\n long_display\n end",
"title": ""
},
{
"docid": "4d850aa3a213bc9a8989dec696d4bebc",
"score": "0.7637922",
"text": "def to_s\n long_display\n end",
"title": ""
},
{
... |
88ff45bbfd1ab4d13fc9150c0af122a5 | Nokogiri XML DOM for the current Brominet XML representation of the GUI | [
{
"docid": "2ad49ee9ac4f717f770495483723bc94",
"score": "0.7443937",
"text": "def dom\r\n @dom = Nokogiri::XML @gui.dump\r\nend",
"title": ""
}
] | [
{
"docid": "48649b79e5137e05f9289d7e121ad484",
"score": "0.775801",
"text": "def dom_for_gui\n @dom = Nokogiri::XML self.dump\n end",
"title": ""
},
{
"docid": "3028972415e5b2fc95c40e51ec6413be",
"score": "0.63618416",
"text": "def document()\n @dom\n end",
"tit... |
43a00be764cde930866ef0ed8c62212a | method which generates entries | [
{
"docid": "2890e430600f0851374b852bc6dcf5de",
"score": "0.0",
"text": "def pop_taxonomy (count, ptype = 'species')\n\n print \"Creating #{count} \"; print \"#{count > 1 ? ptype.pluralize : ptype} in \".green; print \"#{Rails.env}\".green.bold; print \" database \".green\n\n # incl... | [
{
"docid": "691db29efa23a21ff799e372bcbef4f3",
"score": "0.7668906",
"text": "def entries() end",
"title": ""
},
{
"docid": "3fb68e91718c0023575193099d43fb83",
"score": "0.73903435",
"text": "def entries; end",
"title": ""
},
{
"docid": "3fb68e91718c0023575193099d43fb83",... |
0a0579b5ed4dcfd106f579b573a7f1ca | Test that it can detect a winner. How? Helper function to test output. | [
{
"docid": "36eb7593dc3462ebe50a4a47ebf5dcb8",
"score": "0.0",
"text": "def capture_stdout\n stdout = $stdout\n $stdout = captured = StringIO.new\n begin\n yield\n ensure\n $stdout = stdout\n end\n captured.string\n end",
"title": ""
}
] | [
{
"docid": "bfc0f8e0c2f5c75d056bb4885d1c0c3b",
"score": "0.7612279",
"text": "def winner?\n !!determine_winner\n end",
"title": ""
},
{
"docid": "fe3940cb33300e54ce73c76132fedaa0",
"score": "0.75382066",
"text": "def test_winner_1\n grid = [\"x\",\"o\",\"x\",\"x\",\"o\",\"... |
9493413361ab7024426238ff16beeeca | Virtual account of this VirtualClient in the form of PSHash. This method is valid only inside block passed to with_account(). | [
{
"docid": "d8de3aacd80ec8d71b948eb17d2b9a83",
"score": "0.0",
"text": "def account\n @account or raise %Q{Invalid usage; see method's documentation}\n end",
"title": ""
}
] | [
{
"docid": "8f99c686b4027fe57fadf2890907aec7",
"score": "0.5625775",
"text": "def hash\n [@wallet, @account].join('+').hash\n end",
"title": ""
},
{
"docid": "d7fc78c78d2ead958d43220dbabe5767",
"score": "0.5540384",
"text": "def account(hash)\n ledger_entry(hash)\n ... |
aee45703c68c659987a0d721f09baf8a | GET /weibos/1 GET /weibos/1.json | [
{
"docid": "64264735fdd8025d275ca1c89a8bf235",
"score": "0.6149884",
"text": "def show\n @weibo = Weibo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @weibo }\n end\n end",
"title": ""
}
] | [
{
"docid": "96c7c1fb4a48ac9ee68d4c8bf7fcbbb0",
"score": "0.6238512",
"text": "def index\n @waivers = Waiver.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @waivers }\n end\n end",
"title": ""
},
{
"docid": "15504d217eb372847f723... |
29ed8d674c98981a14e1db57f5876b6f | GET /inventory_items GET /inventory_items.json | [
{
"docid": "9877794bc511cdcb4ecf06285b39276c",
"score": "0.0",
"text": "def index\n @inventory_items = InventoryItem.all\n @total_amount = 0\n @total_current_value = 0.0\n @total_value = 0.0\n @inventory_items.each do |inventory_item|\n @total_amount += 1\n @total_current_value ... | [
{
"docid": "f5a45419a7efb5e69e13e2bf92d8b26b",
"score": "0.742052",
"text": "def index\n @inventory_items = InventoryItem.all\n end",
"title": ""
},
{
"docid": "3e41f5361418c0d43438bb8ded8e1d64",
"score": "0.7404527",
"text": "def show\n @inventoryitem = Inventoryitem.find(par... |
f5896722577884f0822195f7224dd6b3 | This method allows the gridclient code to cancel the rendering of a given cell | [
{
"docid": "131fc795b7a98f35d653e9a9df52e212",
"score": "0.8220724",
"text": "def cancel_cell_rendering(column_name,cell_value,record)\n# if column_name == \"show_records\"\n# return true\n# else\n# return false\n# end\n return true\n end",
"title"... | [
{
"docid": "63149660f60d9b2abc1a4c1c4113c37a",
"score": "0.82138306",
"text": "def cancel_cell_rendering(column_name,cell_value,record)\n if column_name == \"menu_item\"\n return true\n end\n return false\n end",
"title": ""
},
{
"docid": "6383b1c46c88bd860f806701bac... |
23f94f66b9d62340880df7534684b929 | def find_tony(array) for item in array if item == 'Tony' return true end if item.class == Array for name in item if name == 'Tony' return true end end end end end | [
{
"docid": "9e141e1846b5d5d0b189fa1432ee1881",
"score": "0.8857331",
"text": "def find_tony(array)\n flat_array = array.flatten()\n for item in flat_array\n if item == 'Tony'\n return true\n end\n end\n return false\nend",
"title": ""
}
] | [
{
"docid": "938ad06f2f43121fdc0400bc3feb0aec",
"score": "0.72173446",
"text": "def find_the_cheese(array)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n array.find { |tasty_morsel| cheese_types.include?(tasty_morsel) }\nend",
"title": ""
},
{
"docid": "5f2e47b9e7bfdc7ef4db6eb22... |