query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
61c89fe86fa279e1cc341a74a40b358d
Deserializes the data based on type
[ { "docid": "ab92b2eacf77a7ca886f186fb97e63b3", "score": "0.0", "text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i...
[ { "docid": "36a7ecd8f09e91284f3ff814815f745d", "score": "0.82312423", "text": "def deserialize(data, type = nil)\n serializer(type).deserialize(data)\n end", "title": "" }, { "docid": "36a7ecd8f09e91284f3ff814815f745d", "score": "0.82312423", "text": "def deserialize(data, type =...
b8eb5ce222d711a9a587b57598da3b8a
OL_CLIENT = Openlibrary::Client.new def ol_client return OL_CLIENT end
[ { "docid": "329e6437aa914d58a7dcc28cade87a7f", "score": "0.0", "text": "def rest_get(url)\n JSON.parse(RestClient.get(url))\n end", "title": "" } ]
[ { "docid": "83d50c30374e8cda1514b4aeba462e05", "score": "0.675889", "text": "def client\n @client ||= OpenIDConnect::Client.new(\n identifier: @client_id,\n secret: @secret,\n redirect_uri: @redirect_url,\n realm: 'esdl-mapeditor',\n audience: @audience,\n authorization_...
77ebc4e1c7faea76c39b8a53d17c35f3
Maps uppercase Firebird column names to lowercase for ActiveRecord; mixedcase columns retain their original case.
[ { "docid": "a6c7744b87c21133ab672ae4997d22fb", "score": "0.7506005", "text": "def fb_to_ar_case(column_name)\n column_name =~ /[[:lower:]]/ ? column_name : column_name.downcase\n end", "title": "" } ]
[ { "docid": "ba172ea1b3d49a5f54991e2f9771a5e8", "score": "0.7398719", "text": "def fb_to_ar_case(column_name)\n column_name =~ /[[:lower:]]/ ? column_name : column_name.to_s.downcase\n end", "title": "" }, { "docid": "98828133aa404602303051691ad87915", "score": "0.7202841", "t...
dad2f9642935e6781f7fe6e192ff9380
If objField = nill, response = list of fields. Else return the specific data of the defined tool in format JSON. config/toolsList.json
[ { "docid": "08f5803d380c6b0cddb05fc7dd5be502", "score": "0.8127125", "text": "def toolsResponse(toolInfo, objField)\n data = readJSONFile(settings.startConfig[\"dataTools\"])\n result = nil\n if toolInfo != nil\n if objField == nil\n data[\"tools\"].each do |element|\n if e...
[ { "docid": "e17dfa4e66238cd0374f0342058efa2d", "score": "0.6568912", "text": "def new_deuce_tools_and_results_list\n raw_json_info { [] }\n end", "title": "" }, { "docid": "92b9a1b8495538f3907207c93bde142a", "score": "0.6250763", "text": "def tools(toolInfo)\n data = readJSONF...
cabf09a887a81b705fd6d31fe3068ca1
Read a 'fabric.ConfigResult' resource.
[ { "docid": "a01c0e8e3b4c0e48d1d36c732201fd33", "score": "0.55924666", "text": "def get_fabric_config_result_list(opts = {})\n data, _status_code, _headers = get_fabric_config_result_list_with_http_info(opts)\n data\n end", "title": "" } ]
[ { "docid": "94b3a55df0f3134e44c89ce609bd820c", "score": "0.6102302", "text": "def read_configuration\n end", "title": "" }, { "docid": "e306754e633595d1d5e3a646d5b589fb", "score": "0.60763836", "text": "def read(name)\n return rread(name, @configurations)\n end", ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "6c8ddcb5a8388ce715b6e557f4d126b9", "score": "0.0", "text": "def set_gbook\n @gbook = Gbook.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
3d08016f06bf130dd1ef2648e71c28f4
A little violating... move this to Datapoints
[ { "docid": "c074a7a5ae43caa3a446d00af81b22fe", "score": "0.0", "text": "def report\n @report ||= begin\n # Questionable what the total numbers of datapoints should be.\n data = Report::Datapoints.new(@postag.size)\n add_datapoints_container(data)\n data.each_wi...
[ { "docid": "8ce74db74c384e8e5921667375de8696", "score": "0.64330024", "text": "def yData; end", "title": "" }, { "docid": "8ce74db74c384e8e5921667375de8696", "score": "0.64330024", "text": "def yData; end", "title": "" }, { "docid": "ccc226ea6b78a4fd6e2fde73a79a6ccd", ...
887b10759a9433263c6645111644deb0
this is also only ever used for testing. Bank accounts are tokenized by balanced in prod
[ { "docid": "c90eb268ed1d8d223ee8c6e43ef94d10", "score": "0.6214343", "text": "def get_bankaccount_token(bankaccount_details)\n response = Balanced::BankAccount.new(bankaccount_details).save\n response.attributes[\"uri\"]\n end", "title": "" } ]
[ { "docid": "f9236c5b4762892a3d960883696682e7", "score": "0.6643548", "text": "def add_bank_account\n\n get_balanced_key\n\n account_uri = params[:account_uri]\n company_name = \"Mindfire Solutions\"\n\n ##You can set your customer business / company name here \n customer = Balanced::Custo...
3d181f1f0290bbfec184636753c790b9
PATCH/PUT /good_types/1 PATCH/PUT /good_types/1.json
[ { "docid": "5292441b88cf7f78516423900dc2d5e5", "score": "0.7004913", "text": "def update\n respond_to do |format|\n if @good_type.update(good_type_params)\n format.html { redirect_to @good_type, notice: 'Good type was successfully updated.' }\n format.json { render :show, status: :...
[ { "docid": "2476b03c5acb67b51c3596660fc3deee", "score": "0.651577", "text": "def update\n respond_to do |format|\n if @spec_type.update(spec_type_params)\n format.html { redirect_to @spec_type, notice: 'Spec type was successfully updated.' }\n format.json { render :show, status: :o...
2d2373d7d3698f0942b65e3dd77cdaba
== 'Roberts, Joe' Question 8 Create a method that takes two integers as arguments. The first argument is a count, and the second is the first number of a sequence that your method will create. The method should return an Array that contains the same number of elements as the count argument, while the values of each ele...
[ { "docid": "0acdf7f9382186e1453ba7b871c2a1b1", "score": "0.0", "text": "def sequence(count, num1)\n num_arr = []\n total = 0\n count.times do\n total += num1\n num_arr.push(total)\n end\n p num_arr\nend", "title": "" } ]
[ { "docid": "c3c9f831e3cca58b1b3edc7637c0ae4c", "score": "0.8070621", "text": "def sequence(count, starting_number)\n multiples = []\n\n 1.upto(count) { |num| multiples << starting_number * num}\n multiples\nend", "title": "" }, { "docid": "3a9ed20d0600567c16f20323e9b3928c", "score": "...
5aa695b5f7c0f93fbd1303ed32a4d9e0
Output a paragraph macro for the escaped paragraph.
[ { "docid": "eb5fae3d1bdcaadcb4413bde83c26b85", "score": "0.6160646", "text": "def accept_paragraph(paragraph)\n parts << handle_inline_attributes(paragraph.text)\n parts << \"\\n.Pp\\n\"\n end", "title": "" } ]
[ { "docid": "c3e15c641b675da59adf576ac0fc2662", "score": "0.7208482", "text": "def print_paragraph(ptext)\n\t\tputs\n\t\tputs ptext\n\t\tputs\n\tend", "title": "" }, { "docid": "e9075952e9f9a4ad0d96cbd4de999360", "score": "0.6677258", "text": "def paragraph(opts)\n paragraphs(1, ...
9b78bcf2678f1af675f31818d4618f15
Read a &39;storage.VirtualDriveContainer&39; resource.
[ { "docid": "60bee98838467ef0e42e9b84d91a46d1", "score": "0.54584706", "text": "def get_storage_virtual_drive_container_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: StorageApi.get_storage_virtual_drive_container_list ...'\n ...
[ { "docid": "ef0c27bcba42a6390112aeb62e8cd5bc", "score": "0.5925271", "text": "def read(path, &block)\n return client.read(container, path, &block)\n end", "title": "" }, { "docid": "12bd4b2b69b9a416ccc52da02bfb133d", "score": "0.5721609", "text": "def get_storage_virtual_driv...
928946780d38667a6eaf644c7eb144f5
Is this resource a collection?
[ { "docid": "cf9d93b7263e3ea63ffd95776d07b973", "score": "0.67127955", "text": "def collection?\n puts \"#{path}: #{options.inspect}\"\n if options[:api_meta]\n options[:api_meta][\"is_dir\"]\n else\n meta = Dropbox.client.metadata(path)\n puts meta.inspect\n (m...
[ { "docid": "7c4e485bfb59397d914fb6f138377dfd", "score": "0.88755983", "text": "def collection?\n not resource_type.nil?\n end", "title": "" }, { "docid": "0c926c40b900c4d86419934437f38233", "score": "0.8455265", "text": "def is_collection?\n @type == :collection\n end...
5e68efd74e714e49d6ca828c554a5e73
Sends input to the slave process STDIN. Returns immediately.
[ { "docid": "2aff82f73997071eafb11e51292bfd22", "score": "0.5879415", "text": "def send_input(input)\n raise ArgumentError if input.nil? or input.try(:empty?)\n input.each_char { |char| @input.putc(char) }\n end", "title": "" } ]
[ { "docid": "07456634d8d29aac3dae2836e0e03be2", "score": "0.72701377", "text": "def stdin_slave\n master, slave = PTY.open\n master.raw!\n\n Thread.new {\n until STDIN.closed?\n # This makes special chars work, but has some weird side-effects that\n # I need to figure out.\n ...
1951841c7344bac3b9d8b4a83a2d9c45
This will give Time Accounted Week Wise
[ { "docid": "347bd5b46c99141e2447ea2cfa0e06cb", "score": "0.7716841", "text": "def time_accounted_week_wise_data\n\t\tduration,method_name=\"week\",'time_accounted_week_wise'\n\t\ttime_accounted(duration,method_name)\n\t\tset_title(\"#{@user.full_name.titleize}'s Time Accounted -Week wise\")\n\t\tset_sub...
[ { "docid": "a3081a9550769230c06b0406652f1639", "score": "0.73309624", "text": "def entries_for_week\n TimeEntry.foruser(self.user).on_tweek(self.weekof.to_date.cweek)\n end", "title": "" }, { "docid": "b47cc74f0ed0849481eccc1258e667b1", "score": "0.73216546", "text": "def total_h...
531ad53514fe6c55de10a33f6a67b3c0
Preprocesses form data for direct input to Job.update
[ { "docid": "21ee1776cd1b7b54308931e59bfed471", "score": "0.7322655", "text": "def process_form_params\n # Handles the text_fields for categories, courses, and programming languages\n [:category, :course, :proglang].each do |k|\n params[:job][\"#{k.to_s}_names\".to_sym] = params[k][:name]\n ...
[ { "docid": "7226c0cf86d98bd8b7408295857b5a88", "score": "0.7326845", "text": "def process_form_params\n # Handles the text_fields for categories, courses, and programming languages\n [:category, :course, :proglang].each do |k|\n params[:job][\"#{k.to_s}_names\".to_sym] = params[k][:name]\n ...
2461045a34827eca87f61446066f1067
Defines a timezone based on data.
[ { "docid": "eb82d669ad65a3b01d73968c675b3628", "score": "0.670803", "text": "def data_timezone(identifier)\n @data_timezones << identifier.freeze\n end", "title": "" } ]
[ { "docid": "94672c192725931cd0d4862993f31d53", "score": "0.7453017", "text": "def create_timezone\n DataTimezone.new(self)\n end", "title": "" }, { "docid": "94672c192725931cd0d4862993f31d53", "score": "0.7453017", "text": "def create_timezone\n DataTimezone.new(self)\n ...
aeabb8e545d6f7aef119c0b12247dbb3
Counts the number of games found for each player
[ { "docid": "7aa5d36b984624b678d5f899a90f100a", "score": "0.0", "text": "def most_active_players\n ReplayXmlData\n .where(hsreplay_id: @replay_outcomes.pluck(:hsreplay_id))\n .pluck(:extracted_data).compact.map do |data|\n data ? data['p1']['tag'] : nil\n end.compact.flatten.group_by...
[ { "docid": "07568f80a45d12aeb542bc07e4affa08", "score": "0.8072753", "text": "def games_played(games)\n count = 0\n\n games.each do |game|\n if self.id == game.creator_id\n count = count + 1\n elsif self.id == game.opponent_id\n count = count + 1\n end\n end\n\n ...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "ebd4aaf9fec7b5d61c71a70836597bca", "score": "0.0", "text": "def blacklist_params\n params.require(:blacklist).permit(:email, :comment)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.69497335", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6812623", "text": "def strong_params\n params.require(:listing_member).permi...
992622578f1635ce923400ad8223200e
more info Update a bunch of profiles
[ { "docid": "23af4a1b345468e907bf1c60914f541a", "score": "0.6722628", "text": "def update_profiles_bulk(profiles)\n raise Exceptions::ServiceException, \"Must be an array of profiles.\" if profiles.nil? || !profiles.is_a?(Array)\n url = Util::Config.get('endpoints.base_url') + Util::Con...
[ { "docid": "6c573650c7187f5bb71e1b32785ddabd", "score": "0.76922274", "text": "def update!(**args)\n @profiles = args[:profiles] if args.key?(:profiles)\n end", "title": "" }, { "docid": "7f1f42e761891460418ce910d7654916", "score": "0.7501893", "text": "def update\n ...
df8650bc7a97629107d888832a0337e5
Checks if a push rule for the current user is enabled
[ { "docid": "16c131d72424cd550ef9eb6cd392bae5", "score": "0.59665966", "text": "def get_pushrule_enabled(kind:, id:, scope: 'global')\n scope = ERB::Util.url_encode scope.to_s\n kind = ERB::Util.url_encode kind.to_s\n id = ERB::Util.url_encode id.to_s\n\n request(:get, client_api_latest, \"/p...
[ { "docid": "327bc30fe36d315d4ed0187165c5c9a0", "score": "0.6714152", "text": "def push_check(attrs)\n unless attrs.nil?\n attrs.each do |a|\n if a[:key] == 'PUSH_ENABLED'\n return a[:value].is_a?(String) ? a[:value] == 'TRUE' : a[:value]\n end\n end\n ...
51c046a5d2003b68afe84501eb982c70
Deletes an affinity group in the specified subscription ==== Attributes +name+ String. Affinity Group name.
[ { "docid": "a03d947c46ad77f463c770e3b84c7215", "score": "0.8320721", "text": "def delete_affinity_group(name)\n if affinity_group(name)\n request_path = \"/affinitygroups/#{name}\"\n request = @client.management_request(:delete, request_path)\n request.call\n A...
[ { "docid": "b35041d09fc3585473c11669dde2fc8e", "score": "0.82814676", "text": "def delete_affinity_group(name)\n if affinity_group(name)\n request_path = \"/affinitygroups/#{name}\"\n request = Azure::BaseManagement::ManagementHttpRequest.new(:delete, request_path)\n re...
cecee36925d2b8f967f77e54f5238f77
Returns all of the discounts that will be displayed in the checkout summary section.
[ { "docid": "cc717c89c8ebf31b13237a2cf9e794c3", "score": "0.6408813", "text": "def all_discounts(scans)\n scans.map do |scan|\n product = scan.product\n next unless product.is_a?(BuyXGetXProduct) || product.is_a?(BulkProduct)\n discount_total = scan.discount_total\n next unless dis...
[ { "docid": "ea1dbb70117bfb1f1b404fed58318ca5", "score": "0.7212498", "text": "def discounts\n @discounts ||= [product.dig(:discounts, :item)].flatten(1).compact\n end", "title": "" }, { "docid": "54e0419300232cf29e1e4f7b5da38aec", "score": "0.7034349", "text": "def discounts\n ...
a10b966341474c40fb8b4ef2d8d64cc2
Sets the lastSyncDateTime property value. The last time when an application sync was done with the Apple volume purchase program service using the the Apple Volume Purchase Program Token.
[ { "docid": "d5ea68ae460ca0eb177c6ac70aed0ccb", "score": "0.7851621", "text": "def last_sync_date_time=(value)\n @last_sync_date_time = value\n end", "title": "" } ]
[ { "docid": "171f9a4c582ea13fe5b44e79d7c5aba5", "score": "0.7331887", "text": "def last_sync=(value)\n @db['last_sync'] = value\n end", "title": "" }, { "docid": "650677b128a254c73c12aa6f9c6c8ad5", "score": "0.7147781", "text": "def on_premises_last_sync_date_time=(value)\n ...
682591120fa6d72808a6a14519c72608
GET /totalbooks GET /totalbooks.json
[ { "docid": "24076a50141de697381a8adce2ad7da9", "score": "0.7124829", "text": "def index\n @totalbooks = Totalbook.all\n end", "title": "" } ]
[ { "docid": "49abef20db0f0aecff520cfd28ebeac0", "score": "0.6789807", "text": "def index\n # @books = Book.all\n @books = Book.page(params[:page]).per(10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @books, status: :ok }\n end\n end", ...
e79e1cbb17efab9872b4c991316fed28
POST /counter_images_sets POST /counter_images_sets.xml
[ { "docid": "e0d257e5250db9e2912c5d5659237ad1", "score": "0.71356964", "text": "def create\n @counter_images_set = CounterImagesSet.new(params[:counter_images_set])\n\n respond_to do |format|\n if @counter_images_set.save\n flash[:notice] = 'CounterImagesSet was successfully created.'\n...
[ { "docid": "8c1ffa8cfd8205777ee2e53208f60dbd", "score": "0.64259803", "text": "def create\n @image_set = ImageSet.new(image_set_params)\n\n respond_to do |format|\n if @image_set.save\n format.html { redirect_to @image_set, notice: 'Image set was successfully created.' }\n forma...
5d2614dc508d8a1e75ac47c96db45b0e
GET /proformas/new GET /proformas/new/:solicitud_id
[ { "docid": "d72edb3d90626af5e9310a98550bdb94", "score": "0.0", "text": "def new\n if !logged_in?\n\n redirect_to :root\n\n end\n @proforma = Proforma.new\n if (params.has_key?(:solicitud_id))\n @solicitud = Solicitud.find(params[:solicitud_id])\n @proforma.solicitud_id = @...
[ { "docid": "681c688b0e3b1a91c840f8b3852b24c2", "score": "0.7296122", "text": "def new\n @trabajo = Trabajo.find(params[:trabajo_id])\n presupuestos_de_proveedor = @trabajo.presupuestos.where(:proveedor_id => current_proveedor.perfilable_id).size\n if presupuestos_de_proveedor > 0\n flash[:...
d9306d1f8d7c27fa396500181d8d98a7
Resets the nonKitchen managed instance using by issuing a command over SSH.
[ { "docid": "dcae52c40e6e559d92b628fb64f95e4f", "score": "0.7761437", "text": "def reset_instance(state)\n if (cmd = config[:reset_command])\n info(\"Resetting instance state with command: #{cmd}\")\n ssh(build_ssh_args(state), cmd)\n end\n end", "title": "" } ]
[ { "docid": "ac064598515f35e3548504a07006e147", "score": "0.7681815", "text": "def reset\n `ssh root@#{ip} \"reboot\"`\n end", "title": "" }, { "docid": "d5ced51dd9fc6110cf56bca3c680890f", "score": "0.72172314", "text": "def reset_ssh\n if !ssh_state\n host(resource[:n...
bed960bd5a451bee5b8007131f40825c
[bsarrazin] July 20th, 2019 Stolen from Fastlane, as I am not an expert on encryption/decryption. If you have experience and want to help, please submit a pull request :) > We encrypt with MD5 because that was the most common default value in older fastlane versions which used the local OpenSSL installation > A more se...
[ { "docid": "a26e7d968ef78cb7356b5649383b55a5", "score": "0.0", "text": "def decode(string: String)\n data = Base64.decode64(string)\n salt = data[8..15]\n data = data[16..-1]\n\n decipher = OpenSSL::Cipher.new('AES-256-CBC')\n decipher.decrypt\n decipher.pkcs5_keyivgen(@pas...
[ { "docid": "4cf3fd9e88cc3f6e9521ea6662a4c12d", "score": "0.7732856", "text": "def encrypt(salt=nil, iv=nil, payload, pwd)\n cipher = OpenSSL::Cipher::Cipher.new('AES-256-CBC')\n cipher.encrypt\n if salt.nil?\n salt = OpenSSL::Random.random_bytes(8)\n else\n salt = hex2bin(salt)\n end\n if iv...
67037e851ff1dc0226bc861539ed5545
return the name of the drink from the JSON information
[ { "docid": "12023a165e7f56eba9d50688820ff9f6", "score": "0.8068854", "text": "def get_drink_name_from_api(drink_hash)\n return drink_hash[\"drinks\"][0][\"strDrink\"]\nend", "title": "" } ]
[ { "docid": "4ad71b98e1268d08714a0aea83b41dc0", "score": "0.7258591", "text": "def api_return_name(drink)\n response_string = RestClient.get(\"https://www.thecocktaildb.com/api/json/v1/1/search.php?s=#{drink}\")\n response_hash = JSON.parse(response_string)\n drink_string = response_hash[\"drink...
6dd7020ba7b630247811997e09ed69b4
The first arg can be a view or a frame
[ { "docid": "7176c9f5ed69dd3c198e9c0b3f83e207", "score": "0.0", "text": "def from_right(from_view=nil, f=nil)\n if from_view.is_a?(Hash)\n f = from_view\n from_view = nil\n end\n f ||= {}\n from_view ||= target.superview\n _calculate_frame(f, from: from_view, relati...
[ { "docid": "45128cea23c91ae50a731e5b05932e96", "score": "0.66732824", "text": "def draw(view)\n end", "title": "" }, { "docid": "0b6751735e9466683fd27d27a6445832", "score": "0.63972855", "text": "def tgtFrame=(_arg0); end", "title": "" }, { "docid": "7930adf588feb010a3af...
ac706c59a90eb4dcf1045de0b6a299b5
Checks the HTTP request method (or verb) to see if it was of type LINK
[ { "docid": "8fad7bdcd0fb2ff424fe4a073c50708c", "score": "0.56531566", "text": "def link?; end", "title": "" } ]
[ { "docid": "2d4dc3f0dd981cc9af274a00478ec15f", "score": "0.6838727", "text": "def is_link?(method)\n @_definition.key?('_links') and @_definition['_links'].key?(method)\n end", "title": "" }, { "docid": "f6ffbabe1c3333b27a29112641b98708", "score": "0.6813761", "text": "def li...
4052845e7936131a8a180fafe1d298d9
Validate set handler. Validates: handlers
[ { "docid": "bcf715501a92cf1c108d70ba7ae2c189", "score": "0.77689606", "text": "def validate_set_handler(handler)\n if is_an_array?(handler[:handlers])\n items_must_be_strings(handler[:handlers]) ||\n invalid(handler, \"handler set handlers must each be a string\")\n ...
[ { "docid": "e0a8967684faaf5695d67f70929c86b8", "score": "0.70569867", "text": "def validate_handlers\n handlers.each { |handler| validate(:handler, handler, children_for(handler)) }\n end", "title": "" }, { "docid": "7e4c77a6108772e4280ba724baa24690", "score": "0.6778296", "t...
f1b82097ecc530035af22d52e3eaada1
write a method that takes an array and returns a new array elements in reverse order
[ { "docid": "f377a3369daa789b2aeec24c9de19b18", "score": "0.0", "text": "def reverse(array)\n new_array = []\n array.each_with_index { |char, idx| new_array << array[-1 - idx]}\n new_array\nend", "title": "" } ]
[ { "docid": "a9b62170c4e32a603bfde17a7c9022d8", "score": "0.85730416", "text": "def reverse_array(array)\n array.reverse\nend", "title": "" }, { "docid": "f551e6bbfecfff7ab46eae00816a16f2", "score": "0.8565027", "text": "def reverse_array(array)\n array.reverse\n end", "titl...
48ac67431251af05d9865ad9a18920e1
lexer rule string! (STRING) (in Spirit.g)
[ { "docid": "dd80a0fb8d2d52186aef10e211049375", "score": "0.6721038", "text": "def string!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 43 )\n\n type = STRING\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - -...
[ { "docid": "b7de070625a2a85bdcb64e8a165e6f3e", "score": "0.7268342", "text": "def string!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 19 )\n\n type = STRING\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - -...
cad3b45a010641251af3eeeebc92bc3e
Returns true if the method was found in the source in the "endless" form, i.e. where the method body is defined using the `=` operator after the method name and parameters.
[ { "docid": "7a173c5447af855701eb051a64986516", "score": "0.0", "text": "def endless?; end", "title": "" } ]
[ { "docid": "8353312d6396c5d103cc8be353ab815e", "score": "0.668052", "text": "def bang_method?\n method_name.to_s.end_with?('!')\n end", "title": "" }, { "docid": "ba4052413fcc62a663b564d3aa0090a2", "score": "0.66387594", "text": "def method_line?\n words = self.strip...
d7ae4c054fcff2b30db600990b91dbc4
print_separator: Prints a separator line to stdout.
[ { "docid": "30160ff2ec96b795a0fffc6c9f72c349", "score": "0.7331354", "text": "def print_separator( enable = $VERBOSE )\n puts \"-\" * $LINE_LENGTH if enable\nend", "title": "" } ]
[ { "docid": "5d31f1f2c0cda576eb8210e03833b825", "score": "0.7643435", "text": "def print_separator\n str = \"+\" + \"-\" * (title_width + 2)\n \n column_order.length.times do\n str += \"+\" + \"-\" * (column_width + 2)\n end\n \n puts str + '+'\n en...
bfee75d4927e9c518570241ed6b454b8
PATCH/PUT /orderdetails/1 PATCH/PUT /orderdetails/1.json
[ { "docid": "eb3ce9707e31d79984e1196dd16b44c9", "score": "0.7108887", "text": "def update\n respond_to do |format|\n if @orderdetail.update(orderdetail_params)\n format.html { redirect_to @orderdetail}\n format.json { render :show, status: :ok, location: @orderdetail }\n else\n...
[ { "docid": "0bba85f6e56e94c650d334f6f82b74c3", "score": "0.73063636", "text": "def update\n @order_detail = OrderDetail.find(params[:id])\n\n respond_to do |format|\n if @order_detail.update_attributes(params[:order_detail])\n format.html { redirect_to @order_detail, :notice => 'Line i...
ff2a13240c405890b57c2e2078a8bfce
Methods Sets the publish_at time to the current UTC time
[ { "docid": "4e33b5a1a0e41a5d0725d74ac81a455e", "score": "0.80390924", "text": "def publish_now\n self.publish_at = Time.now.utc\n self.save!\n end", "title": "" } ]
[ { "docid": "3ee4a9dc509c90702727a4ba7c0f6ceb", "score": "0.7709122", "text": "def publish=(time)\n self.published_at = Chronic.parse(time)\n end", "title": "" }, { "docid": "9a1db295c1c35b51a231ca8381099748", "score": "0.7454702", "text": "def set_published_at\n if draft_chang...
628ab452215d8b2515c7181514b0f5c1
Navigates home, returns self for chaining with next call
[ { "docid": "f198b761586a1ee878481a1f3ad62947", "score": "0.0", "text": "def sitemap\n self.root\n self.follow('dtime:sitemap')\n self.get\n self\n end", "title": "" } ]
[ { "docid": "1f3716efddb3aace7927f3f2995d7b5d", "score": "0.7326779", "text": "def go_home\n self.homelink.click\n end", "title": "" }, { "docid": "30b92d3e1905255ea126a0f3ed6a19f4", "score": "0.71901745", "text": "def go_home\n wait_for_home_button\n home_button.cli...
c73ca3e1d6915c4113ef4ea3adddb4ef
all business rules should be in models controller only serve data
[ { "docid": "9e1a6e55e8b597689e7ffa391a0c90b4", "score": "0.0", "text": "def review_ratings\n if reviews.count.positive?\n total = reviews.inject(0) { |sum, review| sum + review.rating }\n total / reviews.count\n else\n 0\n end\n end", "title": "" } ]
[ { "docid": "ebbe58c09a43355e4f6f8665a47fbf2c", "score": "0.62106097", "text": "def rules\n\n end", "title": "" }, { "docid": "057564e411740f962afeab83b754649b", "score": "0.6125284", "text": "def permit_rules\n end", "title": "" }, { "docid": "8d4dcbe3666448cba168...
8216570473a10c9ae690190410d66425
PATCH/PUT /dmsf/accounts/1 PATCH/PUT /dmsf/accounts/1.json
[ { "docid": "cd012ec049bfdc0ef37091decc1d0b49", "score": "0.6607451", "text": "def update\n respond_to do |format|\n if @dmsf_account.update(dmsf_account_params)\n format.html { redirect_to dmsf_accounts_url, notice: t('.notice') }\n format.json { render :show, status: :ok, location...
[ { "docid": "6ff99486bd117ea96875caa9752b087a", "score": "0.67219794", "text": "def update\n @account = current_user.accounts.find(params[:id])\n\n if @account.update(account_params)\n head :no_content\n else\n render json: @account.errors, status: :unprocessable_entity\n end\n end...
e5c6013d832f2e1d235b55f5969c3792
This just calls the class' .block_sizes_supported method for you.
[ { "docid": "ed6d733bbc48a4a6c2a0db817e2f8219", "score": "0.9018582", "text": "def block_sizes_supported\n\t\t\t\t\tself.class.block_sizes_supported\n\t\t\t\tend", "title": "" } ]
[ { "docid": "19c9623107a18974964ed5a78bd6c9a7", "score": "0.6471583", "text": "def sizes_available\n data[:sizes_available]\n end", "title": "" }, { "docid": "19c9623107a18974964ed5a78bd6c9a7", "score": "0.6471583", "text": "def sizes_available\n data[:sizes_available]\n ...
caef13666af95972f457b08992d03329
Moves the bottom card on the tableau to the foundation for its suit. Raises an error if the move cannot be completed. This version of the method modifies the current board instead of creating a new board.
[ { "docid": "d9e665ce3601566240ea29452ba972da", "score": "0.6295861", "text": "def move_from_tableau_to_foundation!(from_tableau_index)\n do_move do\n from_tableau = get_tableau_for_move(from_tableau_index)\n\n new_from_tableau, bottom_card = from_tableau.remove_card\n\n raise \"Tableau...
[ { "docid": "fee38156f17e5de47594b9ccf40192f1", "score": "0.6613939", "text": "def move_top_waste_card_to_foundation!\n do_move do\n new_waste, card = @waste.remove_card\n\n raise \"No waste card to move\" if card.nil?\n\n suit = card.suit\n\n foundation = get_foundation_for_move(s...
8c91950de38e1f2e5eb96b4e78c4e726
Play the move animation
[ { "docid": "81287486c9376a61bf7108ca56608197", "score": "0.6059366", "text": "def play_animation(user, targets)\n # TODO\n end", "title": "" } ]
[ { "docid": "7c85c3d300eb351f4ace1737c171330e", "score": "0.71904606", "text": "def move\n request_animation_frame { move } if @mouse_is_down\n return if !@position || !@started\n trigger 'move', @position\n end", "title": "" }, { "docid": "0b4965f2ea4ef6a3011d4e92c6f60c4f",...
89c3457d028379f9734d6bc98edcdd31
GET /locations GET /locations.json
[ { "docid": "1621ce62c9e518267307c773fd9c7e59", "score": "0.0", "text": "def index\n @locations =\n if location_params_get[:request_codename]\n Location.select_class(location_params_get[:request_codename])\n .select(:code, :full_name)\n .where('full_name ilike...
[ { "docid": "5a045e60ef8597f6e1a8e45e32e24111", "score": "0.79108214", "text": "def locations(options={})\n get(\"/locations/search\")\n end", "title": "" }, { "docid": "30cf3aaba2cf137b9aad8454273b78d0", "score": "0.7875528", "text": "def locations(opts = {})\n get 'lo...
55eef8a33b762c2b4a1d274038b2f9c6
returns all versions including the user that made it and the
[ { "docid": "8f0ea47317e73fd889be3fef5ad3f54a", "score": "0.6338962", "text": "def version_history\n res = []\n event = 'create'\n author = user\n versions.each do |version|\n # some old entries still include create actions\n # TODO remove next line\n next if version.event == '...
[ { "docid": "2b69c45ec090597077f22cf5599c5d66", "score": "0.7431731", "text": "def version_users\n if !self.paper_trail.live?\n v = self.version\n if v.association_data[:user_ids]\n v_users = []\n users = User.where(\"id IN (#{ v.association_data[:user_ids].join(',') })\")\n ...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "32a1ef6f532c646731626b11d7e80541", "score": "0.0", "text": "def update!(**args)\n @default_leader_location = args[:default_leader_location] if args.key?(:default_leader_location)\n @location = args[:location] if args.key?(:location)\n @type = args[:type] if args.ke...
[ { "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...
49da1f866ad149ad8015b219e795e3d7
Custom attribute writer method with validation
[ { "docid": "fdd4472a35cf7a73ee2e65e19e52830f", "score": "0.0", "text": "def quantity=(quantity)\n\n if !quantity.nil? && quantity < 1\n fail ArgumentError, \"invalid value for 'quantity', must be greater than or equal to 1.\"\n end\n\n @quantity = quantity\n end", "title": "...
[ { "docid": "0f4a74039d4b8dc62405e39b58357a05", "score": "0.6472992", "text": "def attr_writer_tag(text); end", "title": "" }, { "docid": "ac55752dd9cc4f485a916c46d7b41237", "score": "0.6315012", "text": "def allowed_attributes=(_arg0); end", "title": "" }, { "docid": "ac5...
0407fbb76b0a6e5acc9747826996e1b9
Edit a post requires post_owner
[ { "docid": "ac43861c57e195e616c83125ff358ef2", "score": "0.0", "text": "def edit\n\t\t@post = Post.find(params[:id])\n\t\tif @post.bids.any?\n\t\t\tflash[:danger] = \"You are not allowed to edit posts that have recieved bids!\"\n\t\t\tredirect_to root_path\n\t\telse\n\t\tend\n\tend", "title": "" }...
[ { "docid": "dcb69be23735d8d128b043e1749a376e", "score": "0.8258592", "text": "def edit\n @post = Post.friendly.find(params[:id])\n if not_owner_check(@post.user)\n redirect_to current_user\n end\n end", "title": "" }, { "docid": "037834de82fe04d38692e55fabcaae14", "score":...
3e92c83976826d39c103fe8974ad9fe4
Return the number of strains that have a representative in a cluster
[ { "docid": "cede47dd84476dfea411ff183800a2ff", "score": "0.5455536", "text": "def sum_cluster(arr, clust)\n\t\ttotal = 0\n\t\tarr.each do |strain|\n\t\t\ttotal += strain.clusters[clust]\n\t\tend\n\t\ttotal\n\tend", "title": "" } ]
[ { "docid": "1f619df24db0816f0d1511362ffbb91d", "score": "0.6239165", "text": "def size\n\t\t@clusters.size\n\tend", "title": "" }, { "docid": "ae613c4a1a9f12771ede67f7dabdaa92", "score": "0.6152468", "text": "def nr_of_regions\n ConnectedComponents.new(in_use_graph).count\n end",...
a2a876723e162273cd0501dfce8ba84f
Make sure the state we are transitioing to is valid!
[ { "docid": "3c966d6ca2c2f5d71bc2927fe707d28a", "score": "0.69089663", "text": "def check_state_transition \n # List of statuses we are allowed to set. Anything else is an error\n $ALLOWED_STATUSES ||= { nil => ['new'], 'new' => ['submitted', 'cancelled', 'pending'], 'submitted' => ['running', '...
[ { "docid": "effbd52b2e256ffd56bca277b18b0918", "score": "0.80822146", "text": "def ensure_valid_state\n\n end", "title": "" }, { "docid": "434ca3e8824e07f503b528cba30499e2", "score": "0.75061774", "text": "def set_state_to_valid\n \n end", "title": "" }, { "docid"...
582d7c9f955e26a04f488ea5937409d6
We wrap the result_type string attribute in a ResultType class that provides more functionality
[ { "docid": "bc66bb3475f6f7b7c14f4cca861bebaa", "score": "0.80456585", "text": "def result_type\n @result_type ||= ResultType.new read_attribute(:result_type)\n end", "title": "" } ]
[ { "docid": "d698d3fafb62bd17f299e017beb9916f", "score": "0.78362423", "text": "def result_type(result_type=\"mixed\")\n @query[:result_type] = result_type\n self\n end", "title": "" }, { "docid": "be132bc86957ffb51ca3de87267ece6a", "score": "0.77190644", "text": "def res...
43b016220e10d7acc5d09bcf23482c40
Retrieve a document's canonical JSON.
[ { "docid": "67410aef80410e56b5268806ef994559", "score": "0.56003237", "text": "def documents\n return bad_request unless params[:id] and request.format.json? || request.format.js? || request.format.text?\n return not_found unless current_document\n opts = {:access => true, :...
[ { "docid": "c216e4bc249fcbcf38cfe1e18456ddd3", "score": "0.6163849", "text": "def to_json\n { :document => document, :signature => signature }.to_json\n end", "title": "" }, { "docid": "78f6e064dcf55856e36cbff3c5450c55", "score": "0.61567193", "text": "def document\n ...
c6f452ad0177a0491fdbe22c9a7efcca
PATCH/PUT /blivots/1 PATCH/PUT /blivots/1.json
[ { "docid": "7ed9560c15d2ba419217ca5c286b3c47", "score": "0.71614224", "text": "def update\n respond_to do |format|\n if @blivot.update(blivot_params)\n format.html { redirect_to @blivot, notice: 'Blivot was successfully updated.' }\n format.json { render :show, status: :ok, locatio...
[ { "docid": "6d944cd6fc389dd13592c2102b18a4fd", "score": "0.6649964", "text": "def update\n if @boat.update(boat_params)\n head :no_content\n else\n render json: @boat.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "18c146569b94d2abb32e9306e1...
31b8ec07cdbb5c6de0b581cd195baa94
MISCELLANOUS METHODS check if all files for this study are still present in the bucket does not check generation tags for consistency this is just a presence check
[ { "docid": "06a8d332933426e66c7527128d3efb27", "score": "0.57471466", "text": "def verify_all_remotes\n missing = []\n files = self.study_files.where(queued_for_deletion: false, human_data: false, :parse_status.ne => 'parsing', status: 'uploaded')\n directories = self.directory_listings.are_syn...
[ { "docid": "4849e30fd4643aa7496c53ab31d1020a", "score": "0.63446534", "text": "def has_unused_files?\n unused_files = submitted_data_files - @checked_files_in_metadata\n # log error if unused files exist\n if unused_files.any?\n metadata_file_path = FileLocations.metadata_file_path(@source...
9cbb0f5cc787c0f10a64ad6d22d02e95
GET /vehicule_persos/1 GET /vehicule_persos/1.json
[ { "docid": "d28a46a703f68a41461def414d85b063", "score": "0.7433393", "text": "def show\n @vehicule_perso = VehiculePerso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @vehicule_perso }\n end\n end", "title": "" } ]
[ { "docid": "ae8ce3ff33b51418a355ead17e273090", "score": "0.75869244", "text": "def index\n @vehicule_persos = VehiculePerso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @vehicule_persos }\n end\n end", "title": "" }, { "doc...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "f0984e0d1f92518b9bc9c65057e73280", "score": "0.0", "text": "def set_customer\n @customer = Customer.find(params[:id])\n end", "title": "" } ]
[ { "docid": "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...
334d79b137615b56bdfe7cc354285e4a
Reloads the saved browserid config.
[ { "docid": "28c4c4b61bee139c5c0cb15842ff91f6", "score": "0.8558191", "text": "def reload_browserid_config\n Rails.application.config.browserid = @saved_config.dup\n end", "title": "" } ]
[ { "docid": "e992bceebc0b4788b70ec64483ec662a", "score": "0.78288776", "text": "def save_browserid_config\n @saved_config = browserid_config.dup\n end", "title": "" }, { "docid": "a0d8cca0a89dd37afd02566f23186bb4", "score": "0.6363177", "text": "def reload\n logger.info \"Rel...
758190a9fe925d25af103de1b1edfb85
has_many :matches, :through => :firmwares
[ { "docid": "609436067fbcc74a276f3ef4a5fb0059", "score": "0.5882753", "text": "def matches; Match.all_for self end", "title": "" } ]
[ { "docid": "d55506ef2b598792ec7467360a8f55fb", "score": "0.62167096", "text": "def approver_matches\n Match.where(approver: self)\n end", "title": "" }, { "docid": "8f9c6a2d470b70689db242e2225e55a0", "score": "0.5928815", "text": "def requester_matches\n Match.where(requester:...
f5f2ee3ba2e4c23d9647356fafea6b2b
Click on the given profile name using it's name as a locator
[ { "docid": "43f8537ab94738171c3f014bdab665bd", "score": "0.85247743", "text": "def click_on_profile_by_name(name = get_random_profile_name)\n click(css: \"h4>a[class='freelancer-tile-name'][title='#{name}']\")\n Log.step \"Clicked on random profile, profile selected: '#{name}'\"\n end", "titl...
[ { "docid": "fc845c17bf730e01486c41a130672f78", "score": "0.73569506", "text": "def profile\n self.profilelink.click\n end", "title": "" }, { "docid": "d0b144ce06b8490da158ba4db477b194", "score": "0.71081364", "text": "def click_on_freelancer_profile\n puts \"Step 9: Click ...
3663c426844a53d944b1429e15a79032
Restituisce il testo della missione
[ { "docid": "f86eee173657e69760828a61755ce2de", "score": "0.0", "text": "def get_mission\n if $game_system.worldtip.nil?\n missiontext = MISSIONS[$game_variables[STORY_VAR_ID]]\n else\n missiontext = $game_system.worldtip\n end\n return Vocab.no_info if missiontext == nil\n missi...
[ { "docid": "35a51327dd0b5c9a884bb0e6f7155697", "score": "0.69452083", "text": "def testing\n # ...\n end", "title": "" }, { "docid": "7e78781e30c79a0f12058cc8668ea8be", "score": "0.6812557", "text": "def test_otro_programa\r\n aspirantesOtro = 6\r\n tot = ReservarOt...
9b81830c0d50ad4114eab70b68a89e6d
=begin render the transactions page =end
[ { "docid": "f8ee8fb1408262ecf33c57cf0901d97c", "score": "0.7256526", "text": "def render_transactions\n render :template => \"stocks/transactions\"\n end", "title": "" } ]
[ { "docid": "17785e682e67f7dc110657a8021114a0", "score": "0.68091273", "text": "def create\n @transaction = Transaction.new(params[:transaction])\n if @transaction.save\n #flash[:notice] = 'Transaction was successfully created.'\n render :update do |page|\n page.insert_html :bottom...
16c02a1263d61514cb371f9fb6d131bf
DELETE /programs/:program_id/authors/:id DELETE /programs/:program_id/authors/:id.:format
[ { "docid": "5ac0f9f4977544cd3ef84ef03fd6e9dc", "score": "0.74007016", "text": "def destroy\n user = User.find_by_urlname(params[:id])\n @authorship = @program.authorships.find_by_user_id(user)\n @authorship.destroy\n \n respond_to do |format|\n flash[:notice] = 'Authorship destroyed'...
[ { "docid": "3cdeaf2a2c7cf420e30a22b472e13e16", "score": "0.73281354", "text": "def destroy\n @author = Author.find(params[:id])\n @author.destroy\n\n respond_to do |format|\n format.html { redirect_to painel_authors_url }\n format.json { head :ok }\n end\n end", "title": "" ...
681f1c0ab493962ae3fad4489b31d7c6
Iterate through the XF Format objects and give them an index to nondefault border elements.
[ { "docid": "11430dda0a82bf79c61d82aba9e6885e", "score": "0.6500222", "text": "def prepare_borders # :nodoc:\n borders = {}\n\n @xf_formats.each { |format| format.set_border_info(borders) }\n\n @border_count = borders.size\n\n # For the DXF formats we only need to check if the propert...
[ { "docid": "7180898f456b063768f0e21a97ff3919", "score": "0.5952833", "text": "def formats_idx; end", "title": "" }, { "docid": "6b693644cf4c74f3b87e49c113cec753", "score": "0.58295196", "text": "def prepare_formats # :nodoc:\n @formats.formats.each do |format|\n xf_index ...
4bbb37f2bbee3447f0ef81d54e418c01
Check if reset token is longer than 2 hours and update if not
[ { "docid": "48ef2230192e79a26816cdb003e6cdae", "score": "0.0", "text": "def update\n @user = User.find_by_password_reset_token!(params[:id])\n if @user.password_reset_sent_at < 2.hours.ago\n redirect_to new_password_reset_path, :alert => \"Password reset has been expired\"\n elsif @user.up...
[ { "docid": "d5870e14ed2dae0bbba4bc36e70caa65", "score": "0.81444293", "text": "def check_update_token\n refresh! if Time.at(self.expiration-60) < Time.now\n end", "title": "" }, { "docid": "d82525bc762490802abc05d295a87323", "score": "0.77227247", "text": "def check_token(token_t...
aab77a46caab3cf55566e55cb87af8ab
PUT /projects/1/stages/1 PUT /projects/1/stages/1.xml
[ { "docid": "a314a40bf93d59e22a8f2f3f59a4c1c7", "score": "0.7056452", "text": "def update\n @stage = current_project.stages.find(params[:id])\n \n respond_to do |format|\n if @stage.update_attributes(params[:stage])\n flash[:notice] = 'Stage was successfully updated.'\n format...
[ { "docid": "df6c70375ebcc20d6210b7698b770eac", "score": "0.6607062", "text": "def update\n @stage = Stage.find(params[:id])\n\n respond_to do |format|\n if @stage.update_attributes(params[:stage])\n flash[:notice] = 'Stage was successfully updated.'\n format.html { redirect_to(@...
436741c92bded063f514f274e1766bc4
GET /admin/bills GET /admin/bills.json
[ { "docid": "fb8543587afff80d39ce7cb112548f44", "score": "0.7379871", "text": "def index\n @admin_bills = Bill.all\n end", "title": "" } ]
[ { "docid": "fcf0130d71cfa02a1808efe213bf67a3", "score": "0.7715162", "text": "def index\n @bills = current_user.bills.all\n end", "title": "" }, { "docid": "39dab30e47ebbc3447337cb569a73db1", "score": "0.73985076", "text": "def index\n @bills = current_user.bills\n render :...
31c501f0aa7c38b74488a1dabe73fd3e
end of address_delivery_times method delivery options for nonmembers
[ { "docid": "9a8492bb43b590dc54f84b1439137610", "score": "0.61548036", "text": "def address_delivery_windows\n @available_zones = Array.new\n @available_delivery_zones = DeliveryZone.where(zip_code: self.zip)\n \n @available_delivery_zones.each do |zone|\n @time_options = zone.nonmember_...
[ { "docid": "b53805d9dd4ed4d29bd197936e02832d", "score": "0.67748356", "text": "def delivery_method; end", "title": "" }, { "docid": "b53805d9dd4ed4d29bd197936e02832d", "score": "0.67748356", "text": "def delivery_method; end", "title": "" }, { "docid": "b53805d9dd4ed4d29b...
42b5bade31b4f142d95f80a031f9dba6
Detect if `obj` is an instance of `Fixnum` from Ruby older than 2.4.x
[ { "docid": "72d90a1d4ef9990e7140af9879d7ac74", "score": "0.75031686", "text": "def pre_24_fixnum?(obj)\n 24 > ruby_series && obj.is_a?(Fixnum)\n end", "title": "" } ]
[ { "docid": "75fbd4edff0fccbc73f85fc47adc1645", "score": "0.67612827", "text": "def is_num_type?(obj)\n Numeric === obj && obj.respond_to?(:between?) && obj.class.method_defined?(:<)\n end", "title": "" }, { "docid": "a10ae48ee9039b4ac68e99ee87b21fc0", "score": "0.6685548", "t...
76c3f2b51c9dd474fd05811ae6854562
iterate through the linked list in order and yield
[ { "docid": "7c3521f0399f677a751c40d23bc02f77", "score": "0.71241295", "text": "def iterate\n return unless block_given?\n\n current_node = @head\n\n until current_node.nil?\n yield current_node\n\n current_node = current_node.next\n end\n end", "title": "" } ]
[ { "docid": "0132abcfcbe45ae70cfc180516866100", "score": "0.75116456", "text": "def traverse_list\n return self unless block_given?\n x = @head\n until x.nil?\n yield x\n x = x.next_node\n end\n end", "title": "" }, { "docid": "cf20b1ab858cb825d0581083da8cb06b", "sc...
36ef83163478daf7aa258887565bbcc2
GET /ultimo_grado_de_estudios/new GET /ultimo_grado_de_estudios/new.json
[ { "docid": "413ccba8fce6dc6ba1b23c6c0d75b997", "score": "0.7544833", "text": "def new\n @ultimo_grado_de_estudio = UltimoGradoDeEstudio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ultimo_grado_de_estudio }\n end\n end", "title": "" ...
[ { "docid": "9f95bd020b51e879586d991c5cf2efd2", "score": "0.73282856", "text": "def new\n @sezione = Sezione.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sezione }\n end\n end", "title": "" }, { "docid": "fd46eb658e309ff90d18970...
f0be98d033dbefc28a999244daf627ec
Returns a valid password string to create a user using this auth driver
[ { "docid": "92f0bcb6f68be8a23be936c2c889f243", "score": "0.0", "text": "def password\n @srv_passwd\n end", "title": "" } ]
[ { "docid": "0c12b86c960e25d50f5cfebf3e3f3707", "score": "0.71016675", "text": "def generate_password(auth)\n if(auth.password.nil?)\n auth.password = Digest::SHA1.hexdigest(auth.username + auth.enterprise_id)\n else\n auth.password = Digest::SHA1.hexdigest(auth.password + auth.en...
c24e08a3a828ed68b599dd5f1d46741b
Sets the value of the `vms` attribute.
[ { "docid": "129f1f581ef97dddd0093b8f70474ede", "score": "0.7415567", "text": "def vms=(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] = Vm.new(value)\n end\n end\n...
[ { "docid": "8a1ef38156f78a561f6841f67dc59336", "score": "0.7471682", "text": "def set_vms\n @vms = Vms.find(params[:id])\n end", "title": "" }, { "docid": "8a1ef38156f78a561f6841f67dc59336", "score": "0.7471682", "text": "def set_vms\n @vms = Vms.find(params[:id])\n end", ...
26256911da61766657ffabb70089520c
Returns an array of locations for a circle.
[ { "docid": "c57f9a00ea75dcc7fde98d2d56cfdc85", "score": "0.700229", "text": "def get_circle(location, r)\n\t\t\tstartY = location.y - r\n\t\t\t\n\t\t\tstartX = 0\n\t\t\tendX = 0\n\t\t\tif startY % 2 == 0\n\t\t\t\tstartX = location.x - (r / 2.0).floor\n\t\t\t\tendX = location.x + r;\n\t\t\telse\n\t\t\t\t...
[ { "docid": "3fc3fb12a5f2237b5f75a4e0eaf261b2", "score": "0.68248504", "text": "def points_for_circle(x, y, r)\n cur_page.points_for_circle(x, y, r)\n end", "title": "" }, { "docid": "6b19dfa97ab41881c871fa7ce36ff749", "score": "0.67919993", "text": "def location(x, y, theta, ...
35501b9ef31bc4f6d169e18285d57b6b
change attributes of registered class, like credit/audit
[ { "docid": "59218b19c0c46c0635a341fa0e64e002", "score": "0.0", "text": "def update\n @registered_section = RegisteredSection.find(params[:id])\n @registered_section.update_attributes(params[:registered_section])\n end", "title": "" } ]
[ { "docid": "d14f241cc0d7a82c6b2cf4ef38540628", "score": "0.69869065", "text": "def attribute_update(key, original, modified)\r\n case key.downcase\r\n when 'objectclass'\r\n self.remove_class(original) if modified.blank?\r\n self.add_class(modified) if original.blank?\r\n when...
9b7ec25b3c27b589223de80914c6c55d
unit tests for the TileGroup:: append metho
[ { "docid": "532e33f728e996c92923f54064169c11", "score": "0.7878186", "text": "def test_append_duplicate_tiles\n assert true,@newTileGroup.tiles.empty?\n 10.times{|num| @newTileGroup.append(:A)}\n assert_equal(Array.new(10,:A),@newTileGroup.tiles)\n end", "title": "" } ]
[ { "docid": "42cd85e705fcad3b52ffea5d1b78d461", "score": "0.82756835", "text": "def test_append_one_tile\n assert true,@newTileGroup.tiles.empty?\n @newTileGroup.append(:A)\n \n assert_equal([:A],@newTileGroup.tiles)\n end", "title": "" }, { "docid": "edfc496f1dbd34f228...
1d3a5abae216fcc596c7b2a5a539b3d7
Convert the Mail object's body into a Base64 decoded email returning the modified Mail object
[ { "docid": "606b1c37ac1df1fb914e316c80f0c9e1", "score": "0.6891614", "text": "def base64_decode!\n if /base64/i === self.transfer_encoding('')\n store 'Content-Transfer-Encoding', '8bit'\n self.body = base64_decode\n end\n end", "title": "" } ]
[ { "docid": "450ee7e84266b69a93a5b10cbe326790", "score": "0.7348301", "text": "def base64_decode\n Base64.decode(self.body, @config.strict_base64decode?)\n end", "title": "" }, { "docid": "ae2eeefc10e44b1334ed18520dacb080", "score": "0.7071043", "text": "def decoded_multipart_...
fbd7bd89e6496ae1e704fd77fa458921
Clear all cache entries.
[ { "docid": "855f06d04193a76cc244573a5f9fc022", "score": "0.0", "text": "def clear\n @lock.write_sync{ @data.clear }\n end", "title": "" } ]
[ { "docid": "a3e42997ba9c3f0fb2cc3235cbd596f0", "score": "0.858729", "text": "def clear_all!\n @cache = Cache.new\n end", "title": "" }, { "docid": "429ccf9e23dafd01eab54ef2e4b77ff4", "score": "0.84387517", "text": "def clear_cache\n @all = nil\n end", "title": "" },...
16a848ac0b96bfca6cb817a75ab35b53
This implements a character class, and is specifically for use with matching strings
[ { "docid": "6e617a4b99296a601bcae590a932bc74", "score": "0.0", "text": "def range(c_begin, c_end, alphabet = DEFAULT_ALPHABET)\n any((c_begin..c_end).to_a, alphabet)\n end", "title": "" } ]
[ { "docid": "9609b2fb2284a34c92c3477b146f5f22", "score": "0.71366787", "text": "def character_by_character(string)\nend", "title": "" }, { "docid": "21d88057854a27804e69b2309b45a478", "score": "0.70090204", "text": "def charClasses(str)\n classes = Hash.new\n if str =~ /[A-Z]/\n ...
b82a396984c86f15077233944a5d861e
Resumes the execution of a saved VM
[ { "docid": "ee6d06df0dcd236bbf91be7ffce2257a", "score": "0.7115301", "text": "def resume\n action('resume')\n end", "title": "" } ]
[ { "docid": "b2b6e5634878eebda5339b58566bd050", "score": "0.81885695", "text": "def resume\n @vm.resume\n end", "title": "" }, { "docid": "b598d8ca2fd2e65267f5a09608a396b2", "score": "0.8065212", "text": "def resume\n execute(:resume_vm, VmId: vm_id)\n en...
fe99a4e07c0d3b788472f4f7d462cbf2
Adds the given speicmen array type to the set of types which can be held.
[ { "docid": "e30eab9ba28a43b6c10922642ef43d5d", "score": "0.76227015", "text": "def add_specimen_array_type(type)\n storage_types << type\n end", "title": "" } ]
[ { "docid": "a54c60044782fb65418bc44e1a3003f3", "score": "0.7341587", "text": "def add_specimen_array_type(type)\n child_specimen_array_types << type\n end", "title": "" }, { "docid": "9a0c4f7ab5f9da316adefdda7adde563", "score": "0.6867929", "text": "def add(*types); end", ...
bd92aa0a0b60ed727603d714d717bb77
PATCH/PUT /rushes/1 PATCH/PUT /rushes/1.json
[ { "docid": "cfe8d5d9f0fd2482502f076554fa5899", "score": "0.0", "text": "def update\n respond_to do |format|\n if @rush.update(rush_params)\n format.html { redirect_to @rush, notice: 'Rush was successfully updated.' }\n format.json { render :show, status: :ok, location: @rush }\n ...
[ { "docid": "d5eaea298e64625a71a15a970f3b75ed", "score": "0.62340236", "text": "def patch *args\n make_request :patch, *args\n end", "title": "" }, { "docid": "42e4d81ce0f91ce996dcbc347df2958d", "score": "0.6063284", "text": "def update\n @response = self.class.put(\"#{@server_...
f9685cc9736521ea81ea74905f2fdd2a
Returns HalClient::Representation of the provided jsonish thing. jsonish A HAL document (as a string or preparsed hash) or an object that can be converted into one via its `to_hal` or `to_json` methods.
[ { "docid": "52b7ae5a590e0feb4f13cb707dd0309e", "score": "0.7608113", "text": "def parse(jsonish)\n json = if jsonish.kind_of? String\n jsonish\n\n elsif jsonish.respond_to? :to_hal\n jsonish.to_hal\n\n else jsonish.respond_to? ...
[ { "docid": "ed40004c05657b187b393de6b201464a", "score": "0.62288535", "text": "def json thing\n content_type :json, charset: \"utf-8\"\n jsonify thing\n end", "title": "" }, { "docid": "b79471db6901f867ca40c3b46dab44e3", "score": "0.5853826", "text": "def fro...
995b471ae34b30ff111a440039476df6
Sets the query component for this URI from a Hash object. This method produces a query string using the :subscript notation. An empty Hash will result in a nil query.
[ { "docid": "0a197e395b84f3fd151097c25d54b307", "score": "0.0", "text": "def values_to_query(new_query_values, options = T.unsafe(nil)); end", "title": "" } ]
[ { "docid": "c04e0dd575f46d68ab4167ca524a9194", "score": "0.6654317", "text": "def to_query(hash)\n hash.inject([]) do |params, (k, v)|\n params << \"#{k}=#{v}\"\n params\n end.join(\"&\")\n end", "title": "" }, { "docid": "c7f8436c19255721b477fe1be0375d14...
c9eae6f75795c1278c42a437492a1b2c
Perform HTTP POST Request
[ { "docid": "16fdf8af49c4ce33055d42d2ca830951", "score": "0.0", "text": "def post(path, params = {})\n request(:post , path, params)\n end", "title": "" } ]
[ { "docid": "5c1ec63530305c389abd6a59bdde167a", "score": "0.79667974", "text": "def submit_post_request(url, params = {}, https = false)\n HTTP.post(url, params, https).body\n end", "title": "" }, { "docid": "adbd4063f9795c23205a346f6dfd3f22", "score": "0.7772901", "text": "def po...
41303df78499b251ddd6b2893ca40796
Internal: Set the current request_id. Examples RequestId.request_id = SecureRandom.hex => "2297456c027c536d0eb3eb86583fe5a9" Returns the new String request id.
[ { "docid": "7352102f5c8d367f4a27cbe55c6710bb", "score": "0.7351741", "text": "def request_id=(request_id)\n set(:request_id, request_id)\n end", "title": "" } ]
[ { "docid": "272c74c3e98545a2b0ab3139f5975fc2", "score": "0.7832241", "text": "def request_id=(value)\n @request_id = value\n end", "title": "" }, { "docid": "272c74c3e98545a2b0ab3139f5975fc2", "score": "0.7832241", "text": "def request_id=(value)\n ...
760262e062e76f23684ffcff8b861a75
Putting items in cart
[ { "docid": "49d465a6467d3f76349fe52df713cb15", "score": "0.6760925", "text": "def add_item\n if params[:product_id] != nil\n if session[:cart_id] == nil\n session[:cart_id] = Cart.create(status: \"open\").id\n @cart_total = 0.0\n end\n\n ordered_item = OrderedItem.find_by...
[ { "docid": "5ca65bceff14d0316c61652230d791c7", "score": "0.78064346", "text": "def add_item_to_cart(item_id)\n cart << item_id\n end", "title": "" }, { "docid": "5ca65bceff14d0316c61652230d791c7", "score": "0.78064346", "text": "def add_item_to_cart(item_id)\n cart << item_id\...
fd81ef9b96dd779189e7da2f0b00421d
Metodo para multiplicacion dos matrices
[ { "docid": "8f0f8409826e397c8edf8886ea5be60e", "score": "0.0", "text": "def porf(other)\n\t\t\tif ((@nfil != other.ncol) || (@ncol != other.nfil))\n\t\t\t\tputs \"No se pueden multiplicarr las matrices\"\n\t\t\telse\n\t\t\t\telemento = Array.new(0)\n\t\t\t\tfor i in 0...nfil\n\t\t\t\t\tfila = Array.new(...
[ { "docid": "96f50a29e339f8ccf86dd0bbe8c2e3f2", "score": "0.74588287", "text": "def mult(a)\n c=Matriz.new(@n,@m,[0,0],[0,0])\n for i in 0...@n do\n for j in 0...@m do\n c.A[i][j]=@A[i][j]*a\n end\n end\n c\n end", "title": "" }, { "docid": "ed8845f461394343c7bcd...
e0fd79399dd23b5c7b7c8683c529f31a
Candidate languages = ["C++", "Hack"]
[ { "docid": "75b0cb353cfb6cd9a35e15c839066cff", "score": "0.0", "text": "def test_hh_by_heuristics\n assert_heuristics({\n \"Hack\" => all_fixtures(\"Hack\", \"*.hh\"),\n })\n end", "title": "" } ]
[ { "docid": "0e86f3e647e0e319bdeaebc7f7382c7d", "score": "0.75003135", "text": "def languages?(candidate)\n candidate[:languages].include? 'Python' || 'Ruby'\nend", "title": "" }, { "docid": "9ee0dcdaa7c68550707122ecbb3c6d83", "score": "0.7190429", "text": "def languages; end", "...
a164d76eb59fc72a2220a3c657e64b0e
Funcion pop que devuelve el valor de la cabecera y la elimina de la lista
[ { "docid": "245bd5e9e2ed3cf07ced9c0b99a1f637", "score": "0.7523999", "text": "def pop\n \tif(@cabecera!=nil)\n \tnode = @cabecera\n \t@cabecera = @cabecera.prev\n if(@cabecera!=nil)\n @cabecera.siguiente = nil\n node.prev= nil\n else @cola = nil\n end\n \treturn node.valor\n \tend\n e...
[ { "docid": "dfceffaf80716aeac4b0bbca716847ee", "score": "0.7365019", "text": "def pop\n if @numeroNodos == 1 then\n @cabeza = nil\n @cola = nil\n else\n @cabeza = @cabeza.next\n end\n @numeroNodos = @numeroNodos - 1\n end", "title": "" }, { "docid"...
b33e8ba043dc6a77b4423b3af67ae194
Builds the object from hash
[ { "docid": "6740e885eb5944bdb4f239167790d9dc", "score": "0.0", "text": "def build_from_hash(attributes)\n return nil unless attributes.is_a?(Hash)\n self.class.swagger_types.each_pair do |key, type|\n if type =~ /\\AArray<(.*)>/i\n # check to ensure the input is an array given ...
[ { "docid": "da5b02ceb9bf503ea3a6f61c2d096a77", "score": "0.8011074", "text": "def build(hash)\n obj = new\n hash.each_pair do |k,v|\n obj[k] = v if variables[k]\n end\n return obj\n end", "title": "" }, { "docid": "795e2d6be19d924e231b866fbebec323", ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "25ae3561c6e7a0c5bcab795c5bed764f", "score": "0.0", "text": "def set_resume\n @resume = Resume.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...
da5f8f868662a8e193addb7f43d0e0ff
Constructs an instance of Pendragon::Recognizer
[ { "docid": "bbee73313e5a9b31c486ae6c3cae843d", "score": "0.0", "text": "def initialize(routes)\n @routes = routes\n end", "title": "" } ]
[ { "docid": "9c705b284f683030b417c90b7b4837d7", "score": "0.63306063", "text": "def set_Recognizer\n @Recognizer = Recognizer.find(params[:id])\n end", "title": "" }, { "docid": "d0dfaca603226c16a0ac8436bad4a978", "score": "0.59193355", "text": "def recognizer=(recognizer)...
26b9c57995494e7ef0b97aadad9d5a5b
Metodo que anida el menu de la opcion 2 del menu principal
[ { "docid": "d3bd0c9e5a0ea83ce6db6b933d940cf5", "score": "0.0", "text": "def mostrar\n loop do\n puts \"a - Listar mujeres\"\n puts \"b - Listar hombres.\"\n puts \"c - Listar mayores de 20 años.\"\n puts \"d - Listar menores o igual a 20 años.\"\n puts \"r - Regresar al menu principal\"\...
[ { "docid": "ae720af357ce3809866f4492d121d2a9", "score": "0.75202996", "text": "def menu\n\n end", "title": "" }, { "docid": "c9e6df62a165a56ec2277e67a7957bd3", "score": "0.7495746", "text": "def menu\n\tend", "title": "" }, { "docid": "fda1b3ee490ad78d3076d1d08375a312"...
40bfd464f43dd015739803b1169b1f5c
Returns all linked CSS files concatenated as string.
[ { "docid": "e0f7e77f670badcf054972302eecfe55", "score": "0.62112254", "text": "def css_for_doc(doc)\n urls = css_urls_in_doc(doc)\n urls.map { |url| load_css(url).force_encoding('UTF-8') }.join(\"\\n\")\n end", "title": "" } ]
[ { "docid": "2beae0e99d534d2ff9e834c60d125f30", "score": "0.7708412", "text": "def linked_css_files\n @_linked_css_files ||= @doc.search('link[@type=\"text/css\"]').collect do |l|\n href = l.attributes['href']\n if href.include? '?'\n href[0..(href.index('?') - 1)]\n el...
878d27975ebb356b7dd82d1622e04bf3
Ensure user account is active
[ { "docid": "33cb0c7cb13b4f8df7e167fec70162f0", "score": "0.0", "text": "def active_for_authentication? \n super && !deleted_at \n end", "title": "" } ]
[ { "docid": "645b5be9fd22302a28e8e64a0ac2e825", "score": "0.7568951", "text": "def user_active!\n \t\tif current_user && current_user.active == false\n \t\t\tsign_out current_user\n \t\t\tredirect_to new_user_session_path, notice:\"You don't have permissions.\"\n \t\tend\n end", "title": "" }, {...
28d53da934cb77a5a2f81ded69307569
Initialize with a JsonApiClient::ResultSet or a Resource
[ { "docid": "7564c5bf2de63df8d4d90f6da23a3fec", "score": "0.0", "text": "def initialize(result)\n # @env is used in base class JsonApiClient::Errors::Error\n @env = result\n @errors = result.errors || []\n end", "title": "" } ]
[ { "docid": "dcd4675521c11c475949dedb7e197752", "score": "0.6291073", "text": "def initialize response_data, resource\n # For some endpoints we'll get a hash with `paging` and `data` attributes.\n # For others, just an array.\n if response_data.is_a? Hash\n if response_data....
060e3576e290d00b3f995bc15a47a606
take the following reference arguments :reference_identifier usually from paper :data_export_identifier data export :common_namespace maping to a common vocab :common_identifier maping to a common vocab Use the :data_export_identified key to store chosen variable names for questions and values for answers.
[ { "docid": "e8c0cffb79e88e8fbba6b5b3cbddbdf7", "score": "0.49519527", "text": "def _q_y_n_dk(title,options={})\n\tq title, options.merge(:pick => :one)\n\ta_1 \"1 = Yes\", :data_export_identifier => 1\n\ta_2 \"2 = No\", :data_export_identifier => 2\n\ta_999 \"9 = Don't know\", :da...
[ { "docid": "399359aaa55ac0115b2329030062cc75", "score": "0.5197864", "text": "def reference\n \t\"#{Question::BOOKS[book]} #{chapter}:#{verse}\"\n end", "title": "" }, { "docid": "379897ee25264e5bd2c344cd8e0d82ff", "score": "0.5174369", "text": "def reference(key = nil)\n re...
92a06450593826bdf490778072cc3cc9
GET /occupants/new GET /occupants/new.json
[ { "docid": "1e4e9a29e2301eef94db6a956459ce78", "score": "0.7286588", "text": "def new\n @occupant = Occupant.new\n @event = Event.find(params[:event_id])\n user = params[:user_id] ? User.find(params[:user_id]) : @current_user\n @occupant.user = user\n @occupant.status = \"Confirmed\" # se...
[ { "docid": "0e1e48365c8b98cda5bc8d6c56c23ba6", "score": "0.81231683", "text": "def new\n @occupant = Occupant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @occupant }\n end\n end", "title": "" }, { "docid": "3a8d89822f10228f2c9e...