query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
f62315e3990262e4eeaa31c93ff44840
Throws a formatted 406 Not Acceptable error response.
[ { "docid": "562973b21300460753492e52d3c496cd", "score": "0.0", "text": "def not_acceptable! message = nil, **data\n @format ||= config[:formats].first\n media_types = Util.media_types config[:formats]\n error! :not_acceptable, message, data.merge(accepts: media_types)\n end", "titl...
[ { "docid": "7418391e516f99c2f1bf29212f2a76fa", "score": "0.81971174", "text": "def not_acceptable\n head :status => 406\n end", "title": "" }, { "docid": "afb18af12ab4c950863d71bd4c3cf2fc", "score": "0.74138063", "text": "def assert_not_acceptable\n assert_status...
b3ee844f12e004f4001ddfb6c68aab5c
definicion del metodo coerce para racional
[ { "docid": "44d9a4bb0fbc49a067500af6a625c2e9", "score": "0.57853574", "text": "def coerce(other)\n if Integer === other\n\t [Fraccion.new(other,1), self]\n end\n end", "title": "" } ]
[ { "docid": "b23687fecc48963187e6a2478d3db025", "score": "0.7862487", "text": "def coerce\n end", "title": "" }, { "docid": "856ab34578f74eba6a7b819ef4830c4d", "score": "0.7039925", "text": "def coerce(*args)\n self.class.coerce(*args)\n end", "title": "" }, { "do...
84f244ffbed7dec15bfa0f63d76acd71
Overrides delete assignment with mongohash metadata
[ { "docid": "ba4241e1f38ae0c6c8a70cd45f3266ca", "score": "0.0", "text": "def delete(key, mark = true)\n if mark == true\n @delete_keys << key\n end\n super(key)\n end", "title": "" } ]
[ { "docid": "45a3b6b24ab908a5f5a9e269925749cd", "score": "0.6651351", "text": "def delete\n self.replace('_id'=> self['_id'], '_rev'=> self['_rev'], '_deleted'=> true)\n end", "title": "" }, { "docid": "469386d9adad2da444cf7e98a157d6f8", "score": "0.6547326", "text": "def delete(c...
c41667cce73ad293725f36d7fd499f46
PATCH/PUT /player_score_matches/1 PATCH/PUT /player_score_matches/1.json
[ { "docid": "89981e681208c1e443e92252a2aadefd", "score": "0.76608247", "text": "def update\n respond_to do |format|\n if @player_score_match.update(player_score_match_params)\n format.html { redirect_to @player_score_match, notice: 'Player score match was successfully updated.' }\n ...
[ { "docid": "4d497622068218c20daf4d66a9df35f5", "score": "0.7553513", "text": "def update\n request_params = match_scoreboard_params\n action = request_params[:action].to_sym\n version = request_params[:version]\n team_id = request_params[:team]\n player_id = request_params[:player] unless...
f7650d62db84d8d87579d1a413cc64fa
Creates a Deferred object which represents a task which will finish in the future.
[ { "docid": "068139613ba6ae73fbab77cda49e7592", "score": "0.6713352", "text": "def defer\r\n\t\t\treturn Deferred.new\r\n\t\tend", "title": "" } ]
[ { "docid": "dda2d2a9e429298175348f6f5a41b7a2", "score": "0.61349446", "text": "def promise\r\n\t\t\t\tDeferredPromise.new( self )\r\n\t\t\tend", "title": "" }, { "docid": "7cd583c1c1177974581c5d9489e5a108", "score": "0.5949159", "text": "def defer\n deferred = Deferred.new\n yi...
234c1e325c8c722cd31329f48914c170
Adds additional words(chains of vertexes) to the trie object Argument should be array of words Example: >> tss.extend_dictionary(["our", "it", "them"])
[ { "docid": "db843d8713d25ddabb002344fe40ee1e", "score": "0.72791743", "text": "def extend_dictionary(dict)\n @trie_instance.extend_dictionary(dict)\n end", "title": "" } ]
[ { "docid": "bb1e6521bc4c21adf17f134b4a936cf9", "score": "0.6660387", "text": "def add(word)\n if word == \"\"\n @word_end = true\n else\n if @chars[word[0]] == nil\n # Add new letter and recursively\n # add substring\n @chars[word[0]] =\n DictionaryTrie.new...
a330fd126cfb7a15dbaa9e2db4772ee6
The age of the oldest record in QUEUED state, in seconds
[ { "docid": "54722f2a8d41412352cbb03f84be9195", "score": "0.6733097", "text": "def queued_max_age\n max_age = 0\n \n @collection.find(status: 'QUEUED').each do |item|\n age = Time.now - item[\"queue_time\"]\n if age > max_age\n max_age = age\n en...
[ { "docid": "b9bad4deb15a99478691ad172f7b0886", "score": "0.79166055", "text": "def oldest_age\n now = Time.now\n age = nil\n self.each_value do |r|\n seconds = (now - r.receive_time).to_i\n age = seconds if age.nil? || seconds > age\n end\n age\n ...
75b5b4c9dedcbd108651b4fb9831f173
return an array of dates segmenting regions of dates.
[ { "docid": "a7228bd5b317214549bf8e73a761fa99", "score": "0.7474669", "text": "def date_regions\n times = eventdates.collect{|dt| [dt.startdate, dt.enddate]}.flatten().uniq().sort();\n dates = eventdates().sort_by{|k| k.startdate};\n\n contents = [];\n working_set = [];\n headers = [];\n\n...
[ { "docid": "14622224e2454f0ce6f5107b8a20feff", "score": "0.76393926", "text": "def dates_array\n start_date = self.start_date.to_date\n end_date = self.end_date.to_date\n array = Array.new\n return array if end_date<start_date\n (start_date..end_date).each do |i|\n array << i if self...
542471f3a457d2f7de9feba62b3e70c6
Create a new IfNode node. source://syntax_tree//lib/syntax_tree/dsl.rb481
[ { "docid": "bd2da01fe55da2e5ecb783f76f7e766b", "score": "0.66211796", "text": "def IfNode(predicate, statements, consequent); end", "title": "" } ]
[ { "docid": "da095376aacdfe1ec3fc76677ea8fee8", "score": "0.79576933", "text": "def if_node; end", "title": "" }, { "docid": "d671731233ada5e19ea8e280f6e404a5", "score": "0.7432235", "text": "def if_\n\t\tnext_if(:keyword, 'if') or return\n\t\tcond = expression or raise 'missing condi...
859c5fdeb88b762010972130c3ff2a21
Clean up after this actor
[ { "docid": "0afc1387dc830a6f85f1229ad056cc43", "score": "0.0", "text": "def cleanup(exit_event)\n # !!! DO NOT INTRODUCE ADDITIONAL GLOBAL VARIABLES !!!\n # rubocop:disable Style/GlobalVars\n Celluloid::Probe.actor_died(self) if $CELLULOID_MONITORING\n # rubocop:enable Style/GlobalVa...
[ { "docid": "f2aa224c173ae8631d065a2c78228e0f", "score": "0.7505661", "text": "def cleanup\n end", "title": "" }, { "docid": "f2aa224c173ae8631d065a2c78228e0f", "score": "0.7505661", "text": "def cleanup\n end", "title": "" }, { "docid": "caaa82b911d260b8ef5500f5...
2316edd09c3aecdaeff54702c279ee64
chaining for dsllike language
[ { "docid": "d5b8221021da11e762afbf738d748920", "score": "0.0", "text": "def is?(other = nil)\n if other\n RubyVersion == other\n else\n RubyVersion\n end\n end", "title": "" } ]
[ { "docid": "3d7bcf1899671a0fb6f321fdece19364", "score": "0.61298364", "text": "def dsl_eval(dsl, *args, **_arg2, &block); end", "title": "" }, { "docid": "1ca22f356daeffbd99ea5cef8df98b85", "score": "0.5762688", "text": "def rb!\n # -> uncomment the next line to manually enable ...
64d951204ae28df955147b4e831979ec
Merges the vertices and faces of the given other mesh(es) into this one
[ { "docid": "c6c38753d23a28bf82aff8032d752030", "score": "0.54910976", "text": "def boundary_merge! *other_meshes\n other_meshes = [*other_meshes].flatten\n \n other_meshes.each do |variable|\n \n \n \n end\n \n \n end", "title": "" } ]
[ { "docid": "ca5bae9acbd2166258154be74f7b2150", "score": "0.6339015", "text": "def merge_vertices!( *args )\n # create a list of vertices we want to merge\n mergeV = []\n if args[0].class == Array\n mergeV = args[0]\n else\n mergeV << args[0] << args[1]\n end\n\n ...
6668bb1feaae33891ddb058e167cf959
GET /stacks GET /stacks.json
[ { "docid": "e4fd27a963faf005da56e1c4d4a92103", "score": "0.7464895", "text": "def index\n @stacks = Stack.all\n end", "title": "" } ]
[ { "docid": "0c4d2b3214227c342df2eaaa162441e7", "score": "0.861252", "text": "def stacks\n response = OpenStack::Heat::Connection.heat_conn.req('GET', '/stacks')\n stacks_hash = JSON.parse(response.body)[\"stacks\"]\n stacks_hash.inject([]){|res, current| res << OpenStack::Heat...
6dea385e624a1d8ae7c9e22a088a24ac
returns the date the user joined on
[ { "docid": "8b4853cb016b7f3c970969651881b8d6", "score": "0.67801756", "text": "def get_poster_join_date\n if self.member\n self.member.created_at.to_s(:long)\n else\n \"n/a\"\n end\n end", "title": "" } ]
[ { "docid": "56cf45f64edebad323199f9d01306947", "score": "0.7092278", "text": "def join_date\n self.created_at.strftime(\"%B %d, %Y\")\n end", "title": "" }, { "docid": "4a036b15ecda8a8d813852696f409e12", "score": "0.70842963", "text": "def find_my_join_date(db, first_name, last_n...
5138bc0fecf90a7204c8555625b5fac8
Add role on the object to specified subject.
[ { "docid": "b3bbcad8d128b9476220aa67d099ae8c", "score": "0.64621866", "text": "def accepts_role!(role_name, subject)\n subject.has_role! role_name, self\n end", "title": "" } ]
[ { "docid": "48e53e14111f25b8109e5906b52b5191", "score": "0.6827437", "text": "def add_role(role)\n return nil if self.roles.include? role\n self.roles << role\n role\n end", "title": "" }, { "docid": "aa4f11391bb4a713e0c8da0faf11d66f", "score": "0.68083143", "text": "def ad...
0647fa11a8d6d0b2302b3590b54e43e5
use in case of using GCa i.o ami_annotations
[ { "docid": "ae78ab45e8cf4501e4791a1cbdef3be0", "score": "0.0", "text": "def has_interfaces_ami_candidates\n match_members { |m|\n member_is_ami_candidate(m)\n }\n end", "title": "" } ]
[ { "docid": "d7d962a997306a2d5bad6c2a9bfaf11d", "score": "0.753183", "text": "def annotation; end", "title": "" }, { "docid": "d7d962a997306a2d5bad6c2a9bfaf11d", "score": "0.753183", "text": "def annotation; end", "title": "" }, { "docid": "d7d962a997306a2d5bad6c2a9bfaf11d...
4d8e6a6b182d2bef38b95d4f8cb957ae
Get the property type (:line or :match) of a property instance
[ { "docid": "4dc23570f4b6fa93a8f422b4956d8307", "score": "0.8093925", "text": "def property_type(property)\n klass = property.class\n if klass.constants.include?(:COLOR_PROPERTY_TYPE) && klass::COLOR_PROPERTY_TYPE == :match\n :match\n else\n :line\n end\n ...
[ { "docid": "5e0831b5aa0dcc049e72774c2299e7dc", "score": "0.72656673", "text": "def property_type(property, value)\n unless property.fields.blank?\n return 'PROPERTY_SET_DEFINITION'\n end\n\n if property.type.to_s=='STRING' && value && value.include?('\\n')\n return 'TEXT'\n end\n\n...
2836486c20aaef9f30b75c333fc5f53a
summary: The requested images that the thing type supports. returns: a HealthVault::WCData::Methods::Response::GetThingType::Image Array
[ { "docid": "3c63a9b27be3a2e48779d4168f8a907b", "score": "0.0", "text": "def image\n return @children['image'][:value]\n end", "title": "" } ]
[ { "docid": "cd330413619a0a144987c6cf7eecfbf1", "score": "0.6966148", "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'] ...
1cc16be6557d94a0f6d295093957f624
Provide a user friendly representation source://twilioruby//lib/twilioruby/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.rb253
[ { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.0", "text": "def to_s; end", "title": "" } ]
[ { "docid": "cae289bb30bf28df62133b4fdb5fd616", "score": "0.72544676", "text": "def inspect\n \"<Twilio.Numbers.V2.BundleCopyInstance>\"\n end", "title": "" }, { "docid": "8b0f94e3b6cb97a6d4f4f3d9291de239", "score": "0.7132994", "text": "def to_s\n ...
82fd6cb614e5f838d0c21dde5face0b5
POST /tbl_banners POST /tbl_banners.json
[ { "docid": "d8c9cd6ee5e5b4fcf9a1df52d6a599bc", "score": "0.60931045", "text": "def create\n @tbl_banner = TblBanner.new(tbl_banner_params)\n\n respond_to do |format|\n if @tbl_banner.save\n format.html { redirect_to @tbl_banner, notice: 'Tbl banner was successfully created.' }\n\n ...
[ { "docid": "d145bf9766b8d434c82ea321bc0b7b77", "score": "0.6608013", "text": "def create\n @tbl_page_banner = TblPageBanner.new(tbl_page_banner_params)\n\n respond_to do |format|\n if @tbl_page_banner.save\n format.html { redirect_to @tbl_page_banner, notice: 'Tbl page banner was succe...
0b06f170016f1002b569626f1f4050ee
PATCH/PUT /sold_tickets/1 PATCH/PUT /sold_tickets/1.json
[ { "docid": "31d5f48b95a2c18eb994cddf2fde6cf0", "score": "0.72800624", "text": "def update\n respond_to do |format|\n if @sold_ticket.update(sold_ticket_params)\n format.html { redirect_to @sold_ticket, notice: 'Sold ticket was successfully updated.' }\n format.json { render :show, ...
[ { "docid": "f428de7e796d0a27fd38e8d1a64f1e4c", "score": "0.72060317", "text": "def UpdateTicket params = {}\n \n APICall(path: 'tickets.json',method: 'PUT',payload: params.to_json)\n \n end", "title": "" }, { "docid": "ba1b67b26375fdda775726f54fe1beb9", "score":...
805b9477dacc09b1d536d0a1d68038d4
Type : 1Normal Update 2Forcefully Update
[ { "docid": "f6fb25a119f35badd453b97ae924c609", "score": "0.0", "text": "def app_update\n \tapi_detail = ApiDetail.find_by(api_version: 'v1-merchant', device_type: 0)\n render_success(api_detail_result(api_detail)) \n end", "title": "" } ]
[ { "docid": "a65e74a2b3da92b85933622e396b4a7f", "score": "0.68193644", "text": "def update;end", "title": "" }, { "docid": "0ab46813cc857ab79ac0632093b8f55a", "score": "0.6781335", "text": "def update\n\t\t# Left empty intentionally.\n\tend", "title": "" }, { "docid": "8f7...
b8e15e8c391199c0bdcfa608f060f5ea
Try to establish a connection to a ts3 server.
[ { "docid": "73bdb478c9ef9b9891284f7d55740395", "score": "0.0", "text": "def start\n begin\n @query.connect\n rescue Exception => e\n puts \"#{e}. Could not connect to Teamspeak server. No server is running or you provided incorrect login data in your config/ENV vars.\"\n exit(1)\n ...
[ { "docid": "5077d5c5688355b3e57f593122dc2ffb", "score": "0.6563345", "text": "def connect_to_ev3\n EV3.logger.info(\"Connecting to EV3 on TCP Port #{@port}\") unless EV3.logger.nil?\n @tcp_socket = TCPSocket.new(@ev3_address, @port)\n @tcp_socket.send(\"GET /target?sn=#{@serial_numb...
62e0ff279558d02920260504537371df
Asserts that the provided options can be used to generate the provided path.
[ { "docid": "1c5f42ced717c0d6fbc1bbc6b300af63", "score": "0.6594812", "text": "def assert_generates(expected_path, options, defaults={}, extras = {}, message=nil)\n clean_backtrace do \n expected_path = \"/#{expected_path}\" unless expected_path[0] == ?/\n # Load routes.rb if it ...
[ { "docid": "8d6b3f6cca363d97bf8445b547122fc0", "score": "0.72945714", "text": "def assert_valid_options\n valid_options = {\n skip_gemfile: false,\n skip_bundle: false,\n skip_git: false\n }\n valid_options.each do |key, expected|\n next unless options.key?(key)\n actual = options[key]...
e259e89326a2a7bcf0ec9bdfed618c36
If this node is a successive character then add it as is. First child being a spaceonly text node will not be added because there is no previous characters.
[ { "docid": "2c882505c9a5efbc5ef8753dd56fb532", "score": "0.5460357", "text": "def characters(string)\n last = stack.last\n if last and last.children.last.is_a?(String) or string.strip.size > 0\n last.add_node(string)\n end\n end", "title": "" } ]
[ { "docid": "c94c1142b5367d6f72f584b675007383", "score": "0.70479864", "text": "def characters(text)\n node = @current_node.children.last\n if node and node.text?\n node.content += text\n else\n @current_node.add_child(Nokogiri::XML::Text.new(text, @document))\n end\n ...
a8becafbb4d0767fbd842030632418b1
GET /admin/events GET /admin/events.json
[ { "docid": "e0b2d22944751d574edf9fe62baa0c29", "score": "0.0", "text": "def index\n comp_name = params[:comp_name]\n @comps = Competition.select(:id, :name).order('created_at desc')\n events = Event.includes(:parent_event).joins(:competition).order('competition_id desc,is_father desc, parent_id...
[ { "docid": "81502c8ae71bc9296e26548867a8eccf", "score": "0.8059011", "text": "def index\n @events = current_admin.events\n end", "title": "" }, { "docid": "ad6fb9588455cc60b878fd23aefadd44", "score": "0.7810888", "text": "def index # requires user\n render json: current_user...
ad6552956b7e551c33d3f0afa90c3084
Recursively searches for the +pattern+ yielding the matches.
[ { "docid": "ad8ec8040b3c81dc6f04338f204ae5b4", "score": "0.72038066", "text": "def search_each pattern, &block # TODO: rename to grep?\n raise ArgumentError, \"Needs a pattern\" unless pattern.kind_of? Matcher\n\n return enum_for(:search_each, pattern) unless block_given?\n\n if pattern.satisfy...
[ { "docid": "9e79f21276723052fe1e79a427f2312b", "score": "0.7725552", "text": "def search(pattern, node, *args)\n if (match = match?(pattern, node, *args))\n yield node, match if block_given?\n match != true ? [node, match] : [node]\n else\n node.each_child_node\n ...
2ad47699cfaad825531b0b91ffc5b516
char > integer INPUT: a letter [a, z] OUTPUT: the score for the letter as assigned in scrabble
[ { "docid": "00a3c585ce66d2f94994a19cb185b346", "score": "0.0", "text": "def letter_value(letter, tile_vals)\n\t\treturn tile_vals[letter]\n\tend", "title": "" } ]
[ { "docid": "ff51bb11cabe96062fbf761532f51e5e", "score": "0.8284796", "text": "def scrabble_score word\n scores = {\n 'a' => 1, 'e'=> 1, 'i' => 1, 'o' => 1, \n 'u' => 1, 'l' => 1, 'n' => 1, 'r' => 1,\n 's' => 1, 't' => 1, 'd' => 2, 'g' => 2, \n 'b' => 3, 'c' => 3, 'm' => 3,...
54109d203ec7d30572596319dfee57cf
determine_unit_commands : Checks what commands the unit can perform
[ { "docid": "ef179cbe99ff48777823797be51ca0dc", "score": "0.79895115", "text": "def determine_unit_commands\n commands = [] # Shall push all the commands into this variable\n \n # If the cursor is choosing a spot where a different unit exists (ignores hidden)\n other_unit = $game_map.get_unit...
[ { "docid": "4bf313ecc3c47c60ab6f7f1968939433", "score": "0.75106305", "text": "def determine_unit_commands(unit)\n commands = [] # Shall push all the commands into this variable\n \n ### If the cursor is choosing a spot where a different unit exists\n if !$game_map.get_unit(cursor.x, cursor....
c12f26ada3fd69c00486ef783ca758a2
Based on the algorithm provided by Daniel Rentz of OpenOffice.
[ { "docid": "79d430862a0cd41950a870ba938fbfa7", "score": "0.0", "text": "def password_hash(plaintext)\n return 0 if plaintext === \"\"\n hash = 0x0000\n plaintext.unpack('C*').each_with_index do |t, i|\n c = t << (i + 1)\n low_15 = c & 0x7fff\n high_15 = c & 0x7fff << 15\n hi...
[ { "docid": "79d89071eb3d2d9e5bd8700d04d01c45", "score": "0.53164333", "text": "def space_extents_illustrate(space)\n width = space.pages_per_extent\n puts\n puts \"%12s %-#{width}s \" % [\"\", center(space.name, width)]\n puts \"%12s ╭%-#{width}s╮\" % [\"Start Page\", \"─\" * width]\n\n identifier...
9e073db03a19c9613d498692c516c5fd
Override +type_cast+ we pass to mysql2 Date and Time objects instead of Strings since MySQL adapters are able to handle those classes more efficiently.
[ { "docid": "9c8e36afab35e2afc9f8acabb804d64a", "score": "0.6627714", "text": "def type_cast(value) # :nodoc:\n case value\n when ActiveSupport::TimeWithZone\n # We need to check explicitly for ActiveSupport::TimeWithZone because\n # we need to transform it to Time...
[ { "docid": "2d88a05bd3a81c0d30d9615ba3fa9840", "score": "0.72061235", "text": "def type_cast(value, column = nil)\n super\n end", "title": "" }, { "docid": "46f9ae9e71c44c03a1f81cfcce8fc8bc", "score": "0.71861553", "text": "def type_cast(value)\n ::ActiveRecord...
d36610b827bfd03f6811057ecb8ddae3
GET /twenties GET /twenties.json
[ { "docid": "cfe2ed80cbd9663e41805c6a9818e51a", "score": "0.67849153", "text": "def index\n @twenties = Twenty.all\n end", "title": "" } ]
[ { "docid": "f49eda85f5d1c8094c9331bde3f3d1a8", "score": "0.6633355", "text": "def index\n @specialties = Specialty.all\n\n render json: @specialties\n end", "title": "" }, { "docid": "cb2d563c1a88acb04c2c3fe9587b0d6c", "score": "0.6487623", "text": "def show_user_tweets\n @...
d0bd29134514407c63092d1dc9213abf
Indicate whether or not this standard is a substandard of another parent standard. TODO: Only works with TEKS, at the moment.
[ { "docid": "07c53b2080c5d6ac7fd9ec6611ca81d4", "score": "0.0", "text": "def substandard?\n key.include? '.'\n end", "title": "" } ]
[ { "docid": "ffb0ee15a8c78b52c86b7cd29041be52", "score": "0.63398546", "text": "def is_subtractive?\n @name.end_with?('-')\n end", "title": "" }, { "docid": "11808d8b8ac09d2fa4b977acbd8baaa7", "score": "0.6338543", "text": "def standard?\n self == standard\n end", "tit...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "a0c5d26de1c34552c6e17502dde681e6", "score": "0.0", "text": "def booking_params\n params.require(:booking).permit(:timeslot_id, :size)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
09c9d0b56b8d3c4d1b8a18e73dc692ee
update Executes the enemy behaviour according to the AI.
[ { "docid": "abd43120807802caf0d470f6b70032ea", "score": "0.7368545", "text": "def update\n # don't update if outside of ABSEAL range\n return unless self.update?\n # reset loop animation\n @loop_animation_id = 0\n # reset spriteset name\n @character_name = @character_name_org\n # up...
[ { "docid": "568a7232b35cdf6ec065a468dbb308b8", "score": "0.73197055", "text": "def update\n update_player # Checks and updates player related stuff\n for enemy in @enemies.values\n update_enemy(enemy) # Checks and updates enemy related stuff\n end\n update_status # Checks and ...
da0958d32496be2c3546aaf589fd3815
push element onto end of list
[ { "docid": "6069977df1cf39018e7d65d2f74ed1c7", "score": "0.0", "text": "def push(value)\n if @head\n tail.next_node = Node.new(value)\n else\n @head = Node.new(value)\n end\n end", "title": "" } ]
[ { "docid": "cf46a02038a308128cc8d41d696c66fd", "score": "0.7730277", "text": "def push(item)\n @list.unshift(item)\n end", "title": "" }, { "docid": "562915732f935c4b61832d50fe8434b9", "score": "0.7715395", "text": "def push(value)\n @list.unshift(value)\n\n self\n end", ...
54c6f93fe3957f52b3849b9d206ebcb4
rubocop:disable Metrics/CyclomaticComplexity rubocop:disable Metrics/PerceivedComplexity
[ { "docid": "99f0f9576c16c0ecf1ad7166279337f1", "score": "0.0", "text": "def make_me_match_border!(my_border, target)\n already_matching = @borders.select do |_, v|\n v == target || v.reverse == target\n end\n current = already_matching.keys.first\n\n img_save = @img\...
[ { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.6555258", "text": "def used; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.6555258", "text": "def used; end", "title": "" }, { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "sc...
7008a87bf6bfd7478cba70782d910bdf
Fetch all Room objects with boundaries Args : :status > HTTP status code :content > String to be returned
[ { "docid": "859beb03849d241358f2c04fca09de60", "score": "0.0", "text": "def render_error(http_status_code = params[:status], content = params[:content])\n if http_status_code.blank?\n http_status_code = 404\n end\n\n if content.blank?\n case http_status_code\n when 300\n ...
[ { "docid": "81b2757405d492c5f484ac4f05efce36", "score": "0.6465385", "text": "def index\n Rails.logger.info(\"fetching room details from #{@start_date} to #{@end_date}\")\n # @hotel.room_type_ids loads all the room type ids associated with hotel\n @room_details = RoomDetail.where(room_type_id: ...
e7d817645b4e789a5e89a1a41b2ea330
Pub/Sub works by sending all orphaned messages to this callback. It is simple and fast but not tolerant to programming errors. Subclass Redis and/or create a defensive layer if you need to.
[ { "docid": "cf24cf9932efac409ef5c94113543528", "score": "0.5016639", "text": "def pubsub_callback &block\n @pubsub_callback = block\n end", "title": "" } ]
[ { "docid": "e635ee9adaa1d893bb54b4d2fbd85771", "score": "0.60773474", "text": "def cleanup\n $redis.del key('chat')\n $redis.del key('messages')\n end", "title": "" }, { "docid": "041b7d82bdcf19d1187928e94496b1f0", "score": "0.58207166", "text": "def shutdown\n @pubsu...
f2bdde85968f3d406e7a987b27b88823
From for user to update password
[ { "docid": "6e4424f009518767d1196ddf617fe1f3", "score": "0.0", "text": "def edit\n redirect_to(new_session_path) unless user.matches_verification_token?(token)\n # render passwords/edit.html.erb\n end", "title": "" } ]
[ { "docid": "e49e81d7a5a569d3196e30708142225b", "score": "0.79836744", "text": "def edit_password; end", "title": "" }, { "docid": "ec7df7ec54176c4c398a5c3a3807c8b5", "score": "0.7727777", "text": "def update_with_password(params, *options); end", "title": "" }, { "docid":...
718e977181dcb8a06b0a15cd7f072e37
test if gold_found and silver_found are both not zero
[ { "docid": "ac3bc4149c24d8738adac26b7193743a", "score": "0.0", "text": "def test_string_results_neither_zero\n mock_loc = Minitest::Mock.new(\"mock_loc\")\n\tdef mock_loc.name;'Sutter Creek';end\n p = Prospector.new(0, mock_loc, 0)\n\tp.silver_found = 3\n\tp.gold_found = 3\n\tp.s = 's'\n\tp.sg = '...
[ { "docid": "d0f4955aee0e8ad28c889791cae1cb43", "score": "0.63770175", "text": "def check_and_set_gold\n @gold = 0 if @gold.negative?\n end", "title": "" }, { "docid": "fbb21512c2264cb0eb9c1791f7b85935", "score": "0.6338692", "text": "def test_leaving_first_3_false_silver_...
0b4d4bb994745e82292e35e612f07d24
Returns an ssh string as defined in RFC 4251
[ { "docid": "754f9d02b015b4eb9869ff4431bae929", "score": "0.6995621", "text": "def ssh_string(data)\n return [data.bytesize].pack(\"N\") + data\n end", "title": "" } ]
[ { "docid": "4a7579e8eaac866f93997a19bf2fd919", "score": "0.7980741", "text": "def ssh_string\n uri = ssh_url\n user = \"#{uri.userinfo}@\" if uri.userinfo\n port = \":#{uri.port}\" if uri.port\n [user,uri.host,port].join\n end", "title": "" }, { "docid": "fcd0707d31bf6f5d8e9f48c...
b5824e537f1fa098fa3da9d00eabc68e
Returns all referenced URLs in +file+. Returned paths are absolute (ie, they're resolved relative to the +file+ path.
[ { "docid": "118504e269439397343ae6437bbc9cfa", "score": "0.75491047", "text": "def urls(file)\n @contents = File.read(file) unless @contents\n\n @contents.scan(/url\\([\\s\"']*([^\\)\"'\\s]*)[\\s\"']*\\)/m).collect do |match|\n match.first\n end\n end", "title": "" } ]
[ { "docid": "034faa81f7445ef0c10dd7fa3366efb0", "score": "0.8076632", "text": "def urls(file)\n @contents = File.read(file) unless @contents\n\n @contents.scan(/url\\([\\s\"']*([^\\)\"'\\s]*)[\\s\"']*\\)/m).collect do |match|\n path_resolver.resolve(match.first)\n end\n end", ...
41c00ce39e9ec2daf9dc43d37bd36333
Download the results csv if it doesn't already exist
[ { "docid": "57817437fc1b03ec7e4accb1cca32c35", "score": "0.679749", "text": "def retrieve_results_csv(local_results_dir, server_dns = nil, analysis_id = nil)\n # Verify localResults directory\n unless File.basename(local_results_dir) == 'localResults'\n fail \"ERROR: input #{local_results_dir} does...
[ { "docid": "cecd27fb546934dca7d36aa10d7931be", "score": "0.66325915", "text": "def download_csv\n file_url = WhitelistApi.csv_exports\n redirect_to file_url\n end", "title": "" }, { "docid": "9689d4e2f3bdfa2d70cca002ceffff73", "score": "0.6531569", "text": "def download\...
662188357ee77295db64f655148e93ad
The total cost of the order
[ { "docid": "7edbf185bde4fa6516ee861fe89c3c36", "score": "0.8809007", "text": "def total_cost\n order.delivery_cost_price +\n order_items.inject(BigDecimal(0)) { |t, i| t + i.total_cost }\n end", "title": "" } ]
[ { "docid": "9ff1e1f36eab8e023235aec1f86fe68f", "score": "0.892536", "text": "def total_cost\n order_details.inject(0) { |sum, od| sum += od.total }\n end", "title": "" }, { "docid": "90f78908c7b13a3927077b1d3058b5cd", "score": "0.8771976", "text": "def total_cost\n self....
2b9e6601d1ee47c60d4ec3aeeb5b7569
=begin When saveing pay date convert it from user time to system time. unless it is nil then save it as it is. Only way to set pay date is when setting note to payd, so no one outside class(pay method) cannot set pay date, that is why this method is private Params +date+ =end
[ { "docid": "5273bb571fc155c6e325bad38b1d31eb", "score": "0.79557186", "text": "def pay_date= datetime\n if datetime\n datetime = User.current.system_time(datetime)\n end\n write_attribute(:pay_date, datetime)\n end", "title": "" } ]
[ { "docid": "6b816b4c05f01d6164cf6f2ab45f0b8c", "score": "0.7250889", "text": "def pay_date\n datetime = read_attribute(:pay_date)\n if datetime\n User.current.user_time(datetime)\n end\n end", "title": "" }, { "docid": "a85cf347026754f4c017f10f8d608202", "score": "0.711998...
e6e8aad09875d26fd01cc4c9983a9965
Allow simpler call when not caring about getting the actual acceptor
[ { "docid": "c65369f173811435fd566c2c870a3f38", "score": "0.53180933", "text": "def diagnostic_producer(acceptor=nil)\n acceptor.nil? ? super(Puppet::Pops::Validation::Acceptor.new) : super(acceptor)\n end", "title": "" } ]
[ { "docid": "5b5069be90b721299557cb200ad896b5", "score": "0.67121536", "text": "def sysaccept(*) end", "title": "" }, { "docid": "5b5069be90b721299557cb200ad896b5", "score": "0.67121536", "text": "def sysaccept(*) end", "title": "" }, { "docid": "5b5069be90b721299557cb200a...
b0a8187e3dc346cc37b062369df19580
This endpoint is deprecated.
[ { "docid": "dfc48d70fdd1cb2e6d3990fc1489ef1c", "score": "0.0", "text": "def get_user_cluster_logs_using_get_with_http_info(device_session_id, project_id, run_id, user_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TestResultsApi.get_user_clus...
[ { "docid": "77b0c109415e0f3e761fd3df7d4dff39", "score": "0.7556771", "text": "def deprecated; end", "title": "" }, { "docid": "77b0c109415e0f3e761fd3df7d4dff39", "score": "0.7556771", "text": "def deprecated; end", "title": "" }, { "docid": "77b0c109415e0f3e761fd3df7d4dff...
008fca82cc8ae59f001f69e2a2c2e219
puts " " puts " " puts ""
[ { "docid": "cec470c632f18c4d7bce2e95574d4f13", "score": "0.0", "text": "def staircase(n)\n i = n\n n.times do\n i-=1 \n puts \" \"*i+\"#\"*(n-i)\n end\nend", "title": "" } ]
[ { "docid": "6954c21ce22ac096c7727e773a3a70e3", "score": "0.7305416", "text": "def space1\n puts \"\"\nend", "title": "" }, { "docid": "09f97b8aaa7bea82d9317a57f5abcd52", "score": "0.710119", "text": "def space\n puts \" \"\n end", "title": "" }, { "docid": "dbd...
2342f5f86e19add831205c90829ad386
clearing column_types logic from here
[ { "docid": "a32c910e52150026239c833862705e0b", "score": "0.0", "text": "def find_by_sql(sql, binds = [], preparable: nil, &block)\n result_set = connection.select_all(sanitize_sql(sql), \"#{name} Load\", binds, preparable: preparable)\n column_types = {}\n message_bus = ActiveSuppor...
[ { "docid": "cd23d711b50106bf8259d776f2191031", "score": "0.7564343", "text": "def finalize_datatypes_for_csv\n csv_column_datatypes.map { |column_name, possible_datatypes|\n #If there is string type even atleast 1 there is no other option but to set the datatype to string => varchar\n ...
b505d71e2c65561cfb9dedd6c2a78241
an excel file is divided into many courses, each course is often offered for 2 semesters this function will count the number of semesters (which are the regions to be investigated later on)
[ { "docid": "05f6266ad3e296c151699e93fd706006", "score": "0.65232754", "text": "def recognize_semesters\n # recognize the subject code first\n @current_subject_code = ''\n @current_subject_name = ''\n semester_col = @subject_col + 1\n current_semester_row = @subject_row\n semester_regio...
[ { "docid": "90f5ee1070ed5a1bf8933878e88a1222", "score": "0.6516062", "text": "def recognize_course\n\t\t# ignore one row for title of column\n\t\tcurrent_subject_row = @subject_row + 1\n\t\tcourse_regions = []\n\t\tcurrent_cell_value = ''\n\t\t# dividing the region for the subjects by using semester col...
5f171934f0c66869e418719702925496
Complete the 'workbook' function below. The function is expected to return an INTEGER. The function accepts following parameters: 1. INTEGER n 2. INTEGER k 3. INTEGER_ARRAY arr
[ { "docid": "ce527f13cdc7ee434371ce85ce249de8", "score": "0.6191201", "text": "def workbook(n, k, arr)\r\n # Write your code here\r\n sp = 0\r\n count = 0\r\n arr.each do |range|\r\n remainingArray = Array(1..range)\r\n until (remainingArray.empty?)\r\n count += 1\r\n...
[ { "docid": "194e40d2f07e3981b8b47904a8ba3562", "score": "0.5441789", "text": "def get_multi_line_input_int_arr(original_filename)\n get_input_str_arr(original_filename).map(&:to_i)\nend", "title": "" }, { "docid": "a3fad6b344e8b9b8a2e077f1a9726a28", "score": "0.5422426", "text": "de...
855418ff6f32497d6e8cdf628468a222
remove_item(temp, "pizza") p temp
[ { "docid": "bb00c3a149d4ffabc25702584feb705a", "score": "0.0", "text": "def update_item(grocery_list, food_item, quantity)\n\tgrocery_list[food_item] = quantity\n\t#return grocery_list\nend", "title": "" } ]
[ { "docid": "3ecaa08fd224f1e4c85a5dcd11e94659", "score": "0.76112807", "text": "def remove_pizza(inventory, pizza)\t\t\n\tif inventory.has_ky?(pizza)\n\t\tinventory.delete(pizza)\n\telse\n\t\tputs \"This pizza doesn't exist\"\t\n\tend\nend", "title": "" }, { "docid": "6ebf7d4277b1be2e844a9bc3...
db2d7658b3c590b98aa50f6d0142d0e3
Get the created time. ==== Returns created time for the bug.
[ { "docid": "7b01a730f593802b88373954056f2ca3", "score": "0.7916234", "text": "def getCreatedTime\r\n\t\t\t\t\treturn @createdTime\r\n\t\t\t\tend", "title": "" } ]
[ { "docid": "1a5ed47735e7a743f52670b7c207ccc8", "score": "0.79228467", "text": "def created_time\n return @created_time\n end", "title": "" }, { "docid": "dd5bdf42735c2aa3473c321276a82cf2", "score": "0.7875789", "text": "def creation_time\n @creation_tim...
335dd13d86f0827e09016f2405e15516
:nodoc: Create a new edge in +graph+ from +from+ to +to+.
[ { "docid": "8ca1ec7d2005839b9841706e7edf700c", "score": "0.7123353", "text": "def initialize graph, from, to\n super graph\n self.from = from\n self.to = to\n end", "title": "" } ]
[ { "docid": "ca9b0e279a5767238bbe03fb51add613", "score": "0.7951158", "text": "def add_edge(from, to)\n e = Edge.new(from, to)\n return if @graph[from].find_index(e)\n @graph[from].push(e)\n @e += 1\n end", "title": "" }, { "docid": "b7f14a467d1d8eb284fc68696345...
ed176cf773bddce5227e1d5c392354cc
PATCH/PUT /holydays/1 PATCH/PUT /holydays/1.json
[ { "docid": "148499be43cc30a065040e45754f2f6c", "score": "0.7212917", "text": "def update\n respond_to do |format|\n if @holyday.update(holyday_params)\n format.html { redirect_to @holyday, notice: 'Holyday was successfully updated.' }\n format.json { head :no_content }\n else\...
[ { "docid": "ba06fd820f62b62604ce40e5dde2d05b", "score": "0.6966292", "text": "def update\n @hollyday = Hollyday.find(params[:id])\n\n respond_to do |format|\n if @hollyday.update_attributes(params[:hollyday])\n format.html { redirect_to @hollyday, :notice => 'Hollyday was successfully ...
7bfe26e190a9227490fff89a5c0bc6e2
recursively find the sum for a[idx] + a[idx+1] .. a[idx] + a[N] while the total is less than or equal to the seek value $size_to_count is modified based on seek matches
[ { "docid": "83a0f6ed584cac3dafa675ebfbbdb004", "score": "0.8586778", "text": "def find_sum(a, total, idx, seek, size)\n total += a[idx]\n size += 1\n if total == seek\n $size_to_count[size] ||= 0\n $size_to_count[size] += 1\n end\n return if total >= seek\n for i in (idx+1)..(a.size-1)\n ...
[ { "docid": "12119d899c7e5ffe3091da29d3da28df", "score": "0.8156531", "text": "def find_sum(a, total, idx, seek)\n sum = 0\n total += a[idx]\n sum += 1 if total == seek\n return sum if total >= seek\n for i in (idx+1)..(a.size-1)\n sum += find_sum(a, total, i, seek)\n end\n return sum\nend", ...
cc23a3f457f58bed518f61d5f653e7dc
Gets url from existing `data`.
[ { "docid": "cb5129fabe55b105cea80150eaf681b1", "score": "0.7546127", "text": "def url\n data[:url]\n end", "title": "" } ]
[ { "docid": "f8a83e574f39d2f0659c500217bfb54e", "score": "0.7630598", "text": "def data_url\n\t\tdata.url\n\tend", "title": "" }, { "docid": "48f1997013fb2a0f209d1f9b2c7781a1", "score": "0.7102985", "text": "def url(*args)\n self.data.url(*args)\n end", "title": "" }, { ...
44eaedd69e422b4987e87ba65f7d9907
Create card spending control
[ { "docid": "6f834137700415b9d69b1b94a8981347", "score": "0.5552606", "text": "def create_card_spending_control_using_post_with_http_info(request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CardApi.create_card_spending_control_using_post ...'\...
[ { "docid": "ea7f0f005acfb2ce124839f5b5c4d09c", "score": "0.58087254", "text": "def purchase_card(turn)\n own_money = turn.player.money\n keep_repeating = true\n while keep_repeating == true do\n keep_repeating = false \n @@cli.say \"Now it is time to purchase a card; you hav...
9e7cfae34cbd9587071ac244e6b3fbeb
Remembers a user in the database for use in persistent sessions.
[ { "docid": "bca35c7993389739562d684900f1cf1b", "score": "0.0", "text": "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "title": "" } ]
[ { "docid": "2851e427c467049c7639c468daea3c35", "score": "0.6720419", "text": "def reload_user\n @user = User.find(session[:user][:id])\n end", "title": "" }, { "docid": "96a75f37098f9b5db8b7c451f485268e", "score": "0.6603912", "text": "def check_new_or_reseted_user\n begin\n ...
0c91824b384c9c05050ef0ad4ed464a9
scan nodes by dfs; deeper to shallower; O(nodes)
[ { "docid": "c9fc0feaee57f755cfedac28bcc975b3", "score": "0.0", "text": "def dfs_tree_postorder(start, edges)\n require 'set'\n queue = [[start,nil]]\n visited = Set[start]\n bq = []\n while queue.size > 0\n f = queue.pop\n bq << f\n ts = edges[f[0]].keys.reject{ |t| visited.member?(t) }\n ...
[ { "docid": "643a52ddcadc2d2b4c7489a19453e0dc", "score": "0.68317086", "text": "def depth_first_search\n visited = {}\n timestamp = {}\n tree_edges = {}\n back_edges = {}\n cross_edges = {}\n forward_edges = {}\n count = 0\n\n # begin workaround removing depencency to order of Has...
de037bcd353801d815dae173467c82b3
Generate a unique API key
[ { "docid": "8b1484655662a65b1e215f67798dcbbf", "score": "0.830873", "text": "def generate_api_key\n loop do\n token = SecureRandom.base64.tr('+/=', 'Qrt')\n break token unless self.class.exists?(api_key: token)\n end\n end", "title": "" } ]
[ { "docid": "d76022407c5f25f0d85c8ae3475a7dce", "score": "0.9030417", "text": "def generate_api_key\n digest = Digest::SHA2.new(512)\n # generate a unique token\n unique_seed = SecureRandom.hex(20)\n digest.update(\"#{unique_seed} SECRET! #{Time.current.to_f}\").to_s\n end", "title": "" ...
2dd3be66247747fb80817e7cbc0b254d
Provides stylesheets to include with +stylesheet_link_tag+
[ { "docid": "d4f19cd7b1df12c0319f752859ee9f61", "score": "0.0", "text": "def active_scaffold_stylesheets(frontend = :default)\n [ActiveScaffold::Config::Core.asset_path(\"stylesheet.css\", frontend)]\n end", "title": "" } ]
[ { "docid": "8f8824f759dae6a46e79378c74ef45da", "score": "0.816837", "text": "def stylesheet *args\n content_for(:stylesheet) {stylesheet_link_tag(*args)}\n end", "title": "" }, { "docid": "b31e66e8be2401258f2e29a3cf672949", "score": "0.8160234", "text": "def stylesheet(*args)\n ...
61835c2199d07786e0ca50934f38c676
Description of the artist. Will fetch the information from Wikipedia. DEPRECATED! TODO: We should create a resource called "external_source" with all twitter/facebook/wikipedia/etc urls.
[ { "docid": "bd0be06c27742d6bddd486a4c3687ca2", "score": "0.0", "text": "def info\n\t\treturn \"\"\n\t\tp = localized_page\n\t\treturn \"\" unless p && p.content\n\t\tlogger.debug \"parsing page #{p.title}\"\n\t\t\t\n\t\t# extract the top-most section (the one before any ToC)\n\t\tc = WikiCloth::Parser.n...
[ { "docid": "c75e60ac37a37e941a4cb141a6958622", "score": "0.713922", "text": "def biography artist\n url = \"http://developer.echonest.com/api/v4/artist/biographies?api_key=#{ECHONEST_API_KEY}&name=#{artist}&format=json\"\nend", "title": "" }, { "docid": "cc625835bfd912aa073a59c72e71b5f7", ...
76ea4d0cb9f7271b4f2f28d790d89fcf
wrapper for setting system properties on the droplet from configuration keys
[ { "docid": "80e92e4e6298e03f4f19e3c18cfc7628", "score": "0.70951474", "text": "def add_system_property(system_property, config_key)\n return unless @configuration.key?(config_key)\n\n @droplet.java_opts.add_system_property(system_property, Shellwords.escape(@configuration[config_key]))\n ...
[ { "docid": "d763f9b4822da994a3844a1d6d219d17", "score": "0.69879895", "text": "def add_system_property_from_cfg_or_svc(svc, system_property, config_key)\n if @configuration.key?(config_key)\n @droplet.java_opts.add_system_property(system_property, Shellwords.escape(@configuration[config_...
d1a55c43b6b210c504616dcb1d923043
GET /user_inference_responses/new GET /user_inference_responses/new.json
[ { "docid": "b1ab3daf92dbfdd19db6553caeaf657f", "score": "0.81325", "text": "def new\n @user_inference_response = UserInferenceResponse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_inference_response }\n end\n end", "title": "" }...
[ { "docid": "c4e9259c34483e59f4113e1804458992", "score": "0.71375763", "text": "def create\n @user_inference_response = UserInferenceResponse.new(params[:user_inference_response])\n @user_inference_responses = UserInferenceResponse.find(:all, :conditions => [\"user_id = ?\", current_user.id])\n ...
143c4755ddd2bd6e8d8f4d4deeb5b6d6
That was just jibberish23232323223223323232323232323
[ { "docid": "402ecb851d676d3c4c3db53e4e241f15", "score": "0.0", "text": "def syncDevice()\n\t@driver.find_element(:uiautomator, \"new UiSelector().resourceId(\\\"com.zerion.apps.iform.appium:id/activity_form_list_action_sync\\\")\").click()\n@driver.manage.timeouts.implicit_wait = 60\n\t@driver.find_elem...
[ { "docid": "ac22279c9a108601f3f188cf0d450b6e", "score": "0.6031863", "text": "def str_compress\nend", "title": "" }, { "docid": "d7a3b31f594e0774707cc6f87e8bfa2b", "score": "0.59810627", "text": "def run_length_decode(string)\nend", "title": "" }, { "docid": "f01e3b43e9f2...
56c5050f8e77d803658c77dcf22a9de7
clicks the Rave homepage link
[ { "docid": "1f3716efddb3aace7927f3f2995d7b5d", "score": "0.7516493", "text": "def go_home\n self.homelink.click\n end", "title": "" } ]
[ { "docid": "9a6eea060650e5adbd137ec689305c8d", "score": "0.7450727", "text": "def click_view_website\n view_website_link.click\n end", "title": "" }, { "docid": "02e0667c615ff2f13bf701ab6ba76a5e", "score": "0.724242", "text": "def click(link); end", "title": "" }, { ...
2b5e69ec1c3a092a6f7ff191fdf3298e
checks if move is en passant; clears spot where enemy was, adds enemy to captured
[ { "docid": "b34ca7b1e92376628921773ea3657953", "score": "0.6587885", "text": "def process_en_passant(move)\n destination = move[1]\n piece = @positions[move[0].to_sym]\n col_as_num = piece.position[0].ord\n row = piece.position[1]\n right = \"#{(col_as_num+1).chr}#{row}\"\n left = \"#{...
[ { "docid": "dcd0393bcbfd55aff01189ca4a632514", "score": "0.7098045", "text": "def get_en_passant_capture(move)\n if move[:col] == @col then return nil end\n\n is_moving_to_blank = describe_location(move[:row], move[:col]) == :blank_space\n side_piece = @board.get_piece(@row, move[:col])\n is...
70b3646141194c23e9f94ee622fa3aaf
I worked on this challenge [by myself, with: ]. Your Solution Below
[ { "docid": "66d062eff8aaaeb33cc6a833c08f26bf", "score": "0.0", "text": "def add(num_1, num_2)\r\n #your code here\r\n \tp num_1 + num_2\r\nend", "title": "" } ]
[ { "docid": "aa89b26c8848588848ff622b5d313173", "score": "0.64728683", "text": "def solution\n 31875000\nend", "title": "" }, { "docid": "b9960478999684c2b536f76e22f6fc63", "score": "0.62877476", "text": "def solution4(input)\n end", "title": "" }, { "docid": "7a007b87...
efdffd69a6889904bfc24a00cd6c48d6
takes a string (search key word) as an argument
[ { "docid": "98cedc379f6e4a65c9b86fc4df991d61", "score": "0.0", "text": "def lease_break_url(string)\n\tformated_string = string.gsub(\" \", \"+\")\n\tCLURL + \"?\" + \"query=\" + formated_string\nend", "title": "" } ]
[ { "docid": "f683bd54cfbeb88f5fcc68d409e90e07", "score": "0.806564", "text": "def search(word)\n \n end", "title": "" }, { "docid": "820038290148ea74ba059c84c31bbf99", "score": "0.7670534", "text": "def search(word)\r\n \r\n end", "title": "" }, { "doci...
b70b128f72696b71c3735ab6bbcf2fb2
rubocop: disable Metrics/MethodLength rubocop: disable Style/IfInsideElse
[ { "docid": "96e2b90acbca7b6a7ea481b752937f59", "score": "0.0", "text": "def my_inject(par = nil, sym = nil)\n array = to_a\n if block_given?\n if par.nil?\n acc = array[0]\n array[1...array.length].my_each do |x|\n acc = yield(acc, x)\n end\n else\n a...
[ { "docid": "0babe5786f1dc0b716cb7264ef804fca", "score": "0.7477109", "text": "def else_clause; end", "title": "" }, { "docid": "b0e06f6f6770eca8399965ae553bfbab", "score": "0.74239427", "text": "def else_branch; end", "title": "" }, { "docid": "b0e06f6f6770eca8399965ae553...
29ab808467f401de99fce8a46ed1d9e5
Create a set of files used to upgrade servers via mcollective. This will be one file with mcollective commands, and a set of perpackage files that let mcollective run only against the servers that need the updates.
[ { "docid": "61de8f6e87a481766577b8961005af9a", "score": "0.6566489", "text": "def create_upgrade_files_for_week(week, search_package = '', advisories, current_servers)\n\n # Find the directory for the given week. If it already exists, then give\n # a warning and skip this run.\n time = date_of...
[ { "docid": "be1e00aad2254d4043def8260b9e4682", "score": "0.6273908", "text": "def create_upgrade_files(search_package = '')\n advisories = updates_by_package(search_package)\n schedule = load_puppet_schedule\n (1..4).each do |week|\n unless schedule.key?(week)\n warn \"No valid serv...
31f181505556550d5edea4d7667ff71d
Public: Retrieve the refresh rate Returns the String refresh rate
[ { "docid": "7590192f5b1369c2167e6a958bbbbe56", "score": "0.5964873", "text": "def refresh\n conf['dashboard']['refresh'].to_s\n end", "title": "" } ]
[ { "docid": "985a794bf587b1137e2b1262beefb848", "score": "0.73317236", "text": "def refresh_rates\n read_from_url\n end", "title": "" }, { "docid": "9544b9e0e9c025cce3a351264cf1b9a4", "score": "0.7051493", "text": "def rate\n return @...
aa8b0a15363a276f91e2c883554a4a58
invoked by one of Procmail's filter rules. The email has the form 2013/01/20 14:50:56 Device Name: YRMF124 Device Model: MX4101N Serial Number: 0502254100 Machine Code: YRMF124 Device has detected: !!!!! Maintenance required. Code:FK3 !!!!! Parse the Jam Trouble attachment file in directory dir for the jam code.
[ { "docid": "6834d9bc485fb3d65dbb67a1a31ed3ca", "score": "0.51491344", "text": "def getJamCode(dir)\n # returns JamStat record id or nil if no matching history found\n unless (!dir.nil? and File.exists?(dir + '/E-mail DIAG Jam Trouble Data.R05'))\n return nil\n end\n \n f = File.open(dir + '/E-ma...
[ { "docid": "c25749a6900482bbaa456fc230bd1269", "score": "0.5651093", "text": "def email_job_result(jlh)\n return unless email_result?(jlh)\n email_expression = Regexp.new('EMAIL_RESULT_BELOW:(.*)EMAIL_RESULT_ABOVE',Regexp::MULTILINE)\n match = email_expression.match(jlh[:job_result])\n jmd =...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "89ca3a92d3b2aab52994df1b487f3fa5", "score": "0.0", "text": "def set_coach_log\n @coach_log = CoachLog.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;...
9ed0122e7665037cfbd619a96040a40d
state: 'read', ... rank: 1,2,3,...
[ { "docid": "cfa90b4894395af20bb2df09c996c842", "score": "0.0", "text": "def booklog_post(asin, state, rank)\n require 'webookshelf/booklog'\n\n user = @conf.options['booklog_userid']\n pass = @conf.options['booklog_password']\n booklog = Booklog::Agent.new(user, pass)\n \n booklog_status = nil\n ...
[ { "docid": "f1e3192accb569027fad1e56f852160b", "score": "0.6543613", "text": "def reading_order; end", "title": "" }, { "docid": "2876c54fa9b9ef04ccb17657474a6183", "score": "0.6378071", "text": "def readingOrder; end", "title": "" }, { "docid": "7cdf1489497857ef3148e4b86...
f8a0efa31c20980bb709bb22fffcd238
It checks an expression to have dependent vars to depend only on one of the provided variables in `vars` Arguments: exp: symbolic expression met: name of the method calling this check vars: list of possible variables there could be a dependency on
[ { "docid": "e3a03b0fd01e0a3b23e97754a7b51a90", "score": "0.7170805", "text": "def assert_dependency_only_on(exp, met, *vars)\n dvs = exp.dependent_vars\n dvs.each do |dv|\n args = dv.args\n if args.size > 1 || !vars.include?(args.first)\n raise OCPError, \"Depe...
[ { "docid": "ed2724b2646974d60acb658df7b9f1b4", "score": "0.558734", "text": "def test_variable_check_true_2\n\t\ttester = TheRepl.new()\n\t\tassert_equal true, tester.check_variables(['b', 'cause', 'turkey'])\n\tend", "title": "" }, { "docid": "110bb02455d058044dbd94425b1a24fe", "score":...
ab22664aeeb4d903d0d6d9d0b88eb3f9
all this methods are private
[ { "docid": "322ea66a1ca19c366abe84371fafb6f9", "score": "0.0", "text": "def raise_verbose_help(msg)\n puts @opt_parser\n puts \"************************************************\\n\"\n raise OptionParser::MissingArgument, msg\n end", "title": "" } ]
[ { "docid": "6a6ed5368f43a25fb9264e65117fa7d1", "score": "0.74587214", "text": "def internal; end", "title": "" }, { "docid": "1e5e53c4b9e93d9482caa25c8f435412", "score": "0.7209927", "text": "def methods; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd",...
fdaa9ab8485f88b784a46a3f1e35b659
Phase REQUEST_HEADERS. SecRules 1
[ { "docid": "bfac99b64dc852a7fca32e8b5c2b0763", "score": "0.55751777", "text": "def request_headers! header_hash\n errors = header_hash.each_with_object [] do |(key, val), errors|\n key = key.to_s; val = val.to_s\n rv = Wrapper.msc_add_n_request_header txn_ptr, (strptr key), key.bytesi...
[ { "docid": "fbe5f6d74f260dd21aa9d21ead25b167", "score": "0.64900476", "text": "def request_headers; end", "title": "" }, { "docid": "fbe5f6d74f260dd21aa9d21ead25b167", "score": "0.64900476", "text": "def request_headers; end", "title": "" }, { "docid": "a5c0b711d2c8797b59...
ba029cf57bca6978e4e836fcdbd77b2a
DATABASE AND SETTINGS HANDLING load nonarduino parameters
[ { "docid": "71c2cb8063150ab53a37ea53d5249793", "score": "0.65282595", "text": "def load_param_values_non_arduino\n\n p = get_param_by_name('MOVEMENT_STEPS_PER_UNIT_X')\n @axis_x_steps_per_unit = p['value_db']\n\n p = get_param_by_name('MOVEMENT_STEPS_PER_UNIT_Y')\n @axis_y_steps_per_unit = p...
[ { "docid": "9911009c138bef6287da59017d3f739b", "score": "0.7089925", "text": "def load_config_from_database\n @params.each do |p|\n p['value_db'] = @bot_dbaccess.read_parameter_with_default(p['name'], p['default'])\n end\n end", "title": "" }, { "docid": "9911009c138bef6287da590...
6ac81a4e096f09181dfe010e2e28696b
DELETE /comments/1 DELETE /comments/1.json
[ { "docid": "6afe9daa9015b8a9d869aca516d4b1a7", "score": "0.0", "text": "def destroy\n issue_id = @comment.issue_id\n courseid = @comment.courseid\n @comment.destroy\n respond_to do |format|\n # format.html { redirect_to issue_url(issue_id), notice: 'Comment was successfully destroyed.' ...
[ { "docid": "3e527a9d859cb967c5442cb3625a69d8", "score": "0.75341123", "text": "def destroy\n render json: comment.destroy!, status: :ok\n end", "title": "" }, { "docid": "021c3490c1e2fb25c05ca0b44b7d297d", "score": "0.7521334", "text": "def destroy\n Comment.find(params[:id])....
dc2096c2d1d503ed7b000f24530ea216
parser rule term (in FoodLOOP.g) 114:1: term : factor ( ( MUL | DIV ) factor ) ;
[ { "docid": "8ce711dae1a6c795aea63e4969a47d42", "score": "0.74740934", "text": "def term\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 22 )\n\n\n __MUL27__ = nil\n __DIV28__ = nil\n\n\n begin\n # at line 114:7: factor ( ( MUL | DIV ...
[ { "docid": "c690003c8e5ddb49d69b3baa6a9efcfb", "score": "0.767887", "text": "def factor\r\n factor1 = term\r\n\r\n t = @lexer.peek_next\r\n\r\n while [:multiply, :divide, :modulo].include? t.type\r\n t = @lexer.next\r\n factor2 = term\r\n\r\n case t.type\r\n when :mu...
ba936736ab666974962cec1af9335541
validates if the submission history is the same on the database and typeform
[ { "docid": "573021faf3763fd49d1de75d40389114", "score": "0.59382564", "text": "def validate_submission_form_arrays(person_hash, person)\n valid_arrays = true\n form_id_typeform_array = person_hash[person.email]['form_id']\n submit_date_typeform_array = map_datetime_parse_array(person_hash[perso...
[ { "docid": "60a730c5d34c4bee222d4ff6b97858a6", "score": "0.6592876", "text": "def validate_unique_submission\n return unless existing_submission\n\n errors.clear\n errors[:base] << I18n.t('activerecord.errors.models.course/video/submission.'\\\n 'submission_already_ex...
351632c8dc7aa6c91dfb8913c85f88b5
Save our parameters (GET variables) as session variables if they're set
[ { "docid": "0f9f608674dfb0c289380980cb9b2538", "score": "0.7168361", "text": "def save_session(params, session)\n\t\tsession[:zip] = params[:zip] if params[:zip]\n\t\tsession[:min_price] = params[:min_price].to_i if params[:min_price]\n\t\tsession[:max_price] = params[:max_price].to_i if params[:max_pri...
[ { "docid": "105fa16c680393da913c9ad9019e9f0d", "score": "0.72206074", "text": "def set_parameters_in_session\n [:start_date, :end_date, :persons].each do |parameter|\n session[parameter] = params[parameter]\n end\n end", "title": "" }, { "docid": "e7078e54cb720358720bf5e4...
797ce4416b116bb1b463df1d28899b7f
GET /exercises/new GET /exercises/new.json
[ { "docid": "072529842cd6e6c6afdfcb2eaa2e08e6", "score": "0.8046211", "text": "def new\n @exercise = Exercise.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @exercise }\n end\n end", "title": "" } ]
[ { "docid": "238423659b9f424683de37ca6d21030f", "score": "0.7976316", "text": "def new\n @exercise = Exercise.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @exercise }\n end\n end", "title": "" }, { "docid": "650c5669c27c9d3e45...
a9b9afd8a15ee2f11cbccc84518ad141
converts the given absolute path to be relative to repo_dir.
[ { "docid": "c3b0231f12838680cd6fc02252ca2007", "score": "0.74152434", "text": "def relative_to_repo_dir(path)\n path[(@cookbook.repo_dir.length + 1)..-1]\n end", "title": "" } ]
[ { "docid": "ef1e518f9d63813f0b27f1b04eb70475", "score": "0.7468006", "text": "def repo_relative_path(include_repo_root=false)\n leading_path_segments = if include_repo_root\n # Remove repo root dir from leading_path_segments to keep it\n Pathname.new(repository.base_dir).parent.to_s\n...
ee0e9a43b40b7cbb26b2a5fc5970ed4f
Cache the body returned by the block. This way the block won't be called multiple times.
[ { "docid": "6b0bd4055efae5ccc3286d4f40a513fe", "score": "0.0", "text": "def value\n @value ||= @block.call\n end", "title": "" } ]
[ { "docid": "3c5942b1624afcd9bb3aa015da6f7b22", "score": "0.7225516", "text": "def body\n if !block_given?\n if @cached_body != nil\n return @cached_body\n end\n return @cached_body = ::Vertx::Util::Utils.from_object(@j_del.java_method(:body, []).call())\n end\n ...
e04d8f43ee63c5ce4c663238adabee6e
GET /admin/reviews GET /admin/reviews.json
[ { "docid": "7644d93f1afed1dc6f2190ea3fc95102", "score": "0.6326467", "text": "def index\n @reviews = Employee.where(reviewed: nil)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reviews }\n end\n end", "title": "" } ]
[ { "docid": "4c53a23719cec17d6a83a3da03fe2db7", "score": "0.78569454", "text": "def index\n @reviews = reviewable.reviews\n\n respond_to do |format|\n format.html\n format.json { render json: @reviews }\n end\n end", "title": "" }, { "docid": "cf40d6c6450bc2509ea7ec7057430...
89756a53d51d7bbe53f2cd1f28495040
Wait for waiting threads
[ { "docid": "481d8ca29a1711f9afc382660ba031d1", "score": "0.0", "text": "def finalize\n @waiter.all_waits(&:join)\n end", "title": "" } ]
[ { "docid": "dea8055cffb13b62240da699b8afb21c", "score": "0.8504282", "text": "def wait!\n while (!@threads.empty?)\n ThreadsWait.new(@threads).join\n end\n end", "title": "" }, { "docid": "49f023d9bbced5c622572d6c0a878ef7", "score": "0.8498109", "text": "def wait\n f...
ebb815bc224ebc3401b31e5fb098537e
iterate over all cards in deck
[ { "docid": "a64463d78d08fa3e639d2137d3ddceea", "score": "0.7673767", "text": "def each\r\n @card_list.each\r\n end", "title": "" } ]
[ { "docid": "393211b5350446b2d4318445640f69ec", "score": "0.7645719", "text": "def each() \n @cards.each do |card|\n yield card\n end \n end", "title": "" }, { "docid": "990294fe7018f8830251c1edb7717338", "score": "0.75598615", "text": "def each\n @card_lis...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "6ae501e393652f3a4a4ef5a28fbf90e9", "score": "0.0", "text": "def set_subscription\n @subscription = Subscription.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;...
7a0ca50c95a93e3eca794721f52d2a43
PUT /material_codes/1 PUT /material_codes/1.json
[ { "docid": "9f76e40a2b8eb371090d1d17e95c80a9", "score": "0.77240425", "text": "def update\n @material_code = MaterialCode.find(params[:id])\n\n respond_to do |format|\n if @material_code.update_attributes(params[:material_code])\n format.html { redirect_to @material_code, notice: 'Mate...
[ { "docid": "692c7f68c48dcbe2b714548056b524ff", "score": "0.7013992", "text": "def update\n @material = Material.find(params[:id])\n if @material.update_attributes(params[:material])\n head :no_content\n else\n render json: @material.errors, status: :unprocessable_entity\n end\n en...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "7f8dbcd66247cbdaf37595ce21a49d43", "score": "0.0", "text": "def set_comparison_object\n @comparison_object = ComparisonObject.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.6031952", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015048", "text": "def...
b94192274e4300a1a9d37d6cb488cf54
Proper error handling if the scraping result is not what we expected. +links+ a set of extracted links +pattern+ what we used for the search +result_size+ the expected number of hits +link_index+ the index of the link which should be followed
[ { "docid": "a9b879542317859da867942e280dff18", "score": "0.80153245", "text": "def handle_scrape_result(links, pattern, result_size, link_index)\n if links == nil || links.size() != result_size\n raise UnexpectedHtmlStructure, \"#{@share.name}: Found #{links.size} link(s) matching pattern >>#{pa...
[ { "docid": "07d329cbc0af3bd4ae31bbc1b3374003", "score": "0.6350554", "text": "def links(count = nil)\n return @sape_error if @sape_error\n unless @links\n begin\n fetch_links\n rescue Exception => e\n @sape_error = \"<!-- error: #{e.message} -->\"\n ret...
0121a0c9ee5e154b98d46979a5bad5cd
Gets the processingStatus property value. The processingStatus property
[ { "docid": "6d05d16f031b4441897f18c98a82553a", "score": "0.90004", "text": "def processing_status\n return @processing_status\n end", "title": "" } ]
[ { "docid": "6bcc4b37411d94b2dd2f314180c040ab", "score": "0.8545382", "text": "def processing_status=(value)\n @processing_status = value\n end", "title": "" }, { "docid": "0f28e00a822ac9819fc27ece7b0e271f", "score": "0.7825915", "text": "def processing_state...
f152ba532cf04622a1155577e422d27b
GET /trfiles/1 GET /trfiles/1.json
[ { "docid": "12bf96fe3d29ca42014d3405b2595a75", "score": "0.7308798", "text": "def show\n @trfile = Trfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trfile }\n end\n end", "title": "" } ]
[ { "docid": "88ac154188dd607bd4ffdcf8df34af45", "score": "0.76087713", "text": "def index\n @trfiles = Trfile.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trfiles }\n end\n end", "title": "" }, { "docid": "88ac154188dd607bd4ff...
fc2af08ba8e0fb8b7a4560c0d6b487c4
Date: 07/26/2016 Author: Ziman Ling Takes an id of a person as paramter, returns the the first name appended by the last name, truncate the name if it is too long
[ { "docid": "dcae9730f973548e6b7bd8455c09da33", "score": "0.8081668", "text": "def get_name_given_person_id person_id\n person = Person.find(person_id)\n \"#{person.first_name.capitalize.truncate(15)} #{person.last_name.capitalize.truncate(15)}\"\n end", "title": "" } ]
[ { "docid": "cca6a24f1a83dc5b10b128ea114478c8", "score": "0.7402333", "text": "def full_name_id\n \"#{last_name}, #{first_name} (DON#{id})\"\n end", "title": "" }, { "docid": "f0fd78b3d8ff045293e8b694336f0fa6", "score": "0.73101497", "text": "def get_firstname_lastinitial name\n ...
7ff8dc65de70d1a96502193276251a7f
Returns the primary key field for a table. In Hypertable, a single row key exists for each row. The row key is referred to as ROW in HQL, so we'll refer to it the same way here.
[ { "docid": "39054e831a86e98b118d5ad602b24e67", "score": "0.7669598", "text": "def primary_key\n \"ROW\"\n end", "title": "" } ]
[ { "docid": "7158758016645ecacaaa5f0c2f91c2b7", "score": "0.8205036", "text": "def primary_key(table)\n columns(table).find{ |c| c.primary_key? }.name\n end", "title": "" }, { "docid": "04e1fd43bc57810ae829ec9aaa8ed937", "score": "0.818815", "text": "def primary_key(ta...
bbeac88fb3d267c773062a34b25cc298
Used for timing method calls
[ { "docid": "e995bd3793f599b7c31c373181056edd", "score": "0.0", "text": "def timed\n start_time = now\n\n [yield, now - start_time]\n end", "title": "" } ]
[ { "docid": "c2974963391233b0a6eeb54ad06994bc", "score": "0.8093078", "text": "def timing; end", "title": "" }, { "docid": "4a8e6e232309653f21c3e6012fce1181", "score": "0.75109404", "text": "def time_method(method, *args)\n beginning_time = Time.now\n self.send(method, args)\n end_...