query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "c0271bd62806059e61123020f4e0df98",
"score": "0.0",
"text": "def update!(**args)\n @folders = args[:folders] if args.key?(:folders)\n @name = args[:name] if args.key?(:name)\n @parent = args[:parent] if args.key?(:parent)\n @parent_display_name = args[:pare... | [
{
"docid": "184b1b1ed771473d3eb9f338c0734c38",
"score": "0.73066413",
"text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end",
"title": ""
},
{
"docid": "5076c5a88404ae72986f958710f5687a",
"score": "0.72631145",
"text": "def update... |
ca48155eccc337677dc13fcef2cc1b73 | build instance from Faraday::Response | [
{
"docid": "283c018846e958c3e1fba191c3663787",
"score": "0.635369",
"text": "def initialize(response)\n Paperdrive::Error.raise_from(response)\n @header = response.headers.to_h\n @ratelimit = build_ratelimit(@header)\n @body = JSON.parse(response.body)\n @status_code = response.... | [
{
"docid": "731c7985bc4a105597804ffd2103154a",
"score": "0.70656693",
"text": "def initialize(faraday_response, client)\n @client = client\n @response = faraday_response\n @response.on_complete do\n @request_id = headers['X-Orchestrate-Req-Id'] if headers['X-Orchestrate-Req-Id']\n ... |
ae28b9911b90beca1f7bea497e4f3667 | Empty strings comes from form, but we can't save it due to unique DB index. | [
{
"docid": "bf0da79e4788c76ffb6dc519e97b2da3",
"score": "0.0",
"text": "def nullify_empty_slug\n self.landing_page_slug = nil if landing_page_slug == ''\n end",
"title": ""
}
] | [
{
"docid": "c8573bed1f0a2b3e6db2db5c58ddade5",
"score": "0.6930891",
"text": "def set_empty_attributes_to_nil\n\t\t# This method makes sure - empty string does not save in the database.\n\t\t# example: SSN - empty string was getting saved in the database- it was giving unique constraint error - while sa... |
be9db1fd9b759a8dc1ddf1b64eb2acc5 | Reads/sets rec data from record_metadata by recnum lookup | [
{
"docid": "b9f305c98608560508372ddc0ae22841",
"score": "0.66238993",
"text": "def read_record_metadata\n return {} unless recnum\n query = <<-SQL\n select *\n from sierra_view.record_metadata rm\n where record_type_code = \\'#{rtype}\\'\n and record_num = \\'#{recnum}\\'\n ... | [
{
"docid": "1c8b39fc6c576d626518f412681f66dc",
"score": "0.6716347",
"text": "def rec_metadata\n @rec_metadata ||= read_record_metadata\n end",
"title": ""
},
{
"docid": "1f9d2c446cdf4df76d8de292318c8755",
"score": "0.63513273",
"text": "def load(file_rec)\n md_rec = Metadat... |
1efa9883981506a93415c9cd3ec4a608 | number1 The integer that could be between number2 and number3. number2 The integer that marks the first boundry marker. number3 The integer that marks the last boundry marker. Examples between(1, 3, 5) => true Returns true or false depending on if the number is within or equal the two boundries. | [
{
"docid": "ef8494e98b14df482542c98576ac2d40",
"score": "0.7926255",
"text": "def between(number1, number2, number3)\n output = false\n if number1 > (number2 - 1) && number1 < (number3 + 1)\n output = true\n end\n return output \nend",
"title": ""
}
] | [
{
"docid": "26f6d8ded15f92121e98493f635e2e76",
"score": "0.8086989",
"text": "def between(number1, number2, number3)\n return number1 >= number2 && number1 <= number3\nend",
"title": ""
},
{
"docid": "8a00f8f543a58cac59905d1bfd5b57ce",
"score": "0.7966889",
"text": "def between_st... |
a37971a20a2d962c9bef5b154efb9a94 | PATCH/PUT /packages/1 PATCH/PUT /packages/1.json | [
{
"docid": "19c87e34dfaa10944b1a937e54ef0b3e",
"score": "0.65434575",
"text": "def update\n respond_to do |format|\n if @package.update(package_params)\n format.html { redirect_to @package, notice: 'Package was successfully updated.' }\n format.json { render :show, status: :ok, loc... | [
{
"docid": "8d589d5fe6fd72de57fe3bf54256cd5e",
"score": "0.6976328",
"text": "def update\n if @package.update(package_params)\n render json: @package\n else\n render json: @package.errors\n end\n end",
"title": ""
},
{
"docid": "96aabda11bbe96df70bcebcb8d35b784",
"sco... |
cc8acf45a436133e896a1155a745c29e | PATCH/PUT /ratings/1 PATCH/PUT /ratings/1.json | [
{
"docid": "115f6c3d69bffc7f752bcf298613b428",
"score": "0.71170735",
"text": "def update\n respond_to do |format|\n if @rating.update(rating_params)\n format.html { redirect_to @rating, notice: 'Rating was successfully updated.' }\n format.json { render action: 'show', status: :ok... | [
{
"docid": "7db339d82d6b2d81316123b99c839c44",
"score": "0.76427203",
"text": "def update\n @rating = Rating.find(params[:id])\n\n respond_to do |format|\n if @rating.update_attributes(params[:rating])\n format.json { render json: @rating, status: :ok, location: nil }\n else\n ... |
f228088cf6263a8e9c889f5fd2cae755 | A custom shell banner builder must extend from this | [
{
"docid": "67748c465ca8e4459df2609a08bd3f91",
"score": "0.8537502",
"text": "def shell_banner\n Command::ShellBannerBuilder\n end",
"title": ""
}
] | [
{
"docid": "c1aa358383f6ce284913e686ca545184",
"score": "0.7448479",
"text": "def banner\n raise \"Command.banner should be overriden by subclasses\"\n end",
"title": ""
},
{
"docid": "1aa76603e75c96c98febe0bb4a9de724",
"score": "0.6963906",
"text": "def banner(command, n... |
7e18804c7f4a5d7c1f5e35fdc8e4f24a | Public: Get info about the loggedin user. Examples get the email of the loggedin user client.user_info.email | [
{
"docid": "ba46c33eaa6033eeddbbdddd3ad3411f",
"score": "0.79511094",
"text": "def user_info\n get(api_get.body.identity).body\n end",
"title": ""
}
] | [
{
"docid": "d193531c5570e0549b872104f17ea46f",
"score": "0.80064726",
"text": "def user_info(email)\n require_login\n raise CloudFoundry::Client::Exception::BadParams, \"Email cannot be blank\" if email.nil? || email.empty?\n get(\"#{CloudFoundry::Client::USERS_PATH}/#{email}\")\n ... |
3efff74eb3bf7d0b1f7f08919a6fa298 | GET /pages GET /pages.xml | [
{
"docid": "0d9c991642c636d83506683276e4af5e",
"score": "0.0",
"text": "def index\n @documents = Document.paginate_by_date(params[:year], params[:month], params[:day], params[:page])\n @documents_by_date = @documents.group_by(&:date)\n\n respond_to do |format|\n format.html # index.html.er... | [
{
"docid": "343ecaae5f333ae724bf4a4693caeab1",
"score": "0.73507947",
"text": "def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pages }\n end\n end",
"title": ""
},
{
"docid": "8b8502c5082d7c9c685830d8e... |
0ae6173328475ec5a8055fff45860718 | Returns spec by label and remove unnecessary | [
{
"docid": "08428cb7a470e82a3c059b062744d8bf",
"score": "0.63532263",
"text": "def spec(label)\n nbsp = Nokogiri::HTML(' ').text\n @specs.row(label)[1].text.gsub(nbsp, ' ')\n end",
"title": ""
}
] | [
{
"docid": "82be1fb2872f3523b00894a3d6aa96ac",
"score": "0.5514073",
"text": "def by_label\n @by_label ||= notes.group_by(&:label)\n end",
"title": ""
},
{
"docid": "711567140c85ee5a39def4ff94ae18dd",
"score": "0.5406687",
"text": "def labeled_measurements(label)\n # Need ... |
a3c4e9a178d53d934c45a67e2db24785 | Derive And Sync New Change Addresses Through this endpoint users can derive 100 change addresses, starting from the last index we have data for, which are then added to the xPub, subscribed for syncing, and start recording data. If no data is available, it will start from index 0. | [
{
"docid": "2410d55fd4a53b966dc5198b08987940",
"score": "0.52376115",
"text": "def derive_and_sync_new_change_addresses_with_http_info(blockchain, network, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: HDWalletsApi.derive_and_sync_new_change_add... | [
{
"docid": "54eef2c05b8f3ce651c1bbdedb03f8ff",
"score": "0.568708",
"text": "def expa_refresh\n people = nil\n SyncControl.new do |sync|\n sync.start_sync = DateTime.now\n sync.sync_type = 'open_people'\n\n setup_expa_api\n time = Time.new(2016,10,7,0,0,0)\n people = EXPA:... |
e17fa8a4a9fbdcd59946e6f3032ca9e1 | Write a method called prime? that takes a single parameter called number and returns true if the parameter is a prime number, or false otherwise. Use the Math.sqrt | [
{
"docid": "8852b40229e1692b186bb94c01fa20dd",
"score": "0.0",
"text": "def prime(number)\n num = 2.0\n # p Math.sqrt(number)\n until num > Math.sqrt(number)\n # until num > Math.sqrt(number)\n # p num\n # p number.remainder(num)\n if (number.remainder(num)) == 0\n return false\n ... | [
{
"docid": "e3edac979b07f89f7e54d669881af2c7",
"score": "0.89329135",
"text": "def prime?(number)\n prime(number, Math.sqrt(number).to_i)\nend",
"title": ""
},
{
"docid": "8639da6d1b3ed5251d9960e0ecd886b7",
"score": "0.8767812",
"text": "def prime? (number)\n p Math.sqrt(number)\ne... |
3483fb12cb178f5e2a8a2644b68a5887 | GET /linksets GET /linksets.json | [
{
"docid": "e092cf0bb7970d617183afec24da00a0",
"score": "0.7781116",
"text": "def index\n @linksets = Linkset.all\n end",
"title": ""
}
] | [
{
"docid": "7d76375506b4ff25ae4938f406e9ede1",
"score": "0.7129271",
"text": "def index\n @source_linksets = SourceLinkset.all\n end",
"title": ""
},
{
"docid": "ec5d9eedcc925a9cc8802b60904fde83",
"score": "0.66114926",
"text": "def set_linkset\n @linkset = Linkset.find(para... |
b8c0ca984af8aa7ff319a86b11c522cc | Frame Update (main phase step 6 : refresh) | [
{
"docid": "d9f174e01963ae43a2b6d9f39449d315",
"score": "0.0",
"text": "def update_phase4_step6\n # Clear battler being forced into action\n $game_temp.forcing_battler = nil\n # If common event ID is valid\n if @common_event_id > 0\n # Set up event\n common_event = $data_common_eve... | [
{
"docid": "cf64fd117b666f13a2a852428a4bed5b",
"score": "0.71743536",
"text": "def update\n\t\t@currentFrame += 1 if frame_expired?\n\tend",
"title": ""
},
{
"docid": "b3a4d206ce1557cf1c6bf47084e28512",
"score": "0.7173791",
"text": "def refresh_frame(run_whereami=true)\n change... |
1f6dc6995e55a2a71fda1715266dd2e3 | List ApplicationAuthentications Returns an array of ApplicationAuthentication objects | [
{
"docid": "05119399d636df73d605277c90063067",
"score": "0.6092807",
"text": "def list_all_application_authentications_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.list_all_application_authentications ...'\n end\n... | [
{
"docid": "12571f7f1016e8a6e25466f524bd53e3",
"score": "0.76877373",
"text": "def list_all_application_authentications(opts = {})\n data, _status_code, _headers = list_all_application_authentications_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "75c67a7ba165d0e... |
083ff28a55a04b6a599c383550e0cb92 | Login Called from current_user. First attempt to login by the user id stored in the session. | [
{
"docid": "f87ce44af1c849da25d71b63011f4772",
"score": "0.8397002",
"text": "def login_from_session\n self.current_user = User.find(session[:user_id]) if session[:user_id]\n end",
"title": ""
}
] | [
{
"docid": "f51a7636fcfd1cf5473efffab97d7a03",
"score": "0.84712005",
"text": "def login_from_session\n self.current_user = User.find_by_id(session[:user_id]) if session[:user_id]\n end",
"title": ""
},
{
"docid": "6c6133b819a6c13b5cffed2ce093bd4a",
"score": "0.82886606",
"te... |
c77109e43f980fc0432e21663712f621 | needs a bit of work it doesn't reveal numbers | [
{
"docid": "ed7da62b67b0e17e9ad6d317d2604797",
"score": "0.0",
"text": "def reveal_cell(row_num, col_num) #planning to be used recursively, used after ensuring the user did not click on a bomb.\n\t\tif (row_num <= 9 && row_num >=0) and (col_num <= 9 && col_num >=0)\n\t\t\tif @grid[row_num][col_num].is_h... | [
{
"docid": "66d3b6a4971262dd57e42a0a5ce2961c",
"score": "0.6366409",
"text": "def number; end",
"title": ""
},
{
"docid": "66d3b6a4971262dd57e42a0a5ce2961c",
"score": "0.6366409",
"text": "def number; end",
"title": ""
},
{
"docid": "3d1202a32f6b6d7e8715364dc4544bd0",
... |
90a4fce1025c3645c57167571829a300 | Create a screenshot marker Create a new screenshot marker. | [
{
"docid": "05ef5d5929eb65949e7fc2e715e3d6ad",
"score": "0.7512807",
"text": "def screenshot_marker_create(project_id, screenshot_id, screenshot_marker_create_parameters, opts = {})\n data, _status_code, _headers = screenshot_marker_create_with_http_info(project_id, screenshot_id, screenshot_marker... | [
{
"docid": "051c91fcec182bf2b78904c8f40eb261",
"score": "0.7853304",
"text": "def screenshot_marker_create(project_id, screenshot_id, params)\n path = sprintf(\"/api/v2/projects/%s/screenshots/%s/markers\", project_id, screenshot_id)\n data_hash = {}\n post_body = nil\n \n if params... |
7775753ff31a1514dc33761e9f9b88de | PATCH/PUT /supports/1 PATCH/PUT /supports/1.json | [
{
"docid": "a79427455a5a6a567e04fb953544e77f",
"score": "0.5136508",
"text": "def update\n respond_to do |format|\n if @support.update(user_params)\n format.html { redirect_to supports_url, notice: 'Agent was successfully updated.' }\n format.json { head :no_content }\n else\n... | [
{
"docid": "29ebe4868508fbdf158b62b2fe6ed6f7",
"score": "0.63372314",
"text": "def http_method_modifies_resource?\n ['PUT','POST','PATCH'].include?(method.to_s.upcase)\n end",
"title": ""
},
{
"docid": "617ca40a3d7dc649187863a37ddadfa8",
"score": "0.61152005",
"text": "de... |
e288765aad57e2385d80a01e665c20e8 | Given a list of files and directories, create a list of all the Ruby files they contain. If +force_doc+ is true we always add the given files, if false, only add files that we guarantee we can parse. It is true when looking at files given on the command line, false when recursing through subdirectories. The effect of t... | [
{
"docid": "3e331af0914cc1ebb38290a1fdcbf295",
"score": "0.6852115",
"text": "def normalized_file_list(options, relative_files, force_doc = false,\n exclude_pattern = nil)\n file_list = []\n\n relative_files.each do |rel_file_name|\n next if exclude_pattern &... | [
{
"docid": "15ab9e72e0a0f63f10a3fe4ee53eea1b",
"score": "0.6948236",
"text": "def normalized_file_list(options, relative_files, force_doc = false, exclude_pattern=nil)\n file_list = []\n\n relative_files.each do |rel_file_name|\n next if exclude_pattern && exclude_pattern =~ rel_file_na... |
5611bcbe9315908764e798951645a791 | gets a valid dependency list works for any object type for tables, it also searches for foreign key refernces as well as plsql references. | [
{
"docid": "4eb50a5a050095044548a65ab1ff612d",
"score": "0.7837595",
"text": "def get_dependencies(object_owner,object_name)\n tbl_dependency_sql = %q{ select UNIQUE b.table_name dependent_table\n from all_constraints a\n join all_constraints b\n on a.r_constraint_name ... | [
{
"docid": "7677dc6aaf7d51fb2af8e87c1de7094b",
"score": "0.69694984",
"text": "def get_dependencies\n sql = %Q{\n select *\n from all_dependencies dep\n where referenced_name = '#{@table}'\n }\n\n begin\n cursor = @connection.exec(sql)\n ... |
5a82ae0043f70e63ff54e9f7520db6c4 | Takes a hash which maps argument number to class type. Returns the map of argument types. | [
{
"docid": "c0b720e99e50c8b22d6fb81d3c95c8f4",
"score": "0.0",
"text": "def args(map = nil)\n @args ||= {}\n @args.merge! map if map\n @args\n end",
"title": ""
}
] | [
{
"docid": "123b8f7196c86b0ccea4124aead33069",
"score": "0.60286856",
"text": "def class_types\n class_methods_that_should_match.each_with_object Hash.new do |name, hash|\n surrogate_type, actual_type = class_types_for name\n next if surrogate_type == actual_type || name == :clone # u... |
dafb17247152d7a0373f31df8f1b308c | GET /lbaas GET /lbaas.json | [
{
"docid": "90a12f10803c3edb3896052753f08eee",
"score": "0.6744664",
"text": "def index\n @lbaas = Lbaa.all\n @lbaas = Lbaa.where(:section => 'A').order(\"id\")\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lbaas }\n end\n end",
"title":... | [
{
"docid": "049a6408d6130136027d509dd5762587",
"score": "0.6797146",
"text": "def show\n @lbaa = Lbaa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lbaa }\n end\n end",
"title": ""
},
{
"docid": "958a3b9beeba36f5a... |
03a1f07890d0a4d633b6d3eb181b1e6a | PUT /product_costs/1 PUT /product_costs/1.json | [
{
"docid": "8e4b3befe95e6ff8ee39c349bd1c3835",
"score": "0.7357003",
"text": "def update\n @product_cost = ProductCost.find(params[:id])\n\n respond_to do |format|\n if @product_cost.update_attributes(params[:spree_product_cost])\n format.json { head :ok }\n e... | [
{
"docid": "5f65adc41a73ed6cb3c7a4db0dee4f75",
"score": "0.66342247",
"text": "def update\n @cost = Cost.find(params[:id])\n\n respond_to do |format|\n if @cost.update_attributes(params[:cost])\n format.html { redirect_to @cost, notice: 'Cost was successfully updated.' }\n forma... |
4b003d115e5f6aed8034475a7cc14f89 | p stock_buy([10, 7, 5, 8, 11, 9]) You have a list of integers, and for each index you want to find the product of every integer except the integer at that index. Write a function get_products_of_all_ints_except_at_index() that takes a list of integers and returns a list of the products. For example, given: [1, 7, 3, 4]... | [
{
"docid": "fefe9065c2a29d738943a0c383bfd152",
"score": "0.69496894",
"text": "def get_products_of_all_ints_except_at_index(a)\n prod = 1\n a.each { |n| prod *= n if n != 0 }\n a.map { |n| n == 0 ? prod : prod / n }\nend",
"title": ""
}
] | [
{
"docid": "c9154a2b8aa0acd85094951162a9cd97",
"score": "0.81137574",
"text": "def get_products_of_all_ints_except_at_index3(list)\n products = Array.new(list.count)\n max_index = list.count-1\n\n # Get product of numbers before index\n current_product = 1\n (0..max_index).each do |index|... |
628afe3bdb11d43941df34a7b6ddd746 | PUT /mouse_racks/1 PUT /mouse_racks/1.json | [
{
"docid": "7c7461528bdd1cd453c70ae5cb3e0faa",
"score": "0.787827",
"text": "def update\n @mouse_rack = @mouse_racks.find(params[:id])\n respond_to do |format|\n if @mouse_rack.update_attributes(params[:mouse_rack])\n format.json { render json: @mouse_rack }\n else\n forma... | [
{
"docid": "02e5b877165942ace13da110f8d15202",
"score": "0.6219037",
"text": "def show\n @mouse_rack = @mouse_racks.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @mouse_rack }\n end\n end",
"title": ""
},
{
"docid": "763225aec880ab8250215498fa2e3d74... |
bdb56477805cd13b999ea3d2af972a63 | From angles.rb: solar right ascension | [
{
"docid": "86ee8c6440e08a4d207559343a268f45",
"score": "0.0",
"text": "def ra_Sun() \r\n y0 = sin( al(@ma, @ta, Celes.faom03(@ta)) ) * cos( Celes.nut06a(@ajd, 0)[ 1 ] + \r\n Celes.obl06(@ajd, 0) )\r\n Celes.anp( PI + atan2( -y0, -cos( al(@ma, @ta, Celes.faom03(@ta)) ) ) ) \r\n end",
... | [
{
"docid": "2b875166a67d6189b11d6dd07cb3d9e4",
"score": "0.68480235",
"text": "def right\r\n @angle += ROTATION_ANGLE\r\n end",
"title": ""
},
{
"docid": "10b3b692c7fa067b42570c846bf3a8e9",
"score": "0.67405874",
"text": "def angle_rads \n\t\t\t2.0 * Math.atan2( self.vec.ma... |
218382c96f0a183ce87e201c7aaa0401 | Return the database associated with this collection. | [
{
"docid": "0fcb9392358f6eb7d6efa7baa6900a20",
"score": "0.8500175",
"text": "def db\n collection.db\n end",
"title": ""
}
] | [
{
"docid": "f8357affe6b61a7007a1d713a3e82b15",
"score": "0.79871553",
"text": "def database\n @database || self.class.database\n end",
"title": ""
},
{
"docid": "2ee1317f98330f6c014d075ce68dee49",
"score": "0.79138434",
"text": "def database\n self.class.database\n ... |
eb575392b77d558d5cd6d5644ff06c48 | SYNCING INSTANCE METHODS, OVERRIDE THESE AS NECESSARY | [
{
"docid": "c65e6d4f8a481421b5f890fba6d0d6aa",
"score": "0.0",
"text": "def remote_sync_if_necessary(options={})\n false\n end",
"title": ""
}
] | [
{
"docid": "5f425ad03adb4e70f41f8b6437800177",
"score": "0.7136891",
"text": "def sync; end",
"title": ""
},
{
"docid": "e966882dbec4522c6f1c3f074547e82c",
"score": "0.71029407",
"text": "def sync() end",
"title": ""
},
{
"docid": "e966882dbec4522c6f1c3f074547e82c",
"... |
1088ea54bac4c1440b4d5e0f7014e910 | Alters the number of rows and/or columns. ==== Parameter(s) +rows+ number of rows; +columns+ number of columns; | [
{
"docid": "4df0335f545ed71318a724b53ee9a0cc",
"score": "0.7233284",
"text": "def resize(rows, columns)\n raise ArgumentError, \"number of rows must be greater than or equal to zero\" if rows < 0\n raise ArgumentError, \"number of columns must be greater than or equal to zero\" if columns < 0\... | [
{
"docid": "a98916f77d93b60fc30c5bd5d1d0bedb",
"score": "0.7490427",
"text": "def rows=(rows)\n resize_field rows, @columns\n end",
"title": ""
},
{
"docid": "460bc44767d0dd31465a646fd23d13b6",
"score": "0.72265214",
"text": "def update!(**args)\n @cols = args[... |
1cb908970b4af66a3b7db5743ac12de7 | Returns true if the two models have equivalent steps and false otherwise. | [
{
"docid": "10136b0bb33ce091597ddcd15068c30e",
"score": "0.7280424",
"text": "def ==(other)\n return false unless other.respond_to?(:steps)\n\n steps == other.steps\n end",
"title": ""
}
] | [
{
"docid": "83425621993dc7fab74dada1c7c8206f",
"score": "0.6892695",
"text": "def is_equal?(step_nr)\n return step_nr == self.step\n end",
"title": ""
},
{
"docid": "ee538926ced35d831bf32bd309a5d28e",
"score": "0.638238",
"text": "def is_tied_with?(other)\n #vm: (self.pts ... |
bcf313efd08ab4a28f0ea421a074352c | DELETE /passions/1 DELETE /passions/1.json | [
{
"docid": "fd05aef5d8ad63cde39ce93c967722f2",
"score": "0.7451597",
"text": "def destroy\n @passion = Passion.find(params[:id])\n @passion.destroy\n\n respond_to do |format|\n format.html { redirect_to passions_url }\n format.json { head :ok }\n end\n end",
"title": ""
}
] | [
{
"docid": "b3d40e2bf9c059fe2cb1078180f895ee",
"score": "0.7274911",
"text": "def destroy\n @pass.destroy\n respond_to do |format|\n format.html { redirect_to passes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "40014e5ef76989bfce473a25... |
09ff78a5fa8001aa2bc82d81002c1093 | Create a node with the given path. The node data will be the given data, and node acl will be the given acl. The path is returned. The ephemeral argument specifies whether the created node will be ephemeral or not. An ephemeral node will be removed by the ZooKeeper automatically when the session associated with the cre... | [
{
"docid": "bc35820227ad8ee86540ba4bf83f3bfa",
"score": "0.6525626",
"text": "def create(args)\n path = args[:path]\n data = args[:data]\n acl = args[:acl] || ZooKeeper::ACL::OPEN_ACL_UNSAFE\n flags = 0\n flags |= ZooDefs::CreateFlags::EPHEMERAL if args[:ephemeral]\n ... | [
{
"docid": "a6311cfe3262924944dc1fcd96668839",
"score": "0.65457755",
"text": "def create(path)\n # recurse if the parent node does not exist\n create File.dirname(path) unless @zk.exists? File.dirname(path)\n @zk.create(path, ignore: :node_exists)\n end",
"title": ""
},
{
... |
9356bbb094e2be6406618bcbeaccfaf0 | it should return a value when hit when object.hit is invoked | [
{
"docid": "f8a3258d09fb4d4edaa38c93888a5d24",
"score": "0.0",
"text": "def test_hit_reduces_the_health_of_the_ship\n assert_equal @ship.health, @ship.length\n @ship.hit\n assert_equal @ship.health, @ship.length - 1\n @ship.hit\n assert_equal @ship.health, @ship.length - 2\n @ship.hit\... | [
{
"docid": "a5ec6b4354f92076459995192bc8ab05",
"score": "0.81153953",
"text": "def hit\n @hit\n end",
"title": ""
},
{
"docid": "cbf98a2fdadd8c472e4d86ac09ba0b47",
"score": "0.778353",
"text": "def hit; end",
"title": ""
},
{
"docid": "343ed82f74dcf9711856ea1f77... |
7b5e18fc494cd227b3fa07111c9e8e59 | Internal: Generates a String key for a given request object. The request object is folded into a sorted Array (since we can't count on hashes order on Ruby 1.8), encoded as JSON and digested as a `SHA1` string. Returns the encoded String. | [
{
"docid": "7f665abb6bb51cc83420ffbc656626f0",
"score": "0.7294946",
"text": "def cache_key_for(request)\n cache_keys = request.each_with_object([]) do |(key, value), parts|\n parts << [key.to_s, value]\n end\n\n Digest::SHA1.hexdigest(@serializer.dump(cache_keys.sort))\n ... | [
{
"docid": "38c2b54d2c90dc20262a0fe54bb8cb74",
"score": "0.64900875",
"text": "def generate\n data = flatten(stringify_keys(@params)).join\n digest = OpenSSL::Digest::Digest.new(\"sha1\")\n Base64.encode64(OpenSSL::HMAC.digest(digest, @auth_token, \"#{@url}#{data}\")).strip\n end",
"title"... |
09050955a6c25f02f8af18385acb98d4 | Confirms that artwork is for sale | [
{
"docid": "9c4c014dec8ac4052af88f4fc23b8ac0",
"score": "0.7981274",
"text": "def artwork_for_sale\n @artwork = Artwork.find(params[:artwork_id])\n return unless @artwork.status != 'For Sale'\n\n redirect_to root_url\n flash[:warning] = \"Artwork is not for sale. We can't submit your order.\... | [
{
"docid": "654a3635ccf5e6407f61cdec6770dae1",
"score": "0.66925365",
"text": "def for_sale?\n status == 'for_sale'\n end",
"title": ""
},
{
"docid": "69f1fb3dd583a0173015aa6a26fa96b1",
"score": "0.6626889",
"text": "def is_on_sale\n if self.promotion_rules.map(&:promotion... |
2e41bb6735331d8a2541e952f2e63c7b | This is called when the delete button is hit, and removes a composer from the list | [
{
"docid": "0d8c506cc4146b20006a526eed0351bf",
"score": "0.686716",
"text": "def delete_composer\n logger.debug \"**** DELETE COMPOSER ****\"\n @composer = Role.find(params[:id])\n if params[:work_id]\n @composers = session[(\"composers_\" + params[:work_id]).to_sym]\n else\n @comp... | [
{
"docid": "57ff587210c8ab382319a5bc2a2436fa",
"score": "0.68512934",
"text": "def destroy\n @composer = Composer.find(params[:id])\n @composer.destroy\n\n respond_to do |format|\n format.html { redirect_to composers_url }\n format.json { head :no_content }\n end\n end",
"titl... |
e2c4f37f39fe94f7904b5dbb7e3e9153 | Returns the list of objects browsable through all pages with the current filters. Should only be called after the +grid+ helper. | [
{
"docid": "ddc3a19526fe129a5a707e0f5e7b899d",
"score": "0.61890036",
"text": "def all_pages_records\n raise WiceGridException.new('all_pages_records can only be called only after the grid view helper') unless self.view_helper_finished\n resultset_without_paging_with_user_filters\n end",
... | [
{
"docid": "1582d7ea23d166dbb23da73768c0e0c5",
"score": "0.6426723",
"text": "def all_current_filters\n res = []\n\n # need to eager load customers and milestones, so using custom finder here \n proj_permissions = current_user.project_permissions.all(:include => { :project => [ :customer, :mile... |
f415850c0351cef1c729577758673549 | This method adds a HeapNode instance to the heap Time Complexity: O(logn) Space Complexity: O(1) if you're adding one new node | [
{
"docid": "d83ab3b95657992206cce637161c2b78",
"score": "0.7600958",
"text": "def add(key, value = key)\n new_node = HeapNode.new(key, value)\n @store << new_node\n\n heap_up(@store.length - 1)\n return\n end",
"title": ""
}
] | [
{
"docid": "e2f68e1f6a42c9887091da64c3d67ea6",
"score": "0.77560693",
"text": "def add(key, value = key)\n # add new node to end\n @store << HeapNode.new(key, value)\n\n # heap-up from added node to reestablish the heap property\n heap_up(@store.length - 1) if @store.length > 1\n end",
... |
f0ef998d9c9f680aff5c6d37098298bc | Confirms a loggedin user. | [
{
"docid": "ca2afd935535d3d63c912463a50488aa",
"score": "0.0",
"text": "def logged_in_user\n unless logged_in?\n flash[:danger] = \"Please log in.\" #\n redirect_to login_url\n end\n end",
"title": ""
}
] | [
{
"docid": "60995922afe92bcb4b96a5737d729af5",
"score": "0.70087826",
"text": "def correct_user\n @user = User.find(params[:id])\n if !current_user?(@user)\n message = \"currently logged in as #{current_user.name}. Not you? \"\n message += \"#{view_context.link_to('Log out.', log... |
575bec0fa25b4e45d2a50d9ebba1549e | [30, 60, 78, 98, 150] [29, 55, 68, 80, 100] | [
{
"docid": "cc24f094eb6d9695b83acc54cfbba5c4",
"score": "0.0",
"text": "def median(user_ordinate)\n\t len = user_ordinate.length\n\t return (user_ordinate[(len - 1) / 2] + user_ordinate[len / 2]) / 2\n\tend",
"title": ""
}
] | [
{
"docid": "245cb5d90df13e3c529aab5d3c4c8d21",
"score": "0.6031285",
"text": "def get_squares(arr)\n\tnew_arr = []\n\tarr.each { |index| new_arr << index if arr.include?(index * index) }\n\tnew_arr.sort\nend",
"title": ""
},
{
"docid": "4984d3f11078df89f03de4dae60018b2",
"score": "0.6021... |
1c63a99f8ade8b67adf02b75d3dc3a9f | Check for previous execution (looks for outputs folder/s existence) | [
{
"docid": "3b406111e73192ec0ec2a6143bdf2afa",
"score": "0.709408",
"text": "def check_previous_execution(output_folders,force_execution)\n\t# test each folder existence\n\toutput_folders.each do |folder|\n\t\tif Dir.exist?(folder)\n\t\t\tmsg = \"Output folder #{folder} already exists. \"\n\t\t\tif forc... | [
{
"docid": "a3a9abebafb32efc19cf6ccf30816d9c",
"score": "0.6279552",
"text": "def setup_output\n raise \"Please blow away output from previous run of this tool at: #{output_path}\" if Dir.exist?(output_path)\n shell_command(\"mkdir #{output_path}\")\n shell_command(\"mkdir #{temp_path}\")... |
2b45565080b1b8e5e788fc916cc7e57f | Accepts JS file Returns gzipped JS file | [
{
"docid": "8e793f21ca8c3e782a334f21b252a260",
"score": "0.6522645",
"text": "def gzip(file)\n Zlib::Deflate.deflate(file)\n end",
"title": ""
}
] | [
{
"docid": "f416512a7e2682c4825d2ab5f01a6797",
"score": "0.71261996",
"text": "def js_compressor; end",
"title": ""
},
{
"docid": "f416512a7e2682c4825d2ab5f01a6797",
"score": "0.71261996",
"text": "def js_compressor; end",
"title": ""
},
{
"docid": "6a2d1702e5e5466a0176c9... |
04739b7016b488732cc1b9774d253cf0 | get search results from the solr index | [
{
"docid": "5c47aecdef79f3cb277d1c51ca5b4246",
"score": "0.0",
"text": "def flags\n @flags ||= Array.wrap(Flag.where(:published => true))\n end",
"title": ""
}
] | [
{
"docid": "564467193cc71115ee7e2e2309c78466",
"score": "0.8101511",
"text": "def results\n @solr_data[:docs]\n end",
"title": ""
},
{
"docid": "dd1cdf0da8f39fce189a06ffbeedf4bc",
"score": "0.80029374",
"text": "def results\n @solr_data[:docs]\n end",
"title":... |
45805f3957dc8efc4f8485e1281cfa32 | Display the Blog Posts tab of the Admin page. | [
{
"docid": "85f645fac0348610560cf0f63322955e",
"score": "0.0",
"text": "def blog_posts\n @page = 'blog_posts'\n respond_to do |format|\n format.html {\n @blog_posts = BlogPost.find(:all)\n }\n format.json { \n blog_posts = BlogPost.find(:all) do\n if contains_... | [
{
"docid": "45113a524be2dfd8309b877f52773a32",
"score": "0.74352455",
"text": "def index\n @admin_blogs = Blog.all\n @page_title = \"Blog Posts\"\n end",
"title": ""
},
{
"docid": "ff62d6a8438a800804ed6bf50d41687f",
"score": "0.73288673",
"text": "def admin_index\n return... |
eecda3435a78faaab38e2fab3046f676 | =begin def good_practices game_hash.each do |location, team_data| are you ABSOLUTELY SURE what 'location' and 'team data' are? use binding.pry to find out! binding.pry team_data.each do |attribute, data| are you ABSOLUTELY SURE what 'attribute' and 'team data' are? use binding.pry to find out! binding.pry what is 'data... | [
{
"docid": "9c6e4473ad64db689234b4236792856b",
"score": "0.5885203",
"text": "def num_points_scored(player_name)\n total_scored = 0\n\n game_hash.each do |location, team_data| #home, away\n# binding.pry\n team_data.each do |attribute, data| #team_name, colors, players\n# binding.pry\n ... | [
{
"docid": "1f6be10cdfeab3d531e34eeb0d823fb7",
"score": "0.8797951",
"text": "def good_practices\n game_hash.each do |location, team_data|\n #are you ABSOLUTELY SURE what 'location' and 'team data' are? use binding.pry to find out!\n #binding.pry\n team_data.each do |attribute, data|\n ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "416a611d5ca07fb6a4d558550c826848",
"score": "0.0",
"text": "def set_user\n @user = ::User.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... |
cf25cf4b40737a9654ec807f453e7f05 | human readable description of modeling approach | [
{
"docid": "f3668ce1a922f36219e3f2058731a19c",
"score": "0.0",
"text": "def modeler_description\n return 'Adds either: (1) hot water boiler and electric chiller with variable-speed pumps to two plant loops, along with coil heating/cooling water objects on zone hvac four pipe fan coil objects, or (2) ... | [
{
"docid": "400f38055c710e3f9ca3606b0d0e6dcf",
"score": "0.7710149",
"text": "def modeler_description\n return 'Gather orientation and story specific construction, fenestration (including overhang) specific information'\n end",
"title": ""
},
{
"docid": "7f312e0afd1fe5a95907a214078a6c88"... |
46aa8fbb5e9b767d9048f2949ed75a37 | Show an upgrade alert to the user | [
{
"docid": "d70baa36c9626d06eaea1befdbd6a936",
"score": "0.0",
"text": "def alert(title, text, more_info_url, culprits)\n if Config::CONFIG['host_os'].downcase =~ /mswin|windows|mingw/\n basic_alert(title, text, more_info_url, culprits)\n else\n color_alert(title, text, m... | [
{
"docid": "3ca1495da7e69032a3d642c7fd72f1b3",
"score": "0.6473436",
"text": "def user_upgrades_enabled?\n true\n end",
"title": ""
},
{
"docid": "af89cf732fa42ae305c2ff8243aa84b1",
"score": "0.63914096",
"text": "def upgrade\n\t\t# todo: add if statement to confirmed if tran... |
f1cb2e8a1b905dbb1ada91411270bf2c | FalseFailure Passed if object is +false+. | [
{
"docid": "caefaef6fcf03ec0c2369afc831b6b56",
"score": "0.6230202",
"text": "def assert_false(exp, msg=nil)\n FalseFailure.assert(exp, :message=>msg, :backtrace=>caller)\n end",
"title": ""
}
] | [
{
"docid": "a5d5c133b8135a661d7d14381f5906e6",
"score": "0.71424407",
"text": "def wont_be_false(msg=nil)\n FalseAssay.refute!(self, :message=>msg, :backtrace=>caller)\n end",
"title": ""
},
{
"docid": "24d71b0e4670177063e74de40cfffc1e",
"score": "0.71210194",
"text": "def fa... |
66c29d722d454962dc3b396d8b58be05 | Need Skills For New Profile | [
{
"docid": "87c65d6c498dff21a6cbad47f55f4e3f",
"score": "0.57037777",
"text": "def create_row_need_skill\n @need_skill = NeedSkill.new\n\n @need_skill.user_id = current_user.id\n @need_skill.skill_id = params[:full_skill_name]\n @need_skill.skill_category = Skill.find_by(id: params[:full_ski... | [
{
"docid": "5e4f915d74a053e2036d5c0c31074aee",
"score": "0.6431104",
"text": "def own\n @profile = current_user.profile\n @interests = current_user.interests\n @teams = current_user.teams\n if @profile.not_modified?\n flash[:alert] = \"You have yet to create your profile. Please create ... |
a6527a2ee7f77ed7a93a4b65ae76ef25 | Obtain an InputSet object, used to define inputs for an execution of this Choreo. | [
{
"docid": "d42e01ecbf24af0c33420900f25307da",
"score": "0.6115859",
"text": "def new_input_set()\n return GetBodyFatGoalInputSet.new()\n end",
"title": ""
}
] | [
{
"docid": "d8eb34cfc5a1e737977f7023d4849c46",
"score": "0.6740161",
"text": "def new_input_set()\n return CreateObjectInputSet.new()\n end",
"title": ""
},
{
"docid": "7c0d7c433cd4eb8e36bdc3a383e9ec33",
"score": "0.65792465",
"text": "def new_input_set()\n return Ru... |
a65db594b18702741e149ed9c3ff9017 | GET /offerings/1 GET /offerings/1.js GET /offerings/1.json | [
{
"docid": "b06629756eff5a86ec04285f41915e02",
"score": "0.73440015",
"text": "def show\n ## Creating the offering object\n @offering = Offering.find(params[:id])\n\n respond_to do |format|\n format.html { get_collections and render :index }\n format.json { render json: @offering }\n ... | [
{
"docid": "bc53898e169e5f1d2b8460a2f2813d6e",
"score": "0.75844663",
"text": "def index\n\n get_collections\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @offerings }\n format.js {}\n end\n end",
"title": ""
},
{
"docid": "1e... |
597edfa8947031d3c07a7d68df76f913 | Author: Matt Noblett Purpose: This is used to help determine what style of game is being played by the user. Input: checkUserInput What style of game is to be played. It is either a 0 or 1 Output: N/A | [
{
"docid": "d5d943f0d6b5c9e95b1fb2eabca648e8",
"score": "0.62276167",
"text": "def hMode(checkUserInput)\n @checkUserInput = checkUserInput\n if(@checkUserInput == 0)\n play()\n else\n while(@done == 0)\n play()\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "563b90bf956ee27d23a8e4ce473f3f59",
"score": "0.69090015",
"text": "def check_who_win(user_input, computer_input)\r\n if user_input == computer_input\r\n \"Haha! It is a draw! #{user_player.name}, you can try again!\"\r\n elsif user_input == 'R'\r\n if computer_input == 'S'\r\... |
3e7663214cea014d7a92569056d65087 | Render without authorization, for better performance | [
{
"docid": "ceeac6a9e3265af54f3d070785b10b2b",
"score": "0.7222407",
"text": "def render_without_authorization(*actions)\n self.actions_without_authorization = [*actions]\n\n class_eval do\n #\n # It needs to be created afterward,\n # No idea why\n #\n ... | [
{
"docid": "559bb9c63cea8af4b518f5bbebd3aaaa",
"score": "0.8016162",
"text": "def render(*args)\n if render_without_authorization?\n Strongbolt.without_authorization { _render(*args) }\n else\n _render(*args)\n end\n end",
"title": ""
},
{
"docid":... |
946442aa7fc446411e2d2a27b8fb29bc | Sends only the name, id and ingreident ids of recipes, a simpiler view. | [
{
"docid": "777fa8b6a7ed7f901cc493ae420dd57a",
"score": "0.0",
"text": "def array\n @recipes = Recipe.all\n render \"simple_index.json.jb\"\n end",
"title": ""
}
] | [
{
"docid": "a5d7b9079eb5fabd77e105767542959a",
"score": "0.61020595",
"text": "def show\n # @prods = Product.find_by_sql(:conditions => [\"WHERE id in (\n#SELECT prods_id \n#FROM recipe_prods \n#WHERE recipes_id=49\n#)\"])\n $current_recipe = @recipe.id\n @prods_id = RecipeProd.where(\"recipes_id... |
d7d142a1b6a310827d70f82c008aa950 | The base dataset used for the association, before any order/conditions options have been applied. | [
{
"docid": "194ef6953c27e7732669c59d3d0bfe93",
"score": "0.6425118",
"text": "def _associated_dataset\n associated_class.dataset.clone\n end",
"title": ""
}
] | [
{
"docid": "826e49e031e77972931c85105ca91229",
"score": "0.67317384",
"text": "def schema_utility_dataset\n @default_dataset\n end",
"title": ""
},
{
"docid": "072e92253cdc169924f4ca6a1cb6b17b",
"score": "0.6610137",
"text": "def dataset\n @dataset ||= data_maker.dataset\n... |
10a1fc855a12cfdb265488b017f649e5 | converts a split ratio of the form 3:2 (i.e. numerator:denominator) into a decimal of the form 1.5 (i.e. numerator/denominator) | [
{
"docid": "7367ba778c30e69a29ca0b405ef1e002",
"score": "0.8002097",
"text": "def reformat_split_ratio(split_ratio)\n numerator, denominator = *(split_ratio.split(\":\").map(&:strip))\n numerator.to_f / denominator.to_f\n end",
"title": ""
}
] | [
{
"docid": "d26482ad8e7a41eccad3394f5be5b727",
"score": "0.6719033",
"text": "def format_ratio(n)\n \"%2.2f\\%\" % (n * 100).to_s\n end",
"title": ""
},
{
"docid": "1ccaf0844bc1650205310096a9f4da37",
"score": "0.6605158",
"text": "def ratio\n # This call is interesting because... |
e5eee2778a0cc73f1a4a3ee22eac879f | The status of the virtual server instance. Possible values: [failed,paused,pausing,pending,restarting,resuming,running,starting,stopped,stopping] | [
{
"docid": "9b968c1aa80c54b87cffc5425405ce22",
"score": "0.0",
"text": "def status\n @data[:status].downcase\n end",
"title": ""
}
] | [
{
"docid": "2c52b4eacc6a8a673787636e80d7a70a",
"score": "0.75410056",
"text": "def status\n @status || :stopped\n end",
"title": ""
},
{
"docid": "a5f55b328eafc2ebfaa6ab64d5206e95",
"score": "0.74824846",
"text": "def status\n if stopped?\n 'Stopped'\n elsif ... |
c56e3ca93bb5109de9ec1c9273996bf9 | ssws: slash or sorws | [
{
"docid": "c1430fb4129dc060f8e3c14f68b63dc4",
"score": "0.0",
"text": "def mos_elt(i); alt(:elt, i, :slash, :sorws_mos); end",
"title": ""
}
] | [
{
"docid": "c4f0d422c44d40760568229ca88db1bb",
"score": "0.6548324",
"text": "def slashes \n\t\tself.envelop('/' , '/')\n\tend",
"title": ""
},
{
"docid": "76550e3a68f44786d3ee616cd29fa45f",
"score": "0.60521996",
"text": "def escape_path(s); end",
"title": ""
},
{
"docid... |
58ace47a4164740afd4728e12cdb9aeb | Upload a zip file or designate a zip file on the server to import samples into RATE's database. In the zip file, every dir stands for a class, every images in that dir is a sample of that class. === Parameters [has_file String] true: the client is going to upload the zip file. false: The zip file is on the server, then... | [
{
"docid": "fbf995c74b923063634b67b9afa37fd5",
"score": "0.4643795",
"text": "def import(options = {})\n need_arg! options, :import_tag\n if not options[:has_file]\n need_arg! options, :zip_path\n else\n need_arg! options, :path\n file_exist! options[:path]\n end\n\n cmd = ... | [
{
"docid": "96104a436966bd2cd68fc9ec5ddb2aab",
"score": "0.5728953",
"text": "def uploaded_file\n unless self.batch == true\n if self.file != \"\"\n self.file_name_all = sanitize_fn(file.original_filename)\n self.file_name_base = file_name_all.split('.')[0]\n self.extension = file_n... |
79b8fa8f5fffd267a685596138e5d193 | Converts self into OrderedHash, so simply returns self. | [
{
"docid": "49b746a2593d6a3b5ee202a415fe1574",
"score": "0.748532",
"text": "def to_ordered_hash\n self\n end",
"title": ""
}
] | [
{
"docid": "f18ebc043773cae8ff300205d1656bcd",
"score": "0.81195265",
"text": "def to_ordered_hash\n OrderedHash.new(self)\n end",
"title": ""
},
{
"docid": "bd56331c5e151f10079d400ee3327f8d",
"score": "0.67572546",
"text": "def hash\n to_h.hash ^ self.class.hash\n end",
... |
ecb32aa423b62b8dc97da744ba73440f | allow retrieval of borrowers by category. | [
{
"docid": "f3c2c8e819b87f1992599e2c066d6823",
"score": "0.53981656",
"text": "def byCategory\n @borrower = Borrower.find(:all, :conditions => [ \"category = ?\" , params[:category]])\n @borrower.each{|b|\n b[:current_amount] = 0;\n @tran = Transaction.find(:all, :conditions => [\"borrow... | [
{
"docid": "58df5b1221781b09d422fbd20cfd69a2",
"score": "0.6130112",
"text": "def get_borrower(book_id)\n #Runs through all books in the library and finds the one\n #that matches the id, then looks at the borrower\n #Currently no error protection if the book isn't borrowed\n @books.each do |... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "69de6be62677f59c49b1af066a7431b2",
"score": "0.0",
"text": "def set_product_category\n @product_category = ProductCategory.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163821",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6045432",
"text": "def action_hook;... |
a7fb658e67d77568a2e58c3137c07d89 | Add support for retrieving images by their size, e.g. 32x32, 16x16, etc. | [
{
"docid": "e02d7633ae83120a354cd1798af23b1a",
"score": "0.67813855",
"text": "def method_missing(sym, *args, &block)\n if sym.to_s =~ /^(\\d+)x(\\d+)$/\n image_by_size $1, $2\n else\n super\n end\n end",
"title": ""
}
] | [
{
"docid": "cd330413619a0a144987c6cf7eecfbf1",
"score": "0.7604971",
"text": "def images (size_requested = 'all')\n returned_images = []\n images = @record.fetch('ImageInfo', {})\n if images.count > 0\n images.each do |image|\n if size_requested == image['Size'] ... |
e1b28adf8cbc3b6c80278e26b0e3a29c | Set the value of the CommentID input for this Choreo. | [
{
"docid": "87b8c816c6abdb35a4befe5dbd3bcc89",
"score": "0.6798055",
"text": "def set_CommentID(value)\n set_input(\"CommentID\", value)\n end",
"title": ""
}
] | [
{
"docid": "39302f33ba100cb164d47f3670e3283a",
"score": "0.6939344",
"text": "def set_CommentId(value)\n set_input(\"CommentId\", value)\n end",
"title": ""
},
{
"docid": "df790bd820e5ad4d91530dd73ad5839a",
"score": "0.6828429",
"text": "def set_comment\n @comm... |
986b729235f753e8b84710f9f2c30574 | options :cache => Cache Object :module_paths => Array[String] (Deprecated) :spec_searcher_configuration => PuppetfileResolver::SpecSearchers::Configuration | [
{
"docid": "1f6102099fdc4a44a5753fc42487d716",
"score": "0.0",
"text": "def resolve(options = {})\n if options[:ui]\n raise 'The UI object must be of type Molinillo::UI' unless options[:ui].is_a?(Molinillo::UI)\n ui = options[:ui]\n else\n require 'puppetfile-resolver/ui/n... | [
{
"docid": "1e1116261935d4e08babbcc1da2178e4",
"score": "0.56260365",
"text": "def initialize(puppetfile_document, puppet_version, resolver_ui, options = {})\n require 'semantic_puppet'\n\n @puppetfile_document = puppetfile_document\n raise 'The UI object must be of type Molinillo::UI' if... |
fa5120199ad149ac08a1a8bb17bd7ab7 | Returns a score with a logarithmic approach | [
{
"docid": "1d4bcc09c172f779867683f83a9df113",
"score": "0.0",
"text": "def soften(value, comparison)\n # returns a shaped curve\n sigmoid = ->(x) { 1 / (1 + Math.exp(-x * 10)) }\n # simoid boundaries are [0.5, 1]\n # so remove 0.5 and multiply by 2 to have boundaries [0, 1]\n ... | [
{
"docid": "6d6f261cfd3c64c65fd387e2614fccd3",
"score": "0.72443897",
"text": "def logistic\n mult = @multiplier / 232.0 + 3.57\n num = @num / 100.0\n @num = (mult * num * (1.0 - num)) * 100\n end",
"title": ""
},
{
"docid": "49754763b7b0f076d27f8aee24e8ee7e",
"score": "0.70948... |
2b914ebf47e2aafc17c3a81c400aa5a3 | Return an array of all UID values in Active Directory. | [
{
"docid": "fb71cd3c90d96f8149a1f7da68bc1d31",
"score": "0.7462979",
"text": "def load_ldap_uids\n all_uids = []\n user_filter = Net::LDAP::Filter.eq(\"objectclass\", \"user\")\n\n @ldap.search(:base => @root, :filter => user_filter) do |entry|\n begin\n uid = entry.uidNum... | [
{
"docid": "15c4f9750f03eb8fb2f4b7c4aa54d113",
"score": "0.69917023",
"text": "def user_ids\n array = Array.new\n\n self.each(\"USERS/ID\") do |id|\n array << id.text.to_i\n end\n\n return array\n end",
"title": ""
},
{
"docid... |
4d065e6d82b95fef7238eb29772a3fba | a simple descriptor representing the kind of degree, such as Bachelor of Science, etc. | [
{
"docid": "3c36d7ef6743f2245b4f5fb888f9c28c",
"score": "0.0",
"text": "def type\n ::HubEdos::Common::Reference::Descriptor.new(@data['type']) if @data['type']\n end",
"title": ""
}
] | [
{
"docid": "1845ca44ebec0067788918fbc64a3dc6",
"score": "0.72825783",
"text": "def degree; end",
"title": ""
},
{
"docid": "5a8a03131bcf015a72f93ae79a5757ab",
"score": "0.66542405",
"text": "def convert_degree_type (degree_type_num)\n degree_type_num = \"#{degree_type_num}\"\n ... |
810170590878ee334315ac343c6ffeac | searches for start node but not for the goal node the robot does not know where the goal node is but we need to find out where to start at | [
{
"docid": "b8e2a673eda404d81e13f8c327c6b8e4",
"score": "0.0",
"text": "def parse_maze\n x = 0\n y = 0\n z = 0 # will be used as a node number\n @table_reversed.each do |row|\n row.each do |item|\n @start_node = z if item == \"S\"\n\n # create a simple array with all value... | [
{
"docid": "36e96e484d68e5f95f4afff99eae7460",
"score": "0.6442505",
"text": "def path_finder(start_node=START_NODE, goal_node=GOAL_NODE)\n\t\n\t# INITIALIZE\n\tvalid = valid_nodes # largest set\n\treachable = [start_node] # nodes we can reach from current node\n\texplored = [] # nodes we've already con... |
a6527a2ee7f77ed7a93a4b65ae76ef25 | Obtain an InputSet object, used to define inputs for an execution of this Choreo. | [
{
"docid": "dfcf2a7dd57523a919666f46a5f03e31",
"score": "0.0",
"text": "def new_input_set()\n return GetRecordsInputSet.new()\n end",
"title": ""
}
] | [
{
"docid": "64c57f88a4eac6079f885b7b88602378",
"score": "0.66497",
"text": "def execute(input_set = nil)\n # If the inputs are not configured, create a blank set.\n if input_set == nil\n input_set = InputSet.new()\n end\n param_map = {\"source_id\" => TembooSession.get_identifier()}\n ... |
149a74a9b243a9183eb17ee9ca193706 | Returns an array of the dates the email of a specified category was sent | [
{
"docid": "ce2ab3887f2f6c1676eb53359bc15e6c",
"score": "0.8071173",
"text": "def emails_sent_at(category)\r\n emails = self.email_logs.select {|e|e.category == category}\r\n emails.collect {|e| e.created_at}.sort\r\n end",
"title": ""
}
] | [
{
"docid": "372b84e33cae2b3de6ba271c686f2c5f",
"score": "0.8045334",
"text": "def email_sent_at(category)\r\n emails = self.email_logs.select {|e| e.category == category}\r\n emails.collect {|e| e.created_at}.sort.last\r\n end",
"title": ""
},
{
"docid": "b9e61a68569379fa5c4f662a90705... |
47cdbf612c4c7ed02a92f6e5984dc39a | accessor to cgi query parameters (http GET) | [
{
"docid": "564cfedb11d236e470e404ed71c6f2f4",
"score": "0.75857085",
"text": "def query_parameters\n $cuca.value[:request].GET\n# $app.cgi.query_parameters\n end",
"title": ""
}
] | [
{
"docid": "096647b9ee7d0955fb6312facb22e66d",
"score": "0.72907287",
"text": "def GET\n if @env[\"rack.request.query_string\"] == query_string\n @env[\"rack.request.query_hash\"]\n else\n @env[\"rack.request.query_string\"] = query_string\n @env[\"rack.request.query_hash\... |
9d2390335976570d59fc59f7ed66dbef | List branches Requires authenticated client for private repos. | [
{
"docid": "b86aef236e553fedfc2657dddcb7abdb",
"score": "0.69851553",
"text": "def branches(repo, options = {})\n paginate \"#{Repository.path repo}/branches\", options\n end",
"title": ""
}
] | [
{
"docid": "18ad2bbe60dc0c21e4d9458c5ed0a47a",
"score": "0.78196317",
"text": "def branches\n client.branches(repo)\n end",
"title": ""
},
{
"docid": "b4c9faa14cac937d47823346beba1ecb",
"score": "0.71130794",
"text": "def branches\n @branches ||= get(\"/repos/show/#{owne... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "afb7fb193211ca1f05f6f7b83df3eff1",
"score": "0.0",
"text": "def question_params\n params[:question].permit(:title, :description)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.requ... |
964fa44ebd44b057400a2426c9a9b1c7 | Commit a transaction, optionally creating, deleting or modifying some entities. | [
{
"docid": "3ea2323892ed10cb8bb959c18783c6c6",
"score": "0.64985085",
"text": "def commit mutations, transaction: nil\n commit_req = Google::Datastore::V1::CommitRequest.new(\n project_id: project,\n mode: :NON_TRANSACTIONAL,\n mutations: mutations\n )\... | [
{
"docid": "bc9e3b1f1b0f51cf45457c3339196008",
"score": "0.71257603",
"text": "def commit_transaction\n @transaction_manager.commit_transaction\n end",
"title": ""
},
{
"docid": "d991a27bc6b8a03e2bcb38707e43e655",
"score": "0.7123001",
"text": "def commit\n @transaction_... |
de9ae079a79b8b6eeed6361bd0f5f8c4 | EMAILS = Array.new File.open("emails.txt", "r") do |f| f.each_line do |line| $emails.push(line) end end Ensure valid credentials, either by restoring from the saved credentials files or intitiating an OAuth2 authorization. If authorization is required, the user's default browser will be launched to approve the request. | [
{
"docid": "ca511378d7977e4fd2a103d5d10ab93d",
"score": "0.0",
"text": "def authorize\n FileUtils.mkdir_p(File.dirname(CREDENTIALS_PATH))\n\n client_id = Google::Auth::ClientId.from_file(CLIENT_SECRETS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: CREDENTIALS_PATH)\n a... | [
{
"docid": "40ca0ba05da18fd069770d131e33202c",
"score": "0.6084621",
"text": "def _email\n if File.exists?(email_filename)\n email = File.readlines(email_filename).first.strip\n { :email => email }\n else\n puts \"================ WARNING ================\"\n puts \"Make sure you create #{... |
d22d5cfe83cb76080b4907b0f6c6f495 | finds or creates soucy record for pilot | [
{
"docid": "7207716d1c85508a86e4a613471e5475",
"score": "0.60275984",
"text": "def engage_soucy_for_pilot(pilot)\n soucy = SoucyResult.where(:pilot_id => pilot.id, :year => @year).first_or_create\n to_be_results = PcResult.joins(:c_result => :contest).where(\n \"pilot_id = ? and contests.region != ... | [
{
"docid": "b70710be486771b1ed942f00e5744c96",
"score": "0.58109325",
"text": "def create\n @ppi = Ppi.new(ppi_params)\n @document = Document.find(params[:document_id])\n dup = @document.ppis.where(\"(gene1 = ? and gene2 = ?) and (exp = ?) and (itype = ?)\",\n params[:ppi][:gene1], param... |
ed6b0d09e02f9ff43414806416cd4a19 | GET /sundry_debtors/new GET /sundry_debtors/new.xml | [
{
"docid": "19c924b699c1ce573dbf678818044fc6",
"score": "0.76258314",
"text": "def new\n @sundry_debtor = SundryDebtor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sundry_debtor }\n end\n end",
"title": ""
}
] | [
{
"docid": "e45e82ece40e4a7b0ac900c7f237d6d3",
"score": "0.6969663",
"text": "def create\n @sundry_debtor = SundryDebtor.new(params[:sundry_debtor])\n\n respond_to do |format|\n if @sundry_debtor.save\n flash[:notice] = 'SundryDebtor was successfully created.'\n format.html { re... |
e08a4e135f78352b2400285e1f4b4932 | Clears the prepared statements cache. | [
{
"docid": "8bfd068e926bbf36268e510be027602d",
"score": "0.80267036",
"text": "def clear_cache!\n @statements.clear\n end",
"title": ""
}
] | [
{
"docid": "183ddd24705bc59c13fea01e89300226",
"score": "0.8246629",
"text": "def clear_statement_caches\n pool.all_connections{|c| c.statement_cache.clear}\n end",
"title": ""
},
{
"docid": "ca7a317b10ec281db2ddf65c69cc9909",
"score": "0.7243486",
"text": "def clear_... |
967665ee5a3a1c6123b2107dd59e0b0e | GET /discounts_products/1 GET /discounts_products/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "d1514b994211351a6f33043cae2fe3b3",
"score": "0.7323721",
"text": "def index\n @discounts_products = DiscountsProduct.all\n end",
"title": ""
},
{
"docid": "db7b69e5d97cfa04e5b4b91de943e329",
"score": "0.6696047",
"text": "def set_discounts_product\n @discounts_pr... |
18da277f33376f6884383c032802d480 | Gets the IP ToS values in packets sent to peer. | [
{
"docid": "69161ff0814719e64f23d5d41c40d6a7",
"score": "0.58087516",
"text": "def ip_tos_to_peer\n super\n end",
"title": ""
}
] | [
{
"docid": "785f874fdb9a26443ee51957fc54921c",
"score": "0.6121373",
"text": "def ip_tos\n\t\tself[:ip_tos].to_i\n\tend",
"title": ""
},
{
"docid": "d7e1bb2b5a4cf1e402a3c2a5e63f104e",
"score": "0.6088668",
"text": "def sender_ip\n return @sender_ip\n end",
... |
bd989ce5eddd4c39b56be8de09767ee6 | Sets the value of the `profile_details` attribute. | [
{
"docid": "18f156d344f7cc2e7323d5def31c60a6",
"score": "0.70961845",
"text": "def profile_details=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = ProfileDetail.new(value)\n ... | [
{
"docid": "802bbd0d233181124a2c4d6a15d97d65",
"score": "0.68120795",
"text": "def set_profile\n @profile = @current_user.profile\n end",
"title": ""
},
{
"docid": "ad23e53d402025d7ff0e6ea7350f19ba",
"score": "0.6794303",
"text": "def set_profile\n @profile = current_use... |
1bf371e1fdfb1aca98e6e771e6e5ce46 | PUT /tarifs/1 PUT /tarifs/1.xml | [
{
"docid": "77b628dae04b4683ddd4e0f3adf7b2ff",
"score": "0.5646312",
"text": "def update\n @tarif = Tarif.find(params[:id])\n\n respond_to do |format|\n if @tarif.update_attributes(params[:tarif])\n flash[:notice] = 'Tarif was successfully updated.'\n format.html { redirect_to(@... | [
{
"docid": "545dadbe32aa3d9d0edf1d22293783fc",
"score": "0.6539082",
"text": "def test_put_existing\n request = Http::Request.new('PUT', '/file1', {}, 'bar')\n\n response = self.request(request)\n\n assert_equal(204, response.status)\n\n assert_equal(\n 'bar',\n ... |
71b94ada620aa445e617d6ebeafeff39 | Display the rendered output of the test and If the expected ouptput matches the rendered output, simply display that output If the expected ouptput does not match the rendered output, show the expect, then show the actual and give the user the option to overwrite expected with actual If no expected output is saved for ... | [
{
"docid": "f918d1a8a8f6764acccb2bb7f336c2a4",
"score": "0.75060964",
"text": "def view\n if pending?\n ask_pending\n elsif failed?\n ask_failed\n else\n puts rendered\n puts \"Rendered output for #{test_file} matches expected.\"\n end\n ... | [
{
"docid": "564e5651757a43a1d9989e513452d3c6",
"score": "0.76904833",
"text": "def display_results\r\n if @errors.empty?\r\n if @test_diff.empty?\r\n @out.puts \"Output matches exactly\"\r\n else\r\n @out.puts \"Test diff:\"\r\n @out.puts @test_diff\r\n end\r\n ... |
035fc0de15781acd1040515cde5a3dea | All of this specific instance of book, Looking for their genres | [
{
"docid": "6a7c24fc4aefde1f9cca389876848d2a",
"score": "0.82086223",
"text": "def genres\n Genre.all.select{|genre| genre.book == self }\n end",
"title": ""
}
] | [
{
"docid": "d3264b37f1178277fcbd9086e034a335",
"score": "0.7563995",
"text": "def genres\n to_array search_by_itemprop 'genre'\n end",
"title": ""
},
{
"docid": "d1ac84dadd0aec02c454a780d91948f7",
"score": "0.73882616",
"text": "def books\n Book.all.select do |book|\n ... |
5870a9c4d0cbd280ab7313b191ee0bf7 | =begin rdoc Instantiate a Packet object for an Image object with the given ident. =end | [
{
"docid": "f78f018fa2578b2cbf6e874f5d080881",
"score": "0.5647171",
"text": "def initialize(ident, img, img_offset=nil, sz=nil )\n sz ||= img.size\n modelitem_init\n target_init\n sectioned_target_init img, img_offset, sz\n end",
"title": ""
}
] | [
{
"docid": "9beea163d43a46fd62cba4f668c2f0c6",
"score": "0.7448141",
"text": "def add_packet_for_image(pkt_ident, img, img_off=0, sz=nil)\n p = Bgo::Packet.new( pkt_ident, img, img_off, sz )\n add_packet_object p\n end",
"title": ""
},
{
"docid": "f08df2b24c859f7a34179432d9a0323... |
7674d51b73c0af1c573f8717812014f1 | Add this route between these two cities/metros | [
{
"docid": "c9a5ff2d703e9a283b7cd5237879200c",
"score": "0.78935903",
"text": "def addRoute(city1, city2, distance)\n @routes[city1].push(EndpointCity.new(city2, distance))\n @routes[city2].push(EndpointCity.new(city1, distance))\n end",
"title": ""
}
] | [
{
"docid": "6b6f86941f7170bc0efe70bc28e3319f",
"score": "0.7499767",
"text": "def add_route(metro1, metro2, distance)\n if exist_nodes([metro1, metro2])\n self.add_edge(metro1, metro2, distance)\n @nodes[metro1]['flight_to'].push(metro2)\n end\n end",
"title": ""
},
{
"docid... |
7c656e7462e823e712a9546afcfb0753 | def [](num) optional but useful; return the bucket corresponding to `num` end | [
{
"docid": "ab7930a219a7b52ade3e9c932629f522",
"score": "0.0",
"text": "def num_buckets\n @store.length\n end",
"title": ""
}
] | [
{
"docid": "95c9d315c66cb5edfd635749d27198a9",
"score": "0.8140234",
"text": "def [](num) #<== maybe requires hash\n # num_hash = num.hash\n # @store[num_hash % num_buckets]\n @store[num % num_buckets]\n end",
"title": ""
},
{
"docid": "f090ac5ab2ff7356cefd781dc8e2955d",
"score... |
5595b1f89df833b71e503d9b5d57c18c | authenticate user from Authorization in header without exception | [
{
"docid": "94673e41df6d399740bf46220349e8e7",
"score": "0.0",
"text": "def authenticate_user_from_token\r\n result = find_user\r\n @current_user = result.current_user\r\n end",
"title": ""
}
] | [
{
"docid": "00a2aa46a4673155380c62d2ad887d06",
"score": "0.7825193",
"text": "def authenticate_user_from_token!\n auth_token = request.headers['Authorization']\n authenticate_error unless authenticate_with_auth_token auth_token\n end",
"title": ""
},
{
"docid": "dd07cfa99597e305b5a7b4... |
2b797fac089de0fb6770d4a75a89a8d4 | GET /indexed_files/new GET /indexed_files/new.json | [
{
"docid": "a25f4794ea4cd869cc9bd99ce913517b",
"score": "0.8342747",
"text": "def new\n @indexed_file = IndexedFile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @indexed_file }\n end\n end",
"title": ""
}
] | [
{
"docid": "aafe9e094924a3b236045c67f6801ad1",
"score": "0.7571444",
"text": "def create\n @indexed_file = IndexedFile.new(params[:indexed_file])\n\n respond_to do |format|\n if @indexed_file.save\n format.html { redirect_to @indexed_file, notice: 'Indexed file was successfully created... |
de7f3434f3eb9126612537d9818c3be1 | TODO: we may want to remove unsaved (those without user_id) items from the database when removed from history | [
{
"docid": "79bf2eed22538e1c46867af8f48ebe89",
"score": "0.0",
"text": "def clear\n if session[:history].clear\n flash[:notice] = I18n.t('blacklight.search_history.clear.success')\n else\n flash[:error] = I18n.t('blacklight.search_history.clear.failure')\n end\n\n redir... | [
{
"docid": "8d5b615f8d7b92b027bc9a8d34d3c456",
"score": "0.62304837",
"text": "def remove_item\n\tsaved = current_user.saved\n\titem = saved.items.find(params[:item])\n saved.items.delete(item)\n redirect_to :back\n\tend",
"title": ""
},
{
"docid": "82e2bc8f81fffbdf3dfa4fb8550f84b8",
... |
823b5a5679a88b213fea44b116f3a261 | Returns the complete contents of the generated RBI file as a string. | [
{
"docid": "0b2d970abd18331673389fe0098f07cb",
"score": "0.0",
"text": "def rbi(strictness = 'strong')\n \"# typed: #{strictness}\\n\" + root.generate_rbi(0, options).join(\"\\n\") + \"\\n\"\n end",
"title": ""
}
] | [
{
"docid": "f2a5ba0a1570781851fab521828cc7e3",
"score": "0.64429665",
"text": "def result_as_string\n File.open(result_file, 'rb') { |f| f.read }\n end",
"title": ""
},
{
"docid": "ed12407c2c82dcaf92936175634e3a12",
"score": "0.6309582",
"text": "def body\n ::File.binr... |
0c58e53d0c245396cdea8b38a55be6cb | GET /categories_courses GET /categories_courses.json | [
{
"docid": "6df81377e7d8b6e8abc85eda173ba6cc",
"score": "0.75490916",
"text": "def index\n @categories_courses = CategoriesCourse.all\n end",
"title": ""
}
] | [
{
"docid": "eafdf2bd6da95865e3c6ad1b99df52d5",
"score": "0.743281",
"text": "def show\n @category = Category.find(params[:id])\n @category_courses = @category.courses\n end",
"title": ""
},
{
"docid": "a06e022257db4847b8f7e683778a4152",
"score": "0.7318755",
"text": "def... |
9444792d56572dbbc3bfd4abab0d468b | GET /sites/1 GET /sites/1.json | [
{
"docid": "b64410622696ac4d7133716da959ad2d",
"score": "0.0",
"text": "def show\n @record = Site.find(params[:id])\n @record_admin ||= @record.site_admins.where( user_id: current_user ).first\n\n if current_user.is_admin? || @record_admin\n export_path = export_path_for_site( @record )\n ... | [
{
"docid": "85f624b9ca21e24fec1a59dafa0c20e1",
"score": "0.7546538",
"text": "def index\n @sites = Site.all\n render json: @sites\n end",
"title": ""
},
{
"docid": "1c578611b1fd3d62e827e901deee1799",
"score": "0.7469465",
"text": "def index\n @sites = Site.by_user(current_u... |
36a6f6cc1a700f29bff831e5fbcb6f31 | Autenticado como operador con grupo Analista de Casos | [
{
"docid": "41910a3737ef0c783c9e304ab4223472",
"score": "0.6270263",
"text": "def inicia_analista\n current_usuario = Usuario.create!(PRUEBA_USUARIO_AN)\n current_usuario.grupo_ids = [20]\n current_usuario.save\n return current_usuario\n end",
"title": ""
}
] | [
{
"docid": "547c2e5f5f6924f2c8198e503e52fc7a",
"score": "0.6435314",
"text": "def set_comosupo\n @basica = Sivel2Sjr::Comosupo.find(params[:id])\n end",
"title": ""
},
{
"docid": "695a6f8aaf52dd00f6d00153de66986e",
"score": "0.63263476",
"text": "def inicia_observador\n ... |
8242c9122a5759e4a61fa8b107414a52 | update Updates all editable attributes of the billing_group with the given id. | [
{
"docid": "5cdf4580326093f66d1f0ff280c3f339",
"score": "0.71274424",
"text": "def update(bg_id, billing_group_editable, opts = {})\n data, _status_code, _headers = billing_group_update_with_http_info(bg_id, billing_group_editable, opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "7cdff7b9e860ff627ac528398a9b7e56",
"score": "0.6874498",
"text": "def update_group(group_or_id, attributes)\n instantize_group(group_or_id).update(attributes)\n end",
"title": ""
},
{
"docid": "38e3e3c8466f5d44863a74f63cf7e546",
"score": "0.6728169",
"text": "def ... |
b6c54801cec8210748fba1b43ff6a3a1 | Convert to code from name of item. | [
{
"docid": "0a829d8a3e45fe5b128d6a09d053d9a6",
"score": "0.7042254",
"text": "def code_from_name!(name)\n from_name(name)[:code]\n end",
"title": ""
}
] | [
{
"docid": "fb9f5f74aa8b0810636ffa607045bdd0",
"score": "0.6610623",
"text": "def to_code\n \"#{@name}\"\n end",
"title": ""
},
{
"docid": "3b8a87c7c2fe0ad397a505795d6737e9",
"score": "0.6521164",
"text": "def get_code(name)\n return @codes[name]\n end",
... |