query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
0f2f1eec7f2e937d769542e2d72ca701
Is this message ctcp? Return: true|false
[ { "docid": "fedaf1f35ac0c4bb6ad23b357b10f94e", "score": "0.76322013", "text": "def isCtcp?\n return @ctcpQuery|@ctcpAnswer\n end", "title": "" } ]
[ { "docid": "55cfc9a72b4553af2fa929971d457103", "score": "0.8341797", "text": "def ctcp?\n #message = @params[1]\n #message[0] == ?\\01 && message[-1] == ?\\01\n /\\x01(?>[^\\x00\\x01\\r\\n]*)\\x01/ === @params[1]\n end", "title": "" }, { "docid": "39dbdc0375824eb8e52faff046d38cfe",...
09a0c75f9789187e95eb532ce0deb450
GET /posts/new GET /posts/new.xml
[ { "docid": "656592ac70d46b080d2220a3f3147492", "score": "0.76340854", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "title": "" } ]
[ { "docid": "850b9b1ecb72d16ce9d6459d00a509f6", "score": "0.78365606", "text": "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n make_rss\n end", "title": "" }, { "docid": "9599b99da7ed3d2b...
13c5dfd8a2b59c9840d5bca2768013db
Get the hash value for the object id.
[ { "docid": "9b12dc079c560aa86486c8b0352214e6", "score": "0.0", "text": "def hash\n generate_data.hash\n end", "title": "" } ]
[ { "docid": "85601ac2416d5d39c2217744dd640d72", "score": "0.78110385", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "85601ac2416d5d39c2217744dd640d72", "score": "0.78110385", "text": "def hash\n id.hash\n end", "title": "" }, { "docid": "85...
c2d39a8800245653aacf177453449b00
This program will not print anything to the screen because the return call on line 24 prevents line 25 from executing. Exercise 5
[ { "docid": "b440ee2f5620ac107f3ba18fd2a7c33e", "score": "0.0", "text": "def scream(words)\n words = words + \"!!!!\"\n puts words\nend", "title": "" } ]
[ { "docid": "bcef7f0ac195deef4e41ef18b6eee9bf", "score": "0.6688404", "text": "def what_was_that?\n puts \"-\" * 70\n puts \"***** I didn't catch that *****\"\n puts \"\"\n puts \"Would you please try a different answer?\"\n puts \"-\" * 70\n end", "title": "" }, { "docid": ...
f547ce2d3177e8e6405e9bcea8f33eba
rubocop:disable Metrics/MethodLength process each row for information:
[ { "docid": "99605f18ce948145e4735accc55d4d83", "score": "0.0", "text": "def build_collection_objects_ori\n ce_a1 = ''\n ce_m1 = ''\n ce1 = CollectingEvent.find(1)\n # here we store the attributes of stuff we want to find later\n build_objects = {}\n ...
[ { "docid": "6aff2fc70f4cd0cf187dfcccf0aecf48", "score": "0.6668063", "text": "def each_row\n mappings_csv.each do |row|\n info = CSVMappingInfo.new(row)\n yield(info) if info.valid?\n end\n end", "title": "" }, { "docid": "64e8c915c49dd85731f736d584d01975...
49ca2c740f1dfaa22f7761de1fcf44d1
what can this NPC currently buy from this inventory? Returns NpcBuys
[ { "docid": "57615f51df8bcf375242911ed47885d6", "score": "0.7255897", "text": "def buying(player)\n if self.can_buy\n NpcBuys.where(:npc => self).select do |buy|\n PlayerItem.where(:player_id => player.id, :item_type_id => buy.item_type_id).length > 0\n end\n end\n end", "titl...
[ { "docid": "7d78738f75b31a1f8e855e0299420849", "score": "0.6325774", "text": "def available_coins\n coins.select { |coin| coin.quantity.positive? }\n end", "title": "" }, { "docid": "c08900c7214608eb0c43beca076410f6", "score": "0.6158088", "text": "def discover_items_for_itempedi...
05107a52e02d543859ae4c715d437567
GET /native_issues/1 GET /native_issues/1.json
[ { "docid": "890b2036dbb1992972203b0e0be97050", "score": "0.0", "text": "def show\n @has_asanas = NativeIssueHasAsana.where(:native_issue_id => @native_issue.id)\n @has_responses = NativeIssueHasResponse.where(:native_issue_id => @native_issue)\n end", "title": "" } ]
[ { "docid": "2d8e74198f2ff46db8a4a85b13eae68c", "score": "0.7318396", "text": "def index\n if(params[:node] != nil)\n @node = Node.find(params[:node])\n @native_issues = @node.getAllIssues\n else\n @native_issues = NativeIssue.all\n end\n end", "title": "" }, { "docid...
001388b5a480b236a1343d8b15efd759
Get the details of activated locales for a platform.
[ { "docid": "8d9017bd8c376fd051e995a16f575cf1", "score": "0.81035924", "text": "def locales\n get(\"platform/locales\")[\"locales\"]\n end", "title": "" } ]
[ { "docid": "32855959e8bd177397abab6f85109edc", "score": "0.798484", "text": "def platform_locales\n @platform.locales\n end", "title": "" }, { "docid": "c11e6c38aa16c6090c5a0eaacf84c3ab", "score": "0.7359345", "text": "def locales\n @env.locales\n end", "t...
c71cee3241fa9138b120f5b38087b97a
get a list of open appointments returns an array of AthenaStructs raises exceptions if anything goes wrong in the process
[ { "docid": "61d227f7b0ff981805168c0eb7433a07", "score": "0.66736233", "text": "def get_open_appointments(\n appointmenttypeid: nil, bypassscheduletimechecks: true, departmentid:, enddate: nil,\n ignoreschedulablepermission: true, providerid: nil, reasonid: nil, showfrozenslots: false,\n s...
[ { "docid": "97dc5e9b0532151936237164831fe272", "score": "0.6982275", "text": "def get_appointments\n @get_appointments ||= appointment_service.get_appointments(three_months_ago, one_year_from_now)\n end", "title": "" }, { "docid": "31242c859f7621de88fa1ec9aff65367", "score": ...
bd8db8074d130657900558b35b6d39af
GET /commodities/1 GET /commodities/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "f22046c6837653f656b247d7b2c5dd2f", "score": "0.7433827", "text": "def show\n @commodity = Commodity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @commodity }\n end\n end", "title": "" }, { "docid": "f2...
bd43a34572fe6dd4f2c1eb595b11895d
You can run `learn ff to only see the first failing test` You can run `clear` to clear your terminal
[ { "docid": "8774cc6624a835b98dd31f70b78aef86", "score": "0.0", "text": "def countdown_with_sleep(number)\n # Use the stack overflow post linked in the lesson to figure out how to establish a wait time between print statements\nend", "title": "" } ]
[ { "docid": "834c00d9838d67a9841194157e324993", "score": "0.63482165", "text": "def run_fe_tests\n end", "title": "" }, { "docid": "17029c6f807c2f967f50d439ad40714c", "score": "0.605628", "text": "def open_fertility_tests\n touch \"* marked:'Fertility testing and workup'\"\n ...
deb4f928b20a30ca683471b23165e8d4
DELETE users/1/posts/1 DELETE users/1/posts/1.json
[ { "docid": "8af05b62a09579e9ddd0757a8fe336a3", "score": "0.7153592", "text": "def destroy\n # @user = User.friendly.find(params[:user_id])\n @user = current_user\n @post = @user.posts.friendly.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to us...
[ { "docid": "bc8582616bb775bd74d3b05f6b9dc4d1", "score": "0.72502536", "text": "def delete\n user = User.find_by(id: params[:id])\n for post in user.posts do\n delete_post(post)\n end\n user.destroy\n flash[:notice] = \"Your account has now been deleted. Thank you for using TELOS.\"\n...
8b69cc7813db2e8b0eba978ae153035d
POST /merchandise_option_sets POST /merchandise_option_sets.xml
[ { "docid": "323f4af844ee753c7e0cdb5cc9cedfa4", "score": "0.73138076", "text": "def create\n @merchandise_option_set = MerchandiseOptionSet.new(merchandise_option_set_params)\n\n respond_to do |format|\n if @merchandise_option_set.save\n format.html { redirect_to(@merchandise_option_set...
[ { "docid": "84d21fd96e1237ecde0c510e677a9f94", "score": "0.6502088", "text": "def new\n @merchandise_option_set = MerchandiseOptionSet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @merchandise_option_set }\n end\n end", "title": "" ...
704a3ea7feec44719ee5bf26ad2aa5a2
combo_changed event handlers for composite foreign key: rmt_variety_id
[ { "docid": "17d063c9e8315ca40e56cd28884e5d37", "score": "0.62477946", "text": "def rmt_variety_qc_level_commodity_code_changed\n\tcommodity_code = get_selected_combo_value(params)\n\tsession[:rmt_variety_qc_level_form][:commodity_code_combo_selection] = commodity_code\n\t@rmt_variety_codes = RmtVarietyQ...
[ { "docid": "9fef9e4c1d368945afb5cb0ba2988c68", "score": "0.6568162", "text": "def pallet_commodity_code_combo_changed()\n commodity_code = get_selected_combo_value(params)\n session[:filter_by_fruitspec_form][:commodity_code_selection] = commodity_code\n @marketing_variety_codes = Pallet.find_b...
c0e3eeefc6288395c2e0e784c87c20f3
Interval time in seconds Default is 1
[ { "docid": "905cf63e805215419cbd104efa2ac7e6", "score": "0.8124893", "text": "def interval\n @config[:interval] || 1\n end", "title": "" } ]
[ { "docid": "74ef7495da40eeeea6849de1a927ec34", "score": "0.81947356", "text": "def interval\n @interval ||= 1\n end", "title": "" }, { "docid": "ea8ddac6b9c7b444e2eead8f9f608402", "score": "0.7878437", "text": "def interval; end", "title": "" }, { "docid": "8b...
439db8929cf8642d2c41422946bd405c
GET /contains GET /contains.json
[ { "docid": "c86c915de7c6ba12f879333540cedf41", "score": "0.56912404", "text": "def index\n @current_user = current_user\n @contains = Contain.get_search_object(params[:search], params[:title], params[:author], params[:published], current_user)\n end", "title": "" } ]
[ { "docid": "f0d86669c4443b5364662a81ba12ed86", "score": "0.6228181", "text": "def response_contains? string\n response.body.include? string.to_s\n end", "title": "" }, { "docid": "2fa7ade1197fc808860875e02dea90c7", "score": "0.6067382", "text": "def contains\n json_response(...
631b845df8cf1d78f3356bbdc96cd327
PUT /stories/1 PUT /stories/1.json
[ { "docid": "01d4ea5c2c5a017cf85db2ac1d32cfbc", "score": "0.0", "text": "def update\n @story = Story.is_not_deleted.find(params[:id])\n\n respond_to do |format|\n if !@story.published && params[:story][:published]==\"1\"\n if !@story.about.present? || !@story.asset_exists?\n fl...
[ { "docid": "c6ce24cd7374834fd9b3ce79eaef08e4", "score": "0.7361463", "text": "def update\n if @story.update(update_params)\n render json: @story\n else\n render json: @story.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "4d65bdd2df9ec08d20f...
4473156437710f86b8a156ad9f4509c3
Time complexity O(n) Space complexity O(1)
[ { "docid": "9f6cc18ac8658f1554f8ec17b73ea424", "score": "0.0", "text": "def add_last(data)\n if @head.nil?\n @head = Node.new(data, nil)\n else\n cur = @head\n while cur.next != nil\n cur = cur.next\n end\n cur.next = Node.new(data, nil)\n end\n end", "title...
[ { "docid": "c978c895d39f4228b0e144beeaf88f7c", "score": "0.6520136", "text": "def removNb_inefficient(n)\n sigma = n*(n+1)/2 # First find the sum of the first n numbers\n (1..n).each do |i| # Start one iteration from 1 to n, call that i\n (i+1..n).each do |j| # Start an inner iteration fron i+1 to ...
dcbeb30ba4d3582ad4c99a47f093f012
Users might want to overload this function.
[ { "docid": "c56a1eac667e6c8f6dc0af5aa9173289", "score": "0.0", "text": "def handle_result( msg )\r\n self.class.delayed_result_queue.select {|dr| dr.server_id==msg.id}.each {|dr| \r\n dr.send_result(msg.status)\r\n self.class.delayed_result_queue.delete dr\r\n }\r\n end", "title": "...
[ { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.7018693", "text": "def desired; end", "title": "" }, { "docid": "2290804b238fc95bfd6b38f87c6d2895", "score": "0.69719803", "text": "def override; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd",...
93d77746e2c01c5fe8b6863be5ed9c60
llama al metodo Utilizando returns
[ { "docid": "d6b3fbab480dfc811227342ae79a6cb5", "score": "0.0", "text": "def exponente(num=0, val=1)\n return num**val #return es opcional\nend", "title": "" } ]
[ { "docid": "d4b51441e9803335f40f611467a77896", "score": "0.7629863", "text": "def returned; end", "title": "" }, { "docid": "d4b51441e9803335f40f611467a77896", "score": "0.7629863", "text": "def returned; end", "title": "" }, { "docid": "dd68931a1a7f77eb4fd41ce35988a9bb",...
c1a43f19739be216e4cfb0681f68a253
Upload message attachment Upload a new file to insert it as a link.
[ { "docid": "7142029a940ea857acd5001b709bb6a2", "score": "0.6324746", "text": "def upload_message_attachment(file, opts = {})\n data, _status_code, _headers = upload_message_attachment_with_http_info(file, opts)\n data\n end", "title": "" } ]
[ { "docid": "52338d973a44ee7a92f8bf2a94fe82e2", "score": "0.6926237", "text": "def upload_attachment(safebox, attachment)\n if attachment.guid.nil?\n result = @json_client.upload_file(safebox.upload_url, attachment.file_path || attachment.file, attachment.content_type, attachment.filename...
2a341e69b47d48accddfa83ecde26867
Extract attributes required for API calls about this object
[ { "docid": "e0e1af87417b7ab9d61cdfbc495b9752", "score": "0.0", "text": "def route_params\n params = { id: id }\n\n self.class.routes.values.each do |route|\n route.gsub(/:(\\w+)/) do |m|\n m = m.delete(':').to_sym\n params[m] = self.send(m)\n end\n end\n\n ...
[ { "docid": "edbd20fdd2b42c01ec9f5a23f21a1244", "score": "0.7446739", "text": "def attributes\n self.class.extract_attributes(\n resource: self,\n fields: fields,\n invalid_attributes: invalid_attributes,\n id: self.id\n )\n end", "title": "" }, { "doc...
3c6ead7f64eb62bcfca3718799b94409
can pass optional :image_name => 'my_custom_name' to get a specific filtered image
[ { "docid": "765f99e0335a2cc89261a4fa13e3535f", "score": "0.0", "text": "def get_file_html_url(args_hash)\n attachment = args_hash[:attachment]\n image_name = args_hash.has_key?(:image_name) ? args_hash[:image_name] : 'myself'\n get_file_url(attachment, image_name) if attachment\n end", "ti...
[ { "docid": "455e29744970713c1d38617579a4adea", "score": "0.69072855", "text": "def choose_image(discovery, filter)\n \n FlickRaw.api_key=ENV[\"FLICKR_KEY\"]\n FlickRaw.shared_secret=ENV[\"FLICKR_SECRET\"]\n\n bath = flickr.places.find :query => \"Bath\"\n latitude = bath[0]['latitude'].to_f\n long...
e0e963e9f012afbd2aef31f1f4b1a3ae
defines a stage that will terminate processing once its condition is not met. Note if the condition evaluates to +false+, processing is terminated immediately (subsequent stages in the pipeline will not be executed)
[ { "docid": "40dfa4690e7280852c7c91c9d8acf73c", "score": "0.54094344", "text": "def take_while(options = {}, &block)\n @stages << TakeWhile.new(options,&block)\n end", "title": "" } ]
[ { "docid": "24195bd0825d535df03c6cc1861b4d17", "score": "0.62782735", "text": "def halt_pipeline\n @halt_pipeline = true\n end", "title": "" }, { "docid": "bbe77707b1e6b76da2b7219afe0424c5", "score": "0.61996317", "text": "def halt_pipeline?\n @halt_pipeline || false\n ...
ccc03b7f5d05285db91a5e1a9512032e
FIXME: this has a big overlap with miq_request_initial_options. It is needed because the firts load of the GTL is done throught a different mechanism than the subsequent reloads.
[ { "docid": "cea44eeef51af1bf401f26edc8f3b872", "score": "0.0", "text": "def prov_set_default_options\n {\n :reason_text => nil,\n :applied_states => PROV_STATES.keys,\n :type_choice => 'all',\n :user_choice => approver? ? 'all' : current_user.id,\n :time_period =>...
[ { "docid": "1df3d08f640c3a7c5784890c0a1be91a", "score": "0.5695356", "text": "def set_request; end", "title": "" }, { "docid": "1202574be5092d212d81a9ab8e19e909", "score": "0.5467341", "text": "def default_request_options\n {:timeout => 0, :head => {}}\n end", "title"...
50a07019e665eedc1a3730268be4e5d7
Produces the name of an item from Minecraft.
[ { "docid": "3b92132e8080560917468be955604029", "score": "0.7259475", "text": "def item\n fetch('games.minecraft.items')\n end", "title": "" } ]
[ { "docid": "09ca3f27395904972dfc29ec87e5be94", "score": "0.75503904", "text": "def name\n return \"#{@item[:name]}\"\n end", "title": "" }, { "docid": "3d4e00b89f4235c4a2f24537fe5941dd", "score": "0.74037516", "text": "def item_name\n name\n end", "title": "" }, { ...
ca5b145baee5dbf2595fdaff1564a7f1
Returns a list of related documents.
[ { "docid": "5d6146551bdcd21435783e5778facd83", "score": "0.5882317", "text": "def documents\n @mapped_documents ||= Basecamp3::Document.all(bucket.id, id)\n end", "title": "" } ]
[ { "docid": "347909e74e4030a825203e95f1730fe7", "score": "0.6664489", "text": "def documents\n if acknowledged?\n replies.flat_map(&:documents)\n else\n []\n end\n end", "title": "" }, { "docid": "0a7a0cb0586f7f566fd26b9e00861cb1", "score": "0.6...
f7aa57a353357b09748eae4b6ee2ebe8
Sets name on task with given id that belongs to given container
[ { "docid": "985ac6efae424cbcbba05f36675936f7", "score": "0.0", "text": "def set_name(id, t_instance_id, body, opts = {})\n set_name_with_http_info(id, t_instance_id, body, opts)\n return nil\n end", "title": "" } ]
[ { "docid": "b45b210542f6cd32b05d89f5a719b142", "score": "0.67462564", "text": "def task_name(id = @instance_id)\n # get @task_name\n return @task_name unless @task_name.nil?\n # set @task_name\n # TODO: get all tasks instead of just the first\n @task_name = tag_search(...
7fbef3495f0fc215429ba974ccc1ac3e
Method name: load_db Function: Loads a new database from a file. DOES NOT ALTER THE GUI. Arguments: => filename (required): The FULL PATH to the saved OpenSHAPA file. Returns: => db: The database of the opened project. Set to $db to use other functions with it. => pj: The project data of the opened project. Set to $pj ...
[ { "docid": "22996c849a4f6ef6170bf0fb5e609aa2", "score": "0.8029676", "text": "def load_db(filename)\n # Packages needed for opening and saving projects and databases.\n\n\n #\n # ****************************************************************************\n # *** Check to make sure filename belo...
[ { "docid": "899de299fb8bba61f36bd26a45296344", "score": "0.6651328", "text": "def get_db\n # we want to check a couple levels 2011-09-28 \n unless @db\n unless File.exists? @file\n 3.times do |i|\n @file = \"../#{@file}\"\n break if File.exists? @file\n end\n ...
c5dd67f38f4d6a8743fe251e3190e2c4
DELETE /words/1 DELETE /words/1.json
[ { "docid": "0f04c1fb54c37da0784dd205bd60546e", "score": "0.74860764", "text": "def destroy\n check_access\n @word.destroy\n respond_to do |format|\n format.html { redirect_to words_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "6a46a50ef4ae364d0efd96dc2ce2449e", "score": "0.7469168", "text": "def destroy\n @word = Word.find(params[:id])\n @word.destroy\n\n respond_to do |format|\n format.html { redirect_to words_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { ...
47f82cd5a5f1bef11a1ad22155fe96b2
Get the uri as a Mongoid friendly configuration hash.
[ { "docid": "9a09de83dda5de74a55024e264b76540", "score": "0.0", "text": "def to_hash\n config = { database: database, hosts: hosts }\n if username && password\n config.merge!(username: username, password: password)\n end\n config\n end", "title": "" } ]
[ { "docid": "a6f3f8718f2546a59057334935f86991", "score": "0.7023173", "text": "def uri\n if @config.include?('uri')\n @config['uri']\n elsif credentials?\n \"mongodb://#{credentials}@#{@config['host']}:#{@config['port']}/#{@config['database']}\"\n else\n \"mongodb://#{...
eb0993a4ff9ddb0d8001c1eee55843e9
update map metadata after move stage is complete
[ { "docid": "3a66fcb0966887741cc4e5b949b4d261", "score": "0.5994129", "text": "def update_metadata(direction, metadata)\n end", "title": "" } ]
[ { "docid": "580cef70ff0a4d1dc3622bc9aa3a7a2e", "score": "0.63386893", "text": "def update\n @file = @map.meta_data\n # binding.pry\n\n @meta_data = []\n @kind = @map.kind\n fips_to_hc_key\n @map.meta_data = @meta_data\n\n respond_to do |format|\n if @map.update(map_params)\n ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "e892ea77d6be854f7a38dc9bc188e88a", "score": "0.0", "text": "def promotion_params\n params.require(:promotion).permit(:start_date, :end_date, :promotable_id, :promotable_type, :active, :priority, :image)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6980384", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6782743", "text": "def strong_params\n params.requi...
a1869ce4ea4abe92d0a95cf5932cd727
Returns the set of loaded payload module classes.
[ { "docid": "6ebaf210a91d560ddcf22a76b5c82b6d", "score": "0.69966215", "text": "def payloads\n\t\treturn module_sets[MODULE_PAYLOAD]\n\tend", "title": "" } ]
[ { "docid": "4349d59b12a658a18776eb0d03680593", "score": "0.7012678", "text": "def classes\n @classes\n end", "title": "" }, { "docid": "73cc397c69d34fac1a04ba8e0d79ef3e", "score": "0.6868963", "text": "def classes\n return @classes if @classes\n @classes = {}\n @stor...
2d1cbb7ad275baacfe945ab43131c008
DELETE /pesagens/1 DELETE /pesagens/1.json
[ { "docid": "8f3d9c5e12f28061fb5795647c5642e1", "score": "0.6918581", "text": "def destroy\n @pesagem.destroy\n respond_to do |format|\n format.html { redirect_to pesagens_url, notice: 'Pesagem excluida.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "7452c4d15daf08108aaa5a1b728adb31", "score": "0.73304653", "text": "def destroy\n @json.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "b445c184893647d3482f8fbc6a507a52", "score": "0.7322429", "text": "def delete(path, params = {})\n path += '.jso...
0513da89dc68f55bcf6edd88dc0e718b
=begin Identifies relevance between a review and a submission =end
[ { "docid": "abe6fdd3296f05e2e75c2252341cdeee", "score": "0.70604634", "text": "def get_relevance(reviews, submissions, num_reviews, pos_tagger, core_NLP_tagger, speller) #double dimensional arrays that contain the submissions and the reviews respectively\n review_vertices = nil\n review_edges = nil\n ...
[ { "docid": "763f5590126cf498f84354a6fffce13b", "score": "0.7423361", "text": "def get_relevance(reviews, submissions, num_reviews, pos_tagger, core_NLP_tagger, speller)\n review_vertices = nil\n review_edges = nil\n subm_vertices = nil\n subm_edges = nil\n num_rev_vert = 0\n num_rev_ed...
986f309b12bac748dd39e0128d558791
Convert to the array format used by gem servers everywhere
[ { "docid": "0aad18ffc79854a3588589b088be194d", "score": "0.0", "text": "def marshalled_specs( spec_a )\n a = spec_a.collect { |s| s.to_rubygems_a }\n marshal( optimize_specs( a ) )\n end", "title": "" } ]
[ { "docid": "5a921b7bdd43c4707d68fc39b63b8ef1", "score": "0.72813684", "text": "def converted_arrays; end", "title": "" }, { "docid": "925e77cfe3c1041198462621a7ffee49", "score": "0.7106641", "text": "def to_a; Array(force) end", "title": "" }, { "docid": "210543f74ab60fc3...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "82b523dd7d944d95e558e934cc1b22a6", "score": "0.0", "text": "def set_like\n @like = Like.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...
c6f934a37a5f319cd7b2dcf44b595545
DELETE /old_points/1 DELETE /old_points/1.xml
[ { "docid": "9ecd2be19e8fdf02f7361a2de3fc3886", "score": "0.7356192", "text": "def destroy\n @old_point = OldPoint.find(params[:id])\n @old_point.destroy\n\n respond_to do |format|\n format.html { redirect_to(old_points_url) }\n format.xml { head :ok }\n end\n end", "title": "...
[ { "docid": "52c7070fea0f741808c31c40cd0ec98a", "score": "0.6854927", "text": "def destroy\n @old_route_point = OldRoutePoint.find(params[:id])\n @old_route_point.destroy\n\n respond_to do |format|\n format.html { redirect_to(old_route_points_url) }\n format.xml { head :ok }\n end\...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "92c273d17db4697ab21e2bbe1a7a847b", "score": "0.0", "text": "def goal_params\n params.require(:goal).permit(:name, :deadline, :achievability,\n :measurement, :person_responsible, :achieved, :completed_at,\n :version, :slug)\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...
d244fc442f9177b19d3635a2463d6efe
meth Same as cut_depth_rough but is generally a smaller number because it is easier to get a high quality finish when removing less material. TODO: enhance this so that it is using bit and material
[ { "docid": "1e7d029a7d92814b91816c7ac390dcc8", "score": "0.7490448", "text": "def cut_depth_finish\r\n @cut_depth_inc = @cut_depth_inc_max * 0.2\r\n @cut_depth_inc\r\n end", "title": "" } ]
[ { "docid": "e2b67f94d3ced889473421bbd979e5ee", "score": "0.8340094", "text": "def cut_depth_rough\r\n @cut_depth_inc = @cut_depth_inc_max\r\n @cut_depth_inc\r\n end", "title": "" }, { "docid": "0bd9468db9a237e45ad997c103872ab6", "score": "0.69045097", "text": "def cut_fa...
3b2b6afbab2ad7bb38169319f4cce3f2
Swap positions with the next lower item, if one exists.
[ { "docid": "fa2cd745445b70b7421aa4b69b2b79fe", "score": "0.611341", "text": "def move_lower\n decrement_position\n end", "title": "" } ]
[ { "docid": "bea6b23521ef4400e8ce05fd011f7efd", "score": "0.73941314", "text": "def move_lower\n acts_as_list_class.transaction do\n lower_item.try(:decrement_position) and increment_position\n end\n end", "title": "" }, { "docid": "11316f5f3d7fb7fb39b4a885...
90322f75d76d99da27ec965e3b0aef6d
Temporarily change the default group to refer to the specified group while within the passed block. This method also changes the behavior of `remote_exec` and `remote_upload` while within the given block. Both functions don't take an IP and a user, as they collect the information for all nodes within the group. In that...
[ { "docid": "03b34d6391cdddf8380ff2bb2cb8692b", "score": "0.72838384", "text": "def group(group, &block)\n log_info %(entered group block with group \"#{group}\")\n\n # Temporarily switch to the target group.\n old_default_group = get_option(:remote_default_group)\n set_option...
[ { "docid": "adbde2d4c9c6f60bce0978e64dd70061", "score": "0.58483624", "text": "def ips_for(name, &block)\n if block_given?\n @ip_groups[name] = IpGroup.new\n @ip_groups[name].instance_eval &block\n @ip_groups[name]\n else\n @ip_groups[name]\n end\n end", ...
f96313a4c509fde11f1d35a41e6e73f9
Zacks Sales Surprises for Security This database returns historical estimated and actual sales, guidance, and announcement dates for a specified US or Canadian company.
[ { "docid": "57a764b190ecb4f5b4425e82b9a221b4", "score": "0.0", "text": "def get_security_zacks_sales_surprises_with_http_info(identifier, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SecurityApi.get_security_zacks_sales_surprises ...\"\n ...
[ { "docid": "48bd83a079d7a79b5843a7d85468fc54", "score": "0.58598864", "text": "def get_zacks_sales_surprises(opts = {})\n data, _status_code, _headers = get_zacks_sales_surprises_with_http_info(opts)\n return data\n end", "title": "" }, { "docid": "a9f6afe5c241465dc31b91c327ebba...
fe4c9ec39ccaa09499143d4614358ef8
Validates login and email of a Tutor in scope of his/her Owner. Tutors may have same login,email for different Owners but unique login,email for same Owners.
[ { "docid": "0096acb9d5688e87a9057c78881e260d", "score": "0.693577", "text": "def validate\n \tif self.resource_type == RESOURCE_TYPE[:tutor]\n\t\t\tcurrent_user\n\t\t\t@owner = current_user.resource\n\t\t\t@tutors = Tutor.find(:all, :conditions => [\"owner_id = ?\",@owner.id])\n\t\t\t#@Tutor_users shou...
[ { "docid": "acff44a03bf999d2aecf5737100fb997", "score": "0.5918541", "text": "def validate_login_and_email\n self.errors.add(:login, \"и Email не могут быть пустыми одновременно\") if(login.blank? && email.blank?)\n self.errors.add(:login, \"уже есть в нашей базе\") if(login.p...
1749c387a47b58219ffc43a930c44b80
is the file older than MAX_FEED_AGE?
[ { "docid": "caa764b37202545884f049d4cd37669e", "score": "0.85182655", "text": "def expired?(file)\n (Time.now - file.mtime) > MAX_FEED_AGE\nend", "title": "" } ]
[ { "docid": "ad8d829c9cdd0655bc64f2b86643595c", "score": "0.7635765", "text": "def is_old_file?(file)\n File.new(file).mtime < (Time.now - time_limit)\n end", "title": "" }, { "docid": "ad8d829c9cdd0655bc64f2b86643595c", "score": "0.7635765", "text": "def is_old_file?(file)\n ...
0b6d5723ca133857e6f26f04d24e43eb
GET /adverse_reactions/1 GET /adverse_reactions/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "1b602cfeb9c1017ff1fad869eb9e562e", "score": "0.73786664", "text": "def index\n @adverse_reactions = AdverseReaction.all\n end", "title": "" }, { "docid": "80584ff167120d98730850a2bf871fcf", "score": "0.6865292", "text": "def reactions_get(options = {})\n op...
6a31982f4ced748c1e27d68b301fe132
GET /users/new GET /users/new.json
[ { "docid": "8ace5ade634837dfc64ad61ed716323c", "score": "0.0", "text": "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n end\n end", "title": "" } ]
[ { "docid": "10579c3d3cc989fec15a1ace9f9c505e", "score": "0.8287397", "text": "def new\n @newuser = Newuser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newuser }\n end\n end", "title": "" }, { "docid": "4e4b24e3210b5e1807092741...
0b20c00a77b15ef35700e07e1fd0d377
Construct ks password line
[ { "docid": "f3ad60b39be8a85e340dc927a3d67d7d", "score": "0.57834625", "text": "def get_vs_password(options)\n result = \"--iscrypted \"+options['q_struct']['root_crypt'].value.to_s\n return result\nend", "title": "" } ]
[ { "docid": "0a2bb7cb677b11552cee37b95e192d7e", "score": "0.6739913", "text": "def password_key\n prepare_key_pw(password)\n end", "title": "" }, { "docid": "9bb9d1b316cb7eeef014061b1ea15440", "score": "0.6683352", "text": "def prepare_key_pw(password)\n prepare_key(str_to_a32(...
e89b7d7a11c450812e31e4417fecfa8b
accepts an artist's name, finds or creates an Artist instance and assigns it to the Song's artist attribute
[ { "docid": "566c251fa26384354464e6a4a0a40ffc", "score": "0.85319674", "text": "def artist_name=(name)\n self.artist = Artist.find_or_create_by_name(name)\n artist.add_song(self)\n end", "title": "" } ]
[ { "docid": "80a2f6875d3689d8af473871bf7e6bef", "score": "0.8814103", "text": "def artist_name=(name)\n self.artist = Artist.find_or_create_by_name(name)\n end", "title": "" }, { "docid": "3d739ff76d60a3a5b76b3a1b16017355", "score": "0.8761277", "text": "def artist_name=(name)\n ...
378ba8ffb0533cabb4bb31eace562630
Before filters Confirms the correct 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": "0b044c7b0b5351466feb2ff0502f713f", "score": "0.6699564", "text": "def before_set_user\n end", "title": "" }, { "docid": "7eed53dd1b47e2a95ee071e173fef827", "score": "0.65986466", "text": "def current_user_required\n\t\t\t# Have to add \".filter(self)\" when not in befo...
90f355862879dbac00ddff356dd1dcfc
DELETE /our_charities/1 DELETE /our_charities/1.json
[ { "docid": "a669ff19c7f295b20406097d6f5d9665", "score": "0.757823", "text": "def destroy\n @our_charity = OurCharity.find(params[:id])\n @our_charity.destroy\n\n respond_to do |format|\n format.html { redirect_to our_charities_url }\n format.json { head :no_content }\n end\n end",...
[ { "docid": "e38bb407c145d652cfaed8e0f2d9e375", "score": "0.7332699", "text": "def destroy\n @charity.destroy\n respond_to do |format|\n format.html { redirect_to charities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "69140abaeb50d38cae...
af7bfaf2b0fb2c321a837f95860dd913
GET /missions/plan need to add route for /missions/plan
[ { "docid": "0460fbaeb02d76e0e7082de3dab88091", "score": "0.0", "text": "def finish\n @mission = Mission.find(params[:id])\n @stickies = @mission.stickies\n @clumps = @mission.clumps\n @coactions = @mission.coactions\n \n respond_to do |format|\n forma...
[ { "docid": "5c633d9e4df589d82e0410c2eaf337db", "score": "0.6538789", "text": "def status\n @plan = Plan.find(params[:id])\n authorize @plan\n respond_to do |format|\n format.json { render json: @plan.status }\n end\n end", "title": "" }, { "docid": "5b4a7614da4c34a0fb4bc019...
98027d1e738b14b9eba432decf19d3d1
Sets the period in ms with which the threshold callbacks CALLBACK_HUMIDITY_REACHED, CALLBACK_ANALOG_VALUE_REACHED are triggered, if the thresholds BrickletHumidityset_humidity_callback_threshold, BrickletHumidityset_analog_value_callback_threshold keep being reached. The default value is 100.
[ { "docid": "4b63be7554aacad33997f69f90ccc42b", "score": "0.56556374", "text": "def set_debounce_period(debounce)\n send_request(FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, '')\n end", "title": "" } ]
[ { "docid": "45b191f68feaea49e8f2d6ecce9292ff", "score": "0.7629108", "text": "def set_humidity_callback_period(period)\n send_request(FUNCTION_SET_HUMIDITY_CALLBACK_PERIOD, [period], 'L', 0, '')\n end", "title": "" }, { "docid": "f363db0480d356736221708b300fdcb4", "score": "0.700...
f50e397d2edb883adf6fe448492353bc
This removes any view hooks registered with the specified identifier
[ { "docid": "f68e754c423f48cb87296d0ab41b7097", "score": "0.7463195", "text": "def deregister_dynamic_view(id)\n @view_hooks.keys.each do |key|\n @view_hooks[key].each do |view|\n @view_hooks[key].delete(view) if view[:id] == id\n end\n end\n end", "tit...
[ { "docid": "a34a9f439098bb8144c5507173192054", "score": "0.76867586", "text": "def remove_plugin_hooks(id)\n @view_hooks.delete(id) unless @view_hooks.nil? || @view_hooks.empty?\n end", "title": "" }, { "docid": "522be292ed74ce8f0ff7b480a32d18cb", "score": "0.67538756", "...
821284c431b31a9936126ee35513872e
Method: invoke_action, invokes various actions provided though hash methods
[ { "docid": "0b939405d578a3b38cfaed929e308816", "score": "0.0", "text": "def invoke_action(opt = {})\n action_hash = SELECTOR_MAPPING[ACTIVE_SCHEDULE][opt['action'].capitalize.gsub(/(Rename|Delete|Copy).*$/,'\\1')] || {}\n click_on_button('Action', 'button', ACTIVE_SCHEDULE)\n self.send(\"...
[ { "docid": "b2c8a8a06aa615f70cc54c6623ee9111", "score": "0.7440203", "text": "def invoke_action(name)\n end", "title": "" }, { "docid": "b2c8a8a06aa615f70cc54c6623ee9111", "score": "0.7440203", "text": "def invoke_action(name)\n end", "title": "" }, { "docid": "b2c8a8a0...
1630391d6d4f4a4f8d5d3a189193e384
returns the last point in the hash takes a hash as input
[ { "docid": "825d454e73b802fe5859122c954de930", "score": "0.75563836", "text": "def getLastPoint myhash\n\t\t\t#sort the hash and get the x values\n\t\t\tdummy = myhash.keys.sort\n\t\t\t#save the x value of the last point \n\t\t\txval = dummy.last\n\t\t\t#get the y value of the last point\n\t\t\tyval = m...
[ { "docid": "a39e9643ef7decbf4be0b1b1e091dc2e", "score": "0.6526282", "text": "def last \n\t\tlast = @hash.last\n\t\t[last.key, last.value]\n\tend", "title": "" }, { "docid": "95dce4d8db0db6b3cb5582d2ef17626b", "score": "0.6501007", "text": "def largest_hash_key(hash)\n current_hig...
cdd240f6b034d0cb2595e46998e11f11
GET /creditcards GET /creditcards.xml Metodo que se encarga de mostrar todas las tarjetas de credito
[ { "docid": "928a39b7856eeacd1d0c2c03614af235", "score": "0.6665753", "text": "def index\n @creditcards = Creditcard.find(:all, :conditions => [\" client_id = ?\", session[:id] ])\n #@creditcards=Creditcard.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { r...
[ { "docid": "586e91ba6e1028285115a29552d0fd35", "score": "0.69793123", "text": "def get_credit\n path = @constants::PATH_CREDIT\n data = user_hash\n request @domain, path, data\n end", "title": "" }, { "docid": "190970c432e0a096c840e5eddd1c4012", "score": "0.68581694", ...
383c13257bda0bd39c5e37782e3c44a1
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.user_mailer.sponsor.subject
[ { "docid": "b3b49cd85b8f3e62b9e11b05982ce01d", "score": "0.0", "text": "def sponsor(user,level)\n \n @user = user\n @level=level\n @sponsor = case level\n when 1 then user.sponsor\n when 2 then user.sponsor.sponsor\n when 3 then user.sponsor.sponsor.sponsor\n when 4 then user.spon...
[ { "docid": "ea740e704e8f1173fb87b45dfcaaf989", "score": "0.7634146", "text": "def subject_for(key)\n I18n.t(:subject, scope: [:mailer, key])\n end", "title": "" }, { "docid": "542885bb44aabef24a05ce9d9749449c", "score": "0.7490219", "text": "def subject_for(key)\n I18n.t(:...
e10d92cd47158b79abaa9301904024ac
Returns the pod target for the pod being validated. Installation must have occurred before this can be invoked.
[ { "docid": "0a03fa7f8d2e5900007804093dd15707", "score": "0.79384655", "text": "def validation_pod_target\n @installer.pod_targets.find { |pt| pt.pod_name == spec.root.name }\n end", "title": "" } ]
[ { "docid": "7177b8f8aa834d1a7288abadd25f28a7", "score": "0.61727417", "text": "def target_version\n if target && target.respond_to?(:root_spec)\n version = target.root_spec.version\n [version.major, version.minor, version.patch].join('.')\n else\n '1.0.0'\n ...
9eda9d0ea7cfdfd2d0a72c45dc26bfe7
GET /styles GET /styles.xml
[ { "docid": "c2673ea45a44cc59a87934a856e605a5", "score": "0.57502294", "text": "def index\n @setting = @global_settings\n @styles = Style.find(:all, :order => \"created_at DESC\")\n end", "title": "" } ]
[ { "docid": "e1b838d4f1101a44b42b9359559cd85b", "score": "0.68936527", "text": "def index\n @stylesheets = Stylesheet.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @stylesheets }\n end\n end", "title": "" }, { "docid": ...
c59b741707c17f8f8ef59133c6f25508
True when the directive has no visible children.
[ { "docid": "fc03950593fd98048fc59a574ab71957", "score": "0.0", "text": "def invisible?; end", "title": "" } ]
[ { "docid": "9c21e256ff62eefd4e5abcb24856dadd", "score": "0.76428586", "text": "def invisible?\n children.all? {|c| c.invisible?}\n end", "title": "" }, { "docid": "9c21e256ff62eefd4e5abcb24856dadd", "score": "0.76428586", "text": "def invisible?\n children.all? {|c| c.in...
e66877d7ca0c1ffa859ca356734df892
Displays to the screen the previous attempts to the screen and the hidden word.
[ { "docid": "32732b325a6b7a5437172ad86d3ff473", "score": "0.67128855", "text": "def display_hidden_and_attempts\n puts \"You have guessed: #{@attempts}\"\n puts @hidden_word.join(' ')\n end", "title": "" } ]
[ { "docid": "12c5a0309dd38284ddbf5ad46f318ff3", "score": "0.72985566", "text": "def hidden_display last_guess = nil\n update_display(last_guess) unless last_guess.nil?\n puts @hidden_secret_word\n end", "title": "" }, { "docid": "df1aa6c468d9b48d4edb2960e9bc1218", "score": "0.67885...
1e373ba79f58ca3a7e7988e2dddc9590
Payment form for Transparent Redirect Displays a payment form using the Samurai Rails helpers bundled in the gem Payment form is initialized with PaymentMethod data, if a token is passed in the params. This allows validation & processorresponse error messages to be displayed.
[ { "docid": "a8b976eb833766848f9bb3dfa7bce693", "score": "0.8122786", "text": "def payment_form\n setup_for_transparent_redirect(params)\n end", "title": "" } ]
[ { "docid": "5385be43ff29d83bb932d97872794533", "score": "0.6685941", "text": "def payment_form_url\n \"#{host}/form/#{session_token}\"\n end", "title": "" }, { "docid": "2ee9e4992acc2d9d5ba55deb91c04caa", "score": "0.6640163", "text": "def new\n respond_with(payment_forms)...
e17e13e037feb1ed611ad20020e0851d
GET /venues GET /venues.json
[ { "docid": "be5c17948464738025f58ba6fa273216", "score": "0.0", "text": "def index\n @neighborhoods = Neighborhood.all_cached.to_a\n\n @venue_array = @venues.all_cached.order(\"name ASC\").to_a\n end", "title": "" } ]
[ { "docid": "aee67b4d86302510ce183fc6e7df12c6", "score": "0.78412294", "text": "def venues(options = {})\n self.class.require_latitude_and_longitude(options)\n\n response = self.class.get(\"/venues.json\", :query => options, :basic_auth => @auth)[\"venues\"]\n response && response.flatten\n end...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "99695f0da4cb75ef4a320ee26706b4df", "score": "0.0", "text": "def inclusion_params\n params.require(:inclusion).permit(*atributos_form)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74968386", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6958337", "text": "def strong_params\n params.require(:request).permit(param_whit...
7893c4aa31ec39c6f7d15729ac0a1300
Victory screen. Final method if player survives all methods
[ { "docid": "f78a6c33dd70bc04a54866b0bf7809ba", "score": "0.61206275", "text": "def game_victory\n \"You made it!!!!!!\\n\".colorize(:blue).each_char { |c| putc c; $stdout.flush; sleep 0.1 }\n sleep(2.0)\n scenic_view\n sleep(0.7)\n \"\\n!You survived the Zombie Apocalypse! Off to the pub ...
[ { "docid": "25e5434ecfa8feb10540ce5f921e37a6", "score": "0.6851438", "text": "def win_game\n @mode = :game_won\n @viewer.handler = self\n display_victory\n end", "title": "" }, { "docid": "c48397676bbc595b62051b2b056e8ceb", "score": "0.6761763", "text": "def victory...
56d525084b689ec01922c5e9a3ecfd5c
POST /admin/ad_modifies POST /admin/ad_modifies.json
[ { "docid": "1a152e5196712c53a1b331df7454cd42", "score": "0.0", "text": "def create\n #先查找表里有没有ad_modify字段,有就直接修改,没有就新建\n ad_modifies_pre = \"AD_MODIFY_\"\n @ad_modify_image = ConfigTableInfo.where(\"cf_id = ?\",\"#{ad_modifies_pre}IMAGE\").first\n unless @ad_modify_image.blank?\n @ad_mo...
[ { "docid": "b3b623da5cae8c11b8f281f3f15e0ed5", "score": "0.6801948", "text": "def update\n respond_to do |format|\n if @ad_modify.update(ad_modify_params)\n format.html { redirect_to [:admin, @ad_modify], notice: 'Ad modify was successfully updated.' }\n format.json { head :no_cont...
c3ffdc668958ea5b911bcc94717cf4e8
temporary override, just for logging purposes.
[ { "docid": "14af2c778f51349460c24f997e773ad2", "score": "0.0", "text": "def commit(action, parameters)\n response = parse( ssl_post(url_for(action), post_data(action, parameters)) )\n\n File.open(\"/tmp/protx\", \"a\") do |f|\t\t\t# careful on permissions!\n f.puts \"\\n\\n\\n ***...
[ { "docid": "a2fbf97f12d2c95e4f3b3916eb5e2776", "score": "0.6969364", "text": "def logging; end", "title": "" }, { "docid": "c687e4f53d05a7894d76dec3e161504b", "score": "0.6925979", "text": "def logBase; end", "title": "" }, { "docid": "555187d916776e63b80f33763f4125e6", ...
8ccbd9a2b299cf51a51ae69553c36746
GET /employee_reports GET /employee_reports.json
[ { "docid": "326a2f42d34f090797314dd9200af414", "score": "0.673807", "text": "def index\n @employee_reports = current_user.employee_reports.all.order(\"created_at DESC\")\n end", "title": "" } ]
[ { "docid": "b2ae71bb133718f1791135891b334767", "score": "0.7303591", "text": "def report\n @employee = Employee.find(params[:id])\n end", "title": "" }, { "docid": "73ef8cbce95ca1f1c77f49120b3afd87", "score": "0.7054185", "text": "def report\n @events = Event.order :punchtime\...
d9d1149f44abc4dc1de6cee41b95b6bb
text It is a wrapper method for selenium text ==== returns String value
[ { "docid": "66d9088b6b94aa44eb1ae8fefcac6975", "score": "0.8059118", "text": "def text(driver = $focus_driver)\n return driver.find_element(self).text\n end", "title": "" } ]
[ { "docid": "cd17407c8a13cd5a311615ed3e6099ea", "score": "0.80484223", "text": "def text\n driver.text\n end", "title": "" }, { "docid": "5730c724c1ad1d9e0a2d19fcae3ad38a", "score": "0.8030951", "text": "def text(driver = $focus_driver)\n driver.find_element(self).text\n e...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "be9a11b8c32aa8119608b45f514964df", "score": "0.0", "text": "def get_user\n\t\tif !session[:user_id]\n\t\t\t@user = nil\n\t\telse\n\t\t\t@user = User.find(session[:user_id])\n\t end\n\tend", "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;...
d041116def158938aad1df72034c0c5e
Sleep / Wake notifications TODO: Not yet used in timer retiming
[ { "docid": "760f27c89b94ed99eb235f0b3bc6554d", "score": "0.6198321", "text": "def receiveSleepNote(notification)\n Logger.debug(\"Zzzzz\")\n end", "title": "" } ]
[ { "docid": "a8f1bde32c7eea9a16fcac62dc828db3", "score": "0.7588245", "text": "def setupSleepWakeNotifications()\n NSWorkspace.sharedWorkspace.notificationCenter.addObserver(self, selector:\"receiveSleepNote:\", name: NSWorkspaceWillSleepNotification, object: nil)\n NSWorkspace.sharedWorkspace.noti...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "e2a78d51a0446773de50a85be9872db5", "score": "0.0", "text": "def set_suscriber\n @suscriber = Suscriber.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163754", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045816", "text": "def action_hook;...
f3a69c21b840cb8e5fe0492853af0b3d
Responds with true if Private Working Copies are updateable, false otherwise (if false the PWC object can only be updated during the checkin)
[ { "docid": "ffd87b8dde05f2edba517262095fda54", "score": "0.77085406", "text": "def pwc_updatable?\n capabilities[\"PWCUpdatable\"]\n end", "title": "" } ]
[ { "docid": "89e3e969387e160efc26adce53d930db", "score": "0.67424047", "text": "def update?\n if @user.can?(Pirep, :update)\n true\n elsif (@record.pilot == @user) && @record.status.editable?\n true\n end\n end", "title": "" }, { "docid": "ea741bf29f276f786a1067e19bc806b1"...
c24461f160979ff53677f4217f87f72a
Is this case seen by any of the passed names?
[ { "docid": "bf1e2da5ce5dc46711c4778ca0799a75", "score": "0.0", "text": "def seen_by(names)\n all_names = self.viewers.map(&:name)\n all_names = all_names.map{|n| n.downcase }\n names.split(\",\").each do |name|\n all_names.include?(name.downcase.strip)\n end\n end", "title": "" }...
[ { "docid": "718339839852e5253f3e6d094fcf13bc", "score": "0.71474636", "text": "def use_name?(*names)\n return @match.use_name?(*name)\n end", "title": "" }, { "docid": "06b0371a722f0eb040c724272a81fe30", "score": "0.70168626", "text": "def any_name?\n\t\t@ida.has_an...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "b109bd3f7e11cc76e6d827dfd8623012", "score": "0.0", "text": "def recipe_params\n params.require(:recipe).permit(:upload_photo, :recipe_name, :description, :prep_time, :cook_time, :ingredients, :instructions, :source)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.7122858", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.70540553", "text": "def expected_permitted_parameter_names; end", "title": "...
1ee9e115cfd91763a67a473674d6dd46
Find specific router instance with this name
[ { "docid": "f7aaadf421ce8bcdbd3a3de257946b99", "score": "0.61491954", "text": "def load_current_resource\n @router = Cisco::X__CLASS_NAME__X.routers[@name]\n end", "title": "" } ]
[ { "docid": "f99d1005e8ee4b46dcf1cb7bc489d4ba", "score": "0.74915034", "text": "def get_router(name)\n Logging.state(\"Searching for router '%s'\" % [name] )\n begin\n routers = controler.query(:router, {:name => name})\n case routers.length()\n when 1\n ...
2b14ff5ecb135be27963e614a04f3008
Sets the multipageLayout property value. The default direction to lay out pages when multiple pages are being printed per sheet. Valid values are described in the following table.
[ { "docid": "58d70c736f4282e372c75f03b49e1740", "score": "0.798186", "text": "def multipage_layout=(value)\n @multipage_layout = value\n end", "title": "" } ]
[ { "docid": "112e32241167fcbf55f0d8318549d1ef", "score": "0.65318066", "text": "def multipage_layout\n return @multipage_layout\n end", "title": "" }, { "docid": "112e32241167fcbf55f0d8318549d1ef", "score": "0.65318066", "text": "def multipage_layout\n ...
316d9fa173bbeb3629cfcdc1ce67394e
function to process each line of a file and extract the song titles
[ { "docid": "e451f5b37211baef0fa613da61cb7165", "score": "0.0", "text": "def process_file(file_name)\n\tputs \"Processing File.... \"\n\n\tbegin\n\t\tif RUBY_PLATFORM.downcase.include? 'mswin'\n\t\t\tfile = File.open(file_name)\n\t\t\tunless file.eof?\n\t\t\t\tfile.each_line do |line|\n\t\t\t\t\t# do som...
[ { "docid": "0046229efaef44a20e81380287029250", "score": "0.7167768", "text": "def extract_data(song)\n # Songs have to start with the header, so the next is true\n in_header = true\n\n song.split(\"\\n\").each do |line|\n # Ignore comments. Never hurts to have comments in a file format\n next i...
f69f8bf6c90ec921cce76ccd912271d6
patch the value of an argument only valid in pre_hook nr starts at 0
[ { "docid": "d777724cc1aa13e48a8e2e942a2632ce", "score": "0.69987136", "text": "def patch_arg(nr, value)\n\t\tcase @cur_abi\n\t\twhen :fastcall\n\t\t\tcase nr\n\t\t\twhen 0\n\t\t\t\t@dbg.set_reg_value(:ecx, value)\n\t\t\t\treturn\n\t\t\twhen 1\n\t\t\t\t@dbg.set_reg_value(:edx, value)\n\t\t\t\treturn\n\t\...
[ { "docid": "92dba760684e81f7a6d13f7321f8856d", "score": "0.71472555", "text": "def before_value=(_arg0); end", "title": "" }, { "docid": "2c397f68d8ce1289227d109e61c043e5", "score": "0.6883082", "text": "def before=(_arg0); end", "title": "" }, { "docid": "c0a09e8836dc5b0...
3dfaccc1f3576121d4dc8d8c6466afee
Gets world data: country = Country ID Returns SerializeparsePlayerWorld
[ { "docid": "471d1b3caca73c4d2000ef1ab31c1ec7", "score": "0.82731473", "text": "def cmdPlayerWorld(country)\n params = {\n \"player_get_world\" => 1,\n \"id\" => @config[\"id\"],\n \"id_country\" => country,\n \"app_version\" => @con...
[ { "docid": "11d74869ed15a98d8fa25e4bad38387a", "score": "0.62478906", "text": "def get_world(options: {})\n\n World.new(parse(client.get(\"/unicorns/#{gid}/getWorld\", options: options)).first, client: client)\n end", "title": "" }, { "docid": "fa1d75ff7d28c83a4ec4ccf49e12972e", ...
dde3a650c21a16ef7da6067c7afb63b2
Method called externally by the world_state object whenever the timestamp increases
[ { "docid": "c61f5ff2dab8d9e2de07e4cd00a54d8b", "score": "0.0", "text": "def timestamp_changed_signal(timestamp)\n timestamp_changed(timestamp)\n if timestamp > @creation_time\n if (@ticks % @granularity == 0) # Calculate every 1 hour\n\n now = Time.now\n @logger.info \"Current t...
[ { "docid": "46f1baabd8b729407731e0364c697a82", "score": "0.69575804", "text": "def time_tick timestamp\n\t @now = timestamp\n\t super\n\tend", "title": "" }, { "docid": "e61d38b25d403fd104b152fcf18b35a1", "score": "0.65776503", "text": "def update(elapsed)\n \n end", "title...
c74b591dea3638c6cd3874ca875ccba2
Checks that the url property is formatted correctly.
[ { "docid": "37749f69babbc33598087d8daa390680", "score": "0.7449614", "text": "def validate_url\n begin\n uri = ::URI.parse(self.url)\n if uri && uri.scheme == \"http\" || uri.scheme == \"https\"\n return true\n else\n return [false, \"Url must be properly formatted\"]\n ...
[ { "docid": "05b0b92cb19f43da4a5d9119c2439700", "score": "0.73934245", "text": "def validate_url\n uri = URI.parse(self.url)\n %w( http https ).include?(uri.scheme)\n rescue URI::BadURIError\n self.errors.add(:url, \"is not in the right format\")\n rescue URI::InvalidURIError\n self.errors....
7f1d6bdf0da48f46961d4c1105b44be1
Creates a new +Sniffer+ that assumes this Array contains the names of Ruby source files and examines those files for smells.
[ { "docid": "fa60354de36273fd271bae5ca49b732c", "score": "0.60910237", "text": "def sniff\n sniffers = paths.map {|path| File.new(path).sniff}\n Reek::SnifferSet.new(sniffers, 'dir')\n end", "title": "" } ]
[ { "docid": "3a92ab0ca7054fc902da3067f752283f", "score": "0.644276", "text": "def initialize(source, smell_types_to_filter_by = [])\n sources = Source::SourceRepository.parse(source)\n @description = sources.description\n @collector = Core::WarningCollector.new\n\n smell_types = Core:...
00ea73dfb631777b15e1c30cf7578be3
Pseudocode Input: an array Output: puts an array of arrays that contains the new groups and returns it. => Randomize array => Split the array => Fill any small groups => put the array and return it. Initial
[ { "docid": "80d598e397731096618022815f2b9d9b", "score": "0.6805853", "text": "def create_groups(people)\r\n\tlist = people.shuffle\r\n\tlist = list.each_slice(5).to_a\r\n\r\n\tfor i in 0..1\r\n\t\tif(list[-1].length < 3)\r\n\t\t\tlist[-1].push(list[0].pop)\r\n\t\tend\r\n\tend\r\n\r\n\tlist.each {|i| put...
[ { "docid": "eab7e7aaceafb32be7046462b1f790f5", "score": "0.80089617", "text": "def create_groups(array)\n\tArray.new(array.shuffle.each_slice(4).to_a)\nend", "title": "" }, { "docid": "9b36425e51339be74fb5094e48ffe1d5", "score": "0.79585534", "text": "def get_groups(array)\n\tmaster_...
ced4339aed216b84c09745da176f97ce
Ensure usage of cancelled_requests is threadsafe via synchronization!
[ { "docid": "61d807927c234f2635addcbb4b06adcf", "score": "0.79329294", "text": "def cancelled_requests; end", "title": "" } ]
[ { "docid": "2f66c84696378ee3fb1b31e31d1ba2c2", "score": "0.77038634", "text": "def cancelled_requests\n @cancelled_requests ||= []\n end", "title": "" }, { "docid": "f578b5226ddcc911ea341529b2fd52f6", "score": "0.69566536", "text": "def cancel!\n update(request_can...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "df45d8d5abce918c76ee506c965a8b7b", "score": "0.0", "text": "def partida_parcial_params\n params.require(:partida_parcial).permit(:codigo, :nombre, :partida_principal_id)\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...
6fbffb458c477d4f5026c6f2d674861b
Invokes the Try object's block.
[ { "docid": "3c5e540f320cf4ed5bd44b6bd4382a63", "score": "0.0", "text": "def __invoke__ *args\n begin\n instance_exec *args, &__bl__\n rescue ::StandardError => err\n txt1 = \"When trying #{__txt__}\"\n thing, statements = __describe__\n txt2 = DECORATE.( thing, pref...
[ { "docid": "165d3b8a15947a528fad1f17ac4b57ed", "score": "0.65420395", "text": "def call(&block)\n execute(&block) if valid?\n execution_attempted!\n self\n end", "title": "" }, { "docid": "014f8b6af65698d53919ee224bdd1863", "score": "0.6495753", "text": "def try_cal...
1f827ea2f869952a55c85543c6f9c619
Alias to the data key (used frequently)
[ { "docid": "120b18e584bd43b227b94361df5d9479", "score": "0.6656916", "text": "def [](key)\n data[key]\n end", "title": "" } ]
[ { "docid": "d9e06598155c0896fd7aad08c1fdf2fd", "score": "0.7027025", "text": "def [](k) data[k.to_sym] end", "title": "" }, { "docid": "7ecaad20213dcb4d5dad90e0fce6ee38", "score": "0.6976837", "text": "def [](key)\n @data[@aliases[key]]\n end", "title": "" }, { "d...
216e6ad33adb8ebc13b85434d5e31854
Extract Evaluation Context from an element
[ { "docid": "6448a6094c939b67f6ce05bdd0637bd8", "score": "0.0", "text": "def extract_from_element(el)\n b = el.attribute_with_ns(\"base\", RDF::XML.to_s)\n lang = el.attribute_with_ns(\"lang\", RDF::XML.to_s)\n self.base = self.base.join(b) if b\n self.language = lang if lang\...
[ { "docid": "3f2d53bdd9051fc4bac91858799d9a23", "score": "0.6645743", "text": "def context_for_eval\n context\n end", "title": "" }, { "docid": "257ded6512159ca5d8bd9ad5cec9128f", "score": "0.61851186", "text": "def context\n @elements\n end", "title": "" }, ...
f87d30514a125b5f0087fccf05317cb5
target number. The function twoSum should return indices of the two numbers such that they add up to the target, where index1 < index2. Please note that your returned answers (both index1 and index2 ) are not zerobased. Put both these numbers in order in an array and return the array from your function ( Looking at the...
[ { "docid": "fecf5f89421139d3d0adbca9f02e2364", "score": "0.7620038", "text": "def two_sum(arr, target)\r\n hash = {}\r\n arr.each_with_index do |num, idx|\r\n hash[num] = idx if !hash[num]\r\n return [hash[target-num], idx] if hash[target-num]\r\n end\r\n nil\r\nend", "titl...
[ { "docid": "3e6ff89594187570c94a0af7236bec26", "score": "0.8386268", "text": "def two_sum(numbers, target)\n\tpair = numbers.combination(2).to_a.find {|pair| pair.sum == target }\n\t[numbers.index(pair.first), numbers.index(pair.last)]\nend", "title": "" }, { "docid": "8f53266a6ce6481cba3ef9...
620931acfd1a89a00e1482378541e55f
Outputs nonarray value in the form of hash For object, use to_hash. Otherwise, just return the value
[ { "docid": "25a8636255f6e4c5e0c6eac38d3fe98c", "score": "0.0", "text": "def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map { |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsi...
[ { "docid": "a34f3dad821ba9744bc8d807b65489ad", "score": "0.6719518", "text": "def hash\n [value].hash\n end", "title": "" }, { "docid": "a34f3dad821ba9744bc8d807b65489ad", "score": "0.6719518", "text": "def hash\n [value].hash\n end", "title": "" }, { "doc...
6d2a259932f24e23e0cef181dab8e82a
GET /pledges/1 GET /pledges/1.xml
[ { "docid": "4de828557f3124144efb9575eb76b10e", "score": "0.52671355", "text": "def show\n @pledge = Pledge.find(params[:id])\n\n respond_to do |format|\n format.html show.html.erb\n format.xml { render :xml => @pledge }\n end\n end", "title": "" } ]
[ { "docid": "d130b0b3401b9ad649360c4934e3476a", "score": "0.6455975", "text": "def index\n @pledges = current_user.pledges\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pledges }\n end\n end", "title": "" }, { "docid": "3c95aeb14...
50d61268122818d652784535206839e5
GET /slopes/1 GET /slopes/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "dbc64c8256b78a269c0001e9ff022a97", "score": "0.71886253", "text": "def set_slope\n @slope = Slope.find(params[:id])\n end", "title": "" }, { "docid": "4b5142f60b376a87b7371e7da3a43d0e", "score": "0.7030593", "text": "def slope\n\t\t\tprop = Property.new(offset: ge...
0a43718ef0f52aa900c55e73a957a812
DELETE /offerings/1 DELETE /offerings/1.json
[ { "docid": "1b5dbe0b891afbefd9bf463fcd5c3707", "score": "0.76992434", "text": "def destroy\n @offering = Offering.find(params[:id])\n @offering.destroy\n\n respond_to do |format|\n format.html { redirect_to offerings_url }\n format.json { head :no_content }\n end\n end", "titl...
[ { "docid": "890503be718243d93cb0497238fc2dba", "score": "0.79170203", "text": "def destroy\n @offer.destroy\n respond_to do |format|\n format.jsonapi { head :no_content }\n end\n end", "title": "" }, { "docid": "890503be718243d93cb0497238fc2dba", "score": "0.79170203", ...
c6a0d8c2ed37d4e8c1f0dc76a4e8b4de
Iterates over the generated options tree to extract all the nested :except options into their own separate hash, removing :except keys from the original options tree hash.
[ { "docid": "364b29fedc99e57874e3ae19056debdf", "score": "0.6346365", "text": "def extract_exceptions_from(tree)\n exceptions = tree.delete(:except) || []\n nested_exceptions = {}\n\n tree.each do |key, value|\n next unless value.is_a?(Hash) && !value.empty?\n\n sub...
[ { "docid": "172faa46712296d391f2b5c09163a324", "score": "0.6907626", "text": "def options_from_tree(tree, options={})\n option_list = []\n depth = options[:depth] || 0\n exception = options[:except]\n tree.each_pair do |key, values|\n unless key == exception\n option_list << [\"....
b8e7c623c14edbf0085ca10c6b5a8135
Returns current balance if transaction is successful, raises an exception otherwise
[ { "docid": "0b7f66d811f9628e04527a7d29cd9602", "score": "0.0", "text": "def withdraw(amount)\n if has_enough_funds?(amount)\n self.amount -= amount\n self.save\n else\n raise NotEnoughFunds.new('There is not enough funds to process this transaction.')\n end\n end", "title": ...
[ { "docid": "fd36cd939d4b43b9640c4f0e3dbe2ac5", "score": "0.7644787", "text": "def balance\n return nil unless has_balance?\n\n return calculate_balance\n end", "title": "" }, { "docid": "9f08d447140921f0a8c26a25510e7e9f", "score": "0.7281476", "text": "def balance\n balance...
93cc50547ed3db3db195bf367b506b60
Construct a command that will attach the given session when run
[ { "docid": "2b37f270d1b57f8641979c48d6517c05", "score": "0.79783535", "text": "def attach_session_command(session)\n command('attach-session').flags(:t => session)\n end", "title": "" } ]
[ { "docid": "f7efd52da78f1fa02dd46dc9189c7cdb", "score": "0.66075844", "text": "def attach\n `tmux attach -t #{@session_name}`\n end", "title": "" }, { "docid": "a94cfad391b8b1ba2b48f0a507489b63", "score": "0.61123383", "text": "def attach_to(session_id, platform_name, automat...
86acf082f8f00e7eb985a0fd362ce71d
DELETE /post215s/1 DELETE /post215s/1.xml
[ { "docid": "8112aa72bd94d1533d9f1e41a74f7d47", "score": "0.7019796", "text": "def destroy\n @post215 = Post215.find(params[:id])\n @post215.destroy\n\n respond_to do |format|\n format.html { redirect_to(post215s_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "e1d6f603cb5ea1e475ea71422432aeae", "score": "0.7077203", "text": "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end", "title": "" }, { "docid": "69b205c158f7212cc750ed38fc878f1c", "score": "0.6911724", "text": "def delete()\n ...