query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
5afc13214d5166d6397a72fad68daab8
POST /users POST /users.xml
[ { "docid": "342240a8658751f8d2c5fd664ce04eb1", "score": "0.0", "text": "def create\n @content = Content.new(params[:content])\n\n respond_to do |format|\n if @content.save\n notify :notice, 'Content was successfully created.'\n\n format.html { redirect_to(@content) }\n fo...
[ { "docid": "a57ccf1a5b27f3e307e4b283d3837c14", "score": "0.6911369", "text": "def add_user(name, email)\n post \"/api/users.xml\", {:user => {:name => name, :email => email}}\n end", "title": "" }, { "docid": "e0f435c0f7360a427ff909c6e595f1ce", "score": "0.67126167", "text": ...
a8e5a29a2ef55fc0cb5ca2b904664995
Calculates the average user rating
[ { "docid": "e355104dc1c74673ca95d5d9b5245490", "score": "0.7753244", "text": "def calculate_average_rating\n sum = 0\n ratings = comments.map(&:rating)\n ratings.each do |rated|\n sum += rated\n end\n sum / (ratings.size == 0 ? 1 : ratings.size)\n end", "title": "" } ]
[ { "docid": "738fe9b1751186b530de583f98760953", "score": "0.85910624", "text": "def average_rating\n Review.where(:user_id => self.user_id).average(:rating).to_d\n end", "title": "" }, { "docid": "d0e0e15140e2abf771ff475172a18833", "score": "0.84919864", "text": "def average_r...
49a510d650577c2ab8ec98c46f3e862d
Show the failure page
[ { "docid": "a113ae59a2045e714ba9b2def76f2267", "score": "0.76135653", "text": "def failure\n # TODO, create failure.html.erb\n end", "title": "" } ]
[ { "docid": "b5d04c6c471c5be9b9f3d7167c153160", "score": "0.7768661", "text": "def failure\n render :text => \"You just messed up somewhere. no clue where but you just did\"\n end", "title": "" }, { "docid": "dde48feb363a44d04c13608d03018457", "score": "0.74667513", "text": "def f...
4ebcbfee070ab6a4676493972bda7a34
method for creating a user and checking for the exitance of the persons credentials
[ { "docid": "bf76219c39262461e0dae403923e1ac1", "score": "0.70784354", "text": "def create_user\n if params[:password].blank?\n flash[:notice] = \"Please enter a password.\"\n redirect_to '/retry_registration'\n elsif session[:email] == params[:email]\n flash[:notice] = \"Email is al...
[ { "docid": "f09b18f59fb4fc7c830846175351d062", "score": "0.7831823", "text": "def create_new_user\n begin\n # Creates hash of the password enetered by the user\n password = Utility.encrypt_password(@password)\n # Insert a new entry in the database for a user\n @client....
5a7e4681380bb38df57e25932bc2304d
report change of bottom part only
[ { "docid": "0ba3be46b96c7d7689d0398d6fa18adf", "score": "0.0", "text": "def inventory_cages_ams_cage_id_bedding_change_partial_post(ams_cage_id, user, opts = {})\n inventory_cages_ams_cage_id_bedding_change_partial_post_with_http_info(ams_cage_id, user, opts)\n nil\n end", "title": "" ...
[ { "docid": "563c62b62fd579737ee9c1a7b4dc1e83", "score": "0.64457756", "text": "def changes; end", "title": "" }, { "docid": "5f3539b467d5e3b7c2367343e6cc2735", "score": "0.63850653", "text": "def bottom; end", "title": "" }, { "docid": "bd78c784bb7799c9e7d3803b03b26621", ...
eec253c24c7eec8a0500e5ce5d772227
Posts the given data to the given url, returning the raw response
[ { "docid": "ddbc27f9f573309b362283212f800d17", "score": "0.65406054", "text": "def send_request(url, data)\n uri = URI.parse(url)\n http = Net::HTTP.new(uri.host, uri.port)\n if uri.port == 443\n http.use_ssl\t= true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\...
[ { "docid": "6cb5280c37f10f7a6a2d9b46350d2fd2", "score": "0.7553324", "text": "def post(url, data, headers = {})\n request(:post, url, headers, :data => data)\n end", "title": "" }, { "docid": "3ba47138e15194b3a88c5997ff500392", "score": "0.7413686", "text": "def http_post(url...
d3d6b4b6caa8964eb2ee501cacb0d8c0
The title of the plan with range
[ { "docid": "605dc595682f63430a37f105ac4abe12", "score": "0.8214174", "text": "def caption\n \"#{plan.name} - #{formatted_range}\"\n end", "title": "" } ]
[ { "docid": "ff9d6581ab6024674c567ca3ee8aa829", "score": "0.70092875", "text": "def fullTitle\n title + ' : Pool Scoring'\n end", "title": "" }, { "docid": "c94e901531f8ef09215693f261f96c93", "score": "0.6921831", "text": "def title\n return \"#{department...
83c3a70c833de5c1b03a8751667b6483
Get a Product by Id Returns nil if product is not found
[ { "docid": "d2dedd5058fc1775e2c3b94cdeef35e3", "score": "0.84332365", "text": "def getProduct(id)\n @products.find {|prod| prod.productId.to_i == id.to_i}\n end", "title": "" } ]
[ { "docid": "97d6bc6ae168b6359fbf2f6e4ac9c35a", "score": "0.84567446", "text": "def get_product_by_id(product_id)\n return Product.find(product_id)\n end", "title": "" }, { "docid": "9c8f02d5c2761d2cd8d72a6350f659db", "score": "0.81789047", "text": "def find_by_id(id)\n get...
1470ab7aaaf4005dfd9bd2cce1ba2144
Find all the tests a student passed
[ { "docid": "4401d167bb7307005b52901a61ada6be", "score": "0.6847875", "text": "def passed \n tests.select{|test| test.test_status == \"passed\"}\n end", "title": "" } ]
[ { "docid": "e629191fa3ad6d1acc06f6a36814fbba", "score": "0.80789703", "text": "def passed_students\n all_passed_tests = self.boating_tests().select {|bt| bt.status == \"passed\"}\n all_passed_tests.map {|test| test.student }\n end", "title": "" }, { "docid": "108e64e2a528a35...
0052317e17ec206867a0a738cdccf2fa
Converts the SPKI into the PEM format
[ { "docid": "28f9d788f2b078b50a345d33b51f9a5a", "score": "0.73435074", "text": "def to_pem\n @spki.to_pem\n end", "title": "" } ]
[ { "docid": "def298241430a06a9aba0e416542902c", "score": "0.6725568", "text": "def as_pem\n @as_pem ||= @node.at_xpath('asPEM').inner_text\n end", "title": "" }, { "docid": "1bb7f61966c57be130fb58d80001cc3b", "score": "0.6606138", "text": "def to_pem\n if @c...
865398392d9f2879ebb176f9c5850081
Read the service's group file and return an array of all groups this service is in, or an empty array if the service isn't in any groups.
[ { "docid": "1671ced6e47aef68ae406c5e6ea05db8", "score": "0.8232921", "text": "def groups\n\t\t\t@groups ||= begin\n\t\t\t\tFile.readlines(File.join(@svcdir, 'group')).map { |g| g.strip }\n\t\t\trescue Exception => e\n\t\t\t\t[]\n\t\t\tend\n\t\tend", "title": "" } ]
[ { "docid": "2885670508dfedda9554d91310ed2b5a", "score": "0.7064426", "text": "def getGroups()\n\n groups = YAML.load_file(@GROUPSFILE)\n groupsS = []\n for i in 0..groups.size\n groupsS <= groups[i]\n end\n return groupsS\n\n end", "title": "" }, ...
b8c2e7b72fdf753e02c41d3c874b5737
Returns true if the request's header contains "XMLHttpRequest".
[ { "docid": "8071a022b123b316c5a96548df4bbdb7", "score": "0.8369655", "text": "def xml_http_request?\n return false if !@request || !@request['headers'] || !@request['headers']['X-Requested-With']\n test2 = /XMLHttpRequest/i.match(@request['headers']['X-Requested-With'])\n not test2.nil?\n...
[ { "docid": "c73427fb5ec487b2ce2b07a8efb189ee", "score": "0.8560345", "text": "def xml_http_request?\n not /XMLHttpRequest/i.match(@headers['HTTP_X_REQUESTED_WITH']).nil?\n end", "title": "" }, { "docid": "2bb517c4ae4db41986e4064c3ae5d405", "score": "0.8368818", "text": "def xhr?\...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "577aa5ac03034facd982a84d138a02d7", "score": "0.0", "text": "def fee_params\n params.require(:fee).permit(:user_id, :name, :price, :serial, :end_at, :deleted_at)\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...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "e817c4b245e6ea8c2642b8e83f6b8966", "score": "0.0", "text": "def update!(**args)\n @image_url = args[:image_url] if args.key?(:image_url)\n @job_title = args[:job_title] if args.key?(:job_title)\n @name = args[:name] if args.key?(:name)\n @same_as = args[:s...
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "t...
decc9533f92d341948ac349aa55e9f24
set enabled true (for Randomtweet file dsl)
[ { "docid": "194c63c259c4330621c52fd20cbeafdb", "score": "0.6140718", "text": "def enable\n @enable = true\n end", "title": "" } ]
[ { "docid": "3e0363728927154305ecb7e2a2b1c190", "score": "0.63851726", "text": "def enabled=(boolean); @enabled = boolean; end", "title": "" }, { "docid": "dc740c80af3d41448d8a2115c4a35345", "score": "0.6379018", "text": "def enable() @enabled = true end", "title": "" }, { ...
93254f506a106a57e156ec384de52c17
Marks this record as read only.
[ { "docid": "11d11b7c00f2c9c12eb4649d25a1f3d2", "score": "0.763878", "text": "def readonly!\n @readonly = true\n end", "title": "" } ]
[ { "docid": "c2fcc1e74724604f03d873a29efe6f8a", "score": "0.79587626", "text": "def read_only=(value)\n @read_only = value\n end", "title": "" }, { "docid": "c2fcc1e74724604f03d873a29efe6f8a", "score": "0.79587626", "text": "def read_only=(value)\n @read_only = value\n ...
ce611844fd9f75d04952cb395c9a2c0a
Helper for creating a tooltip
[ { "docid": "2c55743905ac83f63155f06cd812879e", "score": "0.7145642", "text": "def tooltip(body, title = nil, length = 10)\n id = UUIDTools::UUID.random_create\n if body.length > length\n <<-TT\n <div id='#{id}' class='tooltip' title='#{title || \"Click to see full text.\"}'>#{body}</div>...
[ { "docid": "c99fce1e0be7ca4e77e52f62835485fa", "score": "0.8100179", "text": "def tooltip= txt\n \n end", "title": "" }, { "docid": "c99fce1e0be7ca4e77e52f62835485fa", "score": "0.8100179", "text": "def tooltip= txt\n \n end", "title": "" }, { "doc...
cc2636a64a822123c1b2d811afc36c04
Reset all configuration options to defaults
[ { "docid": "95329ad8c14fafe2b12fec1921c0f76c", "score": "0.0", "text": "def reset\n self.host = DEFAULT_HOST\n self.key = DEFAULT_KEY\n self.user_agent = DEFAULT_USER_AGENT\n self\n end", "title": "" } ]
[ { "docid": "dfeae341532e332e7d1a2a9e0c6b8af8", "score": "0.86164093", "text": "def reset!\n @options = defaults\n end", "title": "" }, { "docid": "dfeae341532e332e7d1a2a9e0c6b8af8", "score": "0.86164093", "text": "def reset!\n @options = defaults\n end", "title": ...
2b130407d855fdd56079b16aa99c1932
Sets the deviceStatuses property value. List of ManagedDeviceMobileAppConfigurationDeviceStatus.
[ { "docid": "f50ed3b34ca207ff1cdf7009f5a3d475", "score": "0.75215787", "text": "def device_statuses=(value)\n @device_statuses = value\n end", "title": "" } ]
[ { "docid": "f6c892598a8996671a597e6acc99219f", "score": "0.620258", "text": "def device_statuses()\n return MicrosoftGraph::DeviceAppManagement::MobileAppConfigurations::Item::DeviceStatuses::DeviceStatusesRequestBuilder.new(@path_parameters, @request_adapter)\n ...
135e1bbfaec236cec5b4baa0155bee9d
DELETE /rounds/1 DELETE /rounds/1.json
[ { "docid": "52712fbf160d89defd2eb6c41071283b", "score": "0.68591595", "text": "def destroy\n @round.destroy\n respond_to do |format|\n format.html { redirect_to DelphiEstimation.find_by_id(@round.delphiEstimation_id), notice: 'Round wurde erfolgreich gelöscht' }\n format.json { head :no_...
[ { "docid": "b9f11e91c11b0b9415047aa4e5f72b69", "score": "0.76205236", "text": "def destroy\n @round = Round.find(params[:id])\n @round.destroy\n\n respond_to do |format|\n format.html { redirect_to rounds_url }\n format.json { head :no_content }\n end\n end", "title": "" }, ...
78b7601ebc77c8230840097feea6983a
Return first nonzero hop
[ { "docid": "3ec55fb79dd17ae13dc12f35c5e4586d", "score": "0.73656124", "text": "def first_hop()\n @hops.find { |hop| !hop.ip.nil? && hop.ip != \"0.0.0.0\" }\n end", "title": "" } ]
[ { "docid": "fa63573b6567040cb7344096beea4d8e", "score": "0.67648953", "text": "def find_first_nonzero_among(numbers)\n numbers.each do |n|\n return n if n.nonzero?\n end\nend", "title": "" }, { "docid": "fa63573b6567040cb7344096beea4d8e", "score": "0.67648953", "text": "def find...
e2a7d336a55f11a791ce88edd2160178
check method to see whether email has been validated/account been activated
[ { "docid": "8e21c9865cc313193ebd4bec1b22ea5d", "score": "0.6790104", "text": "def email_validated?\n self.email_validation_key.blank?\n end", "title": "" } ]
[ { "docid": "31f01b6e69cfa81b6c5bfa1a951ed9c9", "score": "0.76959413", "text": "def email_available?\n\t\tself.valid?\n\tend", "title": "" }, { "docid": "8bfe2c09dfd1f8abf4dc2b6e2dd7c2c6", "score": "0.7502678", "text": "def can_activate?\n self.person && self.email_match?\n end", ...
962aa6b8c6483ac7db3bd72baa832933
Marks a node to be reindexed before the transaction ends :api: private
[ { "docid": "d9592a772c49f2a02139ca6812f1eeb2", "score": "0.7190363", "text": "def reindex(node)\n @nodes_to_be_reindexed[node.neo_node_id] = node\n end", "title": "" } ]
[ { "docid": "8c138e5a1504f91cf87d5fb96cf41350", "score": "0.66358846", "text": "def reindex_later\n waiting!\n Spotlight::ReindexJob.perform_later(self)\n end", "title": "" }, { "docid": "7b512970f997d571e957b5d9f252b85b", "score": "0.6492428", "text": "def reindex_later\...
35ce1be23f56a0cbb529f8358a9769f3
PATCH/PUT /avaliacao_baladas/1 PATCH/PUT /avaliacao_baladas/1.json
[ { "docid": "66a5ab24e344ac83e49c208e9ea5421a", "score": "0.6945397", "text": "def update\n respond_to do |format|\n if @avaliacao_balada.update(avaliacao_balada_params)\n format.html { redirect_to @avaliacao_balada, notice: 'Avaliacao balada was successfully updated.' }\n format.js...
[ { "docid": "4e67bbebe06004980d1d76cdb1cfdee5", "score": "0.68031234", "text": "def activo_update\n respond_to do |format|\n activo = params[:plan_paciente][:activo]\n id = params[:id]\n PlanPaciente.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :me...
89c46e97426b18823ec66e8364d640b2
Vimeo 150x200 thumbnail image
[ { "docid": "8d834819b5ed04c465d01384695875b5", "score": "0.74114", "text": "def vimeo_thumb\n # Make API call, parse the JSON and extract the url\n JSON.parse(open(\"http://vimeo.com/api/v2/video/#{extract_vimeo_id}.json\").read).first['thumbnail_medium']\n end", "title": "" } ]
[ { "docid": "71885be50b369d8ebbfc0c490ffa8ebc", "score": "0.734583", "text": "def thumbnail\n # size=1 gives bigger thumbnail.\n # I'm not sure how to add size parameter in compatible way\n size = 2\n \"http://img.rutube.ru/thumbs/#{movie_hash[0,2]}/#{movie_hash[2,2]}/#{movie_hash}-#{size}.jp...
fc0b1e5699d18bd695c241faed083958
create actions HTTP GET, create new object to add values to GET/new_subject_path
[ { "docid": "5c41ca495a66e82b693563e8eb52c8ff", "score": "0.0", "text": "def new\n @subject = Subject.new\n @subject_count = Subject.count + 1\n end", "title": "" } ]
[ { "docid": "23742eba79a4d4fa0ee775ceca30b8b1", "score": "0.67349535", "text": "def new\n @subject = Subject.new\n get_all_teachers\n get_all_classes\n respond_with @subject\n end", "title": "" }, { "docid": "0cb874b6abff5ceebd0016364148aa34", "score": "0.6650406", "text"...
b6c0fa37e5518973a2d9ff5d347efc19
optional helper methods go here:
[ { "docid": "ae5ba5cb806b14653d2e8dcd61d400a9", "score": "0.0", "text": "def remove(node)\n if node.parent.nil?\n @root = nil\n return\n end\n if node.parent.left == node\n node.parent.left = nil\n elsif node.parent.right == node\n node.parent.right = nil\n end\n end",...
[ { "docid": "1da1a27ac7f96bb6ad678b54d11badc4", "score": "0.69155395", "text": "def optional; end", "title": "" }, { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.63777965", "text": "def private; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7"...
655fd088e73665ef0d1bbd5741eb57b4
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.new_language.notify.subject
[ { "docid": "0ec9217311d06d2b1d1cd1e4933cae0d", "score": "0.67459154", "text": "def notify(language)\n @language = language\n mail to: \"makcyxa-k@yandex.ru\", subject: 'New language request'\n end", "title": "" } ]
[ { "docid": "8928fe4f050d7ebd3e9aa992b07e320a", "score": "0.75448674", "text": "def subject_for\n ActiveSupport::Deprecation.warn \"subject_for\"\n I18n.t(:\"subject\", scope: [:notifications, :mailer],\n default: [:subject])\n end", "title": "" }, { "docid": ...
be516aaecd59252477701a9045b70a4c
Takes a string or a date and returns a string with three letter month and year with century.
[ { "docid": "aa2382f9b527070b02d7604ba5d53bca", "score": "0.0", "text": "def format_month(time)\n case time\n when String then time.to_time.strftime('%b %Y')\n when Time then time.strftime('%b %Y')\n when nil, '' then '-- ----'\n end\n end", "title": "" ...
[ { "docid": "978534cdcb3a835c23195ffc5caeebef", "score": "0.7207395", "text": "def century(year)\n century = (year + 99).to_s[0..-3]\n if century[-1] == '1' && century[-2..-1] != '11'\n output = century + 'st'\n elsif century == '3'\n output = century + 'rd'\n elsif century == '2' || century[-2...
07276a58df3b755fc8829e200b769df6
True si el cambio de status es no correcto, false de otra manera.
[ { "docid": "1c432727f20aa7de54d0c5ac8466cdda", "score": "0.71679366", "text": "def invalid_status\n\t\tinvalid = false\n\t\tif self.status_changed?\n\t\t\tinvalid = self.status_was != \"active\"\n\t\tend\n\tend", "title": "" } ]
[ { "docid": "449561dea5b22f36128c10bb44973b3b", "score": "0.71933305", "text": "def success?\n status.nil?\n end", "title": "" }, { "docid": "c393b9d0a5f89a35a0a3a3a6de179ed0", "score": "0.70773387", "text": "def valid?\n status == 'Valid'\n end", "title": "" ...
d047649b5ebe625fe8419a5b8f664f8e
GET /admin/product_details GET /admin/product_details.json
[ { "docid": "8b44f2a0e1a35202c39a1e959a38ce32", "score": "0.7520591", "text": "def index\n @admin_product_details = ProductDetail.all\n end", "title": "" } ]
[ { "docid": "8b628a6cb54c59730bee1295bfc8a336", "score": "0.7476636", "text": "def show\n render json: @product_management\n end", "title": "" }, { "docid": "6b084d609415528e8aef03af8df1eeea", "score": "0.7451304", "text": "def view_product\n to_json(\n only: [:id, :title,...
6b8d0a9ce6995743a5f61b948cd78594
wait for ajax requests to finish
[ { "docid": "41f2f716539539467ed5c55473e46c36", "score": "0.7535128", "text": "def wait_for_ajax\n\tTimeout.timeout(Capybara.default_wait_time) do\n loop until finished_all_ajax_requests?\n end\nend", "title": "" } ]
[ { "docid": "109385c8b08e317ae131a2044fa92915", "score": "0.81157553", "text": "def wait_for_ajax\n Timeout.timeout(Capybara.default_wait_time) do\n loop until finished_all_ajax_requests?\n end\n end", "title": "" }, { "docid": "3b36c8c4648bbf54b9f41886a17a...
6742dd95d3fd4f481f4ef1e2b774b642
In the controller ..
[ { "docid": "886b95747a6ac646c33c1ddbe18554bf", "score": "0.0", "text": "def mass_action\n @collection = ResultSet::Collection(Article, params[:ids])\n @new_status = Status.get(params[:status_id])\n visitor = ResultSet::ChangeStatusVisitor(@new_status)\n @results = @collection.accept(visitor)\nend", ...
[ { "docid": "40f7f9a8053cda5781e8cf27340a2d71", "score": "0.693869", "text": "def controller; end", "title": "" }, { "docid": "40f7f9a8053cda5781e8cf27340a2d71", "score": "0.693869", "text": "def controller; end", "title": "" }, { "docid": "40f7f9a8053cda5781e8cf27340a2d71...
b27b225e9377fcd0b123078e79bf4c88
Removes a reserved public IP from a NIC. This operation is required, when dealing with reserved public IPs to ensure proper routing by the ProfitBricks cloud networking layer.
[ { "docid": "9b426c5e89ebb287c0541488576b621f", "score": "0.7311369", "text": "def remove_ip(ip)\n response = Profitbricks.request :remove_public_ip_from_nic, \"<nicId>#{self.id}</nicId><ip>#{ip}</ip>\"\n @ips.delete ip\n return true if response.to_hash[:remove_public_ip_from_nic_response]...
[ { "docid": "801efdbb4b0e4163fec5ece3ed6fcb87", "score": "0.7409509", "text": "def remove_ip(ip)\n response = Profitbricks.request :remove_public_ip_from_nic, nic_id: self.id, ip: ip\n @ips.delete ip\n return true\n end", "title": "" }, { "docid": "199570cbbaa3953b5d2a866e44...
0e4e62dabb4d11b3c509105c134a572e
Creates an exam for a user in a course with `POST /users/:user_id/courses/:course_id/exams/:exam_id` using OAuth2 as a student.
[ { "docid": "ec330edb618341d90afcf0d200bf8d02", "score": "0.8582826", "text": "def create_user_exam(user_id, course_id, exam_id)\r\n response = get_existing_exam(user_id, course_id,exam_id)\r\n if response.status_code == LearningStudioCore::BasicService::HTTPStatusCode::NOT_FOUND\r\n rel...
[ { "docid": "792c8b99384ffdd5b8e0e9ee3e1197ee", "score": "0.7977723", "text": "def create_exam_attempt(user_id, course_id, exam_id, exam_password = nil)\r\n exam_headers = {}\r\n exam_headers = {\r\n PEARSON_EXAM_PASSWORD => exam_password\r\n } unless exam_password.nil?\r\n pos...
09e70534f7d705f10cfe59db13d2f7f0
given a command delimited list of states do a census lookup to get the census ID, and then query for each states sensus data
[ { "docid": "74e6439c1b0e312d57e8fedb77ebe679", "score": "0.5248275", "text": "def retrieve_demographic_data(list_of_states)\n data = list_of_states.split(',')\n .map {|state| API.state_census(state) }\n .map {|census_data| census_data['fips'] }\n .map {|census_id| API.demograph...
[ { "docid": "bd0246e2a45f41dffe71314a399bf1d2", "score": "0.6335836", "text": "def bystate(str)\n p str.\n split(\"\\n\"). # Splitting up the string and converting this to an array at each new line \n group_by { |entry| entry[-2..-1] }. # turning the array to a hash where the key is the last two i...
3e27824d4fb01d9c2fbd9d082a7541cf
currency is still derived from the parent project or DR
[ { "docid": "678d6a28d5f40cb0c372c76b309dd9ce", "score": "0.0", "text": "def update_cached_usd_amounts\n rate = self.currency ? Money.default_bank.get_rate(self.currency, \"USD\") : 0\n self.budget_in_usd = (self.budget || 0) * rate\n self.spend_in_usd = (self.spend || 0) * rate\n end",...
[ { "docid": "c5b95bfaefdaca507e564754da70112a", "score": "0.7623163", "text": "def currency; end", "title": "" }, { "docid": "c5b95bfaefdaca507e564754da70112a", "score": "0.7623163", "text": "def currency; end", "title": "" }, { "docid": "eba1412cc6f0571ea382b913363bc307",...
3c65a58d54afa367b695cf139b24dfa0
Format message as message from the user and send it
[ { "docid": "bf3772b490be6127f44e9d1582a24cd3", "score": "0.0", "text": "def say(msg)\n\t\tsend \"PRIVMSG #{@channel} :#{msg}\"\n\t\t\n\tend", "title": "" } ]
[ { "docid": "0eec39061262857a3fed96a974082846", "score": "0.7258442", "text": "def processRegularUserMessage(message)\r\n return formatMessageText(message[:message])\r\n end", "title": "" }, { "docid": "78fe0c7d77ddfb60721d6e13cf8cdae6", "score": "0.700831", "text": "def user_...
ea92421110c244fe5f1e7d6dc29a43c9
Fetch the secret RSS key for viewing private feeds
[ { "docid": "6790ee9b03b77cbff6c588012913bad2", "score": "0.57229185", "text": "def secret\n client.get(\"/user/secret\").fetch(\"result\")\n end", "title": "" } ]
[ { "docid": "ddd9aa17fca34a45663a1a8e4dfd8a62", "score": "0.72060853", "text": "def rss_key\n token = self.rss_token || Token.create(:user => self, :action => 'feeds')\n token.value\n end", "title": "" }, { "docid": "1a72bb2f1680a5c81b92282f5eb33610", "score": "0.63696635", "te...
f249b62d8e896384633662b92a55d0c4
Highlight and embed a prompt control character in the given +string+ and return it.
[ { "docid": "c051c6f2a5e0994976258394d436ccd3", "score": "0.725861", "text": "def make_prompt_string( string )\n\t\t\treturn CLEAR_CURRENT_LINE + colorize( 'bold', 'yellow' ) { string + ' ' }\n\t\tend", "title": "" } ]
[ { "docid": "8dacf6fe97da322c3a23241211bd8e06", "score": "0.7245096", "text": "def make_prompt_string( string )\n\t\treturn CLEAR_CURRENT_LINE + colorize( 'bold', 'yellow' ) { string + ' ' }\n\tend", "title": "" }, { "docid": "5071f1c0033486562408e17dad876054", "score": "0.72419506", ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "3abe1b2bee4b5a470c21bed8bbdaea02", "score": "0.0", "text": "def set_invoice\n @invoice = Invoice.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.61642385", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60448", "text": "def action_hook; ...
78cc452be82353eb87cee80c7f469892
Returns the resource id of the created object
[ { "docid": "5bba5e55844a30db40d0b3f72fb2cc0f", "score": "0.6303332", "text": "def resourceid\n @resid\n end", "title": "" } ]
[ { "docid": "96512ef1bcc592146c5cf4d3380075f5", "score": "0.7769036", "text": "def createId() \n return @obj.createId()\n end", "title": "" }, { "docid": "8c7781c9f18423b38c805ad0b549a251", "score": "0.76360244", "text": "def id\n instance(resource[:name])[:id]\n ...
2566b68147e36a8ff943d22ced9421b2
GET /editor_area_content_elements/1 GET /editor_area_content_elements/1.xml
[ { "docid": "e250ac9adec846752fb6bc3a35505ce7", "score": "0.0", "text": "def show\n unless params[:full_page]\n partial_type = (@content_element.class.name == 'ContentImageTmp') ? 'image' : @content_element.class.name.underscore.split('_').last\n render :partial => 'show_' + partial_type, :o...
[ { "docid": "299f44e4adc5ea4aed69e2ccd660a75c", "score": "0.6223891", "text": "def content_editor\n frm.frame(:id, \"AddSectionForm:fckEditorView:otherMeletecontentEditor_inputRichText___Frame\").td(:id, \"xEditingArea\").frame(:index=>0)\n end", "title": "" }, { "docid": "299f44e4adc5ea4...
0e0df32124b9f4734b93ebd009f47cc0
DELETE /posts/1 DELETE /posts/1.json
[ { "docid": "772bc5207bc4fb1f1efa33fce4ea184a", "score": "0.0", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url, notice: 'Post was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "d2967b0b04aeff2fcebfecba1d4cd0a1", "score": "0.7746075", "text": "def destroy\r\n @post.destroy\r\n\r\n render json: {}, status: :ok\r\n end", "title": "" }, { "docid": "0bb7e18bf412742726aadde12b6d1174", "score": "0.7729327", "text": "def destroy\n @post.destro...
80aaae8c80f7915caf0de905b780587b
Returns the checkbox label for the Text Messages opt in for the Activation and Communications pages.
[ { "docid": "b5aafb1cafb83c0f84f6e7c38cdd82e9", "score": "0.52641416", "text": "def pur_text_messages_label\n # unit_test_no_generate: pur_text_messages_label, span.className(create_ats_regex_string(\"ats-purtxtmsglbl\"))\n $tracer.trace(__method__)\n return ToolTag.new(span.className(create_ats...
[ { "docid": "2bf6d850a16f83191988d9c2722a2d75", "score": "0.6583995", "text": "def pur_opt_in_text_messages_checkbox()\n # unit_test_no_generate: pur_opt_in_text_messages_checkbox, input.className(create_ats_regex_string(\"ats-purtxtmsgbox\"))\n $tracer.trace(__method__)\n return ToolTag.new(inp...
cc8dcc8772bff37cc23b55182341f4bc
Performs the mapping, returning a hash of data filepaths to config filenames
[ { "docid": "60450328d966c5e60da7d11c4bacce2e", "score": "0.7958385", "text": "def build_paths\n mapping = {}\n mapping_config.each do |config|\n config['paths'].each do |path|\n next unless data_dir.start_with?(path) || path.start_with?(data_dir) || data_dir.empty?\n\n ...
[ { "docid": "20980c085b23cb1f78f2d3bcfd8672ae", "score": "0.6859196", "text": "def map_files\n file_map = {}\n entry_file = Pathname.new(map_entry)\n entry_found = false\n case @files\n when Hash\n @files.each do |path, file|\n file_map[path.to_s] = File.expand_pa...
7b63c490284a229b7e86a9f84d4cb0b9
Default paths to search for the packaged version of Vagrant. /opt/vagrant/bin /usr/local/bin /usr/bin /bin
[ { "docid": "3416b72a5ef43fff18f33a08286302ff", "score": "0.86904484", "text": "def default_paths\n if windows?\n %w{\n C:\\HashiCorp\\Vagrant\\bin\n /c/HashiCorp/Vagrant/bin\n }\n else\n %w{\n /opt/vagrant/bin\n /usr/local/bin\n /usr/bin\n /...
[ { "docid": "5a0c49c6cdefcea363187d96510c4c6f", "score": "0.75123054", "text": "def default_path\n \"bin:#{slug_vendor_base}/bin:/usr/local/bin:/usr/bin:/bin\"\n end", "title": "" }, { "docid": "f74d239f4b11d89d3d05b31dc8297acc", "score": "0.7237953", "text": "def find_vagrant\n ...
742eb7f6ccbec50a9d9c7488c15e1406
Same as rack_oauth but it clears the access token out of the session.
[ { "docid": "96d3232db1635a6c893131e9547bd30d", "score": "0.65448767", "text": "def rack_oauth!(name)\n oauth_instance(name).get_access_token!(oauth_request_env)\n end", "title": "" } ]
[ { "docid": "36762d4386887cd5f3ca065e8f8e65a2", "score": "0.74043787", "text": "def reset\n session.delete(:access_token)\n session.delete(:refresh_token)\n redirect('/auth/foursquare')\n end", "title": "" }, { "docid": "d27ea2573c9dbfa891370dfa353292ba", "score": "0.73985386", ...
c74ddfd5df1ece0a0c809540a975607d
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.user_mailer.welcome.subject
[ { "docid": "c359dec8d9cf548849834f8672246005", "score": "0.0", "text": "def welcome(user)\n return false if user.blank? or user.email.blank?\n @user = user\n mail(to: @user.email,\n subject: 'Welcome to KnewOne')\n end", "title": "" } ]
[ { "docid": "f2fecd58a29b9acf94ad3b95a78dc2e7", "score": "0.79734087", "text": "def welcome_email_subject\n @attributes[:welcome_email_subject]\n end", "title": "" }, { "docid": "ea740e704e8f1173fb87b45dfcaaf989", "score": "0.7641406", "text": "def subject_for(key)\n I18n.t...
eb7a33244d250ef41b2371bc52251de0
List gets a list of AccountResource records matching a given set of criteria.
[ { "docid": "37547c676524d82e5c9a0bdab28e3e8f", "score": "0.7657914", "text": "def list(\n filter,\n *args,\n deadline: nil\n )\n return @account_resources.list(\n filter,\n *args,\n deadline: deadline,\n ...
[ { "docid": "3804c72dc327602d5ba4293c9ea310c1", "score": "0.7292237", "text": "def list(\n filter,\n *args,\n deadline: nil\n )\n req = V1::AccountResourceListRequest.new()\n req.meta = V1::ListRequestMetadata.new()\n page_size_option = @parent._test_options[\"PageSize\"]...
d0848cee9ea416dfbd5b07103b6fd1ec
get every test to pass before coding runner below
[ { "docid": "2355df78a94c213146c03a813f57051d", "score": "0.0", "text": "def runner\n welcome\n total = initial_round\n until total > 21\n total = hit?(total)\n display_card_total(total)\n end\n end_game(total)\nend", "title": "" } ]
[ { "docid": "4214d9c38556c2b02453744c9abd3771", "score": "0.7492311", "text": "def pass(suite, test, test_runner); end", "title": "" }, { "docid": "e820a876acc56d01d07c4fe31f07d454", "score": "0.74173", "text": "def run_tests\n count = 0\n puts \"Starting test run...\"\n self...
804b788e6fb4d85ac897b9c48081f2a0
get value from Stripe, do not push your key
[ { "docid": "57befb05eda52dcec9162052e40a06cb", "score": "0.0", "text": "def create_customer\n Stripe::Customer.create(\n :id =>\n :default_source => # from Stripe.js\n :description =>\n :email =>\n :source => # token from Stripe.js\n )\n end", "title": "" } ]
[ { "docid": "33132be0a762a15fab668edcb3a938d7", "score": "0.64746785", "text": "def retrieve_easypost_stripe_api_key\n response = @client.make_request(:get, 'partners/stripe_public_key', EasyPost::Models::EasyPostObject, nil, 'beta')\n response['public_key']\n end", "title": "" }, { "d...
516208b95d33a35856d9309d5ae146c6
Execute OauthAuthCode subcommand taking input from a input stream and writing to output stream sample: output.puts 'OK'
[ { "docid": "a2a9468dc8c340312e98a3e3c5942ea7", "score": "0.6821461", "text": "def execute(input: $stdin, output: $stdout)\n auth = PocYoutube::GoogleCredentials.for_youtube\n\n prompt.say(\"Using your credentials to access a #{Pastel.new.magenta('one off')} access code\")\n sleep(3)...
[ { "docid": "d2d98144b43b25798037e15badc4fd79", "score": "0.60803604", "text": "def prompt_for_access_token(auth)\n print(\"1. Open this page:\\n%s\\n\\n\" % auth.authorization_uri)\n print(\"2. Enter the authorization code shown in the page: \")\n auth.code = $stdin.gets.chomp\n auth.fetch_access_to...
e69f8b84534a0ba25b1d416c10dacab0
convert integer to a reversed array of digits
[ { "docid": "e98339fdf78cb4ddbe80a4e0e2ea89d6", "score": "0.66687936", "text": "def digit_array(card_number)\n card_number.to_s.gsub(/ +/, '').reverse.split(//).map{|digit| digit.to_i}\n end", "title": "" } ]
[ { "docid": "2d4813bf374b89f63fa1625a4d59b89e", "score": "0.7998103", "text": "def reversed_number(int)\n # output = 0\n # reversed_array = int.to_s.chars.reverse\n # p reversed_array\n int.to_s.reverse.to_i\nend", "title": "" }, { "docid": "b2ed2d48bff8ea0e4dc887dbf37f7dff", "score":...
9e7674d5c2ab2ac2c1a7f9d30f04e2ae
Retrieve all the metrics for the supplied structure.
[ { "docid": "0083be9552199b9b2da2db71dc5ec22d", "score": "0.0", "text": "def hits(structure_id, start_date = 15.days.ago, end_date = 1.day.ago)\n Analytic::Hit.results(profile, start_date: start_date, end_date: end_date).\n for_structure(structure_id).to_a\n end", "title": "" } ]
[ { "docid": "8217d40776decebef44aaedf1620b71e", "score": "0.6969375", "text": "def metrics\n Metric.all\n end", "title": "" }, { "docid": "b609b0424ea479c8bc244393bf98ad46", "score": "0.6899207", "text": "def metrics\n send(:devs) do |body|\n body[:devs].collect(&m...
4f70cc41aefd789c3bdddb22be5d852e
has many? def multiple? true end def virtual? true end
[ { "docid": "30ab77ed26af6dc4fad91f00623304c5", "score": "0.0", "text": "def is_association?\n true\n end", "title": "" } ]
[ { "docid": "e8db32a552026dc2fb39985569d4cd15", "score": "0.7871606", "text": "def has_many?\n true\n end", "title": "" }, { "docid": "0bfbd341146a75a6b39c05cf55ee6962", "score": "0.7611192", "text": "def has_many?\n false\n end", "title": "" }, ...
19d00e6d06e2c2623d341d06e848ee8c
Sets the attribute child_node
[ { "docid": "4d6aed4c8a7bd625622586c8301139e5", "score": "0.7766613", "text": "def child_node=(_); end", "title": "" } ]
[ { "docid": "591158074841fc1120c580033812820f", "score": "0.76766986", "text": "def set_child(name, node)\n send :\"#{name}=\", node\n end", "title": "" }, { "docid": "0c42fab475dd819d32995ba9304abf27", "score": "0.7079845", "text": "def add_child(child_node)\n chil...
a8f2156d1b8174af6af1b09bc5252ffe
GET /rates/1 GET /rates/1.xml
[ { "docid": "d386ae0423373c415eecbc2ee3ba88a4", "score": "0.71174157", "text": "def show\n @rate = Rate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @rate }\n end\n end", "title": "" } ]
[ { "docid": "46ca5cf2259fac1374a744bf0cf096b1", "score": "0.75180167", "text": "def retrieve_rates(date)\n path = \"http://openexchangerates.org/api/historical/#{date.to_s}.json?app_id=#{$app_id}\"\n response = Net::HTTP.get_response(URI.parse path)\n # TODO: error handling\n response.body\nend", ...
023d288012599e3e5a9e01da09bf3ce0
Run framework and model before_action hooks with type symbol and request.
[ { "docid": "ecf2f74333190f58fa8a0678e4f7f0af", "score": "0.79070216", "text": "def before_action_hook(type, request)\n if v = framework.before_action\n v.call(type, request)\n end\n if v = before_action\n v.call(type, request)\n end\n end", "title": "" } ]
[ { "docid": "925e79b1c11ed1d1cf7b59ac98e89036", "score": "0.70450413", "text": "def hook(type, request, obj)\n if type.to_s =~ /before/\n if v = framework.send(type)\n v.call(obj, request)\n end\n if v = send(type)\n v.call(obj, request)\n end\n els...
388a81aa470bd08ca79d9140eeb57735
Set userstamp for any database updates to the current user
[ { "docid": "658307b43e7425a452f8ab04ab11c998", "score": "0.77046335", "text": "def define_userstamps_current\n Mongoid::Userstamps::User.current = current_user\n end", "title": "" } ]
[ { "docid": "25f21620662f3da59e3d8a4563679aac", "score": "0.7574672", "text": "def set_user_stamp\n @user_stamp = UserStamp.find(params[:id])\n end", "title": "" }, { "docid": "d9b280cb80cc92dfa32a878e51ca1a19", "score": "0.7460164", "text": "def set_users_last_access\n if ...
273d58a47c57bb01e9b2472f5ae51445
Returns a list of directory names. This does not include '.' or '..'.
[ { "docid": "8866169096dbc3709bd0315dbd453e73", "score": "0.691418", "text": "def directory_entries\n entries.select{ |f| File.directory?(File.join(path,f)) }\n #dirs = ::Dir.glob(\"#{path}/\")\n #dirs.collect{ |f| f.chomp('/') }\n end", "title": "" } ]
[ { "docid": "649b5179d06fdce9a1c250efd88a4bfd", "score": "0.7694828", "text": "def get_directories_names path\n get_directories_absolute_paths(path).map {|dir| File.basename(dir) }\n end", "title": "" }, { "docid": "872621478abcfb334e8d34972e2fc2a8", "score": "0.7382899", "tex...
5ff179412069b9879939f5b39aebc439
POST /messages POST /messages.json
[ { "docid": "1384e092d653534aef2b239b655a8df1", "score": "0.67002374", "text": "def create\n @message = Message.new(params[:message])\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { re...
[ { "docid": "e18d18e71266c27bcbba27d76e6fe2b4", "score": "0.7465386", "text": "def post(content)\n post_to(\"/api/v1/messages/\", {:body => content})\n end", "title": "" }, { "docid": "0d382a399c00f58d58fd4c7a76bcbd9d", "score": "0.71694404", "text": "def create\n message = Mes...
bad4e75c1d8907412c0cc9c8d0d6216e
DELETE /bumper_stickers/1 DELETE /bumper_stickers/1.xml
[ { "docid": "e483f1feec45ec73772ef12fe525866e", "score": "0.7080632", "text": "def destroy\n @bumper_sticker = Bumpersticker.find(params[:id])\n @bumper_sticker.destroy\n\n respond_to do |format|\n format.html { redirect_to(bumperstickers_url) }\n format.xml { head :ok }\n end\n e...
[ { "docid": "af883f93b357f26633fa1f912d28ab0f", "score": "0.67074656", "text": "def destroy\n\t@bumper_sticker = Bumpersticker.find(params[:id])\n\tif @bumper_sticker.destroy\n\t\tflash[:notice] = \"Your e-Bumper Sticker was deleted.\"\n\tend\n\t\n respond_to do |format|\n format.html { redirect_...
20bb8514194ba0d5f9d3292aa87c5490
Render an object as a hash, using export and security properties set by its controller.
[ { "docid": "81f89f8d232ba0e276efd682c08217ea", "score": "0.56975347", "text": "def serialize(controller, obj, opts, orphans=nil)\n to_hash(controller, obj, opts, 0, [], orphans)\n end", "title": "" } ]
[ { "docid": "51618c07e56374f951c0c16b1688c2b4", "score": "0.6474633", "text": "def render\n puts @my_hash\n end", "title": "" }, { "docid": "744218bb417e37de4f81765ed8e5ea55", "score": "0.62328345", "text": "def render\n render_hash.to_json\n end", "t...
d7a88e40494637beb7390f8583b867f8
def date_is_not_future if date.future? errors.add(:date, "date can't be in the future") end end
[ { "docid": "3decc058df6594bf983d13f4371b5e9d", "score": "0.0", "text": "def dual_matches_pilots\n if pic.downcase == 'self' && :dual_flight? == true\n errors.add(:dual_flight?, \"flight is marked as dual, but 'Self' is listed as PIC.\")\n end\n end", "title": "" } ]
[ { "docid": "bfb66e2b421e20e861d6bf0493370091", "score": "0.9039495", "text": "def must_be_future_date\n \tif date.present? && date <= Date.today\n \t\terrors.add(:date, \"must be in the future\")\n \tend\n end", "title": "" }, { "docid": "7720ae5fe31965ac9d51964abfb1965c", "score": "...
8e38868d18fd516b786469aeeb1358e5
TODO: avoid having a global state through this class variable
[ { "docid": "de351fd56ba0058c4713a0be5a4bde69", "score": "0.0", "text": "def initialize()\n @entities = []\n # Global transformations of entities in or below the active path.\n @transformations_active = {}\n # Global transformations for entities in sibling paths, like entiti...
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.765091", "text": "def private; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.6729749", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", ...
75119c56428be0e69a1ea66fdf6b321c
Validates just the corrections for internal consistency.
[ { "docid": "de13917e9d2955d795bfcebd26560f7f", "score": "0.75804275", "text": "def validate_corrections(corrections, errors, warnings)\n # Validate that each correction has the required attrs\n required_attrs_groups = [\n case @options['validate_or_merge']\n when ...
[ { "docid": "9c9943779bb5186d29e913cd7116c02a", "score": "0.6481535", "text": "def check!\n self.normalize!\n \n __check_coherency\n __check_error\n end", "title": "" }, { "docid": "46aee01456cd9fbd228b...
971dc068052f072fb219d1a17f54134c
with userfriendly terminal output, poll NUMBER_OF_SAMPLES times count the number of polls inside the unit circle derive PI from the total number of polls inside and outside the unit circle return the approximation
[ { "docid": "efbba9ac7114fd61f39a8a29901f03a7", "score": "0.7897332", "text": "def approximate_pi\n puts \"each dot is #{PROGRESSOR_SAMPLE_PERIOD} picks out of #{NUMBER_OF_SAMPLES} total samples\"\n\n running_total_of_circle_hits = 0\n\n NUMBER_OF_SAMPLES.times do |i|\n running_total_of_circle_hits...
[ { "docid": "95a050db54ab54effe69051d55fb3684", "score": "0.64309573", "text": "def calculate_pi(number)\n denominator = 1.0\n operation = 1.0\n pi = 0\n\n (1..number).each do |_count|\n pi += operation * (4.0 / denominator)\n denominator += 2.0\n operation *= -1.0\n end\n\n pi\nend", ...
93362adb11e57576a3404fb0d8ae8939
To know if the end is set
[ { "docid": "68c467f0c669c4f51676f858a906e403", "score": "0.8294808", "text": "def isEnd?\n\t\t\treturn @end != nil\n\t\tend", "title": "" } ]
[ { "docid": "a19ea61c2241861056b8efba73eb5c07", "score": "0.8158434", "text": "def unbounded_end?\n self.end.nil? && !empty?\n end", "title": "" }, { "docid": "49b1e0f6a28179ce8c749865b7580a61", "score": "0.80777425", "text": "def end?\n !!@end\n end", "title":...
67de57ea6c5932436c0469a7c23f1680
GET /car_total_owners/new GET /car_total_owners/new.xml
[ { "docid": "ac5d06bb392f7d277eb0b2f8dc79b65e", "score": "0.74467236", "text": "def new\n @car_total_owner = CarTotalOwner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @car_total_owner }\n end\n end", "title": "" } ]
[ { "docid": "1d955fcc0263ebfe341bc5d8f4131cf6", "score": "0.7600328", "text": "def new\n @total_owner = TotalOwner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @total_owner }\n end\n end", "title": "" }, { "docid": "405b86e248e...
2ef9c9965cfcd990eb983752a1bb7668
Get NCBI Taxonomy ID.
[ { "docid": "29bfd04b238f974d587805942a36c5c5", "score": "0.7574575", "text": "def get_ncbi_taxid\n send(\"get_ncbi_taxid_from_#{universe}\")\n end", "title": "" } ]
[ { "docid": "81449ced44dcab69693029b68698889f", "score": "0.7612514", "text": "def get_ncbi_taxid\n origin = (universe == :ncbi and db == :assembly) ? :web : universe\n send(\"get_ncbi_taxid_from_#{origin}\")\n end", "title": "" }, { "docid": "f2b7164b4a7f3b54654c24f78810359c", "sc...
2191b9a899b79a3ba1122b5cf1a95b14
Aux methods for CSV
[ { "docid": "c465032830749f3a737078b9fd139783", "score": "0.0", "text": "def raw_number(_number, _d)\n formatted_number_without_delimiter(_number, _d)\n end", "title": "" } ]
[ { "docid": "a8cbeda40ecafae56e9239168cc516a1", "score": "0.7110368", "text": "def import_csv_smart\n \n end", "title": "" }, { "docid": "96dacdd0e4c3c047e35e0449a2692780", "score": "0.69484735", "text": "def csv=(klass); end", "title": "" }, { "docid": "65c897e15e95f5c0...
0566db7a2d7a328fd6b4092924bb8bb4
Grab comments from the change log for this backups "new" event.
[ { "docid": "3c4c1db183e63e474efcd2339a9146fd", "score": "0.6712772", "text": "def set_change_log_from_create\n # find comments for the creation of this backup\n self.change_log = ChangeLog.find(:first, :conditions => {:object_class => self.class.name.downcase, :object_id => self.id, :action => 'ne...
[ { "docid": "1ff1784dd4025e83965b4582303a2b55", "score": "0.6577965", "text": "def get_comments\n self.comments = []\n IO.popen \"svn log r#{self.end_revision}\" do |f|\n revision = nil\n author_dt = nil\n data = \"\"\n range = (self.start_revision.to_i + 1)..self.end_revision.t...
9861c1c1dc83fd483cc8630898b4890d
this method finds the Euclidean distance between a data point and a centroid point
[ { "docid": "bd512c4cf1d265dc9e081dd2bdfef626", "score": "0.7045455", "text": "def find_distance_between(data_point, centroid_point, centroids_index)\n return [calculate_distance(data_point, centroid_point), centroids_index]\n end", "title": "" } ]
[ { "docid": "db327e025c006a25a51eff3743abbfca", "score": "0.6812454", "text": "def calculate_centroid\n\n # Clear the centroid vector\n @vcentroid.clear\n tcentroid = Hash.new( \"0\" )\n\n # Iterate through each feature vector\n @people.each do |person|\n\n # Sum the feature vectors i...
2eca7e002d2889fea835b872b7a8a431
Creates a new ParticipantSet.
[ { "docid": "076cabc197f9c3538d8b403f6a34107e", "score": "0.0", "text": "def initialize\n @members = {}\n @locked = false\n end", "title": "" } ]
[ { "docid": "199328d1bdd52a319122d012e3601c19", "score": "0.602362", "text": "def new_input_set()\n return GetParticipantInputSet.new()\n end", "title": "" }, { "docid": "89142d13fd74db722b5d548c1637ab52", "score": "0.5996869", "text": "def new_input_set()\n return ...
d7d5e9a2307ac8da68f11234fbfbc282
Returns the end time of the interval (given the interval +start_time+ in seconds)
[ { "docid": "4f532602dfd746dbff8bd9d91b8d411b", "score": "0.6581634", "text": "def endTime(start_time)\n @components.each do |c|\n start_time=c.endTime(start_time)\n end\n return start_time\n end", "title": "" } ]
[ { "docid": "d16c3b7adba5dbafea9b07b52a0c1d5e", "score": "0.78239745", "text": "def end_time\n start_time + duration\n end", "title": "" }, { "docid": "a961581c9e29c48eeedb9ceb37e37c9e", "score": "0.7622612", "text": "def end_time\n start_time + duration.minutes\n end", ...
af2f90f79d630ca50c9a6bc5ee354ddd
Determines whether this product is currently in stock
[ { "docid": "d70ec7de676dab2d843e882beaec8769", "score": "0.71778286", "text": "def in_stock?\n\n # Iterate over all related styles\n self.sizes.each do |size|\n return true if size.stock > 0\n end\n\n false\n end", "title": "" } ]
[ { "docid": "d7b38b58ab9a15d1dba96e2029069c9f", "score": "0.8655004", "text": "def in_stock?\n has_inventory? 1\n end", "title": "" }, { "docid": "c709e3d9a56925526b415d18a7d8cfda", "score": "0.8500473", "text": "def in_stock?\n stock == 'IN'\n end", "title": "" ...
49926a0e51059022b19af2b300651c21
POST /posts POST /posts.json
[ { "docid": "c338fa417459841bbb538d286d5787c3", "score": "0.0", "text": "def create\n if(params[:post])\n @saveOrigin = Post.new(params[:origin])\n @post = Post.new(params[:post])\n @userid = User.find(session[:user_id]).id\n @post.user = @userid\n @post.capacity = 0\n @post.clu...
[ { "docid": "92c50133f120b4421970b36c5df90a46", "score": "0.7400646", "text": "def create\n @post = Post.new(post_params)\n @post.save\n render json: @post\n end", "title": "" }, { "docid": "abed7ddc94f10bcd0f62efa65c40c143", "score": "0.72498643", "text": "def create\n p...
579bc2e80b37a9c08f45fe68f52e86ca
DELETE /taxonomies/1 DELETE /taxonomies/1.json
[ { "docid": "33e8c3fc05810e699171713773d8c055", "score": "0.7584634", "text": "def destroy\n @taxonomy = Taxonomy.find(params[:id])\n taxonomy_type = @taxonomy.taxonomy_type \n @taxonomy.delete_node_keep_sub_nodes\n @taxonomy.reload\n @taxonomy.destroy\n\n respond_to do |format|\n ...
[ { "docid": "7999f476ab2764c0064164b34df403dd", "score": "0.7261759", "text": "def destroy\n @luxire_taxonomy.destroy\n respond_to do |format|\n format.html { redirect_to luxire_taxonomies_url, notice: 'Luxire taxonomy was successfully destroyed.' }\n format.json { head :no_content }\n ...
4b71576f76a1fbe8d4e18972c8a7f41e
Returns the string value which needs to be attached to HTTP request header in order to be authorized.
[ { "docid": "1dc840d8c8cb73f237d15af13cd4c22e", "score": "0.6912637", "text": "def get_authentication_header\n acquire_token if token_expired\n \"#{token_type} #{token}\"\n end", "title": "" } ]
[ { "docid": "5849a6bf7aa31fb97f0a2e79cb4c8e49", "score": "0.73547995", "text": "def request_authorization_header\n return if request.headers['Authorization'].blank?\n\n request.headers['Authorization'].split.last\n end", "title": "" }, { "docid": "573765696bb5ec75ef2819b1f9...
600db589c42f1338f70c91ada3c4dafd
Get all configured service types (added through plat.servicetype)
[ { "docid": "2efb81f274491272b5ecaa40516e485f", "score": "0.8560812", "text": "def get_service_types\n if @servicetypes.any?\n @servicetypes.flat_map(&:servicetype).compact\n elsif @servicetype\n [@servicetype]\n else\n []\n end\n end", "title": "" } ]
[ { "docid": "e92c55181b116c64546578ca15647185", "score": "0.8536408", "text": "def service_types\n get_info :service_types\n end", "title": "" }, { "docid": "727d074fb18c0c8af87ecde98fc1e5b9", "score": "0.8352977", "text": "def get_list_service_types\n ServiceType.get_list_...
ce62524b7a821495d726b9479855295e
This setup command is run if ".chefworkstation" is missing prior to the run. It will set up default configuration, generated an installation id for telemetry, and report telemetry & config info to the operator.
[ { "docid": "9a0392799bc1b71ca5048b9226b5fc2d", "score": "0.7607609", "text": "def setup_workstation\n require \"securerandom\"\n installation_id = SecureRandom.uuid\n File.write(Config.telemetry_installation_identifier_file, installation_id)\n UI::Terminal.output T.creating_config(Co...
[ { "docid": "9e37196a5ad2633d2e6a6aef4436d004", "score": "0.650031", "text": "def setup\n @kitchen = $base_dir.join('support', 'kitchens', self.class.to_s)\n FileUtils.remove_entry_secure(@kitchen, true)\n @kitchen.dirname.mkpath\n system \"knife solo init #{@kitchen} >> #{log_file}\"\n @s...
e11595924681b4a82db49658a60ec852
GET /audio_sources/1 GET /audio_sources/1.xml
[ { "docid": "8705f63ed2a3f001a07eb37c1c499468", "score": "0.72514147", "text": "def show\n @audio_source = @bundle_source.audio_sources.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @audio_source }\n end\n end", "title": ...
[ { "docid": "c6587feff05f636bc9dfa41bf0143693", "score": "0.74791217", "text": "def index\n @audio_sources = @bundle_source.audio_sources\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @audio_sources }\n end\n end", "title": "" }, { ...
68a57ffa08fdf4ff63d3ad056d58dde0
PATCH/PUT /transfers/1 PATCH/PUT /transfers/1.json
[ { "docid": "cace05f81618dd43dfa5d610e8747d06", "score": "0.60358775", "text": "def update\n @stock = Stock.find(params[:stock_id])\n @transfer = @stock.transfer\n respond_to do |format|\n if @transfer.update(transfer_params)\n format.html { redirect_to stock_transfer_url(@stock, @transfer...
[ { "docid": "1f95f97261fb2310994795ff644b31fe", "score": "0.6504531", "text": "def update\n @transfer = Transfer.find(params[:id])\n\n respond_to do |format|\n if @transfer.update_attributes(params[:transfer])\n format.html { redirect_to @transfer, notice: 'Transfer was successfully upd...
38e702c41f792644a215ace60d13278a
GET /admin/events/1 GET /admin/events/1.json
[ { "docid": "69f8c91b054c1968b47fa15913e7169a", "score": "0.0", "text": "def show\n @score_attributes = EventSaShip.includes(:score_attribute, :score_attribute_parent).where(event_id: params[:id], is_parent: 0).order('parent_id asc').map { |s| {\n id: s.id,\n name: s.level==1 ? s.score_a...
[ { "docid": "81502c8ae71bc9296e26548867a8eccf", "score": "0.7724903", "text": "def index\n @events = current_admin.events\n end", "title": "" }, { "docid": "ad6fb9588455cc60b878fd23aefadd44", "score": "0.75010073", "text": "def index # requires user\n render json: current_use...
054eeec9c007c88421621273be2ae1e3
duration_ms is deprecated. Use duration instead, which returns a Duration type.
[ { "docid": "64504cc833ed67362f7029f51807f629", "score": "0.0", "text": "def duration_ms(timing)\n case timing\n when Run::REAL\n realtime_duration_ms\n when Run::GAME\n gametime_duration_ms\n end\n end", "title": "" } ]
[ { "docid": "1508ea0cadf2c66fa1765fc8f4b7138c", "score": "0.757555", "text": "def duration_ms; end", "title": "" }, { "docid": "2b0f5773ee25961c08d1cf9cf0c253dc", "score": "0.73944634", "text": "def duration_in_milliseconds\n return @duration_in_milliseconds\n ...
7ca9523f460a56c157104c0d85a43b9b
Calling invalidate removes the computation from all of its dependencies. This keeps its dependencies from invalidating it again.
[ { "docid": "c36355a3a509f5f609cd81c4a1e85922", "score": "0.7163564", "text": "def invalidate!\n unless @invalidated\n @invalidated = true\n\n queue_flush! unless @stopped\n\n invalidations = @invalidations\n @invalidations = []\n\n invalidations.each(&:call)\n ...
[ { "docid": "48b4268881151c7995ba20180387bd34", "score": "0.65254396", "text": "def invalidate(*args)\n clear\n @valid = false\n @view.invalidate\n nil\n end", "title": "" }, { "docid": "ae7ab59da16103d1559576d4fab3abc1", "score": "0.6497424", "text": "def inval...
7612be9049e47456ce8eeb95df760c47
Given an array of integers between 1 and n, inclusive, where n is the length of the array, write a function that returns the first integer that appears more than once (when the array is read from left to right). In other words, out of all the integers that might occur more than once in the input array, your function sh...
[ { "docid": "d374233bccafb72f371f36d80f875c86", "score": "0.0", "text": "def fist_duplicate_n_array(nums)\n return -1 if nums.empty?\n\n nums.each do |_num|\n abs_n = nums.abs\n return abs_n if nums[abs_n - 1].negative?\n\n nums[abs_n - 1] *= -1\n end\n -1\nend", "title": "" } ]
[ { "docid": "b8ed02d4c26a4b42df05e2b64733fa8b", "score": "0.8015072", "text": "def find_dup(arr)\n# sorted_array = arr.sort\n# duplicate = 0\n\n# sorted_array.each_with_index do |elem, idx|\n# if elem == sorted_array[idx+1]\n# duplicate = elem\n# end\n# end\n\n# duplicate\n arr...
bbb35e023c4ce258ae187ede6f034c2d
FizzBuzz defines a method with three parameters
[ { "docid": "0cb7de0db287da890630c3e36d4e5497", "score": "0.0", "text": "def fizzbuzz(num_1, num_2, range)\n# inclusive range. Each iterates over each element. do is a loop\n (1..range).each do |i|\n# conditional statement with different operators and two paramenters\n if i % num_1 === 0 && i % num_2...
[ { "docid": "bc3efb7fb5eaba22a8efdcb17e64888c", "score": "0.80806357", "text": "def FizzBuzz\n \nend", "title": "" }, { "docid": "9784d9ad1ce7ba02ac9cfb6eedd6b65f", "score": "0.8052313", "text": "def fizzbuzz(num)\n\nend", "title": "" }, { "docid": "eb2b55d4ca56cdbd55bb...
67fd52d1debe6766f0f041529cc1320c
GET /visits GET /visits.json
[ { "docid": "df1bbd7838dc9a9e914f693730ec473d", "score": "0.70288473", "text": "def index\n @visits = Visit.all\n end", "title": "" } ]
[ { "docid": "a6cd3ec8c1ec4ad1bc45721a8b29650d", "score": "0.7859736", "text": "def index\n # @visits = Visit.all\n render status: :ok, json: @visits\n end", "title": "" }, { "docid": "7eb8b246106ecb69a705a5684f1f1d36", "score": "0.7741094", "text": "def show\n u...
ea43f7d068cda6f086c3c2a611654bd4
Start automatic spinning animation
[ { "docid": "db41a1bf04118a0d6c927ba3aa259601", "score": "0.6255925", "text": "def auto_spin\n CURSOR_LOCK.synchronize do\n start\n sleep_time = 1.0 / @interval\n\n spin\n @thread = Thread.new do\n sleep(sleep_time)\n while @started_at\n if Th...
[ { "docid": "a0b35f7f22bad4f96957ee6db1591536", "score": "0.7096099", "text": "def spin rotations = 1\n rotate rotations\n end", "title": "" }, { "docid": "3d368ca94ec8c0b840b9427141ea6d74", "score": "0.69092315", "text": "def spin\n\t if @spinTime == 60\n\t\t@image = Gosu::Image...
d7b4f1c3b2f8e33f5b163a9a0a7a3f85
Send a +USR1+ signal to the process.
[ { "docid": "2deb36615fa160df777229973e663e82", "score": "0.6649506", "text": "def usr1(pid)\n `kill -s USR1 #{pid}`\n end", "title": "" } ]
[ { "docid": "ce9065409e9cc01561ff3482059a5d77", "score": "0.63761395", "text": "def shutdown\n _shutdown 'SIGUSR1' unless dead?\n end", "title": "" }, { "docid": "edc7af8a7e3d48958936e4e70810a184", "score": "0.6104072", "text": "def graceful\n\t\treturn nil unless self.running?\n\...
029c31943978449556127eeda16f9300
GET /pastes/1 GET /pastes/1.xml
[ { "docid": "e04e962838c850e8afe0af1ce14fbdd7", "score": "0.65493953", "text": "def show\n @paste = Paste.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @paste }\n end\n end", "title": "" } ]
[ { "docid": "c3a35509a40856c771a5fc44cb2946b3", "score": "0.63709456", "text": "def get(id)\n self.class.get(\"/paste/#{id}\").parsed_response\n end", "title": "" }, { "docid": "ace5592ee4ed567500579759ecab57ae", "score": "0.61454195", "text": "def show\n @pastor = Pastor.f...
f8e10959ad3c512dce978ccd644e2658
create and return the second computer within this method
[ { "docid": "1c3db39000ec905b4bb92be31e16bc99", "score": "0.7373839", "text": "def second_computer\n Computer.new(\n brand: \"Apple\",\n screen_size: 24.0,\n model_name: \"iMac\",\n model_year: 2021\n )\nend", "title": "" } ]
[ { "docid": "36b7657d4c6fa767c497fbf6f68ad214", "score": "0.80429256", "text": "def second_computer\n computer = Computer.new(\n \"Apple\",\n 13.0,\n \"Macbook Air\",\n 2015\n )\nend", "title": "" }, { "docid": "1515c3fa402fe206116dd4704211ae59", "score": "0.7484051", "t...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "58399b88f0341664be08fdc89e544fdb", "score": "0.0", "text": "def document_status_params\n params.require(:document_status).permit(:name)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7497761", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6959097", "text": "def strong_params\n params.require(:request).permit(param_white...
ea4fbb40146041177b141343fb34cee3
Called from on_send, this method helps to autocorrect the offenses flagged by this cop. source://rubocoppackaging//lib/rubocop/cop/packaging/bundler_setup_in_tests.rb57
[ { "docid": "022b56975b9b3844907e4f02f7272732", "score": "0.0", "text": "def autocorrect(corrector, node); end", "title": "" } ]
[ { "docid": "7a95abd53eb06909c665693a53002db5", "score": "0.5882833", "text": "def safe_autocorrect?\n config = RuboCop::ConfigLoader.default_configuration\n cop_class.new(config).safe_autocorrect?\n end", "title": "" }, { "docid": "f13d0b2166f3997a9e4a67cc2e9177e3", "s...
ea710e8e1bb8bd9a00268dd1756ba411
DELETE /frequencies/1 DELETE /frequencies/1.json
[ { "docid": "637df5050ec5ce266d6bd76312df5dcb", "score": "0.7012653", "text": "def destroy\n @frequency.destroy\n\n respond_to do |format|\n format.html { redirect_to frequencies_url, notice: t('controller.successfully_deleted', model: t('activerecord.models.frequency')) }\n format.json {...
[ { "docid": "639573a76049b5770c5f23b985e8a51d", "score": "0.71822184", "text": "def destroy\n @frequency = Frequency.find(params[:id])\n @frequency.destroy\n\n respond_to do |format|\n format.html { redirect_to(frequencies_url) }\n format.xml { head :ok }\n end\n end", "title"...
f08750c2e345610f132493eb5166043a
Provides the subset of the given templates that have no dependent templates outside the set.
[ { "docid": "60689140f768155ef49f2637ac594aa7", "score": "0.6839197", "text": "def closed_subset(templates)\n templates_for(@dependency_tree.closed_subset(templates.filenames))\n end", "title": "" } ]
[ { "docid": "369784a6f7dda0b2657d9e00ac1b4745", "score": "0.679725", "text": "def free_templates\n deployed = client.stacks.map(&:name)\n universe = AwsCftTools::TemplateSet.new(client.templates.select do |template|\n deployed.include?(template.name)\n end)\n ...
34fb163a83d7e0ffae48c2e154cd6105
Activate the auto importation of the last successful manual catalog importation. Once you have made your fist manual catalog importation with success, you can call this operation to import it automatically. No parameter required, we know which one it is.
[ { "docid": "bae6fcf86dab225071584622d2e743a6", "score": "0.5561677", "text": "def importation_activate_auto_import(store_id, opts = {})\n importation_activate_auto_import_with_http_info(store_id, opts)\n return nil\n end", "title": "" } ]
[ { "docid": "e282920420b1f8afb229e5cfcb975094", "score": "0.5763957", "text": "def initial_import\n return if @_start_transaction_state[:id] # fix bug in Rails core\n unless skip_import || loading?\n import_batch.jobs do\n CommitImporter.perform_once id\n end\n end\n end", ...
63a84a1eff676bca68bc62d243932288
Choose whether we should respond in an HTTP authentication fashion, including 401 and optional headers. This method allows the user to explicitly disable HTTP authentication on AJAX requests in case they want to redirect on failures instead of handling the errors on their own. This is useful in case your AJAX API is th...
[ { "docid": "84812772c6ff4a025d18ea3b275107b5", "score": "0.6718726", "text": "def http_auth?\n if request.xhr?\n Devise.http_authenticatable_on_xhr\n else\n !(request_format && is_navigational_format?)\n end\n end", "title": "" } ]
[ { "docid": "8ccb31b7331b154eba9521ff1036407a", "score": "0.6899897", "text": "def allow_client_to_handle_unauthorized_status\n headers.delete('WWW-Authenticate')\n end", "title": "" }, { "docid": "e4d861193e49eee7964546304e24540d", "score": "0.689798", "text": "def require_au...