query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
00c46a31502e04e3d33f71f592e6b163
Returns the news story post label (generic) from the news page
[ { "docid": "01c2275416a8630be45308a258dc18c8", "score": "0.8018949", "text": "def news_storypost_label\n $tracer.trace(__method__)\n return ToolTag.new(div.className(\"/gi-post/\").div.className(\"/full-post/\").innerText(\"/post-name/\"), __method__)\n end", "title": "" } ]
[ { "docid": "9828b3a2ab17f4d082d13db5a105192c", "score": "0.73344463", "text": "def podcasts_podcastsstory_label\n $tracer.trace(__method__)\n return ToolTag.new(div.className(\"/gi-post preview/\").div.className(\"/full-post/\").innerText(\"/post-name/\"), __method__)\n end", "title": "" },...
97819c62b251b7af3fe9b7246b6348c8
Set the value of the VendorDistrict input for this Choreo.
[ { "docid": "86cc062d464f77cc93665d2a74f3ef06", "score": "0.81114376", "text": "def set_VendorDistrict(value)\n set_input(\"VendorDistrict\", value)\n end", "title": "" } ]
[ { "docid": "d67e6798343c33ca98cea3b5c3cf4951", "score": "0.6468906", "text": "def set_RecipientDistrict(value)\n set_input(\"RecipientDistrict\", value)\n end", "title": "" }, { "docid": "d67e6798343c33ca98cea3b5c3cf4951", "score": "0.6468906", "text": "def set_RecipientD...
5203f41be129ead21dae8b011706b009
Returns whether the grid is released with an open license
[ { "docid": "fef144d4e2eb4fc50dffc0196a989b3c", "score": "0.84094405", "text": "def open_license?\r\n @open_license\r\n end", "title": "" } ]
[ { "docid": "81520a21e75241e62b60ac78ce79be12", "score": "0.7639153", "text": "def licenses_are_available?\n !License.find_available.empty?\n end", "title": "" }, { "docid": "79a0deaf86058d81e98d565ceef88e76", "score": "0.74546546", "text": "def required_license?\n return true ...
739a5bdaddf609f94150cebe800b1a5f
GET /google_sheets/1 GET /google_sheets/1.xml
[ { "docid": "7a0ae9c9ca791778b710b37158b875c0", "score": "0.6985328", "text": "def show\n @google_sheet = GoogleSheet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @google_sheet }\n end\n end", "title": "" } ]
[ { "docid": "76148b35cad751b63cf94a138e1ab59e", "score": "0.73262477", "text": "def index\n @google_sheets = GoogleSheet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @google_sheets }\n end\n end", "title": "" }, { "docid": "8...
5fac954cd455d08a6b8a66c0de2d65e8
:secret => 'e9ae622150c2b942594e00c1fc0073e6' See ActionController::Base for details Uncomment this to filter the contents of submitted sensitive data parameters from your application log (in this case, all fields with names like "password"). filter_parameter_logging :password Makes helpers available in controller used...
[ { "docid": "d7b5963b5fbc4fb21beb82d00d34b4c6", "score": "0.0", "text": "def help\n Helper.instance\n end", "title": "" } ]
[ { "docid": "06087a7dd43c16815eb98477d07d4114", "score": "0.71270126", "text": "def restricted_fields\n [:user_secret_id, :password]\n end", "title": "" }, { "docid": "a837fc0c0916549d3d2f7bb13627a199", "score": "0.707761", "text": "def hidden_keys\n\t\t[\"password\"]\n\te...
98cbc11e7058613a07eea07abcef383f
Create a new Break node.
[ { "docid": "d4c0c366f29c1c84764ebe416fb60773", "score": "0.6328472", "text": "def Break(arguments)\n Break.new(arguments: arguments, location: Location.default)\n end", "title": "" } ]
[ { "docid": "f89977dabd671619ed92ab0ce439f10e", "score": "0.702709", "text": "def visit_break(node); end", "title": "" }, { "docid": "21dd96351e037f0e995c77664ad9bd2e", "score": "0.651668", "text": "def breakInstruction\n # -> uncomment the next line to manually enable rule traci...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "db3b49452641431243084f450fb1e46f", "score": "0.0", "text": "def user_params\n params.fetch(:user).permit(\n :email, :phone, :password,\n :role_type,\n role_ids: []\n )\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69811666", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6782836", "text": "def strong_params\n params.requ...
cbcdefc4d30014798aa0d117c4830b46
this must be overriden in subclasses actually a subclass can call super()
[ { "docid": "e43ca2c35308a3bc312d46b8aa001c0a", "score": "0.0", "text": "def parse(page)\r\n #In future we will add some useful logic here\r\n #so, -- please call super(page) as a first row of your parse() method\r\n end", "title": "" } ]
[ { "docid": "2290804b238fc95bfd6b38f87c6d2895", "score": "0.8144995", "text": "def override; end", "title": "" }, { "docid": "170e7cc6f3b91fc8d88704f0d36db709", "score": "0.75976855", "text": "def initialize; super; end", "title": "" }, { "docid": "465936ef29dc887acdb2e6cb...
8f1aefb5245ba52b16819703f8d5d3f6
consonant character is doubled. Vowels (a,e,i,o,u), digits, punctuation, and whitespace should not be doubled.
[ { "docid": "35edf1edc3ea06c734476b8184731016", "score": "0.7366699", "text": "def double_consonants(string)\n doubled_string = ''\n string.chars.each do |char|\n doubled_string << char\n doubled_string << char if consonant?(char.downcase)\n end\n\n doubled_string\nend", "title": "" } ]
[ { "docid": "33f1a721e0ed5c693d2ec3567bca2956", "score": "0.77435964", "text": "def double_consonants(str)\n str.chars.each_with_object('') do |c, double_str|\n if c =~ /[^(aeiouAEIOU)|\\W|\\d]/\n double_str << c * 2\n else\n double_str << c\n end\n end\nend", "title": "" }, ...
b272b689267334222f62992a16e1f296
converts a filename into a page title
[ { "docid": "d3d2ce54491b181fc079df7b6fd36719", "score": "0.8389856", "text": "def file_to_pagename(filename)\n\t\tfilename.chomp(\".md\").gsub('_', ' ').capitalize\n\tend", "title": "" } ]
[ { "docid": "11646c8ca31925ea99c930bd91c4c23d", "score": "0.8100387", "text": "def title\n CGI::unescape(file_name.to_s).gsub(/\\.\\w+$/, '').titleize\n end", "title": "" }, { "docid": "11646c8ca31925ea99c930bd91c4c23d", "score": "0.810006", "text": "def title\n CGI::unes...
94444005f5c1c3f680c4196e8607c9df
Reads file from a folder and returns array of content lines. Strips leading and trailing whitespace, including newlines.
[ { "docid": "8291693306bbf51b6c5f91301d00e520", "score": "0.70520884", "text": "def read_file(file)\n lines = []\n IO.foreach(find(file)) do |line|\n lines << line.strip unless line.strip == ''\n end\n lines\n end", "title": "" } ]
[ { "docid": "2143b07e3f6ae4e612321f5b2d626f95", "score": "0.6945614", "text": "def getFileContent(dir, file):Array\n arr = Array.new\n File.open(\"#{dir}/#{file}\", \"r\").each do |line|\n arr.push line\n end\n arr\n end", "title": "" }, { "docid": "4bce1b59b562313c0b295c0f5...
346f209e755c3b7b2eb2d84af31b58b4
Defines a new set of settings which should be configrable from the settings page in the Shopr UI.
[ { "docid": "5793d088c08831d9ec49eaac0dcbe037", "score": "0.0", "text": "def add_settings_group(group, fields = [])\n settings_groups[group] ||= []\n settings_groups[group] = settings_groups[group] | fields\n end", "title": "" } ]
[ { "docid": "d90bce631f42a33e0aaec17963834e1b", "score": "0.68666166", "text": "def setup_settings\n\t\t\t\t@settings = {}\n\t\t\tend", "title": "" }, { "docid": "787fc9ccf33e1e3c10f2226bfff65724", "score": "0.6810743", "text": "def settings=(value)\n @settings = value\...
a51c811317b834fb8addb6276c3ebb8c
This one needs special handling, since it outputs one JSON object per line.
[ { "docid": "282d99e7eefdb86c24937038a9ab01a9", "score": "0.0", "text": "def servers\n @servers ||= execute_remote!(command(:servers)).each_line.map { |line| JSON.parse line }\n end", "title": "" } ]
[ { "docid": "36dcda355769d785f93bcb940fcb1e0b", "score": "0.70504797", "text": "def pretty_output\n JSON.pretty_generate(output)\n end", "title": "" }, { "docid": "7c3316506a06cec12bd78901499d8566", "score": "0.6929764", "text": "def formatJSON\n # @formattedContents = .... wha...
18e9af1e6e08031f0398addfd9fc12c3
Generate a random code for the user to guess.
[ { "docid": "cc7a3dbccf444cb86259ebaa04d92a09", "score": "0.73934567", "text": "def generate_code \n return (0..3).map { ['r','b','g','y','m','c'].to_a[rand(6)] }.join\n end", "title": "" } ]
[ { "docid": "42df6e2e4542ee27a633fa9e451c49e9", "score": "0.8383545", "text": "def generate_code\n puts 'Welcome to Mastermind!'\n 4.times do\n @code += rand(1..6).to_s\n end\n puts 'The secret code is a 4-digit number containing digits from 1 to 6.'\n puts 'The computer will give you...
36d78d9990922c7c2ecfa65337585fbd
our client sends us a csr, and we either store it for later signing, or we sign it right away
[ { "docid": "d8fcbccfd62730ea52737bdf0348eae4", "score": "0.6131364", "text": "def getcert(csrtext, client = nil, clientip = nil)\n csr = Puppet::SSL::CertificateRequest.from_s(csrtext)\n hostname = csr.name\n\n unless @ca\n Puppet.notice \"Host #{hostname} asked for signing from no...
[ { "docid": "f4b866deca61827718db315192ba958e", "score": "0.7860306", "text": "def send_csr\n MCProvision.info(\"Calling request_certificate\")\n request(\"request_certificate\")\n end", "title": "" }, { "docid": "8f9a1e2c62b649728448982db5ac3d14", "score": "0...
bac3d36fda9e6a07655ca804a7fe6119
won?: check to see for a winning combinations => board current board states <= win the winning combination <= nil if there is no winning combination
[ { "docid": "5b8ae0600357d62069738fa34e4d8d74", "score": "0.0", "text": "def won?(board)\n # select the indices containing X\n x_indices = (0..board.size-1).select{|i| board[i] == 'X'}\n o_indices = (0..board.size-1).select{|i| board[i] == 'O'}\n WIN_COMBINATIONS.each do |win|\n if win.to_set.subs...
[ { "docid": "4fb6ab969c6416146bb2b5dc62a10df4", "score": "0.84781486", "text": "def won?\n WIN_COMBINATIONS.detect do |win_combo|\n # The specific cell indexes for a given win combination\n win_index_1 = win_combo[0]\n win_index_2 = win_combo[1]\n win_index_3 = win_combo[2]\n\n ...
9dd97d786bf7def55a147ce6271c7a5f
Very simple breadcrumb generator trail: Hash eg breadcrumb('First bit' => first_path, 'Second bit' => second_path, 'Current page' => nil)
[ { "docid": "407e160e7b879dc18d6a390d7a1d8573", "score": "0.63821644", "text": "def breadcrumb(trail)\n fragments = trail.each.map do |title, href|\n \"<a href='#{href}'>#{title} <span class='glyphicon glyphicon-menu-right'></span></a>\"\n end\n\n \"<div class='breadcrumbs'>#{fragments.join...
[ { "docid": "c445373cc4a6f44d318369a7c65619db", "score": "0.7117687", "text": "def breadcrumb(*args)\n @breadcrumbs ||= []\n\n args.each_slice(2).map do |pair|\n crumb = Breadcrumb.new(title: pair[0], link: pair[1])\n @breadcrumbs.push crumb\n end\n end", "title": "" }, { ...
8e8139118119368fb83fd3398041dfd1
Create post splice that makes hashtag links external page
[ { "docid": "eff5a04d04c69cabc24456da982472af", "score": "0.67352307", "text": "def splice_posts_full(posts, spliced)\n # Split each post and map each piece of post to hashtag or URL if applicable\n posts.each do |post|\n post_spliced = post.text.split\n post_spliced.map! do |piece|\n ...
[ { "docid": "6501de5e4a200b74bb8b58c65d056721", "score": "0.70671165", "text": "def splice_posts(posts, spliced)\n \t# Split each post and map each piece of post to hashtag or URL if applicable\n \tposts.each do |post|\n \t\tpost_spliced = post.text.split\n \t\tpost_spliced.map! do |piece|\n \t\t\t#...
862d78d34e99a348f1a0113157cbfc42
Have the filter attributes saved as property list files files changed? 1. Convert the string of filter names into an array of filter names. 2. Save the attributes of a particular filter in a temporary property file. 3. Compare contents of file with previously saved filter attributes. 4. Delete the temporary file. 5. If...
[ { "docid": "1796bfc4926ededbf1bdb8f54db2a5cc", "score": "0.6074124", "text": "def test03()\n begin\n filters = $coreimagefilternames.split(\" \")\n # puts Dir.tmpdir()\n originalPath = File.join($directory, \n \"coreimagefilterattributes/PLISTFiles/\")\n filter...
[ { "docid": "38c1f462530958d0051d98d6ccc5b3cf", "score": "0.5851519", "text": "def update_filters(l_filter)\n handle_action_exceptions(__method__) do\n raise 'Filters file not valid.' unless File.exist?(l_filter)\n\n do_upload_and_update_filter(l_filter)\n @json ? { 'result' => 'Success...
43bc08681a8405239886c8e15d273f9d
PATCH/PUT /contratantes/1 PATCH/PUT /contratantes/1.json
[ { "docid": "99558e68eac284ffb290a6e763cb705f", "score": "0.6662462", "text": "def update\n respond_to do |format|\n if @contratante.update(contratante_params)\n format.html { redirect_to @contratante, notice: 'Contratante was successfully updated.' }\n format.json { render :show, s...
[ { "docid": "680ace4ad34ff19b0b4a14f18a3d79f5", "score": "0.6929673", "text": "def update\n @consumo = Consumo.find(params[:id])\n\n respond_to do |format|\n if @consumo.update_attributes(params[:consumo])\n format.html { redirect_to @consumo.cliente, :notice => 'Consumo alterado com su...
ca5d06461976081b0a6f7d6e7f07023d
Create a new Task attributes: description, priority, status, tag_names(Array), requester_id or requester_email, assigned_to_id or assigned_to_email external_id if status is null the Task is automatically put in the Feedback panel 'requester_email' can be any email address while 'assigned_to_email' needs to be of a curr...
[ { "docid": "7f45d7f27c191cb431d6b141d05a7a90", "score": "0.6334275", "text": "def create(project_id, attributes={})\n raw_response = post_request(\"projects/#{project_id}/tasks\", task: attributes)\n parse_response(raw_response)\n end", "title": "" } ]
[ { "docid": "42948ce70e2161d6400c82c89e1b6c6b", "score": "0.71614695", "text": "def create_task(name, tags= \"\", coworker_emails = \"\", reporter_emails = \"\")\n\n t = Task.new\n t.name = name\n t.tags = tags\n\n t._serialize\n\n\n Task._load(post_request(\"/users/#{@user_id}/tasks\", t....
4e35303c3190e1cdcc62119b4f664dc8
GET /travel_partners/1 GET /travel_partners/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "9ffbbbf6c58001f509a932d594c2e067", "score": "0.68258697", "text": "def index\n @partners = Partner.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @partners }\n end\n end", "title": "" }, { "docid": "621b3e5531c3c09b9...
14e83a3d93ce5ad10a35f8c74016463b
Get a nonstring, nonlist token
[ { "docid": "091173ddec2f58ca1e8610bbe071bb4e", "score": "0.0", "text": "def getToken(handle)\n token = \"\"\n\n # Read all characters up to the next whitespace or\n # close paren into the token\n while (nextChar = handle.read(1) and nextChar !~ /[\\s)]/)\n token += nextChar\n end\n\n # If the n...
[ { "docid": "5dc8cfa4f4d83330c237cecc4a97ca23", "score": "0.72885406", "text": "def token_literal\n @token.literal\n end", "title": "" }, { "docid": "5dc8cfa4f4d83330c237cecc4a97ca23", "score": "0.72885406", "text": "def token_literal\n @token.literal\n end", ...
474ae5404c5cd5b2978211a3bc612597
Use +first_name+, +last_name+, +race_number+, +team+ to figure out if +person+ already exists. Returns an Array of People if there is more than one potential match TODO refactor into methods or split responsibilities with Person? Need Event to match on race number. Event will not be set before result is saved to databa...
[ { "docid": "aeaf05f9063ed2198b091c4457220987", "score": "0.70077115", "text": "def find_people(_event = event)\n matches = Set.new\n \n #license first if present and source is reliable (USAC)\n if RacingAssociation.current.eager_match_on_license? && license.present?\n matches = matches ...
[ { "docid": "67dcfbd58f4c4036103d370cba044195", "score": "0.6768861", "text": "def find_associated_records\n _person = person\n if _person && _person.new_record?\n if _person.name.blank?\n self.person = nil\n else\n existing_people = find_people\n if existing_people.s...
70a17c339f19372114e6eb892e62c6fc
This is the "other" instance of Steak that were going to compare this instance to.
[ { "docid": "f9202b62901cd5f839707bd4906aab24", "score": "0.0", "text": "def <=>(other)\r\n # if this steak's grade is lower than the other steak's grade,\r\n # return -1.\r\n if GRADE_SCORES[self.grade] < GRADE_SCORES[other.grade]\r\n return -1\r\n elsif GRADE_SCORES[self.grade] == GRADE_S...
[ { "docid": "c4644eaeb175536006ab4a272bcdc2af", "score": "0.6203171", "text": "def == other\n self.class == other.class && self.state == other.state\n end", "title": "" }, { "docid": "c4644eaeb175536006ab4a272bcdc2af", "score": "0.6203171", "text": "def == other\n self.class ==...
1d927ddf23445abdd7a397868c5c7eb1
DELETE /uvas/1 DELETE /uvas/1.json
[ { "docid": "7e076e82d19dc1da0b1e6d42a121d343", "score": "0.7011946", "text": "def destroy\n @uva.destroy\n respond_to do |format|\n format.html { redirect_to uvas_url, notice: 'Uva was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "179ff0053e8f4f967cb3d92206094cf0", "score": "0.72391474", "text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "title": "" }, { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.69589156", "text": "def dele...
4c550d031cb29bf425bc42ae75a39c3d
Remove `require 'ruby2d'` from source file
[ { "docid": "9ff0daa0070de06005d0f24c0e399d45", "score": "0.715965", "text": "def strip_require(file)\n output = ''\n File.foreach(file) do |line|\n output << line unless line =~ /require ('|\")ruby2d('|\")/\n end\n return output\nend", "title": "" } ]
[ { "docid": "cd4dd8341963f3d57b14d83d9ce8aca9", "score": "0.6368524", "text": "def keep_source_code_for_prebuilt_frameworks!\n DSL.dont_remove_source_code = true\n end", "title": "" }, { "docid": "cd4dd8341963f3d57b14d83d9ce8aca9", "score": "0.6368524", "text...
ee67bb9cc0ef6f7c2308e67d1fd0b6c0
Access a byte from the binary.
[ { "docid": "2997d9e5cbe02ecccb3674adf9823107", "score": "0.60674787", "text": "def [](index)\n @type == :string ? `#@data.charCodeAt(index) & 0xff` : @data[index]\n end", "title": "" } ]
[ { "docid": "8cd7b029fbe47bda137941ecebc35daa", "score": "0.8174317", "text": "def getbyte\n read(1).ord\n end", "title": "" }, { "docid": "8cd7b029fbe47bda137941ecebc35daa", "score": "0.8174317", "text": "def getbyte\n read(1).ord\n end", "title": "" }, { ...
4023dcb07ab53cda02cc9daa129dc988
DELETE /innovations/1 DELETE /innovations/1.json
[ { "docid": "39fa3eea4aa76297b066f27e64a8649f", "score": "0.6873713", "text": "def destroy\n if @innovation\n @innovation.destroy\n head :no_content\n else\n render json: { error: \"No innovation with id: #{params[:id]}\"}, status: 400\n end\n end", "title": "" } ]
[ { "docid": "d5b9c8dead2889cb914b333fb85618ce", "score": "0.72194403", "text": "def destroy\n @line_investigation.destroy\n respond_to do |format|\n format.html { redirect_to line_investigations_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid...
3f52973818698070d105a2c20fdb77a5
Serializes information the current object
[ { "docid": "daabea73fb3bcfe2d0798eb799ff9e90", "score": "0.0", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"fields\", @fields)\n writer.write_b...
[ { "docid": "d162e297d0f84ca205afa381c3f6a428", "score": "0.7830697", "text": "def serialize\n Marshal.dump(self)\n end", "title": "" }, { "docid": "762bca0e2db3ff19d91cc4521bb1e1d9", "score": "0.7645999", "text": "def serialize(object) end", "title": "" }, { "docid": ...
1e3cb0cf8b860d0298b9159976471c1f
returns item's sale date
[ { "docid": "3851cb0a26bc7c6469791d89c323c43d", "score": "0.7507691", "text": "def sale_date\n PixiPostProcessor.new(self).get_sale_date\n end", "title": "" } ]
[ { "docid": "92607af93b9cda791f05afdd9616879e", "score": "0.7105751", "text": "def date\n sale_array = Sale.all.keep_if {|sale| sale.product_id.to_i == @id.to_i}\n sale_array.map {|sale| sale.purchase_time.to_date}\n end", "title": "" }, { "docid": "0b4021c21d22523a42b6162df3164e4d", ...
a522692a8c79ae86abb300eb5b5341d2
Synchronously publish an HTTP response format message to all of the configured PubControlClients with a specified channel, message, and optional ID and previous ID. Note that the 'http_response' parameter can be provided as either an HttpResponseFormat instance or a string (in which case an HttpResponseFormat instance ...
[ { "docid": "e0c3993fbdaf31e28b285d08e7b1fc2a", "score": "0.70561594", "text": "def publish_http_response(channel, http_response, id=nil, prev_id=nil)\n if http_response.is_a?(String)\n http_response = HttpResponseFormat.new(nil, nil, nil, http_response)\n end\n item = Item.new(http_respons...
[ { "docid": "3937ef25f87eecc65a3738e691ded09b", "score": "0.6967817", "text": "def publish_http_response_async(channel, http_response, id=nil,\n prev_id=nil, callback=nil)\n if http_response.is_a?(String)\n http_response = HttpResponseFormat.new(nil, nil, nil, http_response)\n end\n it...
887f18e3723078d8efa9a51776e671a4
========================================================================================= chacking/error unit =========================================================================================
[ { "docid": "c413a02fe20592ae618e4351aba820ed", "score": "0.0", "text": "def check_invalid_coordinates( status )\n\t\tabort( \"ERROR: Invalid coordinates in #{status}\" ) unless( self.total_atom_num() == @atom_crd.length )\n\tend", "title": "" } ]
[ { "docid": "7f0376fbe2f738ec1a6f55ecc116e6bb", "score": "0.61973345", "text": "def enqueue_error=(_arg0); end", "title": "" }, { "docid": "fa03289279c230f8c6a29354cb7b6e88", "score": "0.618259", "text": "def handle_ack_msg( their_msg )\r\n begin\r\n our_stored_msg=s...
3291b2a0c57d0cf57b99b90afda147cc
Sets the attribute output
[ { "docid": "89f236cf817e796004aa74578bdd5e30", "score": "0.0", "text": "def output=(_arg0); end", "title": "" } ]
[ { "docid": "fddee29d529539d96fff3f13498f8539", "score": "0.7155231", "text": "def output=(output)\n @_output = output\n end", "title": "" }, { "docid": "39fd8b1572693dd3d27f629e7554694a", "score": "0.62812877", "text": "def initialize\n @am = RDoc::Markup::AttributeManager.new...
35e2955d0d8244e3e8ee1f6f1b89436f
read goodpractice summary from a temporary url return: string of goodpractice summary
[ { "docid": "24d1a66c5df9d77fc40102de84f9ec92", "score": "0.6919773", "text": "def read_gp_summary(url)\n\tcn = Faraday.new(:url => url) do |f|\n \tf.adapter Faraday.default_adapter\n\tend\n\ttxt = cn.get.body.gsub! \"\\\\n\", \"\\n\"\n\treturn txt\nend", "title": "" } ]
[ { "docid": "7f3f60f10b2e4885e03fa8f97afff52d", "score": "0.61829466", "text": "def wikipedia_summary(url)\n doc = Nokogiri::HTML(open(url))\n first_para_html = doc.search('//p').first.to_s # .gsub(/<\\/?[^>]*>/, \"\")\n return Sanitize.clean(first_para_html)\n rescue Exception\n return ni...
ba151941681bd3f5773e99ef0cbd2a76
Create the new result combiner.
[ { "docid": "695e32c288b6255d7e18645c9393312c", "score": "0.0", "text": "def initialize\n @results = {}\n @count = 0\n end", "title": "" } ]
[ { "docid": "41e99ab02c51581e6490b17f3263a84c", "score": "0.65810037", "text": "def merged_result; end", "title": "" }, { "docid": "6c8cd3ed99c727c48f0f7a67e3193211", "score": "0.6182357", "text": "def combine(*results); end", "title": "" }, { "docid": "86782ba95de564fc2a7...
2236253d70a5c010d12d137bf7ae68c9
a and b are coordinates
[ { "docid": "1417499b5673371f52047a658a2c73f1", "score": "0.0", "text": "def close(a, b)\n a[0] == b[0] ||\n a[1] == b[1] ||\n ( (a[0] - b[0]).abs < 0.001 && (a[1] - b[1]).abs < 0.001 )\nrescue\n puts \"Error: #{a.inspect} #{b.inspect}\"\n raise\nend", "title": "" } ]
[ { "docid": "396dff75204b5d8185b13499323b6f38", "score": "0.7026421", "text": "def coordinate_add(a, b)\n [a[0] + b[0], a[1] + b[1]]\nend", "title": "" }, { "docid": "821e510b4d5582c812b7760b22cb9f69", "score": "0.69187", "text": "def orient_coordinates(a,b)\n int_a = a.to_i\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "8fc4adc1a69772a07d841daa530ed09f", "score": "0.0", "text": "def set_group\n @group = Group.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...
31d28f618743f95e6a4c972a5d72f537
Validates that the provided options are compatible with a preexisting network. Raises exceptions on invalid configurations
[ { "docid": "7ee3465d31ba374d86d25525f26217cc", "score": "0.7559075", "text": "def validate_network_configuration!(network_name, root_options, network_options, driver)\n if root_options[:ip] &&\n driver.network_containing_address(root_options[:ip]) != network_name\n raise...
[ { "docid": "ca011fdb3a178132e9dfe3f6cfde5331", "score": "0.7315831", "text": "def check_network(options, attributes)\n env.logger.info \"Checking network\"\n if options.nil? or options.empty? or options[\"network_type\"].nil? or options[\"network_type\"] == \"network\"\n che...
257912458661060bdd922e751c3f79c0
Overwrite this method to customize how students are displayed across all pages of the admin dashboard.
[ { "docid": "c5f9acdf35e3924f6eff31dd7bd41af7", "score": "0.5714062", "text": "def display_resource(student)\n \"#{student.full_name} - #{student.id}\"\n end", "title": "" } ]
[ { "docid": "7f41449b85c18ba0cdeaa4e38f73d157", "score": "0.6370567", "text": "def show_students\n show_students_header\n show_students_list\n show_students_footer\nend", "title": "" }, { "docid": "ea9676120d13f24b3683511d3a484ab3", "score": "0.63494277", "text": "def show_students...
ccd9307a5fd63f26648829f6914f4d9e
Waits a moderate time for an element to be present and clicks it. Intended for page loads.
[ { "docid": "09e41c82edafacef714f38ec34822073", "score": "0.7409141", "text": "def wait_for_page_and_click(locator)\n when_exists(locator, Config.long_wait)\n click_element locator\n end", "title": "" } ]
[ { "docid": "1d294d83bd19a9698739f5c6a3d7e2c7", "score": "0.7691912", "text": "def click_wait(element, sec, arg = nil)\n click(element, arg)\n wait(sec)\n end", "title": "" }, { "docid": "f85fcd531b015a74665cc355a7091762", "score": "0.7666364", "text": "def click_web_element(el...
9a554f468ca4bb46a22ce725ea8116b4
Accessor methods for individual elements of the state matrix
[ { "docid": "44f04c4c17639ada74e0b9f2fe3deb72", "score": "0.0", "text": "def set_a(step_num, new_a)\n @states_matrix[step_num][0] = new_a\n end", "title": "" } ]
[ { "docid": "2ba9c0c39fabb9f4e110a8316590ace0", "score": "0.6871063", "text": "def state\n # returns the current state of the csrmatrix\n # pre self\n # post [@value, @row_pointer, @column_index, @rows, @columns, @dimension]\n [@val, @row_ptr, @col_ind, @rows, @columns, @ndim]\n end", "t...
2ee6f2a91b1606e195814579e43ff789
Retrieves a single translation for the given phrase.
[ { "docid": "ae9777ffe3f18988ab39f3901dd1b568", "score": "0.678759", "text": "def lookup_translation(locale, phrase)\n raise NotImplementedError,\n 'expected to be implemented in derived classes'\n end", "title": "" } ]
[ { "docid": "3868ac036abc5bf8769fb395d826b90f", "score": "0.65988874", "text": "def translation! phrase, language_id\n translations.where({:phrase => phrase, :language_id => language_id}).first or\n translations.create!({:phrase => phrase, :language_id => language_id})\n end", "title": "" },...
882ade6c3d4e781b206a082b7f26bbdf
PATCH/PUT /faculties/1 PATCH/PUT /faculties/1.json
[ { "docid": "bef63973b7948a96f3d2bc323952759e", "score": "0.0", "text": "def update\n respond_to do |format|\n if @faculty.update(faculty_params)\n format.html { redirect_to microposts_path, notice: 'Faculty was successfully updated.' }\n else\n format.html { render :edit }\n ...
[ { "docid": "9da7466679cbb83e627cb3ed769e759e", "score": "0.7128908", "text": "def update\n respond_to do |format|\n if @facult.update(facult_params)\n format.html { redirect_to @facult, notice: 'Facult was successfully updated.' }\n format.json { head :no_content }\n else\n ...
4bd73c7ed1d31772a110b18b24ba6a06
Create an international label with the specified options
[ { "docid": "d7eeea93de7e8e4ba316a6c96c9c182f", "score": "0.69617546", "text": "def international_create(label_options)\n international_url = File.join(LABEL_URL, 'international')\n response = @connection.post international_url, body: label_options.to_json, headers: { 'Content-Type' => 'applica...
[ { "docid": "516137a512617adb052ad94df358c4cd", "score": "0.7507983", "text": "def labeling(options={})\n label_options.update(options)\n end", "title": "" }, { "docid": "0850901b845698f8ffca61baa6c1f46e", "score": "0.7504592", "text": "def create_label(field, text = nil, options_...
283a6b22435d5945929b2394fab13810
Computes the coverage based upon lines covered and lines missed for each file Returns an array with all coverage percentages source://simplecov//lib/simplecov/file_list.rb60
[ { "docid": "08ff550dd0501741f4365bdea500b463", "score": "0.58364254", "text": "def covered_percentages; end", "title": "" } ]
[ { "docid": "14d2080bd8bd55822852de58688adf08", "score": "0.7313941", "text": "def test_coverage_on_three_methods\n results = coverage(:include => test_filename) do\n load test_filename\n tester = TestCode.new\n tester.test_method1\n tester.test_method2\n tester.test_method3\n...
498083c59885b527957825177444ac32
3. Alan wrote the following method, which was intended to show all of the factors of the input number:
[ { "docid": "5d3354bb069dcd961f0e0df02503f7b3", "score": "0.0", "text": "def factors(number)\n divisor = number\n factors = []\n begin\n factors << number / divisor if number % divisor == 0\n divisor -= 1\n end until divisor == 0\n factors\nend", "title": "" } ]
[ { "docid": "aeaa92e920adfc1bdfdb8456bf23f5f2", "score": "0.8465724", "text": "def factors(num)\nend", "title": "" }, { "docid": "aeaa92e920adfc1bdfdb8456bf23f5f2", "score": "0.8465724", "text": "def factors(num)\nend", "title": "" }, { "docid": "aeaa92e920adfc1bdfdb8456bf...
f45bb4b2d00004c9b59aad53a865ebb6
GET /motion_graphic_customizations/1 GET /motion_graphic_customizations/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "89bcbce207438afab398d005cf09161c", "score": "0.77559096", "text": "def index\n @motion_graphic_customizations = MotionGraphicCustomization.all\n end", "title": "" }, { "docid": "919adef7da88e0b02a73ebda45c4ab1f", "score": "0.71187", "text": "def set_motion_graphic_cus...
c0ed0438a9f63496a71e83a648930a21
POST /tournaments POST /tournaments.json
[ { "docid": "6b411e34ba5f868abe982aad32ded847", "score": "0.0", "text": "def create\n if current_user\n if current_user.role == \"admin\"\n @tournament = Tournament.new(params[:tournament])\n\n respond_to do |format|\n if @tournament.save\n format.html { redirect_to @tournament, fl...
[ { "docid": "42a3c875ee95281bc76bd3267a653cda", "score": "0.6471382", "text": "def participatingtournaments_feed\n tournaments= getpartipatingtournaments\n tournamentslist = tournaments.map do |t|\n { :tournament_id=>t.id, :title=> t.name, :start => t.start_date }\n end\n\n render :json=...
bafde0f9963efd239d32b73751d58fd5
For XRI, the persistent identifier. source://rubyopenid//lib/openid/consumer/discovery.rb44
[ { "docid": "9f9e5958c62a194e3057b212df9ca06c", "score": "0.0", "text": "def canonical_id=(_arg0); end", "title": "" } ]
[ { "docid": "ec272053957171d7e7ed351a38f9cbaf", "score": "0.6735441", "text": "def open_id\n relmap('http://specs.openid.net/auth/', true)\n end", "title": "" }, { "docid": "21a9bf5ca40a957cd9658de60a1c7f64", "score": "0.67117006", "text": "def oid()\n #This is a st...
c7d8de56fe5d7127c9adaf2be90bda43
Clear all contents in the database.
[ { "docid": "5b96ad5ea4d349ce74e38266eb6678c2", "score": "0.71365297", "text": "def clear\n if namespace\n keys.each do |key|\n delete(key)\n end\n delete(KEYS_ADDRESS)\n else\n database.clear\n end\n ...
[ { "docid": "9211da92ee70bc6b5b065ca7a8e44ec1", "score": "0.8243402", "text": "def clear\n @db.clear\n self\n end", "title": "" }, { "docid": "2de7e337b2ada589bda44c19c7298bbb", "score": "0.8141488", "text": "def clear_db\n clear_urls + clear_docs\n end", "title": "...
e0252d760588bffb1d3cb8e34f32d87f
end of add_cellar_drink method
[ { "docid": "444c94d66419cabb2f4aa9098351813e", "score": "0.0", "text": "def change_cellar_drink_quantity\n # get data to add/update\n @data = params[:id]\n @data_split = @data.split(\"-\")\n @add_or_subtract = @data_split[0]\n @drink_id = @data_split[1]\n \n # get current cellar dri...
[ { "docid": "23a4b22b2b587f81901c19e5826f888f", "score": "0.6534099", "text": "def add_cellar_drink\n # get drink info\n @this_drink_id = params[:id]\n \n # get user info\n @user = User.find_by_id(current_user.id)\n\n # create new user cellar supply entry\n UserCellarSupply.create(us...
7df179c28d9e8ffac935036a84e87dec
DELETE /careers/1 DELETE /careers/1.json
[ { "docid": "252a0c67612b125c3499d02b01192350", "score": "0.74918574", "text": "def destroy\n @career.destroy\n respond_to do |format|\n format.html { redirect_to careers_url, notice: 'La Facultad ha sido eliminada satisfactoriamente.' }\n format.json { head :no_content }\n end\n end"...
[ { "docid": "0f8c8e7edf983915553ddbc241611c8e", "score": "0.7593339", "text": "def destroy\n @career.destroy\n respond_to do |format|\n format.html { redirect_to careers_url, notice: 'Career was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "...
f193f842d8092af2073b112f5cab7123
Need to be careful about blanket updating openssl
[ { "docid": "769e01335c363c54d36f0f8be9bf615d", "score": "0.0", "text": "def install\n bin.install 'check-cert'\n end", "title": "" } ]
[ { "docid": "52ef91edaa6c007375c6442ebce6d627", "score": "0.6872555", "text": "def force_ssl=(_arg0); end", "title": "" }, { "docid": "5ac4ed87794c2593b21ff4d00e5ac8bf", "score": "0.67917144", "text": "def secure_ssl=(_arg0); end", "title": "" }, { "docid": "a44b7bd9adb037...
0960afa94e4be95cdcf7cb5da015eacf
Render json > xml output request Hash : response Hash : session For the moment it is rcms/server/net/HttpSession simple Hash wrapper properties PropertyLoader etc....
[ { "docid": "00ea8a3027d541f833450478b496d8a4", "score": "0.51822734", "text": "def renderOutput(request, response, session, propertyLoader, xmlFileToRender, theme)\n @mySession = session\n @myPropertyLoader = propertyLoader\n @myTheme = theme\n rendererConfig = YAML.load_file...
[ { "docid": "081827a3fac92a5cb2100229bcd62606", "score": "0.6199031", "text": "def json_reflect\n @content_type = 'text/plain'\n @render_nothing = true\n @rendered_template = true\n @current_layout = nil\n h = {}\n params.each do |x,y|\n h[x]=y\n end\n write_json h\n end", ...
3a2abc4c8360cdea5be7bb0886979458
DELETE /tipo_documentos/1 DELETE /tipo_documentos/1.json
[ { "docid": "2bc194e3bed9d20bc90fa06008713e89", "score": "0.71069354", "text": "def destroy\n ActiveRecord::Base.transaction do\n @tipo_documento.status = Status.find(Status::VALUES[:deleted])\n @tipo_documento.save validate: false\n respond_to do |format|\n format.html { redirec...
[ { "docid": "67559ee500324b5d5fcd73442653cce1", "score": "0.7556905", "text": "def destroy\n @tipo_documento = TipoDocumento.find(params[:id])\n @tipo_documento.destroy\n\n respond_to do |format|\n format.html { redirect_to(tipo_documentos_url) }\n format.xml { head :ok }\n end\n ...
79d5eb11af067fe005f23336c1921436
PATCH/PUT /stories/1 PATCH/PUT /stories/1.json
[ { "docid": "9dfdf4cb1bef0d335ae05371025382b8", "score": "0.68319225", "text": "def update\n respond_to do |format|\n if @story.update(story_params)\n format.html { redirect_to @story, notice: 'Story was successfully updated.' }\n format.json { render :show, status: :ok, location: @...
[ { "docid": "c6ce24cd7374834fd9b3ce79eaef08e4", "score": "0.73188186", "text": "def update\n if @story.update(update_params)\n render json: @story\n else\n render json: @story.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "aa00ffd521d6e9f1de...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "fb2bf3fb9ab8406aef146c3ee7981adf", "score": "0.0", "text": "def set_booking\n @booking, @waitlist = get_booking_and_waitlist_from_params(params)\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.6032574", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015663", "text": "def...
5991c38db8ee180b0c62b1ccca2ad8f5
Will add an error message to each of the attributes in +attributes+ that is blank (using Objectblank?).
[ { "docid": "860ab704020090563eb21cfb3bcc7422", "score": "0.80459857", "text": "def add_on_blank(attributes, msg = @@default_error_messages[:blank])\n for attr in [attributes].flatten\n value = @base.respond_to?(attr.to_s) ? @base.send(attr.to_s) : @base[attr.to_s]\n add(attr, msg) if ...
[ { "docid": "a68ac3e556d90c855b7f1110594aa111", "score": "0.74537766", "text": "def add_on_empty(attributes, msg = @@default_error_messages[:empty])\n for attr in [attributes].flatten\n value = @base.respond_to?(attr.to_s) ? @base.send(attr.to_s) : @base[attr.to_s]\n is_empty = value.r...
ff6122c4e6f9cfbef3b4d4c2d1328d68
Whether the batch details for the errata can be edited.
[ { "docid": "f2339972ac46fe26bc84da86e15da8e8", "score": "0.70956516", "text": "def can_edit_batch?\n self.release.enable_batching? &&\n status_in?(:NEW_FILES, :QE, :REL_PREP) &&\n User.current_user.can_manage_batches?\n end", "title": "" } ]
[ { "docid": "d46cfed0cb577458fa922a18bacb71e9", "score": "0.6365458", "text": "def error_in_changed_attributes?\n errs = errors\n changed_attributes.each_pair do |key, _|\n # If any of the fields with errors are also the ones that were\n return true if errs[key]\n end\n\n ...
96e66e795c92522c9ce1e389661d0d68
optional but useful; return the bucket corresponding to `num`
[ { "docid": "95c9d315c66cb5edfd635749d27198a9", "score": "0.7248714", "text": "def [](num) #<== maybe requires hash\n # num_hash = num.hash\n # @store[num_hash % num_buckets]\n @store[num % num_buckets]\n end", "title": "" } ]
[ { "docid": "f090ac5ab2ff7356cefd781dc8e2955d", "score": "0.6885413", "text": "def basic_bucket_function\n Proc.new do |item|\n bucket_number = bisect_right(@buckets, item) - 1\n\n # Counters is @buckets.size - 1\n # [bucket_number, counter_size-1].min\n\n if bucket_numbe...
01f290a0f99bd6793fa781382a312986
Create a new buffer from a Base64encoded string.
[ { "docid": "369c18aefa548ea609689e58a34b454e", "score": "0.7844118", "text": "def initialize(string = \"\")\n self.buffer = Base64.decode64(string || \"\")\n buffer.force_encoding('BINARY') if buffer.respond_to?(:force_encoding)\n self.invalid_buffer = \"Badly formatted Base64\" unless to...
[ { "docid": "0f5373e05fe864d1257005dc7e7e6d99", "score": "0.7340233", "text": "def from_base64(b, options = { })\n new(b, :base64, options) if b\n end", "title": "" }, { "docid": "67e0b2666e45032f58c8736fbcee5eb3", "score": "0.7227883", "text": "def from_base64\n Base64.dec...
452179ba487adcf04651be5974859c75
GET /case_files/1 GET /case_files/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "569d48f8e258a048035f473c1d9a0bdb", "score": "0.77163595", "text": "def index\n require 'pp'\n @case_files = CaseFile.by_id\n respond_to do |format|\n format.json\n end\n end", "title": "" }, { "docid": "6417ab547e9158fbb2fca13227905f91", "score": "0.75258505...
618da634d3a0f60b63f8a33e4dc59c7d
POST /contacts POST /contacts.json
[ { "docid": "56ef72f96cce5244536992e9946a01a8", "score": "0.0", "text": "def create\n @contact = Contact.new(contact_params)\n @contact.user_id = current_user\n respond_to do |format|\n if @contact.save\n format.html { redirect_to @contact, notice: 'Contact was successfully created.'...
[ { "docid": "a982c74b3e69418529a0029cd2331a03", "score": "0.77051383", "text": "def create(params)\n post \"/contacts\", params\n end", "title": "" }, { "docid": "5b7fa620653a9381645afc207f7c04d8", "score": "0.7498903", "text": "def create\n @contact = current_user.contacts...
45cab2f5cc8a8705ed35e3f78cedaec2
POST /only_layout_fluids POST /only_layout_fluids.json
[ { "docid": "0100aa94a6bd72b21664059f2f953366", "score": "0.6419821", "text": "def create\n @only_layout_fluid = OnlyLayoutFluid.new(only_layout_fluid_params)\n\n respond_to do |format|\n if @only_layout_fluid.save\n format.html { redirect_to @only_layout_fluid, notice: 'Only layout flu...
[ { "docid": "8eacc1fbce6530392c74d7aad57efd4c", "score": "0.6809705", "text": "def index\n @only_layout_fluids = OnlyLayoutFluid.all\n end", "title": "" }, { "docid": "2cc65ac42d19a0b4230b4a4ab07870a6", "score": "0.649429", "text": "def set_only_layout_fluid\n @only_layout_fl...
76596a11e7d5a65ab6ec210090e05c6a
returns nil if the value couldn't be calculated (emptystring, wrongcharacter) do not change the parameter "str" source://text//lib/text/soundex.rb29
[ { "docid": "ebe5b048808b83ca5ebb6f535dc775de", "score": "0.75411624", "text": "def soundex_str(str); end", "title": "" } ]
[ { "docid": "8a8d0fdd4f57a699dba9f71afc9dec21", "score": "0.7013821", "text": "def soundex_str(str)\r\n return nil if str.empty?\r\n\r\n str = str.upcase\r\n last_code = get_code(str[0,1])\r\n soundex_code = str[0,1]\r\n\r\n for index in 1...(str.size) do\r\n return soundex_code if so...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "06603ddb5ed3e57b2bb0cb40e6d7b6a0", "score": "0.0", "text": "def set_real_estate\n @real_estate = RealEstate.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...
762720baffd9faad5f1c0e75d998274c
Remove all of the callbacks from a list
[ { "docid": "45bfe6c6a3bdc73c12438a315c2453e7", "score": "0.0", "text": "def empty!\n @list = []\n @firing_length = 0\n self\n end", "title": "" } ]
[ { "docid": "5214d9b1384dcd2302b46923f9dd8468", "score": "0.77449894", "text": "def clear_callbacks\r\n @callbacks = []\r\n end", "title": "" }, { "docid": "48f3b59104957dc9bee2bc07d287272a", "score": "0.7711857", "text": "def clear_callbacks\n @callbacks = []\n en...
7a600ca5959764cd0d0e8ee36f797377
/article/id, method = DELETE
[ { "docid": "257094c5df276ed9894bf3fd8a416e13", "score": "0.7761395", "text": "def destroy\n @article.destroy\n redirect_to articles_url\n end", "title": "" } ]
[ { "docid": "002a5b579060127019e70a621b834e2c", "score": "0.82241064", "text": "def delete_article(article_id, params)\n # ...\n # ...\n # ...\n end", "title": "" }, { "docid": "b491049c1c427e5d2df29351b170a9ac", "score": "0.8166414", "text": "def destroy\n\n ...
fff8ecd86b2bb4dca622f63d4f02c2fa
Runs the after hook
[ { "docid": "0185a3146605bfee9114feca804a2fd8", "score": "0.78353995", "text": "def after\n return nil if blue_prints.after.empty?\n\n hook_action = HookAction.new(driver,\n blue_prints.after,\n :hook_action, self, loca...
[ { "docid": "c45e069e0c0d3b2ad47494327c8eb698", "score": "0.85351855", "text": "def after\n end", "title": "" }, { "docid": "6b1056367dbccf0129e568525805f6f9", "score": "0.8401243", "text": "def after\n end", "title": "" }, { "docid": "b31804e8db1d7456d6ff6ab0849a3...
1fa82416cad42f7196423eb9030c400e
These options are overridden in plugins to we need to make sure they are available here. source://syntax_tree//lib/syntax_tree/formatter.rb87
[ { "docid": "18ab8417f03e4b8966bda1a252158338", "score": "0.0", "text": "def disable_auto_ternary; end", "title": "" } ]
[ { "docid": "d58709a93143f066c22d28330b182da0", "score": "0.65820575", "text": "def kramdown_options\n {\n syntax_highlighter: defined?(Rouge) ? 'rouge' : 'coderay',\n syntax_highlighter_opts: { }\n }\n end", "title": "" }, { "docid": "018861641a86a8ff67a213e190a081...
ebf648f45c2826b924a7d17549784b2d
GET /leavetypes GET /leavetypes.json
[ { "docid": "ddb6a5c6816ebb9dd2e55bad83748c9d", "score": "0.7678114", "text": "def index\n @leavetypes = Leavetype.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @leavetypes }\n end\n end", "title": "" } ]
[ { "docid": "226f5a11939e911c54a546beb03070af", "score": "0.72161996", "text": "def get_lesson_types\n get \"lessonTypes.json\"\n end", "title": "" }, { "docid": "bd73818f13640aae3654b1b8512cfb97", "score": "0.67559063", "text": "def show\n @all_type=Api::V1::AdminType.all\...
83340a4d9973c5a1f58ad85fdca2dfdc
FIXME: this needs to be changed to the current time format
[ { "docid": "cdf196efa12fb3a1c3f8336dda8cb8e2", "score": "0.0", "text": "def display_time(secs)\n [[60, :s], [60, :m], [9999, :h]].map do |count, name|\n if secs > 0\n secs, n = secs.divmod(count)\n\n \"#{n.to_i}#{name}\" unless n.to_i == 0\n end\n end.compact.reverse.join('...
[ { "docid": "fd54f543637ecb22c3121e6f70bdaf9f", "score": "0.71248144", "text": "def current_time\n Time.now.strftime(\"%l:%M %p\")\n end", "title": "" }, { "docid": "4af360ea95402c5e73875f303152d9ae", "score": "0.7086152", "text": "def proper_time(time)\n\tTime.at(time).gmtime...
b49a58e0b3c5e6e70cd3298520d7ea94
Perform Author: Alpesh Date: 15/01/2018 Reviewed By:
[ { "docid": "63bbf1f1a89fbe443b8d2dd4a0da7eaa", "score": "0.0", "text": "def perform\n\n r = validate\n return r unless r.success?\n\n r = fetch_user\n return r unless r.success?\n\n r = decrypt_login_salt\n return r unless r.success?\n\n r = validate_password\n re...
[ { "docid": "ed8f7b2514a2e125f2802739f2b1f35d", "score": "0.62508214", "text": "def atest_ID_25863_reposted_review()\n # Need clarification\n end", "title": "" }, { "docid": "80a62870302f2e702d9f678c713e4922", "score": "0.6047622", "text": "def author\n 'Department of Ve...
664cd004d3b5ed41adadd8bceb018c94
Return boolean depending on whether this is the market or payout server.
[ { "docid": "520c0b0e90e738d77d86984b73f740d5", "score": "0.73149306", "text": "def is_market?\n !Rails.configuration.market_bitcoinrpc_uri.empty?\n end", "title": "" } ]
[ { "docid": "9b65dd429b96b70f8b7792f9c8e464e3", "score": "0.7230319", "text": "def server?\r\n @connect_type == :server\r\n end", "title": "" }, { "docid": "7098ec6d7c0116a3ee5512a6a8053d7b", "score": "0.7040778", "text": "def server?\n return @mode == :server\n end", ...
2129eb97f4f62e90689818662cff40f3
DELETE /location_lists/1 DELETE /location_lists/1.json
[ { "docid": "d751992dddcb86efd1f310783e1e1fa7", "score": "0.7713983", "text": "def destroy\n @location_list.destroy\n respond_to do |format|\n format.html { redirect_to location_lists_url, notice: 'Location list was successfully destroyed.' }\n format.json { head :no_content }\n end\n ...
[ { "docid": "52d1d94fc0ffc91b746f279bb47a6737", "score": "0.7328798", "text": "def destroy\n @locations = nil\n\n if params.has_key? :id\n location = Location.find params[:id]\n @locations = [ location ]\n elsif params.has_key? :ids\n @locations = Location.find params[:ids].split(...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "23306d107f59202eda67362bfab9ed74", "score": "0.0", "text": "def set_user\n @user = User.find(params[:id])\n end", "title": "" } ]
[ { "docid": "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...
508e764efa20cf1eb0d9224fc50f4b91
DELETE /banieres/1 DELETE /banieres/1.json
[ { "docid": "fb401e61818c9a227028603189e24aa0", "score": "0.73370963", "text": "def destroy\n @baniere = Baniere.find(params[:id])\n @baniere.destroy\n\n respond_to do |format|\n format.html { redirect_to banieres_url }\n format.json { head :no_content }\n end\n end", "title": ...
[ { "docid": "04a42c73fa3e3710f06ef1aac5827fb5", "score": "0.740778", "text": "def destroy\n @banco = Banco.find(params[:id])\n @banco.destroy\n\n respond_to do |format|\n format.html { redirect_to bancos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, ...
b4027800173a60fa81303fb50aa19fec
PUT /carros/1 PUT /carros/1.xml
[ { "docid": "3a099fc88fc0f2cad3e20f2ddeb6fe4c", "score": "0.609023", "text": "def update\n @carro = Carro.find(params[:id])\n\n respond_to do |format|\n if @carro.update_attributes(params[:carro])\n format.html { redirect_to(@carro, :notice => 'Carro atualizado com sucesso.') }\n ...
[ { "docid": "e631b376ae2ccb776680432bf94b01cc", "score": "0.6725485", "text": "def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end", "title": "" }, { "docid": "c2c0b673628fdc28b1...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "0ffff4bb6ef11254e0dbee799635563f", "score": "0.0", "text": "def jurisdiction_params\n params.require(:jurisdiction).permit(:government, :type, :description)\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...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "ea723cbef866e16bd7833a7f9a510010", "score": "0.0", "text": "def update!(**args)\n @date = args[:date] if args.key?(:date)\n end", "title": "" } ]
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "t...
7b49ffa5f5e50f14ebb5dccb582bdad8
Show total amount of available swap. The value is in kilobytes. The return type is a Integer but if the info isn't available, it will return nil.
[ { "docid": "e2d67c039c3eaac7b6116e71eddd19d3", "score": "0.0", "text": "def available\n\t\t\t\treturn nil unless swaps_readable?\n\t\t\t\tvalues_t = read_usage\n\t\t\t\tvalues_t[0].sum - values_t[1].sum\n\t\t\tend", "title": "" } ]
[ { "docid": "0ec334719b13d9055a01ccf910212cff", "score": "0.7078615", "text": "def free_space\n sum = 0\n\n mount_points.each do |mount_point, values|\n sum += RelayRegister::Converter.convert_to_gb(values['size_available'])\n end\n\n \"#{sum.round(1)} GB\"\n end", "title": "" }, ...
148fd6eedff7e487dfa37217c0cb7b82
Edit a comment = Inputs :content Required string = Examples bitbucket = BitBucket.new bitbucket.issues.comments.edit 'username', 'reponame', 'commentid', "content" => 'a new comment'
[ { "docid": "ed672195c5ef792a4371a098701d9f2a", "score": "0.7774355", "text": "def edit(user_name, repo_name, comment_id, params={})\n _update_user_repo_params(user_name, repo_name)\n _validate_user_repo_params(user, repo) unless user? && repo?\n _validate_presence_of comment_id\n\n n...
[ { "docid": "3d0558e063540f14340bace1f3a5b708", "score": "0.7424069", "text": "def edit_gist_comment(comment_id, params={})\n _normalize_params_keys(params)\n _merge_mime_type(:gist_comment, params)\n _filter_params_keys(REQUIRED_GIST_COMMENT_INPUTS, params)\n\n raise Argument...
951a5b2324faa1ef956e783974ea49e2
Configures the site attributes.
[ { "docid": "c4ab68e7f443281a534f5d288931485d", "score": "0.0", "text": "def site(&block)\n return @site unless block_given?\n yield @site\n end", "title": "" } ]
[ { "docid": "42d1f35e0437f84b5b2ff7204f889da5", "score": "0.66308707", "text": "def initialize(attributes = {})\n super\n setup_sites\n end", "title": "" }, { "docid": "7b1dd9ac7309097cd044ba06750a12c1", "score": "0.6554545", "text": "def application_configuration\n...
286e35911e75cfaab9798c20bd74a0b2
Produces a Shakespeare quote from Hamlet.
[ { "docid": "f74e1b662f603ba9f42b0fb886fb1a24", "score": "0.6956525", "text": "def hamlet_quote; end", "title": "" } ]
[ { "docid": "216598c6b20de614a504e70260c56b3d", "score": "0.65367967", "text": "def quote\n fetch('harry_potter.quotes')\n end", "title": "" }, { "docid": "6ed0037f55bb3361b5b6921550a8b723", "score": "0.6178338", "text": "def quote\n @quote ||= quote_hash\n end", ...
3e5794fb8b42616bd8b9597e83299802
Roll up the hits_per_second, into hits_per_window
[ { "docid": "182bfdc0df0d3c1de048475d87f025d7", "score": "0.79857916", "text": "def aggregate\n @hits_per_window.push(@hits_per_second)\n @hits_per_window.delete_at(0) if @hits_per_window.length > @window\n @hits_per_second = {} # Hits per second. This should generally contain 1 second wor...
[ { "docid": "2f2058883e03f2e6e66ccee659574c3d", "score": "0.60340625", "text": "def hits_time_window(type, unit, time)\n hits_window(type, time.strftime(INTERVAL_FORMATS[unit]))\n end", "title": "" }, { "docid": "403efcb65b2e477664ccf91bc9f500da", "score": "0.5765172", "text":...
a2c30d734b0ba65c579c83543e5d0401
should return the table, and th part. will return some headers.
[ { "docid": "6009f3d493a77ee3bf5d997991ccfe68", "score": "0.63789815", "text": "def summary_table_headers(args={})\n\t\t'''\n\t\t\t<thead>\n\t <tr>\n\t <th>Min Age</th>\n\t <th>Max Age</th>\n\t <th>Sex</th>\n\t <th>Min Value</th>\n\t ...
[ { "docid": "a67c1cdcf86bdc451080ffae031640e3", "score": "0.76806426", "text": "def table_header; end", "title": "" }, { "docid": "f75f60f1f775757dd8016f450fd3c85d", "score": "0.7181702", "text": "def table_headers\n raise NotImplementedError\n end", "title": "" ...
c9408aa9a71247421cb68186760c3fe5
takes a single vehicle row from the unparsed vehicle table (comments generator page of AUL) and converts it to a hash of vehicle details
[ { "docid": "6000addc5cce69aa6f651de918c0a5c7", "score": "0.74917877", "text": "def parse_row_to_array (vehicle_row)\n\tvehicle_entries = vehicle_row.search(\"td\")\n\tvehicle_info = Hash.new\n\n\tvehicle_info[\"aul_id\"] = Sanitize.clean(vehicle_entries[0].to_s).strip\n\tvehicle_info[\"stock_num\"] = Sa...
[ { "docid": "4ebe4afebc877108be596cbf43432a0c", "score": "0.79642004", "text": "def id_hash_from_row (vehicle_row)\n vehicle_entries = vehicle_row.search(\"td\")\n {:aul_id => Sanitize.clean(vehicle_entries[0].to_s).strip, :stock_number => Sanitize.clean(vehicle_entries[1].to_s).strip}\n end", ...
8720c7895b5a651c963e97566037bcaa
Called to obtain one or more representations of the resource. Should be safe, that is, not have any sideeffects visible to the caller. This also implies idempotency (which is weaker). You may return either: A single entity representation, in the form of an instance of Doze::Entity An array of multiple entity representa...
[ { "docid": "b9f92ef235d340fc328d57f8463b59fc", "score": "0.0", "text": "def get\n nil\n end", "title": "" } ]
[ { "docid": "90c3a80618e5b314102ce11acbd7337c", "score": "0.65694535", "text": "def get_representation!(*args, &block)\n get(*args).raise_on_error.submit_and_wait(&block)\n end", "title": "" }, { "docid": "14934f6aa4cf34b207570032c1fd938f", "score": "0.6355865", "text": "def g...
b2f1bf13773911389bdc6f9c4fd4a743
Proxy everything to the cache instance.
[ { "docid": "30edad7f0d2c707bd12475ee76e67edc", "score": "0.63467366", "text": "def method_missing(method_name, *args)\n @cache ||= Rails.cache.instance_variable_get(\"@data\")\n @cache.send(method_name, *args)\n end", "title": "" } ]
[ { "docid": "3c6fa159019090c200d4dbf232f82da8", "score": "0.69932663", "text": "def configure_cache; end", "title": "" }, { "docid": "17e99494612dbeffd1b67126ee5a9e99", "score": "0.6879101", "text": "def cache\n yield\n end", "title": "" }, { "docid": "157d4a88...
4b9ef347d9833983f17b0202517d33a9
calculating alice ranks against each game
[ { "docid": "4db89e9424594fbe43c9fa0b4de5d127", "score": "0.0", "text": "def climbing_leaderboard(leaderboard_scores, alice_score)\n positions = alice_score.map do |score|\n position = -1\n leaderboard_scores.uniq.each_with_index do |value, index|\n if score >= value\n position = index...
[ { "docid": "658ce24ff2b7156e10c9bc39c4af8e7d", "score": "0.74416095", "text": "def climbingLeaderboard(leaderboard , alice ) \n leaderboard = (leaderboard.concat(alice)).uniq.sort{| a ,b | b <=> a}\n ranks = []\n alice.each do | a_value|\n ranks << leaderboard.index(a_value) + 1\n end...
6a431bb878d50adacdb34cc39a61b6a0
person is a whole object here
[ { "docid": "e08abdd39a7e600d3c19eeac18f4003e", "score": "0.0", "text": "def initialize #this is how it knows to go to that method first when start class\n @person = init_person\n end", "title": "" } ]
[ { "docid": "6dc6388ae9efa1b62be71972ae347f1a", "score": "0.7522168", "text": "def person\n person_id.get_object\n end", "title": "" }, { "docid": "2d6836ef871fd5a18c2d78a8fb9ced1a", "score": "0.7445032", "text": "def person_to_obj(person)\n end", "title": "" }, { "do...
a40871af0ab7a95283627cb823290b19
Configures the Websocket object to print any errors to the console
[ { "docid": "90eafff054d077a12b2e97d983a75a3e", "score": "0.7509076", "text": "def setup_error_handler\n EM.error_handler do |e|\n print \"Websocket Error: #{e.message} - #{e.backtrace.join(\"\\n\")}\"\n end\n end", "title": "" } ]
[ { "docid": "f428eeacf710f9045298e7174b0c0978", "score": "0.60472006", "text": "def on_open\n puts \"Websocket connection to #{BASE_URI} established succesfully\"\n end", "title": "" }, { "docid": "ddeaee02c7f27cf2a4804e6a27b52cc4", "score": "0.5974706", "text": "def on_ope...
72e4d0ca095555f8d462b6dc4bf603ef
implement general comparison operator () for use by methods in the Comparable module get these operators free: , >=, between? (!= implemented as negation of ==)
[ { "docid": "9ce02db20e6b2f45f02e9a3d37e3e4ee", "score": "0.0", "text": "def <=>(other)\r\n return nil unless other.instance_of?(Point)\r\n Math.sqrt(@x**2 + @y**2) <=> Math.sqrt(other.x**2 + other.y**2)\r\n end", "title": "" } ]
[ { "docid": "a1cd8eb0b9d7a23f2d6dac7357109cc5", "score": "0.8111807", "text": "def >=(rhs); end", "title": "" }, { "docid": "3dea499b90894bb536eb67ffce712375", "score": "0.7841862", "text": "def >=(other); self.<=>(other) >= EQ end", "title": "" }, { "docid": "d5228d1d7be6...
45d760118d4bef1edd20c27ff98f3773
POST /cctvs POST /cctvs.json
[ { "docid": "34116143c6974e36364040806de480ea", "score": "0.69490975", "text": "def create\n @cctv = Cctv.new(cctv_params)\n\n respond_to do |format|\n if @cctv.save\n format.html { redirect_to @cctv, notice: 'Cctv was successfully created.' }\n format.json { render :show, status...
[ { "docid": "01e9ce010b20c9099a9b1b4432fe4d69", "score": "0.6151199", "text": "def index\n @cctvs = Cctv.all\n end", "title": "" }, { "docid": "e68cc44fae9a9b5c2a9db020871d30e4", "score": "0.5972082", "text": "def cctv_params\n params.require(:cctv).permit(:item_name, :catego...
45b3c41342ff6b5983352d933db2b734
Initialize the win_text according to the mode
[ { "docid": "74a3dc3edd10779729ee97d50e5ae821", "score": "0.81910807", "text": "def init_win_text\n case @mode\n when :map, :battle\n return @base_ui.show_win_text(text_get(23, 17))\n when :hold\n return @base_ui.show_win_text(text_get(23, 23))\n when :item\n if @...
[ { "docid": "3f0cfd3c0f3428df7048aeb5574ec164", "score": "0.79801375", "text": "def init_win_text\n return if @mode != :skill\n if @extend_data\n @base_ui.show_win_text(text_get(23, @extend_data[:skill_message_id] || 34))\n else\n @base_ui.show_win_text(ext_text(9000, 120))\n...
2fb34f421f17527f423dde20eb3273f3
Are there any more methods needed in this class?
[ { "docid": "f0ee6e66e4b2a0dfc5be784cad86374d", "score": "0.0", "text": "def initialize(type, clean = true)\n@type = type\n@clean = clean\nend", "title": "" } ]
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.7802548", "text": "def private; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.7218733", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a...
25c3a5b2186dbc810cc95713739f586c
CARD PARSING ============================================================= turn string array into card hash array
[ { "docid": "4ecbeaa93d32be91fd6fa9054c079bf8", "score": "0.6339603", "text": "def parse_cards(cards_string_array)\n output = []\n\n cards_string_array.each do |card|\n output << parse_card(card)\n end\n\n output\nend", "title": "" } ]
[ { "docid": "52c0efc2740495f2ae38f1e25c6753b2", "score": "0.6739735", "text": "def card_hash\n card_hash_indv_keys = [:question, :answer, :category]\n card_hash_array = self.string_split_card.map do |card_array|\n card_hash_indv_keys.zip(card_array).to_h\n end\n card_hash_array\n end", ...
1a3a40360f7ad47b21a1be6e57e162d1
def ticket_type_must_be_available unless self.user.available_ticket_groups.pluck(:id).include? ticket_type_id errors.add(:ticket_type, "The ticket type you have chosen is not available.") end end
[ { "docid": "b6ffcbac2213eb7177e0e0a5ce8aa6cb", "score": "0.0", "text": "def payment_deadline\n return self.charges.pluck(:created_at).last + 60*60*24*7\n end", "title": "" } ]
[ { "docid": "370d21dabcba5c0a1ff310a1cc68f5f6", "score": "0.6279305", "text": "def timebox_type_check\n if group_id && project_id\n field = project_id_changed? ? :project_id : :group_id\n errors.add(field, _(\"%{timebox_name} should belong either to a project or a group.\") % { timebox_name:...
48b857edd1155f00296434d716a1446d
A School Type describes the kind of educational institution
[ { "docid": "dfef2fb23cc5e0b1c63afdb3fbe7f27c", "score": "0.7769469", "text": "def school_type\n ::HubEdos::StudentApi::V2::Term::Term.new(@data['schoolType']) if @data['schoolType']\n end", "title": "" } ]
[ { "docid": "e184a4eb866258b9dd2597d55316d8bc", "score": "0.7016107", "text": "def set_school_type\n @school_type = SchoolType.find(params[:id])\n end", "title": "" }, { "docid": "e184a4eb866258b9dd2597d55316d8bc", "score": "0.7016107", "text": "def set_school_type\n @sch...