query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
ffe4498e7c90045c265fa5610f4ef483 | Validate accepted milage of bike | [
{
"docid": "a4e97aa2f8eacc916ff3371f73b59712",
"score": "0.0",
"text": "def input_milage(msg = 'Enter milage(kmpl)')\n puts msg\n milage = gets.chomp\n if milage.match(/^[0-9.]+$/) && milage.to_i.positive?\n milage.to_i\n else\n input_milage('Enter value of gears')\n end\n end"... | [
{
"docid": "796f42b44e26106f83743e56837ddc32",
"score": "0.6226052",
"text": "def validate\n raise \"#{self} has no wounds!\" if self.wounds <= 0\n raise \"#{self} has >1 auxiliary troop!\" if (@troops.select {|t| t.is_aux_troop?}).size > 1\n raise \"#{self} has more troops than formation... |
063ba80f76fbc909633500655c710d7e | Retrieve the details from a document | [
{
"docid": "efca48335ec8a658606c7ee629b9d093",
"score": "0.72202903",
"text": "def retrieve_details(document)\n return nil unless document\n if wce = document['writeConcernError']\n return wce['errInfo']\n elsif we = document['writeErrors']&.first\n return we['errI... | [
{
"docid": "dd98a5a659635c41eebb5ddfa51d35e8",
"score": "0.7143165",
"text": "def document_details(guid)\n get \"/api/documents/#{guid}.xml\"\n end",
"title": ""
},
{
"docid": "1b352f4b88008a326048d485041304e4",
"score": "0.7060029",
"text": "def get_doc \n @doc\n end",
... |
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": "e2e77e3d4692b97a7841734d5d35a0ec",
"score": "0.7569417",
"text": "def from_hash(hash); end",
"title": ""
},
{
"docid": "e2e77e3d4692b97a7841734d5d35a0ec",
"score": "0.7569417",
"text": "def from_hash(hash); end",
"title": ""
},
{
"docid": "e2e77e3d4692b97a7841... |
f52eafcfe8e7d47f53f66772570b0a5b | def odd_elems(arr) counter = 1 idx = 0 odd_arr = [] loop do odd_arr << arr[idx] if counter.odd? return [] if arr.empty? break if counter == arr.size idx += 1 counter += 1 end odd_arr end p odd_elems([2, 3, 4, 5, 6]) p odd_elems([1, 2, 3, 4, 5, 6]) p odd_elems(['abc', 'def']) p odd_elems([123]) p odd_elems([]) | [
{
"docid": "d760c1811f1749dc1691b1686ed1f380",
"score": "0.90100235",
"text": "def even_elems(arr)\n counter = 1\n idx = 0\n odd_arr = []\n\n loop do\n odd_arr << arr[idx] if counter.even?\n return [] if arr.empty?\n break if counter == arr.size\n idx += 1\n counter += 1\n end\n odd... | [
{
"docid": "5fb353b4a48dbcd9bd12a7c98223255f",
"score": "0.8545983",
"text": "def oddities(arr)\n odd_elements = []\n index = 0\n while index < arr.size\n odd_elements << arr[index]\n index += 2\n end\n odd_elements\nend",
"title": ""
},
{
"docid": "8336c55b530bd66ccbbc30a41519879... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "8f0786ca4f99ec4f450faa55cefb2822",
"score": "0.0",
"text": "def set_category\n @category = Category.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... |
90da60e66a6eb8a8f4f675299e6cb60b | Check module path for module | [
{
"docid": "3c1eb0eb5fbba18a1d1c4ac13360885d",
"score": "0.0",
"text": "def find_file(name)\n @load_path.each do |dir|\n file_path = File.join(dir, \"#{name}.rb\")\n return file_path if File.exist? file_path\n end\n raise(\"Module #{name} not found\")\n end",
"title":... | [
{
"docid": "b60da48b9cc828689c7ee611397649b8",
"score": "0.74676317",
"text": "def module_exist? name, path = false\n\t\t\tif path == true\n\t\t\t\treturn true if File.exist? name\n\t\t\telse\n\t\t\t\tDir['modules/*'].each do | module_name |\n\t\t\t\t\tm = module_name.split('/').last\n\t\t\t\t\treturn t... |
cf827fa3dccc0710ba03d8c0607aa1a8 | uses CURLUE_NO_ZONEID, available since curl 7.81.0 | [
{
"docid": "f58a9eb39778bd0ff9f0e917dd30fb3e",
"score": "0.0",
"text": "def install\n system \"make\"\n system \"make\", \"install\", \"PREFIX=#{prefix}\"\n end",
"title": ""
}
] | [
{
"docid": "9b3ac65823ffebaaa16350356932f0bb",
"score": "0.51537",
"text": "def zone_identifier; end",
"title": ""
},
{
"docid": "9b3ac65823ffebaaa16350356932f0bb",
"score": "0.51537",
"text": "def zone_identifier; end",
"title": ""
},
{
"docid": "84ab7262e4f0dad280ff36f0... |
5735e1d47de94c337eb9429721a78fc7 | Update Update, verify and precalculate | [
{
"docid": "b9f5f55a18c487b2f5306aedf5eabd36",
"score": "0.0",
"text": "def update(validate: true)\n yield self if block_given?\n validate! if validate\n precalculate!\n end",
"title": ""
}
] | [
{
"docid": "47e3f68a3c2cb0c738eeed20b483b448",
"score": "0.74179167",
"text": "def try_update; end",
"title": ""
},
{
"docid": "47e3f68a3c2cb0c738eeed20b483b448",
"score": "0.74179167",
"text": "def try_update; end",
"title": ""
},
{
"docid": "cb2162d3a1fd3434effd12aa702f... |
b9c034fd1256f94d0910aaaa354a5c97 | GET /workobjects GET /workobjects.json | [
{
"docid": "8121e285f2e67be47a4e6fecb994c457",
"score": "0.6907156",
"text": "def index\n @workobjects = Workobject.search(params[:search]).order(sort_column + \" \" + sort_direction).paginate(:per_page => COUNT_STRING_ON_PAGE, :page => params[:page])\n\n respond_to do |format|\n format.html ... | [
{
"docid": "0a6cfdcfae749733303521cd79bf1794",
"score": "0.7319202",
"text": "def index\n \n @works = Work.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @works}\n end\n\n end",
"title": ""
},
{
"docid": "207dabf2ebe89596203b... |
8ddaab157dba934d173682f204ce1881 | GET /tickets/month_report GET /ticketsmonth_report/.pdf GET /tickets/month_report.json | [
{
"docid": "56a6a1289164ac45a4bb72999b521bca",
"score": "0.7544767",
"text": "def month_report\n redirect_to tickets_path(status: 'resolved', date: '1', format: request.format.symbol)\n end",
"title": ""
}
] | [
{
"docid": "d3f258adc32ba49480af9abc5c2b761c",
"score": "0.7811397",
"text": "def report\n authorize! :report, Ticket\n\n # Date range for last month\n start_date = Time.zone.now.last_month.beginning_of_month\n final_date = Time.zone.now.beginning_of_month\n\n # Find all tickets closed on... |
3f01f6a8d32ecc29bf4e4906e0a55848 | jekyll_get pulls data from team_api, but it's nested | [
{
"docid": "b437f7ea568c89e620f6c0a10ef968bf",
"score": "0.0",
"text": "def unnest_site_api_data(site)\n site.data.keys.each do |data_type|\n if data_type.end_with? '_raw'\n site.data[data_type[0..-5]] = site.data[data_type]['results']\n site.data.delete data_type\n ... | [
{
"docid": "89e00d74208fda73d78104171b94025a",
"score": "0.5950742",
"text": "def get_team_fixtures(team_id)\n response = parse_api_request(\"#{BASE_URL}fixtures/team/#{team_id}\")[\"fixtures\"]\nend",
"title": ""
},
{
"docid": "682e45f992cb4a6c790411ad1b07d289",
"score": "0.59017",
... |
4d1af3b36bc17023a7cce428990d1d60 | Returns the image url of an asset Allows you to pass in the following options for image resizing: :width :height :format :quality See | [
{
"docid": "5a5bdfa4b33ca1f43beecc4ca204ec7a",
"score": "0.7061751",
"text": "def image_url(options = {})\n query = {\n w: options[:w] || options[:width],\n h: options[:h] || options[:height],\n fm: options[:fm] || options[:format],\n q: options[:q] || ... | [
{
"docid": "3f0578479273366eaad886f8a56b52ba",
"score": "0.76837873",
"text": "def image_asset_url(width: nil, height: nil, type: \"png\")\n return nil if image_asset.nil?\n\n template_url = image_asset[\"templateUrl\"]\n width ||= image_asset[\"width\"]\n height ||= image_as... |
927e12bb77c05d8758d811e2abba8000 | the array of strings will be converted to strings of hack asm code | [
{
"docid": "9b8f62fa4c2e8af03d31a40c085bfa9a",
"score": "0.0",
"text": "def convertCommand(arr, i, fileName)\n op = arr[0] # the operation is the first word in the vm command\n opType = getOpType(op) # the type of operation each will have there own function\n\n case opType\n when \"arithmeticOp\"\n ... | [
{
"docid": "d9937da57a1d64fd45514130fff53988",
"score": "0.70507675",
"text": "def array_to_code(arr)\n code = ''\n arr.each_with_index do |part, i|\n code << ' + ' if i > 0\n case part\n when Symbol\n code << part.to_s\n when St... |
d4a28dbbdb796fb355adfbfa8cf718f6 | I worked on this challenge [with: Michael Whelpley ]. Your Solution Below | [
{
"docid": "8bbeda8961dfcc3805ecc4d7eb306687",
"score": "0.0",
"text": "def factorial(number)\n # Your code goes here\n result = 1\n counter = number\n while counter > 0\n \tresult *= counter\n \tcounter -= 1\n end\n return result\nend",
"title": ""
}
] | [
{
"docid": "aa89b26c8848588848ff622b5d313173",
"score": "0.6330971",
"text": "def solution\n 31875000\nend",
"title": ""
},
{
"docid": "b9960478999684c2b536f76e22f6fc63",
"score": "0.6231961",
"text": "def solution4(input)\n end",
"title": ""
},
{
"docid": "6979036015... |
647f3e7d83952aad9db33f1f7f400d32 | POST /profiles POST /profiles.xml | [
{
"docid": "b586fe09da69d6fa488d5e1ce3c1ade1",
"score": "0.6293005",
"text": "def create\n @profile = Profile.create! (params[:profile].merge(:account_id => current_account.id))\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to(@profile, :notice => 'Profile was ... | [
{
"docid": "458b16634acf1757c22a212867e5e763",
"score": "0.7754241",
"text": "def profiles= profiles_xml\n params, headers = req('POST', body = \"ProfilesXML=#{::CGI::escape profiles_xml}\",\n 'application/x-www-form-urlencoded', Time.now.to_i, url = \"#{self.url}/\")\n ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "5dc9258788eca12daa7a45c0bb589157",
"score": "0.0",
"text": "def set_pg_sywiretransfer_merchant\n @pg_sywiretransfer_merchant = PgSywiretransferMerchant.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... |
dac6f047bcd0e4651bf8430bfd9147e4 | Yield the ngrams of a specified size for a string one at a time | [
{
"docid": "f631faa6f68c9cf5b3516bf630d99ef0",
"score": "0.86065745",
"text": "def yield_ngrams(str, ngram_size=@ngram_size)\n ngram_list = ngram_list(str, ngram_size)\n ngram_list.each { |ngram| yield ngram }\n end",
"title": ""
}
] | [
{
"docid": "37ef8865b3786b171793fe2693de7e5c",
"score": "0.790123",
"text": "def ngrams(len = 1)\n ngrams = []\n len = size if len > size\n (0..size - len).each do |n|\n ng = self[n...(n + len)]\n ngrams.push(ng)\n yield ng if block_given?\n end\n ngrams\n end",
"title... |
80a86875f459b8342346b13286606f9e | PATCH/PUT /notes/1 PATCH/PUT /notes/1.json | [
{
"docid": "554b824d8253a51a0952661ab56fbb1a",
"score": "0.65044326",
"text": "def update\n respond_to do |format|\n if @note.update(note_params)\n format.html { redirect_to @note, notice: 'Note was successfully updated.' }\n format.json { render :show, status: :ok, location: @note... | [
{
"docid": "49fde848b15fb7ae02bb978edba6f315",
"score": "0.70455545",
"text": "def update\n note = Note.find(params[\"id\"])\n note.update_attributes(note_params)\n respond_with note, json: note\n end",
"title": ""
},
{
"docid": "dba86595fad87f6b5ef28d7d107d4920",
"score": "0.7... |
a8719d38f1abdea6e6408add24555cb0 | method used to delete a post and also prevent deleting another user's posts through URL manipulation | [
{
"docid": "8466cd8de941fdd64b04fe817f2ba32b",
"score": "0.76155555",
"text": "def destroy\n #execute an event which attempts to check if the current post's user_id that wants to be modified matches the\n # current user's id\n @event = current_user.posts.find(params[:id]).destroy\n redirect_... | [
{
"docid": "34bf93cb15e6e991bacfefcec572974b",
"score": "0.80526537",
"text": "def destroy\n unless current_user?(@post.user)\n redirect_to root_path, danger: \"You aren't authorized!\"\n end\n\n @post.destroy\n redirect_to posts_url, success: 'Post was successfully deleted.'\n end",
... |
d1a24b13fe218e9c027072ccc27e9f0f | Transactionally adds 1 or more friends to a user | [
{
"docid": "e113d42bcc59d6c4b9c4aa465e86ca06",
"score": "0.0",
"text": "def sync_friend_ids(user_id, friend_ids)\n @redis.multi do\n @redis.del key(user_id)\n @redis.sadd key(user_id), friend_ids\n end\n end",
"title": ""
}
] | [
{
"docid": "7d47a78210edd9f4ad2c42266a75aaee",
"score": "0.7653642",
"text": "def add\n user = User.find session[:user]\n friend = User.find params[:id]\n \n redirect_to :back\n \n if user != friend\n if !user.friends.exists?(params[:id])\n user.friends.concat friend\n ... |
35beb039df5fb3aa302cd9388b51b266 | clean up logic goes here | [
{
"docid": "5d41713ee646f44802168a7c0d0c690c",
"score": "0.0",
"text": "def onclose(code, reason)\n log.info { \"disconnected with status code: #{code}\" }\n\n EM.stop\n end",
"title": ""
}
] | [
{
"docid": "aeb9c5682d24b55b73bb73877a593c19",
"score": "0.73495317",
"text": "def cleanup; end",
"title": ""
},
{
"docid": "aeb9c5682d24b55b73bb73877a593c19",
"score": "0.73495317",
"text": "def cleanup; end",
"title": ""
},
{
"docid": "aeb9c5682d24b55b73bb73877a593c19",... |
83cef08cdde2056162df3a20c16d7c8b | GET /company_accounts/new GET /company_accounts/new.json | [
{
"docid": "a5d035de50262a2bb7a47bb6177935f9",
"score": "0.8062464",
"text": "def new\n @company_account = CompanyAccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @company_account }\n end\n end",
"title": ""
}
] | [
{
"docid": "6293cc2cd87b3a16a9bd34a5c37cf5ca",
"score": "0.7906282",
"text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "6293cc2cd87b3a16a9bd34a5... |
1f5d272cb735cf2f66e852539f25bba9 | Handles the 'find' command which prints information on all items in the FoodDB matching a certain prefix | [
{
"docid": "e6a0d97aa7365bf019c87672ab67bd70",
"score": "0.80237985",
"text": "def command_find(prefix)\n list=@database.find_matches(prefix)\n list.each do |i|\n puts i.to_s\n end\n end",
"title": ""
}
] | [
{
"docid": "b04c9165e6576327bc0e14fbb7438ace",
"score": "0.7979915",
"text": "def command_find(prefix)\n \tlist = @database.find_matches(prefix)\n\tlist.each {|match|\n\t\tputs \"#{match}\"\n\t}\n end",
"title": ""
},
{
"docid": "eb449fe67a8ffc3950847e13382eafe2",
"score": "0.79753476"... |
c0ba368090ff7baa0e81480251002179 | Makes a deep copy of a transaction input | [
{
"docid": "4201ffb81adc1c0db74924f12195417b",
"score": "0.7437537",
"text": "def dup\n TransactionInput.new(previous_hash: @previous_hash.dup,\n previous_index: @previous_index,\n signature_script: @signature_script ? @signature_script.dup : nil,\n ... | [
{
"docid": "70d238cd92556bd82491f8840ea95c5d",
"score": "0.736579",
"text": "def dup\n Transaction.new(version: @version,\n inputs: (@inputs || []).map{|txin|txin.dup},\n outputs: (@outputs || []).map{|txout|txout.dup},\n lock_time: @loc... |
2517df7317f7ca0699bdfc0c852c1d05 | DELETE /menu_entries/1 DELETE /menu_entries/1.json | [
{
"docid": "e95f9a113d6ec96fb01013449bc60836",
"score": "0.7353034",
"text": "def destroy\n @menu_entry.destroy\n respond_to do |format|\n format.html { redirect_to menu_entries_url, notice: 'Menu entry was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
... | [
{
"docid": "fa3a05167cdd18055a29f97422ef9101",
"score": "0.7519322",
"text": "def destroy\n @admin_menu_entry = Admin::MenuEntry.find(params[:id])\n @admin_menu_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_menu_entries_url }\n format.json { head :no_conte... |
4ee37d9286acfa2b66bf2180a32c17bd | def player(x,o) o = "player1" x = "player2" end def play(board) play=gets play end | [
{
"docid": "48f0075b2d0022b75585eaf03ca0a993",
"score": "0.0",
"text": "def board\n board = ['1','2','3','4','5','6','7','8','9']\n board\nend",
"title": ""
}
] | [
{
"docid": "55770340d3ee3d6c79d5f2fa0ec2eb33",
"score": "0.7969438",
"text": "def main\n @actual_player = @player1 if (@actual_player == \"\")\n\n turn\n end",
"title": ""
},
{
"docid": "c102d8ac5c876c227738861a04675885",
"score": "0.7631324",
"text": "def play(main_player:, p... |
4b0361ef6d9527194312e7fbe0bed2ee | Create the PicrossFrame area, with all the CellButton inside Returns : the PicrossFrame itself | [
{
"docid": "a2b971436998b331966c601c8a4ad6bb",
"score": "0.58238053",
"text": "def createArea()\n\t\t@cells = Gtk::Grid.new\n\t\t@drag = Drag.new(@map, @cells, @frame)\n\t\t@cells.visible = true\n\n\t\tself.redraw\n\n\t\t@mainArea = Gtk::EventBox.new()\n\t\t@mainArea.events |= (Gdk::EventMask::ENTER_NO... | [
{
"docid": "68df05bff24800648fa503d404d0a94c",
"score": "0.6306201",
"text": "def createButtons(framing, groupStyle)\n #Load icons\n red = loadIcon(\"RedIcon.png\") \n green = loadIcon(\"GreenIcon.png\")\n blue = loadIcon(\"BlueIcon.png\")\n black = loadIcon(\"BlackIcon.png\")\... |
7d05ab8292de417f0586a4b91d7487ee | Create the test Dataset | [
{
"docid": "62660912c1b716b8eeac8cba70d5d492",
"score": "0.6049817",
"text": "def bootstrap_dataset(domo_client, upload_timestamp=nil, partition_field=nil)\n dsr = CreateDataSetRequest.new\n dsr.setName \"logstash-output-domo rspec test\"\n dsr.setDescription \"Created by the rspec tests for th... | [
{
"docid": "c9bf239c7acf1b664fb141039a216947",
"score": "0.70912963",
"text": "def test_create_from_data\n data = @test_record.all_text\n \n creation_test do |record|\n record.create_from_data('', data)\n end\n end",
"title": ""
},
{
"docid": "3692e8... |
4733d16febb8b3964c74568f36928254 | Indicate whether the controller is not exempt from redirection. | [
{
"docid": "f2e483d778abe95e10d6a6fe8110f5ca",
"score": "0.66658926",
"text": "def run_state_redirect?(ctrlr = nil, action = nil)\n ctrlr, action = ctrlr_action_to_names(ctrlr, action)\n exempt_ctrlr = RUN_STATE_EXEMPT_CONTROLLER.include?(ctrlr)\n exempt_action = RUN_STATE_EXEMPT_ACTION[ctrlr]... | [
{
"docid": "2e3091d4ea69eafb0555cf1e6874bd84",
"score": "0.7171267",
"text": "def access_is_denied\n redirect_to root_path, notice: t(\"application.access_is_denied\") and return false # Established users cannot use this option\n end",
"title": ""
},
{
"docid": "af4468cd3779d2e0ea25d150... |
fa2fc720801d5c6c6ce966cd2aae3679 | Print the result of the verification to the terminal | [
{
"docid": "e80a8c2db20a400897886d168ddcd661",
"score": "0.6355066",
"text": "def run\n verifier = CandyCheck::PlayStore::Verifier.new(config)\n verifier.boot!\n result = verifier.verify(@package, @product_id, @token)\n out.print \"#{result.class}:\"\n out.pr... | [
{
"docid": "904e142bf86198ccbd18abb52e31d029",
"score": "0.73115927",
"text": "def verify(expected, actual, message)\n if actual == expected\n print \"\\033[32m #{message} passed \\033[0m\"\n else\n puts \"Expected: #{expected} but got : #{actual} #{message}\"\n print \"\\e[31m #{message} fai... |
c02050ee87d8454abcc3f332b743b70f | Deleting A Segment Deletes a segment along with its criteria from the mailing list. The subscribers of the mailing list that the segment returned are not deleted or affected in any way. | [
{
"docid": "57ef5cf821b9a7e21e7f66b87cd044a4",
"score": "0.72237706",
"text": "def deleting_a_segment(format, mailing_list_id, apikey, segment_id, opts = {})\n data, _status_code, _headers = deleting_a_segment_with_http_info(format, mailing_list_id, apikey, segment_id, opts)\n return data\n ... | [
{
"docid": "73f02d78ab70ee23b02c3dfb92709e5f",
"score": "0.70663077",
"text": "def destroy\n @segment = Segment.find(params[:id])\n @segment.destroy\n\n respond_to do |format|\n format.html { redirect_to(orgadmin_segments_url) }\n format.xml { head :ok }\n end\n end",
"title"... |
bf67ddeed5b112baa1b60b350ed98e46 | Determine the count that this skill should be set to, given its current amount | [
{
"docid": "3345d1a16933e7f5a4776966b4e3e973",
"score": "0.0",
"text": "def apply_limit amount\n\t\tif @limit.is_a? Integer\n\t\t\tlimit = @limit\n\t\telsif @limit.is_a? Hash\n\t\t\tlimit = @limit[$character.character_class.to_s]\n\t\telse\n\t\t\tlimit = 0\n\t\tend\n\n\t\tif limit <= 0\n\t\t\treturn amo... | [
{
"docid": "d34a5e53ea205518bee7e753a94b58f9",
"score": "0.7378469",
"text": "def count= amount\n\t\tif amount.to_i > 0\n\t\t\t@count = @skill.apply_limit(amount)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "03ad6cfc4f0b5fc0bd77de0dae444f4b",
"score": "0.6305439",
"text": "def strain... |
b89c6239c8e33ac6b518d81b054dcefc | returns integer storing time (of day) as the number of seconds since midnight | [
{
"docid": "e3aadc979422aabf8438a2eeeef1d3b4",
"score": "0.0",
"text": "def value_from_s(value)\n a = value.scanf(@format)\n t = 0\n t += a[0] * 3600 if a.size > 0 # hours * seconds-per-hour\n t += a[1] * 60 if a.size > 1 # minutes * seconds-per-minute\n t += a[2] if... | [
{
"docid": "cb6596d22852674d2010be4265deaf97",
"score": "0.82971334",
"text": "def seconds_since_midnight; end",
"title": ""
},
{
"docid": "cb6596d22852674d2010be4265deaf97",
"score": "0.82971334",
"text": "def seconds_since_midnight; end",
"title": ""
},
{
"docid": "cb65... |
a537f3f1610518467dc11b24bef879f8 | GET /outings/new GET /outings/new.json | [
{
"docid": "a0cbd5f1e830e6c688358d16d9662c1d",
"score": "0.7444538",
"text": "def new\n @outing = Outing.new\n @activities = Activity.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @outing }\n end\n end",
"title": ""
}
] | [
{
"docid": "13c90b89b8a6240f7e40bdb3e628693c",
"score": "0.7109183",
"text": "def create\n @outing = Outing.new(params[:outing])\n\n respond_to do |format|\n if @outing.save\n format.html { redirect_to @outing, notice: 'Outing was successfully created.' }\n format.json { render ... |
ff4aca285313e63d866394c370101248 | Delete messages in bulk | [
{
"docid": "52f1655d9f1541be9eb85bb548768998",
"score": "0.77916884",
"text": "def bulk_delete_messages(token, channel_id, messages = [], reason = nil)\n Discordrb::API.request(\n :channels_cid_messages_bulk_delete,\n channel_id,\n :post,\n \"#{Discordrb::API.api_base}/channels/#{... | [
{
"docid": "9aa31d3707c55e8c9ab95dd2e29b2781",
"score": "0.77736616",
"text": "def bulk_delete_messages(auth, channel_id, messages = [])\n MijDiscord::Core::API.request(\n :channels_cid_messages_bulk_delete,\n channel_id,\n :post,\n \"#{MijDiscord::Core::API::APIBASE_URL... |
c62f979b560de1d867f95a34ceb1f60b | format time: remove space, downcase AM/PM | [
{
"docid": "0b93632ee3ab75b31a6cc1f21f6a3a5b",
"score": "0.0",
"text": "def parse_time(row)\n raw_time = row[1]\n if raw_time\n time = \"#{raw_time[0..4]}#{raw_time[-2..-1].downcase!}\"\n\n # remove leading 0\n time = time[1..-1] if time[0] === '0'\n time\n else\n nil\n end\nend",
... | [
{
"docid": "56c1d12451a83661aa4b1cd6038f22f2",
"score": "0.7782333",
"text": "def fmt_time(dt) _format_dt dt, H12_M_PM end",
"title": ""
},
{
"docid": "f5e344e34c2cbe87fd96e6b166f56490",
"score": "0.777957",
"text": "def formatTime( time )\n hours = 0\n minutes ... |
b05a9ca5ce4ae34e113664c1865fb297 | Use static analysis to locate the start of the method definition. We have the `__FILE__` and `__LINE__` from the binding and the original name of the method so we search up until we find a def/define_method, etc defining a method of the appropriate name. | [
{
"docid": "52f47eb7ec91415f037d6a5205e5c90e",
"score": "0.6554942",
"text": "def renamed_method_source_location; end",
"title": ""
}
] | [
{
"docid": "67e7a210ce2ece3860587bef532a308a",
"score": "0.69761735",
"text": "def renamed_method_source_location\n if defined?(@original_method_source_location)\n return @original_method_source_location\n end\n\n source_index = lines_for_file(target_file)[0..(target_line -... |
4d7cce9b9636d92cdae3a203f78724d7 | links of current revision | [
{
"docid": "72dd91333bd661e70c2a0860eed858fa",
"score": "0.6868907",
"text": "def links(filter=@wiki.filter)\n if r=revision(filter)\n r.links(filter)\n else\n EmptyView.instance\n end\n end",
"title": ""
}
] | [
{
"docid": "e3c3425418f5bf8d50f24f776bab404b",
"score": "0.72271436",
"text": "def links; end",
"title": ""
},
{
"docid": "e3c3425418f5bf8d50f24f776bab404b",
"score": "0.72271436",
"text": "def links; end",
"title": ""
},
{
"docid": "e3c3425418f5bf8d50f24f776bab404b",
... |
bb047ec7b164fb3382318f09d0e01afe | Parses the CSV file into an Array of rows. Each row is a Hashlike object of header => value. | [
{
"docid": "e6ef7fcbda83cf3ab8fe72fb0e7fefb5",
"score": "0.73718876",
"text": "def rows\n @rows ||= CSV.parse(contents, :headers => true)\n end",
"title": ""
}
] | [
{
"docid": "27b9801b5284b60ee849654d74e9add9",
"score": "0.79814845",
"text": "def parse file\n rows = []\n headers = @line_parser.parse file.gets.chomp\n file.each do |line|\n values = {}\n headers.zip(@line_parser.parse line.chomp).each do |key, value|\n values[key] = value\n... |
dad62901ceaa9213c114ea55f22be714 | Retrieve a stack based on its name | [
{
"docid": "d53bbba623017a6a5278dd5fbcf4db21",
"score": "0.7542609",
"text": "def retrieve_stack(stack_name:)\n setup_module\n begin\n response = @cfn_client.describe_stacks(stack_name: stack_name).stacks.first\n rescue Aws::CloudFormation::Errors::ValidationError => e\n put... | [
{
"docid": "26ca31bbdd70f4b8ef883969a9883d16",
"score": "0.7675866",
"text": "def find_stack(stack_name)\n stacks = @client.describe_stacks()[:stacks]\n puts \"#{stacks.length} stacks found in total.\" if @verbose\n if stacks.length > 0\n stack = stacks.select{|s| s[:name] == stack_name}.f... |
2731a4b3172cf3b07afe390ba1ad1d5b | Carry out static testing on the code below. Read through the code. Comment any errors you can see without correcting them. == and (val) both returns need 1 more tab indent | [
{
"docid": "35ea9efad4518a2798e1d416e1dd3420",
"score": "0.0",
"text": "def func1 val (val)\n if val = 1\n return true\n else\n return false\n end\nend",
"title": ""
}
] | [
{
"docid": "b0571342e5fb187a4a0e1a16545c13e0",
"score": "0.76307005",
"text": "def func1( val ) \r\n# == for equality operator\r\n if val == 1\r\n # fix indent\r\n return true\r\n else\r\n # fix indent\r\n return false\r\n end\r\nend",
"title": ""
},
{
"docid": "6b71cdfd7f1bd2... |
a1dab26923d616995ee0c5c233a7be09 | Loads (or reloads) the application. The reloader will take care of calling this for you. You can certainly call it yourself if you feel it's warranted. | [
{
"docid": "2441aeface81114902b3b24621ec6097",
"score": "0.72164154",
"text": "def load_app\n title = File.basename(@script)[/^([\\w_]+)/,1].gsub /_/,'' \n begin\n all_requires = $LOADED_FEATURES.dup\n load @script\n @requires = ($LOADED_FEATURES - all_requ... | [
{
"docid": "1f51c82bce85a592396d83091a33c4dc",
"score": "0.7377637",
"text": "def reload\n # reload the app file\n load(config.app.path)\n\n # reset config\n envs = config.app.loaded_envs\n config.reset\n\n # reload config\n self.class.load_config(*envs)\n\n load_... |
bf412a6ceed0054ac74a952d9e7156dd | Get logger for given tag | [
{
"docid": "992bded7913a9abd5c1a4e149519dc79",
"score": "0.79586524",
"text": "def logger(tag)\n # Try to reuse existing logger\n @loggers[tag] ||= new_logger(tag)\n\n # Create new logger if old one is closed\n if @loggers[tag].closed?\n @loggers[tag] = new_logger(tag)\n ... | [
{
"docid": "4a3c066263d8843aa0e67c8794ef3972",
"score": "0.7033957",
"text": "def tagged_logger(new_tag)\n self.class.new(\"#{tag}.#{new_tag}\")\n end",
"title": ""
},
{
"docid": "e874b62a5adedf1ef0eeef45e87c6962",
"score": "0.6727347",
"text": "def getlogger(loggername);... |
e8e019b652e685bab4232148d234374f | Check if all words that result from move are legal TODO: Add the following legal move checks: TODO: Move is not a simple pluralization? (e.g. Cat > Cats is NOT a legal move) | [
{
"docid": "d8a754d942f3a2df38e0ea3596922801",
"score": "0.6828615",
"text": "def legal_words?(board, dict, raise_exception = false)\n\n if can_play_letters?(board, raise_exception) \n bad_words = self.new_illegal_words(board, dict)\n if bad_words.empty?\n return true\n ... | [
{
"docid": "e4bb040a8b0675e182240c7a9ba42c3e",
"score": "0.68779767",
"text": "def move(move)\n to_word = move[0]\n from_words = move[1]\n\n # remove each of the \"from words\" from the board exactly once\n words_copy = @words.dup\n from_words.each do |word|\n index = words_copy.inde... |
81fd6c9a8fadf831deaabdff68672d3a | Will try to figure out the "base", which is the parent directory or path. If the base is a directory, this will return the directory name, but if it is an URL, this will return an URI object. | [
{
"docid": "59c7eaf6dce0c0fdf2ed63fc09ab0e68",
"score": "0.68499625",
"text": "def base_for(url)\n url = file_url(url)\n if(File.exist?(url))\n file = File.expand_path(url)\n File.directory?(file) ? file : File.dirname(file)\n else\n uri = URI.parse(url)\n # Re... | [
{
"docid": "687e0e5837573f0b0aee06287ead92b6",
"score": "0.7729596",
"text": "def base\n # user can override base\n return @opts[:base] if @opts[:base]\n return '' unless @location\n # work out base directory or uri\n if local?\n return File.dirname(@location)\n el... |
2499d36f554b92f6d527089ba823ebef | TODO(lingshi) Remove these dummy methods when grpc/9033 is fixed. These methods should never be called, so they will just fail the tests with "unimplemented" errors.. | [
{
"docid": "ed9d410d8503fbeee04aad3888da9993",
"score": "0.0",
"text": "def _undefined\n raise \"Method #{__callee__} is unimplemented and needs to be overridden.\"\n end",
"title": ""
}
] | [
{
"docid": "d5e6fcad531435d87b3763b42690fa1d",
"score": "0.6705911",
"text": "def mock_error_type\n GRPC::BadStatus\n end",
"title": ""
},
{
"docid": "6513ed80c07083afaa67e08a17d5b972",
"score": "0.63444126",
"text": "def stubbed?; end",
"title": ""
},
{
"docid": "0c8... |
74788d759a35a567a89bac58559b9ff6 | PATCH/PUT /seeker_skill_sets/1 PATCH/PUT /seeker_skill_sets/1.json | [
{
"docid": "a4f6979daba0009ea9a3bf132d58499d",
"score": "0.75944203",
"text": "def update\n respond_to do |format|\n if @seeker_skill_set.update(seeker_skill_set_params)\n format.html { redirect_to @seeker_skill_set, notice: 'Seeker skill set was successfully updated.' }\n format.j... | [
{
"docid": "86cf2d730cf06643e23f53f7d688e560",
"score": "0.74443495",
"text": "def update\n @skillset = Skillset.find(params[:id])\n\n respond_to do |format|\n if @skillset.update_attributes(params[:skillset])\n format.html { redirect_to @skillset, notice: 'Skillset was successfully up... |
4065655d7695401cdd538b2a1a36f8be | DELETE /timelines/1 DELETE /timelines/1.json | [
{
"docid": "1f7ebc42feb0a03bf3e3123f6383000f",
"score": "0.7452361",
"text": "def destroy\n @timeline = Timeline.find(params[:id])\n @timeline.destroy\n\n respond_to do |format|\n format.html { redirect_to timelines_url }\n format.json { head :no_content }\n end\n end",
"title... | [
{
"docid": "354f87e448a60808c2d54b0b3d978557",
"score": "0.77132434",
"text": "def destroy\n @time_line.destroy\n respond_to do |format|\n format.html { redirect_to time_lines_url, notice: 'Time line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
... |
c3fbd78a8cfc546b7c4fdd9e0f65ef77 | Set the list of commands to process the movie frame. Required. This will overwrite any commands that might have already been added to the commands list. Alternative to using add_command. | [
{
"docid": "d27111778ac681abb598eaaaeb124b57",
"score": "0.694049",
"text": "def commands=(commands)\n @instructions[:commands] = commands\n commands\n end",
"title": ""
}
] | [
{
"docid": "ac0023bc9ad4fe5f071c22bb38cd3c01",
"score": "0.6914098",
"text": "def commands=(commandList)\n @commandsHash[:commands] = commandList\n end",
"title": ""
},
{
"docid": "092a0ec56e64c506520bde7d597caff3",
"score": "0.6872117",
"text": "def set_command\n @com... |
67c62c5b8672b8eeea00103f9f31198a | PATCH/PUT /pengguna/1 PATCH/PUT /pengguna/1.json | [
{
"docid": "59508281a7ce0389cd88bf6196563b7e",
"score": "0.6699924",
"text": "def update\n respond_to do |format|\n if @pengguna.update(pengguna_params)\n format.html { redirect_to @pengguna, notice: 'Pengguna was successfully updated.' }\n format.json { render :show, status: :ok, ... | [
{
"docid": "e8cfdce5b0eeeba4fc38e063721573ed",
"score": "0.66594833",
"text": "def update\n @jogo = Jogo.find(params[:id])\n \n respond_to do |format|\n if (@jogo.update_attributes(params[:jogo]))\n \n # format.json { render :json => { :success => true, :jogo_id => @jogo.id, :... |
2ff7087e1a738c7b3a397d1f464d60b2 | This method has the contract that if a string `ref` refers to a record `record`, then `class.parse_symbol(ref) == record_identifier(record)`. See note in `parse_symbol` above | [
{
"docid": "abc0253fd36f3c62f45e9f9d8504d814",
"score": "0.0",
"text": "def record_identifier(record)\n { milestone_iid: record.iid, milestone_name: record.name }\n end",
"title": ""
}
] | [
{
"docid": "3a8c0b586a375f06fdbe2024af96c559",
"score": "0.5817681",
"text": "def isSref\n @RecordType == SREF\n end",
"title": ""
},
{
"docid": "5dbb0029b4abe10baa0ecf367762b027",
"score": "0.5760921",
"text": "def parse_ref!\n if ref?\n split_ref(ref)\n elsif s... |
27d0b54c82048975a0dcc548d1ce6f0f | Return parameters for URL generation. | [
{
"docid": "e1bc1c444809e204159c2d3435c89465",
"score": "0.0",
"text": "def sort_by(column)\n column = column.to_s\n\n direction = next_dir(column)\n column = direction && column\n\n { 'sort' => column, 'dir' => direction }\n end",
"title": ""
}
] | [
{
"docid": "0dad0a0018c0705193390ca28c3d4213",
"score": "0.74857",
"text": "def parameters\n url_params = \"\"\n\n if @resource == :catalog\n url_params += \"&\" + \"offset=#{URI.escape(@offset.to_s)}\" if @offset\n url_params += \"&\" + \"size=#{URI.escape(@size.to_s)}\" ... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "e5766609f9bcc6156e50c816e61455e3",
"score": "0.0",
"text": "def project_news_params\n params.require(:project_news).permit(:date, :content, :tags)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.requ... |
7f0b1cd6b5228acdbf147265fe3db81c | Answer: => "Chris plays basketball for U of A!" 12) What will this code return? | [
{
"docid": "752e55d04d64de060fb883055db93d9f",
"score": "0.0",
"text": "def amethod(param)\n param = \"Tealeaf\"\nend",
"title": ""
}
] | [
{
"docid": "f5787a7eb3d6a27244022407d6c0ed72",
"score": "0.6378734",
"text": "def quote_1\n \"There are some things you can't share without ending up liking each other, and knocking out a twelve-foot mountain troll is one of them.\"\n end",
"title": ""
},
{
"docid": "d58cc2c58e5739cb77bc... |
4085bc0b7e3305545fbd7805d855c8b0 | GET /vagas/1 GET /vagas/1.json | [
{
"docid": "2b91661bb6524eb3edfab8ab979dbe7b",
"score": "0.72943234",
"text": "def show\n\t\t@vaga = Vaga.find(params[:id])\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json { render json: @vaga }\n\t\tend\n\tend",
"title": ""
}
] | [
{
"docid": "521d56513e668834dc5703bde1d263aa",
"score": "0.7446708",
"text": "def index\n @vagas = Vaga.all\n end",
"title": ""
},
{
"docid": "556520ed453d490fa956e32cde624b14",
"score": "0.74299854",
"text": "def show\n @vaga = Vaga.find(params[:id])\n\n respond_to do |for... |
d209d32320ac96aea0e781941f560038 | Turns an SQL query into a regular expression: Handles quotes (differing depending on DBMS). Handles round brackets (escaping with backslash to make them literals). Removes line breaks and double spaces (allowing use of intendation and line continuation) Returns the regular expression created from the provided +sql+ str... | [
{
"docid": "49682cd93560cdfe0f5026c322f071f4",
"score": "0.80752695",
"text": "def sql_to_regexp(sql)\n Regexp.new(sql.strip.squeeze(\" \") \\\n .gsub(\"(\", \"\\\\(\").gsub(\")\", \"\\\\)\") \\\n .gsub(\"'\", 'E?.') \\\n .gsub('\"', 'E?.'))\nend",
"title": ""
}
] | [
{
"docid": "f73a19093955f66f570ebfdfbf7b0551",
"score": "0.62112635",
"text": "def tokens(sql)\n sql.scan(%r{\n (\n -- .* (?# matches \"--\" style comments to the end of line or string )\n | - (?# matches sin... |
bbcfe36a865a05138b0eac56ed58a812 | GET /networks/1 GET /networks/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "e760c92c34ad662c8232e3e263ead4da",
"score": "0.7135568",
"text": "def index\n @networks = Network.all\n end",
"title": ""
},
{
"docid": "e760c92c34ad662c8232e3e263ead4da",
"score": "0.7135568",
"text": "def index\n @networks = Network.all\n end",
"title": ""
... |
47612ddc00bd97195f85a15bf29f2bbe | Gets the device screen height and returs it as Integer | [
{
"docid": "e1391f7de970f9f635e6bbc5816270d1",
"score": "0.64984775",
"text": "def height\n @height ||= size.last.split('x').last.strip!.to_i\n end",
"title": ""
}
] | [
{
"docid": "83bce90d33d9f8e64403dd30792c41af",
"score": "0.85917777",
"text": "def screen_height\n run_script(\"return screen.height;\")\n end",
"title": ""
},
{
"docid": "b45c520181c529b25c26432d64e09ad5",
"score": "0.8543903",
"text": "def screen_height\n return exec... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "4fc110c86f62b9d0829ea96dd3198987",
"score": "0.0",
"text": "def update!(**args)\n @content_type = args[:content_type] if args.key?(:content_type)\n @data = args[:data] if args.key?(:data)\n @extensions = args[:extensions] if args.key?(:extensions)\n end",
... | [
{
"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... |
57c170dfa45e4bee0a05774b57a5aee4 | Complete the miniMaxSum function below. | [
{
"docid": "babe2a476368c0134091a575fba3851b",
"score": "0.72827023",
"text": "def miniMaxSum(arr)\n min = 10**9 + 1\n max = 0\n sum = 0\n\n arr.each do |num|\n sum += num\n max = num if num > max\n min = num if num < min\n end\n\n print sum - max\n print ' '\n print sum - min\nend",
... | [
{
"docid": "429094712e676221feba6f01d4a1e4a2",
"score": "0.7696268",
"text": "def miniMaxSum(arr)\n\nmaxSum = arr.inject(0, :+) - arr.max\n\nminiSum = arr.inject(0, :+) - arr.min\n\n puts \"#{maxSum} #{miniSum}\" \n end",
"title": ""
},
{
"docid": "e171f2e7a3e3ad2aee632636443868bb",
"sco... |
a78d7c4c1165d3ff99655f33bc1ec94b | Making "internal" methods private is not required, but is a common practice. This helps make clear which methods respond to requests, and which ones do not. | [
{
"docid": "e635631e237d6ee065e62f13723d60e4",
"score": "0.0",
"text": "def fluffy_params\n params.require(:fluffy).permit(:name, :budget, :remaining_budget, :fluffy_coin, :password, :id)\n end",
"title": ""
}
] | [
{
"docid": "bf92e90603a5ee2dc0876a6d03f92775",
"score": "0.81095356",
"text": "def a_private_method\n\tend",
"title": ""
},
{
"docid": "24f63369e4a36ccdca81610b9d5db49f",
"score": "0.7902477",
"text": "def private_method\n end",
"title": ""
},
{
"docid": "24f63369e4a36cc... |
c76e1731a0143c4d19134963520bb59e | GET /coordenadores GET /coordenadores.json | [
{
"docid": "cbb0441915ac4ca7e1a4de8819ba5657",
"score": "0.69377315",
"text": "def index\n authorize! :admin, Coordenador\n \n @coordenadores = Coordenador.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @coordenadores }\n end\n end",
... | [
{
"docid": "42a3bf0593e23dbdb4e1f6d01fb1c93a",
"score": "0.710266",
"text": "def index\n @coordenador_estagios = CoordenadorEstagio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @coordenador_estagios }\n end\n end",
"title": ""
},
... |
6db40965cd70e77d3f7e933426a2575c | Return the plural of the given noun +phrase+ if +count+ indicates it should be plural. | [
{
"docid": "d000e3dace95935c2ff8c59912254667",
"score": "0.79402363",
"text": "def plural_noun( phrase, count=nil )\n\t\tmd = /\\A(\\s*)(.+?)(\\s*)\\Z/.match( phrase.to_s )\n\t\tpre, word, post = md.to_a[1,3]\n\t\treturn phrase if word.nil? or word.empty?\n\n\t\tplural = postprocess( word, pluralize_nou... | [
{
"docid": "cfa9a639a8c4fb2f71ea854bcef2148d",
"score": "0.84250844",
"text": "def plural( phrase, count=nil )\n\t\tphrase = numwords( phrase ) if phrase.is_a?( Numeric )\n\n\t\tmd = /\\A(\\s*)(.+?)(\\s*)\\Z/.match( phrase.to_s )\n\t\tpre, word, post = md.to_a[1,3]\n\t\treturn phrase if word.nil? or wor... |
69147248ec8ef847493c5e3c887a1831 | Returns the value of attribute spawned. source://puma//lib/puma/thread_pool.rb70 | [
{
"docid": "69be5c5209a098f2171eb8f8690b2dd0",
"score": "0.51021606",
"text": "def spawned; end",
"title": ""
}
] | [
{
"docid": "2113a12774974ef1fbc57c0933ae11af",
"score": "0.63926095",
"text": "def value\n @thread_to_join.join\n super\n end",
"title": ""
},
{
"docid": "aeba2db12ede4239850fdcb857dc63b9",
"score": "0.5829291",
"text": "def process_status\n @wait_thr.value\n end",
... |
9585c6e347543af6a5a91105afc3cb38 | zero or more things | [
{
"docid": "4fbc2de3dd08d689b5f3eaf6d4402832",
"score": "0.0",
"text": "def zero_or_more\n @zero_or_more ||= Saxon::S9API::OccurrenceIndicator::ZERO_OR_MORE\n end",
"title": ""
}
] | [
{
"docid": "523b091c88eea5db78943378db064e54",
"score": "0.63380504",
"text": "def anything; end",
"title": ""
},
{
"docid": "cfc9bc3b89d9e193528805224c0d15cd",
"score": "0.6262684",
"text": "def just?; end",
"title": ""
},
{
"docid": "cfc9bc3b89d9e193528805224c0d15cd",
... |
03e90af0631e82a5fe14792ad8817dd9 | Is the user a member of an organization which is on the development team for this development? | [
{
"docid": "1522acb4ee219638170ac89f08916f85",
"score": "0.7993976",
"text": "def member_of_development_team?(development)\n (organizations & development.team_members).any?\n end",
"title": ""
}
] | [
{
"docid": "6808422a32a7b603dc0810c2dd64c83d",
"score": "0.7928616",
"text": "def member?\n client.organization_member? org_id, github_user.login\n end",
"title": ""
},
{
"docid": "bff3286727a948f0e332b6cb35138b95",
"score": "0.7681347",
"text": "def manage_organization?\n ... |
ac7725c90f2494a61bb179808bcb1e13 | Adds the specified User to the specified group. iam.add_user_to_group('kd', 'kd_test_1') => true | [
{
"docid": "eaa79b91756e618ba22a7814ddef8e4f",
"score": "0.79933405",
"text": "def add_user_to_group(user_name, group_name)\n request_hash = { 'UserName' => user_name,\n 'GroupName' => group_name }\n link = generate_request(\"AddUserToGroup\", request_hash)\n reques... | [
{
"docid": "98323b46b993b7370119ce7c15ba715a",
"score": "0.7911131",
"text": "def add_user(group_id, user_id)\n response = @client.post(\"groups/#{group_id}/users/#{user_id}\")\n verify response,\n forbidden: 'You do not have permission to add users to a group',\n not_f... |
476a3b7379043095cf1a74c48bceb660 | Save it to the profile DB POST to /users/:user_id/profile | [
{
"docid": "ec526b86c168f4b75b1b6014fa50c2d2",
"score": "0.6673237",
"text": "def create\n # Ensure that we have the user who is filling out form\n @user = User.find(params[:user_id])\n \n # This will link the profile to the user that is logged in\n @profile = @user.build_profil... | [
{
"docid": "15bbfe255863808cb159dc2e32136297",
"score": "0.82339597",
"text": "def save(_user_profile_obj); end",
"title": ""
},
{
"docid": "c19407a8b72e7260c2605a24d9d1c4c4",
"score": "0.762854",
"text": "def save\n params = {\n firstname: self.firstname,\n lastname: se... |
f61ad6cb02299aee0223e10fd1b9be16 | DELETE /bookings/1 DELETE /bookings/1.json | [
{
"docid": "7fabc4cec3f2c77039b8353c790a1a8e",
"score": "0.73319197",
"text": "def destroy\n @booking = Booking.find(params[:id])\n @booking.destroy\n\n respond_to do |format|\n # _url which returns the same path prefixed with the current host, port and path prefix\n format.html { red... | [
{
"docid": "899ffdf005df064f4dbab155002fe202",
"score": "0.7660707",
"text": "def destroy\n @booking = Booking.find(params[:id])\n @booking.destroy\n\n respond_to do |format|\n format.html { redirect_to bookings_url }\n format.json { head :no_content }\n end\n end",
"title": "... |
f55594724e63c17b97b1b50bc8d324bb | takes in team name and returns an Array of the jersey numbers for that team. | [
{
"docid": "3349c5495c2289e496d109e142adb70f",
"score": "0.65768546",
"text": "def player_numbers(team_name)\n #return array of player numbers\n player_numbers = []\n game_hash.collect do |location, info|\n info.collect do |info, data|\n if data == team_name\n game_hash[location][:play... | [
{
"docid": "3644f248801731c6431bea82d4cf67c7",
"score": "0.7672993",
"text": "def player_numbers(name_of_team)\n\tarray_of_jersey_numbers = []\n\tgame_hash.each do |team, team_information|\n\t\tif name_of_team == team_information[:team_name]\n\t\t\tteam_information[:players].each do |player_stat|\n\t\t\... |
2565a876070acf85f75e53d848c9061c | This specifies whether POSIM is tracking inventory in stock or not. If true, then whenever a sale is made, the quantity will decrease in stock. If this is false, the quantity in stock will NOT decrease if an item is sold. | [
{
"docid": "d190f16337a9b68db2e3a00a23aa2f35",
"score": "0.6952736",
"text": "def track_inventory?\n @fields[17] == 'Y'\n end",
"title": ""
}
] | [
{
"docid": "d7b38b58ab9a15d1dba96e2029069c9f",
"score": "0.7439088",
"text": "def in_stock?\n has_inventory? 1\n end",
"title": ""
},
{
"docid": "9da826753a3ee7036c8e06be351964d2",
"score": "0.73816097",
"text": "def tracking_inventory?\n respond_to?(:stock_levels) and n... |
52c2404f10030826eb476aa225e6684a | Handles the teardown request. | [
{
"docid": "afcc862f4399e76609b9808704267e14",
"score": "0.71429807",
"text": "def teardown(request)\n RTSP::Server.log \"Received TEARDOWN request from #{request.remote_host}\"\n sid = request.session[:session_id]\n @stream_server.stop_streaming sid\n\n [[]]\n end",
"title": ... | [
{
"docid": "5efff09beaca71b1262ee52ac044fd08",
"score": "0.71770865",
"text": "def teardown_test\n response = @http.post(\"session/test/tearDownTest\")\n msg response, Logger::DEBUG\n return response\n end",
"title": ""
},
{
"docid": "e17ace45d0afdc16f7927f9145dc42c0",
"score":... |
a5d8846f8bfb218fe83a704b89d59c13 | method to set localhost mode features by reading the given .splits | [
{
"docid": "0aa76c21f1c0d1d8bf1b276ff89398be",
"score": "0.7406608",
"text": "def load_localhost_mode_features(splits_file, reload_rate = nil)\n return @localhost_mode_features unless File.exists?(splits_file)\n\n store_features(splits_file)\n\n return unless reload_rate\n\n Thread.n... | [
{
"docid": "ce543dd51003b73fa43d8efd3731a474",
"score": "0.7490896",
"text": "def initialize(splits_file, reload_rate = nil)\n @localhost_mode = true\n @localhost_mode_features = []\n\n load_localhost_mode_features(splits_file, reload_rate)\n end",
"title": ""
},
{
"docid":... |
83473fce4278a063f326b4467e395580 | init_board() sets the board to the initial game state. | [
{
"docid": "f97fca710df5adbbfbdddabab1bcbd14",
"score": "0.7661623",
"text": "def init_board()\n 64.times{|i|\n @color[i] = INIT_COLOR[i]\n @piece[i] = INIT_PIECE[i]\n }\n @side = LIGHT\n @xside = DARK\n @castle = 15\n @ep = -1\n @fifty = 0\n @ply = 0\n @hply = 0\n ... | [
{
"docid": "760b414026f30803bd3932094954185b",
"score": "0.7900534",
"text": "def initalize_board\n\t\t@board = Board.new()\n\tend",
"title": ""
},
{
"docid": "6c92f20880e6eda26d4150f149d1962f",
"score": "0.7678102",
"text": "def initialize_board\n $board_position_def = ['1','... |
766e8652381f5b3e7f0742c692aa5847 | PATCH/PUT /profiles/1 PATCH/PUT /profiles/1.json | [
{
"docid": "38a1b8ad8f05a3cb20e7f1072a23dd94",
"score": "0.6652365",
"text": "def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to [@stakeholder, @profile], notice: 'Profile was successfully updated.' }\n format.json { render :show, s... | [
{
"docid": "c44d011e19e8ff28933f581483bfaa70",
"score": "0.7385554",
"text": "def update\n @profiles = current_user.profiles.find(params[:id])\n\n respond_to do |format|\n if @profiles.update(profile_params)\n format.html { redirect_to profiles_path, notice: 'Profile was successfully u... |
c4656aa0e9c692e679ee11225b739695 | Create the google books api URL | [
{
"docid": "bda334e61017ecf775e1284ffc7e2db0",
"score": "0.79005736",
"text": "def create_google_books_url(search_term)\n url = GOOGLE_BOOKS_API_BASE_URL + search_term.gsub!(\" \", \"+\")\n return url\nend",
"title": ""
}
] | [
{
"docid": "a285594c929474dc3a55767fd6bc50e6",
"score": "0.75555605",
"text": "def build_url(search_terms)\n url = GOOGLE_BOOKS_API_BASE_URL + search_terms.gsub(\" \", \"+\")\nend",
"title": ""
},
{
"docid": "51e7b094700d5ec0879f873818c724e7",
"score": "0.71662074",
"text": "def a... |
b05b8f157bb7613a73f8ff5082445f02 | standard error values include: :invalid_request, :invalid_client, :invalid_token, :invalid_grant, :unsupported_grant_type, :invalid_scope | [
{
"docid": "483193fe0c87f7b91ead36a88607190f",
"score": "0.0",
"text": "def initialize(response)\n response.error = self\n @response = response\n\n if response.parsed.is_a?(Hash)\n @code = response.parsed['error']\n @description = response.parsed['error_description']\n ... | [
{
"docid": "53e3dc5f131d2ad96ca6182bd9ccae0c",
"score": "0.73934215",
"text": "def specific_oauth_error(resp, error_code, context); end",
"title": ""
},
{
"docid": "78b1f2cc781748f569742c840af1e54a",
"score": "0.7154336",
"text": "def invalid_oauth_response; end",
"title": ""
}... |
af1e0dd41138505cab009acf26660db8 | similar to the original pruning but accounts for threadbased workers | [
{
"docid": "6df45cb37f369625cb867acd603c9766",
"score": "0.6469455",
"text": "def prune_dead_workers\n all_workers = self.class.all\n return if all_workers.empty?\n known_workers = JRUBY ? worker_thread_ids : []\n pids = nil, hostname = self.hostname\n all_workers.each do |worke... | [
{
"docid": "f0206178be59164ba93de2d72387dda6",
"score": "0.7360512",
"text": "def prune\n @lock.synchronize do\n @workers.delete_if { |w| !w.alive? }\n @size = @workers.size\n end\n end",
"title": ""
},
{
"docid": "db9ed6794624f3ddb11d8d5b53f04bd3",
"score": "0... |
0e557f7962f36cf93546d1db786fd218 | POST /askquestions POST /askquestions.json | [
{
"docid": "5a32e811c8a139d8af015d06c92e12c8",
"score": "0.689064",
"text": "def create\n @askquestion = Askquestion.new(askquestion_params)\n\n respond_to do |format|\n if @askquestion.save\n format.html { redirect_to @askquestion, notice: 'Askquestion was successfully created.' }\n ... | [
{
"docid": "7f16d949b67a6eea5421953eaaf058e5",
"score": "0.70313",
"text": "def create\n @question = Question.new(question_params)\n \n # if question is alternativce\n if @question.style == Question::STYLE_CHOICE\n # register each response\n if not params[:choices].nil?\n pa... |
b8245725d5f68fafa8ffcd0104a8104c | Helper methods for running jobs on designs | [
{
"docid": "6349a5311fc2c90e74e7e6ac43d14726",
"score": "0.0",
"text": "def reextract\n # delete sif files and extracted folder and start again\n sif_file = self.get_sif_file_path\n extracted_folder = self.store_extracted_key\n tmp_folder = Rails.root.join 'tmp', 'store', self.store_key_pref... | [
{
"docid": "66978ca3f56b9174b77da3e4cb7f4b1b",
"score": "0.7105538",
"text": "def jobs; end",
"title": ""
},
{
"docid": "66978ca3f56b9174b77da3e4cb7f4b1b",
"score": "0.7105538",
"text": "def jobs; end",
"title": ""
},
{
"docid": "2accf5741753dbe1ce34a4fc7b00fb9b",
"sc... |
f5594e485204a148e9f8f30a74e4fda9 | GET /class_spells/1 GET /class_spells/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "9fde623094d7c16c3fc8285af8399698",
"score": "0.7770642",
"text": "def index\n @class_spells = ClassSpell.all\n end",
"title": ""
},
{
"docid": "b50b42b5b660db375d5bd4524b81f8d2",
"score": "0.75703365",
"text": "def spells\n get_schools\n get_classes\n\n respo... |
1aa02698c15f2aabbd220350288c9ecd | A two element array of blocks created by cutting the other block out of this one. | [
{
"docid": "c88675bbf0c1843c0ee9e1f88c0e343e",
"score": "0.75470006",
"text": "def split(other)\n [Block.new(top, other.top), Block.new(other.bottom, bottom)]\n end",
"title": ""
}
] | [
{
"docid": "81c1c4423814079a3ad9a4ad55d2fd43",
"score": "0.7586729",
"text": "def split (other)\n [Block.new(top, other.top), Block.new(other.bottom, bottom)]\n end",
"title": ""
},
{
"docid": "81c1c4423814079a3ad9a4ad55d2fd43",
"score": "0.7586729",
"text": "def split (other)\n ... |
d35cfb94206a6c4e1222b7a4c808450a | Goal2: methods that use puts (UI methods) should not be mixed up with the logic of the program App Logic there should be no puts Returns the number of bottles a user can buy directly with an amount of money | [
{
"docid": "75313db09d2307619afe7811d50ffd5a",
"score": "0.6634417",
"text": "def bottles_from_purchase(money)\n money / 2\nend",
"title": ""
}
] | [
{
"docid": "2344cebda2c484fbc82e1b85085842ab",
"score": "0.66400146",
"text": "def total_display\n\tputs \"Your order is:\"\n\tputs \"and your total cost is:\"\n\t# readback_full_order and cost\n\n\n\t# include a sum of calories, etc\n\t# check against User's allowance (\"wallet\")\nend",
"title": "... |
a33dc87e1a35fd63f27e2a94ef89ea3f | PUT /projects/1 PUT /projects/1.xml | [
{
"docid": "7682219c57ab57cf35676f18a6b2934e",
"score": "0.6558862",
"text": "def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n flash[:notice] = 'Project was successfully updated.'\n format.html { red... | [
{
"docid": "17cef175c9f11b48ca6b985da2df6bf8",
"score": "0.7397803",
"text": "def update_project\n @user = User.find_by_username(session['user'])\n @access_token = OAuth::AccessToken.new(UsersController.consumer, @user.token, @user.secret)\n @response = UsersController.consumer.request(:put, \"... |
7de4f532d6f2bbbb5dd21b5834a52437 | Write your code here. | [
{
"docid": "0481cae89d34798c8b1e05552e6bb00d",
"score": "0.0",
"text": "def dictionary\n dictionary={\"hello\":\"hi\",\n \"to\":\"2\",\n \"two\":\"2\",\n \"too\":\"2\",\n \"for\":\"4\",\n \"For\":\"4\",\n \"four\":\"4\",\n \"be\":\"b\",\n \"you\":\"u\",\n \"at\":\"@\",\n \... | [
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"score": "0.7117752",
"text": "def code; end",
"title": ""
},
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"score": "0.7117752",
"text": "def code; end",
"title": ""
},
{
"docid": "f45f5fa6d32a5d296e5153caa3d92701",
"sc... |
269a3ece4ebf65654b48e0a077a5d2d7 | Returns Yes & No instead of true & false | [
{
"docid": "f6c56d15f918d290bb219bef84547c90",
"score": "0.7252347",
"text": "def human_boolean(boolean)\n\t\tboolean ? \"Yes\" : \"No\"\n\tend",
"title": ""
}
] | [
{
"docid": "779d0a372fab5081393350c75601d87e",
"score": "0.7837793",
"text": "def active_yes_no?\n active? ? \"Yes\" : \"No\"\n end",
"title": ""
},
{
"docid": "b2e7dccc56ab0367655d99dcf9e9c9e8",
"score": "0.77198035",
"text": "def yes_no?\n return self.question_type == 'Yes/N... |
3b9aeb1da727ec0ec2056aec14f38070 | DELETE /donors/1 DELETE /donors/1.json | [
{
"docid": "a8f5a24b1b18f95e358c4e4d819b06f5",
"score": "0.7538059",
"text": "def destroy\n # @donor = Donor.find(params[:id])\n @donor.destroy\n\n respond_to do |format|\n format.html { redirect_to donors_url }\n format.json { head :ok }\n end\n end",
"title": ""
}
] | [
{
"docid": "a384de8b665063054e9ee34797f6f9ff",
"score": "0.72171766",
"text": "def destroy\n @donate.destroy\n\n respond_to do |format|\n format.html { redirect_to(donates_url) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a384de8b665063054... |
58feac574e1389b1fd29736f8a9de2b2 | Perform an HTTP request | [
{
"docid": "65647774f23fbf9c525fe50c2d0ec4b3",
"score": "0.0",
"text": "def request(method, path, options={}, raw=false)\n response = connection(raw).send(method) do |request|\n case method\n when :get, :delete\n request.url(path, options)\n when :post, :put\n ... | [
{
"docid": "e4e961ad065b33c3e715b929f44dab3a",
"score": "0.7807713",
"text": "def do_request()\n uri = URI.parse(API_BASE_URL + build_request_path())\n response = Net::HTTP.get_response(uri)\n response.body\n end",
"title": ""
},
{
"docid": "2ba260502f9375d41a6d0c0323e7506f... |
2eec43d04b6e48b6e061e4be9b46376f | Take a multiplier and a time, then returns a new interval. | [
{
"docid": "770c36fdf357a2db64e8af948ce763fc",
"score": "0.6691957",
"text": "def create_interval(multiplier, current_time = Time.now)\n seconds_ago = time_since_review(current_time)\n new_interval = seconds_ago * multiplier\n self.review_due_at = current_time + new_interv... | [
{
"docid": "eab8caefb217131c32c41a7242d9058f",
"score": "0.61210525",
"text": "def every!(time, &block)\n Interval.new(@native, time, &block)\n end",
"title": ""
},
{
"docid": "eab8caefb217131c32c41a7242d9058f",
"score": "0.61210525",
"text": "def every!(time, &block)\n Interv... |
c58eaee96b7a7c2f02d1ece3ed46df58 | According to The weaker the signal, the larger our standard deviation. This makes sense, because at strong signals, the distance is inverse logarithmically related to the signal strength. We use a gaussian random distribution with the following standard deviation: | [
{
"docid": "4f792a868434c7092947453d865184a2",
"score": "0.60001725",
"text": "def randomize_signal_strength(rss)\n @logger.debug(\"Randomizing signal strength at #{rss}\")\n @logger.data(:MapEngine, :randomize_signal_strength, rss)\n stddev = 0.0497 * rss + 6.3438\n theta = 2 * Math... | [
{
"docid": "86432827feb2d844774d8df16b658dfd",
"score": "0.7077646",
"text": "def gaussian_rand\n begin\n u1 = 2 * rand() - 1\n u2 = 2 * rand() - 1\n w = u1*u1 + u2*u2\n end while (w >= 1)\n w = Math.sqrt((-2*Math.log(w))/w)\n u1*w\nend",
"title": ""
},
{
"do... |
639d94989587e9b8c60eeee9b31504a8 | checks if the version is valid | [
{
"docid": "25eafbf9fbb233f5830fccc6a19db6a8",
"score": "0.0",
"text": "def valid?\n not invalid?\n end",
"title": ""
}
] | [
{
"docid": "36f2fe823d39b5ad04df522aac691275",
"score": "0.8178167",
"text": "def valid_version?\n !statement[\"ver\"].empty?\n end",
"title": ""
},
{
"docid": "3a283e32d5411932f832168ddcdb5c0e",
"score": "0.79190594",
"text": "def check_version(v)\n return true... |
1e3e582c7212ecd049cf4fd79607ec3a | POST /creative_activities POST /creative_activities.json | [
{
"docid": "04e6bb107d3c987b3e2f2f7aff0860cc",
"score": "0.7108427",
"text": "def create\n @creative_activity = CreativeActivity.new(creative_activity_params)\n\n respond_to do |format|\n if @creative_activity.save\n\n\n format.html { redirect_to @creative_activity, notice: '创意活动创建成功' ... | [
{
"docid": "ca1a0a6a1f583bf92f165b5025ff26ec",
"score": "0.72578716",
"text": "def create\n @activity = current_user.activities.new(activity_params)\n\n if @activity.save\n render json: @activity, status: :created, location: @activity\n else\n render json: @activity.errors, status: :u... |
f954f9853b3533abfc6a6d65399c1d75 | DELETE /parts/1 DELETE /parts/1.json | [
{
"docid": "3b62c1821d5f4215017f51ac26e55468",
"score": "0.76590216",
"text": "def destroy\n @part = Part.find(params[:id])\n @part.destroy\n\n respond_to do |format|\n format.html { redirect_to parts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "98c8a42874119775efebb5f4514e60c3",
"score": "0.7660078",
"text": "def destroy\n @part = Part.find(params[:id])\n @part.destroy\n\n respond_to do |format|\n format.html { redirect_to parts_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"doci... |
09897c2b0e434f405e237403f9fdc1be | Returns true if the job logging started | [
{
"docid": "e93daf22c091a9a35d659c82cbe3f806",
"score": "0.0",
"text": "def job_started_at\n Thread.current[:job_started_at]\n end",
"title": ""
}
] | [
{
"docid": "6c1a1782f02c2a4ebebaea3d5b7e8983",
"score": "0.7125",
"text": "def already_started?\n if started?\n ::NewRelic::Agent.logger.error('Agent Started Already!')\n true\n end\n end",
"title": ""
},
{
"docid": "c7c6f0c4e113cd41eb36b862e20e... |
61ba54125cfa3770c979442690d1b5af | Check if the lock has been taken. | [
{
"docid": "31d737cebb1c0a0230fef837ef2f52d4",
"score": "0.6596102",
"text": "def is_locked?\n File.exist?(@file_name)\n end",
"title": ""
}
] | [
{
"docid": "116c0db9a8070bd81cf78190d18ea9f2",
"score": "0.8275127",
"text": "def check_lock\n @locked = locked?\n end",
"title": ""
},
{
"docid": "8754ca6decb09264354583731190139c",
"score": "0.7971588",
"text": "def has_lock?\n @locked \n end",
"title":... |
8f7b31cb01b5dd42d493a1f3e65b9e26 | GET /itenvendas/1 GET /itenvendas/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "dc0f97010cb1acccb74c79f625be1bcd",
"score": "0.66422534",
"text": "def index\n @itenvendas = Itenvenda.all\n end",
"title": ""
},
{
"docid": "a4e7f7c243aaef4825cfba933794707e",
"score": "0.6439026",
"text": "def index\n @residencial = Residencial.find(params[:resid... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "cd0dc3bc8e222aaa185d6e28a2a814b4",
"score": "0.0",
"text": "def project_params\n params.require(:project).permit(:user_id, :stage_id, :subject, :description, :user_url, :development_url)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7496729",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6958585",
"text": "def strong_params\n params.require(:request).permit(param_white... |
af26becc21123dd23b1f12670b43b407 | Calculates the list price based on the difference between a 4year contract and a 3year contract. To work, there must be an HA104A3 or HA107A3 support | [
{
"docid": "3b342f851ede39395c8b88450e1895b2",
"score": "0.6997802",
"text": "def list_price\n support_product_number = type == 'hw' ? 'HA104A' : 'HA107A'\n year1 = PricingDbHpPrice.option_price(:product_number => support_product_number, :year => 1, :option_number => option_number)\n year3 = Pr... | [
{
"docid": "b2f1e172c1f1b3c1a22e263d1b19e2b2",
"score": "0.6183871",
"text": "def calculate_price\t\n\t\tnumber_of_days = calculate_number_of_days\n\t\tif number_of_days == FIRST_RANGE_LOWER_INTERVAL\n\t\t\tprice_time_component = @car.price_per_day\n\t\telsif number_of_days > FIRST_RANGE_LOWER_INTERVAL ... |
4e00a0fc32507ac6a96681778c2ae099 | Convert input image to PNG format Converts the input image into PNG format. Transparency is preserved when present. Supported input file formats include AAI, ART, ARW, AVS, BPG, BMP, BMP2, BMP3, BRF, CALS, CGM, CIN, CMYK, CMYKA, CR2, CRW, CUR, CUT, DCM, DCR, DCX, DDS, DIB, DJVU, DNG, DOT, DPX, EMF, EPDF, EPI, EPS, EPS2... | [
{
"docid": "0d5df2eb49abe0a72bc7fe2312fb9bb4",
"score": "0.56016433",
"text": "def convert_to_png_with_http_info(image_file, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ConvertApi.convert_to_png ...'\n end\n # verify the required par... | [
{
"docid": "768fc7ac644be67f2df82593427352f6",
"score": "0.6277595",
"text": "def convert_jpg_to_png(img_path)\n print_status(\"Converting #{img_path} back to PNG\")\n basename = File.basename(img_path, '.jpg')\n img = MiniMagick::Image.open(img_path)\n img.format('PNG')\n dst = \"#{WORKFOLDER}/#{b... |
4aec482fafa970db70bc3bce3f9d3c2f | methods for movie management | [
{
"docid": "a9c8175956009110fe07cc8ac9e05f46",
"score": "0.0",
"text": "def add_movie(movie:)\n raise 'cannot add existing movie' if\n movies.include? movie\n RepertoireMovie.create(\n repertoire: self,\n movie: movie\n )\n end",
"title": ""
}
] | [
{
"docid": "1d7e1b2562a6ff259d4abdb272abd37b",
"score": "0.818929",
"text": "def movie; end",
"title": ""
},
{
"docid": "8ebb63c254e719624b05163d170552b0",
"score": "0.70364815",
"text": "def movie\n @movie\n end",
"title": ""
},
{
"docid": "5391ccd70f49e9c490244d... |