query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
5d5120363d34284c1a9a12babd9b7c4b
load_and_authorize_resource before_filter :load_permissions GET /payment_reqs GET /payment_reqs.json
[ { "docid": "4404291ac0e56cc6ec367ff3da161dfa", "score": "0.0", "text": "def index\n @payment_reqs = PaymentReq.all\n end", "title": "" } ]
[ { "docid": "c48fb6cca3ab2b869f58736cee4d7c43", "score": "0.6774769", "text": "def load_permissions_then_authorize_resource(*args)\n authorize_resource(*args)\n before_action(:load_permissions, *args)\n end", "title": "" }, { "docid": "3c92b7cfbea436530be42e0af303795d", "score": "0...
2b3126b68eba34b050867a91a2dcfb70
POST /generaljournals POST /generaljournals.json
[ { "docid": "0a48854c23b653beaba715adad9828d7", "score": "0.64227307", "text": "def create\n @generaljournal = Generaljournal.new(params[:generaljournal])\n\n respond_to do |format|\n if @generaljournal.save\n format.html { redirect_to @generaljournal, notice: 'Generaljournal was succes...
[ { "docid": "1b1d21d3440999b2b523c100156e77f9", "score": "0.6313402", "text": "def create\n @journaal = Journaal.new(journaal_params)\n\n respond_to do |format|\n if @journaal.save\n format.html { redirect_to @journaal, notice: 'Journaal was successfully created.' }\n format.json...
aa61d4fcd9ff0e62d993b10353be2909
This displays information about a system
[ { "docid": "7377d332c913e94ff27efc8b2e9937d7", "score": "0.0", "text": "def the_system\n puts \"The #{system} system contains: \"\n @planet.each_with_index do |planet, i|\n puts \" #{planet}\"\n end\nend", "title": "" } ]
[ { "docid": "f5c20870365fd6d2ea958ec776bcf351", "score": "0.77575624", "text": "def show\n render_meta ::System::Information.call\n end", "title": "" }, { "docid": "38a9c41ef09afe2fb0e43d038d148f9c", "score": "0.74911845", "text": "def getinfo\n\tbegin\n\t\tprint_s...
5aef5bcfa5d73fce01f638fefe7e604e
Load Rails runner and invoke the registered hooks. Check Rails::Railtie.runner for more info. source://railties/7.0.4/lib/rails/engine.rb455
[ { "docid": "99646e26d489fcdc759eebcef4df92d9", "score": "0.60859597", "text": "def load_runner(app = T.unsafe(nil)); end", "title": "" } ]
[ { "docid": "57f756cf683f80f385d98e84e7cc487e", "score": "0.61599684", "text": "def runner(environment)\n runcmd \"ruby script/rails runner '#{yield}'\", Dir.pwd, true, 'Gemfile', {'RAILS_ENV' => environment}\n end", "title": "" }, { "docid": "70e07724e537f86de18b885423ac5f28", "score...
da2a2794e05a343613a560c1803f00c7
GET /websites/1 GET /websites/1.json
[ { "docid": "a20ea4118ea40c977446e16529885966", "score": "0.0", "text": "def show\n\n set_meta_tags og: {\n title: @website.name,\n description: truncate(@website.memo, :length => 300, :separator => /\\w/, :omission => \"…\"),\n image: root_url[0..-2] + ActionController::Base.h...
[ { "docid": "bb483f2b4fd0635a9277f89362d62b17", "score": "0.75588995", "text": "def index\n @websites = @website_user.websites\n render json: { websites: @websites }\n end", "title": "" }, { "docid": "9670e6dddf3e1782e2a1d4b2c21c45a4", "score": "0.73374987", "text":...
0d9a64c87fdf9d6d8cbdd399743cd7fb
Render JSON to pass to chartkick for uptodate statistics
[ { "docid": "2c525c6e0564584c0ff1048c20099267", "score": "0.0", "text": "def new_users\n render json: User.group_by_day(:created_at).count\n end", "title": "" } ]
[ { "docid": "7a3bd381c3a27de691bdcfffe1e3e28e", "score": "0.68609375", "text": "def report_json\n r={}\n exclude=[\"date\", \"_id\", \"reporter_mongo_id\", \"general_day_points_hash\", \"general_day_points_variation\"]\n #precreate empty arrays\n DayReport.keys.keys.each do |k|\n r[k]=[] unless ex...
0b6483cc344eb03ed230e815231e0a0d
PUT /admin/bounties/1 PUT /admin/bounties/1.json
[ { "docid": "550a4b2811339849a4bbc7d36158912c", "score": "0.68833536", "text": "def update\n @bounty = Bounty.find(params[:id])\n\n respond_to do |format|\n if @bounty.update_attributes(params[:bounty])\n format.html { redirect_to admin_bounties_path, notice: 'Bounty was successfully up...
[ { "docid": "60c6e90964eaab1b117f5a24484329b5", "score": "0.6277494", "text": "def update\n @bounty = Bounty.find(params[:id])\n\n respond_to do |format|\n if @bounty.update_attributes(params[:bounty])\n format.html { redirect_to admin_bounty_path, notice: 'Bounty was successful...
0383d3cb31192431b6f472ff0f32d7cd
Does everything that is to be done when the Button is held down.
[ { "docid": "88cece7e62c54fe3fcd3ffd1997c57da", "score": "0.74596924", "text": "def held\n\t\tcall_existing(@callbacks, :held)\n\t\t@pressed_previously = true\n\tend", "title": "" } ]
[ { "docid": "e440f212e7f49b220b2dadb2370f134a", "score": "0.74474925", "text": "def down\n\t\tcall_existing(@callbacks, :down)\n\t\t@pressed_previously = true\n\tend", "title": "" }, { "docid": "36a3710febc7b35e9a4558013f40a219", "score": "0.7296359", "text": "def toggle_pressed\n ...
842e089a3162b7e42d1cdd93e5129256
GET /user_data GET /user_data.json
[ { "docid": "2b64657884c436b4368237aa1b1a9fde", "score": "0.6868659", "text": "def index\n @user_data = UserData.all\n end", "title": "" } ]
[ { "docid": "64d4b9d581a78e5b32718de7b68bab6c", "score": "0.7583229", "text": "def user_data\n unless @user_data\n begin\n user_data = get('/user-data')\n @user_data = user_data\n rescue RestClient::ResourceNotFound\n end\n end\n @user_data\n end",...
c610f37771a1b12f0ff75047ce0e86df
So you will book a flight for you and your girlfriend and try to leave all the mess behind you. You will need a rental car in order for you to get around in your vacation. The manager of the car rental makes you some good offers. Every day you rent the car costs $40. If you rent the car for 7 or more days, you get $50 ...
[ { "docid": "712ccfd0cd550b892fd3f67005412be5", "score": "0.6748404", "text": "def rental_car_cost(d)\n total = d * 40\n\n if d >= 3 && d < 7\n total - 20\n elsif d >= 7\n total - 50\n else\n total\n end\nend", "title": "" } ]
[ { "docid": "edde79bb0b096d4997cce4d7f838ac7f", "score": "0.75221676", "text": "def total\n number_of_days_rental = end_date - start_date\n daily_rate = car_category.daily_price\n\n number_of_days_rental * daily_rate\n end", "title": "" }, { "docid": "a20e57e7210112a4c081d45b0b73542...
c5d2e5a71683bf52d3a7e79610ca7b0a
POST /projects POST /projects.json
[ { "docid": "9ff42a940b22a8117cfbc13557ade2d1", "score": "0.0", "text": "def create\n respond_to do |format|\n if @project.save\n flash[:notice] = 'Project was successfully created.'\n @changed << @project.id\n \n format.html { redirect_to projects_path }\n form...
[ { "docid": "5b64ba9f9faea58bb5af65892c2ea3db", "score": "0.7589564", "text": "def post_new_project\n self.class.params\n options = {:body =>{:project=>\n {:title => @@params[\"title\"],\n :description => @@params[\"description\"]}}}\n self.class.post(\"/projects.json\", opti...
6ec8cc7e2e9dc5e39a1a32fc46dba006
Return the order of my attributes
[ { "docid": "cc96ac5658dcff465fd813001f375573", "score": "0.88921595", "text": "def attribute_order; @_attribute_order; end", "title": "" } ]
[ { "docid": "8b1c4b0b91fc84a47fa9a008eda6e1e0", "score": "0.8257327", "text": "def attrs_to_orderings(order)\n order.map do |o|\n Arel::Attribute === o ? o.asc : o\n end\n end", "title": "" }, { "docid": "2b3878fcadc0ba2271e41bb0fc4fc5c7", "score": "0.7...
0db8a953d67fafb7f55e15fcb222f872
Instantiates a new accessPackageResource and sets the default values.
[ { "docid": "e3ee41dcc4c16d810f48d9d372dbee77", "score": "0.0", "text": "def initialize()\n super\n end", "title": "" } ]
[ { "docid": "02b2cb2fe4085a304738f7805841e96d", "score": "0.6422035", "text": "def initialize()\n super\n @odata_type = \"#microsoft.graph.accessReviewInstanceDecisionItemAccessPackageAssignmentPolicyResource\"\n end", "title": "" }, { "docid": "d2a1f7...
f260b0743e3635ff851ba1fb8f391b00
GET /users/1 GET /users/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "9f7c735ace683c5c2b12c914cc9ad8a8", "score": "0.771752", "text": "def get\n users = User.all.as_json\n render(json: users.as_json, status: :ok)\n end", "title": "" }, { "docid": "a95dfe28d6b386aafc5fb53749e84258", "score": "0.75107867", "text": "def user\n...
66b0050840d529af2f669ffe91e43aee
Gets grouping data for fastq.gz files
[ { "docid": "74d113fb532f1a268adbf5eefd702812", "score": "0.69093525", "text": "def group_fastq_files starting_path, output_path, options = {:prefix => \"s_\", :suffix => \".fastq.gz\", :exclude_undetermined => true}\n execute \"mkdir -p #{output_path}\"\n fastq_groups = []\n\n fastq_files...
[ { "docid": "d88dab94133821e9af5aae2fe58efb92", "score": "0.6620108", "text": "def filter_fastq_files fastq_groups, output_path\n\n log \"# Creating path: #{output_path}\"\n execute \"mkdir -p #{output_path}\"\n\n fastq_groups.each do |group|\n command = \"zcat #{group[:path]} | #{F...
ccd6b6f946a5a9354b4ab96a78dc7342
GET /page/search?q=bananas GET /page/search.json?q=bananas
[ { "docid": "ab4996a5b926fe3803f772e2f4e0d606", "score": "0.0", "text": "def search\n @pages = Page.search(\n @search_query,\n fields: [\"title^3\", \"contents\"],\n misspellings: { below: 3, distance: 2 },\n routing: [current_team.id],\n track: { user_id: current_us...
[ { "docid": "7a056b944430c7958c59d377ebaddc09", "score": "0.7252547", "text": "def search\n search_query = params[:q]\n # TODO: search comments here\n # This is a collection route, so:\n # - we don't need a resource id\n # - we should return a collection\n head :ok # just return 200 OK ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "d7761e8aede770a607a7f9f60b80e054", "score": "0.0", "text": "def merchant_params\n params.require(:merchant).permit(:first_name,:last_name, :version_comments,:email_address,:phone_number, :modifier_id, :age,:sex,:business_name,:business_type,:industry_type,:subscription_date,:business_addr...
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6979893", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781746", "text": "def strong_params\n params.requi...
7e8ae7421045e861c6e7e4b0b76d7473
Set the variables for a training request link on general ledgers
[ { "docid": "e9fa48c37fcec8d7de2b6e69dca569c1", "score": "0.72958016", "text": "def configure_training_request\n available_ledgers :training_request\n set_training_request\n end", "title": "" } ]
[ { "docid": "9268bff43ead195193977a487e49ffd5", "score": "0.5914834", "text": "def set_training_request\n @training_request = TrainingRequest.includes(:assigned_to_user, :requested_by_user, :general_ledgers).find(params[:id])\n end", "title": "" }, { "docid": "d8c27a5999a6a176b28b3b6a5b1b...
85553b6a504045e1f266bc6cd38d572e
Publishes the current bottle files for a given formula to Bintray
[ { "docid": "d652a77f282028d8ceee18ed43824bee", "score": "0.6736135", "text": "def publish_bottle_file_on_bintray(f, bintray_org, creds)\n repo = Utils::Bottles::Bintray.repository(f.tap)\n package = Utils::Bottles::Bintray.package(f.name)\n info = FormulaInfoFromJson.lookup(f.full_name)\n if...
[ { "docid": "c835d22c4229fd9f4901461cd39bcc50", "score": "0.62279314", "text": "def verify_bintray_published(formulae_names)\n return if formulae_names.empty?\n\n if ENV[\"HOMEBREW_DISABLE_LOAD_FORMULA\"]\n raise \"Need to load formulae to verify their publication!\"\n end\n\n ohai \"Ver...
eb800d62893e58d154bc0ea5a897e69c
DELETE /point_submissions/1 DELETE /point_submissions/1.json
[ { "docid": "3f07a83df218731e70ed10f84cafdf61", "score": "0.75673044", "text": "def destroy\n @point_submission.destroy\n respond_to do |format|\n format.html { redirect_to point_submissions_url, notice: 'Point submission was successfully destroyed.' }\n format.json { head :no_content }\n...
[ { "docid": "0f52bc5f637a84e447fedcd897d05c07", "score": "0.71619976", "text": "def destroy\n @submission.destroy\n respond_to do |format|\n format.html { redirect_to submissions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0f52bc5f637a...
db5d1d3bd13af82b6788a11fdddaec0f
GET /pre_sales/1 GET /pre_sales/1.json
[ { "docid": "4eb6c197a830177e0cb2c212353fc47c", "score": "0.7134051", "text": "def show\n @pre_sale = PreSale.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pre_sale }\n end\n end", "title": "" } ]
[ { "docid": "51e7ba337541b1d001c682f5f1743e89", "score": "0.7665141", "text": "def index\n @pre_sales = PreSale.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pre_sales }\n end\n end", "title": "" }, { "docid": "28a35690fa2b388a...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "6e86f0e36c5f728260188bf2554f9014", "score": "0.0", "text": "def set_turkey\n @turkey = Turkey.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6164095", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6046031", "text": "def action_hook;...
9ef0526943f1dc2688ad135869870098
Retrieves a new instance of a Savon client that has been correctly configured for sending requests to the Reuter's API.
[ { "docid": "54a2f9faa357c1e01f6840ac9b9a9165", "score": "0.7345214", "text": "def client\n Savon.client options\n end", "title": "" } ]
[ { "docid": "74cb86c694a2d389b9fcea124b13ab22", "score": "0.76060516", "text": "def get_client\n config.client.new(self)\n end", "title": "" }, { "docid": "c4bf56f796eea1c47db2d7beefc5baa4", "score": "0.75893736", "text": "def client \n @client ||= Savon::Client....
8cdf322edd00cb74007a30f8c4abec57
reports the current dog's name
[ { "docid": "f8dae1ba8ffb28d46cfe9029c99e6c27", "score": "0.8430849", "text": "def name\n @this_dogs_name\n end", "title": "" } ]
[ { "docid": "5920d5b3765df66801fe86b02b34d0c9", "score": "0.8525094", "text": "def name \r\n @this_dogs_name\r\n end", "title": "" }, { "docid": "c07d74a4713b1c120219c1fa3111f522", "score": "0.8397418", "text": "def name\n @this_dogs_name\n end", "title": "" ...
ebeb1b3364551a90f49fd86eaaa04636
GET /client_codes/1 GET /client_codes/1.json
[ { "docid": "95a78314734968e2092541b11c5a9391", "score": "0.0", "text": "def show\n is_admin?\n end", "title": "" } ]
[ { "docid": "744c04e030d3e239e70011f1b4a64d85", "score": "0.70400095", "text": "def find_by_code(client_code)\n json = client.get(\"clients/find-by-code.json\", {client_code: client_code})\n Invoicexpress::Model::Client.new(json[\"client\"])\n end", "title": "" }, { "docid"...
3d06c7497ba1680e90cc5d7ab4088d8c
Responds with a map of any number of post and/or picture locations. Parameters:: post_location_ids, picture_location_ids Route:: /map/:post_location_ids/:picture_location_ids
[ { "docid": "8a293eebc62ab472e3d60094b71e92cc", "score": "0.7642302", "text": "def map\n @post_locations = []\n @picture_locations = []\n \n unless params[:post_location_ids].blank?\n \n # Pass through each comma-delimited post location id\n params[:post_location_ids].split(','...
[ { "docid": "afb90b9ee489f2a71f530519d4ae4e74", "score": "0.6984324", "text": "def map_image_tag(post_locations, picture_locations, width, height, place = false, country = false)\n \n # Initialise strings\n markers = 'markers='\n center = ''\n post_location_ids = ''\n picture_location_i...
b430803d595760b269d75780be0fce9b
GET /courses GET /courses.json
[ { "docid": "892cf81b4231472656c7b4989ccd8851", "score": "0.0", "text": "def index\n items_per_page = 20\n if params[:grade]\n @courses = Course.with_grade_level(params[:grade]).paginate(page: params[:page], per_page: items_per_page)\n @grade = GradeLevel.where(id: params[:grade])\n el...
[ { "docid": "a838fe5d49d472323c17c5c6d99876d9", "score": "0.7943173", "text": "def index\n\t\t@courses = Course.all\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render json: @courses }\n\t\tend\n\tend", "title": "" }, { "docid": "3ca604c092fdc8952e08fa129e639cbe", "...
3e74b43777ff9a97576b253cbc006147
test the different forms of structure name all return the right structure and invalid names fail
[ { "docid": "367239c622d7c6662be3fde218beb972", "score": "0.61515373", "text": "def test_structures_method_struct_get\n structures = ['Microformats::Structures::HCard', :h_card, \"HCard\", \"h_card\"]\n structures.each do |structure|\n assert struct_class = Structure.get(structure),\n \...
[ { "docid": "3fedfa5d5a2ca9f049ca1d2bd94c0736", "score": "0.6438495", "text": "def validate_name_parts\n name_part_types.each do |type|\n next if send \"valid_#{type}?\"\n errors.add type, \"valid #{type} required\"\n end\nend", "title": "" }, { "docid": "3d520fcacf148d17bd2f074c812dd...
6359f1672a1af0f60da212f8a3bdae27
Internal The class that holds the default interaction
[ { "docid": "37558bbd14590c325e00032a575b9099", "score": "0.69868016", "text": "def default_interaction\n Whatever\n end", "title": "" } ]
[ { "docid": "0ced5dae1da88f88690fd4fa49ed8722", "score": "0.65554696", "text": "def interactions \n normal_interactions << default_interaction\n end", "title": "" }, { "docid": "6a6ed5368f43a25fb9264e65117fa7d1", "score": "0.6422861", "text": "def internal; end", "title": "" ...
6ff197478aba444062b9808af3653cfe
load_element For loadable attributes of this element type (self.custom_form_element_type), dynamically create accessor methods to read these attributes. Examples include fetching the classes of the element, or the options for a select box.
[ { "docid": "7e077c6199c24a8543d00c1caa8eedda", "score": "0.6334409", "text": "def load_element\n accessors = self.class.config.accessors\n readers = self.class.config.readers\n\n accessors.each do |key|\n build_read_method(key, self.class.config.accessor_db_key(key), self.class.config.acce...
[ { "docid": "1ff8d515f7ec6060549c95eee0bd04f3", "score": "0.62445456", "text": "def method_missing(method, *args, &block)\n if base_elements.include?(attributize(method))\n self.class.send :attr_accessor, attributize(method)\n send method, *args, &block\n e...
7b713d1606defe91e232c931960d7805
Base implementation does nothing worthwhile, you should override this in your own implementation.
[ { "docid": "17313e62e1b6b620ca4d1404217cdbf2", "score": "0.0", "text": "def perform config={}\n while\n log(\"[#{name}] Djinn is running.. and doing nothing worthwhile.\")\n sleep(5)\n end \n end", "title": "" } ]
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.7748716", "text": "def private; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.7167915", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a...
e9eb09763fdc94060e06e5e7f16e8083
GET /wechatinfos GET /wechatinfos.json
[ { "docid": "3cdea0883b0e60439b12f5e1f3be526b", "score": "0.7563598", "text": "def index\n @wechatinfos = Wechatinfo.all\n end", "title": "" } ]
[ { "docid": "ff0ed82bf004bc29487d44a5c448c9c6", "score": "0.7050209", "text": "def fetch_chat_info\n res = @api.get(\n \"#{@base_uri.path}/wikia.php?#{URI.encode_www_form({\n :controller => 'Chat',\n :format => 'json'\n })}\", @headers)\n # @type [Hash]\n da...
f4382ce34311c10945fbf263bd89b233
Finds all members of the given type that are part of this namespace. Attention: Due to the workings of SPARQL this will retrieve all elements that match the type and filter them. Thus it's advised to use this only for types of which only a few elements are known to exist (e.g. Onotology classes)
[ { "docid": "48af9e684f3cd93c4e838419fa24a951", "score": "0.6452113", "text": "def elements_with_type(type, element_type = N::URI)\n return unless(rdf_active? && is_iri?)\n qry = ActiveRDF::Query.new(element_type).distinct.select(:s)\n qry.where(:s, RDF.type, type)\n qry.regexp(:s, \"...
[ { "docid": "1ef2de167b147b45331456d1ebaef661", "score": "0.648759", "text": "def elements_by_type(type)\n\t\treturn xpath('//' + type)\n\tend", "title": "" }, { "docid": "acbae8aa509af87f510e791eeb989b6e", "score": "0.6031229", "text": "def find_type_elements(type, nested = T.unsafe(...
beff6058d417490ef5aa4afca6ee166c
I think digits reorders the digits however. Further exploration: rewrite with Integerremainder
[ { "docid": "b649d693f4df497dab017327933b8e70", "score": "0.0", "text": "def is_odd?(num)\n if num == 0 ||num.remainder(2) == 0\n false\n else\n true\n end\nend", "title": "" } ]
[ { "docid": "25dde6c25ca55e283979be7e15ab45de", "score": "0.6909969", "text": "def reverse_digits(int)\n \nend", "title": "" }, { "docid": "a5eb3d36cacbda78f44dd63225f93af0", "score": "0.6853637", "text": "def rotate_rightmost_digits(int, position)\n int_arr = int.digits.reverse\n ...
5d5b3006b3daad8b1842e2b2bf37f6f3
initialize Setup our OAuth connection here and make attr_accessible
[ { "docid": "d1970c2acb2fba10fba710141716af60", "score": "0.70161706", "text": "def initialize consumer_key, consumer_secret, company_alias \n # Catch invalid parameters\n raise ArgumentError if consumer_key.nil? || consumer_secret.nil? || company_alias.nil?\n \n # Create the OAu...
[ { "docid": "7fe20cc178e2a478f027bf5bf4f92471", "score": "0.7462985", "text": "def initialize\n @api_key = ''\n @consumer_key = ''\n @consumer_secret = ''\n @oauth_token = ''\n @oauth_secret = ''\n end", "title": "" }, { "docid": "7c79975ff776afc30561db7fca427ea9",...
b1cf6f0123db470197e0f145b6219329
Return a new array of only the even numbers from the input Use recursion
[ { "docid": "afb0fb30f353727d1e562eec227788ea", "score": "0.0", "text": "def select_even(integers)\n\nend", "title": "" } ]
[ { "docid": "4f748db49274f85abb81459309c0bb8e", "score": "0.7840809", "text": "def even_numbers(num_array)\n\n\tnum_array.select! do |num|\n\t\tnum % 2 == 0\n\tend\n\n\tnum_array\n\nend", "title": "" }, { "docid": "3add79ca0370b6e72440d5750b7b9de4", "score": "0.77724886", "text": "def...
382b4c0873323fb0051f17eea92a5b2e
execute load data return data is equal to :children
[ { "docid": "435e6025138aa0dcb4fcd9189a36def4", "score": "0.77576625", "text": "def load_data\n all_loader.each { |l| load_data_by_schema_loader(l) }\n children\n end", "title": "" } ]
[ { "docid": "5147bda248a9975b75a49e5ed1e7032e", "score": "0.66975105", "text": "def load_children(id, m)\n end", "title": "" }, { "docid": "050e0a6fff9b0bba51b5e4d56b7a86a5", "score": "0.6653812", "text": "def load_children(id, order)\n # We don't really need to keep the...
3ab356ebf8e38cb47be22d296563ad16
Public: Verifies that the given input query was not logged. input SQL query Returns nothing.
[ { "docid": "5a689c1545157eba239818d3140558b0", "score": "0.8225725", "text": "def should_not_log_query(input)\n queries = sql(input)\n\n expect(queries).to be_empty\n\n valid_output = sql(\"SELECT 1\").any? { |line| line.include? \"SELECT 1\" }\n\n expect(valid_output).to eq(...
[ { "docid": "dbdaf067e8cc0d2ba0ce25a37a5c036f", "score": "0.73106706", "text": "def should_log_scrubbed_query(input:, output:)\n queries = sql(input)\n\n expect(queries.join(\"\\n\")).to_not include(input)\n expect(queries.join(\"\\n\")).to include(output)\n end", "title": "...
736353550222d5698ac568849b0d5cdb
GET /admin_users GET /admin_users.json
[ { "docid": "1e5eeee918174251b8d2c756f7be5d4c", "score": "0.0", "text": "def index\n @admin_users = AdminUser.includes(set_includes).all\n if params['status'] == 'enabled'\n @admin_users = @admin_users.where(enable: true)\n end\n @admin_users = @admin_users.order(order_by).limit(limit).o...
[ { "docid": "543509c6588e2f79a8dbcd1cdcdaf7b9", "score": "0.7746001", "text": "def users\n try_json get('/user')\n end", "title": "" }, { "docid": "430706e49237e520d33d6c2eaffa95b2", "score": "0.76511663", "text": "def index\n set_users_for_admin\n\n respond_to do |forma...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "57b03675309362f1a3900fabaabad3df", "score": "0.0", "text": "def set_myticket\n @myticket = Myticket.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
fb2558d193996ba24106a55505e498f4
returns array of student names
[ { "docid": "9ca37d9071d68a6db3d3226d8f660f1f", "score": "0.6912178", "text": "def get_student_names\t\n\t\tstudents = html.search(\"h3\").collect do |h3|\n\t\t\th3.text\n\t\tend\n\t\t# ALTERNATE METHOD USING REGEX: ?<= is look behind and ?= is look ahead. it splits in between these\n\t\t# students = htm...
[ { "docid": "ac80c2a162c89df3af723a3f14802210", "score": "0.81229633", "text": "def student_names\n students.map { |student| student.name }\n # binding.pry\n end", "title": "" }, { "docid": "266904871068ed0340e463ffacec6f4e", "score": "0.72318876", "text": "def my_stu...
cea479666988bd07485f79fde6bb603a
example: a = AltGlyph.new a.externalResourcesRequired=val print a =>
[ { "docid": "d521884e0dd2d40c2f45de701bccee02", "score": "0.0", "text": "def externalResourcesRequired= value\r\n value = value.to_s\r\n @attributes['externalResourcesRequired'] = value\r\n value.to_number\r\n end", "title": "" } ]
[ { "docid": "f7f8bb126f3ebdf9fe91a01eb653eacb", "score": "0.57317156", "text": "def glyphs_task(style, language)\n \"glyphs:#{style}:#{language}\"\nend", "title": "" }, { "docid": "8fb768f3033a09174dd619ef09be51d8", "score": "0.5413972", "text": "def display(resource, given_options =...
5a1ce49bc3e35241029acb2c947c2931
Allows executing any code having Protector globally disabled
[ { "docid": "984f2c9ca5c7a994f8524111530e0db5", "score": "0.5497863", "text": "def insecurely(&block)\n Thread.current[:protector_disabled_nesting] ||= 0\n Thread.current[:protector_disabled_nesting] += 1\n\n Thread.current[:protector_disabled] = true\n yield\n ensure\n Thread...
[ { "docid": "0aefc82232712c446aa1f6c8296b2537", "score": "0.6740259", "text": "def exec_enabled_check!\n end", "title": "" }, { "docid": "9703f906be05d4b858742395c6a0c384", "score": "0.62521535", "text": "def enable_pry\n return if Rails.env.production?\n\n ENV['DISABLE_PRY...
3dbebe1efa53ba27ba0368406a1af2f4
Accepts an optional set of database options If no options are provided, attempts to read options from config/database.yml If config/database.yml doesn't exist, Dotenv is used to try to load a .env file, then uses any SEQUELIZER_ environment variables as database options
[ { "docid": "dcdb43aa604ca4b3cb11f9af78048595", "score": "0.0", "text": "def initialize(options = nil)\n @options = Options.new(options)\n end", "title": "" } ]
[ { "docid": "1e25878f681a2f2616c1286a87aab5fd", "score": "0.70631367", "text": "def load_database_config\n read_db_yaml_file[env]\n end", "title": "" }, { "docid": "2b4b9c9d0a5f224b6425cc6d8d454696", "score": "0.6833353", "text": "def database_config(env, options)\n if option...
200e8d3a9a7ee0ae934b94e4d58b6ae1
update staffnote only (by the staff)
[ { "docid": "e5733a5f94984b368e8c55bcea9a03f9", "score": "0.71891016", "text": "def update_staffnote\n @comment = Comment.find(params[:id])\n @comment.staff_note = params[:comment][:staff_note]\n respond_to do |format|\n if current_user.role < 4\n if @comment.save\n format.j...
[ { "docid": "0b3e94a742e94f13f27c978f087a3e7f", "score": "0.7279848", "text": "def update_staffnote\n @document = Document.find(params[:id])\n @document.staff_note = params[:document][:staff_note]\n respond_to do |format|\n if current_user.role < 4\n if @document.save\n form...
2618cc068541fe644265569b57c03e02
PATCH/PUT /medicins/1 PATCH/PUT /medicins/1.json
[ { "docid": "af8ead8ca78160f2c19d10ceff0d18cb", "score": "0.71251243", "text": "def update\n respond_to do |format|\n if @medicin.update(medicin_params)\n format.html { redirect_to @medicin, notice: 'Medicin was successfully updated.' }\n format.json { render :show, status: :ok, loc...
[ { "docid": "fc84ddb5e0d0a20a84a5d4da5d1598be", "score": "0.7059467", "text": "def update\n @medic = Medic.find(params[:id])\n\n respond_to do |format|\n if @medic.update_attributes(params[:medic])\n format.html { redirect_to @medic, notice: 'Medic was successfully updated.' }\n ...
54f23f093048a3a9ffad935c825d364f
given the params from the new form 1) pull out the username and password info from params 2) find the user associated with the info a) if found: login the user (set session tokens equal) and redirect to show page b) if not found: redirect to signin page again
[ { "docid": "54ee405085e4ea1e45ad9f0b113ef3a4", "score": "0.0", "text": "def create \n username = params[:user][:username]\n password = params[:user][:password]\n\n user = User.find_by_credentials(username, password)\n if user \n login!(user)\n flash[:success] = \"Log In Successful!...
[ { "docid": "869c808b93539e32c656e59509200055", "score": "0.75771827", "text": "def post_login\n \tbegin\n\t @user = User.find_by_login!(params[:login]) #throws error if not found\n\t if @user.password_valid?(params[:password])\n \t session[:userid] = @user.id\n\t session[:username] = @user.l...
92105f9cd6e569378fade5bbbca24735
Converts all of the keys to strings
[ { "docid": "c815d7c984b61d8d103482e11ae80a3d", "score": "0.67962474", "text": "def stringify_keys!\n keys.each{|k| \n v = delete(k)\n self[k.to_s] = v\n v.stringify_keys! if v.is_a?(Hash)\n v.each{|p| p.stringify_keys! if p.is_a?(Hash)} if v.is_a?(Array)\n }\n self\n end", ...
[ { "docid": "683488141e3f0b34d5a8fde137ff36a9", "score": "0.86515605", "text": "def stringify_keys\n transform_keys{ |key| key.to_s }\n end", "title": "" }, { "docid": "8c7110ec6b640bb72355a8bb4f15a703", "score": "0.85960007", "text": "def stringify_keys\n transform_keys { ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "38d99707e9843add4ca22b05248ec28b", "score": "0.0", "text": "def set_calllog\n @calllog = Calllog.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;...
cce6c18360a4ca9675d1bba9c1999d0d
Update Elements (columns) to Display
[ { "docid": "27234bdc96b59c852fb4c0f66498f016", "score": "0.0", "text": "def post_elements\n programme_id = params[:programme][:id]\n ProgrammeElement.destroy_all ['programme_id = ?', programme_id ]\n logger.info(\"programme=#{programme_id}\");\n logger.info(params.inspect);\n \n...
[ { "docid": "d2b300e1daa64b8143d62d64e62603b9", "score": "0.6328713", "text": "def display\n\t\tdisplay_headers\n\t\t@rows.each do |row|\n\t\t\tdisplay_row(row)\n\t\tend\n\tend", "title": "" }, { "docid": "9c1ee204ed25d9454eef2d1d475a1a4f", "score": "0.61280394", "text": "def update_v...
e56b7e61598c39f87cbc368c8cffab5b
This method should accept as its argument an array of contacts and display each contact in the contacts array
[ { "docid": "4bce3bd72870f6ef82212593516932d0", "score": "0.80125505", "text": "def display_contacts(contacts)\n # Fill this in\n # HINT: Make use of this method in the display_all_contacts and search_by_attribute methods\n\n list = contacts\n list.each do | contact |\n\n puts \"ID: ...
[ { "docid": "577d0259380dce131d7a781813c0440c", "score": "0.8686138", "text": "def display_contacts(contacts)\n contacts.each do | contact |\n puts \"ID #{contact.id} #{contact.full_name} #{contact.email} #{contact.note}\"\n end\n end", "title": "" }, { "docid": "a2ccb51743e...
a81c0f6721023433481173d9a2aa9de9
Gets the detailTemplate as rendered This will take the `detailTemplate` from the event template and return an object rendering the specified event. If the template references `extraData` that isn't found in the event, it will be ignored and we'll render without it.
[ { "docid": "bdcdb6674623278f89f2a02d06446a62", "score": "0.62017894", "text": "def get_detail_by_id(event_template_id, event_id, opts = {})\n data, _status_code, _headers = get_detail_by_id_with_http_info(event_template_id, event_id, opts)\n data\n end", "title": "" } ]
[ { "docid": "ebe6873dcf4da93d0f9d2f5e6ed38b12", "score": "0.62160885", "text": "def event_detail\n return @event_detail\n end", "title": "" }, { "docid": "ebe6873dcf4da93d0f9d2f5e6ed38b12", "score": "0.62160885", "text": "def event_detail\n ret...
adafb0ad8d44c81ace561a2d0e502e4e
PATCH/PUT /assignfeedback_editpdf_quicks/1 PATCH/PUT /assignfeedback_editpdf_quicks/1.json
[ { "docid": "f85e30db7927cacca2c50d09577c98ae", "score": "0.7563714", "text": "def update\n respond_to do |format|\n if @assignfeedback_editpdf_quick.update(assignfeedback_editpdf_quick_params)\n format.html { redirect_to @assignfeedback_editpdf_quick, notice: 'Assignfeedback editpdf quick...
[ { "docid": "821c5d19aec28c2f452d71e940a777f9", "score": "0.7105333", "text": "def set_assignfeedback_editpdf_quick\n @assignfeedback_editpdf_quick = AssignfeedbackEditpdfQuick.find(params[:id])\n end", "title": "" }, { "docid": "c0851a1b31a4878c643637607fc5d1b7", "score": "0.6945...
ae8f9bef0913941ba67784dbf29fe73b
A method we're giving you. This "flattens" Arrays of Arrays so: [[1,2], [3,4,5], [6]] => [1,2,3,4,5,6].
[ { "docid": "ceaaad85fdba96b54ea36c2860ec6584", "score": "0.0", "text": "def flatten_a_o_a(aoa)\n result = []\n i = 0\n\n while i < aoa.length do\n k = 0\n while k < aoa[i].length do\n result << aoa[i][k]\n k += 1\n end\n i += 1\n end\n\n result\nend", "title": "" } ]
[ { "docid": "73a02dd2094c26c61a294b0c2ba932dd", "score": "0.81905866", "text": "def using_flatten(array_of_arrays)\n array_of_arrays.flatten \nend", "title": "" }, { "docid": "346a9c96c2781bfdf1f6bd9cd3ffede7", "score": "0.81878597", "text": "def using_flatten (arrays)\n arrays....
fe329e5fc9ef1db310c861a74657d43c
POST /trainings_sessions POST /trainings_sessions.json
[ { "docid": "b8c1c16d03839c0e1d5d6562db2ea59c", "score": "0.6897593", "text": "def create\n @trainings_session = TrainingsSession.new(params[:trainings_session])\n\t\t@trainings_session.owner = current_user if current_user\n\t\t@my_exercises = Exercise.liked_by(current_user.id).published\n\t\t\t.conca...
[ { "docid": "8e5e2f4b90a5ebae77e8d038d8f0ce92", "score": "0.7072686", "text": "def create\n @training_session = TrainingSession.new(params[:training_session])\n\n respond_to do |format|\n if @training_session.save\n format.html { redirect_to @training_session, notice: 'Training session ...
b318e4b27ac5fce50fa82fe00925d1f1
set name (author name) as secondary key
[ { "docid": "fbc89761ce6fbfc0c53eaec055714ee2", "score": "0.7854167", "text": "def set_author_name\n self.secondary_key = self.integration.gh_client.users.get(self.primary_key).name\n end", "title": "" } ]
[ { "docid": "a7ad231f3ea820848dde036a1ae0425d", "score": "0.7070914", "text": "def secondary_key\n name\n end", "title": "" }, { "docid": "5be33ec2c2be40e271a0a428c5c4b30d", "score": "0.6274464", "text": "def get_authors_key()\n return \"http://vivoweb.org/ontology/core#rel...
0d33dfa24006647fbdab48da3396fefc
Transforms this infinitelength Ruby integer into a fixedlength integer (represented in two's complement form) that has the given width (number of bits).
[ { "docid": "d85c17c31e9e9b7fba9766e14493fd95", "score": "0.59494287", "text": "def pack aPackedWidth\n bits = length\n bits += 1 if self > 0 # positive integers also have a sign bit (zero)\n\n unless aPackedWidth >= bits\n raise ArgumentError, \"packed width #{aPackedWidth} must be at leas...
[ { "docid": "fd23f5ed87a934caf186c1dc22432360", "score": "0.6423405", "text": "def fixed_int(value)\n sprintf(\"%c%c%c%c\", value >> 24, value >> 16, value >> 8, value & 0xff)\n end", "title": "" }, { "docid": "765b75d672d4ad7ddf0f034f162f5be5", "score": "0.63788897", "text": ...
a9f422bb31ac252e0834bd15e5885314
PUT /course_roles/1 PUT /course_roles/1.json
[ { "docid": "0a8591b10de279b7e1234cfe00f6ce33", "score": "0.72666043", "text": "def update\n respond_to do |format|\n if @course_role.update_attributes(params[:course_role])\n format.html { redirect_to course_roles_url, notice: 'Course role was successfully updated.' }\n format.json...
[ { "docid": "715271116eaa4a67f3cab8c29d0ae4ed", "score": "0.68816066", "text": "def update\n @role = @client.roles.find(params[:id])\n\n respond_to do |format|\n if @role.update_attributes(params[:role])\n flash[:notice] = 'Role was successfully updated.'\n format.html { redirect...
1a39f2268ac6d9a5cf9b1ec825caf188
looks up a array of possible snippets retruns a hash of snippetName, snippetValue pairs if snippetName not Symbol, ignores if snippetName not present, calls block if given, else exception
[ { "docid": "36994886c53a13b0adbfb842463f6405", "score": "0.630677", "text": "def find_snippets_or_croak(dictName, *snippetList, &snipBlok)\n eye = :f_snips\n eyeTale = 'FIND SNIPPETS'\n\n $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger_me(eye, eyeTale, \"dictName >#{dictName}< snippetList ...
[ { "docid": "2011fcd1d4ab2aead67052d3e04aa6d4", "score": "0.57971674", "text": "def findSnippets(args, &block)\n keyword = args.shift\n snippets = fetch(keyword)\n snippets = searchExactMatch(snippets, keyword)\n\n if snippets.length < 1\n error \"No snippets found for '#{keywo...
15d1455c17a9e3ff2d5b2073a3122fbb
reduce 63 omitted source://nokogiri//lib/nokogiri/css/parser.rb691
[ { "docid": "450134d0fd3a3d0bbe1758cc02e7f8bc", "score": "0.0", "text": "def _reduce_64(val, _values, result); end", "title": "" } ]
[ { "docid": "359e02a51f807b00bd8f680a13420e4d", "score": "0.68227035", "text": "def css_impl(_roots, _parsed)\n throw 'TODO'\n end", "title": "" }, { "docid": "6387c17aab7fbbef14a9cb2a65bfdb8e", "score": "0.6485097", "text": "def process(css, opts = T.unsafe(nil)); end", "titl...
ad903624a16442ab74689ba908d10c12
issues a command to svn
[ { "docid": "d7febfefc09f45b8f3a12a9762275eb0", "score": "0.77615345", "text": "def svn command\n output = `svn #{command} 2>&1`.chomp\n unless $?.success?\n raise RuntimeError, output\n end\n output\n end", "title": "" } ]
[ { "docid": "8321357deb1bc5425c01b31ca83d16c3", "score": "0.8008467", "text": "def svn_exec(cmd)\n logger.info \"SVN: #{cmd}\"\n system(\"cd #{svn_dir} && svn --username #{svn_config['user']} --password #{svn_config['pass']} #{cmd}\") unless dry_run\n end", "title": "" }, { ...
b75b9e03c2550a92ce2fb69efdccaa6a
increase priority of given handler/query
[ { "docid": "82803651b0f7f0ed420b70a25ae5cd00", "score": "0.6808514", "text": "def stress handler, query, priority\n\t\t\tQueueEntry.transaction do\n\t\t\t\treq = {\n\t\t\t\t\t:queue => @name,\n\t\t\t\t\t:handler => handler,\n\t\t\t\t\t:cquery => JSON.generate([query]),\n\t\t\t\t\t:locked => false\n\t\t\...
[ { "docid": "cca4588faad80b155049b9ecf4afe133", "score": "0.62955284", "text": "def priority(*) end", "title": "" }, { "docid": "f1cbbac7d673e114881047bba92a6232", "score": "0.61922103", "text": "def set_priority\n self.priority = 100\n end", "title": "" }, { "docid": ...
3d8ec9abf0c3816b4980444405320f2a
DELETE /entity_end_point_rels/1 DELETE /entity_end_point_rels/1.xml
[ { "docid": "dd707b3a64abf861378dde58e9c0df70", "score": "0.7948107", "text": "def destroy\n @entity_end_point_rel = EntityEndPointRel.find(params[:id])\n @entity_end_point_rel.destroy\n\n respond_to do |format|\n format.html { redirect_to(entity_end_point_rels_url) }\n format.xml { h...
[ { "docid": "46abd963e84e43d34ad0e738ac5d1b9a", "score": "0.62980604", "text": "def delete\n\t\tdb.execute{ \"delete edge #{ref_name} #{rrid}\" }\n\tend", "title": "" }, { "docid": "d2dabd860429b7dc9ad74f522e3e1ddb", "score": "0.6142012", "text": "def destroy\n @end_point = EndPoin...
dc0bc2de0a6b9e738370133da157a803
DELETE /articulos_agregados/1 DELETE /articulos_agregados/1.json
[ { "docid": "e94cc0e597d65a5f6d8e217a02f6dc73", "score": "0.7458536", "text": "def destroy\n @articulos_agregado.destroy\n respond_to do |format|\n format.html { redirect_to articulos_agregados_url, notice: 'Articulo agregado fue eliminado exitosamente' }\n format.json { head :no_content ...
[ { "docid": "4eadb61943fa9a636cad510bf21db1aa", "score": "0.7457492", "text": "def destroy\n @agronomiadecanato = Agronomiadecanato.find(params[:id])\n @agronomiadecanato.destroy\n\n respond_to do |format|\n format.html { redirect_to agronomiadecanatos_url }\n format.json { head :no_co...
406fd6e64638dfc929d5f6d6d2d61c15
Used for testing different stages
[ { "docid": "1447dc17db11d50be24a625c66c4eb32", "score": "0.0", "text": "def initialize()\n @tileset = Gosu::Image.load_tiles(\"media/tileset.png\", TILE_WIDTH, TILE_HEIGHT, tileable: true)\n\n # Load images here so they will only be loaded once per game\n @enemyAnimation = *Gosu::Im...
[ { "docid": "428b5d1eaf9535043f41374ccd294f0d", "score": "0.69570655", "text": "def test_steps; end", "title": "" }, { "docid": "428b5d1eaf9535043f41374ccd294f0d", "score": "0.69570655", "text": "def test_steps; end", "title": "" }, { "docid": "dc352681b65af80bf219f2beb34b...
f1c22e48aee9ff03ba5f7784ffafc784
GET /ef_columnas GET /ef_columnas.json
[ { "docid": "26eb345135fb12019ab55da5f02a5b49", "score": "0.75051063", "text": "def index\n @ef_columnas = EfColumna.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ef_columnas }\n end\n end", "title": "" } ]
[ { "docid": "a2ce75e65bcfe35284f36685790ef2c2", "score": "0.7455738", "text": "def get_columns()\n url = @base_url + METHODS[:column]\n make_request url, \"get\", 2\n end", "title": "" }, { "docid": "8e8793c2347498982a1d8d7c7b26c24f", "score": "0.7136381", "text": "def get_colu...
735719b54f3bc12bced2a4540ad03209
This function enforces that no one can access a user's info but that user
[ { "docid": "c94803d0b4a63cad1e451402a41f25a6", "score": "0.0", "text": "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "title": "" } ]
[ { "docid": "892149b6739bfb4702b332479864a6ba", "score": "0.7437154", "text": "def restrict_access\t\n\t\tif current_user.owner == false\n\t\t\tredirect_to user_path(current_user), notice: \"You can't view this page, contact your box owner\"\n\t\tend\t\n\tend", "title": "" }, { "docid": "03db...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "9815504c20c86de695ded7cbb5dfab80", "score": "0.0", "text": "def set_role\n @role = Role.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60310596", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6014974", "text": "de...
1be01a3d8dcf60062de6e765fbbaab66
GET /maven_jnlp_maven_jnlp_servers/1 GET /maven_jnlp_maven_jnlp_servers/1.xml
[ { "docid": "a33c8bd58a3b8dcb94fb1cb646bef5cc", "score": "0.71860707", "text": "def show\n @maven_jnlp_server = MavenJnlp::MavenJnlpServer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @maven_jnlp_server }\n end\n end", "...
[ { "docid": "4303fc57c40c1ffc2ebdc26b3424f245", "score": "0.73888886", "text": "def maven_jnlp_server_object\n @maven_jnlp_server_object || load_maven_jnlp_server_object\n end", "title": "" }, { "docid": "f77e817e0764394036fb628a0de6afa2", "score": "0.70735013", "text": "def new\n...
ec0d5232abe62eb0cbd293c3b02cb724
Lists the databases associated with this instance Example: i.list_databases
[ { "docid": "e43df7485dccb06f9fb24b1aec0d5aa1", "score": "0.8674188", "text": "def list_databases\n response = @connection.dbreq(\"GET\", @dbmgmthost, \"#{@dbmgmtpath}/instances/#{CloudDB.escape(@id.to_s)}/databases\", @dbmgmtport, @dbmgmtscheme)\n CloudDB::Exception.raise_exception(response) u...
[ { "docid": "ede66205d489b99140608fc50813b30d", "score": "0.86029756", "text": "def list_dbs\n http_request(\"GET\", \"admin/databases\", \"application/json\", \"\")\n end", "title": "" }, { "docid": "c04eacf981484e9a17f3234e4270c26b", "score": "0.8457886", "text": "def list(o...
5e65220d5e3d3f38eb5ee531cca68c98
Ensure all files in the csv are present in the existing object
[ { "docid": "306c202bdaed480ff35927221da82424", "score": "0.54643434", "text": "def existing_file?(row)\n existing_files_by_filename.key?(row[\"filename\"])\n end", "title": "" } ]
[ { "docid": "a850bd4f3a384626fdb6c3485f819e7e", "score": "0.63849115", "text": "def validateRequiredFiles()\n @sampleSheet = @baseCallsDir + \"/SampleSheet.csv\" \n\n if !File.exist?(@sampleSheet)\n raise \"Missing SampleSheet.csv in directory: \" + @baseCallsDir\n end\n end", "title":...
c35794b090e1eed8206fefbdb9a7a8c0
update user profile and notification preferences
[ { "docid": "66c7d6df566518882bd579bb270274cf", "score": "0.70178527", "text": "def update\n @user = current_user\n if @user.update_attributes(params[:user])\n flash[:notice] = \"Updated your account settings!\"\n redirect_to(account_path)\n else\n @title = \"Account and Notificat...
[ { "docid": "2722275a1a8e283c2d494ec0d3f69d8c", "score": "0.7362484", "text": "def update_prefs\n current_user.preferences = params[:preferences]\n render plain: \"1\"\n end", "title": "" }, { "docid": "0b83da92523cafe1afe50bbe9cb7a539", "score": "0.7333846", "text": "def updat...
2c1c29ade6ebfda1fe74602217812ace
Convert String to HEX Value
[ { "docid": "cb8abef42958c95f0fcad1d500f8465f", "score": "0.0", "text": "def hexme\n self.each_byte.map { |b| b.to_s(16) }.join\n end", "title": "" } ]
[ { "docid": "fba459eba8e529607bc7b34a1e302d74", "score": "0.7836026", "text": "def _hex_value(str)\n hex = ''\n str.each_byte { |x| hex << x.to_s(16) }\n hex\n end", "title": "" }, { "docid": "1947e4125b4d2cd8a1501a3818760f43", "score": "0.78117055", "text": "def hex_to_s (s...
e360fd2e7309ceeeb3d0fdddc3ced18b
The snapshot from which the volume was created, if applicable.
[ { "docid": "ead9ff8ef8a2930093ad250e4613b360", "score": "0.6716314", "text": "def snapshot_id\n data[:snapshot_id]\n end", "title": "" } ]
[ { "docid": "1706b84fdcde0a38f77d0341e93a7e2c", "score": "0.7541917", "text": "def snapshot\n @snapshot\n end", "title": "" }, { "docid": "1706b84fdcde0a38f77d0341e93a7e2c", "score": "0.7541917", "text": "def snapshot\n @snapshot\n end", "title": "" }, { "d...
67407264d1d26a16d18a2e783aa703ee
Show the logged in user's homepage. Should have links to the channel changer, the slideshow, and the user profile editing pages. Create a uuid unless one already exists.
[ { "docid": "70a76fc618e9937298cfab37c127d74e", "score": "0.6704787", "text": "def home\n unless current_user.uuid?\n current_user.create_uuid \n current_user.save\n end\n @uuid = current_user.uuid\n end", "title": "" } ]
[ { "docid": "127363c2009675d19307ddc10590b6a3", "score": "0.71840096", "text": "def homepage\n redirect_if_not_logged_in\n @user = User.find_by_id(session[:user_id])\n redirect_to '/' if !@user\n end", "title": "" }, { "docid": "f7aed57441c0170a50f28a08a243717e", ...
0449c98a42d964e964471384583912fc
Returns whether or not an element exists in this linkedlist
[ { "docid": "ae10507538a10b22e76455553f2b4a91", "score": "0.7170589", "text": "def contains? element\n return (index_of(element) != -1)\n end", "title": "" } ]
[ { "docid": "ca59beb0c04aeb68ae7dc91a1b2b7496", "score": "0.75130993", "text": "def exist? ; ! @element.nil? ; end", "title": "" }, { "docid": "52b3f8a28335025bb638f9ff3ce5898d", "score": "0.74829966", "text": "def contains?(element)\n i = element.hash % @table.size\n node = @ta...
72c7d1c6931685f3a3b9b38d309079d1
Creates Videos from the youtube response
[ { "docid": "e17622bdb7ed05e658aed35c64139c98", "score": "0.72177756", "text": "def create_vids_from_youtube(youtube_vids)\n \tvids = []\n \tyoutube_vids.each do |youtube_vid|\n # This API call takes days\n #duration = retrieve_youtube_content_details(youtube_vid.id.videoId)\n #puts('Dur...
[ { "docid": "f061267ca712f77654829576ae68e6c5", "score": "0.7413838", "text": "def videos\n @client = YouTubeIt::Client.new\n @videos = @client.videos_by(:query => params[:description])\n @lifts = Lift.all\n @video = Video.new\n end", "title": "" }, { "docid": "207afdfa6f451e3241...
0555b044fff5eed12c7847ef107d9f65
GET /dest_notes or /dest_notes.json
[ { "docid": "c5e7e7e476944a2b7ec1e561af12f144", "score": "0.6449252", "text": "def index\n @dest_notes = DestNote.all\n end", "title": "" } ]
[ { "docid": "8c8baa457d52023920796a219ecf5249", "score": "0.6486153", "text": "def get_notes_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: NotesApi#get_notes ...\"\n end\n \n # resource path\n path = \"/Notes\"...
99f099b72c7a060c8a16a93d3497461f
Avanza di livello sintesi
[ { "docid": "489c5a26bef9babd1424ec21628e69f0", "score": "0.0", "text": "def synthetis_level_up\n @synthetis_level = 1 if @synthetis_level.nil?\n @synthetis_level += 1\n end", "title": "" } ]
[ { "docid": "4d42202a1615a5bbf7d957625da9aa76", "score": "0.60125065", "text": "def santali_pursuable(blatjang, gerontine)\n end", "title": "" }, { "docid": "2d5cb7dfbb8878111d046db66e66fd85", "score": "0.60074854", "text": "def syntax=(values); end", "title": "" }, { "...
1dcfdf7d14cd04d1a00fa872609cd83f
A string representation of the response status given as a number.
[ { "docid": "cd71ef0ed4be7d02b8030ded589ba8cd", "score": "0.0", "text": "def response_message\n case response\n when \"1\"\n \"Approved\"\n when \"2\"\n \"Declined\"\n when \"3\"\n \"Error\"\n else\n raise \"Unknown response: #{response.inspect}\"\n ...
[ { "docid": "c17fc0e5968bc88a02f04cd3666d7a7b", "score": "0.75403845", "text": "def code\n @status.to_s\n end", "title": "" }, { "docid": "c17fc0e5968bc88a02f04cd3666d7a7b", "score": "0.75403845", "text": "def code\n @status.to_s\n end", "title": "" }, { "d...
018ac38d5243bcc734fafc5d17ee90f8
POST a decline request Return success json data to ajax
[ { "docid": "fc6acc70695508aa9d53ebd5499b3015", "score": "0.0", "text": "def decline_friend\n \tif @user.pending_friends.include?(@friend)\n Friendship.breakup(@user, @friend)\n message = \"Friendship with #{@friend.nick_name} declined\"\n format.json{render :json => {:message => message,...
[ { "docid": "977ad066591f2c3ba3c17479f17b4cc0", "score": "0.59968334", "text": "def post_data; end", "title": "" }, { "docid": "f5db37ea2b6e8385fc8f925b4e95d92c", "score": "0.56977373", "text": "def post(options)\n options.assert_valid_keys :url, :form, :params, :eval_response\n ...
e82f8fbe3621cb1691137ba64e7ae346
Accepts UIEdgeInsetsMake OR and array of values to be the inset. st.title_edge_insets = UIEdgeInsetsMake(0, 10.0, 0, 0) OR st.title_edge_insets = [0, 10.0, 0, 0]
[ { "docid": "eddd30736ce91ac6f498605d750e8535", "score": "0.83697194", "text": "def title_edge_insets=(value)\n value = UIEdgeInsetsMake(value[0], value[1], value[2], value[3]) if value.is_a? Array\n @view.setTitleEdgeInsets(value)\n end", "title": "" } ]
[ { "docid": "4e6747ed5096c0e08aaf638836cec53d", "score": "0.67074496", "text": "def image_edge_insets=(value)\n value = UIEdgeInsetsMake(value[0], value[1], value[2], value[3]) if value.is_a? Array\n @view.setImageEdgeInsets(value)\n end", "title": "" }, { "docid": "1184c25...
5f6cf2a7777fc881a771e2bc13ceedd4
GET /twites/1 GET /twites/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "19dc015cb1ccb65527b6e7bb139260d8", "score": "0.71912146", "text": "def index\n @twites = Twite.all\n end", "title": "" }, { "docid": "da6fec693705e723518ec0b70cd9f49f", "score": "0.667731", "text": "def show\n @twit = Twit.find(params[:id])\n\n respond_to do |fo...
9070dbc98f65f28854e7b35f494f70b8
reduce 593 omitted reduce 594 omitted reduce 595 omitted reduce 596 omitted
[ { "docid": "c2937285d3b0860044f57c4a2bc83589", "score": "0.0", "text": "def _reduce_597(val, _values, result)\n result = val[1]\n\n result\nend", "title": "" } ]
[ { "docid": "dd458ee5bd7f974c08686357ef463ece", "score": "0.7452797", "text": "def _reduce_608(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "ad801b8250ddef70cf7a067f3e475838", "score": "0.74493104", "text": "d...
d999b895589d855520123b6ec7bf3198
Returns a reference to the Sprocket's context through the importer.
[ { "docid": "9f4111264274f52870687e4a2921b341", "score": "0.0", "text": "def sprockets_context # :nodoc:\n options[:custom][:sprockets_context]\n end", "title": "" } ]
[ { "docid": "cd54da7406e5ea037ecc0885467768b1", "score": "0.70621914", "text": "def context\n return @context\n end", "title": "" }, { "docid": "8e64d9f8fd6380360368688bcf19d886", "score": "0.69323266", "text": "def context\n @context.local\n end", "title": "" },...
513f1dd9cbfca9e46ceb824fa9de2190
Normalized strict epsilon; see Num::Context.epsilon()
[ { "docid": "80acf75579e520ff79b75ae7535ddd97", "score": "0.77060986", "text": "def half_epsilon(sign=+1)\n super.normalize\n end", "title": "" } ]
[ { "docid": "ca66253e1702cdd4c8800fddcddaadfd", "score": "0.820973", "text": "def strict_epsilon(sign=+1)\n super.normalize\n end", "title": "" }, { "docid": "9248e2ee40504619d5dff5187dc8acd9", "score": "0.81446755", "text": "def epsilon(sign=+1)\n super.normalize\n en...
088f2e4f0f873a6589505f293e5c2cd4
GET /surveillance_cables/1 GET /surveillance_cables/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "a6e25914de55da1266c62254e436db44", "score": "0.7405025", "text": "def index\n @surveillance_cables = SurveillanceCable.all\n end", "title": "" }, { "docid": "7258f6c06a39595b6420f49ec3df460d", "score": "0.6081216", "text": "def set_surveillance_cable\n @surveilla...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "43b8fa19f96a3f0df63fabd4df2f1fde", "score": "0.0", "text": "def periodic_params\n params.require(:periodic).permit(:name, :description, :qualis, :knowledgement_area, :issn, :selected_knowledgement_area, :selected_qualis)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6980244", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6782812", "text": "def strong_params\n params.requi...
7864ef737316ef49955c5e729e394ea7
Sets the byte value of bit +i+ to +b+. Invalid for a VoidCube.
[ { "docid": "1e17abc4cc4c4c9a4e5e94eb7ce6c61f", "score": "0.88101333", "text": "def setbyte(i,b)\n raise \"A VoidCube cannot be modified.\"\n end", "title": "" } ]
[ { "docid": "913f139cfa5de536cffb51561e6572ec", "score": "0.74050635", "text": "def []=(i,b)\n raise \"A VoidCube cannot be modified.\"\n end", "title": "" }, { "docid": "4c1b13bbe4db6f0d58520a3ffceac825", "score": "0.7168775", "text": "def []=(i,b)\n b = (b && b!...
3ee4a2497ebda5d76ea3355f3f397ef6
remote execute a command
[ { "docid": "45bf01032094758a7ba20941ff7663aa", "score": "0.0", "text": "def exec(command, stdin = nil)\n\t exit_status = 0 # define variable so that it will be available in the block at method scope\n\t @ssh_session.open_channel do |ch|\n\t @@logger.info(\"Executing command '#{command}'\")\n\t c...
[ { "docid": "4624cfad57ff92b7227e735005d88885", "score": "0.81387115", "text": "def execute(command)\n if remote?\n @remote.exec(command)\n else\n rays_exec(command)\n end\n end", "title": "" }, { "docid": "2527982119eeccec59c13e231fa476b9", "sc...
e22bc3901f44116d4ee209b252158d32
Input parameters are two equal length arrays x (frequency) and y (power). Returns true if total LF power >= 50% total power.
[ { "docid": "0fe31643f7cc347c14bc6cd679fcd5b7", "score": "0.6969928", "text": "def is_resonant\n\t\t# Variables\n\t\tx = @@frequency\n\t\ty = @@amplitude\n\t\t# Constants\n\t\tvlf = [0.0033, 0.04]\n\t\tlf = [0.04, 0.15]\n\t\thf = [0.15, 0.4]\n\t\t# Total sum of power in each frequency band\n\t\ttotal_vlf...
[ { "docid": "3a19e0e5045faae69b170ca29e9d9a60", "score": "0.56679654", "text": "def highpass(freq)\n n = @y.size\n (0...n).each {|i| @fft[i] = 0 if i*(0.5/(n*(@x[1]-@x[0]))) < freq}\n end", "title": "" }, { "docid": "2497d8b199b482cc0f8056a1c6ed66e1", "score": "0.56353325", "te...
0066a6c941a149b556bfee55943777ae
What's the entire superclass chain of the given class? Used in the constructor to make sure something is actually a descendant of ActiveRecord::Base.
[ { "docid": "cb0583c516ec670688a88db865791d86", "score": "0.0", "text": "def superclasses(klass)\n out = [ ]\n while (sc = klass.superclass)\n out << sc\n klass = sc\n end\n out\n end", "title": "" } ]
[ { "docid": "e2db455903ac912c69c40d8f1d7ecb4b", "score": "0.7038571", "text": "def base_class?; end", "title": "" }, { "docid": "edfa2b26eaac171ddb70c072b69ade52", "score": "0.69980466", "text": "def direct_superclass\n @superclass\n end", "title": "" }, { "docid": "3d...
de1197f4cc697609f4dd6f59296cf2af
PATCH/PUT /admins/campaigns/1 PATCH/PUT /admins/campaigns/1.json
[ { "docid": "81dcb219ec83691361add77364bca813", "score": "0.7305004", "text": "def update\n respond_to do |format|\n if @admins_campaign.update(admins_campaign_params)\n format.html { redirect_to @admins_campaign, notice: 'Campaign was successfully updated.' }\n format.json { render...
[ { "docid": "2f5f304f9aab8a68ac434aee5ae77bb1", "score": "0.7332129", "text": "def update\n authenticate_user!\n authorize! :index, @user, :message => 'Not authorized as an administrator.'\n \n @campaign = Campaign.find(params[:id])\n \n respond_to do |format|\n if @campaign.update...
b3ad716f365e9d5a25226212472f63b7
Create Group ID for Troop Encountered
[ { "docid": "940b33df2f2de5fe1c7b336969a3dbfe", "score": "0.0", "text": "def make_encounter_troop_id\n encounter_list = []\n weight_sum = 0\n $game_map.encounter_list.each do |encounter|\n next unless encounter_ok?(encounter)\n encounter_list.push(encounter)\n weight_sum += encoun...
[ { "docid": "43eca47ee8108193aad1756f4df40dd2", "score": "0.70345217", "text": "def add_group_id\n self[:group_id] = rand(Time.now.to_i)\n end", "title": "" }, { "docid": "1ac6233270afa0637ea0cf8914a96ddc", "score": "0.6681243", "text": "def group_id\n super\n end", ...
cf4b38b2333bb1a24982dcfaca042b81
=> Self's Private Area ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ { "docid": "93ee8d63188cb77dc197d26c0c4edbc1", "score": "0.0", "text": "def load_team\n\t\t@club = Club.find params[:club_id]\n\t\t@team = @club.teams.find params[:team_id]\n\tend", "title": "" } ]
[ { "docid": "64a1f809e4ec4b4d201e2f80551ac814", "score": "0.714935", "text": "def printArea1\n printArea() # calling private method here\n end", "title": "" }, { "docid": "d129cc756661d2db1b6e7ead9a68728c", "score": "0.6823628", "text": "def in_private; end", "title": ""...
b932b22b5e26587855a18885184745f5
Helper method for testing
[ { "docid": "6d69089dbdfb68b424e540d4421e3a7c", "score": "0.0", "text": "def to_query_json\n to_query_json!\n end", "title": "" } ]
[ { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.6476778", "text": "def spec; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.6476778", "text": "def spec; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "sc...
370664db031d13f27f4b111e8e3ea5a2
skip login if user is logged in already
[ { "docid": "16ed344b51118199f79937e443593e3c", "score": "0.0", "text": "def login\n #login form\n end", "title": "" } ]
[ { "docid": "25f79bf864c71cdb51c1d542d3764a5e", "score": "0.81651056", "text": "def skip_login?\n false\n end", "title": "" }, { "docid": "25f79bf864c71cdb51c1d542d3764a5e", "score": "0.81651056", "text": "def skip_login?\n false\n end", "title": "" }, { "docid": "...
c3597a107fe20b8668572e955fc6025e
Sets up filters for the method defined in the controllers. Examples class Foos [:foo] def foo the block is called before the method is called and the method is called after the method is called end private def blah end end Options +method_or_filter+ either the method to run before
[ { "docid": "9eefeb86535c5662f54b7109929e8d98", "score": "0.7884865", "text": "def before method_or_filter, options={}, &block\n _add_filter(:before, method_or_filter, options, block)\n end", "title": "" } ]
[ { "docid": "593005017954ec2f0f3199bace4a6d88", "score": "0.70051193", "text": "def process_before_filter name\n filter = find_method name, @current_class\n\n if filter.nil?\n Brakeman.debug \"[Notice] Could not find filter #{name}\"\n return\n end\n\n method = filter[:method]\n\n ...
daa22625d6c3b1ba8695ae53de828f4d
Create a new bedroom
[ { "docid": "688d940122c7a1d6bd95f6549da91ce2", "score": "0.7533136", "text": "def create_bedroom(rental, options = {})\n post(\"rentals/#{rental}/bedrooms\", bedrooms: [options]).pop\n end", "title": "" } ]
[ { "docid": "15963689b7c14d3aaba34bca062d174b", "score": "0.73921794", "text": "def create\n @bedroom = Bedroom.new(bedroom_params)\n\n respond_to do |format|\n if @bedroom.save\n format.html { redirect_to @bedroom, notice: 'Bedroom was successfully created.' }\n format.json { re...
6d51da23a62049e323d86c925526554d
DELETE /discount_activities/1 DELETE /discount_activities/1.json
[ { "docid": "15418283bc9d05ec7b4e9709167c4103", "score": "0.756279", "text": "def destroy\n @discount_activity.destroy\n respond_to do |format|\n format.html { redirect_to discount_activities_url, notice: 'Discount activity was successfully destroyed.' }\n format.json { head :no_content }...
[ { "docid": "4fa33519691b569c4ec239608acc604a", "score": "0.674107", "text": "def destroy\n @discount = Discount.find(params[:id])\n @discount.destroy\n\n respond_to do |format|\n format.html { redirect_to discounts_url }\n format.json { head :no_content }\n end\n end", "title"...