query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
535723f040ac84a13de5d1f6b3755f3f
Compares two Clades field by field. If all instance variables are == than the two clades are == as well.
[ { "docid": "4ce53106bcf5a91ffac9a0f437610a9b", "score": "0.0", "text": "def == clade\n (\n self.name == clade.name &&\n self.all_leaves == clade.all_leaves &&\n self.left_leaves == clade.left_leaves &&\n self.right_leaves == clade.right_leaves &&\n self.all_...
[ { "docid": "d1858883b2cf14e3201aab48bc67f0e4", "score": "0.602553", "text": "def reflections_equal?(a, b)\n comparable_reflection(a) == comparable_reflection(b)\n end", "title": "" }, { "docid": "d1858883b2cf14e3201aab48bc67f0e4", "score": "0.602553", "text": "def reflect...
b787b567115b943a66a619f8b0f57a24
Adds the list of emails as "newsletter_only" user records. If a user is an existing user that is not newsletter_only then an error is added.
[ { "docid": "0932f1987466e770ecb79bb699633bd3", "score": "0.7576876", "text": "def add_newsletter_recipients(email_list)\n\n failed_emails = []\n skipped_emails = []\n enabled_members = []\n added_count = 0\n\n # Get a list of existing users\n existing_users = User.find(\n :all,\n ...
[ { "docid": "0b21b926a0ce0664447037d4c8eb16ff", "score": "0.6296285", "text": "def subscribe(user)\n update subscribed_emails: (subscribed_emails + [user.email])\n end", "title": "" }, { "docid": "211030c1ef41d2074bf7d1460afd605e", "score": "0.61142683", "text": "def edit_newslett...
4f805a3a1abe482c30cfa61808518cc1
++ manage_meta_set_encoding encoding sets character encoding for page
[ { "docid": "d342e0019e722a55eaa7c29682ae473b", "score": "0.83842796", "text": "def manage_meta_set_encoding encoding\n @manage_meta_encoding = encoding\n end", "title": "" } ]
[ { "docid": "8e0b60400cef49d7d7a4bf88345bc55d", "score": "0.811693", "text": "def meta_encoding=(encoding); end", "title": "" }, { "docid": "8e0b60400cef49d7d7a4bf88345bc55d", "score": "0.811693", "text": "def meta_encoding=(encoding); end", "title": "" }, { "docid": "f707...
d586544df355708ee103409cc1bba951
DELETE /api/universities/1 DELETE /api/universities/1.json
[ { "docid": "9b0992e99e1e998c8a6ea6fd80d11fb9", "score": "0.7954152", "text": "def destroy\n @api_university.destroy\n respond_to do |format|\n format.html { redirect_to api_universities_url, notice: 'University was successfully destroyed.' }\n format.json { head :no_content }\n end\n ...
[ { "docid": "6eb56f1baac0518c80981acf4db0d439", "score": "0.78688824", "text": "def destroy\n #not in use\n @university.destroy\n \n respond_to do |format|\n format.html { redirect_to universities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { ...
6ee4c47fa54e57ac0cf8266ef4f5057f
Register an Interceptor which will be called before mail is previewed. Either a class or a string can be passed in as the Interceptor. If a string is passed in it will be constantized.
[ { "docid": "57abf1bbb45828c7132eee4e99e14ec9", "score": "0.67199093", "text": "def register_preview_interceptor(interceptor)\n preview_interceptor = interceptor_class_for(interceptor)\n\n unless preview_interceptors.include?(preview_interceptor)\n preview_interceptors << preview_i...
[ { "docid": "afde3828dd146e35da6ad10e4c887edc", "score": "0.651408", "text": "def register_interceptor(interceptor)\r\n delivery_interceptor = case interceptor\r\n when String, Symbol\r\n interceptor.to_s.camelize.constantize\r\n else\r\n interceptor\r\n ...
081b860a803c60278500cdea69352a19
Replaces our comment with +comment+, unless it is empty.
[ { "docid": "a5733b833f00b61f47a6c4b26043e0f4", "score": "0.78470004", "text": "def comment=(comment)\n @comment = comment unless comment.empty?\n end", "title": "" } ]
[ { "docid": "6c6fa4d892ac7cf0d39fb8f6a4198620", "score": "0.7843716", "text": "def comment=(comment)\n @comment = comment unless comment.empty?\n end", "title": "" }, { "docid": "ff4dbd5f4be70f107ff2a1d09e51fac9", "score": "0.76172876", "text": "def comment= comment\n comme...
9c4b85543a37227baba73cf63b62f0c7
Whether the association has forced nil inverse (So no foreign keys are saved).
[ { "docid": "1ec51fb7057e829f2ac0b8ebc536a352", "score": "0.74092877", "text": "def forced_nil_inverse?; false; end", "title": "" } ]
[ { "docid": "2523853395cd25c44f2f2f1c9360c5fd", "score": "0.8552342", "text": "def forced_nil_inverse?\n has_key?(:inverse_of) && inverse_of.nil?\n end", "title": "" }, { "docid": "82ee25c91fe2b9050edec3857badef76", "score": "0.73725384", "text": "def inverse_of?\n ...
cc054f7c04c9f3d05c14e755bb160b93
Gets the options to generate our own sequence numbers on all SYNs.
[ { "docid": "e9f2a4319873f53d4e5e45957a87861c", "score": "0.0", "text": "def tcp_generate_isn_state\n super\n end", "title": "" } ]
[ { "docid": "2275a0ac2aad3f24db4f122b48103488", "score": "0.6874642", "text": "def sequence_options\n (1..12).collect do |numb|\n [I18n.t('n sequence', :count => numb), numb]\n end\n end", "title": "" }, { "docid": "3508ab8f4d51bfea0a3220accb83f959", "score": "0.56514364", ...
eb8db5215d6176f98fe7d0ce011787c5
[param] String filter [return] RTM::Tasks::GetList
[ { "docid": "1e4532fa774d4516f81b630b22192987", "score": "0.8530634", "text": "def task_list( filter = nil )\n RTM::Tasks::GetList.new( token,\n nil,\n filter ).invoke\n end", "title": "" } ]
[ { "docid": "73c0abd1215527aeec019b0a95b91e09", "score": "0.71627486", "text": "def task_filter(options={})\n post(\"wrike.task.filter\", options)\n end", "title": "" }, { "docid": "2f2245a748ab19d08d7a4d8f29c65a05", "score": "0.69814146", "text": "def list(filter, ignorecase ...
76172a66100364beecb12b7b3f4798f2
get the annualized return of a portfolio with the sum of all its stocks' annualized returns
[ { "docid": "1f414e05822121037ac8045350f3a32a", "score": "0.7678739", "text": "def annualized_return(start_date, end_date)\n stocks.map { |stock| stock.annualized_return(start_date, end_date) }.sum\n end", "title": "" } ]
[ { "docid": "a41c9044ab49388835b9748392a36ed0", "score": "0.74914193", "text": "def portfolio_return\r\n \r\n num_stocks = @stock_names.length # number of assets in portfolio\r\n openval = @stock_open.map { |price| 1/price }\r\n closevals = @stock_close\r\n num_years = @period_actual / 3...
097f6d4d610ef3e6e9ca4dae00585d09
PATCH/PUT /affiliate_dashboards/1 PATCH/PUT /affiliate_dashboards/1.json
[ { "docid": "fedc025f705690237fd8af7e3a955a77", "score": "0.7653943", "text": "def update\n respond_to do |format|\n if @affiliate_dashboard.update(affiliate_dashboard_params)\n format.html { redirect_to @affiliate_dashboard, notice: 'Affiliate dashboard was successfully updated.' }\n ...
[ { "docid": "4967d63a0f820b9c57911003c3abd8f3", "score": "0.691278", "text": "def update\n return render_not_found('dashboard') unless dashboard\n authorize! :update_impac_dashboards, dashboard\n\n if dashboard.update(dashboard_update_params)\n render 'show'\n else\n render_bad_requ...
95eea04fc00505f76070e33f547351fe
DELETE /estados/1 DELETE /estados/1.xml
[ { "docid": "6e6b772898a1a2cb4ec9b521845d9409", "score": "0.0", "text": "def destroy\n @estado = Estado.find(params[:id])\n @municipios = @estado.municipios\n\n @destroyed = false\n if @municipios.first.nil?\n @estado.destroy\n @destroyed = true\n end\n\n respond_to do |format...
[ { "docid": "716140e77187b6811beb68015073780e", "score": "0.7036477", "text": "def destroy\n @estagiario = Estagiario.find(params[:id])\n @estagiario.destroy\n\n respond_to do |format|\n format.html { redirect_to(estagiarios_url) }\n format.xml { head :ok }\n end\n end", "titl...
9f2d990723a6c641a92daa542c5c6d62
Returns the object provided to `initialize` The supplied block will be used to decorate the results
[ { "docid": "4c3bafa07ff1a4935b945b3ea6544f88", "score": "0.0", "text": "def find(_capybara_element, &block)\n block.call(prefetched_element)\n end", "title": "" } ]
[ { "docid": "ec0d2d07690e20be51d1067cb7e08e6b", "score": "0.73321813", "text": "def initialize(&block)\n @block = block\n end", "title": "" }, { "docid": "fa878c84e9a82a43a0f75d3f9eab2fd7", "score": "0.7174871", "text": "def initialize(&block)\n instance_eval(&block) if b...
1d31de27131e4dc7d702919beaa68beb
We just test the name and version as we want to be able to see if an unresolved package and a resolved one represent the same bundle package.
[ { "docid": "e819324fcc58bd14b60c8e7ddccc4389", "score": "0.64775795", "text": "def ==(other)\n return false unless other.is_a? BundlePackage\n eql = name == other.name\n eql |= version.nil? ? other.version.nil? : version == other.version\n eql\n end", "title": "" } ]
[ { "docid": "d07d1222e60772b1ec48710b43df7223", "score": "0.7123896", "text": "def version_exists?(name); end", "title": "" }, { "docid": "b990524954c495ed36b94124d3d0922a", "score": "0.7123869", "text": "def test_resolve_package_does_not_match_distro_family\n pkg_hash = packagelis...
b6b9cd199dfaed08c4c534812e0ac109
Check to see if the all the properties in the model are valid
[ { "docid": "42db1b29f02e1e342d531dc080e3038b", "score": "0.0", "text": "def valid?\n return false if @alliance_id.nil?\n return false if @solar_system_id.nil?\n return false if @structure_id.nil?\n return false if @structure_type_id.nil?\n return true\n end", "title": "" ...
[ { "docid": "162d0e63d65b0cd6795543bab63498f2", "score": "0.7899461", "text": "def validate_properties\n true\n end", "title": "" }, { "docid": "162d0e63d65b0cd6795543bab63498f2", "score": "0.7899461", "text": "def validate_properties\n true\n end", "title": "" }...
8b92afe59dfe40c873b9e9fb91dae1ec
version defaults to current production version here too
[ { "docid": "b5cd12262cf741b36fa831ea9ffcb842", "score": "0.0", "text": "def ruletree(property,version = nil)\n raise 'property must be a Borderlands::Property object' unless property.is_a? Property\n version ||= property.productionversion\n tree = nil\n begin\n rt = @client.ge...
[ { "docid": "2f95d253162f250b709ff7b8b72f7fe1", "score": "0.7910445", "text": "def version=(version); end", "title": "" }, { "docid": "2f95d253162f250b709ff7b8b72f7fe1", "score": "0.7910445", "text": "def version=(version); end", "title": "" }, { "docid": "8dc780b73b0aafd1...
a63cd5016fd0ef598f75a8c016ff4756
Create a new RestParam node. source://syntax_tree//lib/syntax_tree/dsl.rb768
[ { "docid": "0400e9ee0dcdcd9bebc5564be57ff775", "score": "0.72344846", "text": "def RestParam(name); end", "title": "" } ]
[ { "docid": "ec0ed00973b3b294cec89256e3ccc2c9", "score": "0.7170044", "text": "def visit_rest_param(node); end", "title": "" }, { "docid": "d43f2b13910d779456335b99d908bf8a", "score": "0.67457837", "text": "def RestParam(name)\n RestParam.new(name: name, location: Location.defaul...
a12e47ea3fbe7e0b054e12deb18459fd
GET /adscripcions/new GET /adscripcions/new.xml
[ { "docid": "2f55a14dc7237ddb0330905d70fe2fa5", "score": "0.0", "text": "def new\n @adscripcion = Adscripcion.new\n\n respond_to do |format|\n format.html { render :partial => \"new_or_edit\", :layout => \"content\"}\n format.xml { render :xml => @adscripcion }\n end\n end", "tit...
[ { "docid": "eaa13e159944602885f01025936ea4d1", "score": "0.6798509", "text": "def new\n @adjunct_addition = AdjunctAddition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @adjunct_addition }\n end\n end", "title": "" }, { "docid...
85abf28ed114d98cd70299017395562d
Combine domain with port if necessary
[ { "docid": "5f712b2019f9987dc3bbd5b8d2774560", "score": "0.743643", "text": "def domain\n @settings[:port].blank? ? @settings[:domain] : \"#{@settings[:domain]}:#{@settings[:port]}\"\n end", "title": "" } ]
[ { "docid": "2bcb03c9c936e00178a8042b5d20ed38", "score": "0.74121964", "text": "def host_with_port(request)\n url = request.scheme + \"://\"\n url << request.host\n\n if request.scheme == \"https\" && request.port != 443 ||\n request.scheme == \"http\" && request.port != 8...
877f6579d7b921caafab98f653e15038
Get the humanreadable title, if it exists.
[ { "docid": "8e4149cb7ccc2cf910eab3932452d5bd", "score": "0.0", "text": "def unlimited_dimension?\n @netcdf_elmt.hasUnlimitedDimension() \n end", "title": "" } ]
[ { "docid": "b0577203778b205f1abfe8a435162fb9", "score": "0.7901963", "text": "def title\n t = nil\n # default to long title\n long_titles = self.courses.map(&:long_title)\n return t if (t = long_titles.find(&:present?)).present?\n\n # then try specific title. then short title\n return ...
1915c4f6251b89ff33c79ca05f4e6aa4
This method should allow you to specify 1. which of the contact's attributes you want to update 2. the new value for that attribute and then make the appropriate change to the contact
[ { "docid": "8023205b6052c41c6f2ae408d64da1f4", "score": "0.0", "text": "def update(search_type, replace)\n\n if search_type == \"first_name\"\n self.first_name = replace\n return self\n\n elsif search_type == \"last_name\"\n contact.last_name = replace\n return...
[ { "docid": "6ab93231ce59bf2cc613c539028254b7", "score": "0.84068453", "text": "def update(atrb,new_value)\n # # and then make the appropriate change to the contact\n # # 2. the new value for that attribute\n if atrb == 'first_name'\n self.first_name = new_value\n elsif atrb == 'last_n...
55128501679dc03b462bb2fc888a1ea4
PATCH/PUT /reservation_details/1 or /reservation_details/1.json
[ { "docid": "b4b52d193362938dcdffd8f2b6fa3b0b", "score": "0.76412046", "text": "def update\n respond_to do |format|\n if @reservation_detail.update(reservation_detail_params)\n format.html { redirect_to @reservation_detail, notice: \"Reservation detail was successfully updated.\" }\n ...
[ { "docid": "69b34af08c0d10a3aafec87affd34647", "score": "0.76036036", "text": "def update\n if @reservation.update(reservation_params)\n render json: @reservation\n else\n render json: @reservation.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "doci...
8cf285996459af5be40cd110983c5111
Build a method, big_shoe_rebounds, that will return the number of rebounds associated with the player that has the largest shoe size. Break this one down into steps: First, find the player with the largest shoe size Then, return that player's number of rebounds Remember to think about return values here.
[ { "docid": "f24a918fae458a76980570166bf30f7e", "score": "0.73777044", "text": "def big_shoe_rebounds\n biggest_shoe = 0\n rebounds = 0\n game_hash.each do |team, all_info_hash|\n all_info_hash[:players].each do |player_information_hash|\n if player_information_hash[:shoe] > biggest_shoe\n ...
[ { "docid": "b71534f6042e01621e9f5e559ae73951", "score": "0.82899386", "text": "def big_shoe_rebounds\n largest = 0\n player = \"\"\n game_hash.each do |location, team_data|\n team_data[:players].each do |k, v|\n if largest < shoe_size(k)\n largest = shoe_size(k)\n player = k\n ...
864e6de5a6f25f1f4f8ed1d1d835bc3d
Sets the attribute events
[ { "docid": "1cc526e6817beae9f6bd89f22edb4081", "score": "0.5489501", "text": "def events=(_arg0); end", "title": "" } ]
[ { "docid": "2e6eeb45df92ab00130109aba1799715", "score": "0.633439", "text": "def set events, *args\n options = args.extract_options!\n\n trigger = Trigger.new\n %w(badge_code nominee_variable action background condition).each do |opt|\n trigger.send \"#{opt}=\", options[opt...
115c741861f3967edf3040779e8f0262
POST /category_as POST /category_as.json
[ { "docid": "94594a91c6bb81162ded4e869934e17c", "score": "0.63728976", "text": "def create\n @category_a = CategoryA.new(category_a_params)\n\n respond_to do |format|\n if @category_a.save\n format.html { redirect_to @category_a, notice: 'Category a was successfully created.' }\n ...
[ { "docid": "1f4161c02039f36c8638fdb404b9156c", "score": "0.70676255", "text": "def create\n @category = Category.new(category_params)\n\n if @category.save\n render json: @category.to_json\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end", "tit...
055ab45b87056c308b9ae6b6a3f8367e
Validate node pass in CLI
[ { "docid": "6c3591f4bdbca7b0ce61b434c77fbc7e", "score": "0.67966026", "text": "def validate_node!\n if @name_args[0].nil?\n ui.error(\"You must specify a node name\")\n show_usage\n exit 1\n end\n end", "title": "" } ]
[ { "docid": "b9fb1ce45afe7e6fe80b0d1f87420c05", "score": "0.65166503", "text": "def _entry_2_validatecommand(*args)\n\n end", "title": "" }, { "docid": "4e62db54247396b5a7c99b942d4fc15f", "score": "0.6489732", "text": "def _entry_4_validatecommand(*args)\n\n end", "title": "" ...
cbc2d43fd0951807b09405b53385aeae
Close the connection without sending the closing frame.
[ { "docid": "7070db24e501517245082140b7658ced", "score": "0.0", "text": "def handle_close(request, event)\n SockJS.debug \"Closing WS connection.\"\n @session.close\n end", "title": "" } ]
[ { "docid": "776ee5a7c18e2a60ef65c97d5e542a5e", "score": "0.7533432", "text": "def close_connection\n @connection.finish if connected?\n end", "title": "" }, { "docid": "e6c23020f27949d9861f48d29089f9a5", "score": "0.74142796", "text": "def close\n @unbound = true\n ...
3392a56851cd6f1ba3e4fe0f3f17927e
pg:kill pid [DATABASE] kill a query f,force terminates the connection in addition to cancelling the query
[ { "docid": "9f763dd9e9f1f5caf9c447ff5d2fb2a4", "score": "0.7930183", "text": "def kill\n requires_preauth\n pid = shift_argument\n output_with_bang \"procpid to kill is required\" unless pid && pid.to_i != 0\n pid = pid.to_i\n\n cmd = force? ? 'pg_terminate_backend' : 'pg_cancel_backend'\...
[ { "docid": "ffb2a4792b118086af2684f61c9f0330", "score": "0.7216491", "text": "def killall\n requires_preauth\n db = args.first\n attachment = generate_resolver.resolve(db, \"DATABASE_URL\")\n client = hpg_client(attachment)\n client.connection_reset\n display \"Connections terminated\"...
ca363cac804dc3f748fdd081e4237a33
Get a single bibliographic record
[ { "docid": "8acd9770bdbd8520a307831e364b1f7b", "score": "0.6179354", "text": "def get_record(id, options = {})\n id = format_id_param(id)\n self.class.get(\"/content/#{id}\", :query => options)\n end", "title": "" } ]
[ { "docid": "380e5492437096d39eadbdadfb7ea8f6", "score": "0.72676885", "text": "def bib\n record['item']\n end", "title": "" }, { "docid": "4079fe0adf60aa9d59d9e99cb04f2b39", "score": "0.7005521", "text": "def retrieve_from_bibdata(id)\n conn = Faraday.new(url: \"https:...
94398bb00d9c654a3a1705b4b6dca8bd
Sets the api key for all resource Removes all earlier authentication info
[ { "docid": "13c013c0f01598409752a876db4a9fad", "score": "0.6970753", "text": "def key=(value)\r\n resources.each do |klass| \r\n klass.headers['X-BillomatApiKey'] = value\r\n klass.headers['Accept'] = 'application/json' # hack :-(\r\n end\r\n @key = value\r\n @ema...
[ { "docid": "6367597af5b4c37dde2cc1bccdd6d455", "score": "0.75850207", "text": "def set_api_key\n\t\tself.api_key = ApiKey.create()\n\tend", "title": "" }, { "docid": "487cb67005bdfe5c48c72092d45580e1", "score": "0.75438637", "text": "def regenerate_apikeys\n current_path = '/api...
6f90bb77c3e04d6902ce24a0d651d512
Baseline implementation for the enable_xpn_resource REST call
[ { "docid": "58c2fc95b50017252cf7462a9d535a32", "score": "0.72756726", "text": "def enable_xpn_resource request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n uri, body, query_string_params = transcode_enable_xpn_resource_reque...
[ { "docid": "cf8a260df2ddbc996936890531da7275", "score": "0.7172265", "text": "def enable_xpn_resource request_pb, options:, &block\n uri = \"/compute/v1/projects/#{request_pb.project}/enableXpnResource\"\n body = request_pb.projects_enable_xpn_resource_request_resource.to_j...
757082c96c4791e16b170c3c60a51ee9
GET /types/1 GET /types/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "c6006328690467090d008be0fdca44c5", "score": "0.75470114", "text": "def index\n @types = Type.all\n json_response(@types)\n end", "title": "" }, { "docid": "b10c76874e1b595dd50c7a973202cb8f", "score": "0.739118", "text": "def index\n @types = Type.order(:name)....
6500bd815f1d41f9c44fec7c8ec99db9
POST /references POST /references.json
[ { "docid": "eb4378fc8406d6c3b92434ae529c3a1e", "score": "0.70180863", "text": "def create\n @reference = current_user.references.new(reference_params)\n\n respond_to do |format|\n if @reference.save\n format.html { redirect_to @reference, notice: 'Reference was successfully created.' }...
[ { "docid": "96f6b50310ac9a87a6d9caabccf5936f", "score": "0.7114272", "text": "def create\n @reference = Reference.new(reference_params)\n \n respond_to do |format|\n if @reference.save\n format.html { redirect_to references_path }\n format.json { render json: @referen...
99ed9e639557927dec2807b16b153cf5
link based helpers > create link to query (e.g. spelling suggestion)
[ { "docid": "4b1b8f6be0673bcfccc5380408b66ba8", "score": "0.6604473", "text": "def link_to_query(query)\n p = params.except(:page, :action)\n p[:q]=query\n link_url = search_action_path(p)\n link_to(query, link_url)\n end", "title": "" } ]
[ { "docid": "47511864626ce5d1d0513ccaeda7b536", "score": "0.68580157", "text": "def lookup_text\n\t\t$app.data_controller.search_matching_links_to @search_text\n\tend", "title": "" }, { "docid": "c5b6e1aea981b2f431db74bee95ba7e6", "score": "0.6784489", "text": "def search_link(attr, v...
69caf50fdc52612f8edefadcfd403a99
documents associated with have_one have the same id (but not uid) as their parent
[ { "docid": "ccb2d9c105f9279d7d08ad9a4fbf03b9", "score": "0.0", "text": "def add_have_one_association(schema)\n schema.parent = self\n @associations[schema] = :have_one\n @klass.send :define_method, \"#{schema.name}=\" do |attribs|\n instance_variable_set(\"@#{schema.name}\", schema...
[ { "docid": "093d320e794b2dd47539c4cb3e5425ff", "score": "0.664146", "text": "def parent \n self.class.where(:id => self.parent_id).first \n end", "title": "" }, { "docid": "093d320e794b2dd47539c4cb3e5425ff", "score": "0.664146", "text": "def parent \n self.class.where(:id => s...
3660631794afa0ebc126f274375bd668
merge_user_id is an internal method used to merge the actual RPX identifiers
[ { "docid": "d9487a9ef3fce5be7e1c7d4106be1ab7", "score": "0.82095784", "text": "def merge_user_id( from_user )\n\t\t self.rpx_identifier = from_user.rpx_identifier\n\t\t from_user.rpx_identifier = nil\n\t\t from_user.save\n\t\t from_user.reload\t\t\n\t\tend", "title": "" } ]
[ { "docid": "dde5ba216c8a275c8d21082ee7edc1a1", "score": "0.8229404", "text": "def merge_user_id( from_user )\n\t\t\tself.rpx_identifiers << from_user.rpx_identifiers\t\n\t\t\tfrom_user.reload\n\t\tend", "title": "" }, { "docid": "b49e2fba4ad223639c245c87933db1e1", "score": "0.6774316", ...
c29416a16807169e0b6502aec55c90c4
Resolve CSEs to CDRs
[ { "docid": "5a7f96f12ab6f2ceda95ad90205273d4", "score": "0.0", "text": "def resolve(start_time, end_time)\n start_run = Time.now\n\n # limit the size of the queues: it's better to get starved than too eat all available memory\n @log.debug(\"CSE Queue Size = #{@config.cse_queue_size} CDR Queue ...
[ { "docid": "5f3f0a989d20dea63428b4e003430c3f", "score": "0.59259105", "text": "def accept(cse)\n @generation += 1\n\n \n if ( cse ) && (!cse.id )\n if (@last_event_time)\n # Synchronize event in order to trigger advancing last_event_time\n if ( @last_event_time.to_time()...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "a6e4cd63f9eb588ac944cc7974053b77", "score": "0.0", "text": "def invitation_params\n params.require(:invitation).permit(:event_attendee_id, :attended_event_id)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.69497335", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6812623", "text": "def strong_params\n params.require(:listing_member).permi...
fba9168db7294f84984ff92380a9a369
GET /eventimages GET /eventimages.json
[ { "docid": "ba799204a6700499af833f722837ebe3", "score": "0.70331573", "text": "def index\n @eventimages = Eventimage.all\n end", "title": "" } ]
[ { "docid": "e23a2bf3e5403a42e4e3725a579ad3b5", "score": "0.7415603", "text": "def images\n @images = @event.uploads.where(:upload_content_type => [\"image/png\", \"image/gif\", \"image/jpe\", \"image/jpeg\"])\n\n respond_to do |format|\n format.json { render json: @images.map{|image| image.to...
7338ee061d3ad27ee586cd3c0c8135f8
required params: announcement, receiver
[ { "docid": "54330dc9628dfbcf2fecc3fe09ad74d9", "score": "0.72467595", "text": "def post_announcement(args = {})\n @receiver ||= args[:receiver]\n @announcement ||= args[:announcement]\n\n @user = @receiver\n @link_url = notification_redirector_url(\n link: \"/announcements/#{@announceme...
[ { "docid": "8721f000f267418c95866afb9d668f1e", "score": "0.6864642", "text": "def on_announcement(ann)\n puts \"...received announcement: #{ann.inspect}\"\nend", "title": "" }, { "docid": "79c0779fb2ab403bf8c0c5504ccc5ec8", "score": "0.6842728", "text": "def announcement_notificatio...
d4ec17b347b75758b8badc6c3b4785b8
calculates how much funding the project still needs
[ { "docid": "f73780a0f2c7c53ead74983a83d9301b", "score": "0.72926", "text": "def still_needed\r\n\t@target_fund - @fund\r\nend", "title": "" } ]
[ { "docid": "1ccb50be06be1276cd86bf77041f5f6a", "score": "0.70783216", "text": "def needed_amount_less_savings\n recommended_min_portfolio - portfolio_after_growth\n end", "title": "" }, { "docid": "e7c9999e2cdcdf638c3f4190ef75017b", "score": "0.699933", "text": "def remaining_fun...
f3088101cd0c68e11d8f2d46088bd4b5
Returns a valid SQL fieldname as a string. Field names specified as symbols can include double underscores to denote a dot separator, e.g. :posts__id will be converted into posts.id.
[ { "docid": "11b4adf3fb31a6fcd69a220ea7127cfc", "score": "0.7629916", "text": "def field_name(field)\n field.is_a?(Symbol) ? field.to_field_name : field\n end", "title": "" } ]
[ { "docid": "97f1d2fdc3258388d1eb13b75bd1056b", "score": "0.75475323", "text": "def database_field_name(name)\n return nil unless name\n normalized = name.to_s\n end", "title": "" }, { "docid": "7f2fb5e7e0ffffb6c9f9436494cccf4d", "score": "0.6995535", "text": "def d...
3bdf27da07282a516f6d06511c7e7431
end last three month begin last six month
[ { "docid": "e7aa2463e1b416a8b20a52cac3eb8989", "score": "0.62446296", "text": "def last_six_month_trade_day\n self.last_trade_day.months_ago(6)\n end", "title": "" } ]
[ { "docid": "fe688d019be66adbba12f1a23b00ef3d", "score": "0.7643095", "text": "def end_of_month; end", "title": "" }, { "docid": "fe688d019be66adbba12f1a23b00ef3d", "score": "0.7643095", "text": "def end_of_month; end", "title": "" }, { "docid": "b7301b158df589dcde4e5b0d8f...
02664b61752907b6189c13c59ceda614
Metodo to_string que pinta en pantalla lo deseado
[ { "docid": "fe7bdae82229b63e544173bfe574a1b6", "score": "0.0", "text": "def to_s\n \"#{@aText}\"\n end", "title": "" } ]
[ { "docid": "261e99bc26f16e3740139586062394ef", "score": "0.8295287", "text": "def to_s() end", "title": "" }, { "docid": "8b1fb58f6afe0db985d2335dcf091a8f", "score": "0.82353735", "text": "def to_s(*) end", "title": "" }, { "docid": "8b1fb58f6afe0db985d2335dcf091a8f", ...
3abeba01ca87a84e9580435df6f014a6
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.user_notifier.welcome.subject
[ { "docid": "bbfdeef2469780c32984bd01bf96d171", "score": "0.0", "text": "def welcome(user)\n @user = user\n mail to: user.email, subject: \"Welcome, please activate your account\"\n end", "title": "" } ]
[ { "docid": "f2fecd58a29b9acf94ad3b95a78dc2e7", "score": "0.76166385", "text": "def welcome_email_subject\n @attributes[:welcome_email_subject]\n end", "title": "" }, { "docid": "8928fe4f050d7ebd3e9aa992b07e320a", "score": "0.74851626", "text": "def subject_for\n Active...
1f9b8239d545eff6db55569f4d23cc0a
returns an array containing the values or texts of all options of the select box.
[ { "docid": "35050b2a2e5a2edffa6ef2885f25e34e", "score": "0.0", "text": "def options(type=\"text\")\n \t\tsahi_delimiter = \"__SAHIDELIMITER__\"\n \tarr_string = @browser.fetch(\"_sahi._getOptions(#{self.to_s()}, #{Utils.quoted(type)}).join('\" + sahi_delimiter + \"')\");\n \t\treturn arr_string.split...
[ { "docid": "27ba1af573785430ae08e6956aef2d5a", "score": "0.81104153", "text": "def values\n a = []\n items.each do |item|\n a << option(:text, item).value\n end\n return a\n end", "title": "" }, { "docid": "cbd6a239ba072047a9b476ca1c6c23e2", "score": "0.7340...
908b1e219a0eb17245ae24ae507a7479
Returns a developerfriendly representation of this transaction.
[ { "docid": "622e4f8aad514b096de4eaef95a7c1db", "score": "0.0", "text": "def inspect\n sprintf(\"#<%s:%#0x(graph: %s, deletes: %d, inserts: %d)>\", self.class.name, __id__,\n graph ? graph.to_s : 'nil', deletes.count, inserts.count)\n end", "title": "" } ]
[ { "docid": "19b3fcc8db01fae2f72b9d3876702a76", "score": "0.6937157", "text": "def to_s\n \"#<#{self.class.to_s}:#{self.id} @attributes=#{@attributes.inspect}>\"\n end", "title": "" }, { "docid": "75c468ae7aac18e1f6817fa278aa2fc3", "score": "0.67918736", "text": "def to_s\n ...
0d7c0ee8567c016e8c4edb4a0c2ba95f
PATCH/PUT /productions/1 PATCH/PUT /productions/1.json
[ { "docid": "499f592c5916307bc721dba3153cab48", "score": "0.60558856", "text": "def update\n\n respond_to do |format|\n\t @production=Production.find(params[:id])\n\t @pmu=@production.pmu\n if @production.update(production_params)\n format.html { redirect_to pmu_production_path(@pmu,...
[ { "docid": "abb4aa5b49c25bc5f430c0b34b4ac57f", "score": "0.69867915", "text": "def update\n respond_to do |format|\n if @production.update(params[:production])\n format.html { redirect_to action: 'edit', notice: 'Production was successfully updated.' }\n format.json { head :no_cont...
be6733683c82ccfdd6cadfd3b90e8148
Come here to renew a membership from last year
[ { "docid": "b721c376b3aa319d7e78d8341f9576be", "score": "0.69065243", "text": "def handle_renew(mem_id, owner=@session.user)\n @data.owner = owner\n\n @data.mem = Membership.with_id(mem_id)\n if !@data.mem\n error \"I couldn't find that TeamPak\"\n @session.pop\n else\n ...
[ { "docid": "e368a9d379189a0314c3dab95d6c4f74", "score": "0.7107774", "text": "def renew_ticket(env)\n if @configuration['renew'] && env['global_session'] &&\n env['global_session'].directory.local_authority_name &&\n env['global_session'].expired_at < renew.to_i.minutes.from...
5202e692abda60611782eec25083be51
calls the "getHistograms" operation for a given category
[ { "docid": "ea5f239f010b97eb0dc33c37e5350bc7", "score": "0.8167848", "text": "def histograms( category, extra_params = {})\n params = { \"categoryId\" => TOP_LEVEL_US_CATEGORIES[category]||category }.merge!(extra_params)\n fetch(build_url(\"getHistograms\", params))\n end", "title": "" } ]
[ { "docid": "3791101604ba2e90f8896bb9c7283e08", "score": "0.8135106", "text": "def get_histograms(category_id)\n request('getHistograms', 'categoryId' => category_id)\n end", "title": "" }, { "docid": "96d4c8883218634cc36d23ae41da90d3", "score": "0.71739167", "text": "def cate...
40aac4bcc06cc5cbec228a73d2ba7f8f
POST /transactions POST /transactions.json
[ { "docid": "e04111ed68ed084a1b4385ce0fa40f0d", "score": "0.6642784", "text": "def create\n @transaction = current_user.transactions.new(params[:transaction])\n \n respond_to do |format|\n if @transaction.save\n format.html { redirect_to transactions_path, notice: 'Transaction was su...
[ { "docid": "0223c6f1aa8e4390fc1de89565f96635", "score": "0.71249044", "text": "def postTransaction(useridgiving, useridreceiving, amount)\n parameters={useridgiving: useridgiving.to_i, useridreceiving: useridreceiving.to_i, amount: amount.to_f, state: \"initial\"}\n options = {\n :body ...
873eb3a95980cd2e52c8fc1de99fc8d7
Converts an array of permissions into a DACL object.
[ { "docid": "c5110cdc99b0f22d9205a7a8275421ec", "score": "0.6955426", "text": "def convert_to_dacl(permissions)\n dacl = Puppet::Util::Windows::AccessControlList.new\n return dacl if permissions.nil? || permissions.empty?\n\n permissions.each do |permission|\n sid = get_acco...
[ { "docid": "0e765e3284838ab5e795c7d351a4fa9f", "score": "0.5368916", "text": "def make_equivalent_permissions(object, access_controls)\n access_controls.each{ |access_ctl| object.permissions.build access_ctl.to_hash }\n end", "title": "" }, { "docid": "96dc5ef4a734a9fe6f20af161dd9c34...
4bb73340aa664821f4b8b5f41d787359
this is an example of a method spec'able with eval_erb in helper specs
[ { "docid": "4a2c290b4cb9c922d78155c6a53ab6f3", "score": "0.0", "text": "def prepend(arg, &block)\n concat(arg, block.binding) + block.call\n end", "title": "" } ]
[ { "docid": "caf4bb03fe048733af84c4cb0aeb1187", "score": "0.83690673", "text": "def evaluate_erb; end", "title": "" }, { "docid": "4de8698fc9da2745068eb7e22d727513", "score": "0.66211444", "text": "def render_erb(&code)\n template, layout, locals = ErbRenderHelper.new.render &cod...
84c8aabc0fbfecff8dbec6f4682a4f5d
Report incorrectly solved captcha for refund.
[ { "docid": "e9b536e47dcae502f19199504a6881cd", "score": "0.65312564", "text": "def report!(captcha_id)\n raise NotImplementedError\n end", "title": "" } ]
[ { "docid": "e631fae9aab4646ce6675c6bf923c02d", "score": "0.65937907", "text": "def error_report\n @report = Report.new(trusted_params)\n if verify_recaptcha(model: @report) && @report.valid?\n ReportMailer.email_message(@report).deliver_now\n redirect_to root_path, success: 'Thank you fo...
f6fc9060ae0a9f5440b863d86fbc14f3
two users can not have the same username
[ { "docid": "b3d640939a7cc09363fd87b02c542405", "score": "0.0", "text": "def activate? #activates the users account once they have registered\n update_attributes(:activated => true)\n if self.activated\n return true\n else\n return false\n end\n end", "title": "" } ]
[ { "docid": "f1dc44c75796699fa597157205847c95", "score": "0.75610834", "text": "def prevent_duplicated_username\n user_with_it_username = User.where(username: self.username).take\n\n unless user_with_it_username.nil?\n self.errors.add('username', 'already taken')\n raise ActiveRec...
b609d129aa80c09eda909ee9786fe0f8
Counts the number of children that are keying to this Esm.
[ { "docid": "c3c927ac4a0773588715ea676de9285d", "score": "0.7106329", "text": "def keying_children\n return children.inject( 0 ) do |product, value|\n product += 1 if value.try( :device ).try( :keying? )\n product\n end\n end", "title": "" } ]
[ { "docid": "995190f58757cb0490beabe34ef55c99", "score": "0.8293131", "text": "def total_child_count\n count = 0\n self.apply_to_children { |e| count += 1 }\n count\n end", "title": "" }, { "docid": "ec098308f80e646c8c951af900cc5c14", "score": "0.79333824", "text": "...
42df98c7d109798017813ad3ef7812c8
Delete MetaTag Value Returns True on Success, False otherwise
[ { "docid": "3531eaf0f04b1000eee88a8a341484f4", "score": "0.6953172", "text": "def delete(obj, tag)\n if not obj.tags.include?(tag)\n return false\n else\n obj[tag] = '' # Set to Nothing to Wipe Tag\n if obj.save\n return true\n else\n return false\n end\n end\nend", "titl...
[ { "docid": "2dc59e7549f6721fd7d6000e0a21c7bf", "score": "0.726289", "text": "def destroy\n @meta_tag.destroy\n end", "title": "" }, { "docid": "37edc27db148edf830eff3205eadc0d1", "score": "0.71605194", "text": "def test_del_meta_deletes_meta_tag\n assert_nothing_raised(Excepti...
95e27b35c47ce2fa45216d1d68a5520d
CHECK TO SEE IF HOTEL NAME EXISTS
[ { "docid": "ac1ce65c913201d77b977465fbf6c4e9", "score": "0.0", "text": "def checkHotel\n h = Hotel.checkHotel( params[:hotel] )\n if h != 0\n render :nothing => true, :status => 409\n else\n render :nothing => true, :status => 200\n end\n return\n end", "title": "" } ]
[ { "docid": "a18dfa83a4ed507d521a7405a05c27a5", "score": "0.68385434", "text": "def exist?(name)\n find(name) != nil\n end", "title": "" }, { "docid": "de5536f1e5a6e50fcf6dcfc46cbfee13", "score": "0.68266547", "text": "def name_exists(name)\n return false if name.nil? || na...
6201162075ab73f9e8424f0d7c4c492e
DELETE /items/1 DELETE /items/1.json
[ { "docid": "c1a25d22d3e8532aa7078da3f232c512", "score": "0.0", "text": "def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to admin_items_path, notice: '成功刪除商品' }\n format.js # destroy.js.erb\n end\n end", "title": "" } ]
[ { "docid": "86faa8c555419d7144a0c7003f760dff", "score": "0.7906849", "text": "def delete\n render json: Item.delete(params[\"id\"])\n end", "title": "" }, { "docid": "119acbd53f246ab3b80d6d093babf58b", "score": "0.76885504", "text": "def delete(items)\n item_ids = items....
c9d3433a3007552b062b92a29ce7a8ce
Patch call server middleware directly instead of replicating it's logic
[ { "docid": "e110cdee0a939f4ed36116a5eb5c09d8", "score": "0.0", "text": "def execute_job_ext(worker, args)\n pool = Sidekiq.redis_pool\n item = { 'class' => worker.class, 'args' => args }\n normalized_item = Sidekiq::Client.new(pool).send(:normalize_...
[ { "docid": "3f35059e1fa6a00c17e6ed37a5946aaa", "score": "0.6499801", "text": "def middleware; end", "title": "" }, { "docid": "d41c80410fc8662ca8cd4c59dc1f4665", "score": "0.63681597", "text": "def middleware(&block); end", "title": "" }, { "docid": "4e0e59715d19dce2a47fc...
27200ff195e15d3e29a24e6892c383a9
Place a new call as part of a callback conversation.
[ { "docid": "f7458714b71de361384810f2dac2ddfa", "score": "0.0", "text": "def post_conversations_call_with_http_info(conversation_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.post_conversations_call ...\"\n end\n ...
[ { "docid": "134c4fbf5f65e01d4b508950fbc788d2", "score": "0.66822094", "text": "def place_call\n client = Twilio::REST::Client.new(Settings.twilio.account_sid, Settings.twilio.auth_token)\n params = {\n from: call.caller_id,\n to: call.member_phone_number,\n url: call_start_url(call)...
7a0102a3f9be0576abc4635ba03bfc56
Returns false if the specified post doesn't exist, and preps an appropriate error and log message
[ { "docid": "71e9ac01adfc37c5e1d4665ccbae7914", "score": "0.7191306", "text": "def is_valid?(post)\n valid = !post.nil?\n if !valid\n flash.now[:error] = \"No post by specified id under the current user.\";\n logger.error \"Post :: No post by specified id under the current user.\"\n en...
[ { "docid": "7a811c0e66a772d84e9bb1c54628a978", "score": "0.7826603", "text": "def check_existing post\n new_post = (Post.find_by_guid(post['guid']).blank?)\n\n FEDERATION_LOGGER.warn \"a post with that guid (#{post['guid']}) already exists\" unless new_post\n\n new_post\n end", "ti...
ce714ce1487698d61dedd50577cb687c
Create the given user.
[ { "docid": "d9f0bbda8d7da65e5b26326745e89b39", "score": "0.0", "text": "def action_create\n if current_resource.exists? &&\n current_resource.last_name == new_resource.last_name &&\n current_resource.first_name == new_resource.first_name &&\n current_resource.password == new_resource...
[ { "docid": "a33c0e168125252fa684dd279c22aa97", "score": "0.8337541", "text": "def create_user(**args)\n request_post('/user', **args)\n end", "title": "" }, { "docid": "1ff8d97032e5ef3f2cfa03459366afee", "score": "0.81720793", "text": "def create_user(params = {})\n po...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "2b7385e16d4d8a4afcf57d9f4ceb512f", "score": "0.0", "text": "def result_params\n params.fetch(:result, {}).permit(:upload_date, :result_id, :file_path, :user_id, :lab_id, :name)\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...
845e18feb5831a805187b1aa35f8a384
If a connection already exists yield it to the block. If no connection exists checkout a connection, yield it to the block, and checkin the connection when finished.
[ { "docid": "7434a6740ca94f30ff3b1ba254e79387", "score": "0.6567897", "text": "def with_connection\n connection_id = current_connection_id\n fresh_connection = true unless active_connection?\n yield connection\n ensure\n release_connection(connection_id) if fresh_connection\n en...
[ { "docid": "82fc4ef25a4fac09c6f1d4f9ae6684df", "score": "0.7769146", "text": "def with_connection\n conn = checkout\n yield conn\n ensure\n checkin conn\n end", "title": "" }, { "docid": "d4d4887f177a9123be26492d3d2c3ac1", "score": "0.72452986", "text": "def with_new_conne...
a9829d7a0bd4bdba6de13d049f2b17a5
Delete file Delete file
[ { "docid": "455f4cdb405cd21c1584738289039f43", "score": "0.0", "text": "def delete_file(file_name, opts = {})\n delete_file_with_http_info(file_name, opts)\n nil\n end", "title": "" } ]
[ { "docid": "eef7c4f3dbf1fced2d3e3aa83a0799ec", "score": "0.8576715", "text": "def delete\n `rm #{file_path}`\n end", "title": "" }, { "docid": "62cabffacbc42aba1988ff560f169a1e", "score": "0.85689926", "text": "def delete_file\n\t\t\tself.file.destroy\n\t\tend", "titl...
54b4db0c99a8075786fdbfcfb411250a
GET /urls GET /urls.json
[ { "docid": "3b2893f9070aea217ed3032310c93b61", "score": "0.62464184", "text": "def index\n @urls = Url.all\n end", "title": "" } ]
[ { "docid": "5b4302ca1d94c68761b5429a6008fdec", "score": "0.74799776", "text": "def index\n @urls = Url.all\n\n render json: @urls, status: :ok\n end", "title": "" }, { "docid": "fbed884270b83f85c568b0145d2153ed", "score": "0.74270976", "text": "def index\n @urls = Url.all\n...
b6cddbf1e98ba1012001a822550a4474
Execute a GET request. Used to get (find) resources.
[ { "docid": "8f3cf5983b6ac3a502d3c46ed8df5eed", "score": "0.0", "text": "def get(path)\n from_xml_data(Hash.from_xml(request(:get, path, build_request_headers).body).values.first)\n end", "title": "" } ]
[ { "docid": "0b1a66946a229ec6d1dc6953fc71e5f0", "score": "0.74120176", "text": "def get\n resp = conn.get(@path, @params)\n parse_response(resp)\n end", "title": "" }, { "docid": "9d8b832d68098271cad4080bb7ec7b7c", "score": "0.73349196", "text": "def get(*args)\n map...
7c1d58eca3b967abdb55abb45e73e57e
Standard constructor of a metrological quantity. A quantity may have a name and a dimension.
[ { "docid": "cc1247671485819e7e8fece03b7abfe5", "score": "0.7246878", "text": "def initialize( relative: nil,\n composition: nil,\n of: nil,\n measure: nil,\n amount: nil,\n coerces: [],\n coerces_to: []...
[ { "docid": "b6865eb1d51f6c232aa82284d04294db", "score": "0.76118106", "text": "def initialize(name, quantity)\n @name = name\n @quantity = quantity\n end", "title": "" }, { "docid": "051ac339cad5c3ce9bc13a887950d723", "score": "0.7302457", "text": "def initialize(aName, aDescr...
7401eb7f4c24adc3b8534a843c564c19
Close the current browser window (started by the script). If no browser started, then close all browser windows.
[ { "docid": "11a64c1ef0ea0fbb03bf582e3f6edc07", "score": "0.7376378", "text": "def close_browser\n if @web_browser\n # Old iTest2 version\n # @web_browser.close_browser unless $ITEST2_LEAVE_BROWSER_OPEN_AFTER_RUN\n @web_browser.close_browser\n else\n WebBrowser.close...
[ { "docid": "788e0907af03fd1bebb383b81f3a7fcb", "score": "0.79020405", "text": "def close_other_windows\n cur_window = browser.window_handle\n browser.window_handles.each do |window|\n next if window.eql?(cur_window)\n\n browser.switch_to.window(window)\n browser.close\n end\n ...
cc338f40f42a88df3e484b9c0aca6e9a
Returns parts of Conglomerate
[ { "docid": "cb9f935f62924a8873db7d7e2c2a2085", "score": "0.0", "text": "def vomit(component_name)\n @conglomerate.public_send(component_name)\n end", "title": "" } ]
[ { "docid": "90e044dd12ddee837099324edf25b0e6", "score": "0.51333976", "text": "def split_by_longitude\n #two quadrants (W != E)\n \n if tl_crd.long_hem == 'W' \n #going over 0 meridian W => E\n split_long_num=0.0\n else \n #going over 180 meridian E => W\n ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "517752c65780385cbc0f191c9700b232", "score": "0.0", "text": "def integrant_params\n params.require(:integrant).permit(:email, :encrypted_password)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.requ...
16cc7157e4472a36b389bc977e76ac72
Retrieves the value of a specific bit. 13.get_bit_val(1) => 0 13.get_bit_val(2) => 1 bit_pos an index representing the bit position (from right to left) Returns a Fixnum (either 1 or 0).
[ { "docid": "161d06438bcf300c33928cb6b178304b", "score": "0.82983524", "text": "def get_bit_val(bit_pos)\n (self & ( 1 << bit_pos )) >> bit_pos\n end", "title": "" } ]
[ { "docid": "98fe9fca3a0a44435cd13a6490c7b8de", "score": "0.73185277", "text": "def get_bit!\n bit = get_bit()\n if (bit.nil?) # nil check\n else\n incr_offset!(0, 1)\n end\n bit\n end", "title": "" }, { "docid": "0787164d2877ef6ab46b895464c73103", "score": "0.6953938...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "7e1000d2a8c61e70c9c7ea3ddc3ee556", "score": "0.0", "text": "def set_hoy\n @hoy = Hoy.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163821", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045432", "text": "def action_hook;...
4e0eec8544cc22cbc1494c27023ff530
Determine if there are any subscribers for a particular event.
[ { "docid": "fac279f314639503638113afeaf78f61", "score": "0.69597596", "text": "def subscribers?(topic)\n !subscribers_for(topic).empty?\n end", "title": "" } ]
[ { "docid": "fabda68dfb4ad728fd1184c530080591", "score": "0.7950109", "text": "def subscribed?(event)\n\t\tsubscribed_events.include?(event)\n\tend", "title": "" }, { "docid": "59deda5b377791ccecd2b7bac5d79a29", "score": "0.7369237", "text": "def has_subscribers(name)\n self.subs...
cdb5e450372b0e9434108e9e7fd22374
Return current version record.
[ { "docid": "3d65b786638f3f1cfbf1af54950db82b", "score": "0.7425176", "text": "def current_version\n versions.first :order => [:number.desc]\n end", "title": "" } ]
[ { "docid": "1c97d8d4010a99f11a1cf52d9885c6b5", "score": "0.8022354", "text": "def record\n new_version.record\n end", "title": "" }, { "docid": "c2c716007205075d33d2713e149cb5b9", "score": "0.7850827", "text": "def version\n return nil if self.new_record?\n @version...
c14281937488d1dd28227904329777f2
Writes a file with the specified contents. ==== Input [file_path : String] The path to the file that will be created/overwritten. [contents : String] The string to use as the contents of the file. ==== Notes This method is overridden during testing.
[ { "docid": "5f253d5e9955f3533df7175543a4929b", "score": "0.8566979", "text": "def write_file(file_path, contents)\n File.open(file_path, 'w') do |file|\n file.write contents\n end\n end", "title": "" } ]
[ { "docid": "4428a5b5e5cddfa2010a1963a8508b19", "score": "0.8603965", "text": "def write_file(path, contents)\n ::File.open path.to_s, 'w' do |file|\n file.write contents\n end\n end", "title": "" }, { "docid": "ad85a264a8bf1309df0c93031ede5454", "score": "0.812603", ...
797855e423506a5e4fc87b77720ef060
Returns the current state of the game as a string that can be printed on the command line. The board should have the same dimensions each time.
[ { "docid": "aaceb43057ff779f319a4ca72adc24b2", "score": "0.0", "text": "def board_visualization\n @players.each do |racer|\n in_front = @length - @position[racer]\n # track = \"|\" * 30\n # p track.insert(@position[racer, racer.to_s)\n p \" |\" * @position[racer] + racer.to_s + \"...
[ { "docid": "c638c05b83c250a75dab26464323bb00", "score": "0.7603472", "text": "def current_state_string\n string = \"\"\n\n (@size * @size).times{ |i|\n if i % @size == 0\n string << \"\\n\\t\"\n end\n if @state[i]\n string << \"1 \"\n else\n string << \"0 \...
f533d19df2fc4fa04cfaec747b2a08a2
GET /lock_requests GET /lock_requests.json
[ { "docid": "0e92ec3788d383d2d7e77d37dd824fc7", "score": "0.6484093", "text": "def index\n @lock_requests = LockRequest.all.reverse\n end", "title": "" } ]
[ { "docid": "25472ce0e24be8a1d5dcf33cb3a30d4f", "score": "0.69255817", "text": "def lock\n lockinfo = request_document.xpath(\"//#{ns}lockinfo\")\n asked = {}\n asked[:timeout] = request.env['Timeout'].split(',').map{|x|x.strip} if request.env['Timeout']\n asked[:depth] = depth\n ...
c4f8cd24487547d1e9b90bdfe20c912a
Check if all items follow block conditions
[ { "docid": "ee7dcc7d035e126dfe48135b0ff4a66b", "score": "0.59871197", "text": "def my_all?\n return self unless block_given?\n for a in self\n if !yield(a)\n return false\n end\n end\n return true\n end", "title": "" } ]
[ { "docid": "ab12cabbc6f98b7eee8b4e99a34123e5", "score": "0.66738355", "text": "def my_all?\n if block_given?\n self.my_each{|item| return false if yield(item) == false }\n # return true unless one is false\n true\n else\n # if no block given return true\n true\n end\n ...
9a8865cacdb7af105ab3d8a16a3a8629
Return the index of the largest component (abs)
[ { "docid": "66baf5ed519145c9d39bd9014205d096", "score": "0.8207136", "text": "def largest_abs_component\n abs_point = self.abs\n temp = [abs_point.x, abs_point.y, abs_point.z]\n if (temp[0] > temp[1])\n if (temp[0] > temp[2])\n return 0\n else\n return 2\n ...
[ { "docid": "ef59e7d852aa08bd96e2e02366ca7dad", "score": "0.7203911", "text": "def find_max_elem(column_index)\n max_index = column_index\n @data[column_index, @data.length].each_with_index do |row, index|\n max_index = index + column_index if row[column_index].abs > @data[max_index][column_in...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "8f9a377795fc5a01884446b28ee54b9c", "score": "0.0", "text": "def set_sellout\n @sellout = Sellout.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...
a8d420d0f0edd87b6ca6153c9794fc2b
redirect to log in page if user not log in
[ { "docid": "b23bd3691fb96379f1df038df02e7a21", "score": "0.0", "text": "def authorized\n return redirect_to \"/home/login\" unless log_in?\n end", "title": "" } ]
[ { "docid": "a8ae83eaa25dc3eaf37d11617317f409", "score": "0.8622998", "text": "def redirect_if_not_logged_in\n redirect to \"/login\" if !logged_in?\n end", "title": "" }, { "docid": "a6642ebfabfe727f202cf0ab1393d254", "score": "0.8470689", "text": "def redirect_to_login_if_...
bda5e91c53bf4dc6b03c8318fe2dd0f0
for each node type, yield all the running nodes with an index
[ { "docid": "58bd2d5adafa7f5b7c748fa3fe862e65", "score": "0.7275915", "text": "def each_node_with_type_and_index(&block)\n node_types.each do |node_type|\n self.send(\"#{node_type}_nodes\").each_with_index do |n, i|\n block.call(n, node_type, i)\n end\n end\n ...
[ { "docid": "785ca4f482c13060c2eb7768b51c444c", "score": "0.69593173", "text": "def each_node_with_index\r\n i = 0\r\n each_node do |node|\r\n yield(node, i)\r\n i += 1\r\n end\r\n end", "title": "" }, { "docid": "32db1b6b168cd06875daf3f3ec002231", "score": "0.6759886"...
354deea45e936fcb5014eb522ff40b2c
handle NotFound exceptions (404)
[ { "docid": "5f1920a1bcf8441bd3ba916eee808bfb", "score": "0.0", "text": "def not_found\n render :format => :html\n end", "title": "" } ]
[ { "docid": "47d364d4a5af47408ce1272ef07ff3f0", "score": "0.8308931", "text": "def rescue_404\n rescue_action_in_public CustomNotFoundError.new\n end", "title": "" }, { "docid": "4f2b6809f006dbdb87b9358783b00fe9", "score": "0.82841516", "text": "def not_found\n halt 404\n en...
eefd0c2f7f0364510eafe3d8787b1a47
Close the current tab/room on the screen
[ { "docid": "f38a1dd427b426982a32eb30c7ed34e9", "score": "0.7683916", "text": "def local_close(body)\n body = @var[:room] if body.empty?\n @window.remove_tab(body)\nend", "title": "" } ]
[ { "docid": "ac9317ef7e5b06e350a256e093870ad8", "score": "0.7236146", "text": "def close\n shut_window\n end", "title": "" }, { "docid": "1b515ca14b661dcd116028464f3aff0c", "score": "0.7210612", "text": "def close_tabs\n end", "title": "" }, { "docid": "265506...
ce92777b7df0200b7273577faf877ebc
Sets the quarantineUponUpnConflictEnabled property value. Used to indicate that we should quarantine objects conflicting with duplicate userPrincipalName.
[ { "docid": "b98a110dcf012b5b7e337bbaba22ccc1", "score": "0.7785871", "text": "def quarantine_upon_upn_conflict_enabled=(value)\n @quarantine_upon_upn_conflict_enabled = value\n end", "title": "" } ]
[ { "docid": "3fc20a55847c31b1a53d2731cbb683c4", "score": "0.6841782", "text": "def quarantine_upon_upn_conflict_enabled\n return @quarantine_upon_upn_conflict_enabled\n end", "title": "" }, { "docid": "8837e45e51c6b2af1a04218cf741e294", "score": "0.6446626", ...
0b1269420b45ed090d22bf0cfdbe3738
Instantiates a new Cloud Syncer object for either the Cloud::S3 or Cloud::CloudFiles Syncer. Preconfigured defaults specified in either Configuration::Syncer::Cloud::S3 or Configuration::Syncer::Cloud::CloudFiles are set via a super() call to Syncer::Base. If not specified in the preconfigured defaults, the Cloud speci...
[ { "docid": "b99b631bc9fd6f2878f9a246878633f8", "score": "0.0", "text": "def initialize\n super\n\n @concurrency_type ||= false\n @concurrency_level ||= 2\n end", "title": "" } ]
[ { "docid": "f4a1d8f539c368c7f936f966c0a731ad", "score": "0.58073354", "text": "def initialize(options = {})\n initial_options = options.dup\n\n @config = load_config(initial_options.delete(:config_file))\n \n config.merge!(initial_options)\n config.validate!\n \n RightAws::RightAwsB...
1fd5b9667fcd0c31b3b7399ba22c0394
Remove specific tags from the tag_list. Use the :parse option to add an unparsed tag string. Example: tag_list.remove("Sad", "Lonely") tag_list.remove("Sad, Lonely", :parse => true)
[ { "docid": "e699f1a431056eb0acb92184fba618ec", "score": "0.57505083", "text": "def remove(*names)\n extract_and_apply_options!(names)\n delete_if { |name| names.include?(name) }\n self\n end", "title": "" } ]
[ { "docid": "5571c7147fa9b08f8d47185820df7141", "score": "0.7197185", "text": "def removeTag\n #they are stored as a string parameter, where tags are separated by spaces, so split to create an array\n @tagsToAdd = params[:tagsToAdd].split(\" \")\n #remove this tag from the list\n ...
eb2731a763ba9258113b79378c5390d0
Helpers Returns a list of all the pods in this repo
[ { "docid": "d6f4ada0dd917cf1e7729bffd4e011f9", "score": "0.73062176", "text": "def all_pods_in_repo\n return Dir.glob(\"./*.podspec\").map { |file| Pod::Specification.from_file(file).root.name }\nend", "title": "" } ]
[ { "docid": "50bb7e48aeccefb17e737830beca8f59", "score": "0.74663436", "text": "def getPods(namespace)\n pods = []\n begin\n kubesystemResourceUri = \"namespaces/\" + namespace + \"/pods\"\n podInfo = JSON.parse(getKubeResourceInfo(kubes...
c8debf4743da128ced07bee9f6ec2d88
We only set the noramlized number on a attribute accessor, so copy it to the actual record if validation was successful.
[ { "docid": "3dd08bd6cbe2e4a46549bd00d9f2c77a", "score": "0.59735173", "text": "def save_normalized_numbers\n self.phone_number = normalized_phone_number\n self.fax_number = normalized_fax_number\n end", "title": "" } ]
[ { "docid": "5c8959307e1db3885c455be280652d53", "score": "0.63259435", "text": "def number\n reload if attributes['number'].nil? && persisted?\n attributes['number']\n end", "title": "" }, { "docid": "7510deeea4399a610c364189538fabae", "score": "0.61851704", "text": "def real_n...
a6a7e62c6920aa3f288f315185e04418
Update sprite, showing correct frame, scrolling horizontally left, and killing sprite as leaves screen
[ { "docid": "abb873929f432f6315e14d8379f4d560", "score": "0.7776095", "text": "def update \n\t\t@currentframe = (@currentframe + 1) % @frames.size \n\t\t@image = @frames[@currentframe] # load the image\n \t@rect.move!(-@xspeed,0) # move horizontally left \n if @rect.right() < 0\n\t\t\t\tself.kill # ...
[ { "docid": "68547126f5c2c75def60e38e62a35fa0", "score": "0.71137816", "text": "def handleUpdate(sprite) end", "title": "" }, { "docid": "b780fd1e44968c771df4ae07a9850e47", "score": "0.7035822", "text": "def update\n @position = @mouse.getMousePos\n if !@position.nil?\n @x ...
0a56ac6777f1c5264d78e770c1f02e98
POST /pharmacy_payments POST /pharmacy_payments.xml
[ { "docid": "40235d687c8e462bb9b823a27db9538c", "score": "0.0", "text": "def create\n\t@session_id=session[:id]\n\t@session = Session.find(session[:id])\n\t@person = Person.find(@session.person_id)\n @pharmacy_payment = PharmacyPayment.new(params[:pharmacy_payment])\n @goods=Goodsrecieptnotemaster.fin...
[ { "docid": "9927207508e35b46c3037fb18f7cda0a", "score": "0.6507467", "text": "def make_payment\n worldpay_request_response(payment_xml)\n xmldoc = Nokogiri::XML( response )\n error, reference = [ xmldoc.at_xpath('//error'), xmldoc.at_xpath('//reference') ]\n if error\n errors.add(:base,...
3e09d77f6bde111e24f9f2170a58b5be
Returns the current loggedin user (if any).
[ { "docid": "83b7a86f663f701a8ed90c0b78132efe", "score": "0.8078152", "text": "def current_user\n if session[:user_id]\n @current_user ||= User.find_by(id: session[:user_id])\n end\n end", "title": "" } ]
[ { "docid": "1e2c1b815c6a3abd7ca57d13a95399c0", "score": "0.85960984", "text": "def current_user\n if session[:user_id]\n return User.find(session[:id])\n else\n return nil\n end\n end", "title": "" }, { "docid": "c308cad84e780aa521322ad1e5bd4b23", "score": "0.8593657"...
672073d351a4882ffef10522dd7c48f1
GET /diagramas GET /diagramas.json
[ { "docid": "b3ea10b5d8e62bb63aeed1a9be58ddd1", "score": "0.752303", "text": "def index\n @diagramas = Diagrama.all\n end", "title": "" } ]
[ { "docid": "f324885fd7b77f2901ede5bef068e472", "score": "0.6458543", "text": "def index\r\n @diagrams = Diagram.all\r\n end", "title": "" }, { "docid": "8667a71b2260da3cebd938c856c0d15b", "score": "0.63546574", "text": "def show\n @nodes_of_diagram = Node.where(diagram: @node....
324d97335ab58bb817d744a852e2b19f
check if position exists and is available
[ { "docid": "b4a781fb5df7ea916da11c91565774e8", "score": "0.0", "text": "def position_taken?(board, index)\n\tif board[index] == \"\" || board[index] == \" \" || board[index] == nil\n\t\treturn false\n\telse\n\t\treturn true\n\tend\nend", "title": "" } ]
[ { "docid": "7fc9ed71c14ff990feb7bd98ef401d0e", "score": "0.7565018", "text": "def position_available\n\n end", "title": "" }, { "docid": "bf2f8f48239defd12929f8dbbcfbb6a4", "score": "0.75014526", "text": "def position?\n false\n end", "title": "" }, { "docid": "9...
cd2554e357b850ae138f08f9d7556c32
Wrapper for setting IRB.conf[:PROMPT][:MY_PROMPT][:PROMPT_C]. The prompt for when statements wrap multiple lines.
[ { "docid": "2cc2123b167d2c55a67ab1dea6e89c43", "score": "0.65448076", "text": "def continued_statement=(new_continued_statement)\n @irb_prompt_options[:PROMPT_C] = new_continued_statement\n end", "title": "" } ]
[ { "docid": "fc21d199bc0935707765d5ef5be580d2", "score": "0.71317333", "text": "def chut\n IRB.conf[:PROMPT][ IRB.conf[:PROMPT_MODE] ][:RETURN].replace('')\nend", "title": "" }, { "docid": "5986308cafc8377f611f09906ab93b16", "score": "0.6560793", "text": "def prompt(context)\n ...
497eaff717b5093987470eea923d3971
reset the captcha code in session for security after each request
[ { "docid": "e7f2774894a8ee92849f74137afb67ce", "score": "0.9004627", "text": "def reset_last_captcha_code!\n session.delete(:captcha)\n end", "title": "" } ]
[ { "docid": "eb58bde645b2f56ba4569b53f92eac73", "score": "0.8120447", "text": "def set_captcha\n session[:captcha] = rand(10) + 20\n @captcha = rand(session[:captcha])\n end", "title": "" }, { "docid": "4f47df66a10456691745753bf734ca37", "score": "0.77828157", "text": "def curr...
2cb85b461a346fc696705f698129a686
River of News: What's happening with your tracked things
[ { "docid": "4ec47ca7836a1ea02fb0efb983f48241", "score": "0.5703935", "text": "def river\n @results = @user.nil? ? [] : @user.track_things.collect { |thing|\n perform_search([InfoRequestEvent], thing.track_query, thing.params[:feed_sortby], nil).results\n }.flatten.sort { |a,b| b[:...
[ { "docid": "d50c18e648c421b2989b35d24c3c8687", "score": "0.667548", "text": "def track\n end", "title": "" }, { "docid": "d50c18e648c421b2989b35d24c3c8687", "score": "0.667548", "text": "def track\n end", "title": "" }, { "docid": "d50c18e648c421b2989b35d24c3c8687", ...
0ab091231e9cf5554d20813b074f2639
Use callbacks to share common setup or constraints between actions. def set_post
[ { "docid": "264e71e25af1f9f390ea1438a8e62eaa", "score": "0.0", "text": "def post_params\n params.require(:post).permit(:job_title, :company, :location, :your_name, :phone, :description, :salary, :type)\n end", "title": "" } ]
[ { "docid": "fb9bf6a456fd780dc36ed15ce07ed456", "score": "0.6463295", "text": "def post(&block)\n @_post = block\n end", "title": "" }, { "docid": "61912f487fc887fa61a1c609906ee5bd", "score": "0.6403923", "text": "def post\n end", "title": "" }, { "docid": "...