query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
1735d04f43960d8899909ec16aa8c383 | players take turns and enter the number of a box they want to take | [
{
"docid": "03c09095bf02a0f856962cd925d22825",
"score": "0.6527822",
"text": "def take_turn\n @board.show_board\n puts \"#{@current_player}'s turn.\"\n square = 0\n until ((1..9) === square) && @board.take_a_square(square, @current_player)\n puts \"Which square do you want to take?\"\n ... | [
{
"docid": "6ef12ba8d580348e03810ea135af5c34",
"score": "0.7315957",
"text": "def turn\n\t if @player_number % 2 == 0\n\t\t\tputs \"Player X choose your box! 1-9\"\n\t\t\t@ttt.assign_box(gets.chomp.to_i, @x.xoro)\n\t else\n\t\t\tputs \"Player O choose your box! 1-9\"\n\t\t\t@ttt.assign_box(gets.chomp.... |
8186f5d97e66150219421ac27e47bc20 | convert objectc method signatures into ruby => (void)foo:(id)sender > def foo(sender) => (void)foo:(MyArg )arg1 arg2:(MyArg )bar > def foo(arg1, arg2:bar) => + (void)myClassMethod > def self.myClassMethod | [
{
"docid": "87df7164b358c0d088b085d1766fc478",
"score": "0.65293074",
"text": "def objcMethod(line)\n type = \"def \"\n if line.start_with?(\"+\")\n type = \"def self.\"\n end\n\n sig = type\n line = line.sub(/\\(\\w+\\)/, \"\")\n ... | [
{
"docid": "827429d70c98f4ecb9179e5a2edca4ce",
"score": "0.5905823",
"text": "def connect(action: T.unsafe(nil), method: T.unsafe(nil), **keyword_args); end",
"title": ""
},
{
"docid": "12ebefa5f84aa673c8fe646edfd9ebba",
"score": "0.5902531",
"text": "def signature=(_arg0); end",
... |
28cedb51baa5617f5fefa7f0b596496f | Edit an existing participant for a specific open safebox of the current user account. | [
{
"docid": "2b3c70c535f91b088dc214f228a991e1",
"score": "0.7093433",
"text": "def update_participant(safebox_guid, participant_guid, participant_params)\n handle_error { sendsecure_connection.patch(\"api/v2/safeboxes/#{safebox_guid}/participants/#{participant_guid}.json\", participant_params) }\n... | [
{
"docid": "5999a4572b2e15cdab409fb380a115db",
"score": "0.6400123",
"text": "def update\n @participant = Participant.find(params[:id])\n if params[:participant][:active] == '1'\n @participant.make_active\n end\n\n respond_to do |format|\n if @participant.update_attributes(params[:... |
1dc0cc49c4faee49c6f6487da984f94f | If we have been passed recipient records, use these to generate each message for sending | [
{
"docid": "5bd1c9f52592d2b4ac15208b80cdfb13",
"score": "0.76600647",
"text": "def generate_and_send_for_recipient_records\n new_recipient_data = []\n recipient_hash_from_data.each do |rec|\n # Get the list item instance referenced by the list_type and id values\n list_item = lis... | [
{
"docid": "87396ef74861615f98804e21dd32f201",
"score": "0.6871595",
"text": "def create_sent_messages \n target_members = self.members +\n (Group.members_in_multiple_groups(to_groups_array) & # an array of users\n Member.those_in_country)\n @contact_info ... |
3aa885fbc0d70317d9201536ddf80b78 | adds a pair to the json hash tree | [
{
"docid": "e7cee8caa9935c14d11eb4fb41d510f8",
"score": "0.66259605",
"text": "def add_json_pair subject, predicate,oa\n if @json_hash.key? subject\n if @json_hash[subject].key? predicate\n @json_hash[subject][predicate].merge!(oa)\n else\n @json_hash[subject][predicate]=oa\n ... | [
{
"docid": "e2addb6c2894669c6b402474b1d3efce",
"score": "0.696363",
"text": "def add(hash); end",
"title": ""
},
{
"docid": "ad39b85fbf44a677fcba7497f4ea0a60",
"score": "0.6421811",
"text": "def add_item(hash, new_key, new_value)\n hash[new_key] = new_value\n p hash\nend",
"tit... |
67b4f4f8edf60907891744fa385585ce | When the merit order contains one or more inflexible consumers which are allowed to set a price, we return a marker object which instructs the price curve to use this to set the price when appropriate. | [
{
"docid": "db2389589daad9569edb8a8ba191f7f8",
"score": "0.63677204",
"text": "def inflexible_production_marker(order)\n # Can't set a price if there are no dispatchables.\n return nil if @dispatchables.empty?\n\n priced_inflexibles = order.participants.always_on.select(&:provides_price?)... | [
{
"docid": "71040d5fc28c639c37bca51459174d8b",
"score": "0.6867673",
"text": "def inflexible_consumption_marker(order)\n # Can't set a price if there are no price-sensitives.\n return nil if @price_sensitives.empty?\n\n priced_inflexibles = order.participants.users.select(&:provides_price... |
b89d6bf720bee5291427d316a3b39c31 | Get Basic Maximum SP | [
{
"docid": "825c3f9014283b04ab321ff70f19674f",
"score": "0.7822819",
"text": "def base_maxsp\n return base_parameter(1)\n end",
"title": ""
}
] | [
{
"docid": "a2b8c3c4df8474a4090197afb7a88be1",
"score": "0.7463685",
"text": "def base_maxsp\n return @parameters[1, @level]\n end",
"title": ""
},
{
"docid": "0af9b4742862cb3252a3417f7bcf3d59",
"score": "0.74516267",
"text": "def base_maxsp\n n = base_parameter(1)\n n *= A... |
6a00edd5236aa99d5519fc129653e32b | PATCH/PUT /dental_records/1 PATCH/PUT /dental_records/1.json | [
{
"docid": "45156322a7bea8df9c6caeec53ac3c27",
"score": "0.66266346",
"text": "def update\n respond_to do |format|\n if @dental_record.update(dental_record_params)\n format.html { redirect_to @dental_record, notice: 'Dental record was successfully updated.' }\n format.json { render... | [
{
"docid": "2e4a85be87daa2f7316e604c8b3637f3",
"score": "0.6613353",
"text": "def update \n @record = Entity.find(params[:id]) \n @record.update_attributes(params[:entity])\n \n respond_to do |format|\n \n format.json {\n render json: {}\n }\n end\n end",
... |
32c9a6fdcc5962f15d3fe12bd018f40b | Get a list workspace members | [
{
"docid": "2b5bbdc5a648d26eb983813d7096dae4",
"score": "0.61970294",
"text": "def get_contentmanagement_workspace_members(workspace_id, opts = {})\n data, _status_code, _headers = get_contentmanagement_workspace_members_with_http_info(workspace_id, opts)\n return data\n end",
"title": ... | [
{
"docid": "555b8f67741aa6339c32402071492804",
"score": "0.7391815",
"text": "def members\n @members ||= ApiFactory.new 'Workspaces::Members'\n end",
"title": ""
},
{
"docid": "3d42ee667fe9a7ff63a635461c35bff6",
"score": "0.73361534",
"text": "def members\n @members_list... |
c3c1ff8eaafdf07fdeed5dd6223431d8 | Sets the showLegendKey property value. Boolean value representing if the data label legend key is visible or not. | [
{
"docid": "34bbd1faa6ae37f5537c6cd20a18cbb2",
"score": "0.8171461",
"text": "def show_legend_key=(value)\n @show_legend_key = value\n end",
"title": ""
}
] | [
{
"docid": "40fd00575569282563aa012879db6f4f",
"score": "0.76392955",
"text": "def show_legend_key\n return @show_legend_key\n end",
"title": ""
},
{
"docid": "a45e167dda01598b73978ad38cfdf329",
"score": "0.63853323",
"text": "def show_legend=(v) Axlsx::vali... |
601d59dc0aff0ddb20f60b0ddd3f44f3 | Get hash of users within a specific genre | [
{
"docid": "b01da569930a55f43f0450f4e520cfd0",
"score": "0.7147815",
"text": "def get_users_of_genre(genre_title)\n @users_of_genre = @users.select {|user| user.custom_attributes[\"Genre\"] == genre_title}\n puts \"#{@users_of_genre.count} users in #{genre_title} genre\"\nend",
"title": ""
}
] | [
{
"docid": "f23ed9d87bb43372601bfcbb72a1980b",
"score": "0.6237835",
"text": "def index\n @genre = @user.genres\n end",
"title": ""
},
{
"docid": "e62903da1b2524958912c00045982abb",
"score": "0.6217995",
"text": "def genres\n @genres.map do |genre_hash|\n genre_hash[:name... |
33f26848d991130128c7487146f42be7 | DEPRECATED: just use resource.save | [
{
"docid": "4374d6211282045f4d7f5026867bb7b5",
"score": "0.7621178",
"text": "def save_resource\n resource.save\n end",
"title": ""
}
] | [
{
"docid": "b18e205d9cbb64684c57cf2eee2ad75c",
"score": "0.8231436",
"text": "def save!\n resource.save!\n end",
"title": ""
},
{
"docid": "367a455d3f92a7b226a54a4c4319a194",
"score": "0.72384924",
"text": "def ar_save_resource\n @resource.save\n end",
"title": ""... |
b1dd9f712902f63f50d30037a56eb195 | Internal: Called during object instantiation. Takes a connection. connection Shoeboxed::Connection instance. | [
{
"docid": "ff34771d352b3f924f2f3d05ef400dbe",
"score": "0.75341475",
"text": "def initialize(connection)\n @connection = connection\n end",
"title": ""
}
] | [
{
"docid": "c1bcd68c0236e983913abb2b0eaba016",
"score": "0.78181785",
"text": "def initialize connection\n @connection = connection\n end",
"title": ""
},
{
"docid": "fc9f412b88f51b76029178777d312080",
"score": "0.7537456",
"text": "def initialize(connection)\n @connection... |
82dec091a679f76ce5275f06aa469685 | Get the configuration for the plugin | [
{
"docid": "6dcecacd177507ddc5492ae6f0da889f",
"score": "0.0",
"text": "def configure(conf)\n super\n\n @cache_ttl = :none if @cache_ttl < 0\n\n @cache = LruRedux::TTL::ThreadSafeCache.new(@cache_size, @cache_ttl)\n\n @chronos_task_regex_compiled = Regexp.compile(@cronos_task_regex)\... | [
{
"docid": "604e97a0ade0f550c057fb7fd1553e79",
"score": "0.83340555",
"text": "def get_configuration\n @cfg\n end",
"title": ""
},
{
"docid": "c95c53e41027b5a70f6fc2a802e51e41",
"score": "0.8078578",
"text": "def get_config\n # TODO\n end",
"title": ""
},
{
... |
7ab55bf29f2598d8b179dcd688efe92f | GET /weather/prediction/:latitude/:longitude/:period GET /weather/prediction/:latitude/:longitude/:period.json | [
{
"docid": "81301615e7de709b4bf55486410f883a",
"score": "0.62751544",
"text": "def show_prediction_by_latlong\n params = location_params\n @cur_date = {:date => Time.now.strftime(\"%d-%m-%Y\")}\n lat = params[:latitude].to_f\n lon = params[:longitude].to_f\n @coordinates = {:latitude => l... | [
{
"docid": "439de94584e8cf5baf45f24817bb4146",
"score": "0.6982097",
"text": "def predictionByLocation\n latitude= params[:lat]\n longitude= params[:long]\n period=params[:period]\n @p= LocationPrediction.prediction(latitude,longitude,period)\n respond_to do |format|\n format.html\n... |
858c33ae3408f20563f4d893d7229736 | This will create the key pairs if they do not exist | [
{
"docid": "a36315bf1f7fa4c82e32243b228ae512",
"score": "0.0",
"text": "def create_key\n puts \"Preparing to create key to transfer to remote systems...\"\n\n PTY.spawn('ssh-keygen -t rsa') { |rscreen, wscreen, pid|\n rscreen.expect(/Enter/)\n wscreen.puts(\"\")\n\n rscree... | [
{
"docid": "8d72577a49055ae8c5e39f81224772c8",
"score": "0.6850625",
"text": "def create_key_pair\n return if key_file.exist?\n begin\n key = compute.key_pairs.create(:name => key_name)\n key.write(key_file)\n rescue Fog::Compute::AWS::Error => e\n raise \"Unable to create KeyPai... |
a21314902f3dd66a39196af393486018 | Override this to provide lookups | [
{
"docid": "202263042b78ff976380be81d91c8ac6",
"score": "0.0",
"text": "def setup_lookup_sheet(workbook)\n @lookups = {}\n end",
"title": ""
}
] | [
{
"docid": "5930761249ad935482b7956d18120e62",
"score": "0.8325455",
"text": "def lookups; end",
"title": ""
},
{
"docid": "dd634988bef3cbda8a94486413375360",
"score": "0.79344946",
"text": "def lookup; end",
"title": ""
},
{
"docid": "dd634988bef3cbda8a94486413375360",
... |
a3120268b307928ef0475a22143fb7d7 | The appropriate deep_fetch can return either a hash or an array of hashes, so we have to handle that in this method | [
{
"docid": "57d036498db8dfc14542121a2d231474",
"score": "0.0",
"text": "def travelers_from(trav_arr)\n return [] if trav_arr.nil?\n trav_arr = [trav_arr].flatten\n trav_arr.map {|t| LBF::Traveler.new(t)}\n end",
"title": ""
}
] | [
{
"docid": "3294003ae0996ac8e47387c5645d7f97",
"score": "0.70411843",
"text": "def deep_fetch(hash)\n keys = remote_name.to_s.split('.').map(&:to_sym)\n keys.inject(hash){|subhash, key| subhash.is_a?(Hash) && subhash[key] }\n end",
"title": ""
},
{
"docid": "6a4b307802d7f8... |
cddd618edcaae0f7ebb38261bc2d6974 | when save_graphics_state is called, we need to push a new copy of the current state onto the stack. That way any modifications to the state will be undone once restore_graphics_state is called. | [
{
"docid": "94c241d311f9d55918261053c8d7c5ca",
"score": "0.0",
"text": "def stack_depth\n @stack.size\n end",
"title": ""
}
] | [
{
"docid": "dd5ca6e486b57ed5768171a10ac9977f",
"score": "0.88912284",
"text": "def save_graphics_state\n @stack.push clone_state\n end",
"title": ""
},
{
"docid": "61757eae25fdcf426b75ca9ce057e46d",
"score": "0.7648479",
"text": "def restore_graphics_state\n @stack... |
94b6e59205e6489ab1efa4d83edcd3f2 | I.E.: /static/media/loader.4b6db8c3.gif TODO: Create a middleware for that TODO: Remove middleware and configure deployment/webpack descently | [
{
"docid": "89d3b628bab752975afbb280ecca715c",
"score": "0.0",
"text": "def redirect_to_asset\n asset = params[:asset].split('.').tap { |p| p << params[:format] }.join('.')\n redirect_to ActionController::Base.helpers.asset_path(asset)\n end",
"title": ""
}
] | [
{
"docid": "fa59ce98362bda29f4f16062b4c316b1",
"score": "0.63653475",
"text": "def loader\n Loaders.static_loader\n end",
"title": ""
},
{
"docid": "f5a418c517fa1e2ef7f442e4d6cb333d",
"score": "0.63426435",
"text": "def favicon_png32\n serve_image :favicon_png32\n end",
"... |
ae0d200b21dad1f866cbcc9dd10b0cda | Methods implemented by this service Must take a Hash as input Must Return a Hash response or nil for no response | [
{
"docid": "2960b2a1436956ab8892547daa7598ef",
"score": "0.0",
"text": "def echo(params)\n params\n end",
"title": ""
}
] | [
{
"docid": "77f2bcc196d56e41f674edc09271ca7d",
"score": "0.61228126",
"text": "def response_from_service\n\n end",
"title": ""
},
{
"docid": "5e2f9b723e1db1f4cab4fc00154a5fa1",
"score": "0.60054713",
"text": "def toHash\n raise ResponseError, \"Response body doesnot exist\" if ... |
fb14722a3e84d264b0e4f1ea7379c6f9 | Determines who the winner is | [
{
"docid": "bd74b25ecad9cee868f583cc998ef1f5",
"score": "0.0",
"text": "def winner(board)\n\n won = won?(board) != false\n\n all_X = board.select {|token| token == 'X'}\n all_O = board.select {|token| token == 'O'}\n number_of_X = all_X.length\n number_of_O = all_O.length\n\n if ( won )\n if (n... | [
{
"docid": "552df5fce08f3108747b8b744b60c1b7",
"score": "0.828153",
"text": "def winner\n # TODO\n end",
"title": ""
},
{
"docid": "bffe67ed1e60a9a45abd5a535ba0abb7",
"score": "0.81943166",
"text": "def winner\n choose_team_from_comparison(result.toto)\n end",
"title": ""... |
d85ce4a4dc3ee41ee28e948b43e8c4ff | characters which reads the same backward or forward, such as madam or kayak. This time, implementing it using an array of numbers as input. | [
{
"docid": "ab5c85f2561c8722fdf0cd4c5d304301",
"score": "0.0",
"text": "def palindrome?(array)\n #find the midpoint of the array. This will be different for odd or even array lengths.\n #if array.length is odd,\nend",
"title": ""
}
] | [
{
"docid": "701c3c2f6aef895d7ff58251dab69fcc",
"score": "0.64019364",
"text": "def backtrack\n @input.ungetc(@look[0])\n @value.reverse.each_byte {|i| @input.ungetc(i)}\n get_char\n end",
"title": ""
},
{
"docid": "228e622ef68cd2cdd257e505070f1c82",
"score": "0.6293736",
"t... |
93a53f4c9f5bda6163c252bd1a288c10 | DELETE /info/1 DELETE /info/1.json | [
{
"docid": "58baed53853a9ee274b725ecc6968d0d",
"score": "0.0",
"text": "def destroy\n @processing.destroy\n respond_to do |format|\n format.html { redirect_to procesos_url, notice: 'El proceso fue eliminada con exitó.' }\n format.json { head :no_content }\n end... | [
{
"docid": "b1a17c1ee1af05c79fe156622df44818",
"score": "0.7329596",
"text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end",
"title": ""
},
{
"docid": "... |
60c328f3d022a98c56e8a48042fb078e | only users with active settings will be notifyed | [
{
"docid": "ebc4d6253e8b6984a837424031430c05",
"score": "0.0",
"text": "def active?\n active && subscription.active?\n end",
"title": ""
}
] | [
{
"docid": "01585a0d10cf9d991dc990db988b99a3",
"score": "0.68840194",
"text": "def mark_registration_status_depending_on_app_settings\n # If the site is public we will make the user active. Otherwise we will make the user as waiting_approval\n self.registration_status = Setting.my_settings.public_... |
cc86f21004d935d95f5162d8d002bd0b | Sets underlined to either true or false, depending on the given argument. | [
{
"docid": "1e59e67ebc3d4a59e945d2361ea544d2",
"score": "0.80225706",
"text": "def underlined=(u)\n self[:underlined] = u ? true : false\n end",
"title": ""
}
] | [
{
"docid": "a7eb982592e792e0ead94fc4169b58bd",
"score": "0.7550396",
"text": "def underline=(flag=false)\n @underline = flag\n end",
"title": ""
},
{
"docid": "90f2b6acd0ec3a3efaa6ca5a24844181",
"score": "0.7514086",
"text": "def underline=(value)\n @underline = !!value\n ... |
3baf62d72aab25b839d2ec33cc2fec7e | Access a SolrDocument's APO druid | [
{
"docid": "523d818ca5600ce312486aa7f16f1745",
"score": "0.0",
"text": "def apo_id\n if has? FIELD_APO_ID\n first(FIELD_APO_ID)\n elsif UBER_APO_IDS.include?(id)\n id\n end\n end",
"title": ""
}
] | [
{
"docid": "fedc0cabc8cf5b880e88a4a2040cd9a8",
"score": "0.6940818",
"text": "def get_doc\n doc = ActiveFedora::Base.find_with_conditions({:id=>pid}).first\n raise OembedSolrError if doc.blank?\n doc\n end",
"title": ""
},
{
"docid": "2f55c7333813d15377cbeb31d22e2dd3",
"score":... |
622b3c49c1e40c50fd34f36158786460 | Not part of the public interface This method currently returns a one dimensional array | [
{
"docid": "cbf3b37c313299e37dfc6601566ebb92",
"score": "0.0",
"text": "def update_markers\n board.flatten.map do |marker|\n case marker\n when \"X\"\n update_x\n when \"O\"\n update_o\n else\n update_empty\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "e97dfa28bf7d56031abd8f5b1e695826",
"score": "0.7436623",
"text": "def to_a; [Array]; end",
"title": ""
},
{
"docid": "02a4d79adea1e5829db657e1d17a594c",
"score": "0.7258322",
"text": "def to_a\n array\n end",
"title": ""
},
{
"docid": "80f4e23b25edddc4... |
f30be80148965ea8ef367d25c7245128 | GET /user_answers/1 GET /user_answers/1.json | [
{
"docid": "cf7ab0a4925ac18baff96b46aaebbdb7",
"score": "0.73262745",
"text": "def show\n @user_answer = UserAnswer.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_answer }\n end\n end",
"title": ""
}
] | [
{
"docid": "842cb9a395c704d0029bbc4ec31dcdb8",
"score": "0.76830524",
"text": "def index\n @answers = current_user.answers\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @answers }\n end\n end",
"title": ""
},
{
... |
639ae6b9df54cb31d73a4a0059752adc | def channel_id(response) response.reply_with_mention response.message.source.room end | [
{
"docid": "ff15ccf9090efcb2cf4c75515f19c9af",
"score": "0.0",
"text": "def check_if_its_hello_time(*_)\n every(50) do |_|\n Time.zone = 'Brasilia' # Needed since this will run in another thread..\n\n # Todo dia de semana as 10 da manha...\n send_good_morning_me... | [
{
"docid": "4c9460a5b41b00e79cd8da5394933599",
"score": "0.7022484",
"text": "def channel_id\n api.channel_id\n end",
"title": ""
},
{
"docid": "9137139b45ec5745ed58a56a8064c39b",
"score": "0.6888977",
"text": "def channel_id\n attributes[:channel_id]\n end",
"tit... |
5a2dc935831c5a436799745d8564b57a | attempt to upgrade `user` to instructor unless they already are one. | [
{
"docid": "7f05f4405563184dd9f35e763fd47b60",
"score": "0.6192962",
"text": "def attempt_admin_downgrade\n # already an instructor\n if @user.instructor_permissions?\n message = I18n.t('settings.admin_users.remove.already_instructor', username: @user.username)\n yield json: { message: m... | [
{
"docid": "8efc0befbc1cc079720080a09d7d3d98",
"score": "0.6912161",
"text": "def update?; user.instructor?; end",
"title": ""
},
{
"docid": "39ca94581ce17f420d8be732f65edf28",
"score": "0.62880147",
"text": "def upgrade_user\n # TODO\n # pass user references to current_us... |
35fcdfeff43ea744e1223c17c8053392 | GET /entries/:id GET /entries/:id.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "2e0e1e1682cbff9e0398cea86c9abbd8",
"score": "0.7634713",
"text": "def show\n entry = Entry.find(params[:id])\n render :json => entry\n end",
"title": ""
},
{
"docid": "60fc92215d5e7a3a2ada417600ca5483",
"score": "0.7601977",
"text": "def show\n render json: Entr... |
1938a92a7cdb0b6d35dcdabd907492e5 | Return summary information for search results | [
{
"docid": "5ab0902ca6de90d2bfcba4d7201334bf",
"score": "0.7089547",
"text": "def documentation_search_summary(result)\n t('documentation.helpers.documentation_search_summary.text', :total_results => result.total_results, :start_result => result.start_result_number, :end_result => result.end_result... | [
{
"docid": "1de14a2bf2b75c9471ad0b2bf3c2c8a1",
"score": "0.7584505",
"text": "def get_search_summary\n\n result = Hash::new()\n\n _search_id = params[:search_id]\n\n search = Search.where( :id => _search_id ).first()\n\n search.calculate_summary()\n\n # Set results for json\n\n result[... |
30ceadefb88864a396e285d82f91fd54 | paper over inconsistencies in the model classes APIs, and return the objects the user wanted instead of the URI=>object stuff | [
{
"docid": "5e697ed41f0c71e5d054424882a7c170",
"score": "0.6667943",
"text": "def list_objects\n objects = @model_class.method(:list).arity == 0 ? @model_class.list : @model_class.list(true)\n objects.map { |obj| Array(obj).find { |o| o.is_a?(@model_class) } }\n end",
"title": ""
}
] | [
{
"docid": "350524aaa8ceb8655267d3a61ea86170",
"score": "0.6494778",
"text": "def get_objects(data,*moredata)\n parms = legacy_getparms(data,moredata)\n # def get_objects(objecttype, get, exactget, regexget, exclude, andget, includes=nil, login=nil, password_callback=PasswordCallback)\n objectt... |
740fb16cb6d808888f35ed102f23f7f2 | ================================================================== DELETE /roles/1 DELETE /roles/1.json | [
{
"docid": "8f4412e2140e3c0c3bb5cd41e0b97658",
"score": "0.7203305",
"text": "def destroy\n @role.destroy\n respond_to do |format|\n format.html { redirect_to roles_url, notice: 'Role was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
... | [
{
"docid": "df9f4f24d6948f0d0fe36c9869e17ffd",
"score": "0.8002001",
"text": "def delete(id)\n request(:delete, \"/roles/#{id}.json\")\n end",
"title": ""
},
{
"docid": "62fbaa6562932fe78c0815964cb33ed7",
"score": "0.77667284",
"text": "def delete_roles\n delete(role... |
60e35ece0130ae027d7099541b24c4c9 | Generate string for Cisco IOS access list | [
{
"docid": "875b9c606efa4f7e1057d66c1ef4ec48",
"score": "0.0",
"text": "def to_s\n @flag.to_s\n end",
"title": ""
}
] | [
{
"docid": "e182a38a601b971f3b2bbeac70d87401",
"score": "0.63491946",
"text": "def to_s\n # no need to print tcp/udp ANY in Cisco ACL\n ''\n end",
"title": ""
},
{
"docid": "0a51f18b219cb8ee020e685a03778d80",
"score": "0.6308027",
"text": "def access_string\n forum_st... |
f647f07fbed882893b6e2bf72125ffca | A run has been requested, so try to find a matching worker. If no match, returns false. Returns immediately. | [
{
"docid": "028d18091d0a49989bfc65cfb42436c5",
"score": "0.69911176",
"text": "def dispatch_run run_id\n run = database[:runs].where(:id => run_id).first\n \n # no race cond here because there is only one thread in db\n ready_workers = database[:workers].where(:run_id => nil).\n ... | [
{
"docid": "6104dd07f973045618d14875fef73251",
"score": "0.7608952",
"text": "def dispatch_to_worker worker_id\n worker = database[:workers].where(:id => worker_id).first\n \n if not worker\n log.error \"Worker #{worker_id} does not exist. Perhaps db was cleared?\"\n return ... |
707be33520f10745de76c1c6a8e2138a | Identify and describe the Ruby method(s) you implemented. Person 4 | [
{
"docid": "d1800d22e0622dbb6cfde0e814ffe36f",
"score": "0.0",
"text": "def my_array_deletion_method!(array, x)\n\n array.delete_if{|str| str.to_s.include?(x)}\n\nend",
"title": ""
}
] | [
{
"docid": "20d309fac0260c3a410b0ebf06462ff3",
"score": "0.72049487",
"text": "def visit_methods; end",
"title": ""
},
{
"docid": "a265fe5e200ae985db3fc3d804b9fd77",
"score": "0.70589155",
"text": "def method_name; end",
"title": ""
},
{
"docid": "a265fe5e200ae985db3fc3d8... |
70715c729e9b6616f4cb16a622ad7ff1 | For use/testing when no gem is installed Require all of the Ruby files in the given directory. path The String relative path from here to the directory. Returns nothing. | [
{
"docid": "03bba08c8c3b35c3536f9cf6b03abbfb",
"score": "0.6915069",
"text": "def require_all(path)\n glob = File.join(File.dirname(__FILE__), path, '*.rb')\n Dir[glob].each do |f|\n require f\n end\nend",
"title": ""
}
] | [
{
"docid": "745ec2ed9c0d86652d82c85a222bca67",
"score": "0.7041323",
"text": "def require_all(path)\n Dir[File.join(File.dirname(__FILE__), path, \"*.rb\")].each {|f| require f}\nend",
"title": ""
},
{
"docid": "4b649a952a3e9e85423b192e130913d7",
"score": "0.69360656",
"text": "def ... |
ef0e1a5dbe9ad9570b6f6e0959f93a6d | implements returns true or false | [
{
"docid": "70f9517a8c2fd2bae758afdde7c65507",
"score": "0.0",
"text": "def delete_tout(uid)\n delete(\"touts/#{uid}\").code == 200\n end",
"title": ""
}
] | [
{
"docid": "8dc4baf4432fafc1409f8ebbb35bac5a",
"score": "0.7526533",
"text": "def implements?(class_name)\n model.implements?(class_name)\n end",
"title": ""
},
{
"docid": "2a0c197c3595abc573f943efaaf25957",
"score": "0.71029276",
"text": "def concrete?\n ... |
23ae2bd117dbcf96081ee23e1d9f2eb8 | It doesn't make sense to reference pictures because they're nested within the respective object, and don't exist outside of them. They're also not stored by us, so the URL doesn't correspond to the data. | [
{
"docid": "48e1dd2b9a6fcfa318a94025ade5a470",
"score": "0.0",
"text": "def self_link\n nil\n end",
"title": ""
}
] | [
{
"docid": "06fb22265c8d67b58e763d7886abc692",
"score": "0.7539701",
"text": "def pic_url\n {\n picture: self.object.pic.service_url\n }\n end",
"title": ""
},
{
"docid": "2f22130a91024f9ef9d9da3bb941005d",
"score": "0.737675",
"text": "def imgurl\n picref.imgur... |
1bece8227389fe193757a4412a52d7b0 | GET /product_prices/1 GET /product_prices/1.json | [
{
"docid": "32ad349eff589ac48e0d24f8e91d39ab",
"score": "0.7276157",
"text": "def show\n @product_price = ProductPrice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product_price }\n end\n end",
"title": ""
}
] | [
{
"docid": "57f535bcec97109374ce1ea92f43045f",
"score": "0.7272206",
"text": "def prices (currency='TWD')\n get '/prices/' + currency\n end",
"title": ""
},
{
"docid": "5b52eff71dca770f982a3a93fb4a1fc4",
"score": "0.7234452",
"text": "def all_prices\n request :public... |
ebe5981b9e8a56b6eda8b80c2102650a | GET /orthodb_best_orthologues/1 GET /orthodb_best_orthologues/1.json | [
{
"docid": "9e72e3ec0043336646de7f09006705e0",
"score": "0.6751737",
"text": "def show\n @orthodb_best_orthologue = OrthodbBestOrthologue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @orthodb_best_orthologue }\n end\n end",
... | [
{
"docid": "02c3f42bb0c2f70c8b7826d4844cfdd9",
"score": "0.66513985",
"text": "def new\n @orthodb_best_orthologue = OrthodbBestOrthologue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @orthodb_best_orthologue }\n end\n end",
"title": ""
... |
9fb01f0f498288937fd1a0d20aa61044 | Method for listing out the all the surgery locations | [
{
"docid": "dfdf50456c2e459ad6e7d2180f651cb3",
"score": "0.7462246",
"text": "def index\n\t\t@surgery_locations = devise_current_user.setting.surgery_locations.all\n\tend",
"title": ""
}
] | [
{
"docid": "ca27b8de0ebfdc001115f79a3e9fb36e",
"score": "0.74801505",
"text": "def find_surgery_location\n\t\t# Find the surgeon location based on the profile\n\t\t@surgery_locations = current_user.setting.surgery_locations.all\n\tend",
"title": ""
},
{
"docid": "31fb7d5db73374163c6e83ed2d4e... |
71076c396122b26290dc275944a711bb | get html template for the proposal and fill corresponding data in the template | [
{
"docid": "1cf6fbeb2acc93a78224c405c39bd9b8",
"score": "0.0",
"text": "def change_content(options = {})\n html_temp = options[:html] # html file to be modified\n page = Nokogiri::HTML.parse(open(html_temp)) \n options[:tags].each { |tag| page.xpath(\"//#{tag[0]}/text()\")[tag[1]-1].content ... | [
{
"docid": "34c6bdfc534364e7ea00d2a3590ecce5",
"score": "0.71345335",
"text": "def create_proposal\n prop = ProposalObject.find_proposal(\"template\", @bc_name)\n raise(I18n.t('model.service.template_missing', :name => @bc_name )) if prop.nil?\n prop.raw_data\n end",
"title": ""
},
{
... |
301647cfed0602bfe835cae82fc2c8c5 | return list string day in current week | [
{
"docid": "bd82a3b54bb8ac9468ea1deae6bf195f",
"score": "0.8228262",
"text": "def day_in_week_str\n\t\tdays = []\n\t\ttoday = Time.now\n\t\tdays.push(formatted(today))\n\t\ttoday_week_day = today.wday\n\t\tanothers = (0..6).select {|e| e != today_week_day}\n\t\tanothers.map do |e|\n\t\t\tdays.push(forma... | [
{
"docid": "c6ec0625b5e70b092c3c22b24098e609",
"score": "0.75604236",
"text": "def current_week\n week_split.select { |c| c.include?(day) }.flatten\n end",
"title": ""
},
{
"docid": "876f06851c1c3daf8d7eee350bf93954",
"score": "0.7540761",
"text": "def weekdays\n wdays = [... |
ca6ac8667c25f87e7dd2a3eda46a6640 | POST /sessions POST /sessions.json | [
{
"docid": "c06567bb3065413715fba6077607809c",
"score": "0.6075244",
"text": "def create\n # check if user exists in the User database\n username = session_params[:username]\n password = session_params[:password]\n password = Digest::MD5.hexdigest(password)\n user = User.where(username: u... | [
{
"docid": "9f246698ea5c1becce7f3cb4ef311f3e",
"score": "0.7441891",
"text": "def create\n @session = Session.new(params[:session])\n\n if @session.save\n render json: @session, status: :created, location: @session\n else\n render json: @session.errors, status: :unprocessable_entity\n... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "7110d4ff2a9dcbcb32c45c2e698bd988",
"score": "0.0",
"text": "def expense_params\n params.require(:expense).permit(:account_id, :amount, :group, :vendor, :description, :date)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.6980957",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6783065",
"text": "def strong_params\n params.requi... |
7d9a4849a2526e70090aa7c1466538ab | Builds a path array by replacing %n values with matches. | [
{
"docid": "25af95eb68e8682001bdd2c55d0ebd96",
"score": "0.50394994",
"text": "def make_path path_map, regex_opts=nil, &block\n path = []\n escape = false\n replace = false\n new_item = true\n rindex = \"\"\n\n path_map.to_s.chars do |chr|\n case chr\n when Kronk::Pa... | [
{
"docid": "8d01c8c09ad617689e69899ac2ff6b8a",
"score": "0.56077987",
"text": "def all_globs(n)\n chars = n.to_s.chars\n '0'.upto('9').flat_map do |digit|\n char_globs(chars, digit)\n end\nend",
"title": ""
},
{
"docid": "df0eb544afc71dc4099f393e9b0b586e",
"score": "0.5364817",
... |
1b9b29121946bf67686bd8031165a2b1 | Returns the URI for the directory document. | [
{
"docid": "4ba8b76fe351f7c6ae2669929eb5d3a3",
"score": "0.72903144",
"text": "def directory_uri\n template = Addressable::Template.new(\n \"https://{host}/discovery/v1/apis\"\n )\n return template.expand({\"host\" => self.host})\n end",
"title": ""
}
] | [
{
"docid": "84fec59c7efdd7d155135930491898c7",
"score": "0.7711741",
"text": "def uri\n\t\turi = self.directory.uri\n\t\turi.dn = self.dn\n\t\treturn uri\n\tend",
"title": ""
},
{
"docid": "deeab3c89d10f60b34d18fe6017b7024",
"score": "0.6819845",
"text": "def _uri_path\n \"#{@dir}... |
95eff5b0a1c02a01ac8dda15793b677f | :url :params :headers :request :ssl | [
{
"docid": "a0aa4c0a47ee00eaa934d0cad14ec397",
"score": "0.0",
"text": "def initialize(url = nil, options = {})\n if url.is_a?(Hash)\n options = url\n url = options[:url]\n end\n @headers = Utils::Headers.new\n @params = Utils::ParamsHash.new\n ... | [
{
"docid": "6ccb63e49252eb18e9fcdaf628950f25",
"score": "0.75015706",
"text": "def http(url); end",
"title": ""
},
{
"docid": "2ba520056da369e2c4c30cd53c637e7a",
"score": "0.72349834",
"text": "def request(method, url, params = T.unsafe(nil), opts = T.unsafe(nil)); end",
"title":... |
d3ea65f1bd972fe2fe59cccb919c5a1e | Manually refresh information of a package, if not yet loaded | [
{
"docid": "7e52f990212e4923f9c0b0e78ddf9e82",
"score": "0.0",
"text": "def update \n package = Package.find(params[:id])\n package.update_details\n redirect_to :back\n end",
"title": ""
}
] | [
{
"docid": "acf9f22406ab3dc19fccaa930c32cb99",
"score": "0.6802142",
"text": "def update_gems\n source_info_cache.refresh true\n end",
"title": ""
},
{
"docid": "a07e9bd1e5098c8315894f25728f3933",
"score": "0.6768397",
"text": "def refresh\n @manifest = load_manifest\n end",
... |
fa03cf57da9024ab2d6ae72b9da3547c | Wait for a child process to die. | [
{
"docid": "5962697c27cbd6778d49aa68ccb8b786",
"score": "0.6430401",
"text": "def wait_stopped pid\n loop do\n break unless is_alive pid\n sleep 0.1\n end\nend",
"title": ""
}
] | [
{
"docid": "f8932d9b2cbdbd48ffd7be572892e288",
"score": "0.80697817",
"text": "def wait\n ::Process.wait(@pid)\n rescue Errno::ECHILD\n end",
"title": ""
},
{
"docid": "9d39bce4a09a8191af34385d349f2530",
"score": "0.79858303",
"text": "def wait_child\n begin\n Process.... |
7bf4042bb60bc6dcd672dd32a0c77c1a | GET /boiler_plates/1 GET /boiler_plates/1.xml | [
{
"docid": "3c5dc4fa8b988ba8e772ccdf8e2469e1",
"score": "0.78385013",
"text": "def show\n @boiler_plate = BoilerPlate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @boiler_plate }\n end\n end",
"title": ""
}
] | [
{
"docid": "c8d4c6639119717f5581312aa4407d44",
"score": "0.75293154",
"text": "def index\n @boiler_plates = BoilerPlate.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @boiler_plates }\n end\n end",
"title": ""
},
{
"doc... |
bae9716ba907085d99bb7a40341d376d | Returns the integer representation of the rank. | [
{
"docid": "4e06cb4c050e5f763dfaa6ccd58b6372",
"score": "0.8786671",
"text": "def to_i\n @rank\n end",
"title": ""
}
] | [
{
"docid": "75304137d59a1ac3af7c05a0e51e5ec2",
"score": "0.77926046",
"text": "def rank_to_i(rank)\n case rank.to_s\n when /^(a|ace)/i; 14\n when /^(k|king)/i; 13\n when /^(q|queen)/i; 12\n when /^(j|jack)/i; 11\n when '10'; 10\n when '2'..'9'; ... |
b850a3edbf0b5382100ac9c94aad2b9c | Renders the current map to a string | [
{
"docid": "3212dbb1984453ac8ad0c81983aa2dbc",
"score": "0.5436552",
"text": "def render(entity: nil, line_of_sight: nil, path: [], acrobatics_checks: [], athletics_checks: [], select_pos: nil,\n update_on_drop: true, range: nil, range_cutoff: false, path_char: nil, highlight: {}, viewport... | [
{
"docid": "f8ec577858306634b9b607b54f28d479",
"score": "0.6999741",
"text": "def display_map\n @map.display_map\n end",
"title": ""
},
{
"docid": "626b96f52fd73d5d2cffd71e9494f826",
"score": "0.6769416",
"text": "def render(map, reveal: false)\n output = \"--------\" * map.ge... |
8edefabcb3aa1a56aa3964b3a0af3202 | DELETE /nossos_servicos/1 DELETE /nossos_servicos/1.xml | [
{
"docid": "221f6c62a05a74e6ebc0df2df35600a0",
"score": "0.72515094",
"text": "def destroy\n @nossos_servico = NossosServico.find(params[:id])\n @nossos_servico.destroy\n\n respond_to do |format|\n format.html { redirect_to(nossos_servicos_url) }\n format.xml { head :ok }\n end\n ... | [
{
"docid": "6785361f232d351c337cd1539cbf63cf",
"score": "0.6842207",
"text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_services_url) }\n format.xml { head :ok }\n end\n end",
"title": ""... |
693c7a76c31318d21a217e13bdf46684 | GET /exchange_product_price_logs/1 GET /exchange_product_price_logs/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "3c11eb5dda8017f7cefc60a782d6c325",
"score": "0.7530991",
"text": "def index\n @exchange_product_price_logs = ExchangeProductPriceLog.all\n end",
"title": ""
},
{
"docid": "767e56939663b18037628a31e2023ab0",
"score": "0.6708319",
"text": "def set_exchange_product_price... |
f095420ec89cc4234803e400afe8ad58 | returns the thubmail for a given user | [
{
"docid": "20db376e7296ef59471d318606e74bc3",
"score": "0.0",
"text": "def thumbnail_for(user, size)\n if user.photos.any?\n if size == \"small\"\n image_tag user.photos.first.image.url(:small), alt: user.name, width: \"50\", height: \"50\"\n else\n image_tag user.photos.firs... | [
{
"docid": "14231b17b79edc04d6e6997b75e3e3bc",
"score": "0.6835111",
"text": "def get_user_email\n useremail[:value]\n end",
"title": ""
},
{
"docid": "7aeaf47fda93481c91a99fd0b6e154a5",
"score": "0.6534903",
"text": "def me\n MailboxUser.find_user((@@user.include?('@'... |
27f2674fd04c85b6fc459e6ba77887c5 | If it tries to scale up, but the number of MAX_DYNOS restricts it | [
{
"docid": "3af7d648d4fda7bc312f61b941fe7bf5",
"score": "0.0",
"text": "def failed_upscale_alert(dynos, metrics, freq_upscale, upscale_queue_time)\n failed_upscales = failed_tries(\"failed-upscale\", freq_upscale)\n return if !mailer || failed_upscales < failed_upscales_alert\n\n proc = p... | [
{
"docid": "8ac5fc5f2f43794cfb13f3bdbf622626",
"score": "0.6496954",
"text": "def scale(data_row)\n\n rpm = data_row.total_requests\n current_dynos = data_row.dynos\n\n # 32,012 rpm => 32 dynos\n ideal_dynos = (rpm / options[:requests_per_dyno]).round\n\n # return if the delta is less tha... |
4b47bf08c3332d7928656bfdf723643f | only ticket's agent can resolve the ticket, and only when it is assigned TODO discuss with client this rule, and discuss creating supervisor role, and if more complicated ticket flow is needed | [
{
"docid": "e7eb77dde95ba6a0d7fefb953de6b7af",
"score": "0.0",
"text": "def resolve?\n \tresolved?\n end",
"title": ""
}
] | [
{
"docid": "b6a97ac25545237a798947aaf5fdb210",
"score": "0.64462864",
"text": "def resolve\n # restrict resolve access to open tickets or appropriate admin\n unless @ticket.status == nil || current_admin.id == @ticket.admin_id\n redirect_to '/'\n end\n end",
"title": ""
},
{
"... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "f646ebb1cd3122133b4d3286490c74b7",
"score": "0.0",
"text": "def set_tyb_configuration\n @tyb_configuration = Tyb::Configuration.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60339177",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60135007",
"text": "d... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "3553ae5612c04d55673e07841f9ef9a6",
"score": "0.0",
"text": "def payday_detail_params\n params.require(:payday_detail).permit(:base_value,:win,:loss, :appropiation, :worked_days, :start_date, :end_date, :employee_id,\n :concept_id, :payday_master_id)\n end",
"title": ""
}
... | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7943618",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.69572574",
"text": "def permitted_params\n params.permit!\n end",
"title"... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "f77be6b6690aeb603445d69e9c3cb272",
"score": "0.0",
"text": "def set_documentacion\n @documentacion = Documentacion.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;... |
f862460988eb20f783bb542786d27932 | Called from the worker in response to abort event from runq. | [
{
"docid": "d8604d910d17db7dce6508d2ee760a2d",
"score": "0.75447804",
"text": "def abort\n if Thread.current == @thread\n raise \"Wrong thread.\"\n end\n\n if @thread && (0..1) === progress\n log.info \"Aborting.\"\n @thread.raise Interrupt\n @progress = :abort... | [
{
"docid": "f9ee98d34d673f21deb2b2effc4424d8",
"score": "0.73681414",
"text": "def abort\n @thread.raise AbortAction\n end",
"title": ""
},
{
"docid": "8ef8ec7287433cfc0e4db0dcad59bd06",
"score": "0.7338921",
"text": "def abort\n unless @finished\n do_abort\n ... |
c31bf39fda1e444b59f5efdca6843ac1 | This method calculate sum of frames | [
{
"docid": "3de9cdd7015033eb71d3bbbbff0ee57c",
"score": "0.0",
"text": "def strike?(pin)\n pin == 10\n end",
"title": ""
}
] | [
{
"docid": "7af3821dc094f9db317c0be1854ae6a7",
"score": "0.7793151",
"text": "def get_sum_frame()\n sum = 0\n @frames.each do |frame|\n if !frame.score.nil?\n sum += frame.score\n end\n end\n sum\n end",
"title": ""
},
{
"docid": "c4ff0c2261f50a007782dc750404932... |
2661dee8befa6cea54151b8cce434acb | Test for function: get_paginate_subtasks (page = 1, order_field = nil, order_direction = nil, per_page = PER_PAGE) Valid input | [
{
"docid": "9a006f13c280732f0b25f614fc00893c",
"score": "0.7801329",
"text": "def test_ut_da10b_t1_01\n p \"Test 01\"\n # gets a list of subtasks\n subtasks = @pj.get_paginate_subtasks(1,\n nil,\n nil,\n PER_PAGE)\n # this subtask list contains 4 subtasks\n assert_equal(PER... | [
{
"docid": "43a552a644b9a43e6d4a24f86147048d",
"score": "0.78960323",
"text": "def test_ut_da10b_t1_01\n p \"Test 01\"\n # gets a list of subtasks\n subtasks = @pu.get_paginate_subtasks(1,\n nil,\n nil,\n ... |
e500b67e73977aa3a0804ae4ac3c04aa | GET /client_types GET /client_types.json | [
{
"docid": "d71bd8ef361aa88b890439b9684d39f7",
"score": "0.7473817",
"text": "def index\n @client_types = ClientType.all\n end",
"title": ""
}
] | [
{
"docid": "8176ad0010f511c96bdd902dfe166ed8",
"score": "0.6991746",
"text": "def types\n @types ||= Types.new(@client)\n end",
"title": ""
},
{
"docid": "6e8100aea4d7fe9b7d6515242adee2a9",
"score": "0.6921427",
"text": "def show\n @client_type = ClientType.find(params... |
ef210f64511d0b468a29ec20297a753e | Gets the managedDevices property value. The devices that have the discovered application installed | [
{
"docid": "73c8106bd1577cb01ebacc4373c77f80",
"score": "0.835275",
"text": "def managed_devices\n return @managed_devices\n end",
"title": ""
}
] | [
{
"docid": "a42e0782fe54ca9986298b36fb832c2e",
"score": "0.7564514",
"text": "def managed_devices=(value)\n @managed_devices = value\n end",
"title": ""
},
{
"docid": "4795dd9664c2c5e3df053e53c9d37d94",
"score": "0.72463226",
"text": "def devices\n ... |
aeb9131787ebdde08b6cc957f75844e4 | Create a new string from a given string using the first three characters or whatever is there if the string is less than length 3. Return n copies of the string. | [
{
"docid": "c6dd438935c85143e2bae652cc17e996",
"score": "0.68183273",
"text": "def multipleFirstThreeCharacters(text, number)\n return text.length < 3 ? text * number : text[0..2] * number\nend",
"title": ""
}
] | [
{
"docid": "0049103cff4c36a4747b1f1764d3573d",
"score": "0.75851977",
"text": "def strunc(s, n)\n if s.length <= n\n s\n else\n s.gsub(/^(.{,#{n - 3}}).*$/, '\\1...')\n end\nend",
"title": ""
},
{
"docid": "6106e84f7626c3e058fe758e078784b6",
"score": "0.696922",
"text": "def... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "91d97873cee80db363293b3da6dcfae5",
"score": "0.0",
"text": "def winetype_params\n params.require(:winetype).permit(:name, {:wine_ids => []})\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7495027",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.69566035",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
c3fce28f9bdcb337e650b8f20cd2fee8 | Private initialize to force use of Drivercreate. | [
{
"docid": "9823835a0143726f5c73321b9c848604",
"score": "0.0",
"text": "def initialize\n reset\n\n @options = ::Kramdown::Options.defaults\n end",
"title": ""
}
] | [
{
"docid": "ea7c9632bd86dd71f9056a649bb405c8",
"score": "0.74701923",
"text": "def initialize(driver)\n\t\tsuper\n\n\t\tself.driver = driver\n\tend",
"title": ""
},
{
"docid": "ecb2ee701c464b11b01c3a28ba7fef49",
"score": "0.74020964",
"text": "def initialize(driver)\n\t\tsuper\n\tend... |
9c646a557e5ac67461311a1b8f2a9869 | DELETE /hemo_lunars/1 DELETE /hemo_lunars/1.xml | [
{
"docid": "ced91d114bb228b9cd51a5a4259dedf8",
"score": "0.6785567",
"text": "def destroy\n @hemo_lunar = @pacient.hemo_lunars.find(params[:id])\n @hemo_lunar.destroy\n\n respond_to do |format|\n format.html { redirect_to(pacient_hemo_lunars_url(@pacient)) }\n format.xml { head :ok }... | [
{
"docid": "8c1fff3b6a79fc5b8351d52e4b43c3d8",
"score": "0.68892926",
"text": "def destroy\n @l1_node = L1Node.find(params[:id])\n @l1_node.destroy\n\n respond_to do |format|\n format.html { redirect_to(l1_nodes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
... |
754d491a0f0412da45535aab55799858 | Bio::BLAST::::Report::Hsp compatible methods Methods already defined: midline, percent_identity ++ start position of the query (the first position is 1) | [
{
"docid": "4c5a87e22da5f66bf8c798d65e97b9d2",
"score": "0.0",
"text": "def query_from; @seq1.from; end",
"title": ""
}
] | [
{
"docid": "9a5637d8e0623cde4c3eb5a3675162aa",
"score": "0.5529909",
"text": "def query_def; @hit.mrna.definition; end",
"title": ""
},
{
"docid": "6c2030577164801a0aad602a723bec70",
"score": "0.5315916",
"text": "def dividing_line; end",
"title": ""
},
{
"docid": "753a1c... |
6810b1133a69fe8f1e2d93d69c563c0a | Provides operations to call the applyDecisions method. | [
{
"docid": "5a30c5312ff5b8ece1edacf6c3aae690",
"score": "0.6403268",
"text": "def apply_decisions()\n return MicrosoftGraph::IdentityGovernance::AccessReviews::Definitions::Item::Instances::Item::ApplyDecisions::ApplyDecisionsRequestBuilder.new(@path_parameters, @reque... | [
{
"docid": "a7de8179cf1ba77660b94dd49f3b2411",
"score": "0.5946085",
"text": "def apply\n invoke_deferred_logics\n return if advices.empty?\n\n define_methods_for_advice_blocks\n add_to_instances unless @options[:existing_methods_only]\n apply_to_methods unless @options[:new_met... |
51f50f9e426942b55be9a93760b90226 | Using a private method to encapsulate the permissible parameters is just a good pattern since you'll be able to reuse the same permit list between create and update. Also, you can specialize this method with peruser checking of permissible attributes. | [
{
"docid": "29b4d31181dd6b9fc1fde4662ae3d480",
"score": "0.0",
"text": "def post_params\n params.require(:post).permit(:name, :title, :content, tags_attributes: [:name, :_destroy, :id])\n end",
"title": ""
}
] | [
{
"docid": "124e7145bb903f508e4505e21d3826f6",
"score": "0.71744865",
"text": "def permit_parameters!\n @permitted_parameters ||= begin\n case action_name.to_sym\n when :create\n params.require(:responder).permit(:type, :name, :capacity)\n when :update\n params.require(:r... |
868ce967caabd495f2cad985bfb2ba13 | ::: bp_class ::: 31/05/2012 ................................................................................................... Format and clean class strings | [
{
"docid": "cca0fbdf3e13303f30e6bd0c4a4c1e77",
"score": "0.6800241",
"text": "def bp_class class_param\n class_param.blank? ? '' : class_param.strip().html_safe\n end",
"title": ""
}
] | [
{
"docid": "0f7565ae68aff3547b94cffd64e3c3c7",
"score": "0.65835106",
"text": "def sanitize_class_name(name)\n name.gsub(/[^_0-9A-Za-z:]/, '')\n end",
"title": ""
},
{
"docid": "d33a75aded8879fb069d0cfc88af097e",
"score": "0.635127",
"text": "def safe_class_name()\n ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "8d20ac1a533ac432d91a546d3e1a0ed9",
"score": "0.0",
"text": "def set_gym\n @gym = Gym.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60320485",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6013371",
"text": "de... |
308c14ffcc6180b9ffce29196412f667 | Compares the complement link with two oriented segments and optionally an overlap. | [
{
"docid": "53000b8d2ea784fc9c4ab7c69496405a",
"score": "0.7108059",
"text": "def compatible_complement?(other_oriented_from, other_oriented_to,\n other_overlap = [])\n (oriented_to == other_oriented_from.invert_orient and\n oriented_from == other_oriented_to.invert_orien... | [
{
"docid": "aa836c520bc8587f6313b6720ff93482",
"score": "0.6974587",
"text": "def complement?(other)\n (from_end == other.to_end and\n to_end == other.from_end and\n overlap == other.complement_overlap)\n end",
"title": ""
},
{
"docid": "525d3828529734de67b1fa839c542545",
"... |
93102b3027f4fa996d66b64321a93307 | Checks status of JMeter execution on agents and returns array of MasterAgent instances where JMeter is still running. An empty array means JMeter is not running on any agent. | [
{
"docid": "b0ec154a419fd3d9d06330805b89d39d",
"score": "0.7831865",
"text": "def check_status\n logger.debug { \"#{self.class}##{__method__}\" }\n mutex = Mutex.new\n running_agents = []\n visit_collection(self.master_agents.where(active: true)) do |master|\n agent = master.check_statu... | [
{
"docid": "53369eba04bd030e332711cb2143bc47",
"score": "0.6763764",
"text": "def running_agents\n list = `rabbitmqctl list_queues -p #{@options[:vhost]}`\n list.scan(/^\\s*nanite-([\\S]+)/).flatten\n end",
"title": ""
},
{
"docid": "08a06ea33a3ef268b8c2e0c6f63016aa",
"score... |
96fd73d6f78c03a63eb3bdf2ff8f0195 | FIXME: field names ( Checks if current_address is admin, and therefore can play around with the venue table | [
{
"docid": "06f984813c3c44f67615d2f40a171bc0",
"score": "0.0",
"text": "def check_if_admin\n if not current_user.admin?\n redirect_to \"/\"\n end\n end",
"title": ""
}
] | [
{
"docid": "af0c433f242c7b003a598d51f4245510",
"score": "0.68415654",
"text": "def venue_location\n\t if self.venue_address.blank?\n\t nil\n\t else\n address = ''\n address += self.venue_name + '<br>' unless self.venue_name.blank?\n address += self.venue_address + '<br>' unless self.... |
1feeec299449cc07d08736d67a269e81 | For requesting content to post. | [
{
"docid": "ee91d6878ee748062b044f6c6f5ca7e7",
"score": "0.0",
"text": "def request_image\n\t\tchoices = []\n\n\t\tsearch_dir = Rails.root.join(\"public/fflow/labels\")\n\t\tDir.entries(search_dir).delete_if { |e| e =~ /^\\.+$/ }.keep_if { |e| e =~ /\\w+\\.ya?ml/ }.each do |file|\n\t\t\tchoices << Psych... | [
{
"docid": "305109a5d36bc71f51126ab71776e6b6",
"score": "0.69490916",
"text": "def post_content(post, options = {})\n nil\n end",
"title": ""
},
{
"docid": "61912f487fc887fa61a1c609906ee5bd",
"score": "0.6615908",
"text": "def post\n end",
"title": ""
},
{
"doc... |
26f1ae389c28a9f0dc225a8c933db399 | VM command: return Return from a function Generated pseudo code: endFrame = LCL endFrame is a tmp variable retAddr = (endFrame 5) put the return addr into tmp var ARG = pop() Reposition the return value for the caller SP = ARG + 1 Restore SP of the caller THAT = (endFrame 1) Restore THAT of the caller THIS = (endFrame ... | [
{
"docid": "6fe1d0bc16a3faaf841b6d06b0160800",
"score": "0.7025762",
"text": "def translate_return\n [\n \"\\n// return --line: #{@current_line}\",\n # endFrame = LCL\n '@LCL',\n 'D=M',\n '@endFrame',\n 'M=D',\n # retAddr = *(endFrame - 5)\n '... | [
{
"docid": "f01351c9b3fb25575678753287b2a9db",
"score": "0.7653492",
"text": "def returnf\n @@current_function = \"\"\n asm = \"\"\n \n # FRAME = LCL\n asm += \"@LCL\\n\"\n asm += \"D=M\\n\"\n # RET = *(FRAME-5)\n asm += \"@5\\n\"\n asm += \"A=D-A\\n\"\n asm += \"D=M\\n\"\n... |
52d967c4178a52c7eda324fdb75c10cb | Print out some textual representation | [
{
"docid": "9826d6e808617bb6f275e15fef147c4c",
"score": "0.0",
"text": "def to_s\n str = StringIO.new\n @area.each_with_index do |row, r|\n line = row.map.with_index do |panel, c|\n if panel.nil?\n ' '\n elsif panel.negative?\n '█'\n elsif panel.zero?\n ... | [
{
"docid": "f0a7d6057c766112bebc5933ae773b0c",
"score": "0.7677465",
"text": "def print\n p to_string\n end",
"title": ""
},
{
"docid": "e680de9b8a73f1e9e53daf2ab59fb422",
"score": "0.76107323",
"text": "def print\n\t#\t\tputs to_s\n\t\tend",
"title": ""
},
{
"doc... |
2ce267369f65cd4882afbabbb5dbd49d | TODO: Pull these out into a concern | [
{
"docid": "6b9abf671684979d907b325aa3adc50f",
"score": "0.0",
"text": "def flash_save_success object_name\n flash[:success] = \"Your changes to #{object_name} have been saved.\"\n end",
"title": ""
}
] | [
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.63666975",
"text": "def used; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.63666975",
"text": "def used; end",
"title": ""
},
{
"docid": "6ab77a9219ee157923bc58599ba6aa77",
"... |
2629b04ff65f18de7a3c7cdf12c213eb | Given a list of tweet_ids, gets an associated list of tweet records | [
{
"docid": "830277dfae7ae4a5fc2a8e92a98e8807",
"score": "0.72710437",
"text": "def get_tweet_for_tweet_ids(tweet_ids)\n @select_tweet_query ||= @session.prepare(\"SELECT * FROM tweets WHERE tweet_id=?\")\n \n tweets = []\n tweet_ids.each do |tweet_id|\n result = @session.execute(@select... | [
{
"docid": "6a725eadd472baa5dc32fe6d2cb240d0",
"score": "0.6556094",
"text": "def get_trackers(trackers_ids)\n ::Service::Tracker.eager(:item)\n .where(Sequel.lit('id IN ?', trackers_ids)).all\n end",
"title": ""
},
{
"docid": "e9556cfb642e63ff426d833e6b9c1c24"... |
3b06cb7fb65d1775e23c8d1382df9871 | getter and setter Actions has hair lays egg? = false | [
{
"docid": "9b9ddd78f661d6661a73c539992c3201",
"score": "0.0",
"text": "def walk\n \t\tputs \"Walking...\"\n \tend",
"title": ""
}
] | [
{
"docid": "247aa2d51f365fe24b93317ceb2f9586",
"score": "0.6039674",
"text": "def hungry? # End with a ? for true/false only methods.\r\n @stuff_in_belly <= 2\r\n end",
"title": ""
},
{
"docid": "c6b2fad205de52ec65faf2ca04b7d6bd",
"score": "0.59933126",
"text": "def action\n i... |
a30d9c16a84cfc9fa2f1ba399c0535e0 | Call this on error if the result should be an empty array, but wit the invalid metadata | [
{
"docid": "ba584b0fd2f64cc6af52bd50b084ceb9",
"score": "0.55612063",
"text": "def array\n ErrorArray.new(self)\n end",
"title": ""
}
] | [
{
"docid": "a57535f082f492a5f2d797756a495401",
"score": "0.64181215",
"text": "def loose_errors\n err = []\n err << title\n err << authors\n err << s3_error_uploads\n err << url_error_validating\n\n err.flatten\n end",
"title": ""
},
{
"docid": ... |
012b7d6e53ae012d0afd33d19e2153e5 | First we setup our reader attributes, which are used by the rest of the methods. Then we check for a ticket in the inbound request. If it's present, we branch off to complete the authentication process. If not, we send the request down through the rest of the stack, to the application, catching the response, coming bac... | [
{
"docid": "3b2d2ae9fd9176baa9da76f7bd8118d8",
"score": "0.5390435",
"text": "def call(env)\n @session = Rack::Webauth::Session.new(env)\n @request = Rack::Webauth::Request.new(env, config)\n if request.auth_needed?\n complete\n else\n status, headers, body = @app.call(... | [
{
"docid": "092b4077c74f99f2b8b202e9baf62f86",
"score": "0.6473544",
"text": "def call! env\n @request = Rack::Request.new env\n\n return app.call(env) if authenticated?\n\n service_url = request_url_without_ticket\n cas_login_url = cas_client.add_service_to_login_url(service_url)\n\... |
3abb20758a1e00ed1e50db58dd247713 | When called with no arguments, it runs this app instance, executing whatever command was invoked. However, this method can be used to invoke another command explicitly, by providing its name as an argument, along with an optional hash. This can only be done while the main app logic is running, making it possible for a ... | [
{
"docid": "bc432661508bf75994ca7d43c00d63c4",
"score": "0.69715506",
"text": "def run(command_name = nil, hash = nil)\n if command_name\n raise Copt::Error, 'Cannot run commands if app is not running' unless @status == :running\n hash ||= {}\n push(command_name, hash)\n e... | [
{
"docid": "607f9f612d0a1dae647483cc4a741ebc",
"score": "0.67108953",
"text": "def run\n\t\t\tbegin\n\t\t\t\teval \"Hawknee::Cli::Command::#{@command}.new.#{@subcommand}\"\n\t\t\trescue NameError, NoMethodError\n\t\t\t\traise InvalidCommand\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "ad... |
7000c413f6fb0a5a7d4fd7b21dfda9c3 | Looks for user by username and email | [
{
"docid": "1d43c736e269e7699b3b589e4ff7d38b",
"score": "0.0",
"text": "def authorize login, email\n find_by_user_name_and_email login, email\n end",
"title": ""
}
] | [
{
"docid": "7b351f797fb18cb2ef45156b58916202",
"score": "0.78762555",
"text": "def find_by_email(email)\n if email.strip.length > 0\n result = Ripple::client.search('users', \"email:#{email.downcase}\")\n if result['response']['numFound'] == 1\n return User.find(result['respo... |
bdd9bb096eea58b107ddfdd2f0d67012 | deleted variants should be accessible as well | [
{
"docid": "a220a555331cc8d161bacf1fc54ceef7",
"score": "0.622599",
"text": "def variant\n Variant.unscoped { super }\n end",
"title": ""
}
] | [
{
"docid": "4a1e226a0d3a90e2e5e648065e10cf75",
"score": "0.6885779",
"text": "def deleted; end",
"title": ""
},
{
"docid": "1b769c32efd02c70d8d9beec16b4066c",
"score": "0.66065764",
"text": "def delete\n self.class.delete_variant_by_id(self.id)\n end",
"title": ""
},
... |
831ecc1f1c6707030243969a21625d1e | Was the payment successful? | [
{
"docid": "0e1180abd9ee43d01f450289f75fcd26",
"score": "0.0",
"text": "def successful?\n status == 'Success'\n end",
"title": ""
}
] | [
{
"docid": "e749a22b9852e30afa37188e35496b3d",
"score": "0.8750676",
"text": "def guard_payment_successful\n true\n end",
"title": ""
},
{
"docid": "d4b2bf8b5df894250711c8a30abda86e",
"score": "0.8023029",
"text": "def payment_success?(amount)\n\n if credit_card.valid?\n ... |
5014b1b3b9eaa5af19d061336f378cf7 | environment should be www or test this method ensures that | [
{
"docid": "dcfd5d36adb059ff668f405feb0714e1",
"score": "0.6059476",
"text": "def sanitize_environment(environment = nil)\n environment.strip! unless environment == nil\n environment.downcase! unless environment == nil\n environment = \"www\" if environment != \"www\" and environment != \"te... | [
{
"docid": "1791ecb338b38d31a3f5eb8537a4bc7f",
"score": "0.6700176",
"text": "def test? ; @app.options[:env] == :test ; end",
"title": ""
},
{
"docid": "44ebea0f55fa232e9eef1d45c813416e",
"score": "0.6648943",
"text": "def test_system?\n rack_env?(:test) && pegasus_hostname == \... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "3894c19909f103c9f455d96cfa9521d3",
"score": "0.0",
"text": "def plant_params\n params.require(:plant).permit(:garden_id, :plant_image, :family, :variety, :seed_source, :quantity, :notes, :plant_date)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.6978086",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6780264",
"text": "def strong_params\n params.requi... |
3261a7750c51ae48bc5ce2f9a5872282 | 0 [ Measure::SupplementalData ] | [
{
"docid": "61f9b8e90f5e7b056c931b8c465702a9",
"score": "0.5236784",
"text": "def resourceType\n 'Measure'\n end",
"title": ""
}
] | [
{
"docid": "3cb41bcdc23e9fd59b5caba679cc0435",
"score": "0.6186521",
"text": "def calculate_supplemental_data_elements\n\n match = {'value.measure_id' => @measure_id,\n 'value.sub_id' => @sub_id,\n 'value.effective_date' => @parameter_values['effective_... |
a9c9462c60827b2eeb889e22ecee24d3 | Destroy temp password and rollback current simulation run | [
{
"docid": "2b37caecdd479de6ce803118f58f990b",
"score": "0.69256085",
"text": "def clean_up_database!\n destroy_temp_password!\n\n Scalarm::MongoLock.mutex(\"experiment-#{self.experiment_id}-simulation-complete\") do\n rollback_current_simulation_run!\n end\n end",
"title": ""
}
] | [
{
"docid": "f6ca976d5c7a0ce026ab70250bcddfb1",
"score": "0.66524845",
"text": "def ras_teardown_remove_temp(host)\n command = \"rm -rf #{RAS_TMP_WORK_DIR}\"\n\n puts \"Removing temp work directory:\"\n puts command\n puts\n on host, command\n end",
"title": ""
},
{
"docid": "... |
94647778cd32700b46cd5b6504ce5091 | DELETE /articles/1 DELETE /articles/1.json | [
{
"docid": "c0b4a2a2955d217c8a0363803231496d",
"score": "0.0",
"text": "def destroy\n @article.destroy\n respond_to do |format|\n format.html { redirect_to articles_url, notice: 'Zangeが消去されました。' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "69841214643e03d2e662b4f05e2ebf37",
"score": "0.7966318",
"text": "def destroy\n @articles1.destroy\n respond_to do |format|\n format.html { redirect_to articles1s_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b35eeffb872cea7... |
b3cef33f31d73bfa26750cf90d3b2a51 | Counts the total size of the collection of subobjects in the cached object, if the found collection turns out to not be a collection, then it will return nil. | [
{
"docid": "35d09baff60f227ceee3d455f68d90e4",
"score": "0.6972635",
"text": "def wizard_page_objects_size(wizard_cached_object, overrides)\n sub_object_attributes = wizard_sub_object_attributes(overrides)\n return if sub_object_attributes.blank?\n\n all_objects = wizard_all_objects_array(wizar... | [
{
"docid": "9a238c0a93dd403e80d1585fdcb5d4de",
"score": "0.70401984",
"text": "def number_of_elements_in_collection\n # collection here refers to the collection that is set with the initialize method\n # collection() is a private accessor method at the bottom of this class that accesses @collectio... |
614621f9227b7a8356777f3b3f568ec3 | GET /trailers/new GET /trailers/new.xml | [
{
"docid": "f39bc883d708ade907a25f065d7e3a87",
"score": "0.63613665",
"text": "def new\n @trailer = Trailer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @trailer }\n end\n end",
"title": ""
}
] | [
{
"docid": "c6eaceb78d2bc94e0e60a773ac8aa21f",
"score": "0.7094025",
"text": "def new\n @trail = Trail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trail }\n end\n end",
"title": ""
},
{
"docid": "c6eaceb78d2bc94e0e60a773ac8aa2... |