query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
581b8a0e010f8c919f1dcec1c147724a | PATCH/PUT /prodottos/1 PATCH/PUT /prodottos/1.json | [
{
"docid": "a16d6b35382fa44776a8c54d3fc65416",
"score": "0.6899658",
"text": "def update\n respond_to do |format|\n if @prodotto.update(prodotto_params)\n format.html { redirect_to @prodotto, notice: 'Prodotto was successfully updated.' }\n format.json { render :show, status: :ok, ... | [
{
"docid": "06c9489fed5a81c05d9eee2dacb5b8ee",
"score": "0.7012897",
"text": "def update\n if @propietario.update(propietario_params)\n render json: @propietario\n else\n render json: @propietario.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid... |
c0b983f8fe63916faa0cc794c188c810 | Parse the SOAP response Technique inspired by the Paypal Gateway | [
{
"docid": "712244bc22e53ee4f113067e6d05d6a6",
"score": "0.588662",
"text": "def parse(xml)\n reply = {}\n\n begin\n xml = REXML::Document.new(xml)\n\n root = REXML::XPath.first(xml, '//QGWRequest/ResponseSummary')\n parse_element(reply, root)\n reply[:r... | [
{
"docid": "41ab2af8bfa57b639fbd7c103a249c0f",
"score": "0.69554776",
"text": "def parse_soap_response(response) # :nodoc:\n doc = Nokogiri::XML(response)\n doc.remove_namespaces!\n\n result_params = {}\n\n {:doctype => 'doctype', :uri => 'uri', :charset => 'charset',\n :checke... |
7aaca2f9ceb2ffbc1fd00b913949b813 | This allows you to modify the application's middlewares from Engines. All operations you run on the app_middleware will be replayed on the application once it is defined and the default_middlewares are created | [
{
"docid": "570bf666620d3ba800707357df3a8958",
"score": "0.65189344",
"text": "def app_middleware\n @@app_middleware ||= Rails::Configuration::MiddlewareStackProxy.new\n end",
"title": ""
}
] | [
{
"docid": "80331f8646e061091165ef80f291244b",
"score": "0.7209632",
"text": "def middlewares; end",
"title": ""
},
{
"docid": "63e6fcf2a34d536960f67e1e151598b0",
"score": "0.71468854",
"text": "def app_middleware; end",
"title": ""
},
{
"docid": "1913636d5ab9c77f7a78fe95... |
7d1df65812682828176d3c7787f4291f | Gets Connection information Writes it to the DB | [
{
"docid": "7196eac60df4969086054cc1a5ffae87",
"score": "0.0",
"text": "def get_connections\n \n @connections_buffer = []\n @recommendations_buffer = []\n @recommender_identity = {}\n @countdown = ConnectionHandler.countdown(2) # Currently only making exactly 2 calls\n\n EventMachine.... | [
{
"docid": "9cb4a4c84ebe1be131642b6e670c941c",
"score": "0.68090147",
"text": "def connection\n @db = Connection.client\nend",
"title": ""
},
{
"docid": "5c20d2132186c3e96f8b6833acf32ae3",
"score": "0.675958",
"text": "def db_info\n @conn.query({url_path: \"#{database}\", metho... |
24b87ccaced63957dee2b23a087cd04d | callseq: Kconv.toutf8(str) > string Convert str to UTF8 Note This method decode MIME encoded string and convert halfwidth katakana to fullwidth katakana. If you don't want it, use NKF.nkf('wxm0', str). | [
{
"docid": "a43b880dc1be4b6da96776d3e91873ae",
"score": "0.77158505",
"text": "def toutf8(str)\n ::NKF::nkf('-wm', str)\n end",
"title": ""
}
] | [
{
"docid": "b3341e441676db28c9cd8b989d37f80c",
"score": "0.8075774",
"text": "def make_utf8(str)\n return Kconv.toutf8(str.strip)\n end",
"title": ""
},
{
"docid": "b352b8110fe0dcf6f7feb500e379840a",
"score": "0.7412787",
"text": "def toutf8; Kconv.toutf8(self) end",
"title":... |
2c466620283e29e85a6d2132778bc3ab | required for boundary MD5 hashing | [
{
"docid": "1198c5600fb79dac93341657a3806ea2",
"score": "0.0",
"text": "def get_file_header(file_name, boundary)\n head = \"--#{boundary}\" + CRLF\n head += \"Content-Disposition: form-data; name=\\\"new_files[]\\\"; filename=\\\"#{file_name}\\\"\" + CRLF\n head += \"Content-Type: application/x... | [
{
"docid": "f00d342ac53bd30234b0ef1aae864a5f",
"score": "0.6731537",
"text": "def md5\n end",
"title": ""
},
{
"docid": "75f7154e09b2cc81f606020d57ab83ff",
"score": "0.6570987",
"text": "def md5_hash\n @md5_hash ||= Digest::MD5.base64digest content\n end",
"title": ""
... |
3f95fd99a5beab6e36eb3612b513dcdb | Art explore_category_art GET /explore/categories/:category_id/art | [
{
"docid": "0dcf7f0db8005037d482daa6425c3370",
"score": "0.6578573",
"text": "def art\n\t\tmeta_category(:category => I18n.t('views.utilities.menu.art'))\n\t\t@activities = PublicActivity::Activity.order(\"created_at desc\").where(trackable_type: [\"Majorpost\",\"Campaign\"], :published => true,category... | [
{
"docid": "08a8bd4939185cc8b18f98f5980b5e99",
"score": "0.68503326",
"text": "def set_artcat\n @artcat = Artcat.find(params[:id])\n end",
"title": ""
},
{
"docid": "3266083405b1b0950600a8ff12185bb5",
"score": "0.67777956",
"text": "def index\n if params[:category]\n ... |
af352182515c3be99931ef084dc051f4 | DELETE /lists/1 DELETE /lists/1.json | [
{
"docid": "0a10002a83f2194e6bf8faf8eaa26b00",
"score": "0.7475205",
"text": "def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'List was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "cf3db25213818665ad892b671e824ec4",
"score": "0.8048922",
"text": "def delete_list(list_id)\n return base_uri('delete', 'lists/' + list_id)\n end",
"title": ""
},
{
"docid": "00eded1c246f6ba932df779edfa05888",
"score": "0.7885242",
"text": "def delete(list_id)\n d... |
75b85731edba5a15667ccfe5c027dff0 | MatchData[] mtch[i] => obj mtch[start, length] => array mtch[range] => array Match Reference+MatchData+ acts as an array, and may be accessed using the normal array indexing techniques. _mtch_[0] is equivalent to the special variable +$&+, and returns the entire matched string. _mtch_[1], _mtch_[2], and so on return th... | [
{
"docid": "9228257fc3ec37359e2436c7faad510c",
"score": "0.0",
"text": "def [](arg0, arg1, *rest)\n end",
"title": ""
}
] | [
{
"docid": "98131226aa7b50922b264c811ba52183",
"score": "0.61092186",
"text": "def matchdata\n @matchdata\n end",
"title": ""
},
{
"docid": "5f5c0c0ec076b0e2bccbcb997c8cd181",
"score": "0.59529865",
"text": "def each_match_range(range, regex); end",
"title": ""
},
{
... |
1161d16f7194d493a6f7f99727960e20 | Confirm that the use who is going to edit the profit is corrent | [
{
"docid": "e0db0c571867157a0b79a4e9a3f11ac3",
"score": "0.0",
"text": "def correct_user\n @user = User.find_by(id: params[:id])\n redirect_to root_url unless current_user?(@user) || current_user.admin?\n end",
"title": ""
}
] | [
{
"docid": "0fdb588cbb7a2164e8a54e0f1cf3b3fa",
"score": "0.68479735",
"text": "def confirm_guarantee_return\n @guarantee_return = GuaranteeReturn.find_by_id params[:guarantee_return_id]\n # add some defensive programming.. current user has role admin, and current_user is indeed belongs to the comp... |
1cf712be24164e8a11f2129aac8f1944 | double splat holds the keyword arguments like a hash keyed by the symbols | [
{
"docid": "88835912e5108870e8fc59ac5442c341",
"score": "0.0",
"text": "def initialize(**keyword_args)\n\t\t\tKEYS.each { |key|\n\t\t\t\tval=keyword_args[key]\n\t\t\t\tself[key]=val\n\t\t\t\tinstance_variable_set(\"@#{key}\", val)\n\t\t\t}\n\t\tend",
"title": ""
}
] | [
{
"docid": "73c3f3247d5799c4cf3e458e915e1263",
"score": "0.79125226",
"text": "def double_splat(**hash)\n p hash\nend",
"title": ""
},
{
"docid": "9b972b7e4ec15b1bedfcdf009908e72c",
"score": "0.7600513",
"text": "def splatting *params\n params\nend",
"title": ""
},
{
"do... |
51d93104c4f8eb0cc840bad7a3355f7c | callseq: variance() > NMatrix variance(dimen) > NMatrix Calculates the sample variance along the specified dimension. This will force integer types to float64 dtype. | [
{
"docid": "bb117f6b9aa148f42ac254c4c70b9cdd",
"score": "0.84150636",
"text": "def variance(dimen=0)\n reduce_dtype = nil\n if integer_dtype? then\n reduce_dtype = :float64\n end\n m = mean(dimen)\n inject_rank(dimen, 0.0, reduce_dtype) do |var, sub_mat|\n var + (m - sub_mat)*(m... | [
{
"docid": "ff2baa1538017de1556ca246d7c83675",
"score": "0.78074527",
"text": "def variance(dim=0)\n m = mean(dim)\n reduce_along_dim(dim, 0.0) do |var, sub_mat|\n var + (m - sub_mat)*(m - sub_mat)/(shape[dim]-1)\n end\n end",
"title": ""
},
{
"docid": "443b0c1489a7dfabe8f5c25... |
35bf3ad20ce1862d3162a53ab9620e95 | Start the next tiebreak game | [
{
"docid": "9212453a9b5961240d3939367d34ad48",
"score": "0.7826996",
"text": "def tiebreak\n start_game_kind :tiebreak\n end",
"title": ""
}
] | [
{
"docid": "97c6a2adf103e07e1c7df8e7ced32971",
"score": "0.73671913",
"text": "def start_game\n 5.times do \n turn\n end\n end",
"title": ""
},
{
"docid": "f1772b10ed0b52c2ed7f8fbe8456d285",
"score": "0.72436947",
"text": "def play\n menu\n create_pl... |
5938f85fa2f6034597db76720cf2dae9 | called by Puppet to restart the service | [
{
"docid": "081b685d852a4b6fed6797a958da2fbd",
"score": "0.74109066",
"text": "def restart\n debug \"Call 'restart' for Pacemaker service '#{name}' on node '#{hostname}'\"\n if pacemaker_options[:restart_only_if_local] and not primitive_is_running? name, hostname\n info \"Pacemaker service '#... | [
{
"docid": "9f244649879433fc0957b4c083fadea8",
"score": "0.8139626",
"text": "def restart_service\n service 'consul-haproxy' do\n action :restart\n end\nend",
"title": ""
},
{
"docid": "408d1abacc8b8acaba213113cc640cf3",
"score": "0.7689557",
"text": "def restart_container\n ... |
4e0774c17838fae1c30900f790ff162c | Reverse It (Part 2) | [
{
"docid": "2fb5ecd834a7719594d98d53d7df5d97",
"score": "0.0",
"text": "def reverse_words(string)\n \n words = string.split\n reversed=[]\n words.each do |word| \n if word.length > 4\n reversed.push word.reverse \n else \n reversed.push word\n end\n end\n reversed.join(\" \")\ne... | [
{
"docid": "14df44d253b409d8e7b707ca11e4a526",
"score": "0.8202288",
"text": "def reverse!\n `var length = self.length / 2, tmp;\n\n for (var i = 0; i < length; i++) {\n tmp = self[i];\n self[i] = self[self.length - (i + 1)];\n self[self.length - (i + 1)] = tmp;\n }\n\n return... |
47ebc97288ce42d099cfaf1f5e59f107 | PATCH/PUT /documents/1 PATCH/PUT /documents/1.json | [
{
"docid": "6a49ad5e388eb1112e872f3529f18c61",
"score": "0.0",
"text": "def update\n\n if get_case\n #@document = @case.documents.create(document_params)\n path_documents = case_documents_path\n else\n #@document = @document(document_params)\n path_documents = documents_path\n... | [
{
"docid": "2d32a6bb6396297f25f2a914263ae5c9",
"score": "0.692375",
"text": "def update\n respond_with Document.find(params[:id]).update_attributes(params[:doc])\n end",
"title": ""
},
{
"docid": "165ffbf60f9cc0af0fb88bfb9979e5f3",
"score": "0.68756926",
"te... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "e70187eaf9fc9b6be32df5e3e912a364",
"score": "0.0",
"text": "def set_inventory\n @inventory = Inventory.find(params[:id]) unless Inventory.find(params[:id]).survivor.infected?\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... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "55c334e547d87ed12ef6d3cee7c12255",
"score": "0.0",
"text": "def style_params\n params.require(:style).permit(:name, :description)\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... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "0883d561c10e62c659a2a2d773daff11",
"score": "0.0",
"text": "def post_params\n params.require(:post).permit(:title, :image, :date, :text, :post_type_id, :preview)\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... |
a404b592aa3970b53af653edbccc4dec | GET /catalog/devices GET /catalog/devices.json | [
{
"docid": "78292e7207f7b6f945151c10bbb6d2e6",
"score": "0.7379039",
"text": "def index\n @catalog_devices = Catalog::Device.all\n end",
"title": ""
}
] | [
{
"docid": "fff865b72acdc7758482dc1ed89f472d",
"score": "0.7724582",
"text": "def devices(params={})\n res = @client.get(\"#{path}/devices\", params)\n\n res.json[\"devices\"].map{ |atts| ::M2X::Client::Device.new(@client, atts) } if res.success?\n end",
"title": ""
},
{
"docid": "3ea... |
a0ab1aed0fae7dec17c8821e508e60c7 | Append an error to the given attribute for a resource. TODO: consider coercing attribute_name `.to_s` too. | [
{
"docid": "5b408c07894e2011c3fd51f946678301",
"score": "0.8484988",
"text": "def append_resource_error(resource_namespace, resource_uid, attribute_name, error)\n resource_errors[resource_namespace][resource_uid.to_s][attribute_name] << error\n end",
"title": ""
}
] | [
{
"docid": "e198a890f9905d992107a80355288176",
"score": "0.7975834",
"text": "def add_error(resource, message, attribute_name = :general)\n resource.errors.add(attribute_name, message)\n self\n end",
"title": ""
},
{
"docid": "b33c70bad612fa51ca6c486a3b3f532c",
"score"... |
9af3d349bbc5a7e783fd8c1e65e21164 | Switches between the css classnames prefixes depending on current RightJS version | [
{
"docid": "564aef8f118277210b2b5fdf55842aac",
"score": "0.7083739",
"text": "def css_prefix\n RightRails::Config.rightjs_version < 2 ? 'right' : 'rui'\n end",
"title": ""
}
] | [
{
"docid": "83a0e4b7bd737113b351bcdf85ab7b6d",
"score": "0.6598723",
"text": "def component_css_class\n component_class_name_string.underscore.dasherize.downcase\n end",
"title": ""
},
{
"docid": "a0b992e2d0e46a03d2284fe93a2978b9",
"score": "0.6521243",
"text": "def c... |
857c89b77d74d4590008211c3247b620 | This methods gets composite status for processables before given stage | [
{
"docid": "c4ef52f8ed47553c966dde52602d4a2c",
"score": "0.64307696",
"text": "def status_for_prior_stage_position(position)\n strong_memoize(\"status_for_prior_stage_position_#{position}\") do\n stage_statuses = all_statuses_grouped_by_stage_position\n .select { |stage_... | [
{
"docid": "f140116656825872d470b2bcac13cca9",
"score": "0.638146",
"text": "def get_cookbook_stage_status(cookbook_build,step_name)\n res = nil\n\n JSON.parse(cookbook_build.build_job.stages).each do |stage|\n res = stage['status'] if stage['name'] == step_name\n end if cookbook_build.bui... |
d20315c9dade363f12b858e2b75e7e63 | Internal: Based on color, determines if the pawn has moved from its original position. Returns true if this is the first move, false if it has already moved. | [
{
"docid": "9b064637b72c2c9164573a2a262e13fd",
"score": "0.7451105",
"text": "def first_move?(position)\n if color == :black then position.row == 6 else position.row == 1 end\n end",
"title": ""
}
] | [
{
"docid": "fec42a3fcc05cedcdf8e28e77ee39636",
"score": "0.8059467",
"text": "def first_move?(loc)\n return true if (@color == :white && loc[1] == 1) || (@color == :black && loc[1] == 6)\n false\n end",
"title": ""
},
{
"docid": "30f114368d97562be29115854c8d22a9",
"score": "... |
767cf6725b89c28092663a33ce423d20 | It returns available lases in this virtual network. +assigned_user+ id of user who owns lease | [
{
"docid": "7f50832e798cdf7b9e2bbab8e8d35ab9",
"score": "0.798004",
"text": "def find_available_leases(assigned_user=-1)\n res = Lease.find(\"vnetid=#{@id} AND used=0 AND assigned_to=-1\")\n if res.empty? && assigned_user != -1\n res = Lease.find(\"vnetid=#{@id} AND used=0 AND ass... | [
{
"docid": "cda20cc1683f729089fca440e4f2bcda",
"score": "0.5859183",
"text": "def agent(assigned_user=\"\")\n response = @api.get('/users.json')\n\n users = {}\n response['users'].each { |u| users[u['name']] = u['id'] }\n users[\"#{assigned_user}\"]\n end",
"title": ""
},
... |
f2deeb834b3c823127d8969e6e4fa7f5 | Remove a detail from a booking | [
{
"docid": "6f033a9ad26afe33ed87b63d83feb137",
"score": "0.63191164",
"text": "def remove_booking_detail(booking_id, bookingdetail_id, opts = {})\n data, _status_code, _headers = remove_booking_detail_with_http_info(booking_id, bookingdetail_id, opts)\n return data\n end",
"title": ""
... | [
{
"docid": "2e0fccff6d391e385b6ac50084a5bdb8",
"score": "0.7231531",
"text": "def destroy\n @booking.destroy\n end",
"title": ""
},
{
"docid": "2e0fccff6d391e385b6ac50084a5bdb8",
"score": "0.7231531",
"text": "def destroy\n @booking.destroy\n end",
"title": ""
},
{
... |
45c4be194fa457eb98a3e58e3fcb3924 | Sets the simulator as active and all others as inactive. | [
{
"docid": "630a745cbd1c17ee22b31b64a787d5bd",
"score": "0.77875286",
"text": "def activate!\n self.class.where(active: true).each do |simulator|\n simulator.update!(active: false)\n end\n update!(active: true)\n end",
"title": ""
}
] | [
{
"docid": "d87284760f35341cf47df9644d06f115",
"score": "0.6228223",
"text": "def set_unactive\n self.active = false\n end",
"title": ""
},
{
"docid": "72898b3ad6e1cb4d493443d1325af026",
"score": "0.6160976",
"text": "def set_active(script)\n send_command('SETACTIVE', sieve_na... |
bfba909b7a327e7141d6d53bb56db14d | DELETE /endpoints/1 DELETE /endpoints/1.json | [
{
"docid": "97f5e325aaa9affae5115a53aa85820b",
"score": "0.70600224",
"text": "def destroy\n @endpoint.destroy\n respond_to do |format|\n format.html { redirect_to endpoints_url }\n format.json { head :no_content }\n format.js\n end\n end",
"title": ""
}
] | [
{
"docid": "a6660f8f62027412929d7b78d182281c",
"score": "0.80140924",
"text": "def delete endpoint\n do_request :delete, endpoint\n end",
"title": ""
},
{
"docid": "8f06e8310f316354874315f66071a977",
"score": "0.77572656",
"text": "def delete()\n @client.make_request(:de... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "0749b1d7ca6c9d17b3eb8d54f6ebd7cf",
"score": "0.0",
"text": "def field_service_group_params\n params.require(:field_service_group).permit(:name, :location)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74968386",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6958337",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
80e6eb78bca75d69ec658660ef0d7df3 | Returns the librarian command line options merging the options from all cofniguration files | [
{
"docid": "19ecae0622cef3cbd243047029c344d0",
"score": "0.60308903",
"text": "def librarian_options(component, system_config)\n config = system_config.platform_config(component.platform)\n options = config[\"library_options\"].split(\" \")\n # output file\n options << \"#{config[\"l... | [
{
"docid": "58e8880c6204bb74a9892f6b0fd29355",
"score": "0.66978633",
"text": "def option_list\n result = @options.dup\n result << \"-o\" << @rdoc_dir\n result << \"--main\" << main if main\n result << \"--markup\" << markup if markup\n result << \"--title\" << title ... |
f2c2758d8a1b65653c70c3c0ce698495 | It's also an instance method... | [
{
"docid": "8e3a42388bfc759cfde1d754bd67f5b6",
"score": "0.0",
"text": "def abort_on_exception=(val)\n @abort_on_exception = val\n end",
"title": ""
}
] | [
{
"docid": "17a07ff12e4250e34d093e72e3182123",
"score": "0.80102015",
"text": "def instance_method\n end",
"title": ""
},
{
"docid": "17a07ff12e4250e34d093e72e3182123",
"score": "0.80102015",
"text": "def instance_method\n end",
"title": ""
},
{
"docid": "dc23e16909... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "dddee4079d134b7d592710999b9b9d08",
"score": "0.0",
"text": "def set_master_memorial\n @master_memorial = Master::Memorial.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.61637366",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.60446453",
"text": "def action_hoo... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "354b4007a4f040f405f7d4610b0dbb4f",
"score": "0.0",
"text": "def order_params\n params.require(:order).permit(:total_due_calc, :supplier_id, :quote_id)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.requ... |
e236518d5999aa3253e5a51127b57778 | Renders API docs for a Sass function. The function's name is parsed from the signature. The API description is passed as a Markdown block. If `returns` is passed, it's included as the function's return type. Multiple signatures may be passed, in which case they're all included in sequence. | [
{
"docid": "68d4188ace4543714e38f6c5d241db58",
"score": "0.75256014",
"text": "def function(*signatures, returns: nil)\n names = Set.new\n highlighted_signatures = signatures.map do |signature|\n name = signature.split(\"(\").first\n html = Nokogiri::HTML(_render_markdown(<<MARKDOWN))\n`... | [
{
"docid": "ae331176ac62c3d263cab184b7fcfc55",
"score": "0.6462667",
"text": "def generate_function( name, description, parameters, formatter, display_name_and_description = false ) \n \n #\n # Output the header.\n \n formatter.comment_block do\n for... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "b55bb0bcca931a39440a4c6a998be283",
"score": "0.0",
"text": "def set_order\n @order = Order.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... |
da86b051cda67f96f997655fffdc344a | Defines a Module or Class attribute setter stored in Thread.current. | [
{
"docid": "5f9e95180417aded41f4728d104c2350",
"score": "0.6558633",
"text": "def mattr_setter_thread *names\n opts = Hash === names[-1] ? names.pop : EMPTY_HASH\n\n transform = opts[:setter_transform]\n transform = \"__val = (#{transform})\" if transform\n\n names.each do | name |\n... | [
{
"docid": "74354316bbf85965697c97256c678d57",
"score": "0.6304568",
"text": "def attr_threaded_accessor(*method_names)\n method_names.each do |meth|\n self.send(:define_method, meth, proc { Thread.current[meth] })\n meth2 = meth.to_s.gsub(/$/, '=').to_sym\n self.... |
e561d03984e54d7b5938003ca58b62ae | GET /firms/new GET /firms/new.xml | [
{
"docid": "0c69c6fecbbf5ba928e179e262f726da",
"score": "0.6853382",
"text": "def new\n @firm = @klass.new\n\n respond_to do |wants|\n wants.html # new.html.erb\n wants.xml { render :xml => @firm }\n end\n end",
"title": ""
}
] | [
{
"docid": "161da020e756114b40b9240b596e5b6b",
"score": "0.74567485",
"text": "def new\n @firm = Firm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @firm }\n end\n end",
"title": ""
},
{
"docid": "735010f2693696196854df45823338... |
9d0eda6f92266c93f28520b798a2ad32 | Delete directory where file is located | [
{
"docid": "29d89f52d784eaf2faa4b6a2872228f1",
"score": "0.0",
"text": "def delete_code(location)\n unless location.nil?\n pathname = Pathname.new(location)\n unless pathname.directory?\n location = pathname.dirname\n end\n FileUtils.rm_rf(location) if pathname.exist?\n ... | [
{
"docid": "72a88981d244f8909265177c4399e3fd",
"score": "0.8505499",
"text": "def delete_file\n return if path.nil? || !File.exist?(path)\n\n File.delete(path)\n\n pn = Pathname.new(path)\n FileUtils.remove_dir(pn.dirname, force: true)\n end",
"title": ""
},
{
"docid": "3ed21ed9... |
2ed03e6f1a34cf9d0c96d2f8b3cf3b93 | Create Plan Create a new plan for an existing order | [
{
"docid": "5b5a59f85c98a10f8427230b63f6b255",
"score": "0.6572141",
"text": "def create_plan(plan_request, opts = {})\n data, _status_code, _headers = create_plan_with_http_info(plan_request, opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "f853bc95a50a1f388ebadd3f2d500b9c",
"score": "0.7678883",
"text": "def create_plan(options = {})\n build_response(make_request(:post, url: 'plans', options: options))\n end",
"title": ""
},
{
"docid": "12177af34efc990bc4f12f80992fe720",
"score": "0.75475067",
"text... |
aaa572832e7dd92122b3c0aa586c296b | Returns visitor into initial state. | [
{
"docid": "007f8eb466730a8873999c435c5950e5",
"score": "0.0",
"text": "def reset\n super\n\n @distance_map = Hash.new(INFINITY)\n @parents_map = {}\n end",
"title": ""
}
] | [
{
"docid": "704fa7bf7227b96e936aebb3a29894be",
"score": "0.840071",
"text": "def visitor\n @visitor ||= Visitor.new initial\n end",
"title": ""
},
{
"docid": "40775923dde3157069513df14e55cf90",
"score": "0.68827385",
"text": "def visit visitor\n visitor.visit self\n ... |
8b0655ee1dcab3357dc322e868c9446e | Search helper function for the case of a user searching by ingredients. Entry: The params from the search form. Exit: Returns an array of recipes as a result set. | [
{
"docid": "30d2ea03e094dd2f659a4db14381442a",
"score": "0.6955297",
"text": "def ingredientsearch\n @searchedingredients = params[:searchingredients].split(/, */)\n @searchtest = []\n @searchedingredients.each do |si|\n @searchtest.push(si.downcase)\n end\n \n Ingredient.where(\"... | [
{
"docid": "1e1ac0c6a9201c05ccf596a078860b66",
"score": "0.7479695",
"text": "def authoringredientrecipesearch\n @query = params[:search]\n @searchedingredients = params[:searchingredients].split(/, */)\n @searchtest = []\n @searchedingredients.each do |si|\n @searchtest.push(si.downcas... |
ff2671467e9c59717844a63d78398e1c | Note: You should never mutate an array or hash returned by normalize when `wrap` is `false`. | [
{
"docid": "632e66aea80b993a0398274fc6eb1f90",
"score": "0.6246605",
"text": "def normalize(value, scope: nil, wrap: true)\n value = resolve_value(value, scope: scope)\n\n case value\n when ::String\n utf8(value)\n when ::Symbol\n utf8(value.to_s.freeze)\n ... | [
{
"docid": "c2a38727cf07e9f1a621eda9eced5598",
"score": "0.71065515",
"text": "def normalize!; end",
"title": ""
},
{
"docid": "c2a38727cf07e9f1a621eda9eced5598",
"score": "0.71065515",
"text": "def normalize!; end",
"title": ""
},
{
"docid": "c2a38727cf07e9f1a621eda9eced... |
1de21bdadcd73402dd0ce0514a8def47 | DELETE /respuesta_comentarios/1 DELETE /respuesta_comentarios/1.json | [
{
"docid": "fe4751408bd2ea62955f9aeb94b67bea",
"score": "0.7682609",
"text": "def destroy\n @respuesta_comentario.destroy\n respond_to do |format|\n format.html { redirect_to respuesta_comentarios_url, notice: 'Respuesta comentario was successfully destroyed.' }\n format.json { head :no_... | [
{
"docid": "0879ade66bdab83e51e8da609fb6b45b",
"score": "0.75561994",
"text": "def destroy\n @resposta = Resposta.find(params[:id])\n @resposta.destroy\n\n respond_to do |format|\n format.html { redirect_to respostas_url }\n format.json { head :no_content }\n end\n end",
"titl... |
487bb729a712f21576a913307389e7b2 | StringIOgetbyte strio.getc > fixnum or nil See IOgetc. | [
{
"docid": "cc248a3ffdfc6730589c36ae97644230",
"score": "0.58685845",
"text": "def getbyte\n end",
"title": ""
}
] | [
{
"docid": "4940b586f77790d1eff0301388b59c82",
"score": "0.712795",
"text": "def getc\n return nil if @read >= @size\n ret = @io.getc\n @read += 1 if ret\n ret\n end",
"title": ""
},
{
"docid": "d43aaed3096562d391400dcd130ed16b",
"score": "0.6978573",
... |
ea4a030da777e667e33ce3067e57df93 | After an insstance of this class was created[create], the parser is ready to get the files (array of strings or string). Already found targets can be passed over optionally. | [
{
"docid": "e56a4e95703999c72e4cacd8752b3088",
"score": "0.63634735",
"text": "def parse_files(files,targets = [])\n self.targets = targets\n files.each do |file|\n self.process(RubyParser.new.parse(File.read(file), file))\n end\n end",
"title": ""
}
] | [
{
"docid": "cb24a2a4ddb52f4dfa82d6c3538133a6",
"score": "0.6317656",
"text": "def parse_targets\n requested_targets = options.fetch(:targets, [])\n # If no targets are specified and empty targets are allowed return with an empty list.\n # It will be up to the validator (and whatever... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "e7989f9ba2b323cc0af87cf5dd7cb84f",
"score": "0.0",
"text": "def station_type_params\n params.require(:station_type).permit(:typename)\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"... |
7c058811ad5216a58628dccc93b522c2 | Called by Associations::RDFreplace to add data to this resource represenation | [
{
"docid": "5f21bac589d84ecf888f7a7ce49bd0d9",
"score": "0.0",
"text": "def insert(vals)\n _, pred, val = vals\n k = reflection(pred)\n if @hash[k].is_a?(Array)\n set_value(k, @hash[k] << val)\n else\n set_value(k, [val])\n end\n end",
"title... | [
{
"docid": "9f60d2d5c1a459d22f4b633de793f6b6",
"score": "0.63475436",
"text": "def add_resource(*resource)\n add_resource(*resource[0..-2]) if resource.length > 1\n resource = resource.pop\n raise ArgumentError, \"Can only add objects that respond to :ref, not instances of #{resource.class}\" u... |
50f9f185a7e0a4b735aeced6110bd841 | Calculates hash code according to all attributes. | [
{
"docid": "ad655969789279f1cf35ca34dd56f43f",
"score": "0.0",
"text": "def hash\n [name, main_format, shares_translation_memory, project_image, remove_project_image, account_id, source_project_id, workflow, machine_translation_enabled, enable_branching, protect_master_branch, enable_all_data_type_... | [
{
"docid": "08105588814074a5aed46dbb236c8d02",
"score": "0.791457",
"text": "def hash_code; Digest::SHA256.hexdigest(@attributes.values.join); end",
"title": ""
},
{
"docid": "706cbdb4c78e6b67e29589df0a4b1b5c",
"score": "0.73099273",
"text": "def attr_hash\n md5 = Digest::MD5.ne... |
09dc39c382b27d87b8739f9a88821b2d | Returns the order date and time, formatted. The invoiced_at time is used if set, otherwise the order created_at time is used. Returns a blank string if neither is set because the order is a new record. order_formatted_time(Order.new) => "" order_formatted_time(Order.new( created_at: DateTime.new(2016, 12, 9, 12, 52), i... | [
{
"docid": "eaadad227ff588d0008bc5d745d0b974",
"score": "0.81115484",
"text": "def order_formatted_time(order)\n time = order.invoiced_at || order.created_at\n if time\n time.strftime(ApplicationHelper::FRIENDLY_TIME_FORMAT)\n else\n \"\"\n end\n end",
"title": ""
}
] | [
{
"docid": "6ca7267f41716ee08aecad9a38199729",
"score": "0.6759209",
"text": "def date_time_formatted\n self.appointment_datetime.strftime(\"%B %d, %G at %R\")\n end",
"title": ""
},
{
"docid": "13b31567833e8123256b1906311a7153",
"score": "0.66869557",
"text": "def formatted_date... |
46f61ca2ce2969b28f4c37eae591867e | Public Clears out all keys and values from the dictionary. | [
{
"docid": "77359de110c58e6a08ab40145d84717d",
"score": "0.84924215",
"text": "def clear\n dict.clear\n end",
"title": ""
}
] | [
{
"docid": "f59e4330eb593b5aead11b96c466ecaf",
"score": "0.82580024",
"text": "def clear\n @hash.keys.each{|k| remove(k)}\n end",
"title": ""
},
{
"docid": "7cdd46fccd1af567eff4491a20d0c878",
"score": "0.80775607",
"text": "def clear\n @hash = {}\n @keys = [... |
225888135c789e6758a3ac86235e7fa6 | If the method_name exists, then call it and return the result. If the method name doesn't exist then return nil | [
{
"docid": "b25a36a6cc850687343f7a07262f8b1f",
"score": "0.0",
"text": "def authorise_action_for?(method_name)\n return nil unless respond_to?(method_name)\n\n send(method_name)\n end",
"title": ""
}
] | [
{
"docid": "b543ad8dcb932c67325bd93d86388304",
"score": "0.7317228",
"text": "def call_method(name)\n method = lookup(method_call_type, name)\n\n unless method\n raise NoMethodError, \"Undefined method #{name} for #{self.inspect}\"\n end\n\n return method.call(self)\... |
67ae8f9397365cc8879eb8a89ccb8aa4 | Return the classes name for the given step list item. | [
{
"docid": "ea5da5f06cf425d973420a065cf22d6b",
"score": "0.640587",
"text": "def classes_for_design_step(step_name)\n classes = []\n design_steps = [:pick_a_design, :personalize_design, :introduction]\n design_steps_actions = {\n pick_a_design: \"templates#index\",\n personalize_... | [
{
"docid": "638a7dc095eb334e8f6ae8ab8bdabd19",
"score": "0.65640193",
"text": "def class_for_step(context, step) \n logger.debug \"<< Current step test is #{step} >>\"\n logger.debug \"<< Current? #{context.workflow.current?(step)} >>\"\n logger.debug \"<< Completed? #{context.work... |
a3f561a63d8d3d8a4d147d5cb39e3278 | checks if the se is completed on instrument | [
{
"docid": "c61bf9f238d53059bc93bc98ddf43fcb",
"score": "0.65903294",
"text": "def completed_se?(se)\n Helpers::log(\"Checks if .slide_done.txt is created for #{se}..\")\n done_se = completed_run\n done_se.each do |s|\n if /#{s}/.match(se)\n return TRUE\n end\n end\n retu... | [
{
"docid": "ead86bfcf8bbaa6392920b85720ed9d4",
"score": "0.69883007",
"text": "def check_ready_for_analysis?(se)\n temp = Sequence_event.new(se)\n check_transferred?(temp.to_s, @done_slides)\n end",
"title": ""
},
{
"docid": "cc5c73859b5eeda706c89b9ba9b37bbc",
"score": "0.6883517"... |
0476acd517199dbcad6714a419f54876 | Instantiates a new task | [
{
"docid": "7117ea03a70ddce901934255a44746b6",
"score": "0.81102586",
"text": "def initialize_task\n @task = Task.new\n end",
"title": ""
}
] | [
{
"docid": "edeffe8e1dc126179634eab2eaab4b0d",
"score": "0.8264799",
"text": "def new_task\n @task = Task.new\n end",
"title": ""
},
{
"docid": "d8ccf4f5b92abe4376945c73fe244c41",
"score": "0.78902316",
"text": "def new\n @task = Task.new\n end",
"title": ""
}... |
8a7cde3e0aa6306a8ac1fff42a4ee6c3 | Remove format from the url. | [
{
"docid": "56e61ec81d86fe5babe4081daf3c3431",
"score": "0.0",
"text": "def element_path(id, prefix_options = {}, query_options = nil)\n prefix_options, query_options = split_options(prefix_options) if query_options.nil?\n something = \"#{prefix(prefix_options)}#{collection_name}/#{id}#{query_... | [
{
"docid": "f7e96ba16e9f02fb236270d80807cc5c",
"score": "0.75369936",
"text": "def format_url(url)\n url.to_s.sub(%r{index\\.html?$}, \"\")\n end",
"title": ""
},
{
"docid": "6ab5a0f875ab9cfc4bb2ad42a5ca6732",
"score": "0.75074923",
"text": "def format_url(url)\n url.g... |
513e661b963d2034d87bf5927e66c664 | DELETE /classnames/1 DELETE /classnames/1.json | [
{
"docid": "82323a7d726f3e66767c38fc6ca89e37",
"score": "0.73365724",
"text": "def destroy\n @classname.destroy\n respond_to do |format|\n format.html { redirect_to classnames_url, notice: 'Classname was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
... | [
{
"docid": "a9a01a911344fd0eeab8451d75704845",
"score": "0.7000017",
"text": "def destroy\n @classs.destroy\n respond_to do |format|\n format.html { redirect_to classses_url, notice: 'Classs was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ... |
000092c1ffd74217ea5bbcd74023f338 | Returns a representative FHIR::Observation for an instance of a Sara Alert Laboratory. | [
{
"docid": "b1a632a4f523cdf5c1d909dff2ab354f",
"score": "0.5055384",
"text": "def as_fhir\n laboratory_as_fhir(self)\n end",
"title": ""
}
] | [
{
"docid": "d02704ef90676a54e020e2e7090a10f0",
"score": "0.5142933",
"text": "def resourceType\n 'Observation'\n end",
"title": ""
},
{
"docid": "e4f7b9ab38a988d98d8ced5bf79f24e7",
"score": "0.5117254",
"text": "def as_fhir\n FHIR::Observation.new(\n meta: FHIR::Meta.... |
bc60072846d3f2681550f207d5a6d390 | Yield each cell in the console's domain with its corresponding coord. | [
{
"docid": "b8fcbdfd23f8c5bdf95b0579c65a51db",
"score": "0.6420328",
"text": "def each_with_coord\n return enum_for(:each_with_coord) unless block_given?\n\n @rect.each { |c| yield self[c], c }\n\n self\n end",
"title": ""
}
] | [
{
"docid": "cb22dae874280e8f09f9768e147afc85",
"score": "0.6832616",
"text": "def each_cell\n\n each_index do |x, y|\n yield @cells[x][y]\n end\n\n @cells\n\n end",
"title": ""
},
{
"docid": "680b57107c656f66277479deb10b47d0",
"score": "0.6817376",
"text": "def cells\n... |
842c22fc38dd52b65f29c958992c9b78 | The engine of the creation of a new post. Engine of new. | [
{
"docid": "fc1370e8eca4d41cb5755b421e1c367f",
"score": "0.0",
"text": "def create\n\t @article = Article.new(article_params)\n\t \n\t if @article.save # The validation written in the model file is now a condition\n\t redirect_to @article\n\t else\n\t render 'new' # render is a helper that dire... | [
{
"docid": "06420d610eaf7cb661c7aa239a4650da",
"score": "0.7227362",
"text": "def new() save_post end",
"title": ""
},
{
"docid": "2ce745bb07212243c7b318e72bdab8e7",
"score": "0.7032019",
"text": "def new_post()\n\t\t\tcreated_post = Post.new\n\t\t\tcreated_post.api = self\n\t\t\tcre... |
2e4862f4e66ba5414aa6f46d72d4a18d | require 'opaljquery' can't find file: "opaljquery" | [
{
"docid": "8c939ffaecafa28edaf19192ba2897e3",
"score": "0.0",
"text": "def sum_of_cubes\n x = (0..3).map do |n|\n n * n * n\n end.reduce(:+)\n puts x\nend",
"title": ""
}
] | [
{
"docid": "b663854da8fc7f2ed3d9f49e425e679f",
"score": "0.6156296",
"text": "def use_jquerytools\n #use_jquery # required for ie bug?\n javascript_place :js_libs, 'jQuery/jquerytools-1.1.2.min', 'application_jquery'\n #@@jquery_loaded = true\n end",
"title": ""
},
{
"docid": "1927... |
be1663f70ea7ee55ccb276a444632c57 | PUT /conversations/1 PUT /conversations/1.xml | [
{
"docid": "5153a604f78c2aeb6b891262450662d6",
"score": "0.642852",
"text": "def update\n @conversation = Conversation.find(params[:id])\n\n respond_to do |format|\n if @conversation.update_attributes(params[:conversation])\n format.html { redirect_to(@conversation, :notice => 'Convers... | [
{
"docid": "3e54d05f63dfa852336c0059fb7719a7",
"score": "0.68582",
"text": "def update_conversation(id, data)\n put(\"conversations/#{id}\", { body: data })\n end",
"title": ""
},
{
"docid": "3e54d05f63dfa852336c0059fb7719a7",
"score": "0.68582",
"text": "def update_conversation(... |
6645a1a8a4f67a5c59d209d63fd9882c | Note: if we are EDITing a part, then the part already exists, and the ID in the URL is for the part, not the SLI. | [
{
"docid": "9bba8552a6a0dd2b895833ca6c6f968b",
"score": "0.55673754",
"text": "def gfedit_for_sp\n @service_part = ServicePart.find(params[:id])\n @service_line_item = @service_part.service_line_item\n prepFormVariables\n end",
"title": ""
}
] | [
{
"docid": "70dafe0fe68b8013ed1e12109a0edb55",
"score": "0.64523953",
"text": "def set_part\n @part = Part.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "554f7d758911c19276203616954f21cf",
"score": "0.61567175",
"text": "def set_part\n @part = Part.find( p... |
27304baffda6e98358da7d10d4cea474 | perform search on the repository | [
{
"docid": "1dfc8a1572154d54dd2ec5007057b70e",
"score": "0.0",
"text": "def find(pAuthToken, p_args)\r\n query = p_args[:query]\r\n max = p_args[:max]\r\n offset = p_args[:offset]\r\n sort_by = p_args[:sort_by]\r\n select = p_args[:select]\r\n\r\n # verify the arguments\r\n... | [
{
"docid": "ee095bf91f2ab92393964c7656fef73d",
"score": "0.76568604",
"text": "def search\n\n end",
"title": ""
},
{
"docid": "589ce8ab1a3f9ff557eecf3d9027b014",
"score": "0.76473415",
"text": "def search\n end",
"title": ""
},
{
"docid": "8ebcf03a65bb2984f9fadc9722eb8... |
9584a8472f0f07dcf301bcbb3ab9aebd | DELETE /kategori_tindakan_medis/1 DELETE /kategori_tindakan_medis/1.xml | [
{
"docid": "d46544c3e8ed4210d7ec90a1481a39bc",
"score": "0.0",
"text": "def destroy\n @kategori_tindakan_medi = KategoriTindakanMedi.find(params[:id])\n @kategori_tindakan_medi.destroy\n @id = params[:id]\n\n respond_to do |format|\n if request.xhr?\n format.js do\n ... | [
{
"docid": "c1592c9a7c989d01a99d8c2f4e789eab",
"score": "0.68475974",
"text": "def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end",
"title": ""
},
{
"docid": "cb7166a972cafb15f6764b45783db831... |
d76e541c33f223d961c3bc8618b49482 | Tests if the object is defined as an attribute in the namespace | [
{
"docid": "68363c8c5419ec508c635a4745eaf554",
"score": "0.6203281",
"text": "def is_attribute?; end",
"title": ""
}
] | [
{
"docid": "1ffdd998af4fc1d5abaaeafdc72fced3",
"score": "0.6821676",
"text": "def has_attribute (attname)\n\n attname = OpenWFE::symbol_to_name(attname) if attname.is_a?(Symbol)\n\n (@attributes[attname] != nil)\n end",
"title": ""
},
{
"docid": "df289d6e2f1e93c49cf039f9b7555531... |
c68864f1034e189efabdf0580e001d9c | Sets API token to the user | [
{
"docid": "6635ed43d2f0e4db2d08bbd806ee66c4",
"score": "0.7657764",
"text": "def set_api_token\n self.api_token ||= self.class.generate_api_token\n end",
"title": ""
}
] | [
{
"docid": "54a6c2848eea3326b99158157b08deac",
"score": "0.79813284",
"text": "def set_api_token\n @api_token = ApiToken.find(params[:id])\n end",
"title": ""
},
{
"docid": "b0d1980baf8fffb3b955628d1ef49f4b",
"score": "0.78712076",
"text": "def set_current_user token\n if ... |
5ee11338d67dfd93b1459e3abe5d4ceb | Returns a UTF8 character for the given UTF8 codepoint | [
{
"docid": "0fe148f362d3f6498038f8060ac1763d",
"score": "0.5561503",
"text": "def encode(codepoint)\n [codepoint.to_i(16)].pack(\"U\")\n end",
"title": ""
}
] | [
{
"docid": "33fd95130efefee7da545088c0fdf796",
"score": "0.77086407",
"text": "def utf8_character\n character.chr(Encoding::UTF_8)\n end",
"title": ""
},
{
"docid": "a0650e70e21b35c9b70e07718dfd0ce3",
"score": "0.7211508",
"text": "def get_utf8_of(character)\n character.... |
a092b187b1a5bf5a09d478af368e9ae8 | def events_by_code(game_id, event_code) game_events.where(game_id: game_id, event_code: event_code).count end | [
{
"docid": "b5e370dbf546f92b9b36ff4fc5eb6df7",
"score": "0.0",
"text": "def played_time(game_id)\n player_times\n .where(game_id: game_id)\n .select('sum(TIME_TO_SEC(TIMEDIFF(player_times.out_time, player_times.in_time))) as time_in_game')\n .first\n .time_in_game\n end",
"ti... | [
{
"docid": "89c6d5013d2b654446ce682345fa2c06",
"score": "0.6317593",
"text": "def index\n if params.has_key?(:code_id)\n @sc_events = ScEvent.where(code_id: params[:code_id])\n else\n @sc_events = ScEvent.all\n end\n \n end",
"title": ""
},
{
"docid": "3742e3a6b9c0ebab... |
f260b0743e3635ff851ba1fb8f391b00 | GET /users/1 GET /users/1.json | [
{
"docid": "86571b8170a5d9207142497837f76f3f",
"score": "0.0",
"text": "def show\n authorize! :read, @user\n\n @breadcrumbs = [['Users', users_path], [@user.email]]\n if @user.contact_relations.search_by_org(current_organization).first.nil?\n @contact_relation = @user.contact_relations.bui... | [
{
"docid": "9f7c735ace683c5c2b12c914cc9ad8a8",
"score": "0.771752",
"text": "def get\n users = User.all.as_json\n render(json: users.as_json, status: :ok)\n end",
"title": ""
},
{
"docid": "a95dfe28d6b386aafc5fb53749e84258",
"score": "0.75107867",
"text": "def user\n... |
b415395d798838cb30a990858d42598b | p uppercase?('t') == false p uppercase?('T') == true p uppercase?('Four Score') == false p uppercase?('FOUR SCORE') == true p uppercase?('4SCORE!') == true p uppercase?('') == true 6.Write a method that takes a string as an argument, and returns an Array that contains every word from the string, to which you have appen... | [
{
"docid": "83cfeef56de68b1f46ba4257ff17539b",
"score": "0.0",
"text": "def word_lengths(str)\n str.split.map{ |word| word + \" \" + word.size.to_s}\nend",
"title": ""
}
] | [
{
"docid": "b52810dd9c6e6038e73cbf73a57bec1a",
"score": "0.672411",
"text": "def string_length(words)\n if words.length >= 10\n puts words.upcase!\n else\n puts \"The string is not longer than 10\"\n end\nend",
"title": ""
},
{
"docid": "1a9065a36c1e77f9954ab445bb691b48",
"score... |
f57b6e730099c5be5e72481b0c339895 | Get badge info for a specific level. | [
{
"docid": "4ff7c3e32644ee1d4450c68a0c3c2f18",
"score": "0.6439381",
"text": "def business(level = 3)\n data = @data['families'].find { |type| type['name'] == 'Business' }\n badge = data['earnedAchievements'].find { |le| le['familyOrder'] == (level - 1) }\n HQTrivia::Badge.new(badge)\n end",
... | [
{
"docid": "5d2b74ddcb82a8978f73d1a9852729e6",
"score": "0.7769182",
"text": "def badge\n if @badge.nil?\n badges = Badge.by_name(badge_name)\n badges = badges.by_level(level) unless level.nil?\n @badge = badges.first\n end\n @badge\n end",
"title": ""
},
{... |
67257315a525883ac8eab1a22cdbacf1 | Converts APR (annual percentage rate) to EAR (effective annual rate) ear = effective annual rate n = compounding periods per year | [
{
"docid": "83d291734b65f4836e8dd62dbc2ea813",
"score": "0.7282235",
"text": "def ear_to_apr(ear, n)\n n * ((1 + ear)**(1 / n.to_f) - 1)\n end",
"title": ""
}
] | [
{
"docid": "ce27ecd75632472e92b861e10b2ab0ff",
"score": "0.7490981",
"text": "def apr_to_ear(apr, n)\n ((1 + apr / n)**n) - 1\n end",
"title": ""
},
{
"docid": "647c23ccac407e3ef442ce4d1ffb5f68",
"score": "0.67219234",
"text": "def calculate_apr\n payment_ratio = mon... |
16e5365322888c9e999729f592f20364 | GET /people/1 GET /people/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "dc5549fa6a62fc3c865028a017d690e4",
"score": "0.7643086",
"text": "def show\n @people = People.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @people }\n end\n end",
"title": ""
},
{
"docid": "89c5208... |
cae65cabb4b4bf8052631e36dc62d38b | Moves local systemTs to global. NOTE: assumes to_upper_space! has been called. | [
{
"docid": "7e264f2539ff04d5ec7005e3c055f652",
"score": "0.77794534",
"text": "def to_global_systemTs!\n # Force a name if not.\n self.force_name!\n # puts \"to_global_systemTs! for #{self.name}\"\n # For each local systemT\n self.scope.each_systemT... | [
{
"docid": "da86ab8e6dbe7239bcd658cf2e065cee",
"score": "0.56086385",
"text": "def move_to_sys\n # Make sure you got the correct SYSTEM Account Name no matter the OS Language\n local_sys = resolve_sid('S-1-5-18')\n system_account_name = \"#{local_sys[:domain]}\\\\#{local_sys[:name]}\"\n\n # ... |
8e1013d26bac44a626bd542d90e66324 | GET /nfi_pregnancy_categories GET /nfi_pregnancy_categories.json | [
{
"docid": "192c99a0638250c03387c73d1d8a71b9",
"score": "0.7812022",
"text": "def index\n @nfi_pregnancy_categories = NfiPregnancyCategory.all\n end",
"title": ""
}
] | [
{
"docid": "7e9e93b7dbcdceba11d6d67a27bc02cb",
"score": "0.69338804",
"text": "def set_nfi_pregnancy_category\n @nfi_pregnancy_category = NfiPregnancyCategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "1321113768d52f6d7e5eca66eee14302",
"score": "0.6852761",
"text":... |
c2f13a6b5b7c1e16af5aff10a91b7f1b | Set as empty array if no instance variable was instantiated | [
{
"docid": "4056710d1f737fdbfb3a3bde32ed880e",
"score": "0.0",
"text": "def reservations\n @reservations ||= []\n end",
"title": ""
}
] | [
{
"docid": "680358cbd214bcf972851a9f7d556f80",
"score": "0.73865324",
"text": "def initialize\n @array = []\n end",
"title": ""
},
{
"docid": "0ac1581513f24850edddb0950e01bc24",
"score": "0.73263055",
"text": "def initialize\n @array = []\n end",
"title": ... |
d886ee5acc3f72aebd7b9491355723be | The share price of a given stock over a certain period of time | [
{
"docid": "bab561d131e5f06d3e867fe167cdc06b",
"score": "0.6204866",
"text": "def share_price_for_given_stock\r\n # SELECT * FROM stockhistor WHERE ($dateChanged< and $dateChanged>);\r\nend",
"title": ""
}
] | [
{
"docid": "610f2db7a3602e25d91d9765c7f56066",
"score": "0.7330011",
"text": "def shares_at(ticker, time_x)\n t_prime = portfolio.positions_asof.to_datetime\n start_date = [time_x, t_prime].min\n end_date = [time_x, t_prime].max\n\n # This is expected to be 1 or -1\n epsilon = (time_x-t_p... |
f95c882ce36b6d61aa733fd92ce95140 | Inform the player which table we're seating them at. A 200 should be guaranteed, but if they've changed their mind, we just won't seat them at this table. | [
{
"docid": "1b92ddb778376e0d34db704608033f15",
"score": "0.4865418",
"text": "def accepts_seat?(table)\n RestClient::Request.execute(:method => :post, :url => seating_path, :payload => { :game_table_identifier => \"game_table_#{table.id}\" }, :timeout => TIMEOUT, :open_timeout => TIMEOUT) do |respons... | [
{
"docid": "b2f814391dd1022690de76a1896c9eee",
"score": "0.6261878",
"text": "def sit(table)\n puts \"#{name} sits down at table\"\n table.smokers << current_actor # DON'T USE SELF!\n @table = table\n\n transition :procuring\n end",
"title": ""
},
{
"docid": "ff86c249fba54f59796... |
ad5c9cb01e21bdcaf9e225cf5f8d1c3f | DELETE /ideas/1 DELETE /ideas/1.json | [
{
"docid": "af19ef7e08d075533b100f21014625da",
"score": "0.67662406",
"text": "def destroy\n @idea.destroy\n respond_to do |format|\n format.html { redirect_to ideas_url, notice: 'That idea was destroyed!' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "04821b062c12649be76c1fed4b44154f",
"score": "0.74778956",
"text": "def destroy\n @Userideas = Userideas.find(params[:id])\n @Userideas.destroy\n\n respond_to do |format|\n format.html { redirect_to Userideass_url }\n format.json { head :no_content }\n end\n end",
"... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "3dfba10e9c335f981f104213ddd67cdb",
"score": "0.0",
"text": "def ip_asset_params\n params.require(:ip_asset).permit(:title, :description, :filename, :attachment, :tag_list, :ownerships_attributes=> [:id, :user_id, :percentage, :_destroy])\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.requ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "7da7000c45c3472325c1608b432984aa",
"score": "0.0",
"text": "def set_transaction\n @transaction = Transaction.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... |
fe6e592d511f6198997c3daa518f5d20 | Method to remove an item from the list input: the key of what we want to delete steps: use delete(key) output: return the updated hash | [
{
"docid": "eb33a0abdf6937e4124d1deccbce91f2",
"score": "0.0",
"text": "def remove_item(unwanted_item,groceries)\r\n\tgroceries.delete(unwanted_item)\r\n\tgroceries\r\nend",
"title": ""
}
] | [
{
"docid": "e6192ae1de65bd398265ac8830685d2a",
"score": "0.86222816",
"text": "def remove_item(list, item) # input: Hash and Item (key) to be removed \r\n list.delete(item) # steps: Identify input with element in hash & remove it\r\n #print_list(list) #for testing\r\n return list # output: updated ha... |
e413eebf3296cbc2fb65694d584b531d | Uncomment to act only on the listed bridges. FILTERED_BRIDGES = ['beth0'] | [
{
"docid": "1d603c4096891540ef2675e6abcc1550",
"score": "0.0",
"text": "def activate(rule)\n system \"sudo ebtables -A #{rule}\"\nend",
"title": ""
}
] | [
{
"docid": "3d31dd3747e9f4c7b515f25708436dc7",
"score": "0.5530223",
"text": "def get_a_bridge\r\n if has_bridge?\r\n result = @bridges.sample\r\n @bridges = @bridges.delete result\r\n result\r\n end\r\n end",
"title": ""
},
{
"docid": "fd809ac79a6270c4cacf3b749ebc2db4"... |
f9f32afe5c997f72e5b3050f02329a73 | get Graph id for host_id | [
{
"docid": "e23fc82d6fd0e5b5be1431fe8a544159",
"score": "0.7849065",
"text": "def get_graph_id(host_id, graph_id, index = 1)\n return graph_id if graph_id.is_a?(Integer)\n\n command = \"#{cli_path}/add_tree.php --host-id=#{host_id} --list-graphs\"\n\n id = get_id_from_output(command, grap... | [
{
"docid": "08d79ccfa2bdb6e5a86c7f175a74fa71",
"score": "0.7853939",
"text": "def get_host_id(host)\n return host if host.is_a?(Integer)\n\n command = \"#{cli_path}/add_graphs.php --list-hosts\"\n\n id = get_id_from_output(command, host, 3)\n fail \"Failed to Find host_id for #{host}... |
b7096fcb9279c9582c8450f358e6c3ec | GET /categories/1 GET /categories/1.json | [
{
"docid": "674015f157504ad21e5ed8e6e008241f",
"score": "0.0",
"text": "def show\n @itemvalue = 15\n @min = 0\n @max = 1000000000\n @maxvalue = \"-\"\n @sort = \"Produk Terbaru\"\n if params[:sort]\n @itemvalue = params[:item]\n @min = params[:min]\n @max = params[:max]\... | [
{
"docid": "35802ecc80da3ace95df8f771700702b",
"score": "0.7877691",
"text": "def GetCategories params = {}\n\n params = params.merge(path: 'categories.json')\n APICall(params)\n\n end",
"title": ""
},
{
"docid": "04779fc6a7223751fb3e79f2b7a6f82c",
"score": "0.7865133"... |
1b91cf846d8ce0dbf69cc6bec7fc8d3c | Add ev bonus to a Pokemon (with item interaction : x2) | [
{
"docid": "a07131b1495559c24d81245d84fbc51d",
"score": "0.67141825",
"text": "def add_bonus(list)\n return nil if egg\n ev = GameData::EV\n #>Bracelet Macho\n n=@item_holding == 215 ? 2 : 1\n r=add_ev_hp(list[ev::HP]*n,self.total_ev)\n r&=add_ev_atk(list[ev::ATK]*n,self.t... | [
{
"docid": "c23567a180b1b6978980d6c94d6dfe48",
"score": "0.68416655",
"text": "def give_bonus player\n player.add_weapon(Divergent_Weapon.new(@window, player))\n end",
"title": ""
},
{
"docid": "af96fb66b2a94aed0edb97e7f30aeac3",
"score": "0.67880285",
"text": "def apply_equipmen... |
fc1ac6ce1c8bd0cbe1ea43309ed32065 | Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.notifications.new_record.subject Mail last record holder about record been beaten | [
{
"docid": "4bd1f841c607412f8dca27cdcde46a1c",
"score": "0.0",
"text": "def new_record(score)\n @score = score\n\n last_best = @score.last_best\n @greeting = \"Hey #{last_best.user.name}!\"\n\n mail(to: last_best.user.email)\n end",
"title": ""
}
] | [
{
"docid": "cb3903bb72c279531d812f561910449a",
"score": "0.74439955",
"text": "def email_changed(record, opts = {})\n opts[:subject] = \"#{default_title}: #{t(:email_changed)}\"\n super\n end",
"title": ""
},
{
"docid": "ea740e704e8f1173fb87b45dfcaaf989",
"score": "0.7098721... |
17c4fedc7b6ed9bfbadda620f0312e89 | takes user input of student names and adds to an array of hashes returns array of hashes | [
{
"docid": "8e7138ad5d92c5f6b4ae41be8caad41c",
"score": "0.7667636",
"text": "def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n # create an empty array\n students = []\n # get the first name\n name = gets.chomp\n\n while !name.empty... | [
{
"docid": "ba5e4e39b2e872260049017aef5f2318",
"score": "0.7819556",
"text": "def input_students\n\t\tputs \"Please enter the names of the students\"\n\t\tputs \"To finish just hit return twice\"\n\t\t#create an empty array\n\t\tstudents = []\n\t\t#get the first name\n\t\tname = gets.chomp\n\t\t#while t... |
69a59d84f87880ea811a8da02a820d80 | A Broadcasts object, which lets you work with OpenTok live streaming broadcasts. | [
{
"docid": "72c770b07685bf356217e059ab6f4aff",
"score": "0.7798836",
"text": "def broadcasts\n @broadcasts ||= Broadcasts.new client\n end",
"title": ""
}
] | [
{
"docid": "b5780f73926fb606e0121983ffadd21e",
"score": "0.6677103",
"text": "def query_broadcasts(options = nil)\n require_relative 'broadcast'\n @api.cursor(Broadcast, get_base_api_path() + \"/broadcasts\", options)\n end",
"title": ""
},
{
"docid": "b5780f73926fb606e01219... |
47ec8be51f2542a049c06335d866a20d | Dump this generator's indexes to a string that could be evaled inside another instance to represent the same indexes. Options: :add_index Use add_index instead of index, so the methods can be called outside of a generator but inside a migration. The value of this option should be the table name to use. :drop_index Same... | [
{
"docid": "ee629369eac122564d1fcda9b2fe8221",
"score": "0.8312409",
"text": "def dump_indexes(options={})\n is = indexes.map do |c|\n c = c.dup\n cols = c.delete(:columns)\n if table = options[:add_index] || options[:drop_index]\n \"#{options[:drop_index] ? ... | [
{
"docid": "69fc5a2bb3ec3763c4d31c030d8d29c6",
"score": "0.82763904",
"text": "def dump_indexes(options=OPTS)\n is = indexes.map do |c|\n c = c.dup\n cols = c.delete(:columns)\n if table = options[:add_index] || options[:drop_index]\n \"#{options[:drop_index]... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "f0231b5f1f26b4b6c6c71fa8ebf9d287",
"score": "0.0",
"text": "def set_trip\r\n @trip = Trip.find(params[:id])\r\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;... |
24af6a5a4d68841c42b87009f18f9d72 | PUT /frais_deplacements/1 PUT /frais_deplacements/1.json | [
{
"docid": "e50efef7ea840778721eec70c17cd5d9",
"score": "0.630531",
"text": "def update\n @frais_deplacement = FraisDeplacement.find(params[:id])\n\n respond_to do |format|\n if @frais_deplacement.update_attributes(params[:frais_deplacement])\n format.html { redirect_to @frais_deplacem... | [
{
"docid": "4cf17098807c94a13e72800ed0988eb9",
"score": "0.70662016",
"text": "def destroy\n @frais_deplacement = FraisDeplacement.find(params[:id])\n @frais_deplacement.destroy\n\n respond_to do |format|\n format.html { redirect_to frais_deplacements_url }\n format.json { head :no_co... |
b3c4065cdded43d49d6bb8c305bd1dfc | Returns true if each level of tree has the same object_types, or false otherwise. | [
{
"docid": "71e5230744000d7dc753d58a8cafa5be",
"score": "0.66489315",
"text": "def check_tree_levels(tree)\n return true unless tree.has_children?\n \n # For each node in tree compare first_child_type to rest of children's \n # type and return false upon first non-equal type.\n tree.bft d... | [
{
"docid": "f92cd5b72c029e26bd07fa12c891f670",
"score": "0.6862126",
"text": "def has_same_tree_structure(t)\n # check roots first.\n if (!(self.get_type).equal?(t.get_type))\n return false\n end\n # if roots match, do full list match test on children.\n if (!(self.get_fi... |
dac83c106e0864c8dea61f7e8b7e4c80 | Returns the configuration value for the http server host If nothing is set it should default to 0.0.0.0 (all interfaces) | [
{
"docid": "6cf8e318762306fa8eead7625ca57b35",
"score": "0.76856446",
"text": "def local_host\n get('beef.http.host') || '0.0.0.0'\n end",
"title": ""
}
] | [
{
"docid": "faa588c761ab3e73c7d934e6d912c051",
"score": "0.74076915",
"text": "def host(value = nil)\n if value\n @host = value\n else\n @host ||= 'localhost'\n end\n end",
"title": ""
},
{
"docid": "17bb8bfb7d7fa9b97e04ff9df383339d",
"score": "0.7329247",... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "df3ff4ea9e247a4817fab7037bf685bc",
"score": "0.0",
"text": "def set_colour_scene\n @colour_scene = ColourScene.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... |
a10f08d40d858f0ed82d56158d9cecf7 | Builds a fully qualified render request URL. | [
{
"docid": "23873caec19a59f76cf3cbd9720c1961",
"score": "0.7050282",
"text": "def buildRenderServerUrlRequest(inParameters)\n url = self.getRenderServerUrl() + \"render-image?\" + self._stringifyParameters(inParameters)\n url\n end",
"title": ""
}
] | [
{
"docid": "c6868e9aa375ab71fada5f354d85ad64",
"score": "0.7552316",
"text": "def build_url(resource)\n base_url + '/' + resource\n end",
"title": ""
},
{
"docid": "918154d99cf99dc2b5b04077b1d3ec36",
"score": "0.7427859",
"text": "def build_url(resource)\n self.base_url ... |
49a08f0583bf61ea951f63e9347aadd6 | Sets the exceptions property. | [
{
"docid": "e4bbc8a5776822dc8888512eae01ecfe",
"score": "0.78025603",
"text": "def exceptions=(value)\n @values['exceptions'] = value\n end",
"title": ""
}
] | [
{
"docid": "6cdbacc37db7b6d5f8ea43b81cafc392",
"score": "0.8430491",
"text": "def exceptions=(value)\n @exceptions = value\n end",
"title": ""
},
{
"docid": "6cdbacc37db7b6d5f8ea43b81cafc392",
"score": "0.8430491",
"text": "def exceptions=(value)\n ... |
1f76316bdb03f939b15621db04da1f86 | TODO: This needs to be reviewed and specs needs to be written | [
{
"docid": "2dc8fd62e2bdcf3eeb9f5752e10d88d1",
"score": "0.0",
"text": "def compress_rootfs\n # TODO: Pass in tmpdir so we can clean up from outside\n target_path = \"#{Dir.mktmpdir}/rootfs.tar.gz\"\n\n @logger.info \"Compressing '#{rootfs_path}' rootfs to #{target_path}\"\n ... | [
{
"docid": "072514f3348fe62556dcdfd4b06e3d08",
"score": "0.7362857",
"text": "def spec; end",
"title": ""
},
{
"docid": "072514f3348fe62556dcdfd4b06e3d08",
"score": "0.7362857",
"text": "def spec; end",
"title": ""
},
{
"docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1",
"sc... |
e873206c3fe22d7348aef3cdac16b7e5 | check to see if filetype match the types in OUTPUT_TYPES | [
{
"docid": "c3c915ffd4740ad9b33a1dab3e01e15d",
"score": "0.74064076",
"text": "def filetype_valid?(extension)\n if OUTPUT_TYPES.include? extension\n return true\n else\n puts \"Output supports #{OUTPUT_TYPES.join(', ')} filetypes\"\n return false\n end\n end",
"title": ""
... | [
{
"docid": "82b95bd2f5bfec0e22459ebe25629810",
"score": "0.6990984",
"text": "def is_output_file?\n self.data_type == 'outputs' && self.parameter_type.match(/File/).present?\n end",
"title": ""
},
{
"docid": "0af125bfdfc04613887405c065f230b1",
"score": "0.68906015",
"text": "def ... |
5b1e5e9864f0fb3ef6e05844c35bd4a9 | GET /vals/new GET /vals/new.json | [
{
"docid": "b4971572c6f85d08731e4ee1a6fa0f0a",
"score": "0.6960276",
"text": "def new\n @val = Val.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @val }\n end\n end",
"title": ""
}
] | [
{
"docid": "f10140e830077d8ac77061f2d99a6577",
"score": "0.66704345",
"text": "def new\n @value = Value.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @value }\n end\n end",
"title": ""
},
{
"docid": "1bb56472463277b8a1f4e54204d49... |