query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
0542fe3c3d7ac35a9a16bfbaafe66055
Determine if this deck contains a card with the given suit.
[ { "docid": "d53e388955ed87be9925aa1169c6a554", "score": "0.79722047", "text": "def include_suit?(suit)\n @cards.collect(&:suit).any?( suit.to_s.strip.capitalize )\n end", "title": "" } ]
[ { "docid": "80cd6dfa79b257bd0042859b1752263b", "score": "0.7512686", "text": "def matches?(card, suit = false)\n return matches_value?(card) && matches_suit?(card) if suit\n\n matches_value?(card)\n end", "title": "" }, { "docid": "a13fad9a93d635e513489d42562cc976", "score": "0.73...
1f03660d564c9230b5193bb153353ec2
Splits a source item (which is a PDF) into a series of PDFs, 1 per page in the source PDF.
[ { "docid": "4e3f6487790528533be34dc9a96e7faf", "score": "0.8175791", "text": "def split_pdf_source_item(source_item,export_directory)\n\tgenerated_files = []\n\tjava.io.File.new(export_directory).mkdirs\n\tinput_stream = source_item.getBinary.getBinaryData.getInputStream\n\treader = PdfReader.new(input_...
[ { "docid": "8eb9139778076ebde67d60de0670de6c", "score": "0.6768185", "text": "def split_pages(source_file, dest_filename)\n dest_filename_before = ''\n dest_filename_after = ''\n if dest_filename.include? '%d'\n dest_filename_parts = dest_filename.split('%d')\n dest_filename_before = ...
1fbd78c4bb6c2c75bb6f79dcda25986a
class OBJexporter make shortcut to tool
[ { "docid": "dc1ea902f1a2d15cc468866930e9e66a", "score": "0.772066", "text": "def objexporter()\r\n Sketchup.active_model.select_tool(OBJexporter.new())\r\nend", "title": "" } ]
[ { "docid": "e6987c2bf3bd6b22213aa7bd10bc2306", "score": "0.56826633", "text": "def edit_object(obj)\r\n puts \"edit object #{obj}\" if VERBOSE\r\n Sketchup.active_model.select_tool EditOpeningTool.new(self, obj)\r\nend", "title": "" }, { "docid": "a484a3ce0be775ed4089cf08d8c2b3fa", ...
3ad7ecde81e5d2578905205f34fb225f
DELETE /model_stocks/1 DELETE /model_stocks/1.json
[ { "docid": "5f87881aa70e4d170edf16cf780fcbf0", "score": "0.76220816", "text": "def destroy\n @model_stock.destroy\n respond_to do |format|\n format.html { redirect_to model_stocks_url, notice: t('common.message.destroyed_success')}\n format.json { head :no_content }\n end\n end", ...
[ { "docid": "6c6dc66a7786f30f78233ffceb7b1bd3", "score": "0.75942934", "text": "def destroy\n @stock = Stock.find( params[:id] )\n @stock.delete_status = 1\n @stock.save\n #@stock.destroy\n respond_to do |format|\n format.html { redirect_to stocks_edit_all_path }\n format.json { ...
a468bb15e5aa2029efa028e9f67c8f13
Returns surveys's collector details
[ { "docid": "cc656cab9060d7313996aff029cbe76d", "score": "0.62265176", "text": "def collector(collector_id, options = {})\n response = self.class.get(\"/v3/collectors/#{collector_id}\", query: options)\n response.parsed_response\n end", "title": "" } ]
[ { "docid": "da066b51e0e2c6b4b20e22aab495e117", "score": "0.64632505", "text": "def collection\n @collector.collection\n end", "title": "" }, { "docid": "4df87655c0c308e8c68f6b8fe4c69093", "score": "0.61269176", "text": "def get_survey_collectors_with_http_info(opts = {})\n i...
43ea178246816458a1b94b2b484c8602
POST /income_tipes POST /income_tipes.json
[ { "docid": "ab03e25e80fc579f152fc18dc393835f", "score": "0.7496052", "text": "def create\n @income_tipe = IncomeTipe.new(income_tipe_params)\n\n respond_to do |format|\n if @income_tipe.save\n format.html { redirect_to tenant_income_tipes_path(tenant_id: @tenant.id), notice: 'Income ti...
[ { "docid": "47ef27e94135dbc216449fbb19b3b54f", "score": "0.6754148", "text": "def income_tipe_params\n params.require(:income_tipe).permit(:name, :tenant_id)\n end", "title": "" }, { "docid": "c7ce345ab22df30cf84667ff5a9443b8", "score": "0.6703123", "text": "def set_income_ti...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "c61d2f712e051662d439b7c9c2b7054c", "score": "0.0", "text": "def home_params\n params[:home].permit(:ica_presents_begins, :program, :about)\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...
eccca7b47256010ca7cf0b1e2157fc31
The criteria used for querying this association.
[ { "docid": "88fe4daeaa7623c0696f128ce355395d", "score": "0.6528169", "text": "def criteria(base, id_list = nil)\n query_criteria(id_list || base.send(foreign_key))\n end", "title": "" } ]
[ { "docid": "189238394fcd6b79c90b99daf00325ef", "score": "0.85740715", "text": "def criteria\n @criteria ||= _association.criteria(_base)\n end", "title": "" }, { "docid": "bbb6c6db188aef01883514f00dfd31b3", "score": "0.78491706", "text": "def criteria\n Crite...
f46cc99b72902e5dd2796351e374bbf8
POST /urls POST /urls.json
[ { "docid": "7b18568af59bb918f9c27aee9e5f3a8f", "score": "0.5635567", "text": "def create\n @url = Url.new(url_params)\n \n set_url_host_model\n \n respond_to do |format|\n if @url.save\n format.html { redirect_to @url, notice: 'Url was successfully created.' }\n format....
[ { "docid": "179a02f5a12e9b9b6d36bdf6fd22242d", "score": "0.66622853", "text": "def create\n params[:url_list].each do |url|\n WebUrl.new(:url => url).save\n end\n render :json=>params[:url_list].to_json\n end", "title": "" }, { "docid": "a460dcdcc21e93959c213493f677ceae", ...
3b7e8a8813ba0965d52a55f72397c3f9
generate is auction hash
[ { "docid": "18ce3fed845b319abc52cb8d20f28a3e", "score": "0.0", "text": "def is_auction_hash_help\n {\"\" => \"(全部)\", \"0\" => \"非オーク品\", \"1\" => \"オーク品\"}\n end", "title": "" } ]
[ { "docid": "b9ad0210b86d9f175d5ac23572c82396", "score": "0.7112779", "text": "def generate_hash\n LiabilityProof.sha256_base64 \"#{user}|#{sum_string}|#{nonce}\"\n end", "title": "" }, { "docid": "6f888211d63c651c50a313a75d2bae0c", "score": "0.69416344", "text": "def gene...
f949420040d14ae4c8d12a1807c97732
:method: start_node Returns the start node of this relationship :method: end_node Returns the start node of this relationship :method: other_node A convenience operation that, given a node that is attached to this relationship, returns the other node. For example if node is a start node, the end node will be returned, ...
[ { "docid": "7600d0ff621cc57e2659c4b4dab29800", "score": "0.6985328", "text": "def new(type, start_node, end_node, props=nil)\n java_type = type_to_java(type)\n rel = start_node._java_node.create_relationship_to(end_node._java_node, java_type)\n props.each_pair {|k,v| rel[k] = v} if ...
[ { "docid": "f9a61e5ef8421a07e75c62966fb01d93", "score": "0.70449615", "text": "def get_or_create_relationship(conn, node_start, node_end, type)\n data = <<\"EOS\"\n{\n \"to\" : \"#{node_end}\",\n \"max_depth\" : 1,\n \"relationships\" : {\n \"type\" : \"#{type}\",\n \"direction\" : \"out\"\n ...
e8ef501efa3af77c8df8a7a4b2e0cc6c
Get current method name source This will not be required in Ruby 1.9
[ { "docid": "62ae10f9ab33dd98995d831af361ff37", "score": "0.6826517", "text": "def get_mname\n caller[0][/`(.*?)'/, 1] # note the first quote is a backtick\n end", "title": "" } ]
[ { "docid": "afc31d6bf2891160f7afaa362e33cea0", "score": "0.82927084", "text": "def current_method_name\n caller(1).first.scan(/`(.*)'/)[0][0].to_s\n end", "title": "" }, { "docid": "859b98ada401022042a4e1f631a28250", "score": "0.8230047", "text": "def current_method_name\n ...
79a72cc0673107dbccbfcc17f95cdd49
end of membership_payment_email email
[ { "docid": "a2c40b5cad3aaba6592e73aabd0c4ecd", "score": "0.0", "text": "def delivery_date_change_confirmation(customer, old_delivery_date, new_delivery_date)\n sp = SparkPost::Client.new() # pass api key or get api key from ENV\n\n payload = {\n recipients: [\n {\n address: {...
[ { "docid": "b51dfed130fbb0cc7032f4db4d5f0912", "score": "0.71544075", "text": "def email_complete; end", "title": "" }, { "docid": "1421df35cbd457723222e61d3dff9d95", "score": "0.70047426", "text": "def exit_verifying_payment; end", "title": "" }, { "docid": "bfba40bb27d8...
f2d4a85629cdc68a6762bd7a1a585cc1
Converts a vanity number into a normalized E164 number.
[ { "docid": "56ad0ad35bd3266b3c6ced440c7209a3", "score": "0.7146364", "text": "def vanity_to_number vanity_number\n country, cc, national = partial_split vanity_number\n \"#{cc}#{country.vanity_to_number(national)}\"\n end", "title": "" } ]
[ { "docid": "ff652dc5cba5fc0d5723da88044129ec", "score": "0.73867416", "text": "def standardized_phone_number\n Phonelib.parse(phone_number, \"US\").e164\n end", "title": "" }, { "docid": "937f58806e381ec61f0e838cbcea847a", "score": "0.70177096", "text": "def format_phone_number_e...
384ba5a8984329031645d30a4d1f5a9b
Checks if a given value is a Time, Date or DateTime object.
[ { "docid": "5ca77479ea6a201dabbf2e0376ef932d", "score": "0.8372667", "text": "def time_value?(input)\n return input.is_a?(Time) || input.is_a?(Date)\n end", "title": "" } ]
[ { "docid": "f13d0244ce4bf7a97e7492a40eb5a1c6", "score": "0.8675783", "text": "def valid_time_or_date?(value)\n value.is_a?(Time) || value.is_a?(Date) || value.is_a?(ActiveSupport::TimeWithZone)\n end", "title": "" }, { "docid": "92409d7bb2e5428bd89f28ec49fb5c5b", "score": "0....
ee6d07b0cc3074a25c872de88ec5e1c6
DELETE /person_schedules/1 DELETE /person_schedules/1.json
[ { "docid": "d41da661c195fd47eef46046305cabb8", "score": "0.79036355", "text": "def destroy\n @person_schedule.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "2f4cd7e16467f6091ded386ad6483a1f", "score": "0.73999447", "text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2f4cd7e16467f609...
c62d40610919f456b2796490b1f159bb
multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.
[ { "docid": "0360c937ff9f3656bfb41c38ad395257", "score": "0.0", "text": "def find_multiples(int)\n counter = 1\n multiple = int\n multiples_array = []\n\n #run loop to find the next multiple as long as the multiple is under 1000\n while multiple < 1000\n multiple = int * counter\n #found the n...
[ { "docid": "ba33fc5c7b8d95739417b6e09d5230be", "score": "0.87425405", "text": "def multiples_of_3_and_5\n numbers = 1...1000\n divisible = []\n numbers.each do |num|\n if num % 3 == 0 || num % 5 == 0\n divisible << num\n end\n end\n divisible.inject { |sum, num| sum + num }\nend", "t...
ed48df98be391c936e313adab9bccc3b
[END add_ad_customizer] [START add_ad_customizer_2]
[ { "docid": "a53a19cd0fcac7b7fabf7c0e4d8b8e21", "score": "0.6387038", "text": "def link_customizer_attributes(client, customer_id, ad_group_id,\n text_attribute_name, price_attribute_name)\n operations = []\n\n operations << client.operation.create_resource.ad_group_custom...
[ { "docid": "dd495d47ea2a5bd524939e8a2c468837", "score": "0.6861297", "text": "def create_ad_with_customizations(client, customer_id, ad_group_id,\n string_customizer_name, price_customizer_name)\n operation = client.operation.create_resource.ad_group_ad do |aga|\n ag...
28d6dd54f258f77deb28fab50d89e89b
PATCH/PUT /acfee_topics/1 PATCH/PUT /acfee_topics/1.json
[ { "docid": "41cd60c8348b07d5944abd5c16f61c91", "score": "0.74110484", "text": "def update\n respond_to do |format|\n if @acfee_topic.update(acfee_topic_params)\n format.html { redirect_to @acfee_topic, notice: 'Acfee topic was successfully updated.' }\n format.json { head :no_conte...
[ { "docid": "611999ec9d4d1b804366afb5b95e605c", "score": "0.74241287", "text": "def update\n json_update(topic,topic_params, Topic)\n end", "title": "" }, { "docid": "7f365873a24b4f2b187db2f2e8b191f4", "score": "0.7048198", "text": "def update\n if @topic.update_attributes(pa...
1b9adf3266538ea50b811079751db35e
this is called for each arg and if the arg is not constant or Variable we create a tmp variable and assign to that, hoising all the calls. the effect is of walking the call tree now, rather than using a stack to do that at runtime
[ { "docid": "fa5b6b2968711ef2fe66697771a30c59", "score": "0.5775397", "text": "def normalize_arg(arg , statements)\n sol_arg = arg.to_sol\n return sol_arg if sol_arg.is_a?(Sol::Expression)\n if( sol_arg.is_a?(Sol::Statements))\n while(sol_arg.length > 1)\n statements << sol...
[ { "docid": "73761d5e0685772cbb99090aecb940f0", "score": "0.6052021", "text": "def _reduce_682(val, _values, result)\n @static_env.declare val[1][0]\n\n result = [ @builder.restarg(val[0], val[1]) ]\n \n result\nend", "title": "" }, ...
0b10060564f4a569bc75abcd9116cf3e
Test if this bag is empty (no files)
[ { "docid": "b010251ac83b2ed8c10bb8723e6e5a97", "score": "0.9201499", "text": "def empty?\n bag_files.empty?\n end", "title": "" } ]
[ { "docid": "8435f89688607bb359c4f26b54d5e5c8", "score": "0.8211764", "text": "def empty?\n files.empty?\n end", "title": "" }, { "docid": "3ea57d3816c5085998998f6066e8a2ae", "score": "0.82078326", "text": "def empty?\n @files.empty?\n end", "title": ...
87470509cd3344050bb7e6555ae7a95e
Example: add doc:414 token:yum111 days:30 Execution of the tokenadds the document to the user's node
[ { "docid": "02113ee8639e734b42fb4280e0535f4a", "score": "0.73690003", "text": "def add_doc_token_days\n return if authorize_user_for_level(2) == false\n token = \"#{@user.screen_name}_#{@token}\"\n cp = CommandProcessor.new(token: token, user: @user)\n @error = cp.put(command: @command, args...
[ { "docid": "4ed51e244de26a16fc5a6ffe9c4873d7", "score": "0.7003016", "text": "def add_doc_and_group_token_days\n return if authorize_user_for_level(2) == false\n group = \"#{@user.screen_name}_#{@and_group}\"\n token = \"#{@user.screen_name}_#{@token}\"\n cp = CommandProcessor.new(token: tok...
739fa5c3251fba6fb2aed7791d17c65c
DELETE /working_units/1 DELETE /working_units/1.json
[ { "docid": "f808262d1f4104e2b1d2d96aed8eb157", "score": "0.7551576", "text": "def destroy\n @working_unit.destroy\n respond_to do |format|\n format.html { redirect_to working_units_url, notice: 'Working unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n en...
[ { "docid": "370c734cf5de3f686c5ce87d5896502b", "score": "0.7477657", "text": "def destroy\n @work_unit = WorkUnit.find(params[:id])\n @work_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to work_units_url }\n format.json { head :no_content }\n end\n end", "ti...
34e93db892c42c7b3bbbb7331d5e5f37
GET /tratments GET /tratments.json
[ { "docid": "c6c0a437341948227bcb8efe01fd289f", "score": "0.7409594", "text": "def index\n @tratments = Tratment.all\n end", "title": "" } ]
[ { "docid": "f5c923dab4affd41cf4331347db049b2", "score": "0.6571124", "text": "def index\n @tenures = Tenure.all\n render json: @tenures\n end", "title": "" }, { "docid": "3653e73d2f1c499b4e2cc752dcc93e5a", "score": "0.6338457", "text": "def index\n @tranvia = Tranvium.all\n...
1127ecafb949671c58d459ef467e10b7
Create a pipeline Create a new pipeline with the provided property values. The entire pipeline object, including its unique ID, will be returned in the response.
[ { "docid": "c576757b345a4b745900e29ab519cfac", "score": "0.6346244", "text": "def create(object_type, pipeline_input, opts = {})\n data, _status_code, _headers = create_with_http_info(object_type, pipeline_input, opts)\n data\n end", "title": "" } ]
[ { "docid": "f8b2110a064d112e5b09a05eb4e507bb", "score": "0.7340999", "text": "def create(body = {})\n @client.pipeline.create(body)\n end", "title": "" }, { "docid": "8a58bc8dcd98fc795fd25a442374f819", "score": "0.7314271", "text": "def create\n @pipeline = Pipeline.new(pa...
279db3ded4a130590d896da3ab08bd55
Searches through each frame for images named image_name and clicks
[ { "docid": "5b4ccb0cbe0bd1daf3449351d1853ebb", "score": "0.7913398", "text": "def click_all(image_name)\n for i in 1..@num_frames\n $ie.frame(:index, i).images.each do |image|\n if image.src =~ /#{image_name}/\n image.click\n sleep(1.5) #TODO Figure out a way to remove t...
[ { "docid": "0fd9afbb72851c5698573d991740e2e4", "score": "0.67611927", "text": "def count_images(image_name)\n image_count = 0\n for i in 1..@num_frames\n $ie.frame(:index, i).images.each do |image|\n if image.src =~ /#{image_name}/\n image_count +=1\n end\n end\n ...
81fed050ace5d5d408d7d026dc62e877
Load styles from and elements from a given HTML document.
[ { "docid": "87816c20e8a27a8078083efd67beb3e5", "score": "0.8327732", "text": "def load_styles_from_html\n load_styles_from_link_elements\n load_styles_from_style_elements\n end", "title": "" } ]
[ { "docid": "96360d00f943f82a7655dacfea0a4bf4", "score": "0.73266536", "text": "def load_css_from_html!\n if tags = @doc.search(\"link[@rel='stylesheet'], style\")\n tags.each do |tag|\n if tag.to_s.strip =~ /^\\<link/i and tag.attributes['href']\n if media_type_ok?(tag.attributes...
7a1f8ecb8396cf301e324b447acc0ec8
Copy all flow and instance template files to the scratch dir
[ { "docid": "a2d2c910bf53013554c2bd99fbeb6e72", "score": "0.78774375", "text": "def copy_templates_to_scratch\n uncompiled_dir(true)\n template_directories.each do |dir|\n Origen.file_handler.resolve_files(dir) do |file|\n subdir = file.relative_path_from(Pathnam...
[ { "docid": "6e4cad07f3cdfcb86a19a7d0f3fa67b9", "score": "0.72228914", "text": "def copy_source_files_to_scratch\n source_directories.each do |dir|\n Origen.file_handler.resolve_files(dir) do |file|\n subdir = file.relative_path_from(Pathname.new(dir)).dirname.to_s\n ...
ab1d27ca7607e73dfc903c87a489dcac
This is a COPY of Asciidoctor::Converter::Html5Converter:convert_document, with the GBIF theme (logo, "Contribute" links etc) added around the table of contents. TODO: handle subtitles. TODO: Check MathJAX URL.
[ { "docid": "0b0a04083bbc7f718b74f9131f1fa8cf", "score": "0.69754964", "text": "def gbif_convert_document node, contribute_before\n br = %(<br#{slash = @void_element_slash}>)\n unless (asset_uri_scheme = (node.attr 'asset-uri-scheme', 'https')).empty?\n asset_uri_scheme = %(#{asset_uri_scheme}...
[ { "docid": "043171215dd325cc31fee90e5d79ba42", "score": "0.66833997", "text": "def convert title, doc\n puts title\n \n if @capturePageTitle\n\t doc.css('title').each do |elem|\n\t\telem.replace doc.create_element('p', doc.create_element('h1',elem.content))\n\t end\n end\n \n # transform images ...
50b6ff4e885cf97713d1e7e172559c3f
returns an array of all Git::Tag objects for this repository
[ { "docid": "56163d23bc897cc748b09c7a13ef9671", "score": "0.7565189", "text": "def tags\n self.lib.tags.map { |r| tag(r) }\n end", "title": "" } ]
[ { "docid": "dcf6143b1e5d5e34798efc0356efbce3", "score": "0.7810963", "text": "def tags\n return GitHub::API.json(\"/repos/show/#{self.owner}/#{self.name}/tag\")['tags']\n end", "title": "" }, { "docid": "631ef52bd91249896443ca7ea1a50270", "score": "0.7769382", "text": "def ta...
bd3a7dfddc30bc69012064ac1ec450c4
Given a hash with numeric values, return the key for the smallest value
[ { "docid": "de702e89d3bc3d6e9438a0304237009b", "score": "0.0", "text": "def key_for_min_value(name_hash)\n #output = []\n #temp_key = {}\n #temp_key = {}\n temp_key = nil\n temp_value = nil\n name_hash.each do |key, value| #if empty/else couldn't get to work\n if temp_value == nil || value < te...
[ { "docid": "187165074e32a7573ee53a9cabb44ed4", "score": "0.8880233", "text": "def key_for_min_value(hash)\n lowest_key=nil \n lowest_value= Float::INFINITY\n hash.each do |name,number|\n if number < lowest_value\n lowest_value=number\n lowest_key= name\n end \n end\n lowest_key\nend...
171de2842d801163f8661673b15cdbe7
Creates a new sub runner, defaulting the context to `self`
[ { "docid": "f0f573cc97bad586d0149feb6c2c671a", "score": "0.78395647", "text": "def new_sub_runner(options, block)\n options = {\n context: self,\n collection: false,\n items: []\n }.merge(options)\n if options[:collection]\n CollectionRunner.new(options.delete(...
[ { "docid": "79711bc235a7ff4d9bc9bb91bf34b2e5", "score": "0.7933548", "text": "def runner context=nil\n self.class.get_runner_class.new self, context\n end", "title": "" }, { "docid": "9a8d00deec0f3c673447775d426f4819", "score": "0.6962866", "text": "def runner_for( options )\...
c28ef229354893f7ee189db2382b907c
Tab completion for the use command
[ { "docid": "ffb98096207726ffbd2e82c69b940e39", "score": "0.0", "text": "def cmd_use_tabs(str, words)\n\t\tres = []\n\n\t\tframework.modules.module_types.each do |mtyp|\n\t\t\tmset = framework.modules.module_names(mtyp)\n\t\t\tmset.each do |mref|\n\t\t\t\tres << mtyp + '/' + mref\n\t\t\tend\n\t\tend\n\n\...
[ { "docid": "c2fcb9290e8a8393693487eeb4988402", "score": "0.69244033", "text": "def autocompletion; end", "title": "" }, { "docid": "c2fcb9290e8a8393693487eeb4988402", "score": "0.69244033", "text": "def autocompletion; end", "title": "" }, { "docid": "04e25ebab4558f5c7612...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "d76d759ccf953e7fd8f5c16011c8d0ad", "score": "0.0", "text": "def set_produce_given\n @produce_given = ProduceGiven.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...
03400ac8638f0cb1c3c5f341875f3ee5
PUT /sport_doctors/1 PUT /sport_doctors/1.json
[ { "docid": "7dad0d7be46d11cbd229677b62e6921c", "score": "0.6777261", "text": "def update\n @sport_doctor = SportDoctor.find(params[:id])\n\n respond_to do |format|\n if @sport_doctor.update_attributes(params[:sport_doctor])\n format.html { redirect_to @sport_doctor, notice: 'Sport doct...
[ { "docid": "e9cd8cf537def1f7d1ee8e612bce567a", "score": "0.6390275", "text": "def update\n @doctor = Doctor.find(params[:id])\n\n if @doctor.update(params[:doctor])\n head :no_content\n else\n render json: @doctor.errors, status: :unprocessable_entity\n end\n end", "title": ""...
cecb166cb10f2c88601a08c8951564e1
POST /booksets POST /booksets.json
[ { "docid": "cdb2762c5f20b6fdd9a59ed3b4bd6877", "score": "0.74697214", "text": "def create\n @bookset = Bookset.new(params[:bookset])\n \n respond_to do |format|\n if @bookset.save\n format.html { redirect_to @bookset, notice: 'Bookset was successfully created.' }\n format.jso...
[ { "docid": "919d0984e503ff6151afc01640028738", "score": "0.6404817", "text": "def create\n @bookset = Bookset.new(params[:bookset])\n @bookset.user_id = session[:user]\n \n respond_to do |format|\n if @bookset.save\n flash[:notice] = 'Bookset was successfully created.'\n f...
81077bf3a0102579b1d89a7674fb54ab
GET /gamecoholders/new GET /gamecoholders/new.json
[ { "docid": "c7310ba2bb67abb309eb02741adec296", "score": "0.0", "text": "def new\n @advitem = Advitem.new\n \n end", "title": "" } ]
[ { "docid": "247592bd44b2184548d2531f0fc13935", "score": "0.7543959", "text": "def create\n @gamecoholder = Gamecoholder.new(params[:gamecoholder])\n\n respond_to do |format|\n if @gamecoholder.save\n format.html { redirect_to @gamecoholder, notice: 'Gamecoholder was successfully create...
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": "def332f5ea8c2e318e6bebd2f50f35f3", "score": "0.0", "text": "def user_params\n params.require(:user).permit(:username, :password)\n end", "title": "" } ]
[ { "docid": "bf92e90603a5ee2dc0876a6d03f92775", "score": "0.81098837", "text": "def a_private_method\n\tend", "title": "" }, { "docid": "24f63369e4a36ccdca81610b9d5db49f", "score": "0.7902801", "text": "def private_method\n end", "title": "" }, { "docid": "24f63369e4a36cc...
a0b088f5fb4e95a923ab08ab6e22bdc4
Builds a reminder mail to user about issues that are due in the next days.
[ { "docid": "92c8f118de31d91341a76c357c09e114", "score": "0.7300859", "text": "def reminder(user, issues, days)\n @issues = issues\n @days = days\n @open_issues_url = url_for(:controller => 'issues', :action => 'index',\n :set_filter => 1, :assigned_to_id => 'me',\...
[ { "docid": "0bfef485a8fd9559ed8826101f4319e3", "score": "0.6637111", "text": "def send_reminder_email(user, expiringtasks)\n @user = user\n @expiringtasks = expiringtasks\n mail( :to => @user.email ,\n :subject => '[Todo Manager] Task Reminder')\n end", "title": "" }, { "docid":...
e8f7b500787aa2b2bb5819023e6b4213
GET /article1s or /article1s.json
[ { "docid": "0ced590948c771182a2ca0971ce71a38", "score": "0.68322146", "text": "def index\n @article1s = Article1.all\n end", "title": "" } ]
[ { "docid": "19a11bbe551c564fa7cca7d31c8cbc3f", "score": "0.6964774", "text": "def show\n @articles = Article.find(params[:id])\n render json: @articles\n end", "title": "" }, { "docid": "a3e2284c636fa2822bc0d36ebd9b2cbe", "score": "0.69290686", "text": "def index\n @article...
e424396686daea4d02297753f533ba34
Represent the LinkedList objects as strings.
[ { "docid": "a5933ebfeff0265cf25c579224bd52e5", "score": "0.0", "text": "def to_s\n return '' if @head.nil?\n\n cur = @head\n result = []\n until cur.nil?\n result << \"( #{cur.value} ) ->\"\n cur = cur.next_node\n end\n result << 'nil'\n result.join(' ')\n end", "titl...
[ { "docid": "372133073448751e1411fab22738f5df", "score": "0.710461", "text": "def to_s\n list_string = \"\"\n temp = @head\n until temp.nil?\n value_string = temp.value.to_s.clone\n # Add suffixes for head and tail nodes\n if temp == @head && temp == @tail\n v...
709b6db05929bb74d476c5b9e9246c56
Add a hook to run after the given method. Either a Proc or Block must be given.
[ { "docid": "3b0818777e220c219d9a38feb6a45f2e", "score": "0.86581886", "text": "def add_after_hook(method, proc=nil, &block)\n return if not instance_methods.include? :method\n if not after_hooks.include? method then\n after_hooks[method] = []\n end\n hook = proc || block\n ...
[ { "docid": "f23c58bffd3b275b4be698ad062b37d9", "score": "0.77422434", "text": "def add_after_hook method, hook, opts = Hash.new\n after_hooked_methods[hook] = Array.new unless after_hooked_methods[hook]\n after_hooked_methods[hook] += [method]\n original = instance_method(method)\n\n define_...
9c74824eaeefdb6706f40664fe0b3424
Args: folder_id new_name Reply: the renamed folder
[ { "docid": "bae089ccfd56b6380734c91c066b0b84", "score": "0.83040136", "text": "def rename_folder\n folder = Folder.find(params[:folder_id])\n folder.update(name: params[:new_name])\n render json: folder_to_json(folder)\n end", "title": "" } ]
[ { "docid": "e02222f7effc4ddcdc1d02696685d0b9", "score": "0.83246267", "text": "def rename_folder(id,folder_name)\n self.class.put(\"#{url}/api/filesystem/folders/#{ERB::Util.url_encode(id)}/name\", basic_auth: @auth, body: {:name => folder_name}.to_json, headers: {'Content-Type' => 'application/json'...
7c27f9384e6a09b36b5b4ae2fb9c3aaf
Compare skills between the profile and search page and log the skills that weren't on both pages
[ { "docid": "5821a4460a63d4dec0cd043ec7613523", "score": "0.8222748", "text": "def compare_profile_skills(search_skills, profile_page_skills)\n non_matching_skills = profile_page_skills - search_skills\n\n if non_matching_skills\n Log.info \"These skills where not in the search #{non_matching_...
[ { "docid": "94d6723aa876eb03a69b0985b628c018", "score": "0.674675", "text": "def skills_search\n if params[:skills].present?\n # skills will be sent as a comma seperated string\n q = {}\n q[:skills_overlap] = params[:skills].split(\",\").collect {|skill| skill.strip}\n @q = Profil...
81d2ff175dd2695bda9258d1d5b66574
Determine the allowable fan system brake horsepower Per Table 6.5.3.1.1A
[ { "docid": "17bf219b8b1e64d1a02ef9b7751fe920", "score": "0.67823493", "text": "def allowable_system_brake_horsepower(template = \"ASHRAE 90.1-2007\")\n \n # Get design supply air flow rate (whether autosized or hard-sized)\n dsn_air_flow_m3_per_s = 0\n dsn_air_flow_cfm = 0\n if self.autosiz...
[ { "docid": "cf521e065d2049a5a5d71635ac05df40", "score": "0.77511245", "text": "def brakeHorsepower()\n \n # Get the fan motor efficiency\n fan_motor_eff = fan.motorEfficiency\n \n # Get the fan power (W)\n fan_power_w = self.fanPower\n \n # Calculate the brake horsepower (bhp)\n f...
5d69c306a66831281999d28a70f6daaf
Private: Iterates through all attributes and sets it on the instance.
[ { "docid": "bd5f29e4aa89656fc2f085376d13842b", "score": "0.0", "text": "def update_local_attributes!(attributes_hash)\n attributes_hash.each_pair do |attr_name, attr_value|\n update_local_attribute!(attr_name, attr_value)\n end\n end", "title": "" } ]
[ { "docid": "9bf13538d4d44bd3fa9a180c9207112c", "score": "0.8010543", "text": "def set_attributes\n self.class.attributes.each do |attr|\n model_instance.public_send(\"#{attr}=\", read_attribute(attr))\n end\n end", "title": "" }, { "docid": "ce37f721bce3bb74622ce517d58a26ef", ...
23e423f58bdb9fd35890149c25d33997
evaluates predicate function with args
[ { "docid": "3e4fcf5c0d6e6c8d36946bdbf3563195", "score": "0.78350013", "text": "def predicate?(*args)\n predicate.call(*args)\n end", "title": "" } ]
[ { "docid": "01682ed6ee80151f2ab8fa111642141f", "score": "0.6276373", "text": "def add_predicate; end", "title": "" }, { "docid": "02f5962ff527e736f765a327eb2325e3", "score": "0.60467976", "text": "def predicate(&block)\n @predicate = block unless block.nil?\n @predicate\n ...
ab3351c66cc0e1d6d9bca13deacb6eee
Select a build to be submitted for Review. You have to pass a build you got from candidate_builds Don't forget to call save! after calling this method
[ { "docid": "f87d5ef67cbb16b3f97bd03fc1ccbd03", "score": "0.655539", "text": "def select_build(build)\n raw_data.set(['preReleaseBuildVersionString', 'value'], build.build_version)\n raw_data.set(['preReleaseBuildTrainVersionString'], build.train_version)\n raw_data.set(['preReleaseB...
[ { "docid": "6b2c6121f82238d92ac9f942f5c31184", "score": "0.6265082", "text": "def set_build\n @build = Build.find(params[:id])\n end", "title": "" }, { "docid": "6b2c6121f82238d92ac9f942f5c31184", "score": "0.6265082", "text": "def set_build\n @build = Build.find(params[...
f08c88a981a55538ab41ba244e402f88
Joins and returns the full path
[ { "docid": "f6bd75fc6b644c863b0411e243f1c1d6", "score": "0.0", "text": "def path\n if d = dir\n File.join(d, (filename || \"\") )\n else\n \"\"\n end\n end", "title": "" } ]
[ { "docid": "3d36e3f163c183108615a1508c437083", "score": "0.7657753", "text": "def join(*extra_paths)\n\t\treturn Filepath.join(self, *extra_paths)\n\tend", "title": "" }, { "docid": "8aa01f7d4996004767cda38bd3997077", "score": "0.72645843", "text": "def join *paths\n File.expand...
1042e9deaf47cc698c1f01ca43a978b5
GET /show_all_posts Show all latest posts of all feeds by order of published date
[ { "docid": "61de67a2f7efbe81b3ab85d22da19421", "score": "0.7992294", "text": "def show_all_posts\n feed_urls = Feed.all.collect(&:feed_url)\n @posts = fetch_all_feeds_posts(feed_urls)\n\n respond_to do |format|\n format.html\n format.json { render json: @feeds }\n end\n end", ...
[ { "docid": "b90df60b03f764ecd173466632c37bd3", "score": "0.7845421", "text": "def index\n scope = user_signed_in? ? current_user.feed : Post\n\n @posts = scope.page(params[:page]).per(5).order('created_at DESC')\n\n respond_to do |format|\n format.html\n end\n end", "title": "" }...
512e6286d7ec70e73d3170bc0cdebd12
Return a hash of all the summary stats for the set. Super useful for quickly getting the gist of a set.
[ { "docid": "b8d841bb19ef8e13a223f69f5b636390", "score": "0.674454", "text": "def all_stats\n summary_statistics = {}\n summary_statistics[:min] = self.min\n summary_statistics[:first_quartile] = self.percentile(0.25)\n summary_statistics[:second_quartile] = self.percentile(0.5)\n summary_...
[ { "docid": "2ac8b6ca1a29c6ec99d23a95d935930d", "score": "0.7015405", "text": "def summary\n response = get \"summary\", {}\n Hashie::Mash.new(response)\n end", "title": "" }, { "docid": "0962f815b475aa39bf0ad18d295de022", "score": "0.6769244", "text": "def metricsets_sum...
d9c494555edeffcba2a083e9f5517fbe
GET /gamers GET /gamers.json
[ { "docid": "5ee332d9cd094a44146201f17c0d7eb8", "score": "0.7383485", "text": "def index\n @gamers = Gamer.all\n end", "title": "" } ]
[ { "docid": "91f492b127758c6ecfafed6be9fe5dac", "score": "0.7206229", "text": "def list_gamers\n @list = Gamer.order(params[:order]).page(params[:page]).per(20)\n end", "title": "" }, { "docid": "35abe61bfd224be00c833b79588a6bd3", "score": "0.6693392", "text": "def show\n @gamb...
955dd46b0a726097f3edf09107d34d9e
GET /stat_records/1 GET /stat_records/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "33ac0cd6228543333b173d7e63a601e0", "score": "0.7207531", "text": "def index\n @stat_records = StatRecord.all\n end", "title": "" }, { "docid": "9cae7bd36b45607b7239f2410be29088", "score": "0.6999585", "text": "def index\n @stats = Stat.last\n\n respond_to do |fo...
7e9f198bb7b7bcabb12ce0f8c7d30b36
Identical functionality that rgraph_object_and_div. Only returns id and html code.
[ { "docid": "aa6cbad1f18dedffd3f3f566b7b95b55", "score": "0.77334195", "text": "def rgraph_object_and_div(width, height, chart, id = nil)\n\n id = Rgraph::Util.generate_id if id == nil\n\n html = get_html(width, height,chart, id)\n return [id, html]\n end", "title": "" } ]
[ { "docid": "3d4b0b5bcb1c6e3e27ef149563a1a510", "score": "0.6567304", "text": "def rgraph_object_and_div_and_csv(width, height, chart, id = nil)\n\n id = Rgraph::Util.generate_id if id == nil\n\n html = get_html(width, height,chart, id)\n return [id, html, chart.get_csv]\n end", "ti...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "951363f9be0aeb384bd9543ace570ea8", "score": "0.0", "text": "def set_order\n @order = Order.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
cff757723be039313fb0f00c2ad6064b
GET /biomechanical_symmetries/1 GET /biomechanical_symmetries/1.json
[ { "docid": "785895bc47c50c348499a0f2e6a65eba", "score": "0.6478767", "text": "def show\n @biomechanical_symmetry = BiomechanicalSymmetry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @biomechanical_symmetry }\n end\n end", ...
[ { "docid": "ce58f101ddf0cab6abf46933ae5431a2", "score": "0.58732855", "text": "def new\n @biomechanical_symmetry = BiomechanicalSymmetry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @biomechanical_symmetry }\n end\n end", "title": "" ...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "b8e777d081988af88220a9aabe66c8a4", "score": "0.0", "text": "def user_params\n params.require(:user).permit :first_name, :last_name, :email, :password\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.71230334", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.70530915", "text": "def expected_permitted_parameter_names; end", "title": ...
254ab1c942be85bddd937c5b340a9267
GET /sites/new GET /sites/new.json
[ { "docid": "710b45035a5d240ee3731298e7fad204", "score": "0.79289687", "text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" } ]
[ { "docid": "ebe928aa5e65a1bcc8ab6cc88ac95503", "score": "0.79740214", "text": "def new\n @site = current_user.sites.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "ebe928aa5e65a1bcc8...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "e9753be03716616cc8cc4c1f01b77980", "score": "0.0", "text": "def update!(**args)\n @assistant_interaction_features = args[:assistant_interaction_features] if args.key?(:assistant_interaction_features)\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...
dc8534be9da42b72241bc8d17fa98c08
Convert a string to a valid YAML value
[ { "docid": "0e67efecd5a7bef7a9baece77ebadc4f", "score": "0.0", "text": "def to_config_value(orig_value = nil)\n if orig_value\n case orig_value.class.to_s\n when /Integer/\n to_i\n when /(True|False)Class/\n self =~ /^(t(rue)?|y(es)?|1)$/i ? true : false\n ...
[ { "docid": "e65f83334b0b8a015991463d44a2b32e", "score": "0.7100393", "text": "def parse_yaml_value val\n if val.empty?\n ''\n else\n begin\n ::SafeYAML.load %(--- #{val})\n rescue ::StandardError, ::SyntaxError\n val = val.gsub '\\'', '\\'\\...
3ae48636d32383c5a0191bababfc0e73
Name : Product Info : Returns the product of all values in the array Author : Trickster Call Info : No Arguments
[ { "docid": "e9473c246dc41ba7ecab2cf9c7baa079", "score": "0.0", "text": "def product\r\n # Setup N initialize to 1\r\n n = 1\r\n # Run Through and Find Product\r\n each {|num| n *= num}\r\n # Return Product\r\n return n\r\n end", "title": "" } ]
[ { "docid": "77ca3ae41d172875a144423fd7b2cc50", "score": "0.77622265", "text": "def product\n @product ||= DoubleDescriptive.product(@array_list)\n end", "title": "" }, { "docid": "c7d46882a85154ce842c2b5dbb9cc3b1", "score": "0.7195292", "text": "def productify(array)\n\nend", ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "518b4fd6ab05bfdf31bf8932b6f7bb00", "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...
e9c710a5597e054978c358980d387de0
builds an imagemagick identify command to the specified fild
[ { "docid": "15bfe44d89ff5573e0e5b68db7f69e8b", "score": "0.0", "text": "def info_command_string(file)\n \"-format '%w,%h,%b' #{file}\"\n end", "title": "" } ]
[ { "docid": "25c2453f8af4d243d4c1142b53d1dc7d", "score": "0.7340213", "text": "def identify(args={})\n tokens = [\"identify\"]\n tokens << convert_to_arguments(args) if args\n tokens << \" '#{@file}#{\"[#{args[:layer].to_s}]\" if args[:layer]}'\"\n tokens = convert_to_command(tokens)\n ou...
012cbf6e6433810e679295247e5051d0
Fetch results for this agent subreddits must be in an array!
[ { "docid": "e28e8c9ccf17eab8aa98cba1d8e3bc13", "score": "0.63909626", "text": "def fetch(subreddits = current_subreddits, queues = QUEUES)\n subreddits.each do |s|\n queues.each { |x| fetch_recent(x, s) } unless queues.nil?\n end\n end", "title": "" } ]
[ { "docid": "e3fc1cf8cd8c6ea55583d62e5089b2ee", "score": "0.67733955", "text": "def get_subreddits(where = :popular, params = {})\n object_from_response :get, \"/subreddits/#{where}.json\", params\n end", "title": "" }, { "docid": "4bff3e833ccff8435021e3edce398289", "score...
eb40a4143a40b5ceb81c6ef8d5e18291
DELETE /bakusokukuns/1 DELETE /bakusokukuns/1.json
[ { "docid": "089f85e4728e34cc941f3366644b161b", "score": "0.6797364", "text": "def destroy\n @bakusokukun.destroy\n respond_to do |format|\n format.html { redirect_to bakusokukuns_url, notice: 'Bakusokukun was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",...
[ { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.7077385", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "179ff0053e8f4f967cb3d92206094cf0", "score": "0.70015156", "text": "def delete_aos_version(args = {}) \n delete(\"/aosversion...
35333c505b55b2d75cf1b8d1b69d3d36
Change the internal node that this object delegates to by performing a query. If a block is given, changes it only for the duration of the block.
[ { "docid": "d11b7c75f77e15e38fc4a4f64bb82650", "score": "0.0", "text": "def scope(path)\n old_node = __getobj__\n node = at(path)\n if node then __setobj__(node)\n else raise \"no node at #{path.inspect}\"\n end\n\n if block_given?\n begin\n yield self\n ...
[ { "docid": "f0930f850bce7a6d96c308b149f48249", "score": "0.668749", "text": "def node=(node)\n query[:node] = node\n end", "title": "" }, { "docid": "f0930f850bce7a6d96c308b149f48249", "score": "0.668749", "text": "def node=(node)\n query[:node] = node\n end", "ti...
2e8cf9693777f7e4f94ee3a36d1075a1
Creates a new model object and saves it (if a post), then reroutes to the main page
[ { "docid": "f43d5220fdead82cd9b3bdc0fa471070", "score": "0.0", "text": "def onNew(packet, params)\n params[:published] = false unless params.has_key?(:published) || params.has_key?(\"published\")\n params[:author] = packet['user', false] ? packet['user'].name : \"Author\" unless params.has_key...
[ { "docid": "f2d5c2d17052c4396c62176ba881da38", "score": "0.7328253", "text": "def create\n # creating the object... and whitelisting the controller params title and text... allowing them. \n @post = Post.new(post_params)\n # saving the object into the database with a rails method\n if @post....
43e75844ac504d1e728095324990403d
boolean Does this automation run in real time? This is a readonly property based on automation type.
[ { "docid": "1975ac1bcc1ebc2724359d10f348f290", "score": "0.0", "text": "def realtime\n @attributes[:realtime]\n end", "title": "" } ]
[ { "docid": "e3e3b2f94028f1555166363edbb6683d", "score": "0.7108667", "text": "def is_running?\n @running\n end", "title": "" }, { "docid": "6ea9853814a162409db6a65e9c33faa5", "score": "0.70057094", "text": "def running?\n @is_running\n end", "title": "" }, { "doci...
a15d32ca91b8c0ada7fb634010ac16cc
The Director can construct several product variations using the same building steps.
[ { "docid": "1c367a89ba72b7122c300047a282352d", "score": "0.0", "text": "def build_computer\n @builder.build_case\n @builder.build_screen\n @builder.build_keyboard\n end", "title": "" } ]
[ { "docid": "2612d87acc1bf61aa3d3e5bf135bab64", "score": "0.6744246", "text": "def build_product\n Product.new(name: 'Product 1', measure_ids: ['8A4D92B2-397A-48D2-0139-B0DC53B034A7'], bundle_id: '4fdb62e01d41c820f6000001')\nend", "title": "" }, { "docid": "cd346a9571a18e548e8f53a08d8879c2",...
8080b4e6dcaa2ee9bb663e37f055889d
if get days supply only then days_supply = ... calculated
[ { "docid": "90a7b816a9bfe5fe5bc59f49fe2f2a64", "score": "0.78474045", "text": "def calculate_daily_quantity_from days_supply\n calculated_daily_quantity = days_supply / self.last_fill_quantity\n end", "title": "" } ]
[ { "docid": "3d54deee53df9daafeb3d26acc861ff5", "score": "0.81540513", "text": "def calculate_days_supply_from daily_quantity\n calculated_days_supply = quantity_dispensed / daily_quantity\n end", "title": "" }, { "docid": "3ceffe23918706237e4bfb0d25b46bc6", "score": "0.6872806", ...
a7364a25453af34311d0541334beb1a0
Exit normally, dumping current setup information to YAML
[ { "docid": "1613b5e3ff78475a3089fd229c77f733", "score": "0.6676014", "text": "def exit_normal\n puts \"\\n\\n Exiting JumpStart...\".purple\n puts \"\\n Goodbye!\\n\\n\"\n puts \"******************************************************************************************************...
[ { "docid": "6a8bbd26fe412d7cb691697c6d271c86", "score": "0.63178104", "text": "def dump_jumpstart_setup_yaml\n File.open( \"#{JumpStart::CONFIG_PATH}/jumpstart_setup.yml\", 'w' ) do |out|\n YAML.dump( {:jumpstart_templates_path => @templates_path, :jumpstart_default_template_name => @default...
161b1faefeea788810e3a4d4e7832e1b
GET /music_boxes/new GET /music_boxes/new.json
[ { "docid": "61f3a5e38b3057bab0a311a8b46bba66", "score": "0.7977238", "text": "def new\n @music_box = MusicBox.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @music_box }\n end\n end", "title": "" } ]
[ { "docid": "dab8017844f13e33d93dd7809c2348e3", "score": "0.77241325", "text": "def create\n @music_box = MusicBox.new(params[:music_box])\n\n respond_to do |format|\n if @music_box.save\n format.html { redirect_to @music_box, notice: I18n.t('app.views.music_boxes.messages.create.succes...
63cf21c80be6e7fec837eec4f0828ec4
Public: Registers a new user email user's email password user's password Examples
[ { "docid": "ea8a95f2a4a89f673ca07f091a98d7ae", "score": "0.70107955", "text": "def register(email, password)\n params = {:account => {:email => email, :password => password, :password_confirmation => password}, :client_id => Stagehand.config.client_id}\n url = Stagehand.config.resource_hos...
[ { "docid": "3cb8902acd28e8b861f39a41daf20294", "score": "0.78647757", "text": "def register_new_user(email, password)\n query_rest('successful_register', :action => :register_new_user, :login => email, :password => password)\n end", "title": "" }, { "docid": "9b2044d21f1b4313c642a6b4...
790a9ca3ed67f13fae587aaaed2ac69d
PATCH/PUT /journaaltypes/1 PATCH/PUT /journaaltypes/1.json
[ { "docid": "c3a247c0c524a31d3160c388a3d4c6a9", "score": "0.70980996", "text": "def update\n respond_to do |format|\n if @journaaltype.update(journaaltype_params)\n format.html { redirect_to @journaaltype, notice: 'Journaaltype was successfully updated.' }\n format.json { render :sh...
[ { "docid": "f9603b3d44faed9a2cfb9fb08aad435b", "score": "0.6525378", "text": "def change_type\n\t\t\trender json: User.update_type_by_id(params[:id], params[:type], params[:is])\n\t\tend", "title": "" }, { "docid": "5d96c879fee25218d2ac908a3bcaa3c6", "score": "0.6383875", "text": "de...
1a06f2f6de123779a3d56353cbdc8fc9
The raw dispatch work, wrapped in error handling.
[ { "docid": "0c4870bd764471999d61d825ad9acc0d", "score": "0.6107502", "text": "def do_dispatch(participant, msg)\n\n do_raw_dispatch(participant, msg)\n\n rescue => err\n @context.error_handler.msg_handle(msg, err)\n end", "title": "" } ]
[ { "docid": "47859b6d17d23fe19d7e57bc3953d909", "score": "0.6736274", "text": "def action_wrapper\n begin\n yield\n rescue ::Rbt::Error::AuthError => e\n handle_auth_error(e)\n rescue ActiveRecord::RecordInvalid => e\n handle_validation_error(e)\n rescue => e\n ...
c93ffec900555baf1a081face2f3863a
crea l'icona del prodotto
[ { "docid": "5064017b67b58c39ced1eab39fe5eafe", "score": "0.5999502", "text": "def create_product_icon\n @product_icon = Sprite.new\n @product_icon.x = cent_x\n @product_icon.y = cent_y\n end", "title": "" } ]
[ { "docid": "92b9fd78be841e09760859ab4b8751ea", "score": "0.6203565", "text": "def create\r\n @icons_app.each do |k,v|\r\n v.create\r\n end\r\n # local variables\r\n \r\n refresh_settings\r\n \r\n #splitter position\r\n gfxgui_settings = @app_settings['guigfx']\r\n \r\n...
27956440b8e8429fcea0344bd9c7a480
Get a url for a speech file generated from uploaded text.
[ { "docid": "1c93f57cfea56bb571a9710b7d6189af", "score": "0.65785414", "text": "def create_speech_file( text, voice='en_us_salli', speed = \"Prosody-Rate=100\", sentencebreak = \"Sentence-Break=400\", paragraphbreak = \"Paragraph-Break=650\")\n HTTParty.post(\"#{BASE_URL}/speechfiles\", {:body=>get_...
[ { "docid": "ba5f18dc8630cf23950745d4a93f973a", "score": "0.67083246", "text": "def audio_url(path); end", "title": "" }, { "docid": "ba5f18dc8630cf23950745d4a93f973a", "score": "0.67083246", "text": "def audio_url(path); end", "title": "" }, { "docid": "6bf223d9fd81250c95...
15aa75b1520b62c4aed1cfe9b68b1bc5
The edit funtion is used to edit information of a game
[ { "docid": "ba213b432b45ed3cced9700fce391f38", "score": "0.7306752", "text": "def edit\n \t@admingame = Game.find(params[:id])\n end", "title": "" } ]
[ { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.7709616", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.7709616", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "sc...
0115ce6624f70824a8a88cf3ce1265ee
POST /master_bom_items POST /master_bom_items.json
[ { "docid": "4a94f86c90e4752b105a0db59e94a467", "score": "0.724084", "text": "def create\n @master_bom_item = MasterBomItem.new(master_bom_item_params)\n # authorize(@master_bom_item)\n\n respond_to do |format|\n if @master_bom_item.save\n format.html { redirect_to @master_bom_item, ...
[ { "docid": "71173a093490d14a4b75b988ed128bf1", "score": "0.729145", "text": "def master_bom_item_params\n params.require(:master_bom_item).permit(:qty, :bom_item_id, :product_id, :department_id, :project_name)\n end", "title": "" }, { "docid": "025a03a135835e7d6ce72be4c4ed65d7", "sco...
b2b2e60e0aeff8c8c2f4320b149634e2
DELETE /replies/1 DELETE /replies/1.json
[ { "docid": "c1cb4b0cbe60b1cd4aa44eedede6b71b", "score": "0.7688689", "text": "def destroy\n @reply = Reply.find(params[:id])\n @reply.destroy\n\n head :no_content\n end", "title": "" } ]
[ { "docid": "af9019c0b7a75bc611984f2c012f9199", "score": "0.7838339", "text": "def destroy\n @reply = @message.replies.find(params[:id])\n @reply.destroy\n\n respond_to do |format|\n format.html { redirect_to([@user,@message]) }\n format.xml { head :ok }\n end\n end", "title":...
cb790738f2567ca0b6df3f68aff416a4
Emit a text representation of the grammar. Each production rule is emitted per line.
[ { "docid": "3175f824b19a8bbeae5aecb42165c6b2", "score": "0.5581572", "text": "def to_string\n productions.map(&:to_string).join(\"\\n\")\n end", "title": "" } ]
[ { "docid": "1f50059ea2792049807b101cb0b82123", "score": "0.6660675", "text": "def puts_grammar(cnf)\n\t\tcnf.each {|state, production| puts \"#{state} => #{production}\"}\n\t\tprint \"\\n\"\n\tend", "title": "" }, { "docid": "d0ea54383c9b8e80a9a458a0750f0926", "score": "0.64997977", ...
3bedee09d243eae533680610a53da379
The +recv_whole_block+ method loops receiving a sent block as packets, rebuilding the whole block and joining it.
[ { "docid": "497e7603bfa59841aef81ade5ac46f8c", "score": "0.66226804", "text": "def recv_whole_block(client)\n block = String.new\n begin\n catch :whole_block do\n loop do\n packet = client.recvfrom(@@block_size)[0]\n if packet == ''\n throw :whole_block\n ...
[ { "docid": "d9cc0125e5d73b0137d152ee1cf91b68", "score": "0.5529707", "text": "def send_getblocks\n refresh_status\n\n # @blockchain.blocks.length includes block #0 while @blockchain.last_height does not.\n if @blockchain.blocks.length > @blockchain.last_height\n @blockchain.save_data\n ...
e9e565b8074c2fc2170152a2c5edaf9c
TODO: Move analyze_and_return_labels_with_score into a worker
[ { "docid": "69813c6d541b5fbd64eeff78df12ecce", "score": "0.7461735", "text": "def analyze_and_return_labels_with_score\n image_annotator = Google::Cloud::Vision::ImageAnnotator.new\n file_name = self.image_on_disk\n response = image_annotator.label_detection image: file_name\n return_data = ...
[ { "docid": "ab158678ab1aed1b5fa7898ce02db2a9", "score": "0.65490484", "text": "def score(x, y)\n x = check_convert_sample_array(x)\n y = check_convert_label_array(y)\n check_sample_label_size(x, y)\n evaluator = Rumale::EvaluationMeasure::Accuracy.new\n evaluator.score...
70dd2b2ee77d23ef909c6e541f9a8ecc
Replace placeholders in a string
[ { "docid": "4a3a1189968ccfa392398a3e165cac92", "score": "0.6009013", "text": "def expand(str)\n str = str.gsub(/\\$\\{([^}]+)\\}/, '#{\\1}') # ${..} => #{..}\n eval \"\\\"#{str}\\\"\", @placeholders.instance_eval { binding }\n end", "title": "" } ]
[ { "docid": "20ea21fbd67903e555c3c0e9580e55d5", "score": "0.7347981", "text": "def transform_placeholders(str)\n str.gsub(/(\\$\\d|\\$\\{\\d\\})/) do |match|\n tmp = match[1, match.size]\n tmp = tmp[1].chr if tmp.size > 1\n \"\\\\#{tmp}\"\n end\n end", "title": "" }, { "...
c5b16d9676d84fb743f4cf28bee38aa4
POST /tasks POST /tasks.json
[ { "docid": "d9a872d789bb821e6856a5983d46c87f", "score": "0.0", "text": "def create\n if get_case\n @task = @case.tasks.create(task_params)\n path_tasks = case_tasks_path\n else\n @task = Task.new(task_params)\n path_tasks = tasks_path\n end\n\n @task.user = @user\n @ta...
[ { "docid": "780b88f768513ebf1032946b44a23f64", "score": "0.7529737", "text": "def create\n #@task = Task.new(task_params)\n task = @task_list.tasks.create!(task_params)\n render json: task\n end", "title": "" }, { "docid": "ae173c1e45b9ac44ef7f6d4ccb1da825", "score": "0.7497622...
ebbfb0ae1e4374b81ec76af6c343a1bb
Adds the current package being stored to the YAML cycle data file and will remove any old package file(s) when the storage limit set by keep is exceeded.
[ { "docid": "475bf7125434c0a574c185bcef1856f1", "score": "0.7333713", "text": "def cycle!\n Logger.info 'Cycling Started...'\n\n packages = yaml_load.unshift(package)\n excess = packages.count - keep.to_i\n\n if excess > 0\n packages.pop(excess).each do |pkg|\n ...
[ { "docid": "b64f63288cecbc8ea19b8c988e95aacf", "score": "0.7835793", "text": "def update_storage_file!\n packages = yaml_load.unshift(@package)\n excess = packages.count - @storage.keep.to_i\n @packages_to_remove = (excess > 0) ? packages.pop(excess) : []\n yaml_save(...
64337726d5e027922d10dac7d85987bb
Render element into DOM in the current rendering context. Used for elements that are not yet in DOM, i.e. they are provided as children or they have been explicitly removed from the rendering context using the delete method.
[ { "docid": "96d6eaabb6c10a3371de43e6ba566cd3", "score": "0.59483325", "text": "def render(*props)\n if props.empty?\n Hyperstack::Internal::Component::RenderingContext.render(self)\n else\n props = Hyperstack::Internal::Component::ReactWrapper.convert_props(element_type, ...
[ { "docid": "6a74ae6324898ba54425713eb706fbf4", "score": "0.6967696", "text": "def render!\n\t\t\tnodes = collect{|child| child.respond_to?(:render!) ? child.render! : child}.flatten\n\t\t\treplace(nodes)\n\t\tend", "title": "" }, { "docid": "c26b2a5eb12057b324bad757ee81b07c", "score": "0...
b124a22f3bcde769788995c27ad7fc38
Add the text functions to the interface Create a new QuestBookList
[ { "docid": "3b69e5d537d0ff8c36e4b4cec4ebe4c7", "score": "0.5150515", "text": "def initialize(id, index, quests_id)\n super() # Call the Base initialize method ignoring the argument of the current initialize\n @index = index\n @id = id\n @quests_id = quests_id\n @viewport = Viewp...
[ { "docid": "2b31300756a685555ac2c5cdbc789e8e", "score": "0.62401724", "text": "def add_item(text)\n result = @client.api_helper.get_response(Config::TODOIST_QUICK_ADD_COMMAND, {text: text})\n return ParseHelper.make_object(result)\n end", "title": "" }, { "docid": "b...
b4d264db241115ef9b4a071076e4188b
Puts a message in the SQS queue
[ { "docid": "f13f0db34e8453467d5cf0b86e4fc8ca", "score": "0.0", "text": "def enqueue(queueKey, workUnit)\n self.queues[queueKey].send_message(workUnit)\n end", "title": "" } ]
[ { "docid": "10c9fcb6e0ffb7ddc11776a06f8eb0f4", "score": "0.8080443", "text": "def send_message(message)\n sent_message = @queue.send_message(message.to_sqs_message)\n Queued::Services::AmazonSqs::Message.new(self, nil, nil, sent_message)\n end", "title": "" }, { "doc...
c5dc3260a9d3f7e6a862142d2a191b5c
PATCH/PUT /coffee_attempts/1 PATCH/PUT /coffee_attempts/1.json
[ { "docid": "6afede209170051bb646c8931c7f1952", "score": "0.7212164", "text": "def update\n\n respond_to do |format|\n if @coffee_attempt.update(coffee_attempt_params)\n\n format.html { redirect_to @coffee_attempt, notice: 'Coffee attempt was successfully updated.' }\n format.json {...
[ { "docid": "6033ebd641ac13b37bfdaba33c6af8af", "score": "0.65153134", "text": "def update\n respond_to do |format|\n if @attempt.update(attempt_params)\n format.html { redirect_to @attempt, notice: 'Attempt was successfully updated.' }\n format.json { render :show, status: :ok, loc...
057b150d7c59fdb5ebf05b639a7d8439
`rsync` cookbooks to the node
[ { "docid": "4510cbfcae0c2fc056802110d149b112", "score": "0.7693107", "text": "def sync_cookbooks\n rsync_resource(:cookbooks)\n end", "title": "" } ]
[ { "docid": "d9a0dc4f81aa2499e8ccfbc303cb335b", "score": "0.6708183", "text": "def sync_recipes\n Chef::Log.debug(\"Synchronizing recipes\")\n update_file_cache(\"recipes\", @rest.get_rest(\"cookbooks/_recipe_files?node=#{@node.name}\"))\n end", "title": "" }, { "docid": "128eda1...
ec3cd89d07710792bc03a72ef11610bb
Some storage implementations cache information before a step begins, reducing the number of requests to the underlying data system. This begin step notifies the storage that a new step is on and it should refresh the cached information. The storage implementation, if it supports this feature, will cache the information...
[ { "docid": "cc29a1d78fa9c838ab82ae8ccf88c478", "score": "0.6664867", "text": "def begin_step\n\n Thread.current['ruote_worker'] = self\n\n @storage.begin_step if @storage.respond_to?(:begin_step)\n end", "title": "" } ]
[ { "docid": "2e180a07bd4cce13a97fd09e0e84f9cc", "score": "0.77503854", "text": "def begin_step\n\n prepare_cache\n end", "title": "" }, { "docid": "94f8279e86f42511f057fe2a387015f5", "score": "0.60235447", "text": "def after_call\n finalize_loaders\n @cache = {} ...
dc12929403a9d5c9c86c47849e041b5c
GET /student_talukas/new GET /student_talukas/new.json
[ { "docid": "9d5288cbcc461f62794aee6750510d09", "score": "0.7820144", "text": "def new\n # @student_taluka = StudentTaluka.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student_taluka }\n end\n end", "title": "" } ]
[ { "docid": "dd7013e9251d9a09c12a10d4b91b4816", "score": "0.781027", "text": "def new\n @title = \"Create Student Account\"\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "title": "" }, ...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "387e993d39b57825191d06dcc01a6d2c", "score": "0.0", "text": "def update!(**args)\n @display_name = args[:display_name] unless args[:display_name].nil?\n @label_with_op = args[:label_with_op] unless args[:label_with_op].nil?\n @name = args[:name] unless args[:n...
[ { "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...
b4ed9d180da4ef31b2df1ce2eda2b9e8
POST /trajectories POST /trajectories.json
[ { "docid": "39c24742c3e7d2c236b5be544a66bc13", "score": "0.6014214", "text": "def create\n @trajectory = Trajectory.new(params[:trajectory])\n\n respond_to do |format|\n if @trajectory.save\n format.html { redirect_to @trajectory, notice: 'Trajectory was successfully created.' }\n ...
[ { "docid": "abb787a7becfd105684d3f04f3fbb9fa", "score": "0.62927747", "text": "def create\n @trail = Trail.new(params[:trail])\n\n respond_to do |format|\n if @trail.save\n format.html { redirect_to @trail, notice: 'Trail was successfully created.' }\n format.json { render json:...
5be701f2dcefea82b49c98161789d332
update delete user from the database Rt: DELETE /users/:id c.r.u.D
[ { "docid": "4815bd651759a575dfcc3708a90c98cd", "score": "0.7632745", "text": "def destroy\n User.find(params[:id]).destroy\n flash[:success] = \"User deleted\"\n redirect_to users_url\n end", "title": "" } ]
[ { "docid": "acc859d1b341336dcf96e9bf81b4f874", "score": "0.7984655", "text": "def delete\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "acc859d1b341336dcf96e9bf81b4f874", "score": "0.7984655", "text": "def delete\n @user = User.find(params[:id])\n end", ...
c7751864fecb224f516115e279897901
Trigger set helps the user set a trigger Test: what's your trigger?
[ { "docid": "bb453a850d7e48832f0e800222f4f7d8", "score": "0.67588186", "text": "def triggerset(current_user)\n\tputs \"triggerset\" # for testing\n\ttrigger = \"\"\n\n\tcurrent_user.levelup\n\ttrigger = answer\nend", "title": "" } ]
[ { "docid": "481eaa15b6ad57be84e2008e2a0359f7", "score": "0.71020436", "text": "def triggers\n all_triggers.select { |name|\n allow?(name)\n }.to_set\n end", "title": "" }, { "docid": "7e67242ea841789e90177201462d592f", "score": "0.67940086", "text": "def t...
a6baec6044dadc5fc9724819577f18f6
Criando um novo array heroi def calcula_nova_posicao(heroi, direcao) case direcao when "W" [ heroi[0] 1, heroi[1] ] when "S" [ heroi[0] + 1, heroi[1] ] when "A" [ heroi[0], heroi[1] 1 ] when "D" [ heroi[0], heroi[1] +1 ] end end Duplicando um array def calcula_nova_posicao(heroi, direcao) heroi = heroi.dup case direcao...
[ { "docid": "c52dfa6f7ec14e7f42a19538452d902b", "score": "0.0", "text": "def posicao_valida?(mapa, posicao)\n\n linhas = mapa.size\n colunas = mapa[0].size\n estourou_linhas = posicao[0] < 0 || posicao[0] >= linhas\n estorou_colunas = posicao[1] < 0 || posicao[1] >= colunas\n\n if estourou_linhas ||...
[ { "docid": "7e3f9656543621cf8b3ede4dbfa9055d", "score": "0.8260982", "text": "def calcula_nova_posicao(heroi, direcao)\n heroi = heroi.dup\n movimentos = {\n \"W\" => [-1, 0],\n \"S\" => [+1, 0],\n \"A\" => [0, -1],\n \"D\" => [0, +1]\n }\n movimento = movimentos[direcao]\n hero...
0214a30c812f6b6485bd193a9ea984f4
find the same theme jobs TODO add cach
[ { "docid": "7310c6353fe42ad7a31297333fa142e4", "score": "0.68697137", "text": "def related_jobs\n return [] if self.themes.blank?\n Job.opened.limit(15).order('RAND()').where(\"themes REGEXP ?\", self.themes.gsub(\",\", \"|\")).all\n end", "title": "" } ]
[ { "docid": "4a0cad2c99445cfdb29837dea577917a", "score": "0.6110652", "text": "def scrape_jobs\n @scraper = FreelancerFinder::Scraper.new\n @scraper.scrape_recent_jobs.each do |job_hash|\n FreelancerFinder::Job.new(job_hash) unless FreelancerFinder::Job.all.detect {|job| job.path == job_hash[:...
c009c36e18a323be900fa18ef97063ed
Provide a user friendly representation source://twilioruby//lib/twilioruby/rest/preview/wireless/sim.rb518
[ { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.0", "text": "def to_s; end", "title": "" } ]
[ { "docid": "96d60de44371322e840413a8e9682b50", "score": "0.57695216", "text": "def to_human\n str = +\"##{num} #{human_protocol}\"\n case spi_size\n when 4\n str << ('(spi:0x%08x)' % PacketGen::Types::Int32.new.read(spi).to_i)\n when 8\n str << ('(spi:0x%016...