query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
093e72ed4f500b0d4bd02283d3531a46
DELETE /warranty_types/1 DELETE /warranty_types/1.json
[ { "docid": "57e47f254266782946d7da2a84fb0a64", "score": "0.73633677", "text": "def destroy\n authorize! :destroy, @warranty_type\n @warranty_type.destroy\n respond_to do |format|\n format.html { redirect_to warranty_types_url, notice: 'Warranty type was successfully destroyed.' }\n...
[ { "docid": "27862c2c7d101385db89cc16109a083c", "score": "0.748826", "text": "def destroy\n @warrantytype = Warrantytype.find(params[:id])\n @warrantytype.destroy\n\n respond_to do |format|\n format.html { redirect_to(warrantytypes_url) }\n format.xml { head :ok }\n end\n end", ...
9d18ae451493139e7f30bf1ce5d96352
Generate scope at top level e.g. User.on_replica
[ { "docid": "4c355d9a9617d2de33ef912f483d0783", "score": "0.0", "text": "def on_replica\n # Why where(nil)?\n # http://stackoverflow.com/questions/18198963/with-rails-4-model-scoped-is-deprecated-but-model-all-cant-replace-it\n context = where(nil)\n context.knockoff_target = ...
[ { "docid": "a95ca71a73143bde330e84db80daf329", "score": "0.70302594", "text": "def scope_name; end", "title": "" }, { "docid": "30e913f766c746c07a11a0e27284fd0c", "score": "0.6825383", "text": "def scope_level; end", "title": "" }, { "docid": "f3c13a1a81915ee7e7acb15e8430...
d1f4b3501a99af352f47b71610724e9e
adapter_bucket Retrieve parallel adapter bucket instance.
[ { "docid": "c3d82e65a407c3c78dd631fa3e8a6385", "score": "0.7955855", "text": "def adapter_bucket\n \n unless @adapter_bucket\n raise 'Persistence port must be enabled first.'\n end\n \n return @adapter_bucket\n \n end", "title": "" } ]
[ { "docid": "7e3495ea06e8367294227312cd7a9a27", "score": "0.64103746", "text": "def bucket\n @bucket ||= begin\n bucket = config[:bucket]\n connection.buckets.create(bucket) unless connection.buckets[bucket].exists?\n connection.buckets[bucket]\n end\n ...
89253aa65b847d6498a45e9c0cf0bbaa
Visit ActiveRecord::Base objects. These should be converted to their id before being used in a comparison.
[ { "docid": "d90a3084aaba3e6eb12f0a88ae8efba5", "score": "0.6657057", "text": "def visit_ActiveRecord_Base(o, parent)\n o.id\n end", "title": "" } ]
[ { "docid": "1a2e948b7842e3d95cb24600aaa21953", "score": "0.57277626", "text": "def instances_relating_to(obj)\n @relationships.map do |relationship|\n relationship_model = relationship[:references][obj.class]\n\n if !relationship_model\n []\n else\n # This rel...
566797a10b84e8047ff662d308f49ee5
DELETE /modelprices/1 DELETE /modelprices/1.json
[ { "docid": "c6e681aaff283dfc89ce73a2da5dd1d3", "score": "0.6840021", "text": "def destroy\n f_respond_destroy(@modelprice.destroy, @modelprice.id.to_s, modelprices_url)\n\n\n# @modelprice.destroy\n# respond_to do |format|\n# format.html { redirect_to modelprices_url, notice: 'Modelprice was...
[ { "docid": "c12d1ae42d08d3f8e2470a99060cd84c", "score": "0.73673266", "text": "def destroy\n @rackprice = Rackprice.find(params[:id])\n @rackprice.destroy\n\n respond_to do |format|\n format.html { redirect_to rackprices_url }\n format.json { head :no_content }\n end\n end", "...
48ae059946bcca544fe164d404b3fb47
Load the RMXP Data
[ { "docid": "6888cb05d9e340437181ac8566164563", "score": "0.5982098", "text": "def data_load\r\n unless $data_actors\r\n $data_actors = _clean_name_utf8(load_data(\"Data/Actors.rxdata\"))\r\n $data_classes = _clean_name_utf8(load_data(\"Data/Classes.rxdata\"))\r\n $data_ene...
[ { "docid": "68e6f70b12d1362b02ce91abe146dd6a", "score": "0.59605944", "text": "def load_data\n\t\tload_using_arr(train_file,train_hash,0,1)\n\t\tload_using_arr(train_file,movie_hash,1,0)\n\tend", "title": "" }, { "docid": "027c59e9d511366a239b04a4c227ce17", "score": "0.5700076", "tex...
d0848cee9ea416dfbd5b07103b6fd1ec
get every test to pass before coding runner below
[ { "docid": "b60562dedb8335886456a980c0b71fe1", "score": "0.0", "text": "def runner\nWelcome\ncard_total = initial_round\nwhile card_total < 21\ncard_total = hit?(card_total)\ncard_total = display_card_total(card_total)\nend\nend_game(card_total)\n\nend", "title": "" } ]
[ { "docid": "4214d9c38556c2b02453744c9abd3771", "score": "0.7492311", "text": "def pass(suite, test, test_runner); end", "title": "" }, { "docid": "e820a876acc56d01d07c4fe31f07d454", "score": "0.74173", "text": "def run_tests\n count = 0\n puts \"Starting test run...\"\n self...
68bc719305ce85782830373a7fdf872c
Returns the block argument given to the Contextcall for the given frame, or nil if no block was given.
[ { "docid": "c528fb8e7696615fe606bd5208666953", "score": "0.528387", "text": "def block_for_frame(frame)\n @block_association_cache[frame]\n end", "title": "" } ]
[ { "docid": "c1c0fbfc6105aab2fdc9c38080631786", "score": "0.69842935", "text": "def extract_block_arg\n if args.last.is_a?(Sexp) and args.last.type == :block_pass\n block_arg = args.pop\n block_arg = block_arg[1][1].to_sym\n end\n end", "title": "" }, { "d...
b8695cfbe7c8b92a51879d60d8e4b6af
Constructeur de la classe
[ { "docid": "a48e5cbf908e69aa48d1753675589fc7", "score": "0.0", "text": "def initialize\r\n @health = 20\r\n end", "title": "" } ]
[ { "docid": "700c042555d8ebc7c4de252bf9ffc0af", "score": "0.8770985", "text": "def constructor; end", "title": "" }, { "docid": "d88825898c6b9898e549cc4320aeaf0a", "score": "0.84330124", "text": "def initialize\n \n end", "title": "" }, { "docid": "02fcfb474eba42...
b3d5d2a3b65229b1a38592126b4a23dd
List all shares for the given device id List all shares for the given device id
[ { "docid": "00c3226d0174dc06df8e449a9d7546a9", "score": "0.7364808", "text": "def get_all_shares_for_device(device_id, opts = {})\n data, _status_code, _headers = get_all_shares_for_device_with_http_info(device_id, opts)\n return data\n end", "title": "" } ]
[ { "docid": "2167748b852b46b2936e60105cb7b5b5", "score": "0.68649006", "text": "def get_all_shares_for_device_with_http_info(device_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DevicesSharesApi.get_all_shares_for_device ...\"\n end\n ...
001138653f4d2b622f229c36d1066b6a
Language of the source code associated with the object. Defaults to +:ruby+.
[ { "docid": "f33e8f368f6e998bbf3494661077743f", "score": "0.0", "text": "def source_type; end", "title": "" } ]
[ { "docid": "7c12b45453d47339d8396b79bada2f71", "score": "0.7372397", "text": "def rb_language=(_arg0); end", "title": "" }, { "docid": "43a323387e4bc857c56080cdf939a603", "score": "0.7216183", "text": "def language\n Language.lang_for(dictionaries, :source_language)\n end", "...
52bdac7725b0e0c9a048e28ece463496
Sets a cryptographic hasher that will be used to sign outgoing commands. Once a hasher is set, all outgoing frames will be signed.
[ { "docid": "b57ed6f9c49b794f7ac3b027320d7abb", "score": "0.7394652", "text": "def outgoing_command_hasher=(hasher)\n @out_command_hasher = hasher\n end", "title": "" } ]
[ { "docid": "32257fd852d1564a11f3335f7ac62f3a", "score": "0.68958986", "text": "def incoming_command_hasher=(hasher)\n @in_command_hasher = hasher\n end", "title": "" }, { "docid": "d372ed8c307b1c26278f783e06084143", "score": "0.58614194", "text": "def set_outgoing_hash\n \n ...
0c94b1523d91059f0b3355293b42e24f
Undo a frame to their payload
[ { "docid": "ec862e8c48d53f027f9724eafc3d9302", "score": "0.7773335", "text": "def undo(frame)\n @xorify.unpack( undo_bypass(frame) )\n end", "title": "" } ]
[ { "docid": "94320ebd718612b1b500dc0b1a606560", "score": "0.7907078", "text": "def undo buffer\n @frames[buffer].undo buffer\n end", "title": "" }, { "docid": "d10e437a7a805f2be342f52d6b73ed85", "score": "0.67724067", "text": "def undo!\n bb = @stack.pop\n set_black(...
db6983e9697e7f76af0254468f903f4c
x y = z z + y = x try different values for z until you get z + y = x
[ { "docid": "f1872d428faf4e75990c91d0b33f7a01", "score": "0.6064864", "text": "def subtract(x, y)\n z = 0\n return z if x == y\n direction = (z + y > x ) ? -1 : 1\n until (z + y ) == x\n z = z + direction\n end\n z\nend", "title": "" } ]
[ { "docid": "a5be3014a3100abbe40494287cf7eee5", "score": "0.6891104", "text": "def do_something(a, b)\n x = a\n y = b\n z = 0\n until x == 0\n z += y\n x -= 1\n end\n z\nend", "title": "" }, { "docid": "6829d27cb561fd8ce0ea38abcf1824be", "score": "0.6607513", "text": "def ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "e6bda07fdc0fe2026afe37d2ef2af037", "score": "0.0", "text": "def set_a_brief_about_yourself\n @a_brief_about_yourself = ABriefAboutYourself.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;...
5681e10dd30168f17e6655942cfd166c
GET /master/employes GET /master/employes.json
[ { "docid": "426bd5ecb4907728c1b3e145616f8a44", "score": "0.69661796", "text": "def index\n @master_employes = Master::Employe.all\n end", "title": "" } ]
[ { "docid": "919f47800251143c266484531b3b0f05", "score": "0.7691129", "text": "def index\n @employes = Employe.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employes }\n end\n end", "title": "" }, { "docid": "652a45da3aa45ad7d9...
8706aa336bc82f961ad98ead371ba12b
PUT /time_tables/1 PUT /time_tables/1.xml
[ { "docid": "3369a994e974db51edc5f02437a383b7", "score": "0.5749907", "text": "def update\n @time_table = TimeTable.find(params[:id])\n\n respond_to do |format|\n if @time_table.update_attributes(params[:time_table])\n #format.html { redirect_to(@time_table, :notice => 'Time table was s...
[ { "docid": "48ced90d32c35c88ece0e9d4bb429dd5", "score": "0.57947695", "text": "def set_time_table\n @time_table = TimeTable.find(params[:id])\n end", "title": "" }, { "docid": "74f7f7d1f33860170fe9ebfacd2440e8", "score": "0.57891697", "text": "def update\n @event = Event.f...
1f39af86ecd6c804fa51864f70d0c6d8
DELETE /admin/brokers/1 DELETE /admin/brokers/1.json
[ { "docid": "3d6ffcb4baeb428fd1a78bf77c70b111", "score": "0.0", "text": "def destroy\n @agent.destroy\n respond_to do |format|\n format.html { redirect_to admin_agents_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "efaa3819db82da012b78522c5ccd0eea", "score": "0.755506", "text": "def destroy\n @broker.destroy\n respond_to do |format|\n format.html { redirect_to admin_brokers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f760de6051578dd3...
c27c7f259b30f9c5c2c1c4149e52cea6
Determines whether a value has changed for dirty checking. +old_value+ and +new_value+ will always be typecast. Types should not need to override this method.
[ { "docid": "d9973c45ff908406ef6cfe56b785928a", "score": "0.83004713", "text": "def changed?(old_value, new_value, _new_value_before_type_cast)\n old_value != new_value\n end", "title": "" } ]
[ { "docid": "97491f27fcc1ae9a0cb3a3eeb51d3cd8", "score": "0.8403192", "text": "def changed?(old_value, new_value, _new_value_before_type_cast) # :nodoc:\n old_value != new_value\n end", "title": "" }, { "docid": "6f592dbc55fb932a937e76ba568d95b0", "score": "0.749155", "tex...
9838e5b1e88ee33cab776cf421746212
fetchdata_google_blog fetches data from bing for the given kw of given category and stores it in DB
[ { "docid": "c10f04094089ce25b50296e51a4de9de", "score": "0.66019267", "text": "def fetchdata_bing(kw,cat)\n\tputs \"#{Time.new}:fetching from bing...\"\n\tres = Hash.new\n\tqurl = \"http://api.bing.com/rss.aspx?Source=News&Market=en-US&Version=2.0&Query=\"\n\tqurlx = qurl + kw\n \tputs qurlx\n \thtml ...
[ { "docid": "d750f69705d729e0e84807c493c5b27b", "score": "0.7211806", "text": "def fetchdata_google_blog(kw, cat)\n\tputs \"#{Time.new}:fetching from google_blog...\"\n\tres = Hash.new\n\tqurl = \"https://www.google.com/search?hl=en&tbm=blg&num=20&output=rss&q=\"\n\tqurlx = qurl + kw\n \tputs qurlx\n \...
287b0a0d9a834817c4f5b3a8cede0a15
This method is a public interface that allows the associated resource to reset the token completely.
[ { "docid": "b2d6f7d479e18171b27c66189df6cd68", "score": "0.670016", "text": "def reset!\n reset_secret\n refresh_expiry\n reset_confirmation\n save!\n end", "title": "" } ]
[ { "docid": "846d50b01a7779355bf4c6aaf39be364", "score": "0.82656264", "text": "def reset\n reset_token\n end", "title": "" }, { "docid": "8e7c1723abc132a37f210709321bd600", "score": "0.7904651", "text": "def reset_token\r\n authentication_token true\r\n end", "title":...
fa0202191ac68e0921bd9663d42abd61
Fixes issues sorting as per
[ { "docid": "d3135dc4158098626ce14234e6148cc2", "score": "0.0", "text": "def gantt_issue_compare_with_sorting(x, y, issues = nil)\n [(x.root.start_date or x.start_date or Date.new()), x.root_id, (x.start_date or Date.new()), x.lft] <=> [(y.root.start_date or y.start_date or Date.new()), y.root_id,...
[ { "docid": "02f49c93e72b2a8de7272166ba44c351", "score": "0.7518271", "text": "def sort_labeled_issues(issues); end", "title": "" }, { "docid": "716bfc5dce35f6e9e9bd2ab68b58028c", "score": "0.71300197", "text": "def sort_issues!(issues)\n issues.sort! { |a, b| gantt_issue_compa...
98d7ece9d18455fde1f9e7786633a8fc
there are multiple acceptable answers for this one. What is the output of the following code
[ { "docid": "6fae7d3e6db57691bbb5931d09bf5256", "score": "0.0", "text": "def recursion(x)\n return \"HEYO!\" if x >= 5\n puts x\n recursion(x += 1)\nend", "title": "" } ]
[ { "docid": "991b6f12a63ef51664b84eb729f67eed", "score": "0.57259", "text": "def formation; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.55684644", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", ...
eadf21cd6951df881afb390b6898318a
GET /photo_products/1 GET /photo_products/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "36d50e04a4ef2252a56364a370abb544", "score": "0.7878689", "text": "def show\n @photo_product = PhotoProduct.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo_product }\n end\n end", "title": "" }, { "...
873991bd859cb1720586a0327b65d72e
Test voting. Now have Dick vote on Mary's name. Votes: rolf=2/3, mary=1/3, dick=1/3 Rolf prefers naming 3 (vote 2 vs 3). Mary prefers naming 9 (vote 1 vs 3). Dick now prefers naming 9 (vote 3). Summing, 3 gets 2+1/3=1, 9 gets 3+3+3/4=.75, so 3 gets it.
[ { "docid": "d585de0a4bbd7b91de7946cbac51e56c", "score": "0.6444669", "text": "def test_cast_vote_dick\n obs = observations(:coprinus_comatus_obs)\n nam1 = namings(:coprinus_comatus_naming)\n nam2 = namings(:coprinus_comatus_other_naming)\n\n login('dick')\n post(:cast_vote, :value => \"3...
[ { "docid": "a2724cf9c9f80945715eaf8df11d9cc8", "score": "0.6772115", "text": "def required_votes\n possible_votes / 2 + 1\n end", "title": "" }, { "docid": "844fff0de210a3427e22c65ed23ae748", "score": "0.63888025", "text": "def vote_up\n 15\n end", "title": "" }, ...
641f310c470f21e22de1af50aa35ce37
Returns if the given message is from a device
[ { "docid": "4f2fcbedc77a0348756884857aeba031", "score": "0.6021219", "text": "def device?\n !user?\n end", "title": "" } ]
[ { "docid": "2317faa8056dbe0762f8518e4fb3d216", "score": "0.68273544", "text": "def incomming?\n device?\n end", "title": "" }, { "docid": "7159a9fd0423531a798205ab551cf3c5", "score": "0.6611933", "text": "def has_device?(device)\n @devices.include?(device.to_s)\n end", ...
add9ca28828d03053f6fe2d2f1829d20
Split shorthand border declarations (e.g. border: 1px red;) Additional splitting happens in expand_dimensions_shorthand!
[ { "docid": "dd8ffa496ae2734456e7fd1ab9ac6f5e", "score": "0.7921527", "text": "def expand_border_shorthand! # :nodoc:\n BORDER_PROPERTIES.each do |k|\n next unless (declaration = declarations[k])\n\n value = declaration.value.dup\n\n replacement = {\n \"#{k}-width\" => ...
[ { "docid": "ee276805abfce6551dae4f13c50e24c5", "score": "0.85924184", "text": "def expand_border_shorthand! # :nodoc:\n ['border', 'border-left', 'border-right', 'border-top', 'border-bottom'].each do |k|\n next unless @declarations.has_key?(k)\n\n value = @declarations[k][:value]\n\n...
dc8b3746d2e6cebbac40880664018c39
require_role "admin", :except => [:index]
[ { "docid": "cef45b6cee1eae0d65d713ee34b146fc", "score": "0.0", "text": "def index\n today = Date.today\n b = today << 1\n today_topics = ActiveRecord::Base.connection.select_all(<<sql).collect{|c| c[\"count(*)\"].to_i}\nselect date(created_at),count(*) from topics\nwhere created_at < '#{today}'...
[ { "docid": "b5034bd2a76ebad2c699dbed91db3515", "score": "0.7805163", "text": "def set_admin_only\n redirect_to(\"/\") unless current_user.roles.include?(\"admin\")\n end", "title": "" }, { "docid": "4dc7ce5c4ebbadae3705ecfe33cff068", "score": "0.77533406", "text": "def require_ad...
aa00d7c86fe99c105a401e7b3c3e9a90
Returns normalized attributes for that particular blueprint.
[ { "docid": "344b9c39c5ee4f7b5c652514fb64065f", "score": "0.62929034", "text": "def normalized_attributes\n Buildable.normalize_attributes(@attributes ||= {})\n end", "title": "" } ]
[ { "docid": "1cb9810a4d2750a224bf571aacbbe0c9", "score": "0.6004801", "text": "def attributes\n attrs = filter_partials(self.class._attributes.dup)\n filter(attrs).each_with_object({}) do |attr, hash|\n hash[camelize_value(attr)] = send(attr)\n end\n end", "title": "" }, ...
c4ef51cac0fe0e5baf2c061e3de11384
PATCH/PUT /installations/1 PATCH/PUT /installations/1.json
[ { "docid": "4cc6ecadee8161b7cfc247d6a4b23a98", "score": "0.6849272", "text": "def update\n respond_to do |format|\n if @installation.update(installation_params)\n format.html { redirect_to @installation, notice: 'Installation was successfully updated.' }\n format.json { head :no_co...
[ { "docid": "fd17b437e40b4211b8fcd1e2e428b454", "score": "0.68078256", "text": "def update\n @installation = Installation.find(params[:id])\n\n respond_to do |format|\n if @installation.update_attributes(params[:installation])\n format.html { redirect_to @installation, :notice => 'Insta...
e74f8f623d090b06c82c497621a5f2be
GET /auctions/1 GET /auctions/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "b910a495c53edc895db1065244ec3bb4", "score": "0.77117133", "text": "def index\n\t\t@auction_items = @auction.auction_items\n\t\trender json: @auction_items.as_json\n\tend", "title": "" }, { "docid": "b87d39fffd897b27c5ea8b7b3c02fa57", "score": "0.7681789", "text": "def ind...
9557e604f3cb39e58eb194238e1806db
image location ??????? Create a database of images that have location name and url loop through and see how many image has location that is not NIL or empty [] location = result["data"][19]["location"]["name"] count = how many friends who likes her
[ { "docid": "ee315280c99bdd9fb35018093aa0ba3a", "score": "0.5649503", "text": "def count\ncount = result[\"data\"][1][\"likes\"][\"count\"]\nend", "title": "" } ]
[ { "docid": "778519ecd25dcdccfd3048b46ccdcaac", "score": "0.66854066", "text": "def find_trail_and_counts(data_with_location)\n trail_data = Hash.new(0)\n data_with_location.each do |image|\n name = image.location.name\n trail_data[name] += 1\n end \n return trail_data\n end", ...
73f65d6eaaa33fa84122f40bbf5c4aa3
look for archive.org locations, or identifiers, or local ids to reference as embeddable iframe source
[ { "docid": "e10c13da62ecccbcd667feb5a672eaa5", "score": "0.6406861", "text": "def iframe_url_for_document(document={})\n if archive_org_id = archive_org_id_for_document(document)\n return \"https://archive.org/stream/#{archive_org_id}?ui=full&showNavbar=false\"\n end\n end", "title": "" ...
[ { "docid": "2de84c5057550a83c5977a05b310b8e0", "score": "0.58984745", "text": "def show\n # This is a Test for iFrame\n # @url = Location.find(params[:id])\n @locations = @location.nearbys(1)\n end", "title": "" }, { "docid": "5d065ba702a7bf22964aef10fcb1fef7", "score": "0.5801...
57236a011628d4f52fc27924758cb1c9
read the first argument
[ { "docid": "f76faabc773d2d9b2d0a2364edde3d68", "score": "0.0", "text": "def hashcode_of wd\n wd.downcase.split('').sort.join('')\nend", "title": "" } ]
[ { "docid": "b91c9f0741cb94e3f7212a262891d938", "score": "0.74486846", "text": "def first_argument; end", "title": "" }, { "docid": "b91c9f0741cb94e3f7212a262891d938", "score": "0.74486846", "text": "def first_argument; end", "title": "" }, { "docid": "b91c9f0741cb94e3f721...
017b23d89c4b8c27eee30766095d75ae
Public: Finds the absolute paths, including hidden ones, of the files that are not used by the pod and can be safely deleted. Returns an Array of Strings containing the absolute paths.
[ { "docid": "e0535996af3cef6fe8018cfbcc4ad7d2", "score": "0.6378797", "text": "def clean_paths\n cached_used_paths = used_paths.map{ |path| path.to_s }\n files = Dir.glob(root + \"**/*\", File::FNM_DOTMATCH)\n files.reject! do |candidate|\n candidate.end_with?('.', '..') ||\n ...
[ { "docid": "8bc3695a09b2ca0fead7c2553d41d2ba", "score": "0.7198643", "text": "def absolute_paths\n return [] unless valid?\n drive_path = MountedDrives.path_to(drive)\n relative_paths.map { |p| File.join(drive_path, p) }\n end", "title": "" }, { "docid": "5649085f5e...
4b4af5272c94b21824e917a1f6f6816f
argument is the original index of the SNP returns the index of the SNP in the included list these will be equal if no SNPs are excluded
[ { "docid": "6c7ff5742a6d5db4d2a2a9a42ae95095", "score": "0.6185127", "text": "def get_snp_included_index_num(original_snp_index)\n return @index_of_included_snps[@snps[original_snp_index].name]\n end", "title": "" } ]
[ { "docid": "c82e63fec1856e8405867e4f1873deb1", "score": "0.5903252", "text": "def process_included\n @snps.each_with_index do |snp, index|\n if @included_snps_hash[snp.name]\n @included_snps << index\n @index_of_included_snps[snp.name] = @included_snps.length-1\n end\n end\...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "240a9f777ca49241e2f360b6ab8e662b", "score": "0.0", "text": "def set_student_group\n @student_group = StudentGroup.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60322535", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6012846", "text": "de...
0a38c8c0a8b4f65610543588e07fbaa6
this object could have a 3d or 2d model show in tree
[ { "docid": "56f10cfafdfbc1791c7af97341a9a835", "score": "0.0", "text": "def have_model_design?\n\t\t\ttrue\n\tend", "title": "" } ]
[ { "docid": "76b52ee1f400cfed8d174a9c30c5f33b", "score": "0.63536006", "text": "def show\n @new = false\n @single = true\n @width = @height = 150\n @vw = 80\n @vh = 40\n @vx = @tree.x - @vw/2\n @vy = @tree.y - @vh/2\n \n end", "title": "" }, { "docid": "8d623a3ec6a9ad...
e8edbd5e6f41683995b830ef5a6bc971
Evaluate prefix (base_url) in order: 1. base_url key from local configuration (currently secrets) 2. from Information Service (cached) with https:// appended 3. or use PREFIX const
[ { "docid": "b87e49f4241183da4cf5ac33d2019cea", "score": "0.77915305", "text": "def find_prefix\n url_from_config = Rails.application.secrets.base_url\n url_from_config || Utils.random_service_public_url('data_explorers') || PREFIX\n end", "title": "" } ]
[ { "docid": "9525fced117c44b6fcc61bdc616078fb", "score": "0.7098484", "text": "def base_prefix\n Starter::Config.read[:prefix]\n end", "title": "" }, { "docid": "c8e05be1732f7bcfdf2c0226b07906ca", "score": "0.6730685", "text": "def prefix_url(rest_of_url='')\n prefix ...
33cfdef9127bea9bc321b1eb41dbc962
Checks if the category param is present in the url params, then whitelist the properties of the category param.
[ { "docid": "17d1f0f2991d66a95111452646c32953", "score": "0.0", "text": "def category_param\n result = params.require(:category).permit(:label)\n result[\"name\"] = result.delete \"label\"\n result\n end", "title": "" } ]
[ { "docid": "968dcf688f6bb7ac49dfbef4d670a4b3", "score": "0.6403232", "text": "def category_params\n params.require(:category).permit(:name) #name of category has been whitelisted\n end", "title": "" }, { "docid": "aa89f609e585b786970186dd463c334f", "score": "0.64019066", "t...
773573237aa04ea26bcfdcd0129a5258
returns the correct player, X, for the third move expect(game.current_player.token).to eq("X")
[ { "docid": "2b17da0f9895d811c4e23dbfaa77188b", "score": "0.0", "text": "def current_player\n @board.turn_count % 2 == 0 ? @player_1 : @player_2\n end", "title": "" } ]
[ { "docid": "ab7e90d374f7df083fee05380ecbf8b6", "score": "0.73506325", "text": "def current_player(board)\n turn_number = turn_count(board) + 1\n token = (turn_number % 2 == 1) ? \"X\" : \"O\"\n return token\nend", "title": "" }, { "docid": "c9f7b213b0406978d55fd371a0cb06c8", "score": ...
dde3db0cf89a365e966d7f17425b8c1a
FizzBuzz Define a method called fizzbuzz with parameters called num_1, num_2, and range.
[ { "docid": "b5f36db1ff1b2cef3acdb2886b1b941b", "score": "0.7438379", "text": "def fizzbuzz(num_1, num_2, range)\n#Create a for loop for a variable named i from 1 to range variable.\n (1..range).each do |i|\n#Write a conditional statement to see if 0 can be the remainder of the division of i/num_1 AND A...
[ { "docid": "eb2b55d4ca56cdbd55bbedfb0ffb1f5a", "score": "0.8039163", "text": "def fizzbuzz(num)\n \nend", "title": "" }, { "docid": "eb2b55d4ca56cdbd55bbedfb0ffb1f5a", "score": "0.8039163", "text": "def fizzbuzz(num)\n \nend", "title": "" }, { "docid": "9784d9ad1ce7ba02...
de1f937ebc1fc608c31cfcb4a1de860c
Get all recent builds for a specific project
[ { "docid": "2c237aeb07259af3dd1534929238196d", "score": "0.77158344", "text": "def recent_builds(params = {})\n CircleCi.request(conf, base_path, params).get\n end", "title": "" } ]
[ { "docid": "c08bb31452256e773433fbde01d5e1d6", "score": "0.80826473", "text": "def recent_builds(params = {})\n CircleCi.request(@conf, \"/project/#{username}/#{project}\", params).get\n end", "title": "" }, { "docid": "1139144772b4abe8348a5b72588ed35d", "score": "0.7228891", ...
0290059b7b695f01f2e116bba61a81ef
Returns a Proc that can be used as a finalizer to call `BZ2_bzDecompressEnd` with the given `stream`.
[ { "docid": "f3c1f842ec2395a6cc4993d1d05afe24", "score": "0.83835155", "text": "def finalize(stream)\n ->(id) do\n Libbz2::BZ2_bzDecompressEnd(stream)\n end\n end", "title": "" } ]
[ { "docid": "70d771cba1d352b3dbc9c810811d65da", "score": "0.61844575", "text": "def StreamDataEnd(stream)\n @ole._invoke(9, [stream], [VT_BYREF|VT_DISPATCH])\n end", "title": "" }, { "docid": "4d862d0b899b081d3bc52815d9525948", "score": "0.5620141", "text": "def pull(stream)\n...
1feeac7e0b23cf23f77036318bb8c20d
Set the value of the CalendarID input for this Choreo.
[ { "docid": "b0d17a0cc69417e748eba4d0ca39c1cc", "score": "0.7333203", "text": "def set_CalendarID(value)\n set_input(\"CalendarID\", value)\n end", "title": "" } ]
[ { "docid": "8dc00892a5e17d4a687d0cf62fe1f1d2", "score": "0.65536475", "text": "def set_calendar\n @calendar = Calendar.find(params[:calendar_id])\n end", "title": "" }, { "docid": "908aee9a5005a4ef6938b87cc61948eb", "score": "0.64115894", "text": "def set_calendar\n ...
76e26e427766da7e7a985535ab6f72e4
GET /commitments/1 GET /commitments/1.json
[ { "docid": "80426112a6c5c9795673da4d387785ff", "score": "0.6941051", "text": "def show\n @commitment = Commitment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @commitment }\n end\n end", "title": "" } ]
[ { "docid": "2ea176f113be3fa4c64a397fd19ce971", "score": "0.72465706", "text": "def index\n @commitments = Commitment.all\n end", "title": "" }, { "docid": "3b40c4da72585348aeedab8d330697d4", "score": "0.7089743", "text": "def show\n respond_to do |format|\n format...
6821397268faea69c54e94b57b81cd9e
Find a way to accumulate the :worldwide_grosses and return that Integer using director_data as input
[ { "docid": "0cc89cfefc3edfd5a1940339d742275b", "score": "0.71042264", "text": "def gross_for_director(director_data)\n\n \n col = 0\n value = 0\n \n while col < director_data[:movies].length do\n \n value = value + director_data[:movies][col][:worldwide_gross]\n # puts director_data[row][:mo...
[ { "docid": "78129262a5d48c085cf6cb4e93eafdb3", "score": "0.8031163", "text": "def gross_for_director(director_data)\n movie_index = 0\n worldwide_grosses = 0\n while movie_index < director_data[:movies].length\n worldwide_grosses += director_data[:movies][movie_index][:worldwide_gross]\n movie_...
2bd22cd4316b82956f099b43e671b835
At this point very limited in it's ability
[ { "docid": "9d8298b3bdc7cee2b86df5c476145330", "score": "0.0", "text": "def decode_query_string\n self.split(\"&\").inject({}) { |collector, string|\n pair = string.split('=', 2)\n collector.merge({pair[0] => pair[1]})\n }\n end", "title": "" } ]
[ { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.6961394", "text": "def desired; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.6899605", "text": "def used; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "a3b5fd0b8100e1498fd37571bae175d4", "score": "0.0", "text": "def testcase_params\n params.require(:testcase).permit(:title, :description)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7493595", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6954758", "text": "def strong_params\n params.require(:request).permit(param_white...
21b76830642cd808d89a208ed28d830e
of def initalize }}} The function count goes through the jokes database and counts the jokes according to their source
[ { "docid": "04dad6eeb43ad50ee2bd74ef7dfbc9bc", "score": "0.82678235", "text": "def joke_count # {{{\n\n @log.message :debug, \"Entering count function\"\n\n jokes = Joke.all\n sources = Hash.new\n\n sources[ \"Total\" ] ...
[ { "docid": "7e4a35f1efc80ad73232e18c42a4b5c0", "score": "0.6788473", "text": "def count; end", "title": "" }, { "docid": "7e4a35f1efc80ad73232e18c42a4b5c0", "score": "0.6788473", "text": "def count; end", "title": "" }, { "docid": "7e4a35f1efc80ad73232e18c42a4b5c0", "...
50a4b8330dccbcbc4ff0b6915414e31b
USER_ORG's parent must be USER_ORG
[ { "docid": "fe2f27c0650d5d7a1569da05dec27d97", "score": "0.0", "text": "def validate_tree_kind\n if parent_id\n if kind != parent.kind\n err_on(:kind, 'different_kind_from_parent')\n end\n end\n end", "title": "" } ]
[ { "docid": "b8b3ffc2582948ceafdcf1e8ff04e4da", "score": "0.6967765", "text": "def parent\n raise \"undefined parent Organization\" unless organization?\n organization\n end", "title": "" }, { "docid": "d74103c329cce07145068d0fab6c4429", "score": "0.6644833", "text": "def paren...
af5e266db29a1f23a5a22d544b040a3e
link to a page new elem
[ { "docid": "d2833dd9dad06b29f22bff12db7ba461", "score": "0.0", "text": "def new_elem\n @type_name = params[:type]\n @name =eval(@type_name).to_p_name\n @parent_id = params[:parent_id]\n end", "title": "" } ]
[ { "docid": "e5c8fa9cde9681187bc24ccc22acb4fc", "score": "0.6787122", "text": "def new_for_page\n id = params[\"page_id\"]\n owner = Page.find(id)\n new_text_element = owner.text_elements.new\n new_text_element.page = owner\n hobo_new_for :page, new_text_element\n end", "title": "" ...
02eb9d17789c087b00373b36c00d3591
PATCH/PUT /data/1 PATCH/PUT /data/1.json
[ { "docid": "9462b322678af1c6044d5521d5238b31", "score": "0.0", "text": "def update\n respond_to do |format|\n if @datum.update(datum_params)\n format.html { redirect_to @datum, notice: 'Datum was successfully updated.' }\n format.json { render :show, status: :ok, location: @datum }...
[ { "docid": "05c1bed948daa058e70016e863c7cd96", "score": "0.7088323", "text": "def update_request(data)\n client.create_request('PATCH', url_path, 'data' => data)\n end", "title": "" }, { "docid": "5fd5f00640bdb0c785bcac4689a46f3c", "score": "0.7049579", "text": "def patch(dat...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "aa00700496b3b51158ccc3d0c55a75f9", "score": "0.0", "text": "def set_app_variable\n @app_variable = AppVariable.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60310465", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60152966", "text": "d...
f970c489cfe048e72672ed014a7fc38e
Appends a comment node at the current position in the document
[ { "docid": "c8e497d786ac7ea2a1d5def95288fa37", "score": "0.64976627", "text": "def comment!(string)\n comment = XOM::Comment.new string\n @target.append_child(comment)\n self\n end", "title": "" } ]
[ { "docid": "6ed6bf0e4b0c02b4fb81c31d77a70c0e", "score": "0.7182936", "text": "def add_comment(comment); end", "title": "" }, { "docid": "aec815b8d3307106c93408ca1760d13b", "score": "0.7089156", "text": "def add_comment(comment)\n return if ! comment\n if @comment \n ...
392d0aeb86500ede0dd905cd43aa8f94
PUT /leaveforstudents/1 PUT /leaveforstudents/1.xml
[ { "docid": "a59240960ee9c45bfb714ceff4c62750", "score": "0.6824307", "text": "def update\n @leaveforstudent = Leaveforstudent.find(params[:id])\n\n respond_to do |format|\n if @leaveforstudent.update_attributes(params[:leaveforstudent])\n flash[:notice] = 'Leaveforstudent was successfu...
[ { "docid": "6a8b169abeba6cb604ea0f0152128a5b", "score": "0.6750721", "text": "def update\n @leaveforstudent = Leaveforstudent.find(params[:id])\n\n respond_to do |format|\n if @leaveforstudent.update_attributes(params[:leaveforstudent])\n flash[:notice] = t('leaveforstudent.title2')+\"...
c4736d8d29e543cd4bbb1e1058cb6a83
strong parameters is mandatory in rails4 see for details
[ { "docid": "715aea41acd7a1f06ead4623c1e6ee88", "score": "0.0", "text": "def configure_permitted_parameters\n sign_up_vars = [:email, :password, :password_confirmation, :current_password, :address, :name,\n :address, :phone, :skype, :aim, :yim, :jabber, :latitude, :longitude]\n\n ...
[ { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.7918364", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.74791867", "text": "def good_params\n permit_params\n end", "title": "" }, ...
2cdc2f7a2a3bac815283c7583a59e3f3
PATCH/PUT /career_fields/1 PATCH/PUT /career_fields/1.json
[ { "docid": "c43fa13c2da891555ec7045f5df75a5b", "score": "0.71157354", "text": "def update\n respond_to do |format|\n if @career_field.update(career_field_params)\n format.html { redirect_to @career_field, notice: 'Career field was successfully updated.' }\n format.json { render :sh...
[ { "docid": "a5c71b42de2d9c2b2c5159a57bd20dd2", "score": "0.6784346", "text": "def update\n @career.update(career_params)\n head :no_content\n end", "title": "" }, { "docid": "fe8feac8d1f0ebcc4841d02e9c8de2fc", "score": "0.65630776", "text": "def UpdateField params = {}\n ...
bfc31d7ec49c287c97d10f3780091370
DELETE /services/1 DELETE /services/1.json
[ { "docid": "cbab7808ecd4a80dae94ac519587c98c", "score": "0.6891541", "text": "def destroy\n\n @service.destroy\n\n redirect_to services_url\n\n end", "title": "" } ]
[ { "docid": "f771df7d19346fc235fe7bb3807d51c9", "score": "0.7445268", "text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to services_url }\n format.json { head :ok }\n end\n end", "title": "" }, ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "c80cc2ba6b4746f961748d8f5545a0db", "score": "0.0", "text": "def postcard_params\n params.require(:postcard).permit(:title, :desc, :ix, :src)\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...
a973780d75348cd744e3204d4f95b3a3
Updates a Task Link
[ { "docid": "07c7c44d30fabd342d0b10fa629e447f", "score": "0.75102526", "text": "def update_task_link(id, api_link, opts = {})\n data, status_code, headers = update_task_link_with_http_info(id, api_link, opts)\n return data\n end", "title": "" } ]
[ { "docid": "b38857a05c886cd1a6b89a6e00cb68a5", "score": "0.75547445", "text": "def set_task_link\n @task_link = TaskLink.find(params[:id])\n end", "title": "" }, { "docid": "1cdfd6691a031cc7c2cb4fd16ae43420", "score": "0.7482302", "text": "def update\n @tasklink = Tasklink...
12be30c28e9c7c17aa4a2a3189b6ade6
Finds a post based on the +post_type+ and +post_id+
[ { "docid": "6e328859942397c71eb21b03dcad08e9", "score": "0.59301585", "text": "def post\n \"Stacked::#{post_type.classify}\".constantize.find(post_id)\n end", "title": "" } ]
[ { "docid": "34bcbcae5585c2cb3cba34170096013c", "score": "0.7177188", "text": "def find_post #(18): remove repetition on show, update, edit, destroy methods\n @post = Post.find(params[:id])\n end", "title": "" }, { "docid": "d2b78a70bc6cac5260568801e398d944", "sco...
9be4f76c5d06179bd3b64538a2e9517a
Set tempo in terms of Quarter Notes per Minute (aka BPM)
[ { "docid": "f13125872aa78a67c222190448d83e5e", "score": "0.77403736", "text": "def tempo(bpm)\n # if @parent then this is a child sequence and we should respect\n # the parent tempo and adjust the qnpm accordingly\n @tempo = bpm\n ms_per_quarter_note = MIDI::Tempo.bpm_to_mpq(bpm)\n ...
[ { "docid": "b1e536927abae1d5a559d44da05bcb4d", "score": "0.7528274", "text": "def tempo(beats_per_second)\n\t\tbeats_per_minute = beats_per_second * 60 \n\tend", "title": "" }, { "docid": "cb2f314ce73a82edd0f23729b7f8a264", "score": "0.63498175", "text": "def tempo_min\n @tempo_mi...
46b030d72e431ff1fdbb60f4b6130378
GET /arteditors/new GET /arteditors/new.json
[ { "docid": "7ba84d1a662e47d9b247cd62b9b32666", "score": "0.683915", "text": "def new\n @veditor = Veditor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @veditor }\n end\n end", "title": "" } ]
[ { "docid": "fea46ea2209cd4710e9b2c7f6268fb56", "score": "0.76137453", "text": "def new\n @editor = Editor.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @editor }\n end\n end", "title": "" }, { "docid": "1ca1fbbbe2d68b0994494c3b8a29...
c025151d2e0065dc5c699a0348c9a9ea
Time complexity: O(logn) The number of digits in a number is given by log(n) and we are processing each digit in the number Space complexity: Closely related to the time complexity, and is a measure of what numbers we're putting in the HashSet, and how big they are. For a large enough n, the most space will be taken by...
[ { "docid": "ac9114a182f59e995d34a1883973f278", "score": "0.0", "text": "def is_happy(n)\n seen = Set.new\n while(n != 1 && !seen.include?(n))\n seen.add(n)\n n = calculate_sum(n)\n end\n n == 1\nend", "title": "" } ]
[ { "docid": "15ded1cdcc13e127d95fb9f9c0a9256f", "score": "0.64888805", "text": "def is_happy(n)\r\n set = Set.new\r\n while true do\r\n digits = n.to_s.split('').map(&:to_i)\r\n total = 0\r\n digits.each { |digit| total += digit**2 }\r\n return true if total == 1\r\n ...
ea1c566baa1a75434537270aef9caf32
returns all the valid questions for a company
[ { "docid": "c53f3427564f78f1e4ac8969f1869e6f", "score": "0.6927046", "text": "def valid_questions\n questions.select { |question| question.valid_for_quiz?(self.id) }.uniq\n end", "title": "" } ]
[ { "docid": "a73443d4724bbb5d652d59d0f810210e", "score": "0.6518735", "text": "def valid_questions\n @valid_questions ||= @group.parent_questions.select{|pq|!pq.hidden?}\n end", "title": "" }, { "docid": "d783e3c25edf15b0c04258bd0fd4fbd6", "score": "0.65090287", "text": "def u...
a157de36ec16787edbca649f295fdf00
GET /howtodos/1 GET /howtodos/1.json
[ { "docid": "51ab0d267ca78cc71b37fcf2531a0dcf", "score": "0.0", "text": "def show\n @comments = @howtodo.comments\n @ratings = @howtodo.ratings\n current_user.view_howtodo(@howtodo)\n end", "title": "" } ]
[ { "docid": "16b8ff79f0996db0991cbc98b91943fa", "score": "0.67970604", "text": "def index\n @to2dos = To2do.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @to2dos }\n end\n end", "title": "" }, { "docid": "39400dc029c1a6dbd878f06...
40f6092839d2fac975ef15628af4c57d
Update a 'appliance.Upgrade' resource.
[ { "docid": "d42b91ef7add5b8cfbbfe2c7b1e5eca3", "score": "0.6237799", "text": "def update_appliance_upgrade(moid, appliance_upgrade, opts = {})\n data, _status_code, _headers = update_appliance_upgrade_with_http_info(moid, appliance_upgrade, opts)\n data\n end", "title": "" } ]
[ { "docid": "202af165d1ed1fa4ab14baccee755c88", "score": "0.72635597", "text": "def update\n @upgrade = Upgrade.find(params[:id])\n\n respond_to do |format|\n if @upgrade.update_attributes(params[:upgrade])\n format.html { redirect_to(@upgrade, :notice => 'Upgrade was successfully updat...
30400e314ecc7a849c2500d7390a13ea
Takes populatoin_density and state as parameters. Returns the number of months it will take the virus to spread.
[ { "docid": "e3fd825fb821128298b718f0b58c0da8", "score": "0.0", "text": "def speed_of_spread #in months\n speed = 0.0\n case @population_density\n when @population_density >= 200\n speed += 0.5\n when 150..199\n speed += 1\n when 100..149\n speed += 1.5\n wh...
[ { "docid": "1d25b71b8aeff42dde44420e006d407b", "score": "0.7578014", "text": "def speed_of_spread #(population_density, state) #in months\n # We are still perfecting our formula here. The speed is also affected\n # by additional factors we haven't added into this functionality.\n num_of_month...
8d134a837d795003c4c62ea5e7fa05a0
Summarizes the annotation results for this RelationInstance
[ { "docid": "309df50f59375ea965386ff33500538c", "score": "0.66008234", "text": "def summarize_annotations\n\t\tresult = {is_expressed: 0, is_not_expressed: 0, not_sure_expressed: 0, is_bad_pattern: 0, total_anns: self.annotations.count}\n\t\tself.annotations.each do |ann|\n\t\t\tcase ann.annotation\n\t\t...
[ { "docid": "b0bcd60aab5200ad654321bc9cb7b0df", "score": "0.63381535", "text": "def annotations; end", "title": "" }, { "docid": "b0bcd60aab5200ad654321bc9cb7b0df", "score": "0.63381535", "text": "def annotations; end", "title": "" }, { "docid": "b0bcd60aab5200ad654321bc9c...
21d72fd344f446ed9025a3b55e516318
The following methods are to unescape the direct upload url path
[ { "docid": "d3717bd2e42b1ee2d3ea688a9fb491ae", "score": "0.6340758", "text": "def layout_upload_direct_upload_url=(escaped_url)\n write_attribute :layout_upload_direct_upload_url, self.unescape_url(escaped_url)\n end", "title": "" } ]
[ { "docid": "26569b6c5c4dd54e23b70bc2fc729bde", "score": "0.7783842", "text": "def unescape_path(s); end", "title": "" }, { "docid": "26569b6c5c4dd54e23b70bc2fc729bde", "score": "0.7783842", "text": "def unescape_path(s); end", "title": "" }, { "docid": "26569b6c5c4dd54e23...
665830f9c2d366748e13b763121e5ecb
Called when a new Regional is created
[ { "docid": "54f76e8864fe7d813e2d9a176207a373", "score": "0.0", "text": "def initialize(regional_x, regional_y)\n @coordinates = { x: regional_x, y: regional_y }\n end", "title": "" } ]
[ { "docid": "5d19805557847f51c5c2b89177e51316", "score": "0.70779437", "text": "def create\n @breadcrumb = 'create'\n @region = Region.new(params[:region])\n @region.created_by = current_user.id if !current_user.nil?\n\n respond_to do |format|\n if @region.save\n forma...
6790e3721ca9b89ece142d048fad5b93
DELETE /has_tags/1 DELETE /has_tags/1.json
[ { "docid": "810158092dd8983aab006ba6fc1d0b14", "score": "0.7393988", "text": "def destroy\n @has_tag.destroy\n respond_to do |format|\n format.html { redirect_to has_tags_url, notice: 'Has tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title"...
[ { "docid": "06667229334809f93125852c81f53ca3", "score": "0.7493433", "text": "def delete()\n\n client.delete(\"/tags/#{gid}\") && true\n end", "title": "" }, { "docid": "f3556d6972f6f78f70303c500860537f", "score": "0.7479012", "text": "def delete_tag tag\n delete \"tag...
f7bd6b9652a2221d18a0ff647b069308
Train the model. Must call fit prior
[ { "docid": "58c3ea70b04b1040d374c3432e3f007d", "score": "0.6611805", "text": "def train\n train_in_epochs(matrix_nnz)\n self\n end", "title": "" } ]
[ { "docid": "a485479c1203b9531aff15c1df5d8084", "score": "0.7507078", "text": "def train\r\n\t\t#Do data splitting\r\n\t\tdata = trainingData\r\n\t\ttrainData\t= data.segregate trainingDataAsArray, true\r\n\t\t@lr\t= Liblinear.train(\r\n\t\t\t{solver_type: self.class.findKernel(@kernel) },\r\n\t\t\ttrain...
7860089c84fd381131a370d4ba43dc54
Condenses our restaurant address into one string for display purposes in our application.
[ { "docid": "8f6d6070bbd534023d2d89f22c873ba3", "score": "0.0", "text": "def get_city_state_zip\n\t\tcity_state_zip = self.city + \", \" + self.state + \" #{self.zip}\"\n\tend", "title": "" } ]
[ { "docid": "8a53f94af64f26da5cbb815f72e2b41c", "score": "0.80551547", "text": "def full_address\n return \"#{business_address} <br/> #{(city ? (city.to_s+',') : '')} #{(state ? (state.to_s+',') : '')} #{zipcode}\"\n end", "title": "" }, { "docid": "be2577218ebd68220acb07b4fbdad1c8", ...
ea33df5dda563af221e649669e1972b6
Returns whether `file` contains enough `../` references to reach outside this directory.
[ { "docid": "58624db21074c2ccb5ad66e4e4c342db", "score": "0.7078477", "text": "def _reaches_out?(file)\n depth = file.path.count(\"/\")\n file.content.scan(%r{(?:\\.\\./)+}).any? {|match| match.count(\"/\") > depth}\n end", "title": "" } ]
[ { "docid": "9ca073621046b1f571f1c68dbf703cbf", "score": "0.6983556", "text": "def relative?(path)\n expand(path).rindex(@path_root, 0) == 0\n end", "title": "" }, { "docid": "83a46ee7ba9a2d06bbe8800fa9998574", "score": "0.6651516", "text": "def relative?\n # FIXME: Need a ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "687bc8586b3f7220fb0817fdbd581d83", "score": "0.0", "text": "def game_asset_params\n params.require(:game_asset).permit(:name, :price, :main_category, :sub_category, :file_uploaded, :promo_url,\n :sales_copy, :sales_body, :sales_closing, :make_public, :order, :license, :search, :g...
[ { "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...
d26427937e7d8fe3c5f9aa5787c8c472
Requires email and password params, accepts a name parameter Returns an API token for the user if valid
[ { "docid": "4c03083786d2be689ff059e7dcc5ebec", "score": "0.7344349", "text": "def create\n user = User.find_by(email: auth_params[:email])\n if user&.valid_password?(auth_params[:password])\n @token = user.api_tokens.find_or_create_by(name: (auth_params[:name] || \"default\")) do |token|\n ...
[ { "docid": "1c159425be84704f4ade515348653233", "score": "0.7468427", "text": "def create\n user = User.find_by_email(params[:email])\n if user.valid_password?(params[:password])\n render :json => { name: user.first_name, token: user.auth_token }\n end\n end", "title": "" }, { ...
0b939f15f4b6b4dffeffcfc1181ae9da
The initial position of the foregrounds
[ { "docid": "5c8814ff0af61dc22685aac32e6df3b8", "score": "0.8600469", "text": "def foreground_pos\n return 0, 0\n end", "title": "" } ]
[ { "docid": "5aef50c366aee2a4855b79789af25f4d", "score": "0.7361037", "text": "def front_initial_pos\n return -48, 220\n end", "title": "" }, { "docid": "fa9965a75ef4f8b9d5492c2688b8c674", "score": "0.721562", "text": "def back_initial_pos\n return 368, 220\n e...
d49e85fe8815e0f255d85c1d072a1402
PATCH/PUT /estimator_types/1 PATCH/PUT /estimator_types/1.json
[ { "docid": "6f404af493fd8816321b158e2aa82f1a", "score": "0.72510344", "text": "def update\n respond_to do |format|\n if @estimator_type.update(estimator_type_params)\n format.html { redirect_to [:admin, @estimator_type], notice: 'Estimator type was successfully updated.' }\n format...
[ { "docid": "28be727aca8b1ea8a16d2331b85fa0c9", "score": "0.6379821", "text": "def set_estimator_type\n @estimator_type = EstimatorType.find(params[:id])\n end", "title": "" }, { "docid": "c43d27fbd4ecd979026d518ec22003b3", "score": "0.63306075", "text": "def set_estimator_type\n ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "2a609efd63de58b7170894b696747974", "score": "0.0", "text": "def groupement_params\n params.require(:groupement).permit(:name, :phone, :region_id, :localisation, :email)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7493595", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6954758", "text": "def strong_params\n params.require(:request).permit(param_white...
12fb3921ac5750bf5482919723b9ab73
Creates a secure random remember token for the user if it doesn't already have one
[ { "docid": "7eef146d86354413c620eec6518e080b", "score": "0.80381024", "text": "def create_remember_token\n\t\t\tself.remember_token ||= SecureRandom.urlsafe_base64\n\t\tend", "title": "" } ]
[ { "docid": "61dde70c99be10efeb3d7b588b1f2868", "score": "0.846448", "text": "def create_remember_token\n unless self.remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end\n end", "title": "" }, { "docid": "30d227c21cf713de6acc8607923747f9", "score": "0.8360...
0deac99fa3222ccb75f19e92a3a53b96
params: access_token, group_id self's right
[ { "docid": "7eae204004d7139b74b97b28b789b0f7", "score": "0.0", "text": "def all_my_posts\n @posts = @current_user.posts\n render_results(@posts)\n end", "title": "" } ]
[ { "docid": "aef3ba9b0bb0c294511eb3601d2af234", "score": "0.7041854", "text": "def api_auth_group_token\n words = request.authorization.split(' ')\n head :unauthorized unless words[0].casecmp('group').zero?\n\n @group = Group.find_by api_token: words[1]\n head :unauthorized unless @group\n e...
2ca267a7363d06e7b389b095e873223c
shut down the EventHandlerSubscriptions
[ { "docid": "b2de10e3018c50804b307610a2347e84", "score": "0.0", "text": "def close\n synchronize do\n @callbacks.values.flatten.each(&:close)\n @state = :closed\n clear!\n end\n end", "title": "" } ]
[ { "docid": "a8a2075b24c99d0c04a8234c10905e74", "score": "0.69234186", "text": "def deregister_event_handlers\n\t\tframework.events.remove_session_subscriber(self)\n\tend", "title": "" }, { "docid": "15af6cd9312b95301049a32780d6b133", "score": "0.69045174", "text": "def unsubscribe\n ...
edc7f0927a672ebc580a1a91df12cfdc
Checking if the piece coordinates are valid or not:
[ { "docid": "e82dbcb2e53eeb46a4e79cf433ba9335", "score": "0.83166677", "text": "def piece_location_valid?(coords)\n if valid_coords?(coords)\n puts \"Piece added at coordinates #{coords}\"\n coords_available?(coords)\n else\n puts \"Piece coordinates are out o...
[ { "docid": "8f0e2f0f6f933a3ba0e20cd50c8db11a", "score": "0.875155", "text": "def piece_location_valid?(coords)\n end", "title": "" }, { "docid": "45be1ad2c1cd8022e3f8babcb60b1558", "score": "0.8033362", "text": "def within_valid_coordinates?(coords)\n # piece coords are i...
e1b6dfb177fe6f99a8d4fd6e5d0943f7
Set the active property of the controls in the user control SET
[ { "docid": "8173f0c6294b45e2fc13334fc0988881", "score": "0.60773736", "text": "def active=(active)\n @active = active\n @ucActStates.active = active\n @ucHpStat.active = active\n @cHpStatGauge.active = active\n @ucMpStat.active = active\n @cMpStatGauge.active = active\n @ucAtkStat.a...
[ { "docid": "147a00e9bc5c59c6309771a5f739c1a5", "score": "0.84628284", "text": "def active=(active)\n @active = active\n for i in 0 .. @ucControls.size-1\n @ucControls[i].active = active\n end\n end", "title": "" }, { "docid": "9b072a668c795103d9df3c61e92c62c8", "score": "0...
7313a4b4800df7311081da9668baa083
Allows multiple text fields grabbing autocomplete info from the same place
[ { "docid": "9a524343249afad292f536d3f5c438a5", "score": "0.6557586", "text": "def text_field_id_with_auto_complete(object, method, tag_options = {}, completion_options = {}, cont = params[:controller])\n # cont: an embedded form passes in its controller name (e.g. 'forms/admissions/prospect') otherwise...
[ { "docid": "a3ec89ee5750ac1de689fe04eca4386e", "score": "0.7366341", "text": "def autocomplete; end", "title": "" }, { "docid": "5f62c78add290c24b65d8205468365fe", "score": "0.6744672", "text": "def auto_complete_info(field)\r\n { \"id\" => id, \"label\" => send(field), \"value\" ...
8b93d5dc72afe2d3637cc4f93d4b2d04
PATCH/PUT /groups/1 PATCH/PUT /groups/1.json
[ { "docid": "9c45f084b1e9823a846394d2a06fd3f4", "score": "0.0", "text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'グループが更新されました。' }\n format.json { render :show, status: :ok, location: @group }\n else\n ...
[ { "docid": "8ee64ed93964ca86b3715555759824c2", "score": "0.7710417", "text": "def patch_group(group_id, request)\n start.uri('/api/group')\n .url_segment(group_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .patch()\n .go()\n end", "title"...
242efd146342f7f178d48ea5c77df6d7
End namespace /users Get user from ID
[ { "docid": "11df45fdff4f4d5bd1873a3db532f67b", "score": "0.6918365", "text": "def user_from_id(user_id)\n user = User.first(:id2 => user_id)\n if user.nil?\n give_error(400, ERROR_USER_NOT_FOUND, \"No user found.\").to_json\n end\n \n return user\n end", "title": "" } ]
[ { "docid": "2a68f384da335ac25f2cb0198dcab24e", "score": "0.78376544", "text": "def get_user_by_id(id)\n $r.hgetall(\"user:#{id}\")\n end", "title": "" }, { "docid": "15a8bfcf46990230d5ef6abdc751b2ba", "score": "0.7835112", "text": "def get_user(id)\n return @client.raw...
928dc7691f945d48301f5035f672fd1f
Money gotten if sold now with latest prices
[ { "docid": "2a123a18bda4dfc394698ac00e3d1a4b", "score": "0.66544527", "text": "def value\n buys_amount = buys.sum(:amount)\n sells_amount = sells.sum(:amount)\n (buys_amount - sells_amount) * constituent.price.amount\n end", "title": "" } ]
[ { "docid": "5c8bdf4e83d429d958f5abf147e58fbd", "score": "0.70691067", "text": "def calculate_final_price\n nada = price\n forty = price - (price * 0.40)\n twenty = price - (price * 0.20)\n\n if orders.count < 10\n amount = nada\n elsif orders.count.between?(10, 30)\n ...
167c84416a4c6c33a5cfc23b22a7443a
Calling this will prevent activerecord from assigning the same id (which violates constrain)
[ { "docid": "e160ce90bb0b3670ce40a5eb7d46b56a", "score": "0.0", "text": "def reset_db_peak_sequence\n ActiveRecord::Base.connection.tables.each do |t|\n ActiveRecord::Base.connection.reset_pk_sequence!(t)\n end\nend", "title": "" } ]
[ { "docid": "35d97686dc96abbfae7f08c02fdaf3e8", "score": "0.69961417", "text": "def create_or_update\n if self.id.is_a?(Numeric) && self.id.to_i.zero?\n self.id = nil\n @new_record = true\n end\n super\n end", "title": "" }, { "docid": "44e19d395ddcbea9e8157b55...
b165bb4158b78da21bdb9e01c19103e0
Gets a list of all packet filter rules.
[ { "docid": "5ce30df5c46a5649e24f081ff110f2fb", "score": "0.0", "text": "def list\n super\n end", "title": "" } ]
[ { "docid": "88898f9ef9f1b620130fa66a5819665d", "score": "0.6974597", "text": "def all\n @rules\n end", "title": "" }, { "docid": "a891425c1bf5f60ce569ad6d219d6d84", "score": "0.69298327", "text": "def rules\n return [] if @rules.empty?\n @rules.sort_by {...
25f11f039f624909dd9868ab7d06fee0
Gosu implementation Inputs: none Outputs: none
[ { "docid": "763e5817900fcdc1226bf5063f71ae0b", "score": "0.0", "text": "def clicked\n end", "title": "" } ]
[ { "docid": "64ecf4bb47342c97dbb7efe629dc7867", "score": "0.6552962", "text": "def draw\n \n if @visible > 0 #Draw the Ruby if @visible is a number bigger than 0\n @image.draw(@x - @width / 2, @y - @height / 2, 1)\n end\n \n @hammer_image.draw(mouse_x - 40, mouse_y - 10, 1) #Dr...
e809e1c55267e72eba6cb72dc4ac9adb
GET /registrations GET /registrations.json
[ { "docid": "141b7fad4b99fab73c3e7fa9caa79e28", "score": "0.6216609", "text": "def index\n @registrations = Registration.order(:last_name).where(\"created_at >= ?\", Date.today.beginning_of_year)\n\n respond_to do |format|\n format.html\n format.json { render json: @registrations, include...
[ { "docid": "6550a3fdc86733c553417757d71a8fa4", "score": "0.7722891", "text": "def index\n @registrations = Registration.all\n \n render json: @registrations\n end", "title": "" }, { "docid": "4b192d9054befc7bc5c6597459caf015", "score": "0.7635744", "text": "def index\n ...
0c692f94e0553140e2c30097825689ca
Update a &39;capability.ChassisManufacturingDef&39; resource.
[ { "docid": "b4893ae1b4aba37ecf60bee87d77cfbb", "score": "0.6543395", "text": "def update_capability_chassis_manufacturing_def_with_http_info(moid, capability_chassis_manufacturing_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi....
[ { "docid": "e77796eebb240b7f1811834099329466", "score": "0.7213708", "text": "def update_capability_chassis_manufacturing_def(moid, capability_chassis_manufacturing_def, opts = {})\n data, _status_code, _headers = update_capability_chassis_manufacturing_def_with_http_info(moid, capability_chassis_m...
e1039ff82d62ed784b41a6dbf3b61667
GET /tickets GET /tickets.json
[ { "docid": "d27715208ae228b99697ea8bee05538a", "score": "0.76279", "text": "def index\n @tickets = Ticket.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ticket }\n end\n end", "title": "" } ]
[ { "docid": "bca922a42971ac7e819a20e8b5f19079", "score": "0.812432", "text": "def GetTickets params = {}\n\n params = params.merge(path: 'tickets.json')\n APICall(params)\n\n end", "title": "" }, { "docid": "485d99e64672b1c96f45b9fa9ff259cb", "score": "0.7915244", "...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "b44e36739422ea3cbad563038ecd8ca2", "score": "0.0", "text": "def program_roster_params\n params.require(:program_roster).permit(:program_schedule_id, :customer_id)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6980957", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6783065", "text": "def strong_params\n params.requi...
1e68b23fe47d22f97080639c85e6796f
Adds package/packages into group which will be picked up.
[ { "docid": "ed3da05a39173b407a26c23748b14169", "score": "0.0", "text": "def add(transporter, data)\n endpoint_url = \"#{@api_url}/#{transporter}/add\"\n body = data\n RequestMaker.new(@api_user, @api_secret).send_post_request(endpoint_url, body)\n end", "title": "" } ]
[ { "docid": "4a54c497c123deec82953b7247690136", "score": "0.6851714", "text": "def add(package)\n @packages << package\n end", "title": "" }, { "docid": "f2faf1261e6387ab72f5c77a239abbb4", "score": "0.65984446", "text": "def _add_to_group(group, gems_code)\n # convert...
a85cfca8cbc8fd337e534684739bcd2b
DELETE /places_interests/1 DELETE /places_interests/1.json
[ { "docid": "b71d966bcb272bd8e4186cf37a97372b", "score": "0.794088", "text": "def destroy\n @places_interest = PlacesInterest.find(params[:id])\n @places_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to places_interests_url }\n format.json { head :no_content }\n ...
[ { "docid": "158f376b5b9cfe328c4e14032648cd77", "score": "0.7435881", "text": "def destroy\n @interest_place.destroy\n respond_to do |format|\n format.html { redirect_to interest_places_url, notice: \"Interest place was successfully destroyed.\" }\n format.json { head :no_content }\n e...
9d17ab106c60279a2d87291be7a1da6e
Method: tableAliasGen Remember a table alias when it is created. Method remembers any table alias that is generated in a FROM clause and puts it into the probe private metadata.
[ { "docid": "a6a40c0c67ec0af1ece3524d783c8467", "score": "0.7344085", "text": "def tableAliasGen(theTree)\n # theTree.myText = \"ta_#{theTree.object_id}\"\n theTree.myText = @metadata.getAlias\n # theTree.probeData[:tableAliases].push(theTree.myText)\n end", "title": "" } ]
[ { "docid": "4f308509cfe127f2e51189b71af57114", "score": "0.70008856", "text": "def aliased_table; end", "title": "" }, { "docid": "f823696d91127b7cfbe82499fa3e8051", "score": "0.6987026", "text": "def table_alias_for(table_name); end", "title": "" }, { "docid": "539313d54...