query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
f3f7736370adb0afebe782f0a24a19fa
Generic method to perform recursive operations on a Hash.
[ { "docid": "391bf67ea833c0afcbe086f11b607c16", "score": "0.0", "text": "def deep_transform_keys(&block)\n _deep_transform_keys_in_object(self, &block)\n end", "title": "" } ]
[ { "docid": "2884273c059b30e41542331de5174555", "score": "0.6629245", "text": "def dehash(hash, depth); end", "title": "" }, { "docid": "3c3cf32d3d8944ad78a0aae0f41e0de9", "score": "0.6446206", "text": "def recalculate_hash_at(node)\n return node._hash = node.value if node.value\n ...
e335f1854b103bd499694c73832f984d
DELETE /purchase_orders/1 DELETE /purchase_orders/1.json
[ { "docid": "63e5259e0ee65a3fd7c98c504e7a4910", "score": "0.7208023", "text": "def destroy\n @purchase_order.destroy\n respond_to do |format|\n format.html { redirect_to admin_purchase_orders_url, notice: 'Purchase order was successfully destroyed.' }\n format.json { head :no_content }\n ...
[ { "docid": "cf95e2b664280ccbc9b47bcf0f1debe9", "score": "0.7581346", "text": "def destroy\n @purchase.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "89af0e6e4527f4cf4ce03544ff8e9a5c", "score": "0.750134", "t...
88e497789804e650c1f92024b68ae4db
AR relation where condition for transaction time intersection. Selects all record that have a transaction period that intersects the instant or period provided. tt_intersect => selects records active now. tt_intersect("20130101") => selects records active on January 1, 2013 at 00:00:00. tt_intersect("20130101", "201301...
[ { "docid": "cf5bb45b8d960b0f401898facde01068", "score": "0.7488752", "text": "def tt_intersect(instant=Time.zone.now, range_end=nil)\n where(arel_tt_intersect(instant, range_end))\n end", "title": "" } ]
[ { "docid": "ebba291501b5ba2e7f87268fc439a925", "score": "0.71105796", "text": "def arel_tt_intersect(instant, range_end)\n arel_intersect(:ttstart_at, :ttend_at, instant, range_end)\n end", "title": "" }, { "docid": "d7f34ad5099ce4c5da264b75b46a70ed", "score": "0.6823162", "t...
9f2c4d9aa4ef0d0aba47600638d8e2e7
DRIVER TESTS GO BELOW THIS LINE card = CreditCard.new(4563960122001999) p card.check_card => true card = CreditCard.new(4408041234567892) p card.check_card => false card = CreditCard.new(44080412345678) p card.check_card => should throw error
[ { "docid": "97673ad72966aeff8c8946e6116a8593", "score": "0.0", "text": "def assert\n raise ArgumentError.new(\"Try again!\") unless yield\n raise \"Assertion failed!\" unless yield\nend", "title": "" } ]
[ { "docid": "736c8d72ea8d6246881d89b14d652d68", "score": "0.8004137", "text": "def assert\n raise \"Invalid Credit Card\" if CreditCard.new(1234567891234567).check_card()\n raise \"Invalid Credit Card\" if CreditCard.new(4408041234567892).check_card()\n raise \"Invalid Credit Card\" if CreditCar...
2dc83c20cc899dd84bbc77b90ca4e5d2
GET /places/1 GET /places/1.json
[ { "docid": "bb4540fe91a2c2558ee49b7366b60ee2", "score": "0.0", "text": "def show\n \n end", "title": "" } ]
[ { "docid": "6c6f23ccf7a32c2b2941dcc1b5fecf54", "score": "0.7485251", "text": "def show\n @place = Place.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @place }\n end\n end", "title": "" }, { "docid": "7ffe0f9631141c12ec4e224e94ba1ae1", "score": "...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "e7bd681499a259f6c438aa8cc5adf931", "score": "0.0", "text": "def plan_params\n params.require(:plan).permit(:name, :velocity_max_upload, :velocity_max_download, address_range_attributes: [:id, :name, :start_range, :end_range, :concentrator_id])\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...
02a62ec641fabe830af77bdbf6753880
add element to queue.
[ { "docid": "0a90066642ed0a35ca213f3bffa1e1ed", "score": "0.7578861", "text": "def enqueue(el)\n queue_array.unshift(el)\n end", "title": "" } ]
[ { "docid": "6d4c17271abe3cfa31e81cb707d7d2ed", "score": "0.8695018", "text": "def add(element)\n self.queue << element\n prune! while full?\n end", "title": "" }, { "docid": "dfb6bebba529733002858583f67fbf25", "score": "0.85800713", "text": "def enqueue(element)\n @...
84210199c63ee77ce316bccd13f9da37
GET /sorteios/new GET /sorteios/new.json
[ { "docid": "bf07ac5c945c758f79df4d5c02084179", "score": "0.65449774", "text": "def new\n @sorteio = Sorteio.new\n end", "title": "" } ]
[ { "docid": "0efc596a15702588ddaf7104cd84f765", "score": "0.7470323", "text": "def new\n @sort = Sort.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sort }\n end\n end", "title": "" }, { "docid": "4e04152eafc3841932dc441efe928e4c", ...
78b2cab7fc9ca7006325b98378950c13
def merge(hash_1, hash_2) hash_1.merge(hash_2) end In reading documention, I found the above merge method that solved the problem in one swoop...but the walkthrough spells it out, so I'll try the long way too
[ { "docid": "c3b140613bcbecd92e4e8ba77938f44d", "score": "0.8220358", "text": "def merge(hash_1, hash_2)\n new_hash = {}\n\n hash_1.each { |k, v| new_hash[k] = v }\n hash_2.each { |k, v| new_hash[k] = v }\n\n new_hash\nend", "title": "" } ]
[ { "docid": "10f640910b67d2dffb93911bd2c20289", "score": "0.91709065", "text": "def merge(hash1, hash2)\n hash1.merge(hash2)\nend", "title": "" }, { "docid": "a835fec22b0aedc67d91dc0e2b540e92", "score": "0.8991928", "text": "def merge(hash); end", "title": "" }, { "doci...
61f73b1b7e9e37c6363e130c963c956b
Translates an OTP Leg into the given locale
[ { "docid": "2230f8b157d24dc0b775c0cf36ba6ff1", "score": "0.6165921", "text": "def translate_leg(leg)\n steps = leg[\"steps\"].is_a?(Array) ? leg[\"steps\"] : []\n leg[\"steps\"] = steps.map { |step| translate_step(step) }\n return leg\n end", "title": "" } ]
[ { "docid": "cc2e375a9d2aa5e5542bd0a357bdffaa", "score": "0.66045547", "text": "def to_google_translate_compatible_locale(locale); end", "title": "" }, { "docid": "cfd6c35a87facf56d14caffbc8489c1a", "score": "0.64542973", "text": "def locale_from_route; end", "title": "" }, { ...
6a0611a49c55b7eddba3be9ac38fbbea
Returns an array of JS conditions for raising and argument error caused by arity check
[ { "docid": "4e821d2230186c25cbf25f197348ea49", "score": "0.6982573", "text": "def arity_checks\n return @arity_checks if defined?(@arity_checks)\n\n arity = all_args.size\n arity -= @optargs.size\n\n arity -= 1 if @restarg\n\n arity -= kwargs.size\n\n arity = -a...
[ { "docid": "e404367294f8224d48c47b6aa8fdbce6", "score": "0.67908907", "text": "def raise_error_args?\n arg_types = arguments.map(&:sexp_type)\n [[], [:str], [:const], %i[const str], [:colon2]].include?(arg_types)\n end", "title": "" }, { "docid": "34ae73587c0f9d71ebe...
e253924e9e6f1508d6428c72aa5f6d71
DELETE /beings_issues/1 DELETE /beings_issues/1.xml
[ { "docid": "2d127abd693198bee9411307343a39b1", "score": "0.7449054", "text": "def destroy\n @beings_issue = BeingsIssue.find(params[:id])\n @beings_issue.destroy\n\n respond_to do |format|\n format.html { redirect_to(beings_issues_url) }\n format.xml { head :ok }\n end\n end", ...
[ { "docid": "d44f3684bf971faeb75471a6b76285a6", "score": "0.70034784", "text": "def destroy\n @happenings_issue = HappeningsIssue.find(params[:id])\n @happenings_issue.destroy\n\n respond_to do |format|\n format.html { redirect_to(happenings_issues_path) }\n format.xml { head :ok }\n ...
0e6ba3e502f4c8b619faff07164b7612
get the value field, YAML decoded
[ { "docid": "cfce2b9058f9b986d0371e26e58bf9e0", "score": "0.8215534", "text": "def value\n YAML::load(self[:value])\n end", "title": "" } ]
[ { "docid": "7cb2d909b22c913ba51c2514629a100e", "score": "0.8079204", "text": "def value\n YAML::load(self[:value])\n end", "title": "" }, { "docid": "7cb2d909b22c913ba51c2514629a100e", "score": "0.8079204", "text": "def value\n YAML::load(self[:value])\n end", "ti...
b913750123684ba163dce0b4e5d9b636
MultiConnection initializer taking list of urls which to connect to
[ { "docid": "e804e8aa9a22517ba6b577ad681edb41", "score": "0.73460776", "text": "def initialize(*urls)\n @connections = []\n\n urls.each { |url|\n @connections << Connection.new(url)\n }\n\n connections.each { |c| c.parent = self }\n\n yield self if block_given?...
[ { "docid": "b9ec47c50a852dd49b82a29ac2947ea4", "score": "0.7194854", "text": "def multi_connect( collection_names, options = {} )\n MultiCollection.new @server, collection_names, options\n end", "title": "" }, { "docid": "a97c59149b514b1d68cdf3e8a4aa3de0", "score": "0.69455945", ...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "3d45375bfb307b898108909c12a8314f", "score": "0.0", "text": "def articulo_image_params\n params.require(:articulo_image).permit(:articulo_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title"...
be29630feff4a59c519fdc3ffe7c7356
Get a value by its key
[ { "docid": "7a63ee0a9d1ba0c18a1944401b987233", "score": "0.0", "text": "def get key\n @key = key\n url = [\"/v1/kv/#{@key}\"]\n url += check_acl_token unless check_acl_token.nil?\n @raw = @conn.get concat_url url\n parse_body\n return_value\n end", "title": "" } ]
[ { "docid": "6e0764fd23cdcf8d6b190ff54cae7a57", "score": "0.8256093", "text": "def getValue(key)\n return @values[key]\n end", "title": "" }, { "docid": "a9068e3f0aaa5cdb7768a3e88142bf4d", "score": "0.8214636", "text": "def get(key)\n find_by_keys([key]).first\n end", ...
bfb504624205e3831c5e7a0e190f8c94
Test cases from Leetcode
[ { "docid": "dc9d29d2b889f3160bd8d5c87879ca4a", "score": "0.0", "text": "def test_one_leetcode\n str = 'leetcode'\n dictionary = [\"leet\",\"code\"]\n assert Validator.evaluate(str, dictionary)\n end", "title": "" } ]
[ { "docid": "3fc2b24227cbb5f7478364c1e6487863", "score": "0.65391403", "text": "def run_tests\n check_solution(1, [6, 29, 18, 2, 72, 19, 18, 10, 37], 18, 2)\n check_solution(2, [6, 29, 18, 2, 72, 19, 18, 10, 37], 9, -1)\nend", "title": "" }, { "docid": "2c7792113f3e6a7b897090f47ee25903", ...
127abadfa9d3f0de389d31a9d06def36
DELETE /images/1 DELETE /images/1.json
[ { "docid": "369990fef61faab4232ed55847eaa44f", "score": "0.0", "text": "def destroy\n\t\tif logged? \n\t\t@image = Image.find(params[:id])\n\t\tnews_id = @image.news_id\n\t\t@image.destroy\n\n\t\trespond_to do |format|\n\t\t format.html { redirect_to edit_news_path(news_id) }\n\t\t format.json { head...
[ { "docid": "d1bf143e8d2595438228d99d62b31e6d", "score": "0.8074402", "text": "def delete\n render json: Image.delete(params[\"id\"])\n end", "title": "" }, { "docid": "8e911b1a5d8964b2e3d3b8ce2c8449be", "score": "0.80066633", "text": "def destroy\n json_respond compute().delet...
6c398e3480cf74322733fcc4b5319a04
Test 4: Empty group, populated title, populated date, populated time, populated location, populated description
[ { "docid": "130c54c3c3173a195267c5454927336f", "score": "0.0", "text": "def test04_EmptyGPopTDTiLDe\n\t\t\tloginPost\n\t\t\t$browser.goto($patch_event)\n\t\t\tsleep 2\n\t\t\tif $post_event_title.exists?\n \t\t\t\t$post_event_title.set(\"Event #{random}\")\n \t\t\t\t$post_event_calendar_start_text.set(\"...
[ { "docid": "b0bfcdf3005716fabf28dfad49c09e64", "score": "0.605335", "text": "def setup\n g = Group.new :name => 'validname', :camper_id => 1, :startdate => Date.today, :enddate => Date.tomorrow\n g.save\n end", "title": "" }, { "docid": "1beda5996812bce27a87f3495a09bc24", "score":...
c4620d9228cdbc40d7198b59e1c14817
This is necessary since Rails 3.0.4 See and
[ { "docid": "c4c02e1a52189c2a1ac0c0cc1ff6eec4", "score": "0.0", "text": "def handle_unverified_request\n true\n end", "title": "" } ]
[ { "docid": "6ab77a9219ee157923bc58599ba6aa77", "score": "0.60187584", "text": "def in_use; end", "title": "" }, { "docid": "6ab77a9219ee157923bc58599ba6aa77", "score": "0.60187584", "text": "def in_use; end", "title": "" }, { "docid": "2290804b238fc95bfd6b38f87c6d2895", ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "f0b2080de7574e16ac512eb38f3eb23b", "score": "0.0", "text": "def set_dashboard\n @dashboard = Dashboard.find(params[:id])\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...
39e1373d828f56541b79201a6e65c6a2
add from master list
[ { "docid": "c8c5871a36d3244fb8b3f17204a7f271", "score": "0.0", "text": "def add_from_sub_category\n\t\tsub_category=SubCategory.find(params[:id])\n\t\tuser=User.find(params[:user_id])\n\t\titem_lists=sub_category.item_lists.find_by({content: sub_category.content, user_id: user.id})\n\n\t\trespond_to do ...
[ { "docid": "d6e641bfd5bae27e091c86fd2166464c", "score": "0.7055394", "text": "def add_to_list(list)\n\n end", "title": "" }, { "docid": "d6e641bfd5bae27e091c86fd2166464c", "score": "0.7055394", "text": "def add_to_list(list)\n\n end", "title": "" }, { "docid": "d6e641bf...
dda2b63d4622a8af2cf8eb64ca8256bf
Creates custom image tag based on path, instead of default /images dir Takes optional has_thumbnail boolean flag
[ { "docid": "8601f0c18633d2a1153f07889db8cbd8", "score": "0.0", "text": "def photo_image_tag(photo)\n image_tag(photo.url, :class => \"photo\", :alt => photo.title, \n :size => photo.image_size)\n end", "title": "" } ]
[ { "docid": "5d4484665f372ec84bf8678c19c381bf", "score": "0.6707659", "text": "def image_tag(path, params={})\n params.symbolize_keys!\n\n # We won't return an image at all if a :target or :feature parameter\n # was provided, unless we're building that target or feature.\n return if p...
e42875d995ead268b034912987b06be9
an AJAX wait to allow inprogress items to complete before continuing.
[ { "docid": "24d5679eeadbd7e3ee7d1ce12d48542f", "score": "0.6369606", "text": "def ajax_wait\n respond_to do |format|\n format.js do\n sleep 0.1\n head :ok, content_type: 'application/javascript'\n end\n end\n end", "title": "" } ]
[ { "docid": "f71e1163c5bd936d70b0ccbc016ea059", "score": "0.73928946", "text": "def wait_for_ajax_complete\n wait_for_page_load\n wait_for_ajax\n end", "title": "" }, { "docid": "7f0ac3bd29fc91c80659b33954a3390f", "score": "0.67728627", "text": "def wait_until_visible\n ...
a70aa14069c61d126db1bbd606d1cd29
FIXME optimize lookup algorithm
[ { "docid": "8732d644925c86d763dbac235a536129", "score": "0.0", "text": "def find_route(path, method)\n method = method.upcase\n routes.each do |route|\n next unless route.method == method\n if route.regex && route.regex.match?(path)\n return route\n elsif route.pa...
[ { "docid": "dd634988bef3cbda8a94486413375360", "score": "0.7702808", "text": "def lookup; end", "title": "" }, { "docid": "dd634988bef3cbda8a94486413375360", "score": "0.7702808", "text": "def lookup; end", "title": "" }, { "docid": "5930761249ad935482b7956d18120e62", ...
e3a1650fe24efc356ed6cfe9b8fe6315
test if the Joke class exist
[ { "docid": "6709b34ca111d8f6f98ef1ddf7724573", "score": "0.6147109", "text": "def test_it_exist\n assert_instance_of Joke, @joke\n end", "title": "" } ]
[ { "docid": "c5092523eec0d5b296e30b9988d8b193", "score": "0.74413824", "text": "def class_exists?(name)\n get_class(name) != nil\n end", "title": "" }, { "docid": "50a87b0e33b3c626e28670146c767a07", "score": "0.7336954", "text": "def class_exists?(name)\n rslt = true\n b...
f06ab58e7bcdf6112a3950d1b8175152
, :except => [:auto_complete_model_for_person_fullname]
[ { "docid": "d0fb9afea76bf83ecb55b55cea3834ec", "score": "0.7560637", "text": "def auto_complete_model_for_person_fullname\n @result = Person.non_student.find_all{|p| p.fullname.downcase.include?(params[:person][:fullname].downcase)}[0..10]\n render :partial => \"auto_complete\", :object => @result...
[ { "docid": "47f9bb5ae303e9b49e99431b3b74f668", "score": "0.67233044", "text": "def auto_complete_for_person_name\n \tname = params[:person][:name].downcase\n \tnames = name.strip.split(' ')\n \t\n find_options = {\n :order => \"last_name, first_name ASC\",\n\t :limit => 10 }\n\n\t\tif names....
a0da10abce88190720452b2f5a7c6707
DELETE /floor_monsters/1 DELETE /floor_monsters/1.json
[ { "docid": "3ffc89c9f798399fc168828b4bda8576", "score": "0.7652438", "text": "def destroy\n @floor_monster = FloorMonster.find(params[:id])\n @floor_monster.destroy\n\n respond_to do |format|\n format.html { redirect_to floor_monsters_url }\n format.json { head :no_content }\n end\...
[ { "docid": "0b24cbc6495df3923ea7679acbcd8deb", "score": "0.763499", "text": "def delete_floor_plan(args = {}) \n delete(\"/files.json/floorplan/images\", args)\nend", "title": "" }, { "docid": "6e9f26c9592b1307ef431b19bd9db894", "score": "0.74728954", "text": "def delete_monster(mons...
ec8add1ad89480d9b38a6807c4b07b37
0 [ SubstanceReferenceInformation::Target ]
[ { "docid": "5ba206e2a0198da07274499e923e0e0d", "score": "0.0", "text": "def resourceType\n 'SubstanceReferenceInformation'\n end", "title": "" } ]
[ { "docid": "a601ee8d152f361b3ccdade163b16aa2", "score": "0.74464893", "text": "def target\n get_or_make_reference(@data['target_type'], @data, 'target_id')\n end", "title": "" }, { "docid": "9e6e5eaa60ec46297557bab540d2d39f", "score": "0.72318083", "text": "def target()\n\t\t...
c51c02d27e2187e00ac6da341035a02f
Returns an image derived from the source. The source can be an IO object, datastream (anything that responds to :read) or a file path (String)
[ { "docid": "9c62749e016e51f437ef9ab1dce4f27f", "score": "0.67601705", "text": "def initialize(source, opts={})\n if source.is_a?(IO)\n image = MiniMagick::Image.read(source)\n elsif source.is_a?(ActiveFedora::Datastream)\n if Image.derivable?(source.mimeType)\n image = M...
[ { "docid": "0044891b1d46cf122aa5d5f5e69fcb4b", "score": "0.75219584", "text": "def image\n @image ||= MiniMagick::Image.open(source_path)\n end", "title": "" }, { "docid": "f1c5f63092c65476d687570ce6b184ca", "score": "0.7012022", "text": "def path_to_image(source, options...
28fb89ee04827bf5d03eb78c53fdd14b
Helper method to handle no route. Decorator method
[ { "docid": "da19f43330f610c1cee9750987864d71", "score": "0.0", "text": "def get_path_weight(graph, path_array)\n result = graph.get_path_weight(path_array)\n result.nil? ? \"NO SUCH ROUTE\" : result\nend", "title": "" } ]
[ { "docid": "e4146b71f133ac4a31e0efd8ffe5ca49", "score": "0.82599765", "text": "def no_routes\n end", "title": "" }, { "docid": "85512954dd5558017656285b3975fa93", "score": "0.7903784", "text": "def no_routes\n # no need to do anything here either.\n end", "title": "" ...
dd97e390ee47db430fa55b8e2a11aa19
add an element to the queue
[ { "docid": "fc040a709a1b78461aacdde10017fa64", "score": "0.6974339", "text": "def enqueue(item)\n @items[ @items.size ] = item\n # instead of:\n # @items.push item\n end", "title": "" } ]
[ { "docid": "6d4c17271abe3cfa31e81cb707d7d2ed", "score": "0.8761121", "text": "def add(element)\n self.queue << element\n prune! while full?\n end", "title": "" }, { "docid": "dfb6bebba529733002858583f67fbf25", "score": "0.86225826", "text": "def enqueue(element)\n @...
2b8a57a33be7738825642708d3902dab
render a form input based on analysis_parameter attributes
[ { "docid": "d9aab27168f74a2ad26a7c6d0bf2d146", "score": "0.7717223", "text": "def render_analysis_parameter_input(parameter, study)\n case parameter.input_type\n when :select\n options = parameter.options_by_association_method((parameter.study_scoped? || parameter.associated_model == 'Study')...
[ { "docid": "310ede20f621fbdd1f16da74af3a8609", "score": "0.69702303", "text": "def generate_attribute_input(attr_label)\r\n input_html = ''.html_safe\r\n\r\n # Get the attribute hash corresponding to the given attribute\r\n attr = @metadata.select{ |attr_hash| attr_hash[\"attribute\"].to_s.eql?...
58bce7ff9c0f7adc007b30927d017f2d
Unique code of courier.
[ { "docid": "a44372b3ba3546bdf9a209949e107a31", "score": "0.0", "text": "def slug=(value)\n @slug = value\n self.courier = value.upcase\n @slug\n end", "title": "" } ]
[ { "docid": "4ac471f9b34583fa5484291929bca12f", "score": "0.59165657", "text": "def f2c(t)\n\treturn (t - 32) * 5.fdiv(9)\nend", "title": "" }, { "docid": "8aef36ba3481d3b715d9cb6a4d57ad74", "score": "0.59037614", "text": "def cac2\n 0\n end", "title": "" }, { "docid":...
75b12bc3f46b03f13b379c963b60f050
returns the capacity of the auditorium for a particular showtime
[ { "docid": "f1eeacf819af68191778c44ac0981ec0", "score": "0.83080095", "text": "def movie_auditorium_capacity(movie, showtime)\n movie.showtimes.find(showtime.id).auditorium.capacity\n end", "title": "" } ]
[ { "docid": "eb3ac7b2e9b17ec427745606d6855b05", "score": "0.63001615", "text": "def capacity\n info[:capacity]\n end", "title": "" }, { "docid": "c5577287a086887a6ac9141a0e298b8c", "score": "0.62495613", "text": "def capacity\n\t\t\t\t\treturn self.send(\"capacity_#{self.capac...
da969767e81d90f441822fafb4567175
Translates a single variable
[ { "docid": "6b2ad0784f40aa7fd29bc2b71e1c20eb", "score": "0.67326474", "text": "def translate_variable(a, name, resource)\n code = format(T_VARIABLE, resource.load(a), name + '_' + a)\n @attribute_output << format(T_OUTPUT, name + '_' + a, name + '_' + a)\n code\n end", "title": "" ...
[ { "docid": "3e19b651252bd6596a5e5b4b37c4e3da", "score": "0.76225376", "text": "def var_translate text, locale\n is_var?(text) ? text : service.translate(text, locale)\n end", "title": "" }, { "docid": "60686cd9cbadc5b5cf7709486a9615f9", "score": "0.7405224", "text": "def tran...
86b6f8e5a9b4679b09fd2cd49795851c
PUT /invoices/1 PUT /invoices/1.json
[ { "docid": "e295c6523fc3c96bde354f8a6694c2b7", "score": "0.7000014", "text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, :notice => 'Invoice was successfully update...
[ { "docid": "9e6ab717a25574668ffce0ff81a79d5e", "score": "0.71472603", "text": "def update\n \n @invoice_item.update(@invoice_item)\n respond_with(@invoice)\n \n end", "title": "" }, { "docid": "a1298ad67be9b58357ac256c0dfa0e68", "score": "0.7076736", "text": "def update\...
b9d69290cae79c5c24b3d7f5927ead1a
unsafe access to content, for performance purpose only
[ { "docid": "0ef8f1d68dbd5a5a4b6f6b5f6eb042bf", "score": "0.7606958", "text": "def unsafe_content; self.unsafe_data.first; end", "title": "" } ]
[ { "docid": "0a15bd6e53dfab404d2abbe535e9eeb3", "score": "0.69357264", "text": "def get_content\n __getobj__()\n end", "title": "" }, { "docid": "f55229022cf6ab75fa06b1a8e3a65828", "score": "0.64248383", "text": "def unmethodicated\n return @contents\n end", "title": "...
51a08792ccd8b33f627e33ed1e7e1f92
Used to fix bot not streaming when only 1 item is in the queue
[ { "docid": "a4e87e23fbc48cf631470f7dcaf70d49", "score": "0.0", "text": "def addFile(msg)\n\t msg = msg.strip\n\t\tfile =\tFile.join(\"#{msg}.mp3\")\n\t\tadd = system( \"mpc add #{file}\" ) # Add sound to MPC queue\n\t\tif add\n\t\t\tsend(\"File Added\")\n\t\telse ...
[ { "docid": "20df39848d360016b3994588e6f12a79", "score": "0.6617979", "text": "def manage_playlist_feeding\n in_queue = @liq.send(SCHEDULER_CONFIG[:liq_queue].to_s).pending_length[0].to_i\n if @current_playlist.files.length > 0 and in_queue < 15\n (15 - in_queue).times do\n if @curren...
13b6b5cc70760faafb27d4deb6634128
gives you all the important fields as keyvalue pairs
[ { "docid": "74e66f96497d6e9c0bbf957604b4cdb1", "score": "0.0", "text": "def hash\n res={}\n [:success, :lat, :lng, :country_code, :city, :state, :zip, :street_address, :province,\n :district, :provider, :full_address, :is_us?, :ll, :precision, :district_fips, :state_fips,\n :block_...
[ { "docid": "df17998877d004de499ebb703f3a99c8", "score": "0.72487515", "text": "def key_fields; end", "title": "" }, { "docid": "df17998877d004de499ebb703f3a99c8", "score": "0.72487515", "text": "def key_fields; end", "title": "" }, { "docid": "5bb389daec26146fdd5ac3f82877...
afaaf91c2fb0f70cf15a3a1d5e9c056b
photo can be a Photo or a photo id tags is an array of tags
[ { "docid": "f113928971139b4d1eb7e393a1c3b3fa", "score": "0.7374297", "text": "def addTags(photo,tags)\n photo = photo.id if photo.class == Flickr::Photo\n tstr = tags.join(',')\n @flickr.call_method('flickr.photos.addTags',\n 'photo_id' => photo, 'tags' => tstr)\n end", ...
[ { "docid": "f8e294db7d8dbf35c121341a0d74db33", "score": "0.71699345", "text": "def update\n # creates tag objects for photos\n tag_array = tag_params['tags'].split(',').each do |x|\n x.strip!\n end\n tag_array.each do |x| \n if Tag.find_by(name: x)\n @tag = Tag.find_by(n...
f30734f6741f6752ae983045fa5908e0
Use the easy access method to start stop an interval
[ { "docid": "7c9416c162b55c302c0fdf53ea0b8a8b", "score": "0.0", "text": "def hitimes_duration_i2\n Hitimes::Interval.now.stop\nend", "title": "" } ]
[ { "docid": "d2ea89a60ab78ae94b0b3f231c4e53ba", "score": "0.7576157", "text": "def stop_periodic_timers; end", "title": "" }, { "docid": "4de4abd5b0f8613758ea810f21ce3a77", "score": "0.72866136", "text": "def stop!; end", "title": "" }, { "docid": "6738d1f1e78801e1a8abd8af...
845ea3fe3ffc6bd0f58fddb034fd9af7
DELETE /administration/user_roles/1 DELETE /administration/user_roles/1.xml
[ { "docid": "37f286eb3c0d51d9ae60cc400575b61f", "score": "0.71333754", "text": "def destroy\n @administration_user_role = Administration::UserRole.find(params[:id])\n @administration_user_role.destroy\n\n respond_to do |format|\n format.html { redirect_to(administration_user_roles_url) }\n ...
[ { "docid": "62fbaa6562932fe78c0815964cb33ed7", "score": "0.712675", "text": "def delete_roles\n delete(roles_path)\n end", "title": "" }, { "docid": "2d39e6d80731e3795ace1359a536800d", "score": "0.6985187", "text": "def destroy\n @roles_user = RolesUser.find(params...
1b11cd47f85c77b11b8b949cbea05f4d
GET /classrooms/1 GET /classrooms/1.json
[ { "docid": "843515aae2843e831b81906dc6818dd1", "score": "0.0", "text": "def show\n @students = @classroom.show_students_with_rank\n end", "title": "" } ]
[ { "docid": "d3195b636f2740240090088375c9449e", "score": "0.7851191", "text": "def show\n @classroom = classroom.find(params[:id])\n\n render json: @classroom\n end", "title": "" }, { "docid": "5ac132de11edca60672c30b57eb8094d", "score": "0.7756427", "text": "def index\n @cl...
634638e17a731f7b11591a7630fcb5ee
Returns percentage of owner GPUs that are available
[ { "docid": "878eab2a60fecdd05fdf6f9ce1c9c650", "score": "0.746023", "text": "def owner_gpus_available_percent\n owner_gpus > 0 ? ((owner_gpus_used).to_f / owner_gpus.to_f) * 100 : 0\n end", "title": "" } ]
[ { "docid": "8d80ec97abae35bbbc99f78364ff7660", "score": "0.8366089", "text": "def owner_gpu_nodes_available_percent\n owner_gpu_nodes > 0 ? ((owner_gpu_nodes - owner_gpu_nodes_free).to_f / owner_gpu_nodes.to_f) * 100 : 0\n end", "title": "" }, { "docid": "48bcbfbd49fc3a0fb71e2dad298000d1...
413f18cea63f763f07c01f6f764a45a7
obtiene las reservaciones de un numero de reservacion
[ { "docid": "b4f69e349ddaea0fe85b171dc9813605", "score": "0.59449565", "text": "def show\n @reservations = Reservation.where(number: params[:id])\n #si el numero de reservacion no contiene reservaciones lo redirige al seat chooser\n if @reservations.count == 0\n redirect_to edit_seat_path\n...
[ { "docid": "bfc75f5b9977085edc97fce0ced51c08", "score": "0.6781461", "text": "def reservations\n end", "title": "" }, { "docid": "4056710d1f737fdbfb3a3bde32ed880e", "score": "0.66004294", "text": "def reservations\n @reservations ||= []\n end", "title": "" }, { "...
7de01ca6802bc849b343f67dba53a8ca
GET /water_histories GET /water_histories.json
[ { "docid": "3c164a37b5adbd505d26a7a9356d3b93", "score": "0.75422084", "text": "def index\n @water_histories = WaterHistory.all\n end", "title": "" } ]
[ { "docid": "839c59063da1e77c7f9a270810306029", "score": "0.6616882", "text": "def index\n @reading_histories = current_user.reading_histories.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reading_histories }\n end\n end", "title": "" ...
fc0470e8971ab0f33cc311773445ec7b
Convert Markdown > :yaml_tablerize
[ { "docid": "a3bce2b05e632d3d2b1d7829960ef250", "score": "0.7138906", "text": "def parse_yaml_tablerize\n @src.pos += @src.matched_size\n @tree.children << Element.new(:yaml_tablerize, @src[1])\n end", "title": "" } ]
[ { "docid": "95fe5ff47abd29e38ab9938f1d05cb37", "score": "0.65622944", "text": "def to_yaml_style\n end", "title": "" }, { "docid": "95fe5ff47abd29e38ab9938f1d05cb37", "score": "0.65622944", "text": "def to_yaml_style\n end", "title": "" }, { "docid": "95fe5ff47abd29e38a...
cc6399706e08ca7fd875d5a7364c6015
DELETE /dj_schedules/1 DELETE /dj_schedules/1.json
[ { "docid": "e30dab6b6c1c396390a2720a16db2075", "score": "0.79091007", "text": "def destroy\n @dj_schedule.destroy\n respond_to do |format|\n format.html { redirect_to dj_schedules_url, notice: 'Dj schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"...
[ { "docid": "2f4cd7e16467f6091ded386ad6483a1f", "score": "0.780522", "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": "2f4cd7e16467f6091d...
b724ca343c6b7c4c4a8206661d6dab70
GET /posts GET /posts.json
[ { "docid": "670aa903008a6701010bbbcdcbc45ed5", "score": "0.0", "text": "def index\n redirect_to '/admin/posts'\n end", "title": "" } ]
[ { "docid": "915c0178f9e4347098d8a463c2cbe6b0", "score": "0.78664786", "text": "def show\n @posts = Post.find(params[:id])\n render json: @posts\n end", "title": "" }, { "docid": "9e4bfaa87507d05255fbaeadc1ecb1d6", "score": "0.7496321", "text": "def index\n @posts = Post.all...
b329f031c00fd159ba9b396279f23d3f
:category: Queries Return whether the date falls on the last day of a halfyear.
[ { "docid": "01b6a9c51fb14508c93746825b57717c", "score": "0.0", "text": "def end_of_half?\n end_of_half == self\n end", "title": "" } ]
[ { "docid": "ebd141528aedb9d7bf001e82732ee663", "score": "0.781005", "text": "def is_always_last_day_of_year?; end", "title": "" }, { "docid": "6684e07e5679cecc62e82f965eae8a3c", "score": "0.7330447", "text": "def historic?() @year_end ? true : false; end", "title": "" }, { ...
1d6148015379d45a61c980dc3b58a1fd
Search Searches for the entities as specified by the given query.
[ { "docid": "6755de6a86c0499ca774890492168f9d", "score": "0.0", "text": "def transaction_service_search_with_http_info(space_id, query, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: TransactionService.transaction_service_search ...\"\n end\...
[ { "docid": "831a10cd3910ee517a041a0e232bcdc5", "score": "0.77783585", "text": "def search(query)\n @search_svc.search query\n end", "title": "" }, { "docid": "a4e37947ffddb76d5abfbff1833f172a", "score": "0.7425246", "text": "def search(query); end", "title": "" }, { ...
d400c8209a9996621f91f55fbbf67426
Delete a domain for the user. Requires that domain be empty unless 'force' parameter is set. URL: /domain/:name Action: DELETE
[ { "docid": "59c5a31a30131571f690de24a2e2f521", "score": "0.78860795", "text": "def destroy\n name = params[:name] || params[:id]\n name = name.downcase if name.presence\n get_domain(name)\n force = get_bool(params[:force])\n\n authorize! :destroy, @domain\n\n if force\n while (app...
[ { "docid": "a6a97bee91d59060bbf22c897f2aa16c", "score": "0.7663802", "text": "def delete_domain( name )\n response = invoke(\"aut:deletedomain\") do |message|\n build_auth!( message )\n message.add('domainNameOrId', name)\n end\n\n true\n end", "title": "" }, { ...
96efea75c0a1ce4d62a0d83c328a1d3e
Gets the operating system
[ { "docid": "4b36ec661802c1d319a8e29007d1e783", "score": "0.72384113", "text": "def os\n app = app_with_comments\n return app.comment[0] if app && app.comment[0]\n\n app = detect_product(DARWIN)\n [IOS, OperatingSystems::Darwin::IOS[app.version.to_s]].compact.join(' ') if app\...
[ { "docid": "85a14f9940c9b8e033494c0979f57851", "score": "0.8720404", "text": "def os\n return `uname -s`.chomp\n end", "title": "" }, { "docid": "5ad4d0c262c633d2a302358f523d38e3", "score": "0.82192767", "text": "def get_os_name\n\t\t\t\treturn SystemDetector.get_os_name\...
fda254a9d5e79d3f49a51a9821bf9b48
Ask if players want to play a new match
[ { "docid": "fe9307cc6e3af2b18529622432bd2c7e", "score": "0.59925264", "text": "def ask_new_game\n print \"Would you like to start a new game?: [y/n]\".blue\n new_game = $stdin.gets.chomp\n\n if new_game.downcase == \"y\"\n print \"\\e[H\\e[2J\"\n :new_game\n else\n ...
[ { "docid": "12959c07f84c12abd8d529494f7b16e4", "score": "0.7210158", "text": "def play_match\r\n reset_scores\r\n\r\n loop do\r\n display_scores\r\n choose_turn_order\r\n play_round\r\n break if someone_won_match?\r\n end\r\n\r\n display_match_result\r\n end", "title...
c8b8b73a8d3fb063c98fc1912f612daa
This displays a column. This method doesn't get used.
[ { "docid": "98f9675ac5017770603f28cc363bc4b7", "score": "0.7242164", "text": "def display_column(column)\n puts %w( B I N G O )[column]\n @bingo_board.each do |row|\n puts row[column]\n end\n end", "title": "" } ]
[ { "docid": "c19dd9a58cee26584ea9fe09d83ce264", "score": "0.7336625", "text": "def column(*args, &block)\n @_viewaide_column_count ||= application_width\n col(*args, &block)\n end", "title": "" }, { "docid": "c9524e492dcdcd1314b49cce9baa93ba", "score": "0.73244196", ...
bf90346f0148424d9e342d119c3abe1c
Overrides the Blacklight::Controller provided search_action_url. By default, any search action from a Blacklight::Catalog controller should use the current controller when constructing the route.
[ { "docid": "f1e8dcd637137141bc2c64c7e1b50624", "score": "0.7140327", "text": "def search_action_url(options = nil)\n opt = (options || {}).merge(action: 'index')\n lens = opt.delete(:lens) || current_lens_key\n canonical = opt.delete(:canonical)\n canonical &&= Blacklight::Lens.canonical_for...
[ { "docid": "8b2b60fa29c14ec51213c3cdbf39fdd5", "score": "0.76088315", "text": "def search_action_url\n url_for(controller: '/catalog', action: 'index', only_path: true)\n end", "title": "" }, { "docid": "e155adea9a6704828fa097502fa366d5", "score": "0.75605565", "text": "def searc...
adbcc8b34bf1f8a4ea392ad0020730b3
Reports Chef's +run_status+ exception and backtrace to Splunk Storm.
[ { "docid": "6032aee85b9fb8dda65874831d97d005", "score": "0.695212", "text": "def report_exception\n event_metadata = {\n :sourcetype => 'storm_multi_line',\n :host => node.hostname,\n :project => @project_id}\n\n api_params = event_metadata.collect{ |k,v| [k, v]....
[ { "docid": "d7fc78e5f7d18ecb842683ae08694b69", "score": "0.71594554", "text": "def run_failed(exception, run_status); end", "title": "" }, { "docid": "57ea5fd0496e8a5856e4ca16aedfb83a", "score": "0.67804164", "text": "def run_failed(exception)\n elapsed = Time.now - @start_tim...
6623f607bd7e436265e1919894a54230
has_one referencia os registros associados a esta chave ex: has_to :post
[ { "docid": "ba4e37fc051d39475d5cdf44b6112325", "score": "0.0", "text": "def full_name\n \"#{first_name}, #{last_name}\"\n end", "title": "" } ]
[ { "docid": "ac6b9e25a09becf94698390bdfabe7ba", "score": "0.67826384", "text": "def has_one(name, options = {}, &block)\n characterize(name, Referenced::One, options, &block).tap do |meta|\n relate(name, meta)\n reference(meta)\n builder(name, meta).creator(name,...
f7139f642d0d7b53e24fc858f0406c69
POST /provincials POST /provincials.json
[ { "docid": "f19ca2f90e0d836b6cffebc2a7405ae8", "score": "0.6786266", "text": "def create\n @provincial = Provincial.new(provincial_params)\n\n # respond_to do |format|\n if @provincial.save\n redirect_to admin_provincials_url\n # format.json { render :show, status: :created, loc...
[ { "docid": "b93c0789b0f5882a8fc0d589bfb59ca7", "score": "0.6590205", "text": "def provincial_params\n params.require(:provincial).permit(:name, :ordinate, :province_kind,\n districts_attributes: [:id, :name, :_destroy])\n end", "title": "" }, { "docid": "f5c97a90d4e5987858c0d6...
ee7c82ea6f1837f44923dbeb073adc97
The reason that we are operating directly on the scope here (rather than passing back some arel conditions to be added to the scope) is because scope.where([x, y]) has a different meaning to scope.where(x).where(y) the first version might perform some substitution if x is a string.
[ { "docid": "7dfc8e58b3091b171b6e9689019eea87", "score": "0.5536275", "text": "def add_conditions(scope)\n unless @reflection.through_reflection.klass.descends_from_active_record?\n scope = scope.where(@reflection.through_reflection.klass.send(:type_condition))\n end\n\n ...
[ { "docid": "4d8fef8b109514d7627325ecd95723d1", "score": "0.6845145", "text": "def where(args={})\n scope = spawn(\"AND\")\n scope.where!(args) if args\n end", "title": "" }, { "docid": "920328217e0d906a820f868a6098bb1f", "score": "0.67340857", "text": "def where(*where)\...
2e9d97841013510240a495571fded1ec
after siugn up path
[ { "docid": "c18de2c217f1b37ca8d4e16ab893932a", "score": "0.0", "text": "def after_sign_up_path_for(resource)\n \t#for sending sign \n UserMailer.welcome_user(resource).deliver\n super\n end", "title": "" } ]
[ { "docid": "0091b5110abfb206d1e13dcc273bed25", "score": "0.6926151", "text": "def path=(new_path); end", "title": "" }, { "docid": "0091b5110abfb206d1e13dcc273bed25", "score": "0.6926151", "text": "def path=(new_path); end", "title": "" }, { "docid": "b203dc4bcffdad227ba4...
fe56b160a87b06bd0a6b874d8a518ede
When reduced to universal measures are two measures the same type and value?
[ { "docid": "831a1c786fcc93ee341517b2584e943f", "score": "0.56310844", "text": "def ==(other)\n case other\n when Measure\n a = self.universal\n b = other.universal\n return false unless a.count == b.count\n return false unless a.units.sort == b.units.sort\n ...
[ { "docid": "9bd73ac13fcf1a39676aed79866c1ee6", "score": "0.6547953", "text": "def universal\n Measure.new(value, units.map{ |u| u.universal })\n end", "title": "" }, { "docid": "0d8ef07628fbc8e00fe2264a69c06135", "score": "0.58754885", "text": "def mm?; measurement == :metric...
eb651b85e9c43e67566aa14799f544f2
Returns an enumerator for the ruleset: 'number of grains of wheat on a chessboard given that the number on each square doubles.'
[ { "docid": "bf2f99c758cc725b7ab22434c4a53271", "score": "0.6338165", "text": "def grains\n grains = Enumerator.new do |y|\n result = 1\n loop do\n y << result\n result *= 2\n end\n end\n end", "title": "" } ]
[ { "docid": "078dd91382daf5f00859c424676f12a8", "score": "0.6465652", "text": "def count_rule_possibilities\n\t\t@state_count ** (@state_count ** Neighbours)\n\tend", "title": "" }, { "docid": "95af3fc09703bbc4ba0a25b8e745e1e4", "score": "0.6301397", "text": "def grains\n sum = 0\n ...
9a6549bd4d9d891cb72b714d4bfcf394
Set the value of the ResponseFormat input for this Choreo.
[ { "docid": "d2924c65a8ac0e53548242b0da6d7f41", "score": "0.0", "text": "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "title": "" } ]
[ { "docid": "77cc15d6d890482d623539da5f52a542", "score": "0.8193936", "text": "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "title": "" }, { "docid": "77cc15d6d890482d623539da5f52a542", "score": "0.8193936", "text": "def set_ResponseFormat(v...
73e381e3cb7dffc116fd3af27109e8a1
Get comment from file searching down from given line number.
[ { "docid": "1ff4bed624de4a93dbbf2cf75fd50f88", "score": "0.7563352", "text": "def get_following_comment(file, line)\n get_following_comment_lines(file, line).join(\"\\n\").strip\n end", "title": "" } ]
[ { "docid": "09b16de96da1a67a79622b2bc7dcc8a9", "score": "0.784899", "text": "def comment_describing(file, line_number)\n lines = file.is_a?(Array) ? file : file.each_line.to_a\n\n extract_last_comment(lines[0..(line_number - 2)])\n end", "title": "" }, { "docid": "d74662cfe7eb44...
8097edf3c381968c9466ab2f439934db
NicSettings much match the number of network adapters being passed in the config spec
[ { "docid": "8c03f0a3620a6a23263915e034051b17", "score": "0.7305505", "text": "def adjust_nicSettingMap(spec)\n return if spec.blank?\n\n requested_network_adapter_count = options[:requested_network_adapter_count].to_i\n nic_count = Array.wrap(spec.nicSettingMap).length\n\n if requested_netwo...
[ { "docid": "39162ff428be2cb7c86adbbea3fefa8b", "score": "0.6403681", "text": "def calculate_add_nic_spec(nic, unumber = nil)\n mac = nic['MAC']\n pg_name = nic['BRIDGE']\n default =\n VCenterDriver::VIHelper\n .get_default(\n ...
7b9b7ff5e1ed3e43ef73b6dc1bcc7176
once the filling done on selecting queue for sending the kit it will check the open order for that kit
[ { "docid": "00f2d673c998c2491dfcae132e389371", "score": "0.62997305", "text": "def find_open_order\n @kit_filling = Kitting::KitFilling.find_by_id(params[:kit_filling_id]) # true or false\n @status = @kit_filling.rbo_status == \"Revoked\" rescue false\n if @kit_filling.present? and @statu...
[ { "docid": "b1b0dde162e593376c1fcb2b61207d73", "score": "0.64385235", "text": "def wait_for_queue_completion timeout=nil\n # Queued: //action//caller-id, History: //entry//policy-id\n logger.info \"Waiting for queue completion\"\n start_wait_time = Time.now.to_i\n max_polls =...
6881dd2024fcece3e601f73726250331
PUT /finales/1 PUT /finales/1.xml
[ { "docid": "cb2eed780bd34f47845053c3c730eaac", "score": "0.0", "text": "def update\n @final = Final.find(params[:id])\n\n respond_to do |format|\n if @final.update_attributes(params[:final])\n format.html { redirect_to(@final, :notice => 'Final was successfully updated.') }\n fo...
[ { "docid": "c82cce87718d916e1aa52d59378dd881", "score": "0.6079724", "text": "def update\n @faxis = Fax.find(params[:id])\n\n respond_to do |format|\n if @faxis.update_attributes(params[:faxis])\n format.html { redirect_to @faxis, notice: 'Fax was successfully updated.' }\n form...
c1a04f964075ebe9437155c7bcf49711
POST /training_days POST /training_days.json
[ { "docid": "afd61c1c8490ef25d12b031299a4e846", "score": "0.64225197", "text": "def create\n @training_day = TrainingDay.new(params[:training_day])\n # This code creates new periods for each trade depending on the Day. Need to move to own method in Tsession.\n # @trade = Trade.all\n # @period...
[ { "docid": "2fc27d2900fb390b75e7b744f4bc4567", "score": "0.7180423", "text": "def create\n @training_day = TrainingDay.new(training_day_params)\n\n respond_to do |format|\n if @training_day.save\n format.html { redirect_to @training_day, notice: 'Training day was successfully created.'...
6b15b004843b08ce8e865209346b9002
All 3 subway lines intersect at Union Square, but there are no other intersection points. (For example, this means the 28th stop on the N line is different than the 28th street stop on the 6 line, so you'll have to differentiate this when you name your stops in the arrays.) Tell the user the number of stops AND the sto...
[ { "docid": "a35ebb90cd4344d19ce59b367cc99bbf", "score": "0.57556266", "text": "def plan_trip(start, stop)\n start_l = find_line(start)\n stop_l = find_line(stop)\n if line1 == line2\n puts \"You travel along these stops: \"\n p travel(line1[:stops], find_index(line1, start), find_index(line1, s...
[ { "docid": "c22fae85320a149ae3207fd743688f9e", "score": "0.6834934", "text": "def backwards_start_multi(start_line, end_line, start_stop, end_stop)\n # other direction - 1st line\n reverse_journey_5 = LINES[start_line].map { |l| \"#{l}\"}.reverse!\n start_position_5 = reverse_journey_5.index(s...
c19669e6fe3d8ff9e0ac3e0b24b03f96
Asserts that the given collection contains item x. If x is a regular expression, ensure that at least one element from the collection matches x. assert_contains(['a', '1'], /\d/) => passes assert_contains(['a', '1'], 'a') => passes assert_contains(['a', '1'], /not there/) => fails
[ { "docid": "32a239db67fe7561ac7048f73a656861", "score": "0.83993137", "text": "def assert_contains(collection, x)\n collection = [collection] unless collection.is_a?(Array)\n\n case x\n when Regexp\n collection.detect { |e| e =~ x }\n else\n collecti...
[ { "docid": "032e3279d07047d564099a38de131350", "score": "0.83326733", "text": "def assert_contains(collection, x, extra_msg = \"\")\n collection = [collection] unless collection.is_a?(Array)\n msg = \"#{x.inspect} not found in #{collection.to_a.inspect} #{extra_msg}\"\n case x\n when Regexp\...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "82dbbf7c4f97a871ba6adefc05826dec", "score": "0.0", "text": "def backstory_params\n params.require(:backstory).permit(:content, :champion)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title"...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "a58b4e837156001ab6ddd43b560d98bc", "score": "0.0", "text": "def reserva_params\n params.require(:reserva).permit(:estado)\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...
ccf4a032d23eed31ba30a1e581a2e1db
PUT /stations_translations/1 PUT /stations_translations/1.xml
[ { "docid": "256baff0f8e37044e6e4daa6eeb6ad38", "score": "0.6746586", "text": "def update\n @stations_translation = StationsTranslation.find(params[:id])\n\n respond_to do |format|\n if @stations_translation.update_attributes(params[:stations_translation])\n format.html { redirect_to([:...
[ { "docid": "8ebe70432444bcec990ecde71635d2de", "score": "0.609207", "text": "def create\n @stations_translation = StationsTranslation.new(params[:stations_translation])\n\n respond_to do |format|\n if @stations_translation.save\n format.html { redirect_to([:admin,@stations_translation]...
f041f9517012d0b9a0f528210f4f4210
DELETE /families/1 DELETE /families/1.json
[ { "docid": "2dff8d4711081d97f3f46137ffdeedc2", "score": "0.71099216", "text": "def destroy\n @family.destroy\n respond_to do |format|\n format.html { redirect_to families_url, notice: 'Family was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title":...
[ { "docid": "5f5c29d4beb03b6ec702d45201bb4323", "score": "0.7311203", "text": "def destroy\n @family.destroy\n respond_to do |format|\n format.html { redirect_to families_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d29f55c10a4716027900...
8ca8f02f02730d708c4822d3e6ab6b00
DELETE /cargo/1 DELETE /cargo/1.json
[ { "docid": "9ae0f4be539780bd13be2d1fe31894fd", "score": "0.6587578", "text": "def destroy\n @cargo.destroy\n respond_to do |format|\n format.html { redirect_to cargo_index_url, notice: 'Cargo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title":...
[ { "docid": "b445c184893647d3482f8fbc6a507a52", "score": "0.7064746", "text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end", "title": "" }, { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.706422...
0ac23ba83490ae69b0f224a1641869ea
predict what kind of grades a person will get. He says if you own less than 10 books, you will get a "D". If you own 10 to 20 books, you will get a "C", and if you own more than 20 books, you will get a "B". He further hypothesizes that if you actually read your books, then you will get a full letter grade higher in ev...
[ { "docid": "e3d803049f00cedd5380f92012ab2ba4", "score": "0.0", "text": "def grade(n, reads_books)\n mark = \"C\" if n < 10\n mark = \"B\" if n > 9 && n < 21\n mark = \"A\" if n > 20\n reads_books ? mark : mark.next\nend", "title": "" } ]
[ { "docid": "ab4dc850b420b1d11dc8738397e25ccc", "score": "0.7792598", "text": "def grade(num_books, reads_books)\n\tif reads_books == true\n\t\tif num_books < 10 then \n\t\t\t\"C\"\n\t\telsif num_books <= 20 then\n\t\t\t\"B\"\n\t\telse\n\t\t\t\"A\"\n\t\tend\n\telse \t\t\n\t\tif num_books < 10 then\n\t\t\...
e83004176409490f0e28886784fe3947
Returns a Range representing the valid proxy port values
[ { "docid": "40090889d7a5c03bd6c8d590181186da", "score": "0.7674188", "text": "def port_range\n uid_offset = @container.uid - @uid_begin\n proxy_port_begin = @port_begin + uid_offset * @ports_per_user\n\n proxy_port_range = (proxy_port_begin ... (proxy_port_begin + @ports...
[ { "docid": "81114d6fa94091cd294b35551fdc7212", "score": "0.7496339", "text": "def parse_port_range(port_range)\n # Three forms:\n # \"80\"\n # \"5000-5010\"\n # \"\" (all ports)\n m = /\\A(\\d+)(?:-(\\d+))?\\Z/.match(port_range)\n return 0..65_535 unless m\n\n start = Integer(m[1])\...
3b501cdfd4534f17235a9c54ba7314be
POST /stops or /stops.json
[ { "docid": "e6c47112214ec11c04b034b2efe10065", "score": "0.7087752", "text": "def create\n @stop = @tour.stops.build(stop_params)\n\n respond_to do |format|\n if @stop.save\n format.html { redirect_to tour_path(@tour), notice: \"Stop was successfully created.\" }\n format.json {...
[ { "docid": "f0b158f031d878ef143c083d5520f106", "score": "0.711768", "text": "def create\n @stop = Stop.new(params[:stop])\n\n if @stop.save\n render json: @stop, status: :created, location: @stop\n else\n render json: @stop.errors, status: :unprocessable_entity\n end\n end", "...
1622d8972833c1ba4116fc4db6b4b023
set a constructor method for name and locstion
[ { "docid": "55e635a1a51f1e26a7de52b7bbbf20cb", "score": "0.0", "text": "def initialize(name, location)\n @name = name\n @location = location\n @@all << self\n end", "title": "" } ]
[ { "docid": "46d7c89546734252f13c21a6cfe663b5", "score": "0.7220205", "text": "def initialize(method_we_pass)\n @name = method_we_pass\n end", "title": "" }, { "docid": "8fcf2072dd8dec7b03140874e2fb6d0f", "score": "0.7089991", "text": "def define_constructor(name)\n ...
ffc6f00cf38b0bd782a891471708702c
GET /jobs GET /jobs.json
[ { "docid": "ebb8a8614925e07473e399e94fcc5641", "score": "0.0", "text": "def index\n @jobs = Job.published.desc\n end", "title": "" } ]
[ { "docid": "3bc2606635c5a859f5986f0894dbceca", "score": "0.7848542", "text": "def index\n @jobs = Job.all\n\n render json: @jobs\n end", "title": "" }, { "docid": "d092386d022b402070534f1fa34090cf", "score": "0.78388816", "text": "def index\n @jobs = Job.all\n render jso...
92ac30414ae358af76414049258227a6
This method generates the set of fieldconfig definitions from the table metadata to pass to the 'build_form' method of the application helper which will generate the actual HTML form. The fields that will be build have two 'sources': 1) The native fields on the table self i.e all non foreign key fields 2) The composite...
[ { "docid": "816143d303635006ad25e72c84fecb3f", "score": "0.7033889", "text": "def gen_field_configs_code\n begin\n lookups = Hash.new\n lines = Array.new\n lines.push \"\\t field_configs = []\"\n field_index = 0\n \n @model_settings.table_columns.each do |column|\n next if ['cr...
[ { "docid": "ad3e03c543bf156883df1fb4f35df586", "score": "0.6561519", "text": "def default_fields_for_forms\n selected_columns = final_columns.select do |c|\n data_adapter.attribute_names.include?(c[:name]) ||\n data_class.instance_methods.include?(\"#{c[:name]}=\") ||\n ...
c8836abf3e6bf8e2da5605100867b457
Inserts the department identifier into the activity hash in the form "_" using the following rules: For activities with a department_id defined in the Activity record, we use that department For ActivityCourse records, a separate "reporting department" can be specified, in which case we populate a :reporting_department...
[ { "docid": "581b3e0a3a01bd3b1c5185b561c55215", "score": "0.55933166", "text": "def inject_departments(force = false)\n load_results(:with_averages_added, force) if force || @results.empty?\n @log_step = :with_departments\n @overwrite_log = true\n puts \"Injecting department identifiers into ...
[ { "docid": "4c7c399efe72381a19f0902c93a8b7d7", "score": "0.6119596", "text": "def department\n ::HubEdos::Common::Reference::Descriptor.new(@data['department']) if @data['department']\n end", "title": "" }, { "docid": "8b4d1684d62849c26cd18d3c5de6ca0d", "score": "0.59...
c10e7c0f2e490d4b5d9e3cb1ddc28745
download avatar for each vertex in graph g and save avatar to avatar_dir
[ { "docid": "bd282a71933f5d4a4567b16c62238ef2", "score": "0.853482", "text": "def download_avatars(g, avatar_dir)\n LOGGER.info \"Downloading friends' avatars to #{avatar_dir} directory.\"\n FileUtils.mkdir(avatar_dir) unless File.exist?(avatar_dir)\n for friend in g.vertices\n # avatar is saved to...
[ { "docid": "2e6401870358d95314ab4385adcdfa25", "score": "0.6065286", "text": "def get_images(node_set)\n node_set.each do |node|\n src = node['src']\n puts \"fetching #{src}\"\n \n open(File.join(DATA_DIR, File.basename(src)), 'wb') do |file|\n file << open(src).read\n end\n \n ...
2dd9aed4e9ad427067d33e20f166bde6
Test 3: Edit Article draft
[ { "docid": "f1f04d4a79bb011b5dbc93be78a06074", "score": "0.7849804", "text": "def test03_pre_closed_news_edit_article_draft\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_pre_closed_article_new)\n\t\t\n\t\tcreate_article_draft \"Article for Draft #{random}\"\n\t\tsleep 2\t\n\t...
[ { "docid": "78e4804160d8f9e66fb5d96f29c8ed55", "score": "0.79672754", "text": "def test02_pre_closed_blog_edit_article_draft\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_blogs_pre_closed_article_new)\n\t\t\n\t\tcreate_article_draft \"Article for Draft #{random}\"\n\t\tsleep 2\n\t...
ef77b29accbef841404aa1156b6b08e6
Given an array of Git log lines, compute the number of days this was in development Note: you cannot assume any order of commits (e.g. you cannot assume that the newest commit is first).
[ { "docid": "c23ef61e3d1f0bd27f3366f010da253d", "score": "0.7506923", "text": "def days_of_development(lines)\n m=\"\"\n d=\"\"\n y=\"\"\n dates=Array.new\n i=0\n lines.each do |line|\n line=line.chomp.split(/ +/)\n if line[0].eql?(\"Date:\")\n m=line[2]\n d=line[3]\n y=line[-2...
[ { "docid": "281ebfd346a947b83ee1fa40b42c84e3", "score": "0.79382575", "text": "def days_of_development(lines)\n # start with dummy values of now. No way for a git log to have been\n # updated in the future\n start_date = Date.today\n # another dummy variable that will be out of range for the end dat...
5fe7b22fab562c90529e203de0ffa16a
sets the variables from the expression
[ { "docid": "51ae9fe6e2374ff7b419622e27254e4a", "score": "0.7334661", "text": "def set_variables\n self.variables=Variable.where(game: game).in(name: var_list(expression)).to_a\n end", "title": "" } ]
[ { "docid": "46c8584343d614da8a8807654f75313c", "score": "0.68771744", "text": "def expressions=(_arg0); end", "title": "" }, { "docid": "46c8584343d614da8a8807654f75313c", "score": "0.68771744", "text": "def expressions=(_arg0); end", "title": "" }, { "docid": "46c8584343...
4d8b2c195657d487c4e9c9f66e815efe
Returns chord's base value
[ { "docid": "1354ac22f1c3ae2395638c8280fd47c5", "score": "0.0", "text": "def chord_values(chords=self.chords)\n chords.each_with_index.collect{|chord, i| chord.value if chords[i-1] != chord.value}\n end", "title": "" } ]
[ { "docid": "c1309c4cf9b597d29015431a80645282", "score": "0.6416575", "text": "def base\n return @base\n end", "title": "" }, { "docid": "afc2b5762e4d05128bab392686ff6f6d", "score": "0.6356154", "text": "def aq_base\n (s + 1) + t.divide(2)\n end", "title": "" }, ...
2537d94d28f889f2277f0174828a18b8
main function of the animation sequence
[ { "docid": "b95a7864e3269573c1a0ff66f334c196", "score": "0.6179797", "text": "def pbMain\n # stops BGM and displays message\n pbBGMStop()\n pbMEPlay(\"EBDX/Evolution Start\")\n 16.times do\n Graphics.update\n self.update\n @sprites[\"bar1\"].y -= @sprites[\"bar1\"].bitmap.heig...
[ { "docid": "37085e55cede60afbf27f8acd97b1a4a", "score": "0.7774621", "text": "def animation\n end", "title": "" }, { "docid": "20b94bf604437512518a3b8ef17c8c87", "score": "0.7303653", "text": "def animating?; end", "title": "" }, { "docid": "22d1f721109ca5bf344fc777c792e...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "d0c7924e35ff357c64d50bf73f7c3dfd", "score": "0.0", "text": "def pledge_params\n params.\n require(:pledge).\n permit(:amount, :goal_id).\n merge(email: stripe_params[\"stripeEmail\"], card_token: stripe_params[\"stripeToken\"])\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.requ...
f94c4d119bd14d4a4b615c7ce6eca92e
Concatenates the list with another. list.experts => [] another_list.experts => [, ] list.concat(another_list) => list.experts => [, , ] Returns the list.
[ { "docid": "2f518789497e60961c4aa175fa413446", "score": "0.5847616", "text": "def concat(other)\n add_collection(other.list_items.map { |item| item.copy(note: nil) })\n self\n end", "title": "" } ]
[ { "docid": "d80d8a1d7aa36ec4bc189df0f1072e38", "score": "0.6470765", "text": "def another\n rv = []\n rv.concat(AnotherList1)\n rv.concat(AnotherList2)\n rv.concat(AnotherList3)\n rv.concat(AnotherList4)\n rv.concat(AnotherList5)\n return rv\n end", ...
153fdf92505a3fbfc8763404cf539bdb
tells the action played
[ { "docid": "a3ddb89d549511f9d88e69bda3f228c6", "score": "0.6125754", "text": "def update(who,action)\n @actions << Action.new(@game_id, @round, who, action)\n #debug @actions[-1]\r\n @players[who].last_action = action\r\n\t\tcase action[0]\r\n\t\t\twhen FOLD\r\n @players[who].f...
[ { "docid": "d629817126d2bfcbdbbf72ab51db92e7", "score": "0.7006894", "text": "def play_action\n @status.playback_state = :playing\n update_status\n end", "title": "" }, { "docid": "f7c37c2f87eb930e54f3519284f6d48a", "score": "0.7000173", "text": "def play\n @hungry = true\n...
86d2321a5a4ae9430bfe73c006a7e388
if the number is divisible by 3, print Fizz if the number is divisible by 5, print Buzz if both, print FizzBuzz otherwise print the number
[ { "docid": "dd40061394200848806f6f794759d48f", "score": "0.876453", "text": "def fizz_buzz(num)\n if (num % 3 == 0) && (num % 5 == 0)\n puts \"FizzBuzz\"\n elsif num % 3 == 0\n puts \"Fizz\"\n elsif num % 5 == 0\n puts \"Buzz\"\n else\n puts num\n end\nend", "title": "" } ]
[ { "docid": "b929828cb4eaca2c2dbebedd068e92bf", "score": "0.8890112", "text": "def fizz_buzz()\n (1..100).each do |i|\n #if i is divisible by 3 without a remainder and divisible by 5 without a remainder\n if i % 3 == 0 && i % 5 == 0\n print \"FizzBuzz\"\n #else if i is divisible by 3 wit...
098b616ae25680d0786e24616846118a
Document reporting entity (primary container for disclosure data)
[ { "docid": "456cac8a3c41e4092ed1e108576fd227", "score": "0.6190732", "text": "def reporting_entity\n self.data['reportingEntity']\n end", "title": "" } ]
[ { "docid": "0f6686c52fd28a733f3a6636dd5573cc", "score": "0.6632219", "text": "def document\n data.document\n end", "title": "" }, { "docid": "afb7d3649faf4359151b82d518ed1460", "score": "0.6455128", "text": "def document\n attributes.fetch(:document)\n end", ...
ee9dbe68836a10c6544eab168fed7955
Unregisters a key event so that it will no longer be processed
[ { "docid": "06300a1cc8878a02259e7fbd8b2b5617", "score": "0.7423459", "text": "def unregister_key_event( key_event )\n if @key_events.include? key_event\n @key_events.delete key_event\n return key_event\n else\n return nil\n end\n end", "title": "" } ]
[ { "docid": "749865fcb818f901b5bd25eae63bc056", "score": "0.803895", "text": "def key_released( event )\n @keys -= [event.key]\n end", "title": "" }, { "docid": "749865fcb818f901b5bd25eae63bc056", "score": "0.803895", "text": "def key_released( event )\n @keys -= [event.key]\n ...
2d3f2f6291224ca401594a24c4ec21ba
GET /projects GET /projects.json
[ { "docid": "5ab5e4af9f4596ff333d0a2c6178c298", "score": "0.0", "text": "def index\n @projects = Project.all\n end", "title": "" } ]
[ { "docid": "dc8505687156cb859adc07f1e0435407", "score": "0.8865709", "text": "def projects\n return get(\"/projects/list\")\n end", "title": "" }, { "docid": "e5cff083faf736771900db26645e7ffe", "score": "0.8730487", "text": "def get_projects\n self.class.get(\"/projects.json...
160acf75ac62bf082b951dfc514672ed
=begin rdoc Turns the provided parse tree into a question. =end
[ { "docid": "765a5ab17dec0a66371774fd153489e6", "score": "0.7469294", "text": "def to_question(parse_tree)\n np, vp = parse_tree.extract_tree(@matcher_tree).children.first.children\n if np.children.first.label == \"PRP\" and np.children.first.to_sentence != \"It\"\n question_word = \"Who\" \n ...
[ { "docid": "ef7ff685dca3aedea2d50d65157b676a", "score": "0.6620748", "text": "def to_question(parse_tree)\n tree = parse_tree.extract_tree(@matcher_tree)\n tree.children.first.children.first.to_sentence =~ /(\\d\\d\\d\\d)/\n date = $1\n tree.children.first.children.slice!(0, 2)\n \n se...
36b8d47a913f9e3aac527737aa9c348e
p6 def minilang(commands) register = 0 commands = commands.split(' ') stack = [] commands.each do |command| case command when command.to_i.to_s then register = command.to_i when 'PUSH' then stack << command.to_i when 'ADD' then register += stack.pop when 'SUB' then register = stack.pop when 'MULT' then register = stack...
[ { "docid": "fcceb35171496f90b60bace505ce10df", "score": "0.0", "text": "def word_to_digit(string)\r\n digits = {\r\n 'zero' => '0', 'one' => '1', 'two' => '2', 'three' => '3', 'four' => '4',\r\n 'five' => '5', 'six' => '6', 'seven' => '7', 'eight' => '8', 'nine' => '9'\r\n }\r\n digits.key...
[ { "docid": "ba33a96b25467f5c91982dc7d041882f", "score": "0.89324915", "text": "def minilang(commands)\n stack = []\n register = 0\n commands.split.each do |command|\n case command\n when 'PRINT'then puts register\n when 'PUSH' then stack.push(register)\n when 'POP' then register = stack....
96b4a9ea16d9e1dfa24f20b9ba283aee
PATCH/PUT /otu_page_layouts/1 PATCH/PUT /otu_page_layouts/1.json
[ { "docid": "b30e7837fd0815f0ebae76b771ee8d75", "score": "0.7201958", "text": "def update\n respond_to do |format|\n if @otu_page_layout.update(otu_page_layout_params)\n format.html { redirect_to @otu_page_layout, notice: 'Otu page layout was successfully updated.' }\n format.json {...
[ { "docid": "a298a079040c5a3595009676168de517", "score": "0.6706504", "text": "def update\n respond_to do |format|\n if @otu_page_layout_section.update(otu_page_layout_section_params)\n format.html { redirect_to :back, notice: 'Otu page layout section was successfully updated.' }\n ...