query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
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.6721729", "text": "def hash\n [value].hash\n end", "title": "" }, { "docid": "a34f3dad821ba9744bc8d807b65489ad", "score": "0.6721729", "text": "def hash\n [value].hash\n end", "title": "" }, { "doc...
9d5c7bf61d18a94708301688fe22ef1d
Returns +true+ if the session cookie has been set.
[ { "docid": "9902ea581ea1e6c91c6671ce6a333c56", "score": "0.0", "text": "def authenticated?\n !!@authentication_headers\n end", "title": "" } ]
[ { "docid": "0103aa8c1dbd45b2fdbb9ea2cad925b0", "score": "0.76240903", "text": "def logged_in?\n return false unless @cookie\n true\n end", "title": "" }, { "docid": "0103aa8c1dbd45b2fdbb9ea2cad925b0", "score": "0.76240903", "text": "def logged_in?\n return false unl...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "e59cd1c2be2fca61b85ad593d2ccc1f9", "score": "0.0", "text": "def set_user_role\n @user_role = UserRole.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...
6c7855df00626d0af5353e9a11917d5b
Translates a string from wookiespeak to english using the dialect given to the initializer.
[ { "docid": "6274704ce679f5d4632df3213c9a7b33", "score": "0.0", "text": "def from_wookie(str)\n @dialect.from_wookie(str.to_s)\n end", "title": "" } ]
[ { "docid": "a49fb9b966d76a79836f75cedaa00c50", "score": "0.6624313", "text": "def to_en(text)\n translate( text, \"en\", \"\" )\n end", "title": "" }, { "docid": "20dbf811f3667b1a817bd68856d36184", "score": "0.66239315", "text": "def localize(str, locale)\n dict = dictio...
99af93de187dfe32d775bd8492871bb5
Gets the states that specify how we handle the "AcceptEncoding:" header. If set to false, we will strip the "AcceptEncoding:" header before passing the request on to the server (so that the server doesn't also compress the response). If it is set to true, we will leave the "AcceptEncoding:" header in the request so tha...
[ { "docid": "e9da36060f70805775bc65fcdd880607", "score": "0.72628194", "text": "def keep_accept_encoding_header_state\n super\n end", "title": "" } ]
[ { "docid": "71c2cbff73ab3a608a64ffeeced7ef4f", "score": "0.7101739", "text": "def set_keep_accept_encoding_header_state(opts)\n opts = check_params(opts,[:states])\n super(opts)\n end", "title": "" }, { "docid": "86605e89f8915c6bab7909cb9781c4c3", "score": "0.69404644", ...
2336df0fa281c0ef00551725e904b533
POST /clubs POST /clubs.json
[ { "docid": "037d02e7d954372d52f586070afc14a7", "score": "0.7065429", "text": "def create\n @club = Club.new(club_params)\n @club.players << current_player\n @club.player_id = current_player.id\n\n\n\n respond_to do |format|\n if @club.save\n format.html { redirect_to @club, notic...
[ { "docid": "b9083b41b6ab16a27b62005fed10027e", "score": "0.7858204", "text": "def create\n club = Club.new(club_params)\n if club.save\n render json: club, status: 201, location: [:api, club]\n else\n failed_to_create(club, \"club\")\n end\n end", "title": "" }, { "doc...
639eee2c836a439df75ac400bc915c50
Sets the isHybridAzureADJoinedDeviceAccepted property value. Specifies whether hybrid Azure AD joined devices from external Azure AD organizations are trusted.
[ { "docid": "87a833f2bd59a7948a2ad0181177991e", "score": "0.72725433", "text": "def is_hybrid_azure_a_d_joined_device_accepted=(value)\n @is_hybrid_azure_a_d_joined_device_accepted = value\n end", "title": "" } ]
[ { "docid": "c6637b5f83818bdcc1dce23f0aefd5ed", "score": "0.6678436", "text": "def is_hybrid_azure_a_d_joined_device_accepted\n return @is_hybrid_azure_a_d_joined_device_accepted\n end", "title": "" }, { "docid": "2fa14b997da953e13285926b814e4b08", "score": "0.52...
ef864c73d6d1748fc14985769391f34e
A method to call from bookingsupdate or from waitlistsupdate This keeps all the smarts in one place
[ { "docid": "3e57f862cf9705d3cb65f5751c11bbbb", "score": "0.65948784", "text": "def update_booking_waitlist(booking, waitlist, record_parameters)\n\n # Get some basic info we use several places below\n tour_id = record_parameters[:tour_id].to_i\n num_seats_already_booked = booking ? booking.num_...
[ { "docid": "a120f1483135a2cac027dea96d3a9843", "score": "0.6536822", "text": "def update\n\n # Bookings edit page does double-duty (booking / waitlist)\n @booking, @waitlist = get_booking_and_waitlist_from_params(params)\n update_booking_waitlist(@booking, @waitlist, waitlist_params)\n\n end",...
725ac8b15cc761b84e66d88590dd6940
clear out any saved input/output parameters and set directly from WDL
[ { "docid": "bc1585b65a728946df4f8135d8b4431c", "score": "0.66141295", "text": "def reset_wdl_params\n @reference_analysis.load_parameters_from_wdl!\n redirect_to reference_analysis_path(@reference_analysis), notice: \"'#{@reference_analysis.display_name}' required parameters successfully reset.\"\...
[ { "docid": "59e57352f2dab2273fe898dca1383f40", "score": "0.66667676", "text": "def clear\n @params.clear\n @dparams.clear\n @amp_vals.clear\n @norm_vals.clear unless @norm_vals.nil?\n end", "title": "" }, { "docid": "1854bc469b1a5f37672e1317afb6373f", "score": "0.6...
12d5e1f89db8d45b579eb702b31eedb8
Run the initialization process. If a block is given to this method, the application's configuration object will be yielded to the block after the environment has been loaded. This allows the user to override enironmental configuration settings at runtime.
[ { "docid": "c95305913d9fed3b076136d347defb8f", "score": "0.785163", "text": "def process( *args, &block )\n load_environment\n block.call(@config) unless block.nil?\n @config.initializers.each {|init| self.send \"initialize_#{init}\"}\n self\n end", "title": "" } ]
[ { "docid": "647f71b6fd5d94966669970458ce54e9", "score": "0.7546127", "text": "def process( &block )\n Logtastic.configuration = configuration\n\n load_environment\n block.call(Logtastic.configuration) unless block.nil?\n configuration.initializers.each {|init| self.send \"initialize_...
2d64c367a523d083660899a108720e5a
:callseq: contact.ip_addresses(interface=nil) Returns all of contact's IP addresses, or if an interface is supplied as an argument, just the IP addresses for that interface. Pass true as the second argument to prevent a lookup of interfaces, pass true as the third argument to prevent a lookup of IP addresses, and inste...
[ { "docid": "10979864bd13d5dd8d6fd75b057b464a", "score": "0.7420077", "text": "def ip_addresses(interface=nil, resolve_cache=nil, use_cache=nil)\n getaddrinfo(resolve_cache) unless use_cache\n if interface\n @interface_addresses[interface]\n else\n @interface_addresses.values...
[ { "docid": "83a71f38b815e0587fb634a47127903d", "score": "0.6884397", "text": "def pif_addresses(node, interface=nil)\n addresses = []\n begin\n node['network']['interfaces'].each do |eth, opts|\n # if interface is not matched and no-scrambled search performed\n ...
07fc1bd21601fd4b8cf5dcf9879879fc
PATCH/PUT /stag_prices/1 PATCH/PUT /stag_prices/1.json
[ { "docid": "e35d1824c366abdd7a02e66d24049314", "score": "0.70570475", "text": "def update\n respond_to do |format|\n if @stag_price.update(stag_price_params)\n format.html { redirect_to @stag_price, notice: 'Stag price was successfully updated.' }\n format.json { render :show, stat...
[ { "docid": "fc30dad73497718dc5bc1f192ccbebe2", "score": "0.66448283", "text": "def update\n @supermarket = Supermarket.find(params[:id]) \n respond_to do |format|\n if @supermarket.update(supermarket_params)\n format.json { render json: @supermarket, status: :ok }\n end\n end\...
50af3a93947a4ba3e4d76eb949288f11
Summarize a referent for a table, with its name, and summaries of its expressions, relations and affiliates Options: :header, if truthy, says to generate a header from the referent's identifier :label labels the name (defaults to the referent's type name)
[ { "docid": "d7f6eb882e623f0684a86831317e92cd", "score": "0.52934986", "text": "def referent_summary ref, options={}\n header =\n if options[:header] || options[:label]\n referent_identifier ref, options[:label]\n else\n 'Topic: '.html_safe +\n homelink(ref, title: ref.name) +...
[ { "docid": "4f4c17e5e548000e3130c74b99f3f05f", "score": "0.59522235", "text": "def summaries\n header = summarize_per.header\n summaries = default_summaries\n operand.each { |tuple| summaries.summarize_by(header, tuple) }\n summaries\n end", "title": "" }, { ...
bfee788e70a6d76c6bef5b56d0cb0949
GET /lab_courses/1 GET /lab_courses/1.json
[ { "docid": "64989e62bfd4149c56ec3409aee17666", "score": "0.74987066", "text": "def show\n @lab_course = LabCourse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lab_course }\n end\n end", "title": "" } ]
[ { "docid": "cf89c2f9861e230239acff8f67c9bafb", "score": "0.73108286", "text": "def courses\n @courses = Course.where(faculty_id: params[:faculty_id]).order(:name)\n respond_to do |format|\n format.json { render json: @courses }\n end\n end", "title": "" }, { "docid": "3ca604c0...
bef8d79750ddf632fb0508b8c3218701
Get detected catalog columns during this importation.
[ { "docid": "4d57cfed52dc7e9101d14cf1be663c94", "score": "0.0", "text": "def importation_get_detected_catalog_columns_with_http_info(store_id, execution_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ImportationCatalogInfoApi.importation_get_...
[ { "docid": "f35b070551f61edf54bd41a37e3ee05b", "score": "0.7377659", "text": "def importation_get_detected_catalog_columns(store_id, execution_id, opts = {})\n data, _status_code, _headers = importation_get_detected_catalog_columns_with_http_info(store_id, execution_id, opts)\n return data\n ...
3ce9e1b7dbe7575d50c2dc3047b3b934
Release 2: Change an Attribute with a Method
[ { "docid": "36c6f61790ef7a53d67b23621b8d4a07", "score": "0.0", "text": "def celebrate_birthday\r\n @age = @age + 1 # +=1 \r\n end", "title": "" } ]
[ { "docid": "030950bca9f426bf8c0868161d1c9e84", "score": "0.7674682", "text": "def attribute_change(attr_name); end", "title": "" }, { "docid": "030950bca9f426bf8c0868161d1c9e84", "score": "0.7674682", "text": "def attribute_change(attr_name); end", "title": "" }, { "docid...
b10689210aa4a9d9d31f2d0a87157e4a
The Amazon Resource Name (ARN) specifying the group. For more information about ARNs and how to use them in policies, see [IAM Identifiers][1] in the Using IAM guide. [1]:
[ { "docid": "bc1f0bdc67d702f1bf70f619a116d6b2", "score": "0.0", "text": "def arn\n data.arn\n end", "title": "" } ]
[ { "docid": "cee14747eda4435b56a3eff9ac6b4f8b", "score": "0.7047289", "text": "def group_arn\n data[:group_arn]\n end", "title": "" }, { "docid": "2d23141bf4f433bf52df9ed59844e267", "score": "0.6784102", "text": "def auto_scaling_group_arn\n data[:auto_scaling_group_arn]\...
ad113aacfd55be3a22020e909cd9317c
Helper method for writing a file using a template from the templates directory
[ { "docid": "20788fe89c9490151d5196a613dbfcf6", "score": "0.7907862", "text": "def write_file(file_name, template_name, mode = 'w')\n puts \"* #{file_name}\"\n File.open(file_name, mode) do |f|\n f.write(ERB.new(File.read(\"#{HERE}/templates/#{template_name}\")).result)\n end\nend", "...
[ { "docid": "5726052e64d44fccd1fe0f0a62a0216b", "score": "0.80441904", "text": "def template_to_file (tpl_name, fname, dname = \"\")\n fw = File.open File.join(@source.root, dname, fname), \"w\"\n fw.puts template tpl_name, dname\n fw.close\n end", "title": "" }, { "docid": ...
7c5f9e4092a4c0cb096f0930d5ea2f91
POST /settings POST /settings.json
[ { "docid": "d5326ccaca091657d7f9b5388eec1bca", "score": "0.67200017", "text": "def create\n\n @setting = Setting.new(\n :tenant => Tenant.current,\n :user => current_user,\n :name => params[:name],\n :value => params[:value])\n\n respond_to do |format|\n if @setting.save\n...
[ { "docid": "ce5b03d270173f7774df44c7169ed4b7", "score": "0.79205394", "text": "def settings\n request(Resources::RESOURCE_SETTINGS, HTTP_METHOD_POST)\n end", "title": "" }, { "docid": "8b4dfa3b42372da8043910da1ef5835c", "score": "0.7139767", "text": "def settings\n get('...
ab8807779402809ec8602b9bfff2c1a2
PATCH/PUT /wbs/1 PATCH/PUT /wbs/1.json
[ { "docid": "9134d1a22751cca843b7fb8765c6c393", "score": "0.65329015", "text": "def update\n respond_to do |format|\n if @wb.update(wb_params)\n format.html { redirect_to @wb, notice: 'Wb was successfully updated.' }\n format.json { head :no_content }\n else\n format.htm...
[ { "docid": "09fb203d8961ffe4e945942ee6cf9149", "score": "0.6642819", "text": "def update\n if @wod.update(wod_params)\n render json: @wod\n else\n render json: @wod.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "01a8bff90353eee2821f320bae09...
dcb61ea51e8aac74a05ea29d494ca9d6
GET /work_areas/1 or /work_areas/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "c290e9d08463e74541536eed35caf7d6", "score": "0.6672238", "text": "def show\n @breadcrumb = 'read'\n @work_order_area = WorkOrderArea.find(params[:id])\n @worker_orders = @work_order_area.work_orders.paginate(:page => params[:page], :per_page => per_page).order(:order_no)\n ...
19a1f096a55f6ef5611f964e9e1e0b0d
GET /sale_offer_statuses_statuses GET /sale_offer_statuses_statuses.json
[ { "docid": "f659a21cc8bfbcf717b20cfe2f2e27e3", "score": "0.6547655", "text": "def index\n manage_filter_state\n @sale_offer_statuses = SaleOfferStatus.paginate(:page => params[:page], :per_page => per_page || 10).order(sort_column + ' ' + sort_direction)\n\n respond_to do |format|\n ...
[ { "docid": "04fa560d2fe78668c23dd4918c43e16a", "score": "0.7323107", "text": "def product_statuses\n url = \"#{@url}reference/product-statuses\"\n make_request(url)\n end", "title": "" }, { "docid": "41908d54cf3c90081c90606a5fb39df0", "score": "0.69523", "text": "def index\n ...
c379477605a8a9f7443f00391e724c8a
PUT /coments/1 PUT /coments/1.json
[ { "docid": "0e49af1e85df3a00461e7f3c33899bcb", "score": "0.6426233", "text": "def update\n @coment = current_user.coments.find(params[:id]) # busca solo en sitios asociados a current_user\n # @coment = Coment.find(params[:id])\n\n respond_to do |format|\n if @coment.update_attributes(param...
[ { "docid": "1aa7da3b07b7ff034cee05ae499ea499", "score": "0.6689027", "text": "def update\n @coment = Coment.find(params[:id])\n\n respond_to do |format|\n if @coment.update_attributes(params[:coment])\n format.html { redirect_to @coment, notice: 'Coment was successfully updated.' }\n ...
8b107a90701506ce862d26b3516afbbe
player has completed a haste round
[ { "docid": "591341b7719a8291361b0ffd79822916", "score": "0.0", "text": "def complete\n score = completed_haste_round_params[:score].to_i\n if user_signed_in?\n if score > 0\n current_user.completed_haste_rounds.create!(score: score)\n end\n best = current_user.best_haste_scor...
[ { "docid": "3353e4976c69ae97a28bfdb904f7da50", "score": "0.6905864", "text": "def end_round\n\t\tshow_hands unless round_over? \n\t\tremaining_hands = players.reject{ |p| p.folded? }\n\t\t.map{|p| p.hand }\n\t\twinner = Hand.highest_hand(remaining_hands)\n\t\twinner.take_winnings(@pot)\n\t\t\n\t\tputs \...
84840720553a6d0bba097615144b5787
DELETE /matches/1 DELETE /matches/1.json
[ { "docid": "4756197ab3a892c98aaa9c944608762b", "score": "0.74096155", "text": "def destroy\n @match.destroy\n respond_to do |format|\n format.html { redirect_to matches_url, notice: 'Match was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": ""...
[ { "docid": "c99b5c93f6aa91fa206958413b6d4679", "score": "0.77277064", "text": "def destroy\n @match = Match.find(params[:id])\n @match.destroy\n\n respond_to do |format|\n format.html { redirect_to matches_url }\n format.json { head :no_content }\n end\n end", "title": "" },...
54f96f8ad239440289489337691516da
DELETE /parents/1 DELETE /parents/1.json
[ { "docid": "e60dc5478336e0a8ded87ade297d5d12", "score": "0.0", "text": "def destroy\n Attendance.find(params[:id]).destroy\n redirect_to :action => 'index'\n end", "title": "" } ]
[ { "docid": "8ee5fb0fdaf84ddaf93aea40444b4099", "score": "0.77786523", "text": "def destroy\n @parent = Parent.find(params[:id])\n @parent.destroy\n\n respond_to do |format|\n format.html { redirect_to parents_url }\n format.json { head :no_content }\n end\n end", "title": "" ...
6c27f18d47cce8e938902a0af1d78c31
GET /credit_applications GET /credit_applications.json
[ { "docid": "0a33efab20682fc1ffa6bd9e47194a56", "score": "0.76745933", "text": "def index\n @credit_applications = CreditApplication.all\n end", "title": "" } ]
[ { "docid": "d9240480a0eba9d3120b5e82d8b714b7", "score": "0.70098925", "text": "def applications_list\n get \"applications\"\n end", "title": "" }, { "docid": "e83fdd1f355311f7631d2958220b9d40", "score": "0.6725762", "text": "def get_applications\n http_get_request(Scalar...
9070dbc98f65f28854e7b35f494f70b8
reduce 593 omitted reduce 594 omitted reduce 595 omitted reduce 596 omitted
[ { "docid": "19d7b48a2a3d8b4e36418497c49ab305", "score": "0.0", "text": "def _reduce_597(val, _values, result)\n result = val[1]\n \n result\nend", "title": "" } ]
[ { "docid": "dd458ee5bd7f974c08686357ef463ece", "score": "0.7453462", "text": "def _reduce_608(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "ad801b8250ddef70cf7a067f3e475838", "score": "0.7449266", "text": "de...
c628cbb2c7bd657c35637872cdcc21bc
Crunch all agis calls on a single model found using the find method with the agis_id or id. Must be numeric
[ { "docid": "29ccfc53772ea87fc8f9530651c238e5", "score": "0.5603612", "text": "def agis_crunch_all_records(redis)\n all = agis_find_all_mailboxes(redis)\n all.each do |id|\n self.class.find(id).agis_call(redis)\n end\n end", "title": "" } ]
[ { "docid": "e88ce783ee4c81cbc8ebade4fbcd8335", "score": "0.54420024", "text": "def models_subreport(ids,start_date,end_date,eq_models)\n res_set = Reservation.includes(:equipment_model,:equipment_object).starts_on_days(start_date,end_date).where(equipment_model_id: ids)\n res_rels = default_relati...
06909d7cda4bb8950b59c521d3043551
Builds a save_process screen
[ { "docid": "2334ebc1b0b9a2d8936a047db3ecff2a", "score": "0.6458474", "text": "def save_process()\n\n if (@jsession_store.get_session[:active_transaction] != nil)\n transaction_name = Inflector.tableize(@jsession_store.get_session[:active_transaction].class.name).chop\n #--------------------...
[ { "docid": "9b285a3b77cd81bce4077db5c2ffcaeb", "score": "0.7717046", "text": "def build_save_process_choice_screen\n field_configs = Array.new\n field_configs[field_configs.length] = {:type=>\"text_line\", :name=>\"output\", :value=>\"Do you want to save the process\"}\n field_configs[field_con...
7b1ad464f630aa39242b058953ea4ca1
Detect if browser is Kindle.
[ { "docid": "712cc0af1746d848f96962b0495d88a4", "score": "0.8089458", "text": "def kindle?\n !!(ua =~ /Kindle/ || silk?)\n end", "title": "" } ]
[ { "docid": "fa8cb0615929f6dd58847bfa9eca6e4d", "score": "0.83417183", "text": "def detect_kindle\n !@user_agent.index(DEVICE_KINDLE).nil?\n end", "title": "" }, { "docid": "9d1c6b0dc3b67ff879e27b9571dfd3ec", "score": "0.80925936", "text": "def detect_kindle()\r\n if (use...
3541857354d7213e5132643a908a0959
puts big_divisible(nums) def satisfies_both(nums) nums.find do |num| find_all_divisible_by(7, nums).include?(num) && num > 10 end end puts satisfies_both(nums) Bonus: 5. Create an array of the squares (the number times itself) of all numbers that are divisible by 7
[ { "docid": "9ce12a366104507808f398590776d97f", "score": "0.7798594", "text": "def seven_squares(numbers)\n\n sevens = find_all_divisible_by(7, numbers)\n squares = sevens.map {|num| num ** 2}\n return squares\n\nend", "title": "" } ]
[ { "docid": "fb73d310aa75bc3d85b445ddf4a5c6e4", "score": "0.8786199", "text": "def big_divisible(nums)\n # nums.find do |num|\n # num % 7 == 0 && num > 10\n # end\n find_all_divisible_by(7, nums).find {|number| number > 10}\nend", "title": "" }, { "docid": "a8d106cf80a882b7b0c...
1ddd086cc9aa3d1b6743d9da40b5c34d
Replaces reset defined inside of Pry with a reset that instead restarts guard.
[ { "docid": "844fa426fe2fc4dcdf8a6f9b325e74b7", "score": "0.7186829", "text": "def _replace_reset_command\n Pry.commands.command \"reset\", \"Reset the Guard to a clean state.\" do\n output.puts \"Guard reset.\"\n exec \"guard\"\n end\n end", "title": "" } ]
[ { "docid": "4e230a50d5c092f06e08b734e5f40357", "score": "0.71354616", "text": "def _replace_reset_command\n _pry_commands.command \"reset\", \"Reset the Guard to a clean state.\" do\n output.puts \"Guard reset.\"\n exec \"guard\"\n end\n end", "title": "" }, ...
500cfdac4c61f5006c63e3eb2b519173
Return the base path of the Avro schemas on our project.
[ { "docid": "46ffe2949ea57b640d905d9e82d198bc", "score": "0.8549638", "text": "def base_path\n Rimless.configuration.avro_schema_path\n end", "title": "" } ]
[ { "docid": "b1864dc06a0e7a8ccf0f01f23632be0f", "score": "0.7810459", "text": "def base_path\n @base_path ||= MR.root_path.join('fixtures', 'schemas')\n end", "title": "" }, { "docid": "4a15bd36729c5905d5226a78d5d1bf7f", "score": "0.7211168", "text": "def absolute_dir\n @abso...
b85c378dcb2058a995eae4dc54e8c73b
Returns nil if an empty string
[ { "docid": "c631b795e086b9469d1b6f2527a41ca7", "score": "0.0", "text": "def get_option(opt_name)\n val = option(opt_name)\n return (val.is_a?(String) and val.strip == '') ? nil : val\n end", "title": "" } ]
[ { "docid": "7e7abe521a80a9240c73c5338adcbf51", "score": "0.7786748", "text": "def empty_string_to_nil(val)\n return if !val || val == \"\"\n return val\n end", "title": "" }, { "docid": "b3aa929385357691c9e29e29e95e1037", "score": "0.7666267", "text": "def nil_or_b...
f072d68b80b726ba12786a504410ad9e
Uses the puts command to output all the duesummary stats as a line separated text.
[ { "docid": "4169bb8aa0693c218ab40aafd1bc8659", "score": "0.68830776", "text": "def print_summary\n update_now_date_time\n calc_difference\n puts \"#{DueText.minutes} #{till_or_since}: \\t #{calc_mins_till.round(2)} #{DueText.minutes_suffix} \\n\n #{DueText.hours} #{till_or_since}: \\...
[ { "docid": "eb7afbcd58b2e528bcbe2cc1084abe11", "score": "0.736138", "text": "def puts_summary(io)\n io.puts(\"\\n#{[coverage_text, successful_text, failed_text, total_text].join(' ')}\")\n end", "title": "" }, { "docid": "e88d2f4393c535299dfd2161e2568ace", "score": "0.7096005", ...
7040d666836fa7fe3b594bda95148c3c
more redundancy, can likely collapse these down to klass type methods? setters
[ { "docid": "b187d04ccda755e9ed36324dea3b2365", "score": "0.0", "text": "def new_otus(attrs)\r\n otus = Otus.new(:attrs => attrs)\r\n self.otus.push(otus)\r\n otus \r\n end", "title": "" } ]
[ { "docid": "c44965db33e0045f75660529ba047532", "score": "0.64689916", "text": "def type=(type); end", "title": "" }, { "docid": "bb67501064942364fb867e80120cd408", "score": "0.6333882", "text": "def type=(_); end", "title": "" }, { "docid": "bb67501064942364fb867e80120cd4...
bac1831ffc754dd8cda16fdd0ca46583
0 paused 1 not checked yet 2 up 8 seems down 9 down
[ { "docid": "3ad320b5b0ceb1eff6c4c0a8bd788f95", "score": "0.0", "text": "def stringify_status(status_code)\n case status_code\n when 0\n 'paused'\n when 1\n 'not_checked_yet'\n when 2\n 'up'\n when 8\n 'seems_down'\n when 9\n 'down'\n else\n 'unknown'\n end\nend", "title": "...
[ { "docid": "d27178cef68b7a7a959db967642ee4b6", "score": "0.71155006", "text": "def pause\n @paused += 1\n end", "title": "" }, { "docid": "14bdde8019b13b543a7c3a88483ee5fc", "score": "0.6857087", "text": "def maybe_pause_evolution\n\n end", "title": "" }, { "docid"...
6ea16ef0b30095d1f6fca00cbf019133
Method description Options +option+:: specifies something Example $$$ Need an example $$$
[ { "docid": "028078af3f25fa0b0b16f7e4f68f400e", "score": "0.0", "text": "def add_retrieve(&block)\n @retrieve_method = block\n end", "title": "" } ]
[ { "docid": "a5dd23d7c86fcb4035d462902e81de66", "score": "0.82286876", "text": "def options(opt); end", "title": "" }, { "docid": "a5dd23d7c86fcb4035d462902e81de66", "score": "0.82286876", "text": "def options(opt); end", "title": "" }, { "docid": "a5dd23d7c86fcb4035d46290...
b0d2044c7365764546d8ddb6d060c617
The exception that resulted in this error action being called can be accessed from the env. From there you can get a backtrace and/or message or whatever else is stored in the exception object.
[ { "docid": "84e19cd8093b15409ec326ce4d1cc06c", "score": "0.740302", "text": "def the_exception\n @e ||= env[\"action_dispatch.exception\"]\n end", "title": "" } ]
[ { "docid": "de28cbe3e5063da85efd29cccd0c5921", "score": "0.75839144", "text": "def exception\n @context[:exception]\n end", "title": "" }, { "docid": "60d5913cdff6214030d24d2bf5e5d350", "score": "0.7571959", "text": "def exception\n env['action_dispatch.exception']\n end"...
e68db1e5e80e836c51b75025421f3233
Extrae el nodo de la cola
[ { "docid": "258576103e255991416e906c6e7b3ddb", "score": "0.0", "text": "def extract_end()\n if(@size==0)\n puts \"No hay elementos\"\n elsif(@size == 1)\n sale = Node.new(@final.value,nil,nil)\n @size-=1\n @inicio = Node.new(nil,nil,nil)\n ...
[ { "docid": "b18a13a2996bea3381fdcf7592419adb", "score": "0.67226344", "text": "def insertarInicio(nodo)\n\t\tif(vacia)\n\t\t\tself.cabeza = nodo \n\t\telse\n\t\t\taux = cabeza\n\t\t\tself.cabeza = nodo \n\t\t\tself.cabeza.nodoSiguiente = aux\n\t\tend\t\n\tend", "title": "" }, { "docid": "74f...
c81bc2065744342eaf1633d0cce38bc2
These other advisories are currently blocking this advisory from pushing to RHN stage.
[ { "docid": "ce8a462bccc25f439eb39b0298e6afad", "score": "0.63650674", "text": "def currently_blocked_for_rhn_stage_by\n # (No need to be blocked if we don't push to RHN stage)\n return [] unless self.supports_rhn_stage? || self.supports_rhn_live?\n # If the dependency is already pushed to RHN s...
[ { "docid": "f543e3780d0840fc0f7603b7d52e871f", "score": "0.6330272", "text": "def add_blocking_advisory\n # Calling ajax_refresh_dependencies when nothing has changed will\n # needlessly refresh page content, but it doesn't matter too much..\n\n begin\n blocker = Errata.find_by_advisory(pa...
c90f974aedb2ae8ff10d217cdc3ba9d7
To notify Entitymerge that this component should not be merged
[ { "docid": "c2b74e9e2a7f18e410b679f57d221de0", "score": "0.6068185", "text": "def not_merged\n define_method(:merge?) { false }\n end", "title": "" } ]
[ { "docid": "d2db7b50ff9c450893d80fda7051dcee", "score": "0.5740033", "text": "def mark_as_processed!(**attrs)\n logger.info \"\\n in mark_as_processed! before merge\"\n update_column(:processed, true) if self.class.columns.map(&:name).include?('processed')\n logger.info \"\\n in mark_as_process...
a04bde4bb7579adbf1e4792416aeb219
GET /corporation_types GET /corporation_types.json
[ { "docid": "8364eddf151b0accd2ea30e67214e577", "score": "0.7389196", "text": "def index\n @corporation_types = CorporationType.all\n end", "title": "" } ]
[ { "docid": "a0dce3ac5ebd1ca4bfb09f1f3f332f6d", "score": "0.7097702", "text": "def types!\n mashup(self.class.get(\"/\", :query => method_params('aj.types.getList'))).types['type']\n end", "title": "" }, { "docid": "d83c08f38d3e155a8797fdcb78c561cb", "score": "0.7007038", "text": ...
5d472084df19359ac1068a57dbae461c
private Returns the version of the given stack being used by the Webapp. nil if stack not used. raises if stack invalid.
[ { "docid": "f566dc0d70097e14ab982b8ccf93300e", "score": "0.8318483", "text": "def stack_version(stack)\n stack = \"netFramework\" if stack.eql?(\"aspnet\")\n stack_key = \"#{stack}Version\"\n raise ArgumentError, \"#{stack} is not a supported stack.\" unless stack_supported(stack)\n linux_fx...
[ { "docid": "7cc0b4280c8986317f78d0efbdb5c82c", "score": "0.7057387", "text": "def using_latest?(stack)\n using = stack_version(stack)\n raise ArgumentError, \"#{self} does not use Stack #{stack}\" unless using\n latest = latest(stack)\n using[0] = \"\" if using[0].casecmp?(\"v\")\n using....
f5b3b8f3ece88d58c46f313801e76a19
Turn the table into an array of Hash where each Hash has keys corresponding to the table header (first line) and the values are the individual row cells.
[ { "docid": "5bffc951191614239b1081f5edb9e63b", "score": "0.7184916", "text": "def hashes\n header = @raw[0]\n @raw[1..-1].map do |row|\n h = {}\n row.each_with_index do |v,n|\n key = header[n]\n h[key] = v\n end\n h\n end\n ...
[ { "docid": "4dcd5de2df038bc4d724b40d2bcd206b", "score": "0.8403814", "text": "def hashes\r\n all_rows = rows.to_a\r\n header_row = all_rows.shift or raise Exception::Error, \"no rows in table\"\r\n\r\n headers = header_row.ths.map { |header_cell| header_cell.text }\r\n result = []\r...
59e991765832cfbf132a06273aeb6427
return a sql string which can be excuted to get the knowledges list def self.sql_find_knowledges_with_tag(tag_id) ("SELECT FROM knowledges WHERE concat(',',concat(tags,',')) LIKE '%,"<<tag_id<<",%' ORDER BY created_at DESC") end
[ { "docid": "b08ede2b2b921f04a4e285b1d383059e", "score": "0.0", "text": "def if_soft_deleted(soft_deleted =nil, user = nil)\r\n if soft_deleted.present? and user.present?\r\n if [\"true\",\"1\",1,true].include? soft_deleted\r\n self.deleted_at = Time.now\r\n self.deleted_by = user.i...
[ { "docid": "a8c2ca77984c2ce6e885eae0f56b92eb", "score": "0.6146121", "text": "def get_tags_by_post_id(id)\n result = db.execute(\"SELECT post_tags_join.post_id, tags.tag_name FROM post_tags_join INNER JOIN tags ON post_tags_join.post_tag = tags.tag_id WHERE post_id =(?)\", id)\n return result\nend...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "d91cf88d6d1d5a1270be17e7052b6bc6", "score": "0.0", "text": "def set_wowolink\n @wowolink = Wowolink.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;...
a65df7901f954927abb152bd5c23c40d
Retrieves the position on a line for a given document character offset
[ { "docid": "d181d1703721b5eeba403fde5fd1161d", "score": "0.7180703", "text": "def pos_on_line(obj, offset)\n # TODO: Should really use the SourceAdpater\n # https://github.com/puppetlabs/puppet-strings/blob/ede2b0e76c278c98d57aa80a550971e934ba93ef/lib/puppet-strings/yard/parsers/puppet/stateme...
[ { "docid": "5377de223144b7478a1c41537f29d8a3", "score": "0.840323", "text": "def line_char_to_offset(text, line, character); end", "title": "" }, { "docid": "bc0e57a411a5ecd1ad0f7da93d22cc61", "score": "0.81360525", "text": "def pos_on_line(offset)\n end", "title": "" }, { ...
cb514891b3fa5b27c823943ba6b560ab
Helper method for storing and validating configuration parameters
[ { "docid": "2421167c08621c39d61ba8ee1d021ca5", "score": "0.61805886", "text": "def save_and_validate_parameters\n # Configure the hash for use when connecting for cloning a machine\n @connection_options = {\n user: config[:vcenter_username],\n password: config[:vcenter_pa...
[ { "docid": "3bb3ea1c5d6b2742097931092f651f97", "score": "0.6727885", "text": "def validate_config(config)\r\n raise TransactionSupportError, \"Parameter 'key1' is required\" if config.key1.blank?\r\n raise TransactionSupportError, \"Parameter 'key2' is required\" if config.key2.blank?\r\n ...
897b344ef07b99314e56fcd741024d61
Public: send a line to the connected client. line the line to send, sans \r\n delimiter.
[ { "docid": "3778270d42be0b8e20a180302da48a8d", "score": "0.825682", "text": "def send_line(line)\n logger.debug \"irc <- #{line}\"\n send_data line + \"\\r\\n\"\n end", "title": "" } ]
[ { "docid": "e853a3b77be6d64b4c8cd20ab2779242", "score": "0.87976307", "text": "def send_line(line)\n self.send_data(\"#{line}\\n\")\n end", "title": "" }, { "docid": "73d27cae93a513ab816f7937d09d7cb4", "score": "0.87445736", "text": "def send_line(line)\n connect unless ...
5dc7d150d74979abad6c377cc689b709
To send emails asynchronously via ActiveJob.
[ { "docid": "049e2ab184c28ad5a1e5ae8043d6ff6e", "score": "0.0", "text": "def send_devise_notification(notification, *args)\n devise_mailer.send(notification, self, *args).deliver_later\n end", "title": "" } ]
[ { "docid": "0dd4ee3a296ca6c62fb9dc5047826287", "score": "0.78470546", "text": "def async_send_email\n Resque.enqueue(Job::SendBreakingNewsEmail, self.id)\n end", "title": "" }, { "docid": "36c591da1eedd172f95934559d289be4", "score": "0.70663905", "text": "def easy_safe_deliver\n ...
a2c813c7f21c24a0d32098cca500fc33
def rescue_action(exception) render :action => 'index' end GET /places GET /places.xml
[ { "docid": "dfd6011e36c17370aad835a8471c7f3e", "score": "0.0", "text": "def results \n if (params['location'].blank?)\n redirect_to :action => 'index'\n return\n end\n \n @venues = FoursquareVenueQuery.query(params['location']['latitude'], params['location']['longitude'])\n @re...
[ { "docid": "c7090418b4bd15042d3b0823edee117f", "score": "0.68405277", "text": "def index\n raise ActionController::RoutingError.new('Not Found')\n end", "title": "" }, { "docid": "4fd101c57cbe010023942cde1551f4dd", "score": "0.668874", "text": "def rescue_action(exception)\n c...
9ad6a18f073db02eb7a899cf47bac6ef
set up the hydra for running http requests. Increase concurrency as needed
[ { "docid": "29f2ee99a526a7c492cfa0ca4f20f78b", "score": "0.6521237", "text": "def hydra\n @hydra ||= Typhoeus::Hydra.new(:max_concurrency => 1)\n end", "title": "" } ]
[ { "docid": "85b321eaef8a8a4dec3bfc5fb2c81978", "score": "0.6557778", "text": "def initialize(opts = {})\n @opts = opts.with_indifferent_access\n @hydra = Typhoeus::Hydra.new(max_concurrency: 80) # hail hydra\n end", "title": "" }, { "docid": "5b3b502e4a0d33e48813e09aacefbeee", ...
0ae5c1e9409bfc992e5f746a31db176d
Set the value of the Name input for this Choreo.
[ { "docid": "556b2d3ed77dc127d19f7fa1a0d04847", "score": "0.0", "text": "def set_Name(value)\n set_input(\"Name\", value)\n end", "title": "" } ]
[ { "docid": "bd8df1d1ba74b7b21f005d968816a612", "score": "0.7494862", "text": "def set_Name(value)\n set_input(\"Name\", value)\n end", "title": "" }, { "docid": "bd8df1d1ba74b7b21f005d968816a612", "score": "0.7494862", "text": "def set_Name(value)\n set_input(\"Nam...
7ee5eab55c7e400c2a4246918446790d
Hook called right after the resource's creation, at compile time.
[ { "docid": "df1bb3b1219386b7283c49e226e10d86", "score": "0.0", "text": "def after_created\n super\n # Set the default host and token to what could have been set in a with_databricks_access scope\n host node.run_state.dig('databricks', 'host') if host.nil?\n token node.run_state.dig('databric...
[ { "docid": "981670182b44e77098c774f25d4afb73", "score": "0.63310206", "text": "def after_created\n if compile_time\n self.run_action(:apply)\n self.action :nothing\n end\nend", "title": "" }, { "docid": "d008019642183252a46ac8cfee09f4cf", "score": "0.62696016", "text": "def c...
06eceaffde243f4051add5923446d1c1
+extension+ path to extension
[ { "docid": "60dfdba120bcb2a6674e034fbf84b3f0", "score": "0.0", "text": "def compile_extension(extension, platform)\n compiler_options = compiler_options()\n compiler_class = compiler_class(extension)\n\n compiler_options[:platform] = platform\n\n compiler = compiler_class.new(exten...
[ { "docid": "22a0a68894d8b3ba72e7548da9b1d976", "score": "0.8201302", "text": "def add_extension(path); end", "title": "" }, { "docid": "55f41d5b774fcda5110997dadbb7fe7e", "score": "0.8135728", "text": "def extname() File.extname(@path) end", "title": "" }, { "docid": "b61...
28ecb4f24af4cc654f5807e702cf31cd
Verifies that a meeting id is provided as parameter; otherwise return an invalid action request Assigns the meeting instance. Verifiy if user is logged and associated to a swimmer and sets preselection of team and swimmer == Params: id: the meeting id to be processed
[ { "docid": "f85e59373436ecce40d8b7755a31792a", "score": "0.66993713", "text": "def verify_meeting\n set_meeting_from_id\n unless ( @meeting )\n flash[:error] = I18n.t(:invalid_action_request) + ' - ' + I18n.t('meeting.errors.missing_meeting_id')\n redirect_to( meetings_current_path() ) a...
[ { "docid": "ba65cf8d78b9a39abb1bc20f9c0c4c5b", "score": "0.6943332", "text": "def set_meeting\n meeting_id = params[:id] || 1\n @meeting = Meeting.find(meeting_id)\n end", "title": "" }, { "docid": "c58667ddf3185da349821d001260c521", "score": "0.658233", "text": "def set...
ba152f5046c3c774d83e0634412dee7b
PATCH/PUT /favorite_items/1 PATCH/PUT /favorite_items/1.json
[ { "docid": "d81841cbd63472ac0753b7f199e70e7c", "score": "0.74193734", "text": "def update\n respond_to do |format|\n if @favorite_item.update(favorite_item_params)\n format.html { redirect_to @favorite_item, notice: t('.notice') }\n format.json { render :show, status: :ok, location...
[ { "docid": "1f8edc297efa4a11314148516cee07f1", "score": "0.68661547", "text": "def update\n json_response(@food_item.update!(food_item_params))\n end", "title": "" }, { "docid": "d7e8ec7d06b7efcb189a872bdaf34113", "score": "0.6824373", "text": "def update\n @favorite =...
02da03df22df8584746aaeeed3eb5d5b
parse ConstraintChecker results an create ConstraintExceptions Objects
[ { "docid": "25f3cdd66d07ff4a3ec3c99c57c803e5", "score": "0.7264791", "text": "def create_constraint_exceptions(results)\n results.each do |result|\n p result.class\n case result.class.name\n when \"ConstraintsChecker::Constraints::Prerequisite\"\n entity = Constraint.find(re...
[ { "docid": "f534dc13b5a91ccafc983c64f4d4fda6", "score": "0.63882625", "text": "def parse_constraint_validations\n db.extension(:_model_constraint_validations)\n\n unless hash = Sequel.synchronize{db.constraint_validations}\n hash = {}\n db.from(constraint_validati...
31ef9dc3768b12486bab0a561759c03c
ENDDO_BLAST BEGINFETCH_RESULTS Fetches the results of the commited blast search Returns result of the search in XML format if successfully retrieved the data. Exception handling must done by the caller.
[ { "docid": "3f72690135be9765963d813c19c1dd00", "score": "0.6745605", "text": "def fetch_results\n if @rid.length > 0\n res='http://www.ncbi.nlm.nih.gov/blast/Blast.cgi?CMD=Get&FORMAT_TYPE=XML&RID=' + rid.to_s\n @answer=open(res).read\n return @answer\n else \n @logg...
[ { "docid": "5b5c615cdc41d16c8219155598be49a1", "score": "0.53967863", "text": "def blast\n begin\n\n if @xml_file == nil\n \n #file seek for each query\n @query_offset_lst[0..@query_offset_lst.length-2].each_with_index do |pos, i|\n \n if (i+1) >= @start_idx\n ...
e57863730144e9d9fbd26dd25bc600fe
Returns a string representing the class name
[ { "docid": "332cb23c974a67fed71b0e967e8fc8aa", "score": "0.0", "text": "def to_s\n \"#<JenkinsApi::Client>\"\n end", "title": "" } ]
[ { "docid": "4b4eb648777d501d5649f8f3b7798272", "score": "0.84994596", "text": "def name\n @class_name\n end", "title": "" }, { "docid": "5ffb25bb6de398db660b368b95ed323b", "score": "0.84642106", "text": "def class_name\n @class_name ||= derive_class_name\n end", ...
eac51976d93fee62d53278f64163ef7d
Runs another CLI command via its command class.
[ { "docid": "da9f7a0d0867837b79d334c42afe538e", "score": "0.62777793", "text": "def run_command(klass, *args)\n klass.new(\n out: out,\n inflector: app.inflector,\n fs: Dry::Files\n ).call(*args)\n end", "title": "" } ]
[ { "docid": "607f9f612d0a1dae647483cc4a741ebc", "score": "0.7139038", "text": "def run\n\t\t\tbegin\n\t\t\t\teval \"Hawknee::Cli::Command::#{@command}.new.#{@subcommand}\"\n\t\t\trescue NameError, NoMethodError\n\t\t\t\traise InvalidCommand\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "7d8...
0c56dee2819c98b71ff35b7a0ed3daff
Kind of hacky way to trigger reindex of work when transcripts are changed here, since we now index transcripts in solr. Called in after_commit hook. If the last save changed the transcript, and we HAVE a work, and kithe configuration is currently set up to autoindex that work... autoindex it. Note this means if you are...
[ { "docid": "0682822406ffd622891aec68032cfc7e", "score": "0.7742486", "text": "def after_commit_update_work_index_if_needed\n return unless (\n self.saved_change_to_attribute?(:ohms_xml_text) ||\n self.saved_change_to_attribute?(:searchable_transcript_source)\n )\n return unless work &...
[ { "docid": "8b0cbb854208769ea240ac500846c39b", "score": "0.6340506", "text": "def auto_solr_update\n\n documents = []\n remove_self = false\n\n dirty_attrs = self.changes.keys.collect(&:to_s) \n\n if self.class.solr_powered?\n if self.solr_saveable?\n if dirty_attrs & self.class....
1ca5cbd39a3d2e46a67cc5b488ebce42
Refworks has to post to the action
[ { "docid": "2dc7140f181201c6166da7b70d3863bb", "score": "0.5621792", "text": "def post_form_to_external?\n true\n end", "title": "" } ]
[ { "docid": "c2c6d2f572b3f112dc8d5daacbdeb33c", "score": "0.6847007", "text": "def post; end", "title": "" }, { "docid": "b937668031da726f019cd2c84320d287", "score": "0.6803874", "text": "def post\r\n end", "title": "" }, { "docid": "4180d858de91da8e62a829b4a5577430", ...
c80ddc318a04e8d7ac7a0c88bbebcbba
DELETE /djs/1 DELETE /djs/1.json
[ { "docid": "4de29c53ea8198c942dd3972de5b1076", "score": "0.6692153", "text": "def destroy\n @dj.destroy\n respond_to do |format|\n format.html { redirect_to djs_url, notice: 'Dj was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "b445c184893647d3482f8fbc6a507a52", "score": "0.72374785", "text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end", "title": "" }, { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.72231...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "f1401787c7cf77fe55ada36a451cf85f", "score": "0.0", "text": "def set_cadastro_questo\n @cadastro_questo = CadastroQuesto.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.6031952", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015048", "text": "def...
0f541506bf55a839f18e7a67cfd703cc
include the module (loaded with helper methods) into ActionView::Base
[ { "docid": "1a3422874fb496262898d0271d60f2da", "score": "0.7667122", "text": "def install_helpers # :nodoc:\n mod = @module\n ActionView::Base.class_eval do\n include mod\n end\n end", "title": "" } ]
[ { "docid": "485db489128306b6329f8e37c86378db", "score": "0.7235494", "text": "def include_abingo_views\n\t\tmodule_eval ABingoCampingPlugin::Views.abingo_view_helpers\n\t\tmodule_eval ABingoCampingPlugin::Views.common_abingo_views\n\n\t\tmodule_eval do\n\t\t\tapp_module_name = self.to_s.split(\"::\").fi...
78372a479b0013366c0ef382d2b7bbd2
Returns the applicable unique expiration identifiers that can be used for the considered Snippet instance. This mostly depends on the fact that a user is associated with the snippet or not: if a snippet is associated with a specific user, the snippet can be saved with a never ending expiration.
[ { "docid": "b8cb008625a4aff88be50a2069db76c2", "score": "0.57818025", "text": "def expirations\n EXPIRATIONS.dup.delete_if { |key| user_id.nil? && key == :never }\n end", "title": "" } ]
[ { "docid": "0508538bc8f19eb9af860b9fcb3c78cc", "score": "0.53054935", "text": "def obfuscated_ids\n [\n Digest::SHA1.hexdigest(Time.now.to_f.to_s)[0..9],\n Digest::SHA1.hexdigest(Time.now.to_f.to_s)[0..15],\n Digest::SHA1.hexdigest(Time.now.to_f.to_s)\n ]\n end", "title": "" ...
9378ec574668d48046469adf80ce8682
Performs a self check against some core values from being not nil
[ { "docid": "4eafe55d406aaf5a5d485b1bfcab6ec8", "score": "0.0", "text": "def lint\n ret = []\n ret << :cve if self.cve.nil?\n ret << :osvdb if @osvdb.nil?\n ret << :cvss if self.cvss.nil? || self.cvss.empty? || self.cvss == \"not assigned\"\n ret << :severity if self.se...
[ { "docid": "f63d0ba1e6929e054f6f606d09ca9ffd", "score": "0.62882686", "text": "def not_nil?\n msg = \"#{self} was nil/null\"\n check_if !self.nil?, msg\n end", "title": "" }, { "docid": "432236acaae0ee6e798e56a014207d16", "score": "0.6239745", "text": "def check_values\n ...
0fff08d51751f16e8e1ce9c15241825d
Prevents a parameter from being reassigned.
[ { "docid": "c5bc8665c66968019fc8af4db54ef1a8", "score": "0.0", "text": "def protect(key)\n @_protected << key.to_s\n end", "title": "" } ]
[ { "docid": "96eb08bcad43f9aa3ef719ebed9f0903", "score": "0.6512973", "text": "def parameter!\n @parameter = true\n self\n end", "title": "" }, { "docid": "85a18d18ee38965ad8619b5d24ea422b", "score": "0.6378171", "text": "def safe_by_default=(_arg0); end", "titl...
888695c2ef389a80d770dc759129825d
Evaluate a simple infix arithmetic expression using a stack
[ { "docid": "a6f9dedec7fd6fc590a89a03a7053e1e", "score": "0.7962567", "text": "def stack_eval_infix(string)\n raise \"Bad characters\" if string =~ INVALID_INFIX_CHARACTERS\n op_stack = LinkedStack.new\n value_stack = LinkedStack.new\n string.chars do | ch |\n case\n when ch =~ /\\d...
[ { "docid": "c934fa01155881ecacea7d5758e52c9c", "score": "0.7925855", "text": "def evaluate\n stack = []\n @expr.split.each do |token|\n case token\n when /\\d+/\n stack.push(token.to_i)\n when \"+\", \"-\", \"*\", \"/\"\n operands = stack.pop(2)\n stack.push(ope...
2a4d32b4ad318756e873f04d969dcdd5
GET /performances/1 GET /performances/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "8ecd19a07a3882b4623fe8e0a011e5fd", "score": "0.75961816", "text": "def show\n @performance = Performance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @performance }\n end\n end", "title": "" }, { "doci...
b000b3ca310ada047e6b03d672ec68ff
convert ip address to string
[ { "docid": "09f26b39b0dd1242079df57b15222921", "score": "0.7607007", "text": "def to_s\n @ip\n end", "title": "" } ]
[ { "docid": "02582c3d533fa16092f4d7c378337ebe", "score": "0.79507446", "text": "def to_s\n @ip_string\n end", "title": "" }, { "docid": "608d90ef635b1544f6588af0f0488595", "score": "0.78629315", "text": "def ip_string(ipint)\n octets = []\n 4.times do\n oc...
d5a72d18f1e3eeefc5f0f748d4f04615
This method is used to retrieve contact data
[ { "docid": "433801519766679ac21d461dfbf506ae", "score": "0.0", "text": "def get_contact_members(col)\n data = []\n table_headers = [t(:label_contacts),\"#{t(:label_Account)}\",\"#{t(:text_no_of)} #{t(:text_campaign)}\", t(:text_responded), \"#{t(:text_responded)} %\",t(:text_opportunities),\"#{t(:...
[ { "docid": "6abb9f33b2cb51e33e4fe03831a70a0c", "score": "0.80811566", "text": "def contact_information\n fetch ContactInformation\n end", "title": "" }, { "docid": "6abb9f33b2cb51e33e4fe03831a70a0c", "score": "0.80811566", "text": "def contact_information\n fetch C...
c0a40ad6b75a03dd1094a9005d622088
Defining my model with 2 attibutes: name and description
[ { "docid": "91a4fbc905170bb725679563517fa847", "score": "0.0", "text": "def initialize(attributes)\n @name = attributes[:name]\n @description = attributes[:description]\n @prep_time = attributes[:prep_time]\n @status = attributes[:status] || false\n @difficulty = attributes[:difficulty] |...
[ { "docid": "1f3eb363569c21fc231424ae84e8b81a", "score": "0.74017614", "text": "def name\n description\n end", "title": "" }, { "docid": "1f3eb363569c21fc231424ae84e8b81a", "score": "0.74017614", "text": "def name\n description\n end", "title": "" }, { "docid": "70...
de3e37efca5c24f6a7cc16bc685fdb47
Installs a propagate function through a block.
[ { "docid": "c12dccd482aa09482dbb18cec8c5f23d", "score": "0.661534", "text": "def set_propagate(&block)\n raise ArgumentError, 'Propagate expected through a block' if block.nil?\n raise ArgumentError, 'Block of arity 2 expected' unless block.arity==2\n @propagate = block\n end",...
[ { "docid": "0c9f1f73731616394d71eaf330c69af2", "score": "0.66246843", "text": "def install(&block)\n @component.install << yield\n end", "title": "" }, { "docid": "3db484d94de89c4c13bd76145e3c48bf", "score": "0.66033405", "text": "def install(&blk)\n @install_blk...
66e86f5e2d31dae1a8bd8aa066213c02
When updating this, also update PRODUCT_MATRIX.md
[ { "docid": "b562201a8c20d6cdbaf47d287dc068c2", "score": "0.523948", "text": "def product_matrix\n {\n 'analytics' => {\n 'package-name' => 'opscode-analytics',\n 'ctl-command' => 'opscode-analytics-ctl',\n 'config-file' => '/etc/opscode-analytics/opscode-analytic...
[ { "docid": "f3c680e22c97c8aae0be85224b8e9b1d", "score": "0.5639452", "text": "def products_section\n\tprint_ASCII(\"Products\")\n\tproducts\nend", "title": "" }, { "docid": "aced60eb5b7a013a219d1ca1ea22030d", "score": "0.5624896", "text": "def before_make_products row\n end", ...
a85e4089e0011d3464bb898b0c0c6756
method defined to present and process quiz questions
[ { "docid": "67c7a12e86b708aff4e128a5457942fe", "score": "0.6811903", "text": "def show_q(question, q_A, q_B, q_C, q_D, answer)\n\n #Loop until the player gives a valid answer\n\n loop do\n Console_Screen.clears\n\n #Format the display of the quiz question\n puts question + \"\\n\\n\"\n put...
[ { "docid": "d8d75b378aa921e6d3812010801a4043", "score": "0.7695406", "text": "def quiz\n end", "title": "" }, { "docid": "8839e73d780c21528cfb30dc11f37811", "score": "0.71281284", "text": "def answer\n prepare_quiz\n session[:current_question] = @number\n delete_old_answer\...
776ced3c8a339d5f1e3dbf449e8991c7
Generate activation data from the token blob and the digipass parameters embodied in the token static initialisation vector. == Returns: The token serial number and the activation code as an Array, suitable for multiple assignment. Not all tokens support activation data generation. This is determined by the DPX having ...
[ { "docid": "546951f0a6745f199e45db2752f2b31a", "score": "0.6230574", "text": "def activation\n ad = VacmanController::LowLevel.generate_activation(@token_hash)\n [ ad.fetch('serial').scan(/\\d(\\d)/).flatten.join, ad.fetch('activation') ]\n end", "title": "" } ]
[ { "docid": "4717b3d625b486eb29b45deeb50faee1", "score": "0.5937339", "text": "def initialize_account_token\n return_str=\"\"\n return_str << generate_activation_code(8)\n end", "title": "" }, { "docid": "31f4b1b9f02327e80fd6b90ba616a8ae", "score": "0.5804731", "text": "def cr...
aafaf82f9e47449e37588d532110b70a
PUT /games/1 PUT /games/1.json
[ { "docid": "54fe6a3c6e733dce37ccc2f7ef60b098", "score": "0.6878091", "text": "def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, :notice => 'Game was successfully updated.' }\n ...
[ { "docid": "5af53471ff55ef34c43a5f170769ad10", "score": "0.76136506", "text": "def update\n @game.update(game_params)\n render json: @game, status: 200\n end", "title": "" }, { "docid": "ca80e32e1ab5b34f1f02c5507ae69821", "score": "0.7485905", "text": "def update\n @game = ...
98dc725a500f64c2d23134ad1b3073cd
GET /pictures GET /pictures.xml
[ { "docid": "6589da7be944b672fcecb9b6558f9998", "score": "0.0", "text": "def index\n @pictures = @album.pictures.all \n @picture = @album.pictures.build\n end", "title": "" } ]
[ { "docid": "ad15aaa8dbc9b4d412a7be916d6d4edd", "score": "0.7298022", "text": "def index\n @pictures = Picture.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pictures }\n end\n end", "title": "" }, { "docid": "ac6c41bec0e2273d...
db547ab9f298ed035e39599d441371b2
This will be overwritten by _write_layout_method source://actionview//lib/action_view/layouts.rb382
[ { "docid": "8704dc0e394590e135c56990e9bd9ea6", "score": "0.6698723", "text": "def _layout(*_arg0); end", "title": "" } ]
[ { "docid": "8088959227256fe931697e73b30b631f", "score": "0.7534137", "text": "def place_in_layout?; end", "title": "" }, { "docid": "8088959227256fe931697e73b30b631f", "score": "0.7534137", "text": "def place_in_layout?; end", "title": "" }, { "docid": "373f35dd06a64efe71...
e35438cb9840bf81ddf086c3b5e0e8c3
Perform an HTTP GET request
[ { "docid": "63c4ec5e6a849ad7cc5931471eaeca81", "score": "0.0", "text": "def get(path, params = {})\n response = access_token.get(path + '?' + params.to_param, header)\n parse_response(response)\n end", "title": "" } ]
[ { "docid": "291d8825b84313454d5f5ecfe483726c", "score": "0.82494193", "text": "def get\n execute_request('GET') do |uri, headers|\n HTTP.http_client.get(\n uri,\n follow_redirect: true,\n header: headers\n )\n end\n end", "title":...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "9c88c3623e81aa1703fa078ab5cb493c", "score": "0.0", "text": "def number_format_params\n params.require(:number_format).permit(:project_id, number_parts_attributes: [:format, :type, :id])\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
962a46cebcd869ff6c6b576423b6dd9a
Define a method that, given the string of a respectable business sign, returns a boolean indicating whether pranksters can make a given vandalized string using the available letters. Ignore capitalization and punctuation. can_tweak_sign("We're having a yellow ferret sale for a good cause over at the pet shop!", "Leopar...
[ { "docid": "88682f8b85504f5a630744ac0db23f95", "score": "0.7279679", "text": "def can_tweak_sign?(normal_sign, vandalized_sign)\n normal_hsh = character_count(normal_sign)\n vandalized_hsh = character_count(vandalized_sign)\n\n vandalized_hsh.each do |k, v|\n if normal_hsh[k] == nil || normal_hsh[...
[ { "docid": "f11ec3e98350244627a97b0bae74603b", "score": "0.82842535", "text": "def can_tweak_sign?(normal_sign, vandalized_sign)\n normal_char_count = character_count(normal_sign)\n vandalized_char_count = character_count(vandalized_sign)\n can_tweak = true\n vandalized_char_count.each do |char, cou...
2a8a8173afd8aa8a2d288691a39c03c8
return a random phone number
[ { "docid": "7ba20aa60221291f0937ddf160d87dc8", "score": "0.72309536", "text": "def phone_number\n value = Faker::PhoneNumber.phone_number\n remove_extension(value)\n end", "title": "" } ]
[ { "docid": "5b1124066b5397a1b1e0686b49814329", "score": "0.8661244", "text": "def phone_number\n case rand(0..1)\n when 0 then mobile_phone_number\n when 1 then home_work_phone_number\n end\n end", "title": "" }, { "docid": "e469887e6b3ed6d5d29cb435344363c5", "scor...
b27fe7458904ee21dc05e21db6351a55
Capabilities specific to the `textDocument/publishDiagnostics` notification.
[ { "docid": "c592d2d7ce72ac5002bc9e43ea3dbd90", "score": "0.59666175", "text": "def publish_diagnostics; end", "title": "" } ]
[ { "docid": "23d57c71f27db6f8093ca2de9e6d2d19", "score": "0.5959883", "text": "def publish_diagnostics\n attributes.fetch(:publishDiagnostics)\n end", "title": "" }, { "docid": "a8e409edfb46438bad7d1a63e96a972b", "score": "0.44992414", "text": "def supports_log_exports...
3d301be18fb5c1988920754f4db200c9
returns the credit claimed details required for a save draft or submit
[ { "docid": "404a234ff3f9aef191a1755f58e59e12", "score": "0.71094984", "text": "def save_credit_claimed_hash\n { # NOTE: we specifically return 0 for an N so we can restore on load\n # know the difference between they weren't asked (nil) and they answered no (0)\n 'ins0:SLCFContr...
[ { "docid": "7aab3f1355601f623e79ed64924cba61", "score": "0.65863967", "text": "def calc_credit_claimed_hash\n {\n 'ins1:CreditClaimed': slcf_credit_claimed,\n 'ins1:BadDebtClaimedAmount': bad_debt_credit,\n 'ins1:PermanentRemovalClaimedAmount': removal_credit\n }...
45d00c9bb925f579819231959ff41e7f
Admin section & stats
[ { "docid": "51d43a4aa522fe4c88716c95bc818ef0", "score": "0.5884744", "text": "def generate_site_stats\n H.ul {\n H.li {\"#{$r.get(\"users.count\")} users\"} +\n H.li {\"#{$r.zcard(\"news.cron\")} news posted\"} +\n H.li {\"#{$r.info['used_memory_human']} of used memory\"}\n }\...
[ { "docid": "755b82447182fd08b70d203eb210516c", "score": "0.7041706", "text": "def show\n\t\trequire_admin!\n\tend", "title": "" }, { "docid": "c81a139b8bc978a8913e64884dbfb70a", "score": "0.6975781", "text": "def admin_logic\n end", "title": "" }, { "docid": "4ba0af5...
0f8e217546660c60c90c1d56b17ff6e1
Method to validate the email format
[ { "docid": "d2e5be4d5470c5bcd2357d077fc22e45", "score": "0.7355323", "text": "def validate_regex\n if !company.nil? && company.allow_email_regex == true\n # if email =~ /#{company.email_format}/i\n if email =~ /^([^@\\s]+)@((?:#{company.email_format}))$/i\n true\n else\n ...
[ { "docid": "b4fb766ff2eb9961756aae2ac7df6b65", "score": "0.85222477", "text": "def email_format\n\t\terrors.add(:email, :invalid) unless email.match(EMAIL_REGEXP)\n\tend", "title": "" }, { "docid": "a5786fa84264115f300471014b3c0db7", "score": "0.80644536", "text": "def email_check\n ...
ecb38607351f6b75a5891fa89e831ccd
POST admin/destaques/create POST admin/destaques.json
[ { "docid": "6006cebd9d6b2cc68f33625b88adacd1", "score": "0.7721209", "text": "def create\n @destaque = Destaque.new\n @destaque.oferta = Oferta.find params[:id]\n @destaque.status = Status.find_by_descricao('Ativo')\n\n respond_to do |format|\n if @destaque.save\n format.html { r...
[ { "docid": "5c2ee43627631e091c00efa8577b8e0e", "score": "0.74544734", "text": "def create\n @destaque = Destaque.new(params[:destaque])\n\n respond_to do |format|\n if @destaque.save\n format.html { redirect_to(@destaque, :notice => 'Destaque was successfully created.') }\n form...
1eadf00dab4dd32ce0f52b9a7fe5c458
If you have extra params to permit, append them to the sanitizer.
[ { "docid": "a803a41eab605d758001e5360c08996e", "score": "0.0", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:name, :email, :password,:tipo,:app,:apm,\n :nom1,:nom2,:RFC,:CURP,:seguro,:INE,:nacionalidad,:fecha_nacimiento,:nac_ciudad,:nac_...
[ { "docid": "505e334c1850c398069b6fb3948ce481", "score": "0.72707826", "text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end", "title": "" }, { "docid": "b4c9587164188c64f14b71403f80ca7c", "score": "0.7025185", "text": "def sanitize_params!\n request.sanitiz...
02d50c14c72945277a22267db367320a
remaining time for edit
[ { "docid": "8093f0f4589e60208122e81e33ee467c", "score": "0.6762696", "text": "def remaining_time\n # calculate how old is the feedback\n created_at = self.created_at.to_time\n diff_seconds = (Time.now - created_at).round\n remaining = TEN_MINUTES - diff_seconds\n\n remaining.to_s\n end",...
[ { "docid": "2a6ec4f8730248ba508ca41981013053", "score": "0.74335355", "text": "def edit_time_left(item)\n diff = Time.now - item.updated_at\n expire_rate = APP_CONFIG[:edit_expiration_in_minutes].to_i\n return expire_rate > 0 ? expire_rate - (diff.to_i / 60) : nil\n end", "title": "" }, ...
52ea30726b42b62ca40c8dda2d0e96b2
Renders an enum template
[ { "docid": "aa55dfdc2e42b01614920e09f9022092", "score": "0.7017047", "text": "def render_swift_enum_template(file:, header:, template:, output_subfolder:, extension:)\n # split Enum to Enum.swift and Enum+Extension.swift (easier to support cocoapods subspec)\n output_enum_subfolder = \"#{output_su...
[ { "docid": "57833317d46bfb85243982ea284f8e18", "score": "0.6938247", "text": "def renderEnum(model, enm, result)\n nameSpace, base = assertNamespace(enm.name)\n L.info(\"Rendering enum #{enm.name} of the type #{enm.class}\")\n case enm\n when DataMetaDom::Enum\n ...
e60004e5e6d3f2a2a9046b5482e12155
Returns markup'd information about a post's author (user).
[ { "docid": "9a4592c5aaf28f9d1b8a950cd0384bdb", "score": "0.74694574", "text": "def pretty_author(user, options = {})\n content_tag :span, :class => \"author vcard\" do\n content_tag :span, :class => \"fn\" do\n user.name rescue \"Admin\"\n end\n end\n end", "title...
[ { "docid": "4a8a68ef34f0974c3fa15177de5dee2e", "score": "0.7376872", "text": "def author_name\n self.posts.first.author_name\n end", "title": "" }, { "docid": "be5b7c392549fb08ccd42c1fcd99f5b2", "score": "0.7337346", "text": "def author\n \"#{user.name} (#{user.login})\"\n...
798f33a3d0dadcee1bc2c59d8722037e
Toggle the visible state and store the model. When the model is hidden, then it is shown, and vice versa.
[ { "docid": "3c1ab8bb9ee522244093b5be68c3ca6b", "score": "0.69951844", "text": "def toggle\n return hide if visible?\n\n show\n end", "title": "" } ]
[ { "docid": "420fef1e2b9bd6218e0a299f7c8c26ba", "score": "0.70492786", "text": "def toggle\n if visible?\n hide\n\n else\n show\n\n end\n end", "title": "" }, { "docid": "69a8be34bfdd53fa016436fbd1bfe7ff", "score": "0.7011467", "text": "def ...
d0369bc5c7aa3ac5f330f1581f465f66
Mehtod that generates datepicker input field inside a form
[ { "docid": "368e50c7efd60a64edf59828a04b6ef1", "score": "0.7157408", "text": "def datepicker_tag(name, value, options = {})\n dp_options, tf_options = JqueryDatepicker::split_options(options)\n dp_options.merge!(:altField => \"##{name}\", :altFormat => 'yy-mm-dd')\n text_field_tag_id = na...
[ { "docid": "2d1999b09e88b604233ffd32081c84e8", "score": "0.7990232", "text": "def datepicker_field(form, field_name, params = {})\n label = params[:label]\n icon = params[:icon]\n if params.delete(:show_time)\n class_name = 'datetimepicker'\n format = :default\n else\n cl...
6628cc32b8e3af81c6cab62e3a7bade7
Round 4 Write a function word_reverse that accepts a single argument, a string. The method should return a string with the order of the words reversed. Don't worry about punctuation. word_reverse("Now I know what a TV dinner feels like") => "like feels dinner TV a what know I Now"
[ { "docid": "95b93f2f03def5a13bae5e31014c6956", "score": "0.8654541", "text": "def word_reverse(string)\n p string.split.reverse.join(' ')\nend", "title": "" } ]
[ { "docid": "931ebc0adde84f6a713713bff2e47e94", "score": "0.8656311", "text": "def wordReverse (string)\n return string.reverse\nend", "title": "" }, { "docid": "b67e87908e57e75e7920695fcb7bee78", "score": "0.8485446", "text": "def word_reverse str\n str.split(\" \").reverse.join(...
1c4d2bf5a8987352f7dd3af96b85930a
Decrementa el nivel del jugador en l niveles.
[ { "docid": "7209db6b6efafdf754ba44205a3613b0", "score": "0.68478775", "text": "def decrementLevels(l)\n @level -= l\n \n if(@level <= 0)\n @level = 1\n end\n end", "title": "" } ]
[ { "docid": "20840d152cf74899d3ce6373e22a91e2", "score": "0.6531668", "text": "def decrement\n @value -= 1\n end", "title": "" }, { "docid": "ec93a748608a49e5a81532b11b699723", "score": "0.63026255", "text": "def decrement(node)\n change_by node, -1\n end", "title": ""...