query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
601ee363e23373c8334e4fea534b340d
DELETE /folders/1 DELETE /folders/1.json
[ { "docid": "9ae21ec151c3c8bd6f82d5aaa1d0fb28", "score": "0.7038344", "text": "def destroy\n @folder = Folder.find(params[:id])\n @folder.destroy\n\n respond_to do |format|\n format.html { redirect_to folders_url }\n format.json { head :no_content }\n end\n end", "title": "" ...
[ { "docid": "fcf0fa86db2cf222b4b7017c7a2d0a1a", "score": "0.75944734", "text": "def folder_delete(path)\n make_request(:delete,\"#{folders_url(path)}.xml\")\n end", "title": "" }, { "docid": "7d672d630a4c5fa4e50c17240e039a2c", "score": "0.7218044", "text": "def delete_folder(i...
f32076047c7f499a6587f4f7b961b8bb
Check if there are any notifications for this instance of user
[ { "docid": "6f4a5a2d170984664bcbed006d4f2edf", "score": "0.67228246", "text": "def new_notifications?\n PublicActivity::Activity.where(recipient_id: id, read: false).any?\n end", "title": "" } ]
[ { "docid": "6658a0c394889d348b547e15db34c30b", "score": "0.7527524", "text": "def check_notifications(user)\n return user.profile.notifications\n end", "title": "" }, { "docid": "cb0c5e54ecba4f881a4aa0c802305059", "score": "0.7414403", "text": "def notified?\n !notif...
cbf9ebf0fa2b6beccd5ecfbcfaecf8f4
Casos de Prueba: Ejercicio2
[ { "docid": "dd7cc396b0fec16c4e21be356861c11d", "score": "0.56478554", "text": "def casos_de_prueba_ejercicio_dos\n\tp1 = Product.new '01', 'Martillo', '50'\n\tp2 = Product.new '02', 'Clavos x 100', '10'\n\tp3 = Product.new '02', 'Clavos x 100', '10'\n\tp4 = Product.new '04', 'Mecha de taladro', '65'...
[ { "docid": "5987163a0d20916007f84cb8a21ef4c3", "score": "0.67179674", "text": "def casos_de_prueba_ejercicio_uno\n un_hombre = Hombre.new\n un_hombre.caminar\n otro_hombre = Hombre.new\n otro_hombre.hablar\n un_sapo= Sapo.new\n un_sapo.saltar\n un_aguila= Aguila.new\n un_aguila.v...
6a7bed08a0cb74ea8e391d895740dfac
method deserialize Generates a compound key from an array of components.
[ { "docid": "a9744dec629e9433f0ee9d2b7eb2b96e", "score": "0.44985697", "text": "def serialize *keys\n keys[1..-1].inject(keys.first.to_s) { |str, key| str << '[' << key.to_s << ']' }.intern\n end", "title": "" } ]
[ { "docid": "0b9d243c9dad8b6f5abf4e7dc83c4c48", "score": "0.59958345", "text": "def deserialize key\n key.to_s.sub(/\\]\\z/, '').split(/\\]?\\[/)\n end", "title": "" }, { "docid": "dd30a8384787db6ab88b731db915b545", "score": "0.58455914", "text": "def deserialize key\n ke...
104bfef1da50befb5968bc4672f1b3e1
POST /goal_assignments POST /goal_assignments.json
[ { "docid": "44af5e2b46fa5b0d511d7738b8f9145b", "score": "0.73615146", "text": "def create\n @goal_assignment = GoalAssignment.new(goal_assignment_params)\n\n respond_to do |format|\n if @goal_assignment.save\n format.html { redirect_to @goal_assignment, notice: 'Goal assignment was suc...
[ { "docid": "4cbc4eda25e200121df6a8c955c9b87a", "score": "0.8010495", "text": "def create\n @assignment = @user.assignments.create!(params[:assignment])\n \n @assignment.add_to_goal(params[:goal_id]) unless params[:goal_id].blank?\n\n respond_to do |format|\n if @assignment\n form...
864ee2364de0b767ea958d8e4156fcb0
simplify, a tad bit long, maybe > helper method(?)
[ { "docid": "da104a042ab21ed0b31256fe865e2e2c", "score": "0.0", "text": "def sort_flavor\n equal = 0\n print \"What flavor do you prefer? \\n> \"\n choice = gets.chomp.downcase\n unless @recommendation == [] # to avoid an empty array going through an each do loop\n ...
[ { "docid": "8f9e688a594780eccf233865123acc4f", "score": "0.6955616", "text": "def simplify; self; end", "title": "" }, { "docid": "de81bb94d9278ced508384b5bacf32da", "score": "0.6458317", "text": "def simplify\n hash = @x.to_s\n @x = @x.simplify\n while @x.to_s != hash...
743dcce61b215d660305c148a2c02b4a
Provide a user friendly representation source://twilioruby//lib/twilioruby/rest/conversations/v1/service/participant_conversation.rb141
[ { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.0", "text": "def to_s; end", "title": "" } ]
[ { "docid": "74018ee60a8c3e9b2f6cd48cc091fd2b", "score": "0.75140786", "text": "def to_s\n \"<Twilio.Conversations.V1.ParticipantConversationInstance>\"\n end", "title": "" }, { "docid": "f6c8095349388afa18515fa5a7275306", "score": "0.7495478", ...
b8a6aee5e52d759fd7e0541bc86c6dd0
=begin get(note_id) This function takes a note_id which refers to the index of the note in the notes list and returns the content of that note as a string. =end
[ { "docid": "03950310fb4bdfca7b59d1ae9599f1fa", "score": "0.7016389", "text": "def get\n print \"Type the Note ID:\"\n note_id = gets.chomp\n puts \"Getting note contents...\"\n if note_list[note_id]\n note_list[note_id].each do |key, value|\n return value if key == \"...
[ { "docid": "8efd87a634fc274eb169544262a7bb85", "score": "0.7081636", "text": "def notes_get(id)\n options = create_params({})\n note = self.class.get(\"/notes/#{id}\", options)['note']\n\n return nil unless note\n\n # Complete hack, because the API is still broken\n content = '_...
a17a0f30482cdaeeda4beb55e1c5910a
PUT /clubs/1 PUT /clubs/1.json
[ { "docid": "7924d3f286aba7043df734cc1a883ad3", "score": "0.76134956", "text": "def update\n @club = Club.find(params[:id])\n\n respond_to do |format|\n if @club.update_attributes(params[:club])\n format.html { redirect_to @club, notice: 'Club was successfully updated.' }\n forma...
[ { "docid": "53ec73dc7b750fd9ac7845bd744a24b8", "score": "0.7919075", "text": "def update\n club = Club.find(params[:id])\n if club.update(club_params)\n render json: club, status: 200, location: [:api, club]\n else\n failed_to_update(club, \"club\")\n end\n end", "title": "" ...
c87b590c83e2b4b2a1f65fbc80b682c9
(Returns nil if we assume the given id doesn't represent a bug)
[ { "docid": "5804826ee97e600f1d9e5d004b038946", "score": "0.682111", "text": "def extract_id(id)\n # User specified it's a bug\n if id =~ /^bz:(.+)$/\n $1\n # User specified a it's a JIRA issue\n elsif id =~ /^jira:/\n nil\n # Looks like a JIRA issue and there's a matching JIRA i...
[ { "docid": "456cb0ef85d9fb2178a2365a00383825", "score": "0.73580766", "text": "def find_migrated_bug(id)\r\n uri = URI.parse(@api_uri.to_s)\r\n search = \"computer:\\\"BugzillaBugId: #{id}\\\"\"\r\n uri.query = \"cmd=search&q=#{URI.escape(search)}&cols=ixBug\"\r\n\r\n ...
c73380a00259b53741150cdc5449bac9
Defines a method to show the title of the game.
[ { "docid": "3506959ef8a0228f476a8fd9212ccefb", "score": "0.0", "text": "def show_game_title(title)\n formatted_title = '| ' + title + ' |'\n dashes = '-' * formatted_title.length\n puts dashes\n puts formatted_title\n puts dashes\nend", "title": "" } ]
[ { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7805838", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7805838", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "...
28ff13e235221c13015e95a4e2bd5817
POST /replacements POST /replacements.json
[ { "docid": "39dd83b7b731e3da710c0505f31e672d", "score": "0.7575312", "text": "def create\n @replacements = replacements_params.map do |replacement_params|\n Replacement.create(replacement_params)\n end\n\n respond_to do |format|\n if @replacements.all?(&:persisted?)\n format.js...
[ { "docid": "ff1d346263dbcbde84e3ccd4a0e052fa", "score": "0.66284", "text": "def create\n @replacement = Replacement.new(replacement_params)\n\n respond_to do |format|\n if @replacement.save\n format.html { redirect_to @replacement, notice: 'Replacement was successfully created.' }\n ...
43a8897a97064feaad1e0047c8e2b719
Update a &39;memory.Array&39; resource.
[ { "docid": "908efb10fdd04e03aa372b4f7abb8f8c", "score": "0.5586078", "text": "def patch_memory_array_with_http_info(moid, memory_array, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: MemoryApi.patch_memory_array ...'\n end\n # verify th...
[ { "docid": "e3363de419df6d49036242eb3a2d7d0a", "score": "0.68607575", "text": "def update_memory_array(moid, memory_array, opts = {})\n data, _status_code, _headers = update_memory_array_with_http_info(moid, memory_array, opts)\n data\n end", "title": "" }, { "docid": "0fe0562a2...
51f4f7ac8978540181f0ab8f3e26c10b
Methods manage http dialogs
[ { "docid": "8a6b4e559847144964c61e46ea294546", "score": "0.0", "text": "def http_action_post(url, payload = {})\n resp = @site.post(url, payload) do |req|\n req.headers.merge!(@auth_params)\n end\n check_response resp\n end", "title": "" } ]
[ { "docid": "3c8b8b022ac6823d6f26e260d219a52e", "score": "0.6367095", "text": "def http\n end", "title": "" }, { "docid": "1d313b5278e4ace5284ab82f00a1001f", "score": "0.6256687", "text": "def http; end", "title": "" }, { "docid": "861c5d3d93e179768cf3971db9122a05", ...
a9923e0a02dd87b5191a48c4174b0f09
Creates a new MPlayer object with the specified _path_ of the +mplayer+ program.
[ { "docid": "719613aab95e561a6fd5445cddd638b4", "score": "0.0", "text": "def initialize(path)\n super(path)\n end", "title": "" } ]
[ { "docid": "b1512e14dcef9629cc1650a4d3c487c0", "score": "0.61745405", "text": "def play_file(path)\n unless @is_inited\n raise \"Uninitialized player.\"\n end\n @stdin.puts \"loadfile \" + path\n @log.debug \"mplayer has loaded file #{path} with message:\" + @stdout.gets\n @stdin.put...
c719b2cce39c6dcd6156a54b326e188a
Returns the value of attribute prefer_for_regular_expression_match. source://cucumbermessages//lib/cucumber/messages.dtos.rb1009
[ { "docid": "352e2e9e71a2787bc8f2d101b2c0ce09", "score": "0.7158779", "text": "def prefer_for_regular_expression_match; end", "title": "" } ]
[ { "docid": "7b4b399bf6ade141a782ad639da353b7", "score": "0.5945983", "text": "def url_match_attribute\n value = self.class.url_match_attribute\n return if value.nil?\n\n value = Regexp.new(value) unless value.is_a?(Regexp)\n value\n end", "title": "" }, { "docid": "b64...
9f8f8f4db568ca5c50b5642b88791898
TODO: remove after deprecation cycle
[ { "docid": "c1ac9a5030799911bf5c632d2a08ddc7", "score": "0.0", "text": "def warn_if_twitter_secrets_in_env\n return unless store_has_keys?(ENV, ENV_API_KEYS)\n\n warn_secrets_in_project(\"ENV\")\n end", "title": "" } ]
[ { "docid": "6ab77a9219ee157923bc58599ba6aa77", "score": "0.65775484", "text": "def in_use; end", "title": "" }, { "docid": "6ab77a9219ee157923bc58599ba6aa77", "score": "0.65775484", "text": "def in_use; end", "title": "" }, { "docid": "2290804b238fc95bfd6b38f87c6d2895", ...
e83f20123b4214b823c24636d13fcfac
Software Returns all software enumerated on any asset.
[ { "docid": "20f0a14fea3c2738de70ea53df45809f", "score": "0.5398578", "text": "def get_softwares_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AssetApi.get_softwares ...'\n end\n # resource path\n local_var_path = '/...
[ { "docid": "7cf93b04c7a413b16173b176d00c71b4", "score": "0.64364463", "text": "def software\n collected_software = {}\n Brand.where(show_on_consultant_page: true).where(\"api_url LIKE ?\", '%%http%%').each do |brand|\n brand_software = BrandApi.software brand.softwares_api\n brand_softwa...
fc8c79775db6d036fe2290f28d4a2739
== Permission === Get permission menu. Get permission menu. ==== Example
[ { "docid": "9b444f4c1886d1909a64943a203b28fe", "score": "0.87701356", "text": "def get_permission_menu\n return @client.raw(\"get\", \"/helpers/menu\")\n end", "title": "" } ]
[ { "docid": "23645b4587b249f651f60ab8478edf73", "score": "0.87116987", "text": "def get_permission_menu\n @client.raw('get', '/helpers/menu')\n end", "title": "" }, { "docid": "6960d275a95a734031438a5b85b937a1", "score": "0.7349864", "text": "def header_menu\n return [] unless ...
473de0da29769b18f304b7c221c9ef93
I've wondered what the doublecolon notation meant. I've seen it when referencing other modules, e.g. Nokogiri::XML, or Neo::Koan. The formal definition is: The :: is a unary operator that allows: constants, instance methods and class methods defined within a class or module, to be accessed from anywhere outside the cla...
[ { "docid": "973f39255b8c21068b1450ee2f9b2e96", "score": "0.60792786", "text": "def test_top_level_constants_are_referenced_by_double_colons\n assert_equal 'top level', ::C\n end", "title": "" } ]
[ { "docid": "4987ca6f8cb90d6f2f85fbc49d4ddffc", "score": "0.6392008", "text": "def colon; end", "title": "" }, { "docid": "99c539c52c5ab3e728eee4a55ddaf50b", "score": "0.6223903", "text": "def double_colon?\n loc.respond_to?(:dot) && loc.dot && loc.dot.is?('::')\n end", ...
c36b0173785872633c03688edf08eafd
helper to get an auth token for the OAuth application and a user
[ { "docid": "f891e83a04aa90c81a423300943aa19d", "score": "0.0", "text": "def get_auth_token(login, password, otp)\n temp_client = Octokit::Client.new(login: login, password: password)\n res = temp_client.create_authorization(\n {\n :idempotent => true,\n :scopes => SCOPES,\n ...
[ { "docid": "40ed7d98f42b0fe96baa7515988f4afe", "score": "0.75013226", "text": "def get_token\n json = prepare_and_invoke_api_call 'auth/v1/keys/tokens',\n :params=>{:frob=>@frob, :api_key=>@api_key}, :method=>:post,\n :auth=>false\n @auth_user = User.new(json['auth_user'])\n ...
f3d0c5788bf0c56d4ec857ce4c30f85e
We get the topic from the store of the specified identity in a form suitable for editing. TODO: Refactor with get_topic
[ { "docid": "ba781774e900986fd6cc465c9ef03dcc", "score": "0.70461166", "text": "def get_topic_for_edit(id)\n puts \"#> get topic for edit: #{id}\"\n @topic_store.start\n topic = @topic_store.get_topic_with(id, @current_language, @current_scope)\n resolve_raw_occurences!(topic, @current_map)\n...
[ { "docid": "11fb406632493f79c7d3c9225c981294", "score": "0.71243566", "text": "def find_topic\n @topic = current_user.topics.find(params[:topic_id])\n end", "title": "" }, { "docid": "11fb406632493f79c7d3c9225c981294", "score": "0.71243566", "text": "def find_topic\n @topic = ...
485b138031e6dda08e7e6fd5663b01c4
Checks if server is in quiet down mode.
[ { "docid": "4e49c7303351f6620d3c14cd5a1a788d", "score": "0.7920287", "text": "def check_quiet_down?\n @logger.info \"Checking if jenkins is in quiet down mode...\"\n @client.root.quieting_down?\n end", "title": "" } ]
[ { "docid": "c2cc15804cc6134ef758539c90302ac1", "score": "0.67992175", "text": "def quiet_mode?\n @@quiet_mode\n end", "title": "" }, { "docid": "fb6afd713544b863fcf823e6655db1ac", "score": "0.66964644", "text": "def quiet?\n @quiet\n end", "title": "" },...
263861a97273f089c56f34a5c576785e
Publish event to registered handlers or put in the queue
[ { "docid": "602cff35ad9f5c17525588f8c3627a84", "score": "0.6970945", "text": "def publish(event)\n @router.handlers_for(event).each do |handler|\n if handler.is_a?(Events::Handlers::AsyncHandler)\n Resque::Job.create('rcqrs', handler.class, event.class.to_s, event.to_json)\n ...
[ { "docid": "6066fae551558b2b737606fb585c3095", "score": "0.7580238", "text": "def publish(event)\n if @is_synchronous\n dispatch_event(event)\n return\n end\n\n @queue_mutex.synchronize do\n @event_queue << event\n end\n end", "title": "" }, { "docid": "7fdc57a205...
f7ede08df748a4689193949933c5cc7f
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.admin_mailer.registration_confirmation.subject
[ { "docid": "47629068c25e3ec05b278f3dc31a204a", "score": "0.0", "text": "def registration_confirmation(new_admin, old_admin)\n @new_admin = new_admin\n @old_admin = old_admin\n mail to: \"#{new_admin.name} <#{new_admin.email}>\", subject: \"Registration Confirmation\"\n end", "title": "" ...
[ { "docid": "8928fe4f050d7ebd3e9aa992b07e320a", "score": "0.7734644", "text": "def subject_for\n ActiveSupport::Deprecation.warn \"subject_for\"\n I18n.t(:\"subject\", scope: [:notifications, :mailer],\n default: [:subject])\n end", "title": "" }, { "docid": "...
14eebdb1bd486a0ff0d3d96a4cc137a5
reduce 7 omitted reduce 8 omitted reduce 9 omitted
[ { "docid": "3421531ad457d5e062216fd632793242", "score": "0.0", "text": "def _reduce_none( val, _values)\n val[0]\n end", "title": "" } ]
[ { "docid": "8faa7cab97da269bb37c244337bdf096", "score": "0.69556254", "text": "def _reduce_9(val, _values, result); end", "title": "" }, { "docid": "8faa7cab97da269bb37c244337bdf096", "score": "0.69556254", "text": "def _reduce_9(val, _values, result); end", "title": "" }, { ...
7cf52864a3660cbd2e22ea0da985d8c7
DELETE /admins/1 DELETE /admins/1.json
[ { "docid": "8be041869b9c325ba00d292e92a7cb10", "score": "0.7573194", "text": "def destroy\n @admin = Admin.find(params[:id])\n @admin.destroy\n\n respond_to do |format|\n format.html { redirect_to admins_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "a21d11622dc84078d0a45987da833ed6", "score": "0.76915157", "text": "def destroy\n admin.destroy\n respond_to do |format|\n format.html { redirect_to admin_admins_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d7f1a818506c0a2d...
c90baf5a3061fdb6cd0d1735d60e624c
generate a challenge for :averagerand configuration
[ { "docid": "c808f1aba749a609f163e8eab31699da", "score": "0.54621476", "text": "def generate_averagerand\n return @challenges[0] if @challenges.size == 1\n chall = nil\n while chall == nil\n rand_index = rand(@challenges.size)\n if $game_temp.lbchll_lastly_used != rand_index\n i...
[ { "docid": "f712d49ec6c615538b2e2aa846391fda", "score": "0.61752003", "text": "def challenge; end", "title": "" }, { "docid": "a7a3f5ae9cfb672e6690a7592a46a80c", "score": "0.570778", "text": "def challenge\n $challenge = Challenge.new()\n yield\nend", "title": "" }, { "...
7b73d9956a722b6533a635c45e2138fa
Returns the id of a given category, which belongs to the currently logged user.
[ { "docid": "4c7b11ed09ccc2e260bf18cfc16dc778", "score": "0.7864697", "text": "def id_from_name(category_name)\n where(:user_id => User.current_user_id, :name => category_name).first.id\n end", "title": "" } ]
[ { "docid": "daafabb98dd13ae643a51616cc08a3b7", "score": "0.6917156", "text": "def general_category_id\n where(:name => 'General', :user_id => User.current_user_id).first.id\n end", "title": "" }, { "docid": "5c257ee6253e7b1953e36db4b050c33d", "score": "0.6887988", "text":...
8379bb46758ad50bcbafb4607368bc09
def find_customer user.stripe_token ? retrieve_customer(user.stripe_token) : create_customer end
[ { "docid": "36289e27044d230c29e08e0c2761bc7c", "score": "0.77995604", "text": "def retrieve_customer(stripe_token)\n\t\tStripe::Customer.retrieve(stripe_token)\n\tend", "title": "" } ]
[ { "docid": "6245d87a9ac5f775985d9f7fdcbec2a4", "score": "0.77905476", "text": "def stripe_customer\n if stripe_customer_id.present?\n @stripe_customer ||= Stripe::Customer.retrieve(stripe_customer_id)\n else\n nil\n end\n end", "title": "" }, { "docid": "2908df4863e83148c...
647fa0abe4bc00ddd217a134fff1ce2b
Current User (new or from DB)
[ { "docid": "423e869a681ae48f6ffaf0241f0850f3", "score": "0.0", "text": "def user\n @user ||= build_resource(User)\n end", "title": "" } ]
[ { "docid": "e6c58bd80cd7282e8733a9285d85f55f", "score": "0.8173068", "text": "def current_user\n u = User.new\n u.id = session[:current_user_id]\n u\n end", "title": "" }, { "docid": "36828e6b514c99b0a764e9e0544ed513", "score": "0.8027069", "text": "def current_user\n\t\tif...
93b6a91b3d95689839e4971ca88cd54c
Returns a `Time` representing midnight local time on the day specified by the rule for the given offset and year.
[ { "docid": "21c3509fd27232d27dc18db6e5ef237d", "score": "0.747027", "text": "def get_day(offset, year)\n Time.new(year, 1, 1, 0, 0, 0, offset.observed_utc_offset) + seconds\n end", "title": "" } ]
[ { "docid": "2c21dded0160acee67ec18ccf0b951ff", "score": "0.71455884", "text": "def get_day(offset, year)\n candidate = Time.new(year, month, @offset_start, 0, 0, 0, offset.observed_utc_offset)\n diff = day_of_week - candidate.wday\n\n if diff < 0\n candidate + (7 + diff) * 86400\n ...
7e5dfddaab8852abcfa5cd11d5fa29d9
Get Counts of trunks that have recording disabled or enabled
[ { "docid": "17b76e6c7146b461fbe96f28f0c98820", "score": "0.0", "text": "def get_telephony_providers_edges_trunkswithrecording_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: TelephonyProvidersEdgeApi.get_telephony_providers_edges_t...
[ { "docid": "f2058c9d694279af244293aa2f460cd1", "score": "0.58856076", "text": "def ActiveKiteCount\n return kites.where(:Completed => true).any? ? kites.where(:Completed => true).count : 0\n end", "title": "" }, { "docid": "5401c319336fe4d86a82d0ac2b0f515b", "score": "0.58519644", ...
7614ad758ba2fd75f868baf68c35eddd
and returns an Array with the same number of elements, and each element has the running total from the original Array. should have used map
[ { "docid": "77f16f074e13e6d187c5b4dcdd151c0e", "score": "0.7899289", "text": "def running_total(array)\n result = []\narray.each_index do |x|\n if x.zero?\n result.push(array[x])\n else\n result.push(array[x] + result[x - 1])\n end\nend\nresult\nend", "title": "" } ]
[ { "docid": "f3568ca367e8840106ae5b76d48e676f", "score": "0.8426016", "text": "def running_total(array)\n array.map.with_index do |num, index|\n array[0..index].reduce(:+)\n end \nend", "title": "" }, { "docid": "b14b61b16f58b3eb440b0885ecd8eb80", "score": "0.838641", "te...
9e6ea7cf984a5f5d253084b000154922
initializes a new BinaryNode
[ { "docid": "c35d0215f97773baa5381316387ed8bb", "score": "0.0", "text": "def initialize(value, left, right)\n @value = value\n\t@left = left\n\t@right = right\n end", "title": "" } ]
[ { "docid": "dd6caefb102917d31b5d628b51946ff9", "score": "0.68676996", "text": "def init_node\n end", "title": "" }, { "docid": "dd6caefb102917d31b5d628b51946ff9", "score": "0.68676996", "text": "def init_node\n end", "title": "" }, { "docid": "ddeb933bf06b614723a6ec99f2...
e393d100053caadb9d97cb59a4f03b5f
Show each Edit Page
[ { "docid": "b3b3c14bbef0977306b3cd3f3bf0d81f", "score": "0.0", "text": "def edit\n\tend", "title": "" } ]
[ { "docid": "e4c08f615a2a2197007ad3da166193ad", "score": "0.7920524", "text": "def edit\n\t\t@page_name = \" - Edit Show\"\n\tend", "title": "" }, { "docid": "2486fb5620707bc2856b50e6ea360b1e", "score": "0.73978746", "text": "def edit\n\n end", "title": "" }, { "docid...
68065ca7f0f8293dd432e38bf15f4527
Get all members (member events) in the room
[ { "docid": "621fb5506d60088d06106a42ba204272", "score": "0.74228215", "text": "def all_members(**params)\n client.api.get_room_members(id, **params)[:chunk].map { |ch| client.get_user(ch[:state_key]) }\n end", "title": "" } ]
[ { "docid": "f5daf7f8a09d8a82542dccb0c01cfde8", "score": "0.76675236", "text": "def get_member_list\n members = []\n events.each do |event|\n event.attendees.each do |attendee|\n members.push(attendee) unless members.include?(attendee)\n end\n end\n members\n end", "titl...
0fde3cdc993728a7006787aa58182483
GET /item_wh_transacs GET /item_wh_transacs.json
[ { "docid": "b6e941e65d2803840eaac87c4af945b4", "score": "0.0", "text": "def index\n #** warehouse_filter = ItemWhTransac.all.where(\"warehouse_id=?\",params[:warehouse_filter])\n #** item_filter = ItemWhTransac.all.where(\"item_id=?\",params[:item_filter])\n #** transac_type_filter = ItemWhTransac...
[ { "docid": "74459615f522370c4309a5092b7a3100", "score": "0.63724494", "text": "def set_item_wh_transac\n @item_wh_transac = ItemWhTransac.find(params[:id])\n end", "title": "" }, { "docid": "6c8d0bb89b3254ce41f23ee95c5e6976", "score": "0.63521403", "text": "def index\n jso...
b272b689267334222f62992a16e1f296
converts a filename into a page title
[ { "docid": "d3d2ce54491b181fc079df7b6fd36719", "score": "0.8389856", "text": "def file_to_pagename(filename)\n\t\tfilename.chomp(\".md\").gsub('_', ' ').capitalize\n\tend", "title": "" } ]
[ { "docid": "11646c8ca31925ea99c930bd91c4c23d", "score": "0.8100387", "text": "def title\n CGI::unescape(file_name.to_s).gsub(/\\.\\w+$/, '').titleize\n end", "title": "" }, { "docid": "11646c8ca31925ea99c930bd91c4c23d", "score": "0.810006", "text": "def title\n CGI::unes...
a14de871464c140d9b5f565ec03bb9d3
Insert the advice after methods.
[ { "docid": "e7ae15519e41a522a319ff154f8968eb", "score": "0.7494624", "text": "def after(*targets, &block)\n targets, advice = Aspects.resolve(*targets, &block)\n\n targets.each do |target|\n after_advice[target] << advice\n after_advice[target].uniq!\n\n define_advice(target) unless...
[ { "docid": "9d164da1d87af791cfe3fd42af089236", "score": "0.75444543", "text": "def after(*meths, &block)\n return after_all(*meths, &block) if meths.empty?\n meths.each do |meth|\n aspects[:after][meth.to_s] = block\n end\n end", "title": "" }, { "docid": "6edda3d428...
de7a501f52cce6e8a80b551c59c12c7f
admin member > nonadmin member
[ { "docid": "c1b3c1043b828b84c74c6ecbf95609e9", "score": "0.0", "text": "def test_change_member_status_admin_make_member\n change_member_status_helper(mary, mary,\n :change_member_status_make_member,\n true, true, false, true)\n en...
[ { "docid": "fd29ce56189e85314fe0d248f59e707e", "score": "0.777688", "text": "def admin?(member)\n member.login == \"admin\"\n end", "title": "" }, { "docid": "03ae0793ff49ed1a16eed31b4800192a", "score": "0.76690024", "text": "def admin? ; role == 0 ; end", "title": "" ...
da0f4a7a13072a7406ee133c798c230d
generate the code for creating buffers.
[ { "docid": "6d9d91757b7686d51280b3866f0f59b5", "score": "0.6759445", "text": "def print_create_buffer_code\n @gvariables.each do |obj, name|\n if obj.is_a?(CType::OclArray)\n @printer << \" #{name} = clCreateBuffer(context, CL_MEM_READ_WRITE,\"\\\n \" s...
[ { "docid": "bb2d3f7409d8a008d0c1853b50bd6e74", "score": "0.64124984", "text": "def generate; end", "title": "" }, { "docid": "342a662406152150095ab10bd0966137", "score": "0.64009625", "text": "def create_begin\n buffer.allocate(4 + @_model.fbe_size)\n end", "title": "" ...
56565056226de5c3652d4f7ccbf0b2c6
DELETE /approvable_associations/1 DELETE /approvable_associations/1.xml
[ { "docid": "ff4190ab5983a3a4124f77c9a00e3381", "score": "0.7611477", "text": "def destroy\n @approvable_association = ApprovableAssociation.find(params[:id])\n @approvable_association.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_approvable_associations_url) }\n ...
[ { "docid": "a3244d0cd6cad933ff7bac57a485ff21", "score": "0.67824066", "text": "def destroy\n @appropriation = Appropriation.find(params[:id])\n @appropriation.destroy\n\n respond_to do |format|\n format.html { redirect_to(appropriations_url) }\n format.xml { head :ok }\n end\n en...
6f404673c1a11560a4b3025b83f85f30
PATCH/PUT /ciclos/1 PATCH/PUT /ciclos/1.json
[ { "docid": "1fe54990783dc9417c5ce369b9f5371d", "score": "0.6839803", "text": "def update\n respond_to do |format|\n if @ciclo.update(ciclo_params)\n format.html { redirect_to @ciclo, notice: 'Ciclo was successfully updated.' }\n format.json { render :show, status: :ok, location: @c...
[ { "docid": "fd4a80089a1cff5ea9aa68a6f0bddfa4", "score": "0.6611919", "text": "def update\n @colegio = Colegio.find(params[:id])\n\n respond_to do |format|\n if @colegio.update_attributes(params[:colegio])\n format.html { redirect_to @colegio, notice: 'El Colegio fue actualizado satisfa...
b541134aba9dddd77ee373fc036ccf26
Is this record based on a collaboration?
[ { "docid": "3f5c87d2cc2773f4db38a3ef96648c62", "score": "0.8070181", "text": "def collaboration?\n resource_type == \"collaboration\"\n end", "title": "" } ]
[ { "docid": "b38ef09ea438f85659495d15e7e2633c", "score": "0.68739533", "text": "def collaborative?\n response[\"collaborative\"]\n end", "title": "" }, { "docid": "cd4b7bc2500156b9cadb52cd745347bc", "score": "0.68155533", "text": "def shared?(resource)\n # organization_...
6b343a5c6ffd974011d0df3020bcdea2
1 hour, 10 minutes, and 15 seconds 1 hour, 0 minutes, and 5 seconds 1 minutes and 1 second 15 seconds
[ { "docid": "5b3cf0f1111d0885744efbbf78fe267e", "score": "0.0", "text": "def duration_in_words(started_at, finished_at)\n # difference in seconds\n diff = (finished_at - started_at).to_i\n\n hours = hours_part(diff)\n minutes = minutes_part(diff)\n seconds =...
[ { "docid": "5c3dce21a35d9db50ae35b95a3537fe5", "score": "0.69919235", "text": "def seconds_per_minute() 60 end", "title": "" }, { "docid": "83811742f30aa4d6bf1edc0096946cfa", "score": "0.6715528", "text": "def seconds_calc(seconds = 0, minutes = 30, hours = 1)\n\ttime = 3600 * hours ...
44a6ef828e7887f08836fc02ce58e0c8
Iterate through all root page numbers for indexes in the space.
[ { "docid": "5b9ebe424fdec1e539ccfdec5ca028fa", "score": "0.797534", "text": "def each_index_root_page_number\n return enum_for(:each_index_root_page_number) unless block_given?\n\n if innodb_system\n # Retrieve the index root page numbers from the data dictionary.\n innodb_system...
[ { "docid": "24b501286369815358a31b778532292c", "score": "0.65489346", "text": "def index\n @root_pages = [fetch_root_page].flatten\n end", "title": "" }, { "docid": "ecdd182d65203a26ea9a0865cc085a99", "score": "0.6428414", "text": "def each_index\n return enum_for(:each_inde...
aa4054809e9f0db4312720c2ba76422b
GET /qanotes/1 GET /qanotes/1.json
[ { "docid": "faa59fc0517d763b9b52d4c6927b7bfa", "score": "0.6066706", "text": "def show\n # For URL like /orders/1/items/2\n # Find an item in orders 1 that has id=2\n @qanote = Qanote.find(params[:id])\n end", "title": "" } ]
[ { "docid": "ac994dfd602dff74b35c893471c72257", "score": "0.63525015", "text": "def index\n @q_resources = QResource.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @q_resources }\n end\n end", "title": "" }, { "docid": "36d3ed...
4c7e5d0958b215e5723183d8b971bc8c
returns the unique column values contained within the result set
[ { "docid": "ebc59e21311d3236cbd57cf70d5e80b6", "score": "0.71440125", "text": "def pluck_unique(column_name, results = last_results)\n results.map {|r| r[column_name]}.uniq\nend", "title": "" } ]
[ { "docid": "c61ea7777bb07fbbdc7a67ed4ef6c662", "score": "0.74648225", "text": "def values_distinct(column)\n values(column).uniq\n end", "title": "" }, { "docid": "c9d3be1b7841c09236e5715c2f01e7a8", "score": "0.7228825", "text": "def column_values attribute\n self.ma...
2786c041fc8c957ca3beec8eda4ada1c
Base URI from the HTML doc head element
[ { "docid": "00d9158f64e340ceecbc3d1d88a88aed", "score": "0.819695", "text": "def base\n @base = if doc\n href = doc.search('//head/base/@href')\n URI(href.to_s) unless href.nil? rescue nil\n end unless @base\n \n return nil if @base && @base.to_s().empty?\n @base\n...
[ { "docid": "d604203e027afb62de7bedb2158bd504", "score": "0.79667366", "text": "def baseURI\n base = at('.//base')\n base ? base['href'] : document.documentURI\n end", "title": "" }, { "docid": "67ce59a50254488296bebda4ef2717a7", "score": "0.78806365", "text": "def ...
001240671b8ae789f6c02c42543cef34
Lists exceptions that should lead to the request being flagged as invalid (4xx as opposed to 5xx for a generic server error). Decent clients should _not_ retry those requests.
[ { "docid": "cce97bf550effc8492eb3618b9559bac", "score": "0.0", "text": "def permanent_failures\n [\n Magick::ImageMagickError,\n UnsupportedInputFormat,\n ImageVise::ImageRequest::InvalidRequest\n ]\n end", "title": "" } ]
[ { "docid": "0e4797b680ff470140083f3e72e2426c", "score": "0.66429883", "text": "def exceptions\n exceptions = DivaServicesApi.get(\"/algorithms/#{id}/exceptions\").parsed_response\n exceptions.map do |entry|\n DivaServicesApi::ExceptionMessage.new(id, DateTime.parse(entry['date']), entry...
4259081a386f112b8186efc69fa81bf4
GET /user_betting_sites/1 GET /user_betting_sites/1.xml
[ { "docid": "f4c34cc57ab0edf55dcd77a85e91b2e8", "score": "0.69784915", "text": "def show\n @user_betting_site = UserBettingSite.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user_betting_site }\n end\n end", "title": "" ...
[ { "docid": "8100a4f03877672826cef3ff9b2bc90d", "score": "0.7056983", "text": "def index\n @betting_sites = BettingSite.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @betting_sites }\n end\n end", "title": "" }, { "doci...
00395963c606155efc6c95918558b8da
Literate extracts code from Leanpub Markdown files. Usage literate [markdown_file] [template_directory] literate [markdown_file1,markdownfile2,...] [template_directory] Examples literate chapters/2components.md code/public literate chapters/2components.md,3serversandcomponents.md code/public
[ { "docid": "0924ebd5be5a4f310854ad895c794bf2", "score": "0.0", "text": "def resolve_path(path)\n unless Pathname.new(path).absolute?\n File.join(Dir.pwd, path)\n else\n path\n end\nend", "title": "" } ]
[ { "docid": "b81a20cca6d5b25497afc922d9f21693", "score": "0.5668274", "text": "def example_markdown_targets()\n target_files = []\n\n example_dir = File.join(K4_ROOT, 'example')\n ext = 'md'\n filelist = FileList[File.join(example_dir, \"*.#{ext}\")]\n filelist.each do ...
4f62fc4202e995424905c0f79462419d
Ends a session by freeing the ressources in the database
[ { "docid": "51e1fba85ecceb0b00c0fca48004586d", "score": "0.0", "text": "def end_session(token)\n end", "title": "" } ]
[ { "docid": "b9bbba2941b33ed73cd2b70ad07c39ac", "score": "0.68644875", "text": "def close\n @session.close\n end", "title": "" }, { "docid": "e17af834fd115793e0018b9541550a34", "score": "0.6860725", "text": "def dispose()\r\n delete()\r\n end", "title": "" }, { "do...
9436ff7783294279518c8ac022da2dd6
loads an object from a cached file if it exists if it does not exist attempts to create the object from a block if an object is created this way it is written to the cache
[ { "docid": "30dd0829a4ca9ad2ee530af66b564cbb", "score": "0.6761349", "text": "def load(archive_name, klass) \n filename = \"#{archive_name}-#{klass.name}\"\n if File.exist?(File.join(@cache_dir, filename)) then\n puts \"loading from cache: #{filename}\"\n return Marshal....
[ { "docid": "7179ae6e2f986351739cd9d1d53acf16", "score": "0.7796334", "text": "def try_load_object(name, cache_path); end", "title": "" }, { "docid": "5d70e21c71884c657b4b9af89be35ce4", "score": "0.69820756", "text": "def load( id, object=nil )\n @cache[id] ||= read(id)\n end"...
434a4215267b064a89aed2d9581f1a60
Track the requirements of a given plugin
[ { "docid": "d8e4f8feb244efb2e36d40940c318348", "score": "0.0", "text": "def requirements\n @requirements ||= {\n internal: false,\n args: [],\n types: [\n #\n ]\n }\n end", "title": "" } ]
[ { "docid": "12ea396c0570e6ac196183e8225ff19c", "score": "0.6398663", "text": "def pre_plugin\n @pre_plugin\n end", "title": "" }, { "docid": "ff1f9e95ddfed1ca3eb98a2ad2529fd2", "score": "0.6360703", "text": "def plugin_setup!; end", "title": "" }, { "docid": "ff1f...
cf6c824f282544573b4abd182c4adc29
An optional result id. If provided and clients support delta updating the client will include the result id in the next semantic token request. A server can then instead of computing all semantic tokens again simply send a delta.
[ { "docid": "17eb72bff33a9d9779572f663f7f06f3", "score": "0.5774028", "text": "def result_id; end", "title": "" } ]
[ { "docid": "5a991ecd8e6721864291bbbac674e20d", "score": "0.60712624", "text": "def result id\n Result.new id,api_key\n end", "title": "" }, { "docid": "a39e81cbc445fcb25f10158abecdd5d4", "score": "0.5483531", "text": "def update_version( result ) \n self.id = r...
a7716a226f8938b33be3bd180910e4cf
when association changed before destroy
[ { "docid": "ea23828720a31c99daac887c4747e735", "score": "0.0", "text": "def test_should_decrement_counter_when_association_unset_just_before_destroy_when_match\n f, m = build_fixture(:unread => true)\n m.folder = nil\n m.destroy\n assert_equal 0, f.reload.unread_messages_count\n\n # just ...
[ { "docid": "79d7f5d3082dd210183a8e641c7c8658", "score": "0.82206464", "text": "def destroyed_by_association; end", "title": "" }, { "docid": "4d83e41962c39df4727a6f128c765430", "score": "0.74787974", "text": "def destroyed_by_association\n @destroyed_by_association\n end", ...
4f0ad2b314790bbd62cb9ceb5c693e6a
Updates a tag name at Delicious (if necessary)
[ { "docid": "04a5b2f507d60d7c78673ba9939ec3b8", "score": "0.60160446", "text": "def save\n validate_presence_of :name\n unless @original_name == @name\n wrapper.rename_tag(@original_name, @name) || raise(OperationFailed)\n @original_name = @name\n end\n end", "title": ...
[ { "docid": "feaa646023ec7f6902e212cf4d87406d", "score": "0.6870823", "text": "def sanitize_name\n self.name = Tag.sanitize_name(self.name)\n end", "title": "" }, { "docid": "1bd3cf15fd8dc94d2b96deed9145a571", "score": "0.68474036", "text": "def update_tag_name\n t = self.tag\n ...
85d94936f7f3f02d914a8c300a1d271c
GetReportScheduleList The GetReportScheduleList operation returns a list of report schedules that match the query parameters. Currently, only order reports can be scheduled. The maximum number of results that will be returned in one call is one hundred. If there are additional results to return, HasNext will be returne...
[ { "docid": "ca8606195b9e40e6bc4e6d6ca900468e", "score": "0.8159332", "text": "def get_report_schedule_list(params = {})\n response = get(\"/\", {\"Action\" => \"GetReportScheduleList\"}.merge(params))\n GetReportScheduleListResponse.format(response)\n end", "title": "" } ]
[ { "docid": "4273bd1f39805e1bd26eb21d793e2491", "score": "0.6513851", "text": "def list_schedules(opts = {})\n data, _status_code, _headers = list_schedules_with_http_info(opts)\n return data\n end", "title": "" }, { "docid": "43ebb932f45cccbebee31bd7403216bb", "score": "0.60...
c10080a83af6bb35538fdf6a89f2755e
GET /stepstones/new GET /stepstones/new.json
[ { "docid": "c73b95234f4235947cc9a547c77b965b", "score": "0.78841454", "text": "def new\n @stepstone = Stepstone.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stepstone }\n end\n end", "title": "" } ]
[ { "docid": "1e92ceca7ca1c7eddb3681fce3d02714", "score": "0.72283596", "text": "def new\n\t\t@step = Step.new\n\t\trespond_to do |format|\n\t\t format.html # new.html.erb\n\t\t format.json { render :json => @step }\n\t\tend\n end", "title": "" }, { "docid": "3febe425d896b105ac8454397e63795...
6235a60daf005050080339cce4018497
GET /applications/1 GET /applications/1.xml
[ { "docid": "cbe4268479e0979f6b692fa282a51c44", "score": "0.0", "text": "def show\r\n @application = Review.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml { render :xml => @application }\r\n end\r\n end", "title": "" } ]
[ { "docid": "9a01a8dc2ffdcf22c5eebb10f4508832", "score": "0.7723505", "text": "def retrieve_applications()\n start.uri('/api/application')\n .get()\n .go()\n end", "title": "" }, { "docid": "577f3e7e098b0f1d572897563503246c", "score": "0.76858187", "text": ...
5c914d12458da68ed61adc8c35c108a8
PUT /entries/1/unarchive PUT /entries/1/unarquive.json
[ { "docid": "fa2676bf6e4f165830fa86a6cb38ac6f", "score": "0.7263017", "text": "def unarchive\n @day = @entry.day\n @entries = @day.entries.archived\n respond_to do |format|\n if @entry.unarchive\n format.html { redirect_to entries_url, notice: 'Entry was successfully destroyed.' }\n ...
[ { "docid": "8ee908f44470296e1867459ddbc80951", "score": "0.7632553", "text": "def unarchive\n perform_action(:post, 'unarchive')\n end", "title": "" }, { "docid": "793871c93347c431cd1a6e9ac7fa8000", "score": "0.7554793", "text": "def unarchive!\n update!(archived: fals...
7396ae16a6f55145b961caaecc8c9bc0
++ Computes a shorter description for the name associated with this data
[ { "docid": "86e35e5cd7a02c4f410482ea23937e8d", "score": "0.0", "text": "def get_full_name\n \"#{get_scheduled_date} #{get_event_type}: #{rank}) #{swimmer.get_full_name}, #{get_timing}\"\n end", "title": "" } ]
[ { "docid": "c15d31876655bc8aff550026059c2e0d", "score": "0.7491034", "text": "def long_name\n \"#{self.name} - #{self.description}\"\n end", "title": "" }, { "docid": "455abc26193e096c05e9975a9a0b667c", "score": "0.72957873", "text": "def shortname\n data.shortname\n end"...
f377be7fbe6ace95009050c297ca21b2
GET /posts GET /posts.xml
[ { "docid": "8504f36146c649d7b91e9cc4c6ff60d2", "score": "0.0", "text": "def index\n \n\ti=0\n\t@postname = {}\n\t@post = {}\n\t@user = {}\n for post in Post.find(:all, :include => [ :user ]) \n\t i += 1\t\n \t @postname[i] = post.user.name\n\t @post[i] = post\n\t @user [i] = User.fin...
[ { "docid": "96353a9632432f29bdb1830a6be90489", "score": "0.72866184", "text": "def index\n @posts = Post.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end", "title": "" }, { "docid": "f2ee44b73f3580e58...
1bbba947bce120f3466b5eedd81a4d61
Returns the basename of an image without its file extension. image_name "/path/to/name_of_image.jpg" => "name_of_image"
[ { "docid": "8a687cf938bb67d28fd9982e7d74bd41", "score": "0.8703184", "text": "def image_name(image)\n File.basename image, \"*.{jpg,JPG,png,PNG,gif,GIF}\"\n end", "title": "" } ]
[ { "docid": "91f42ae615b668536534894cfa10896d", "score": "0.8441743", "text": "def image_name\n File.basename(image.path || image.filename) if image\n end", "title": "" }, { "docid": "91f42ae615b668536534894cfa10896d", "score": "0.8441743", "text": "def image_name\n File.basena...
c6042f20e2358af5dbe87cd24f65b5c3
used only by super admin to create a new admin
[ { "docid": "1c478ec1dcfd0a3cf346024a05d7912c", "score": "0.67470646", "text": "def create\n mobile=String(admin_params[:mobile]).strip.to_i\n admin_params[:mobile]=mobile\n @new_admin=Admin.new(admin_params)\n password=admin_params[:password]\n password_confirmation=admin_params[:password...
[ { "docid": "2f92e0a4478dd68c50bf081369f4f1f7", "score": "0.79876566", "text": "def create_as_admin\n create\n end", "title": "" }, { "docid": "6ae0002ed83e66b3115f773979dbbe23", "score": "0.76071477", "text": "def new\n unless @current_admin.is_super_admin\n flash[:error]...
b05b65aa29fe45ba4f76523d034ac38d
GET /breeders/1 GET /breeders/1.json
[ { "docid": "c8d44c6e922665d283704fc3131017c3", "score": "0.0", "text": "def show\n @canines = @breeder.canines\n end", "title": "" } ]
[ { "docid": "3830b81fe5a9779d4da12a30cda22c9d", "score": "0.7701419", "text": "def show\n @beer = BreweryDB.beer(params[:id]) \n render json: @beer\n end", "title": "" }, { "docid": "f19ad4a196f5687f218f57abcc1846c6", "score": "0.7447467", "text": "def get_beer\n beer_i...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "7c797deacc0fa7636f80e3f4b1c36df8", "score": "0.0", "text": "def update!(**args)\n @canonical_name = args[:canonical_name] if args.key?(:canonical_name)\n @marks = args[:marks] if args.key?(:marks)\n @name = args[:name] if args.key?(:name)\n end", "title"...
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.73066413", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72631145", "text": "def update...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "099f3c4480ffa18485a3052ac5fd8544", "score": "0.0", "text": "def set_dish_menu\n @dish_menu = DishMenu.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
a18cf6d2d66be04dca2ee65eabec446a
is following a user?
[ { "docid": "a32b1b9b527af45e5b854c9fd11f0e18", "score": "0.0", "text": "def following?(other)\n following.include?(other)\n end", "title": "" } ]
[ { "docid": "090f0f01d6fe46c08009131420be2228", "score": "0.89001584", "text": "def following?(user)\n following.include?(user)\n end", "title": "" }, { "docid": "c4f0877ebe59d3aeb9c217ed8dd50bd0", "score": "0.8830123", "text": "def following?\n user.present?\n end", "titl...
b2205840c7d629684a43c72fdd28e128
GET /pi_estimators/1 GET /pi_estimators/1.json
[ { "docid": "5c710b238d0d1ea6f681efa682faf20a", "score": "0.0", "text": "def show\n @coords = eval(PiEstimator.find(params[:id]).coords)\n if PiEstimator.find(params[:id]).check_for_coord_length(@coords)\n @result = PiEstimator.find(params[:id]).mCarlo3D_pi(@coords)\n else\n @result = ...
[ { "docid": "8822919c8b3a3d730061a63594b79823", "score": "0.7173775", "text": "def index\n @pi_estimators = PiEstimator.all\n end", "title": "" }, { "docid": "fa461798806a7aa5f85bef77ab1fa632", "score": "0.6167281", "text": "def set_pi_estimator\n @pi_estimator = PiEstimator....
26c9773d5bc57d2c4f473133fe04f9d0
Returns all groups where the user is an admin
[ { "docid": "27894b8336e75d2a64a947c818a3c41a", "score": "0.72066784", "text": "def admin_groups\n Group.joins(:employee_groups).where(:employee_groups => {:employee_id => self.id, :group_admin => true}).order(:name)\n end", "title": "" } ]
[ { "docid": "5bc8c11a096bdd02f848975ee4e80029", "score": "0.8128617", "text": "def admin_groups(groups)\n groups.reject {|g| !current_user.group_admin?(g)}\n end", "title": "" }, { "docid": "a18a69fb21e179212929950e356a3cd5", "score": "0.78778267", "text": "def admins\n members...
9af5a45f229ae80b471edd693a86aa89
I worked on this challenge [by myself]. largest_integer is a method that takes an array of integers as its input and returns the largest integer in the array +list_of_nums+ is an array of integers largest_integer(list_of_nums) should return the largest integer in the +list_of_nums+ If +list_of_nums+ is empty the method...
[ { "docid": "606b31174ab63e61f446d018952b1053", "score": "0.84877646", "text": "def largest_integer(list_of_nums)\n\tif list_of_nums.length == 0\n\t\treturn nil\n\telsif list_of_nums.length == 1\n\t\treturn list_of_nums[0]\n\telse\n\t\ti = 1\n\t\tmax_num = list_of_nums[0].to_f\n\t\twhile i < list_of_nums...
[ { "docid": "9280886dc9a04ad162555dfd6a47f80f", "score": "0.896275", "text": "def largest_integer(list_of_nums)\n if list_of_nums.length==0\n \treturn nil\nend\n\tmax_num = list_of_nums[0]\n\tlist_of_nums.each do |number|\n\t\tif number > max_num\n\t\tmax_num=number\n \t\tend\n \tend\n \tmax_num\nend"...
72aa72c3948b38a33e872dc1405f4a8b
POST /yong_hus POST /yong_hus.json
[ { "docid": "63a579e8c0ef569aaecfaa4cee459a4b", "score": "0.6464663", "text": "def create\n @yong_hu = YongHu.new(yong_hu_params)\n\n respond_to do |format|\n if @yong_hu.save\n session[:yong_hu_id] = @yong_hu.id\n format.html { redirect_to @yong_hu, notice: 'Yong hu was successf...
[ { "docid": "486c206acd874cc32e1f89400b217b3a", "score": "0.6756475", "text": "def create\n @yugioh = Yugioh.new(yugioh_params)\n\n respond_to do |format|\n if @yugioh.save\n format.html { redirect_to @yugioh, notice: 'Yugioh was successfully created.' }\n format.json { render :s...
b75f02d30e3285183ae589bce920e8a2
Metodo que calcula la huella de carbono de un plato
[ { "docid": "4994bd4e1a1234f9aae34f38d1a6568e", "score": "0.6531261", "text": "def huella_carbono\n if geidiario() < 800\n return 1\n end\n if geidiario() > 1200\n return 3\n else\n return 2\n end\n end", "title": "" } ]
[ { "docid": "1bc8a3282af34f2de2bdcef4118e81b9", "score": "0.6828515", "text": "def huella_nutricional\n (valor_calorico() + huella_carbono()) / 2\n end", "title": "" }, { "docid": "d2a3e76dace1d20847c7305d0a07c365", "score": "0.67642504", "text": "def calculo \n self.minuto...
94c864a9ce0ac141f83e43de1b6484c5
Main part This fucntion calculates predicted rating using existing factors' and predictors' values, and returns that prediction
[ { "docid": "eb0f18faa2a9b3b30c5fb4417b8a7cf9", "score": "0.7666539", "text": "def predict_rating(user,film)\r\n f_amount=SVD_param.find_by_name(@f_amoun_str).value.to_i\r\n\r\n mu=SVD_param.find_by_name(@global_predictor_str).value\r\n user_prd=user.base_predictor\r\n film_prd=film.base_pred...
[ { "docid": "ef5aca604a857304ca24940240ad590f", "score": "0.7052943", "text": "def predict(user, movie)\n\n popularity = @popularityMap[movie].to_i\n \n feature = [popularity]\n linearRegressionModel = user_predictMap[user]\n \n predictRating = linearRegressionModel.pred...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "9db67876a619370687c5662faefd3442", "score": "0.0", "text": "def account_params\n params.require(:account).permit(\n :client_id,\n :reservation_id,\n :nombre,\n :ruc,\n :telefono,\n :correo,\n :direccion,\n :numero,\n :subtot...
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7498391", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6958937", "text": "def strong_params\n params.require(:request).permit(param_white...
b43b3d6a30efa60a27ce1f4b226383fe
A number chain is created by continuously adding the square of the digits in a number to form a new number until it has been seen before. For example, 44 > 32 > 13 > 10 > 1 > 1 85 > 89 > 145 > 42 > 20 > 4 > 16 > 37 > 58 > 89 Therefore any chain that arrives at 1 or 89 will become stuck in an endless loop. What is most ...
[ { "docid": "a787e3964ac4e6b604b948e275439669", "score": "0.6213685", "text": "def solve( n = 10_000_000 )\n sum = Array.new( n, 0 )\n limit, scale = 1, Math.log( n, 10 ).round - 1\n\n # Precompute single digits.\n (0...10).each {|i| sum[i] = i*i}\n\n # Use previously computed values to sp...
[ { "docid": "1f700c5fb324f95d19d52469156ce3c6", "score": "0.7736995", "text": "def final_chain_num(n)\n while n != 1 and n != 89\n n = sum_squares_of_digit(n)\n end\n n\nend", "title": "" }, { "docid": "13d5128ea160bc5f21e527ac758be79a", "score": "0.69164366", "text": "def persi...
d013f60a773b9c00a7315a54f6c262a1
Gets the startMenuPinnedFolderDownloads property value. Generic visibility state.
[ { "docid": "a451b6a361c4e98f9b76b28fc3bc2198", "score": "0.80202615", "text": "def start_menu_pinned_folder_downloads\n return @start_menu_pinned_folder_downloads\n end", "title": "" } ]
[ { "docid": "1ba6a76dba48dc1f56628489636440c6", "score": "0.7474496", "text": "def start_menu_pinned_folder_downloads=(value)\n @start_menu_pinned_folder_downloads = value\n end", "title": "" }, { "docid": "9cfd27d6f371d39006966537a0248846", "score": "0.728712", ...
40b87aad568006066c90fb3d5b2b1e64
invites each user in 'members' by its user name, to this group If the method is invoked by an instructor, checks on whether the students can be part of the group are skipped.
[ { "docid": "45372ef278cdddf2c787e81d22a40008", "score": "0.7635289", "text": "def invite(members,\n set_membership_status = StudentMembership::STATUSES[:pending],\n invoked_by_instructor: false)\n # overloading invite() to accept members arg as both a string and a array\n m...
[ { "docid": "6180b4cae9e8a7bddbf85e8af50913e0", "score": "0.6532887", "text": "def invitable_users\n @title = \"Invitar usuario\"\n @invitable_users = GetInvitableUsers.call(@previa_group)\n end", "title": "" }, { "docid": "6f01d30219a37298d1f1587380d3e111", "score": "0.630558", ...
ab6b26f6811f32ee2cbb4d59525d7a7e
use session query_uri, or Wac.query_uri if no session available
[ { "docid": "525dbfdaa461185d0ab6235f7461d51f", "score": "0.8518682", "text": "def query_uri\n session ? session.query_uri : Wac.query_uri\n end", "title": "" } ]
[ { "docid": "3eb4df31536fe8fac56650840e781603", "score": "0.6451302", "text": "def store_location\n session[:return_to] = begin\n if !request.query_string.empty?\n \"#{request.path}?#{Rack::Utils.parse_query(request.query_string).slice!(SNOWMAN_NAME).to_query}\"\n else\n reques...
2227269bd568e858bb14b71d51d9b0be
PATCH/PUT /cearths/1 PATCH/PUT /cearths/1.json
[ { "docid": "89ddd08b3e256a3f2c895d1ab597e333", "score": "0.67405844", "text": "def update\n respond_to do |format|\n if @cearth.update(cearth_params)\n format.html { redirect_to calc_earths_path, notice: 'Cearth was successfully updated.' }\n format.json { head :no_content }\n ...
[ { "docid": "8526bda945752e27df3ffdba1b7efea0", "score": "0.6231208", "text": "def update_mobile_carrier(args = {}) \n put(\"/mobile.json/#{args[:carrierId]}\", args)\nend", "title": "" }, { "docid": "aa0b87a16ede7353758305dbbaf57c22", "score": "0.62113684", "text": "def put(*a) r...
07e2557446416b18ef73638cdf70ac23
Returns a string representation of the task and its options to be used by the help system.
[ { "docid": "0f37cbf32b1f824ae91565f3e7e83172", "score": "0.6449852", "text": "def to_help\n [ self.to_s , self.short_description, self.description ]\n end", "title": "" } ]
[ { "docid": "b236b52700b0bed73a2e57e42f92e228", "score": "0.7527814", "text": "def task_help(shell, task_name)\n meth = normalize_task_name(task_name)\n task = all_tasks[meth]\n handle_no_task_error(meth) unless task\n\n shell.say \"Usage:\"\n shell.say \" #{...
c7d7a2b99a12e809cb91ecf37110bf40
GET /coupons/1 GET /coupons/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "de4e95549a38a4fdb7333c44c53d1171", "score": "0.75613546", "text": "def coupons\n headers, params = build_request_data\n urlstr = generate_url('/%s/coupon/%s/show.json?hash=%s', params)\n handle_coupon_results(JSON.parse(RestClient.get(urlstr, headers)))\n end", "title":...
ed7e75869e7dfd2aa22d41d8cce64734
param [Hash] options options option options [Class] :model model class. Default: ActiveSupport::Cache::DatabaseStore::Model
[ { "docid": "bbee0b905a45e47752c2990dbef48f4c", "score": "0.5617371", "text": "def initialize(options = nil)\n @model = (options || {}).delete(:model) || Model\n super(options)\n end", "title": "" } ]
[ { "docid": "b3530f7f61ca08420d38351f9cafdb88", "score": "0.733992", "text": "def benny_model_cache(options)\n ns = self.get_benny_model_ns\n\n if options.is_a?(Hash)\n key_format = []\n key = []\n options.keys.sort.each do |k|\n key_format << \"#{k.to...
512f4b2e8ddefb6a0b5c3db8f3615daa
Returns the link to cover art e.g.
[ { "docid": "484c57fb9371c4a7018ec5689d2ff114", "score": "0.77791816", "text": "def cover_art_url\n @cover_art_url ||= extract_nodes(p_shownotes_main,:cover_art_url)\n end", "title": "" } ]
[ { "docid": "4db05855ab4852572013081720dc7095", "score": "0.7445446", "text": "def cover_url\n media_file(4).try(:media_file_link)\n end", "title": "" }, { "docid": "312411e2b06c26d80bc3ef159fbab4eb", "score": "0.703177", "text": "def cover_url_hq\n media_file(6).try(:med...
7c2e0f28843b4f99d94661e110aa9764
Get the action of the command
[ { "docid": "60e2bdb4faadbb0c6372820d4041a326", "score": "0.8637483", "text": "def action\n (val = command[:action]) && val.to_sym\n end", "title": "" } ]
[ { "docid": "461ee76afff6216d39eb448b1ce275f1", "score": "0.7596671", "text": "def action\n return @action\n end", "title": "" }, { "docid": "461ee76afff6216d39eb448b1ce275f1", "score": "0.7596671", "text": "def action\n return @action\n ...
8be92b2f750eef00aeeb03316ada46f7
Method to get all the search fields for Tickets, Users and Organizations
[ { "docid": "42ddf974c0cbd34b7e67f39030d1e0fb", "score": "0.60917395", "text": "def index\n begin\n @search_keys = Hash.new\n @search_keys[:tickets] = @tickets.first.keys if (@tickets && !@tickets.empty?)\n @search_keys[:users] = @users.first.keys if (@users && !@users.empty?)\n @s...
[ { "docid": "05ab76d5b4d8eaae76cb49a7d53689b2", "score": "0.6478601", "text": "def search_fields\n search_field_options_for_select\n end", "title": "" }, { "docid": "05ab76d5b4d8eaae76cb49a7d53689b2", "score": "0.6478601", "text": "def search_fields\n search_field_options_for_s...
2eb1c33d5ff3443233e513b1a120f504
POST /pokemen POST /pokemen.json
[ { "docid": "9e7d9ad722b9a2583dfc0de934f653f5", "score": "0.6432801", "text": "def create\n @pokeman = Pokeman.new(pokeman_params)\n\n respond_to do |format|\n if @pokeman.save\n format.html { redirect_to @pokeman, notice: 'Pokeman was successfully created.' }\n format.json { ren...
[ { "docid": "0bc902e9c9ca76493b7ca4f6dd1e68d2", "score": "0.66532737", "text": "def create\n @poem = Poem.new(poem_params)\n render json: [\"Poem creation error\"], status: 422 unless @poem.save\n end", "title": "" }, { "docid": "be166cfdf8073e54fd8011603188bff0", "score": "0.66314...
bd5c5af52e1b7b8e216e9a216bb03065
extract the spacekey and id from the ticket id
[ { "docid": "c3c15a8319497e0c5dabc3b33de6461e", "score": "0.68602353", "text": "def split_spacekey_and_id(key)\n spacekey = key.scan(/^([A-Z]+)/).to_s\n id = key.scan(/([0-9]+)$/)[0].to_s.to_i\n return id, spacekey\n end", "title": "" } ]
[ { "docid": "405b78e907f2866a319e78043674b25d", "score": "0.61230016", "text": "def getDetails id\n\t\tticket = @tickets.read ['id', 'pid', 'title', 'description', 'tracker', 'creator', 'created', 'status'], ['id', id]\n\t\tticket = ticket[0]\n\tend", "title": "" }, { "docid": "8cc07432e0f938...
bcac8387975d5f5cd19a8974a9ec67a3
In the new initialize preprocess_arguments happens after pre_initialize The idea is to perform any filtering, cleaning or ordering operations and return the cleaned up arguments. In this case it is being used to enable the ip address to be an optional parameter.
[ { "docid": "a658352bc312dcc5a91b1294d69ece4b", "score": "0.7708361", "text": "def preprocess_arguments(args)\n args.unshift(nil) if args.length <= 1 # add the ip address to the front\n args\n end", "title": "" } ]
[ { "docid": "590db248c4ee520d5c51cc8011f9358d", "score": "0.656723", "text": "def ip_filter=(_arg0); end", "title": "" }, { "docid": "590db248c4ee520d5c51cc8011f9358d", "score": "0.656723", "text": "def ip_filter=(_arg0); end", "title": "" }, { "docid": "590db248c4ee520d5c...
95cdb000a06b91fa8764ae2218800507
Get a list of all featured collections.
[ { "docid": "fe7dbcf6fba354768b39b4a89ee843c9", "score": "0.6776314", "text": "def featured(page = 1, per_page = 10)\n params = {\n page: page,\n per_page: per_page\n }\n list = JSON.parse(connection.get(\"/collections/featured\", params).body)\n list.map...
[ { "docid": "05596ced071075a3ad839d7a1956fa79", "score": "0.7004398", "text": "def available_collections\n api = API.new\n params = {:limit => 9999, :preserve_original => true}\n response = api.send_and_receive('collections', {:params => params})\n response.map {|n| [n['title'], n['identifier...
2f36644968ab413e99ebe38c25891724
There can be only one payment related to a certain conversation
[ { "docid": "be5529a8cf87fd7e8794fb8864edc1f5", "score": "0.77264816", "text": "def one_conversation_cannot_have_multiple_payments\n payments = Payment.where(:conversation_id => conversation.id)\n if payments.size > 1 || (payments.size == 1 && payments.first.id != self.id)\n errors.add(:base, ...
[ { "docid": "87fa82fbf9a5a96b670b98dd5409c2c7", "score": "0.6475225", "text": "def should_pay?(conversation, community)\n conversation.requires_payment?(community) && conversation.status.eql?(\"accepted\") && id.eql?(conversation.buyer.id)\n end", "title": "" }, { "docid": "821adaa730a9a9...
a9b0e7ff23c83e21867846e0357f4f7a
Render a template for file content
[ { "docid": "b3ffc1722f178bc20788b097f30a0a0e", "score": "0.0", "text": "def render_erb_template(template_path, options)\n require 'tilt'\n Tilt::ERBTemplate.new(template_path).render(nil, options)\n end", "title": "" } ]
[ { "docid": "85bf006088676a9844f3d96d485b8b79", "score": "0.81633407", "text": "def render\n template = ERB.new File.new(@template_path).read, nil, \"%\"\n template.result(binding)\n end", "title": "" }, { "docid": "510346443d56caad3706a127a89949ae", "score": "0.81523025", ...
34e6dfe3ea664a85d71e422814f28365
Print detail about a parameter
[ { "docid": "bff21638174ab95b7539baa0e989ec11", "score": "0.8023046", "text": "def printParamDetail(paramName)\n printDebugMessage('printParamDetail', 'Begin', 1)\n paramDetail = getParamDetail(paramName)\n puts paramDetail.name + \"\\t\" + paramDetail.instance_variable_get(:@type)\n puts par...
[ { "docid": "aba056a28799833a65b4068ad620d558", "score": "0.7266956", "text": "def inspect\n \"Parameter(name=#{@name}, description=#{@description})\"\n end", "title": "" }, { "docid": "9df812699c10bd63f445915c338de111", "score": "0.72598404", "text": "def basic_param_function...
d49644299587d214b3e04e314ffe3889
Returns an object with the properties of a PoP
[ { "docid": "f763685bd9bf58ad0644751408369a9b", "score": "0.0", "text": "def getPoPExtraInfo(extraInfo)\n pop_extra_info = {}\n items = extraInfo.split(' ')\n for item in items\n pop_extra_info[item.split('=')[0]] = item.split('=')[1]\n end\n pop_extra_info\n...
[ { "docid": "b4aa809e9c1c33c935098b1933262af9", "score": "0.6404634", "text": "def get_po(component, property, componentInfo=nil)\n return $marathon.getPropertyObject(ComponentId.new(component, componentInfo), property)\nend", "title": "" }, { "docid": "bd414e6c6ceac1393d9d3100ec1f5bc0", ...
5637609d4e1355083dc4348439935068
GET /pedidos GET /pedidos.json
[ { "docid": "98679c09c075e845d0f7e6db374cff42", "score": "0.69721276", "text": "def index\n @pedidos = Pedido.all\n end", "title": "" } ]
[ { "docid": "8083d17d825e9fa61dad2888519ddbaa", "score": "0.7971994", "text": "def index\n @pedidos = @producto.pedidos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pedidos }\n end\n end", "title": "" }, { "docid": "18da6c487111df...
784e9d8b1220c552f94ddffc11261da5
DELETE /tissue_samples/1 DELETE /tissue_samples/1.json
[ { "docid": "1d4dc03c038aa2d65cb1808faa81c69b", "score": "0.7804135", "text": "def destroy\n @tissue_sample = TissueSample.find(params[:id])\n @tissue_sample.destroy\n\n respond_to do |format|\n format.html { redirect_to tissue_samples_url }\n format.json { head :ok }\n end\n end",...
[ { "docid": "1053c4b0a6247d9e5b5ebc2836d304d3", "score": "0.72808784", "text": "def destroy\n @api_v1_sample.destroy\n head :no_content\n end", "title": "" }, { "docid": "561b57f9fa7222e279229f89405ac038", "score": "0.70941514", "text": "def test_delete_not_exist_experiment\n ...
c121448bdebb3cdc9898abc56d2f56a9
Include an additional pageids section listing all returned page IDs.
[ { "docid": "3d0cab07aa2d3c6b52de9d0c1841e1e6", "score": "0.6551532", "text": "def indexpageids()\n merge(indexpageids: 'true')\n end", "title": "" } ]
[ { "docid": "f7c3d8818cdd60e6e1ad0dff12d19872", "score": "0.6779939", "text": "def paged_all_item_ids(page, num_per_page)\n @overall_results_ids.paginate(:page => page, :per_page => num_per_page) \n end", "title": "" }, { "docid": "355fc5b59380e713434ed16db8f7f1bd", "score": "...