query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "d17174b1926aab5a6a5020ace52f77bb", "score": "0.0", "text": "def bookjudge_params\n params.require(:bookjudge).permit(:title, :author, :isbn, :judge_result)\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...
988901ab093eed274745fc8ac3a2f312
Define method to create cards from .txt file
[ { "docid": "c688ca01df7b3dee159e0925ba4a19d9", "score": "0.7079145", "text": "def cards\n # Initialize an array in which to store cards\n card_array = []\n\n # Parse lines from csv into an array (if no commas used in the question)\n lines = CSV.read(@filename)\n\n # Fo...
[ { "docid": "46c00db06ebe17e7e32ba945c8d55c05", "score": "0.85242814", "text": "def cards\n # Open and iterate on file contents to create individual cards, closes automatically\n File.open(filename, 'r') do |file|\n file.readlines.map do |line|\n question, answer, category = line.chomp....
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "19f574f0118639a9c82d88c94222ceb7", "score": "0.0", "text": "def check_result_params\n request_para = params[:check_result].nil? ? params : params[:check_result]\n request_para.select{|key,value| key.in?(CheckResult.column_names())}.symbolize_keys\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...
2fb339c5e58500b9f59ade7517413721
6 Kyu Take an input string and return a string that is made up of the number of occurances of each english letter in the input, followed by that letter. The string shouldn't contain zeros; leave them out. An empty string, or one with no letters, should return an empty string. the input will always be valid; treat lette...
[ { "docid": "f43da0802c2c4591e66805ee2fac3989", "score": "0.804741", "text": "def string_letter_count(str)\n letters = ('a'..'z').to_a.map { |letter| [letter, 0] }.to_h\n str.downcase.each_char { |char| letters[char] += 1 if letters.has_key?(char) }\n letters.select { |_, value| value > 0 }.map { |let...
[ { "docid": "24304860d7cc06fa5f0ea2be4dcca315", "score": "0.79781836", "text": "def letter_count string\n frequency = {}\n i = 0\n while i < string.length do\n if !frequency[string[i]]\n frequency[string[i]] = 1\n else\n frequency[string[i]] += 1\n end\n i += 1\n end\n frequenc...
8679cc5561175039d5db29ef4bfc16b5
GET /flight_plans/1 GET /flight_plans/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "5b231aaa064e3d8c5863db7eb11b2e61", "score": "0.7479206", "text": "def index\n @plans = Plan.all\n \n render json: @plans\n end", "title": "" }, { "docid": "a48647cb18c5a615d363b32cce9953e9", "score": "0.74478686", "text": "def index\n @tripplans = Tripplan.al...
5d139396a75ad313e14ccf5e247b3f7b
Ideally we'd test this for failures to create Rack::Request as well, but unfortunately racktest, which we're using to drive, creates Rack::Request objects internally, so there's not an easy way to.
[ { "docid": "1ca966d30355617ff152454f3861ecf9", "score": "0.68097806", "text": "def test_handles_failure_to_create_request_object\n if defined?(ActionDispatch::Request)\n ActionDispatch::Request.stubs(:new).raises('bad news')\n\n assert_raises RuntimeError do\n get '/foo/bar?q...
[ { "docid": "b3c0e56539e96c96eb699857bb73e8e9", "score": "0.69432014", "text": "def setup\n @requester = Rack::MockRequest.new(SampleApp)\n end", "title": "" }, { "docid": "0a11ba667e1473bbe0c3004a7681ef66", "score": "0.6607928", "text": "def initialize_request_and_response(env)\n...
1097a7e7758f08d32addfc88ea3fdcab
GET /users GET /users.json
[ { "docid": "64b4b16840b74209b7b7fd38b1b272cb", "score": "0.0", "text": "def index\n @users = User.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end", "title": "" } ]
[ { "docid": "9f7c735ace683c5c2b12c914cc9ad8a8", "score": "0.8407128", "text": "def get\n users = User.all.as_json\n render(json: users.as_json, status: :ok)\n end", "title": "" }, { "docid": "543509c6588e2f79a8dbcd1cdcdaf7b9", "score": "0.8359616", "text": "def users\...
68e0896d9b86de8e4f8bfd34b7935453
Set the primary key for the table. The value should be set as an array with the clustering key first.
[ { "docid": "084555202729a3994b0f69d48a14a5f6", "score": "0.8314151", "text": "def primary_key=(value)\n self._primary_key = Array(value).map { |column|\n if column.is_a?(Array)\n column.map(&:to_sym)\n else\n column.to_sym\n end\n }.flatten\n end", ...
[ { "docid": "7c749520239df4051c351a26945e76af", "score": "0.7854796", "text": "def set_primary_key(*key)\n @simple_pk = key.length == 1 ? db.literal(key.first) : nil \n @primary_key = (key.length == 1) ? key[0] : key.flatten\n end", "title": "" }, { "docid": "2baa301b076e60...
e3f9d9578c0e6e75b33291505fdeb8cf
Returns Strelka::HTTPRequest::Language objects for natural languages that have a higher qvalue than the current response's entity body (if any).
[ { "docid": "b5c4b59f010e239c43356fde2ed37d8f", "score": "0.7425675", "text": "def better_languages\n\t\treq = self.request or return []\n\n\t\tcurrent_qvalue = 0.0\n\t\taccepted_languages = req.accepted_languages.sort\n\n\t\t# If any of the current languages exists in the Accept-Language: header, reset\...
[ { "docid": "a11af2e84d712dc4d94ddb4d7121de1d", "score": "0.6496091", "text": "def top_languages\n CLD.get_array_from_ptr(self[:lang_results_ptr], MAX_CLD_RESULTS, LanguageResult).select { |lang|\n !lang[:score].zero? # exclude padded values\n }\n end", "title": "" }, { "d...
1ce8bac22c28e77d39ce07d3b8ddad0c
Read a &39;kubernetes.VersionPolicy&39; resource.
[ { "docid": "2695cfb545d54f64179870cc01fe2234", "score": "0.5273238", "text": "def get_kubernetes_version_policy_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: KubernetesApi.get_kubernetes_version_policy_list ...'\n end\n ...
[ { "docid": "384f53ba751cbe5f937a52bd5fe48780", "score": "0.6173865", "text": "def show_version\n \t\t@policy = Policy.find(params[:id])\n\t\t@versions = @policy.versions\n \t@policy = @policy.versions[params[:version].to_i].reify if params[:version]\n \tend", "title": "" }, { "docid": "...
a9e078db6f4663ac6dcc55e494a8c020
Set the value of the SubnetId input for this Choreo.
[ { "docid": "01ae74071df4d920ab5650101a94d766", "score": "0.699324", "text": "def set_SubnetId(value)\n set_input(\"SubnetId\", value)\n end", "title": "" } ]
[ { "docid": "433be898a189aa3c340cf1b57650dd90", "score": "0.65098125", "text": "def aws_subnet_id(subnet_id)\n @platform.aws_subnet_id = subnet_id\n end", "title": "" }, { "docid": "74f7410d23a970c57f319cbe5c18da7b", "score": "0.5738947", "text": "def update_subnet(node_id...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "f5223f353aa40a2cda0c36036cc88314", "score": "0.0", "text": "def product_params\n params.require(:product).permit(:name, :price, :seller_id, :picture, :description)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.69497335", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6812623", "text": "def strong_params\n params.require(:listing_member).permi...
f038a53ed9a1bdfcced72c201ded681b
```p palindrome?("racecar") => true p palindrome?("wazzzzup") => false```
[ { "docid": "8e19f94494b149ae81c1dde404943744", "score": "0.0", "text": "def palindrome (input_string)\n input_string == input_string.reverse\nend", "title": "" } ]
[ { "docid": "b21c55439d408929702f65d35b7ed23b", "score": "0.88129294", "text": "def is_palindrome = 'racecar'", "title": "" }, { "docid": "073a7d66fd71f4dd023e066a033bdc06", "score": "0.8653147", "text": "def palindrome?(string)\n\nend", "title": "" }, { "docid": "073a7d66...
3d1c44452277db050831bbe295a2cda4
GET /versions/1 GET /versions/1.json
[ { "docid": "9d3a1d97dc43d0a3be7a7a0ea3b3d39b", "score": "0.0", "text": "def show\n authorize! :manage, @version, :message => \"Access denied.\"\n end", "title": "" } ]
[ { "docid": "0272dc9b03cc36d3376ed49d7364f3a5", "score": "0.78029037", "text": "def get_versions\n path = \"/d2l/api/versions/\"\n _get(path)\n # returns: SupportedVersion JSON block\nend", "title": "" }, { "docid": "1ec61b6b54e78faead5e68993bf6f757", "score": "0.7685248", "text": ...
a3c73a60531b18a2249d0176145570cb
DELETE /locations/1 DELETE /locations/1.json
[ { "docid": "6b26ea8c65cb4f770988fad5a63172cd", "score": "0.7292965", "text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.json { head :ok }\n end\n end", "title": "" ...
[ { "docid": "4da4dd82c73d871c95906ca2a0d70575", "score": "0.7461481", "text": "def destroy\n record = Location.find(params[:id])\n record.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "faf9b1ec3a056040b2c981...
6723efd8bf81434bad3468a8be72aac8
Checks out the app's codebase to the checkout path.
[ { "docid": "2258ec2e32f44a6ae37f71ca64e8ef74", "score": "0.5069664", "text": "def checkout_repo repo, scm_info={}\n install_deps repo.scm\n\n Sunshine.logger.info repo.scm,\n \"Checking out to #{@shell.host} #{self.checkout_path}\" do\n\n @info[:scm] = repo.checkout_to self.check...
[ { "docid": "0e86b32c61630c3ae91f6057a36e0fb5", "score": "0.66557854", "text": "def checkout(*args, **options)\n self.lib.checkout(*args, **options)\n end", "title": "" }, { "docid": "f50af898b49aeb4b97662cf569658bbf", "score": "0.66169447", "text": "def checkout_to(dir)\n ...
d8ce65abe63b1ec34851e8eed905ce25
PATCH/PUT /measurements/1 PATCH/PUT /measurements/1.json
[ { "docid": "62476181908371890789ff562804dd6c", "score": "0.68152285", "text": "def update\n respond_to do |format|\n if @measurement.update(measurement_params)\n format.html { redirect_to @measurement, notice: 'Measurement was successfully updated.' }\n format.json { render :show, ...
[ { "docid": "c8b6b1f879927a3b3ec9202bfbfa37b4", "score": "0.68399465", "text": "def update\n @measurement = Measurement.find(params[:id])\n\n respond_to do |format|\n if @measurement.update_attributes(params[:measurement])\n format.html { redirect_to body_measurement_path(@measu...
a72e62759aac39ba78da764b68984fa8
GET /code_problems/new GET /code_problems/new.json
[ { "docid": "5e01168c69c3ae20e584ce3ef26e4ed4", "score": "0.796784", "text": "def new\n @code_problem = CodeProblem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @code_problem }\n end\n end", "title": "" } ]
[ { "docid": "f139cc8ecee7339cbc98670c1cc1291c", "score": "0.81762755", "text": "def new\n @problem = @idea.problems.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @problem }\n end\n end", "title": "" }, { "docid": "1b1a7886c119aa14...
69c920c765b1e683f06819de197240a2
GET /stock check details
[ { "docid": "88405786ff52af04f1f2684796233890", "score": "0.6401053", "text": "def stock_check_details\n render layout: nil\n end", "title": "" } ]
[ { "docid": "8dc7485f14a96dfd4885f56a1b8d6396", "score": "0.7704764", "text": "def lookup_stock(stock)\n address, port = lookup_service('stocks')\n uri = URI.parse(URI.encode(\"http://#{address}:#{port}/stock/#{stock}\"))\n res = Net::HTTP.get_response(uri)\n res.body if res.is_a?(Net::HTTPSuccess)\n...
f1aad8f5019e2414f20574f75bbaeefa
The connection status when the cipher suite was used.
[ { "docid": "0aaf55d7869eb6a416301c353dee4a05", "score": "0.7096482", "text": "def connection_status\n @connection_status ||= @node['connectionStatus']\n end", "title": "" } ]
[ { "docid": "b57857e5399b86ce8049911b0f361ca9", "score": "0.731217", "text": "def connection_status_handshake; end", "title": "" }, { "docid": "9fcfe57f47b2ae5932b25788cdbe5948", "score": "0.7294754", "text": "def connection_status_client_status; end", "title": "" }, { "do...
e35be2f6dbe352172bd3a4d6b80199be
Unlike an object. This removes the object from a user's set of likes.
[ { "docid": "f19000af621fedccbd6d60509134f246", "score": "0.5930171", "text": "def unscore(obj)\n return unless scores?(obj)\n\n run_hook(:before_unscore, obj)\n Recommendable.redis.zrem(Recommendable::Helpers::RedisKeyMapper.scored_set_for(obj.class, id), obj.id)\n Recommenda...
[ { "docid": "3b59038e80db49953d6e040fa8fd7548", "score": "0.8063316", "text": "def undislike(obj)\n return unless dislikes?(obj)\n\n run_hook(:before_undislike, obj)\n Recommendable.redis.srem(Recommendable::Helpers::RedisKeyMapper.disliked_set_for(obj.class, id), obj.id)\n Re...
ee08dd8c512d6d0bb5414f18006eda62
If running within java, extract helper utility script from jar ball and write to local system to allow shellout to work as expected.
[ { "docid": "08ea758eefb8d71132bfa55cab7ef8ec", "score": "0.67680204", "text": "def setup(*_)\n require 'reaper-man'\n location = ReaperMan::Signer::HELPER_COMMAND\n if(location.include?('jar!'))\n tmp_file = Tempfile.new('reaper-man')\n new_location = File.join(Dir...
[ { "docid": "46bffe17dea614f0f041e39e7b00f956", "score": "0.61644185", "text": "def patch_wrapper_script(prog)\n\t\twrapper_script_header = <<-WRAPPER_SCRIPT_HEADER\n#!/bin/bash\n\nexport LANG=en_US.UTF-8\nexport LANGUAGE=en_US.UTF-8\nexport LC_ALL=en_US.UTF-8\n\nCOMMONSDIR=\"#{HOMEBREW_PREFIX.join('opt'...
89d4fb59558a144f448c30ed8baaab14
Send message This is the main entrypoint to send messages. See the examples above for the reference.
[ { "docid": "38a26f9e375f32faec5e63f562cf477d", "score": "0.0", "text": "def send_message_with_http_info(send_message_input_object, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TextMagicApi.send_message ...'\n end\n # verify the requir...
[ { "docid": "551270ade0c3a61516c885d4f1e20406", "score": "0.7854547", "text": "def send(message)\n info(\"[Smartfocus] Send -> #{message}\")\n end", "title": "" }, { "docid": "1b41aaa95a5e66902925337410b8ba31", "score": "0.78335506", "text": "def send_message(message); end", ...
976a229c05522b679aca16f28e74f1ac
All requests circulate through this method. Here you can set configuration details on the rubyamf gateway.
[ { "docid": "f2af98e7b18db7e0e6267e761418d72d", "score": "0.6097576", "text": "def service(request, response)\n \n\t #this only catches errors in this scope, all other errors in the rubyamf process are caught \n\t #in BatchFilter, then transformed into an AMF acceptable Fault Object to be return...
[ { "docid": "1df3d08f640c3a7c5784890c0a1be91a", "score": "0.5950611", "text": "def set_request; end", "title": "" }, { "docid": "ddcd8dd411efbde7ff2c70ff15b474d5", "score": "0.5887165", "text": "def initialize_config(&block)\n import 'rack/amf/config/default'\n configure(&bl...
5950b30e1588359518e06b5113847270
Initializes a client if necessary.
[ { "docid": "30290a270a2aa6090bff39cc5ba417ee", "score": "0.8022195", "text": "def soft_init_client\n return if @initialized\n init_client\n end", "title": "" } ]
[ { "docid": "f9799c5406d3632fbef86a40f72e7dd6", "score": "0.7561732", "text": "def ensure_client!\n raise \"Must have active connection\" unless @client\n end", "title": "" }, { "docid": "b0ed3213f1aab239bc43175aefa11c30", "score": "0.7547412", "text": "def initial...
140adf23176f0d74b7be8fff6ecf3974
same as `send_file` except it instruct browser to display save dialog
[ { "docid": "d2574114b0624f96e78a4a9d5c1a081b", "score": "0.5759875", "text": "def attachment path, opts = {}\n halt send_file path, opts.merge(:attachment => true)\n end", "title": "" } ]
[ { "docid": "218613bed84fce5840544ecfd6db4133", "score": "0.71987915", "text": "def send_file(path); end", "title": "" }, { "docid": "cba6002285b26b10ac14a20a5a218f13", "score": "0.675687", "text": "def send_file(controller)\n ext = File.extname(filename)[1..-1]\n mime_type = Mi...
6a06e92a5faaa64ddeea095aeea4b4e2
DELETE /hohos/1 DELETE /hohos/1.json
[ { "docid": "730fe51112bc48d0eac2db865810a475", "score": "0.7157109", "text": "def destroy\n @hoho.destroy\n respond_to do |format|\n format.html { redirect_to hohos_url, notice: 'Hoho was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ...
[ { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.7158648", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "77a2d5503aca8bdde9bc069510fe752a", "score": "0.7006178", "text": "def destroy\n @hoge = Hoge.find(params[:id])\n @hoge...
c0ed1e96406796b7092d1789c6361a07
We want stylesheets and javascripts to do the exact same thing, magic of polymorphous super() makes it work:
[ { "docid": "7644a228da90a6dd2cd770e34d9d9713", "score": "0.5130304", "text": "def path_to_stylesheet(*args)\n path = super\n if @generate_urls_with_host \n path = request.protocol() + request.host_with_port() + path\n end\n return path\n end", "title": "" } ]
[ { "docid": "812bc5424b05e0f9ee7c1cc2af821f19", "score": "0.6634251", "text": "def superclass() end", "title": "" }, { "docid": "e21e8506fc488800618fb6f83e35d311", "score": "0.65624946", "text": "def inherited(base); end", "title": "" }, { "docid": "badbfbff62729c0763e5d36...
950ba28ef77edb42ac2c65b5220947b2
GET /male400mts_heads GET /male400mts_heads.json
[ { "docid": "526aa5e2b7970128897b3c7aa666f6fb", "score": "0.73012036", "text": "def index\n @male400mts_heads = Male400mtsHead.all\n end", "title": "" } ]
[ { "docid": "4d3ed4cd3cff90b77d2092a1ed56a561", "score": "0.69089156", "text": "def index\n @male1500mts_heads = Male1500mtsHead.all\n end", "title": "" }, { "docid": "95128d60e6b596fc0699d380963c498c", "score": "0.64475554", "text": "def index\n @male100mtshurdles_heads = Male...
ac508d6bcd6716989d535bc6b87d3776
returns an array of hashes
[ { "docid": "8ea590592a6c1bec8f579a28240c5589", "score": "0.0", "text": "def getAssociatedObjects(name, obj_id, no_data = true) # get ids of an object's associated objects\n xml = call_method(\"facebook.data.getAssociatedObjects\", { \"name\" => name, \"obj_id\" => obj_id, \"no_data\" => no_data.to_s })...
[ { "docid": "df9fee37484b0d58e881d659518cc13e", "score": "0.7481935", "text": "def to_array\n map(&:to_hash)\n end", "title": "" }, { "docid": "b123bb4d3fbbc1c5a492c9b91e74c089", "score": "0.72934496", "text": "def get_hash_array\n @@hash_result_arr # Can bu used anywhere ...
a6e0b867baeb3d8d05fa45e1a622f78e
value is a String
[ { "docid": "440801246221de9203af136b6829e2da", "score": "0.0", "text": "def eff_date=(value)\n @children['eff-date'][:value] = value\n end", "title": "" } ]
[ { "docid": "afd43f5c6e9f5fcedb1c98529904cf47", "score": "0.7760506", "text": "def string?(value)\n value.is_a?(String)\n end", "title": "" }, { "docid": "3129fb647fe9d6974306618e05f5d5c7", "score": "0.77269197", "text": "def must_be_a_string(value)\n value.is_a?(String...
ae769a18ba23242578a6acb077492ba6
=begin Function to create a new Article Param 1: logged user object Return if successful: 1.execution result(true), 2.created election object 3.photo creation status Return if unsuccessful: 1.execution result(false), 2.response code from the server, or array of validation errors 3.response message from the server =end
[ { "docid": "fdd61e80d51be6e2778eb16a2e0e7c5f", "score": "0.6802492", "text": "def save (user)\n Rails.logger.debug \"Call to article.save\"\n if self.valid? #Validate if the Article object is valid\n Rails.logger.debug \"The news article is valid!\"\n picture = self.picture #Retrieve the...
[ { "docid": "ed599d1bbb639a1e28f6fd679bdde193", "score": "0.7057245", "text": "def create\n @article = Article.new(article_params_for_create)\n # TODO \u001b$B$3$3%-%b$$$+$i%(%i!<%O%s%I%j%s%0$G$I$&$K$+$9$k\u001b(B\n return if validate_user\n\n respond_to do |format|\n if @article.save\n ...
4ecfaff3e6d38a1f160224084859556d
TODO: Should this method be here? The responsability of saving preferences isn't of the controller? A preference should just represent one instance of preferences?
[ { "docid": "ffecbae80166e79a414a991e7c6c535c", "score": "0.57040185", "text": "def test_should_save_settings\n prefs = {\n \"store_name\" => \"Substruct\",\n \"store_handling_fee\" => \"0.00\",\n \"store_use_inventory_control\"=>\"1\"\n }\n assert Preference.save_settings(prefs)\...
[ { "docid": "27928d766300643fd42c70158c31f431", "score": "0.71047384", "text": "def remember_preference settings\n self.preference = Preference.find_or_create_by user_id: self\n self.preference.update settings\n end", "title": "" }, { "docid": "7756ab0f74e49b1a545eb1b3b04edc9d", "s...
b44822bd5d11bbfab9f95f549f907fe4
DELETE /prescription_rows/1 DELETE /prescription_rows/1.json
[ { "docid": "1b6d7f817d87f45c9d7666832f33bcff", "score": "0.74570113", "text": "def destroy\n \n @prescription=Prescription.where(id: @prescription_row.id_prescription).first\n @prescription_row.destroy\n respond_to do |format|\n format.html { redirect_to @prescription, notice: 'Prescrip...
[ { "docid": "e44bdbe9cb6ec363e8cd940936624722", "score": "0.71572876", "text": "def delete_row(row_id); rest_delete(\"#{link('rows')}/#{row_id}\"); nil; end", "title": "" }, { "docid": "45c72295c097aec098c0fe5f6bc1edb5", "score": "0.69639033", "text": "def destroy\n @invoice_row.de...
8cb8bb409c79da39d8ba668fc2757da0
Given an array of numbers, return an array of all the products remaining when each element is removed from the array. You may wish to write a helper method: array_product. products_except_me([2, 3, 4]) => [12, 8, 6], where: 12 because you take out 2, leaving 3 4 8, because you take out 3, leaving 2 4 6, because you tak...
[ { "docid": "3e3f192f254b21d784865cb206c32fe5", "score": "0.7181444", "text": "def products_except_me(numbers)\n\n result = []\n numbers.each_index do |i|\n subarr = numbers[0...i] + numbers[i+1..-1]\n result << subarr.reduce(:*)\n\n end\n result\nend", "title": "" } ]
[ { "docid": "a88454fd07b4d4b103a01bbfe626f731", "score": "0.77933085", "text": "def products_except_me(numbers)\n sum_of_products = []\n i = 0\n while i < numbers.length\n product_array = []\n j = 0\n while j < numbers.length\n if i != j\n product_array.push(numbers[j])\n end...
1784524ab6a88ec01553b9074de72679
Create a setting in the specified bucket
[ { "docid": "d35a3205c3149728efc1e8bfda346790", "score": "0.0", "text": "def settings_create_setting(request, opts = {})\n data, _status_code, _headers = settings_create_setting_with_http_info(request, opts)\n data\n end", "title": "" } ]
[ { "docid": "aa4802e7c1f600bb6b758bb142dfd969", "score": "0.6743587", "text": "def configure_s3_bucket\n connection = Fog::Storage.new(:provider => 'AWS',\n :aws_access_key_id => Constants::S3_ACCESS_KEY_ID,\n :aws_secr...
f641f4426c8f04864e9f54627909a345
Escape str if necessary. Useful for passing arguments to a shell.
[ { "docid": "d08497d08e2044e5bf7120d9a6d54af3", "score": "0.7025026", "text": "def shellescape(str)\n Shellwords.escape(str)\n end", "title": "" } ]
[ { "docid": "3605a971ebea03af2f06ae32a11d9bfd", "score": "0.79114866", "text": "def sh_escape(str)\n if str !~ /^[a-z0-9\\/.:_-]*$/i && str !~ /\"/\n \"\\\"#{str}\\\"\"\n else\n str\n end\n end", "title": "" }, { "docid": "9359554e92c71ddd1b12694b30...
2da8f7975f7206d0eede9d8d0beef9bc
GET /cfp/events/new GET /cfp/events/new.xml
[ { "docid": "c19dbee55a8aa375d3f089899a2977d4", "score": "0.6726119", "text": "def new\n @event = Event.new(:time_slots => @conference.default_timeslots)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @event }\n end\n end", "title": "" } ]
[ { "docid": "e9fa74e224b2e463bda40bcc5e11c9b1", "score": "0.7470805", "text": "def new\n setup_variables\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @event }\n end\n end", "title": "" }, { "docid": "b83c4aa...
41c3917edd9b8373513d4c08c0feb855
add a player to the table
[ { "docid": "54cb3d52f4174d2040f9b014b73b05ae", "score": "0.6363748", "text": "def <<(player)\n @players << player\n end", "title": "" } ]
[ { "docid": "9179c03cf456ca5e7d8b5f0061beb598", "score": "0.8060105", "text": "def add_player(player)\n raise \"A table can hold a maximum of 10 players.\" if players.size >= MAXIMUM_PLAYERS\n @players[position(nil)] = player unless @players.include? player\n end", "title": "" }, { ...
e38e69dd0279e6d60c3db0ddd3cf7655
A list of chat routes defined by the handler.
[ { "docid": "f65096ffa32896d1b5e60d9bf545a40d", "score": "0.7124", "text": "def routes\n @routes ||= []\n end", "title": "" } ]
[ { "docid": "fb12d48c15c9124d20bd27a1a263efac", "score": "0.6738877", "text": "def routes\n @routes\n end", "title": "" }, { "docid": "fb12d48c15c9124d20bd27a1a263efac", "score": "0.6738877", "text": "def routes\n @routes\n end", "title": "" }, { "docid": "...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "e89650539278d7180e996d72961d92ab", "score": "0.0", "text": "def municipality_params\n params.require(:municipality).permit(:name, :province_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.79427844", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.6957069", "text": "def permitted_params\n params.permit!\n end", "title"...
2897f36a8596d22126777d760398859f
POST /cycles POST /cycles.json
[ { "docid": "249b5a56df7cee3aa73801ffe7a73803", "score": "0.6557409", "text": "def create\n @cycle = Cycle.new(cycle_params)\n\n respond_to do |format|\n if @cycle.save\n format.html { redirect_to @cycle, notice: 'Ciclo creado exitosamente.' }\n format.json { render :show, status...
[ { "docid": "aa7f5ffafb5c68918912152f85bc6208", "score": "0.67611086", "text": "def create_next\n old_cycles = Maintenance::Cycle::CYCLE_TYPES.map { |type| Maintenance::Cycle.current(type) }.select{ |cycle| cycle && cycle.is_over? }\n cycles = []\n for old_cycle in old_cycles\n cycles << Ma...
10b5a12274e9d8cf614b645289b3502c
List entities which reference the current one. Once an entity is found, it will also search for related entities of this instance.
[ { "docid": "b48b4537727bba0060b16857b91e2a6f", "score": "0.627303", "text": "def related_entities(instances = [])\n self.class.roles.each do |role_name, role|\n instance_index_counterpart(role).each do |irv, instance|\n if instance.class.is_entity_type && instance.is_identifie...
[ { "docid": "811a199acf9e2227f45175050ddccc11", "score": "0.6286099", "text": "def references\n self.class.where reference_id: self.id\n end", "title": "" }, { "docid": "4d093d5ade8b2d1901e2d0cab5d386d1", "score": "0.60865146", "text": "def entities\n result = []\n self.enti...
ba2e9d671f4a0bfcee38f742396a0874
destroy the current chef session
[ { "docid": "af9a79c9a57a6c9370ef56caf3b75bf3", "score": "0.72968316", "text": "def destroy\n\t\tsession[:chef] = nil\n\t\tflash[:success] = \"You have logged out\"\n\t\tredirect_to root_path\n\tend", "title": "" } ]
[ { "docid": "8d3ee013f0b7856101ab0acdee6a0f44", "score": "0.68906057", "text": "def destroy\n @session.clear\n end", "title": "" }, { "docid": "732fa3755b229a1459a2d32b4745e386", "score": "0.66458625", "text": "def teardown\n nodes.each do |k,v|\n storage = RSpec.confi...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "3d2a7c388c877e061ebcb5e738777a13", "score": "0.0", "text": "def set_admin_week\n @admin_week = Week.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;...
ed8e201936d4d880d6cfaeec2bd7155e
Take a token off the input string and return it
[ { "docid": "af789b54a3162c21f1bf8d54a7324850", "score": "0.69486016", "text": "def pop_token(input)\n # can't use ^ since it matches line beginnings in mid-string\n token = case input\n when /\\A(\\s|;.*$)/ # ignore whitespace and comments\n @@lines += Regexp.last_match[1]....
[ { "docid": "0ddd0585d65ed25ebfce1d6f9489d098", "score": "0.771567", "text": "def get_token(string)\n result = string[0]\n if [\",\",\"(\",\")\",\"=\"].include?(result) || OPERATIONS[result]\n\n elsif (\"a\"..\"z\").include?(result) || (\"A\"..\"Z\").include?(result)\n #go until find so...
e959f717aa7f5f56745b455092fbf0a0
Attempts to find an integration that matches the given class. This will look through all of the builtin integrations under the StateMachines::Integrations namespace and find one that successfully matches the class. == Examples class Vehicle end class ActiveModelVehicle include ActiveModel::Observing include ActiveModel...
[ { "docid": "d2e396a8ce549db957db410b4047f98d", "score": "0.60334563", "text": "def match(klass); end", "title": "" } ]
[ { "docid": "9a8141c7aadd924c5dc2b6ffc9e889fd", "score": "0.55529696", "text": "def matches?(klass); end", "title": "" }, { "docid": "b6129ce7e6055b777b5b80943ff29058", "score": "0.5340041", "text": "def findExactClassMatch(name)\n fname = name.tr(':', '_')\n return ClassIndex.c...
35439ff1fb0b28832af5ecf3e0bbd5f5
Returns a collection of tracking tags available to the current account.
[ { "docid": "4428bf265aa9701b0f06efba7e95acae", "score": "0.62446475", "text": "def tracking_tags(id = nil, opts = {})\n load_resource(TrackingTag, id, opts)\n end", "title": "" } ]
[ { "docid": "118540c2eaab1a1475b83fcdb3d30f44", "score": "0.71516377", "text": "def tags\n get.tagGuids\n end", "title": "" }, { "docid": "2881d2519b8553febe55ae88bb7d81ab", "score": "0.6972651", "text": "def local_tags\n @local.tags\n end", "title": "" }, ...
72d3b20b9a6dff8ca01478ed3e6e6610
Create, update or delete this attribute in the database. Don't call this directly; the save() method on details will handle everything for you.
[ { "docid": "25e5649557e1feab79695aca48083061", "score": "0.5415674", "text": "def save(place, history)\n results = nil\n if deleted?\n results = PublicEarth::Db::Place.one.remove_attribute_value(id, source_data_set_id) unless id.nil?\n history.deleted_attribute(se...
[ { "docid": "d1dcb1c96179505246f4b0c81c7e49e6", "score": "0.68069375", "text": "def save\n attr_hash = {}\n selection_attr = self.Id.nil? ? \"createable\" : \"updateable\"\n self.class.description[\"fields\"].select { |f| f[selection_attr] }.collect { |f| f[\"name\"] }.each { |attr| ...
0a48b7227e19c35c0ff5f8e94c1e0fba
If `StorageEncrypted` is enabled, the Amazon Web Services KMS key identifier for the encrypted DB cluster. The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key.
[ { "docid": "45e449fcfa18d5bc5d14e25d6030c170", "score": "0.71767455", "text": "def kms_key_id\n data[:kms_key_id]\n end", "title": "" } ]
[ { "docid": "22b1ec182c91c6cda5cde61b788545ae", "score": "0.72850406", "text": "def encryption_key\n @encryption_key ||= @keys.last.tap do |key|\n key.public_tags.encrypted_data_key_id = key.id if ActiveRecord::Encryption.config.store_key_references\n end\n\n @encryption_key...
de0c45ab33e33a8653c229ae717efff1
Determine if this git repo has already been downloaded.
[ { "docid": "1a95a42eca78d38bca45113e01b2fa08", "score": "0.0", "text": "def cached?\n cache_path.exist?\n end", "title": "" } ]
[ { "docid": "d5b764847dc226513d11fd160a92cab5", "score": "0.7421902", "text": "def exists\n Dir.exist? self.repo_local_url\n end", "title": "" }, { "docid": "c7292fc0273bc42c03a49b722e9259d9", "score": "0.72249484", "text": "def has_repo?\n return repo != \"\"\n end", "tit...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "0f630949b34c283c068e1f7b5f21ddaf", "score": "0.0", "text": "def usuario_params\n params.require(:usuario).permit(:nombre, :rut, :mail, :fechaingreso, :foto, :curso, :rol, :activo, :password, :password_confirmation, estudios_attributes: [:id, :carrera_o_curso, :institucion_id, :done, :_d...
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69802505", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781974", "text": "def strong_params\n params.requ...
f8f6d18a69d1c715a4cf90955e7acc1b
Writes out a description of the given test set to a specified file, so that we can read it back in later, at analysis time. This method is special it's called at testrun time.
[ { "docid": "b78871b1159814f2f9379984c6a09f55", "score": "0.86066633", "text": "def write_test_set_description(test_set)\n File.open(test_set_description_file.to_s, \"w\") do |file|\n file << test_set.to_s\n end\n end", "title": "" } ]
[ { "docid": "4d4f671a4921c9532172d8c9306d5524", "score": "0.70809287", "text": "def test_set_description_file\n FilePath.new(@testrun_directory, \"test-set-description.txt\")\n end", "title": "" }, { "docid": "a92720c573be428574efa133fbed1573", "score": "0.6843075", "text": ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "1cb23b546361cabd82b86bf3b5cbb543", "score": "0.0", "text": "def coder_params\n params.require(:coder).permit(:username, :email, :password, :password_confirmation)\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...
48285575978d2bab0c80784ef7d6dd5f
calculate correct cursor position
[ { "docid": "dea2c42eff756859a8990443099211e7", "score": "0.0", "text": "def navigate(command)\n @cursor_position = [0,0]\n case command\n when '0'\n navigate_to_begining\n when '$'\n navigate_to_end\n when 'e'\n navigate_to_word_boundary\n when /^t(.)$/...
[ { "docid": "910a82e6bc6df5d5c2d9c5f279237ede", "score": "0.7862414", "text": "def cur_pos\n @cursor.pos\n end", "title": "" }, { "docid": "1bd13f7f7a87d0ec0e0b7aa4e9be07e1", "score": "0.7806956", "text": "def update_cursor_pos\n @cursor_timer = 0\n pos = @text.v...
c2c6bc25f4220510f31a1236abefaaae
Allows this object to act like a hash (and therefore as a FlashHash via the include above).
[ { "docid": "77de72845b6f60aebaa0a6f05454f25e", "score": "0.0", "text": "def [](symbol)\n @parsed[symbol]\n end", "title": "" } ]
[ { "docid": "142bb3920d8b9ae8d2dc1f0b31c273ae", "score": "0.6653185", "text": "def hash\n wrapped_object(Hash)\n end", "title": "" }, { "docid": "a5e23f671dd691b971ea0c05c4dc4135", "score": "0.6626358", "text": "def hash\n end", "title": "" }, { "docid": "a5e23f67...
c971b464dc20459f2d961dd5b0fbf0be
Convert the selector to an aggregation pipeline entry.
[ { "docid": "5836bebd352ecbc35152e38b3a4e7943", "score": "0.46206003", "text": "def to_pipeline\n pipeline = []\n pipeline.push({ \"$match\" => self }) unless empty?\n pipeline\n end", "title": "" } ]
[ { "docid": "9929e8a77629c4c562cca3bef3eb37dd", "score": "0.55642253", "text": "def aggregate\n collection.group(options[:fields], selector, { :count => 0 }, AGGREGATE_REDUCE, true)\n end", "title": "" }, { "docid": "f7de37c5977a7e6b998392adf0041037", "score": "0.5305427", ...
db1344aedb91fa57588094c970b156a5
Read a 'hyperflex.VcenterConfigPolicy' resource.
[ { "docid": "eac5265d74c92bdbeca1e1c4f56f579a", "score": "0.53413445", "text": "def get_hyperflex_vcenter_config_policy_by_moid(moid, opts = {})\n data, _status_code, _headers = get_hyperflex_vcenter_config_policy_by_moid_with_http_info(moid, opts)\n data\n end", "title": "" } ]
[ { "docid": "3bd4a5f694ca9fe8be608ef49eab3795", "score": "0.569285", "text": "def create_hyperflex_vcenter_config_policy_with_http_info(hyperflex_vcenter_config_policy, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: HyperflexApi.create_hyperflex_v...
40c6022b3c680e784eb2ed7fdbc8e0a7
LiMaL API PART V. Installation and Removal of init.d Files Enable specified service, and all required services.
[ { "docid": "0b9610c287de678847d6e2646496c583", "score": "0.6266286", "text": "def ServiceInstall(service, rls)\n rls = deep_copy(rls)\n return 1 if !Builtins.haskey(@services, service) # service not found\n\n rls = GetServiceDefaultStartRunlevels(service) if rls == nil\n\n dep_s = Se...
[ { "docid": "0a22496871ea961d0d99ecabffde3bd5", "score": "0.6839047", "text": "def dist_install_init_service( name )\n sudo \"/sbin/chkconfig --add #{name}\"\n end", "title": "" }, { "docid": "b56b51a553d6336b744d5f0440c61aed", "score": "0.67336196", "text": "def initiate_inst...
d90a23f5e6a81475f54bb5a783803221
Returns the scheme (protocol) for this URI.
[ { "docid": "a17631a8b3edeb0aadc8bd9f98e2e2d1", "score": "0.7813024", "text": "def scheme\n return nil if @scheme.nil? || @scheme.strip == \"\"\n return @scheme\n end", "title": "" } ]
[ { "docid": "a979e9cbaeeb35b5038ee7bc065b9fcf", "score": "0.8593665", "text": "def scheme\n parsed_uri.scheme\n end", "title": "" }, { "docid": "8fef5327980cb8fb5487456b85f782c9", "score": "0.8415004", "text": "def scheme\n return @uri.scheme unless @uri.nil?\n retur...
fc227380b0f90714328c48f72313bedb
Returns a new sample object
[ { "docid": "8deefba322a9b1c161ad05a5f9b8be43", "score": "0.7729214", "text": "def new_sample\n @type.new\n end", "title": "" } ]
[ { "docid": "283789fcd2739213fe0842965ac220ed", "score": "0.7935543", "text": "def to_sample\n Sample.new(@id,@sampClass)\n end", "title": "" }, { "docid": "909e3cd6b3da714e47460d724ccbf3cb", "score": "0.74934983", "text": "def new_sample(sax, author_id)\n Sample.new.tap do |samp...
b2323a9fc62ad2275f5097bf150da9d8
Collection Route methods here This is basically an algorithm resource GET kinds/search
[ { "docid": "a30316d539ba7581fcd918d5412981d2", "score": "0.6554768", "text": "def search\n # if the user has selected to clear the search, or there is no search params, start from the top\n if params[:clear] || params[:q] == \"\"\n Rails.logger.info(\"Kind: #{params.inspect}\")\n redirec...
[ { "docid": "1bf4c807990efeff50a7acdaac0d6c6f", "score": "0.67930907", "text": "def index\n\t\t# default search terms will throw off the search, so remove them\n\t\tsearch_params = remove_default_search_terms(params[:search])\n\t\tlogger.debug(\"routes search params: #{search_params.inspect}\")\n\t\t@rou...
3c4499f9ded4d528bd97509cc1295f3f
return 1,2,3,4: 1to4wayfit return 0: not fitting
[ { "docid": "c996af0cedd35ba827e10ade1a288839", "score": "0.0", "text": "def fit_count(stone, board_x, board_y)\n if board_x < 0 || board_y < 0 || board_x > 11 || board_y > 7\n return 0\n end\n\n # is there a stone on this square?\n if self.get_stone(board_x, board_y)[\"color\...
[ { "docid": "6fe80f753c4384dc9b03424dff35b763", "score": "0.6134406", "text": "def best_fit; end", "title": "" }, { "docid": "23c4c1dd3158e41fba6af51b58d16216", "score": "0.60828215", "text": "def bestFit; end", "title": "" }, { "docid": "af144b2bdd6db8b6309338f8967b96e8",...
b354b68f0ea9021f2022483ffc36de0d
Amount of item purchased.
[ { "docid": "846537151211d1dd1a015734463d95f0", "score": "0.0", "text": "def amount\n params['ap_amount'].to_f\n end", "title": "" } ]
[ { "docid": "fb5984d8edf32db8b15f08046a6e83b1", "score": "0.81780964", "text": "def purchase_amount\n item_price * purchase_count\n end", "title": "" }, { "docid": "0915ad20580ab5afa051e27c6e281521", "score": "0.7853293", "text": "def purchase_total\n total = 0\n self.purcha...
f72d895734501c77a5f8881d54bca4ba
Test 3: New private education group
[ { "docid": "b1d76129721a5aef2a7976785e3fc031", "score": "0.7282314", "text": "def test03_PrivateEducation_TC_24399\n\t\tloginGroup\n\t\t\n\t\tsleep 5\n\n\t\t$private_group.fire_event(\"onclick\")\n\t\t$group_name.set(\"Education Group #{random}\")\n\t\t$group_nickname.set(\"Nickname #{random}\")\n\t\t$g...
[ { "docid": "ad72c1bc4aa788118dbfef318fb77e80", "score": "0.6854553", "text": "def create_test_group(user = nil, parent = nil, invalid = false)\n i = rand(1000)\n user = create_test_user(i) if user.blank?\n parent = user.groups.find(:last)\n unless invalid\n priv = user.priviledges.find_...
e787f6f1e3fabb85f95ac5b9a09e24f2
Return the LD4L::VirtualCollectionRDF::Item instance for the item at the specified position in an ordered collection
[ { "docid": "b9ff182b36cbcb466163b7e8bb431220", "score": "0.76575357", "text": "def get_item_at(position)\n # TODO Stubbed - Required definition and implementation\n end", "title": "" } ]
[ { "docid": "557812c255a123ef8a399ca59670a828", "score": "0.78408194", "text": "def item_at(position)\n @collection[position]\n end", "title": "" }, { "docid": "8359e896b36e75236bf05955af44791f", "score": "0.7100557", "text": "def item\n collection[index]\n end", "titl...
91174f8095de42ffaffa33cd46f38a62
pristup k datum a jejich uprava
[ { "docid": "2266c447580c96deceb99697428a1ef9", "score": "0.0", "text": "def [](row, sdata=nil)\n @data = Array.new if @data.nil?\n @data.push(Hash.new()) if (@data.last()).nil?\n (@data.last())[row] = sdata if !stdata.nil?\n end", "title": "" } ]
[ { "docid": "ad244bd0c45d5d9274f7612fa6fee986", "score": "0.62264186", "text": "def suivre; end", "title": "" }, { "docid": "07f4aba74008200310213b63a5f3de3f", "score": "0.6048753", "text": "def zuruecksetzen()\n end", "title": "" }, { "docid": "5ae2f4dff1b7f274304d0c204c...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "589279e5c8977f5614c011378245606d", "score": "0.0", "text": "def judge_params\n params.require(:judge).permit(:name, :recommendation, :details, :judicial_district)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.7121987", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.70541996", "text": "def expected_permitted_parameter_names; end", "title": "...
a6527a2ee7f77ed7a93a4b65ae76ef25
Obtain an InputSet object, used to define inputs for an execution of this Choreo.
[ { "docid": "32371e70628ac0b975755d8a20e90e21", "score": "0.0", "text": "def new_input_set()\n return LikePostInputSet.new()\n end", "title": "" } ]
[ { "docid": "d8eb34cfc5a1e737977f7023d4849c46", "score": "0.6741255", "text": "def new_input_set()\n return CreateObjectInputSet.new()\n end", "title": "" }, { "docid": "7c0d7c433cd4eb8e36bdc3a383e9ec33", "score": "0.65807736", "text": "def new_input_set()\n return Ru...
f6025700c6228fa7b24d9639b7b71b08
Traditional Allow credentials to be overwritten if needed
[ { "docid": "44cba2d35352fa5165611cedc484e48c", "score": "0.0", "text": "def credentials\n @credentials || self.class.credentials\n end", "title": "" } ]
[ { "docid": "bb1688bf6fb14e87dca6081fc77b26b5", "score": "0.70629734", "text": "def credentials\n super\n end", "title": "" }, { "docid": "5d60b7145bcea5a3c0e4f12286e04160", "score": "0.70211935", "text": "def allow_credentials\n\t\tself.credentials_allowed = true\n\tend", "ti...
4cbe25fed7435e30a14facd3c0f7e056
Walks through all job arguments and does proper expand operation for its value
[ { "docid": "6350e86b22d07dd298fde53d46e4d49a", "score": "0.82648957", "text": "def expand_job_arguments\n @job_args.each do |name, desc|\n type, _extras = desc\n value = instance_variable_get(\"@#{name}\")\n update_argument(name, type, value)\n end\n end", ...
[ { "docid": "f8a3250b9e2e9a8f096f1c672daade80", "score": "0.64573574", "text": "def expanded_args; end", "title": "" }, { "docid": "6611cda165091f0a59ef10ab86608fec", "score": "0.63842523", "text": "def expand!\n each_with_index do |arg, i|\n next if !arg.start_with?('-')\...
dcfab046df3bf948ea181bfd49050047
Returns an array with all tuples in this relation.
[ { "docid": "e4454fc53ad090311983c3ef13d87a1b", "score": "0.0", "text": "def to_a(okey = nil)\n okey = Tools.coerce(okey, Ordering) if okey\n ary = tuples.to_a\n ary.sort!(&okey.sorter) if okey\n ary\n end", "title": "" } ]
[ { "docid": "0adac31c31aca3cf1e5d064d72e9bfaf", "score": "0.77379817", "text": "def tuples\n relation = self.relation\n return relation if materialized?\n\n adapter.read(relation)\n end", "title": "" }, { "docid": "7bf4203f44c37f8fff68a534546a7d2d", "scor...
10851df56ea5957e2b95b8988be6004e
method to return the show size for any specified player
[ { "docid": "6d6cdc9683b3927e18fd6aa90b1c8ccd", "score": "0.6991487", "text": "def shoe_size(player_name)\n\n return stat_search(player_name, :shoe)\n \nend", "title": "" } ]
[ { "docid": "c5582e402abb3f0933cd06946c73e3f3", "score": "0.7288331", "text": "def shoe_size(player_name)\n select_player(player_name)[:shoe]\nend", "title": "" }, { "docid": "9e19b7cc13004e6303b3c5e4505e0ce8", "score": "0.72285277", "text": "def shoe_size(player_name)\n return get_...
8fb16a38034943fcbc21452cb2cba6c4
GET /blogs/1 GET /blogs/1.json
[ { "docid": "1eb2e8e39f4224aac84b186b1ab35a5b", "score": "0.0", "text": "def show\n @comment = Comment.new\n @blog = Blog.includes(:user, :comments, :favourites).where('id=?', params[:id]).first\n @head_title = @blog.title\n @masthead_picture = 'bg_new_post'\n if (@blog.status == 0)\n ...
[ { "docid": "309c2019db2d4e2dfd7579f55e52ad16", "score": "0.76985115", "text": "def index\n @blogs = Blog.all\n render json: @blogs\n end", "title": "" }, { "docid": "1d0439fac40ac935f4e67fbc0a52c313", "score": "0.7619311", "text": "def index\n @blogs = Blog.all\n\n r...
22cfcd2ec3373772dcba60990bf9d19c
inside this action, user authentication information is present
[ { "docid": "ba5fc4efd97e130501976616e87b5952", "score": "0.0", "text": "def create\n # pulls user from the DB by email.\n user = User.find_by(email: params[:session][:email].downcase)\n #rescue Mongoid::Errors::DocumentNotFound\n if user && user.authenticate(params[:session][:password])#4 po...
[ { "docid": "5169eb2f573a0490408cfe7656e32aed", "score": "0.7362423", "text": "def authenticate\n# logger.debug \"Host name is: \" + request.host\n# logger.debug \"session user is:\" + (session[:user].nil? ? \"nil\" : session[:user])\n# logger.debug request.headers[\"HTTP_AUTHORIZATION\"].nil? ? \"No ...
c299dc2ed0133ea114feb130d52184cb
The object to return in case of a failure.
[ { "docid": "8f7597b64b93031caf036b4171cb07dd", "score": "0.0", "text": "def failure_hash\n {\n page: ERB::Util.html_escape(render_to_string(view_for(false))),\n success: false\n }\n end", "title": "" } ]
[ { "docid": "eb67b5a9f9e1e03f1b7401addfdd26c0", "score": "0.67058176", "text": "def return_fail(results = nil)\n self.class.new input: build_new_result(results), success: false\n end", "title": "" }, { "docid": "3bb72142b5dde689a37cbfec6622a35d", "score": "0.66697997", "text":...
1cdab152e2e71b37e1fd728f85f742c5
POST /tracks POST /tracks.json
[ { "docid": "e364a4b937d0825df22f6739a361eb66", "score": "0.66081256", "text": "def create\n @track = Track.new(track_params)\n\n if @track.save\n redirect_to track_path(@track.id)\n else\n render :template => \"tracks/new\"\n end\n end", "title": "" } ]
[ { "docid": "e2ed2d568a3910532d3ba0dd5bcf3782", "score": "0.7535632", "text": "def create\n @track = Track.new(track_params)\n if @track.save\n render json: @track, status: :created, location: @track\n else\n render json: @track.errors, status: :unprocessable_entity\n end\n end", ...
42070f132284b3aec6b4efe4c44b2dea
Executes the given SQL statement. If additional parameters are given, they are treated as bind variables, and are bound to the placeholders in the query. Note that if any of the values passed to this are hashes, then the key/value pairs are each bound separately, with the key being used as the name of the placeholder t...
[ { "docid": "acd51bce225b5131dddf991d0fd27375", "score": "0.6477794", "text": "def execute sql, bind_vars = [], *args, &block\n # FIXME: This is a terrible hack and should be removed but is required\n # for older versions of rails\n hack = Object.const_defined?(:ActiveRecord) && sql =~ /^P...
[ { "docid": "d1f0128f37f7130ec36f687454bb4d25", "score": "0.7192022", "text": "def execute( sql, *bind_params )\n stmt = prepare( sql )\n stmt.bind( *bind_params )\n if block_given? then\n stmt.each { |row| yield row }\n else\n return stmt.all_rows\n end\n ensure...
0ffaa6074c482dd3691ecb348b66f49f
This method takes in an Erg Array (of start and end time and power tuples) and strips out duplicates. Requires the array, and returns the simplified erg array.
[ { "docid": "b6807ba1af168b4d617d0cc48f25c9cf", "score": "0.7267126", "text": "def simplifyErgArray(array)\n current=0 #the \"start\" element\n lookingAt=1 #the element we're looking at to decide if it's the same as current\n toRemove=[] #duplicate elements to remove\n\n while (current<array....
[ { "docid": "39babc027999b5e953c8baa5ed2e45c4", "score": "0.6014642", "text": "def remove_duplicates(array)\n new_array = []\n idx1 = 0\n while idx1 < array.length\n idx2 = 0\n while idx2 < idx1\n break if array[idx1] == array[idx2]\n idx2 += 1\n end\n\n new_array << array[idx1] ...
78c9c42a8da8a03950199a475c187d47
generate a true hex string (byte array) from a hex representation of a string used for validating webmoney hashes
[ { "docid": "4b8a6c3eadc9f9648c552ecde266b7ce", "score": "0.0", "text": "def hex16(s)\n ret_str = ''\n s.scan(/[0-9a-f]{2}/).each do |a| # split in bytes\n ret_str << a.to_i(base=16).chr\n end\n return ret_str\n end", "title": "" } ]
[ { "docid": "1947e4125b4d2cd8a1501a3818760f43", "score": "0.7547732", "text": "def hex_to_s (str)\n \nend", "title": "" }, { "docid": "406cf33ee09801e2170e04edb925f18e", "score": "0.73121494", "text": "def hexencode(str); end", "title": "" }, { "docid": "32465e413ecef0d4e...
d49d0ac20729cbf8192ad8e4f1c38132
Create a map and initialize the prospectors
[ { "docid": "92ab0a95ccc783ed593a1b6fec09cccd", "score": "0.0", "text": "def create_graph(seed, num_prospectors)\n initialize_locations seed\n initialize_prospectors num_prospectors\n initialize_neighbors\n [@locations, @prospectors]\nend", "title": "" } ]
[ { "docid": "4828f18b5aea145e132ca2343b7a8bc7", "score": "0.75421464", "text": "def setup_map\n @map = [\n ['Enumerable Canyon', 'Duck Type Beach', 'Monkey Patch City'],\n ['Duck Type Beach', 'Matzburg', 'Enumerable Canyon'],\n ['Monkey Patch City', 'Nil Town', 'Matzburg'],\n ...
0b5a523a67fec3b63b07e6bf902bd9b1
Set the value of the Region input for this Choreo.
[ { "docid": "2b6e5a9f3e3b0082b92843b0f1ab585f", "score": "0.71082425", "text": "def set_Region(value)\n set_input(\"Region\", value)\n end", "title": "" } ]
[ { "docid": "91a66fa32385138fa93b88bb27d8e2cc", "score": "0.73759305", "text": "def set_Region(value)\n set_input(\"Region\", value)\n end", "title": "" }, { "docid": "8a930672b32bf737d01fdc864c1f1bda", "score": "0.72557354", "text": "def region=(value)\n @r...
beeb477318d392fb7c0e7c86bc7041d1
GET /points/1 GET /points/1.json
[ { "docid": "730a8b31d629ac64cd308ef363f53a8b", "score": "0.67016053", "text": "def show\n authorize! :show, @user, :message => 'No estas autorizado como administrador.'\n @point = Point.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render j...
[ { "docid": "14a3de1e7330068db9e70ab53aaa7123", "score": "0.7675267", "text": "def point\n statistic = Statistic.points(params[:points])\n render json: statistic, status:200\n end", "title": "" }, { "docid": "f1644d396921064098d8658c64daafae", "score": "0.76543194", "text"...
38896bf4dc27446bc2984358bc6531b9
POST /admin/players POST /admin/players.json
[ { "docid": "96867ac76c78ee7355563c74ce081913", "score": "0.69832265", "text": "def create\n @player = Player.new(params[:player])\n @player.skip_confirmation!\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to admin_player_url(@player),\n n...
[ { "docid": "e06ade4095ab2f07645f6ef1f7474d36", "score": "0.7432981", "text": "def create\n @admin_player = Player.new(admin_player_params)\n\n respond_to do |format|\n if @admin_player.save\n format.html { redirect_to @admin_player, notice: 'Player was successfully created.' }\n ...
af43ba3211e882dd09652646f6824102
This is a template method that is used to escape results values (returned in execute) that would cause the XML to be invalid. This method is not necessary if values do not contain character that have special meaning in XML (&, ", ), however it is a good practice to use it for all return variable results in case the val...
[ { "docid": "9924368ca2def54b5d463405898949da", "score": "0.0", "text": "def escape(string)\n # Globally replace characters based on the ESCAPE_CHARACTERS constant\n string.to_s.gsub(/[&\"><]/) { |special| ESCAPE_CHARACTERS[special] } if string\n end", "title": "" } ]
[ { "docid": "8bac79ec1cf079b85a6a8276aa1f36d0", "score": "0.6441575", "text": "def escape_value(value)\n value = escape_not_value(value)\n value = escape_sign_value(value)\n value = escape_quotation_value(value)\n value = escape_sql_value(value)\n return value\n en...
46ab70bf99d5f28d031df7a70d1be539
Maximum likelihood estimate using only the given 'elite' solutions.
[ { "docid": "6848b9c7e7a5b1e7642c001c5a56f987", "score": "0.60078305", "text": "def estimate_ml(elite)\n [elite.mean(0), elite.stddev(0)]\n end", "title": "" } ]
[ { "docid": "bb9aa34809cde3b53929db41dfa971db", "score": "0.6126606", "text": "def solve_max\n # create LP problem (maximize)\n lp = create_lp\n lp.set_maxim\n # set objective and add constraints\n lp.set_add_rowmode(true)\n set_objective(lp)\n add_linear_constraints(lp)\n # solve...
f99feeabb0c0318113619e9490f4d420
DELETE /contacts/1 DELETE /contacts/1.json
[ { "docid": "355ca94849bf1e143fe5e6981519d869", "score": "0.0", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to admin_contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "17bbac4c2997ecb6a6d6dceb6947218c", "score": "0.78873235", "text": "def destroy\n puts \"delete contact\"\n contact = Contact.find(params[:id])\n contact.destroy\n render json: contact\n end", "title": "" }, { "docid": "db31580cc47cc5b92920ab8f13760712", "score": ...
c31706eecf6e69e2014039c82a46b0ba
returns the flight number of the flight
[ { "docid": "7c3cbb18795458f5bd3a1e91b4344177", "score": "0.8392692", "text": "def flight_number\n @raw_data[:FlightNumber]\n end", "title": "" } ]
[ { "docid": "7f1282d3ab48d4929c53ea448625bdb2", "score": "0.84149975", "text": "def flight_number\n return nil if flight_code.nil?\n return flight_code unless flight_code_has_airline_code?\n flight_code[2..flight_code.length - 1]\n end", "title": "" }, { "docid": "54f7dded60fbab6db5...
1e224bfed650729f9fd796e0eaa5b31c
Create the new complex criterion.
[ { "docid": "b5262fb8d7fd296adf093b4b5edb3e2b", "score": "0.0", "text": "def initialize(opts = {})\n @key,@state = opts[:key],opts[:state].to_s\n @operator = '$elemMatch'\n end", "title": "" } ]
[ { "docid": "122696b12f0020018683bf1e0fc5043b", "score": "0.60557985", "text": "def + (n_complex)\n\t\tComplejo.new(@real+n_complex.real, @imaginaria+n_complex.imaginaria )\n\tend", "title": "" }, { "docid": "80b28ffcad12e5e1a587a779255e3d47", "score": "0.5761099", "text": "def comple...
0c31a1c5e644f6cf70929db0bd190c09
Display the genre names in a numbered list and ask the user to select one
[ { "docid": "4e3bdefce91a142b39330e6684ff348f", "score": "0.7540694", "text": "def read_genre()\n\tcount = $genre_names.length\n\ti = 0\n\tputs 'Genre: '\n\twhile i < count\n\t\tputs \"#{i} \" + $genre_names[i]\n\t\ti += 1\n\tend\n\tselectedGenre = read_integer_in_range('Please select your album genre.',...
[ { "docid": "4d41b0d467e2b9b0b51f0cce78bd13a9", "score": "0.7902743", "text": "def list_genres\n\n puts \"1. Action\"\n puts \"2. Adventure\"\n puts \"3. Fighting Games\"\n puts \"4. First-Person Shooters\"\n puts \"5. Flight/Flying\"\n puts \"6. Party\"\n puts \"7. Platformer\"\n ...
2fd552a0158cc95794b55471d4c23208
POST /cargas or /cargas.json
[ { "docid": "ed80d6fd578501e887d2663272becd10", "score": "0.0", "text": "def create\n @carga = Carga.new(carga_params)\n\n respond_to do |format|\n if @carga.save\n format.html { redirect_to @carga, notice: \"Carga was successfully created.\" }\n format.json { render :show, statu...
[ { "docid": "ff0e7431cc4e94a0c35add655d2a0ac4", "score": "0.6348956", "text": "def add_tenant_circle(args = {}) \n post(\"/tenantcircles.json/\", args)\nend", "title": "" }, { "docid": "30c3df8c2c53166f52e7608309a036b5", "score": "0.5846324", "text": "def create\n @cargo = Cargo.ne...
578a6492ac389086a23f7abd74ad6cbd
Return the total number of reads from all the tags in the list.
[ { "docid": "6ac5a4ae78609eba9fe730154c5e8435", "score": "0.79765356", "text": "def read_count \n \n count = 0\n \n self.each do |tag|\n count += tag.count\n end\n \n return count\n \n end", "title": "" } ]
[ { "docid": "14a757dc7e7f8c4f56b73ad69db4c3b4", "score": "0.73742205", "text": "def number_of_tags\n total = 0\n\n self.tags.each do |tag, amount|\n total += amount\n end\n\n return total.to_f\n end", "title": "" }, { "docid": "36fe181292eacf1de685bb3...
e02a19fb32a00eb98728fad447e0926a
formats keys for printing input
[ { "docid": "8fe6211f4380b015f3d5b950d54ccdc4", "score": "0.0", "text": "def formatted_jira_keys(jira_keys)\n jira_keys.each do |jira|\n #prints string at beginning of key pair\n string_of_dashes\n puts 'Issue no.: ' + jira[:issue_no]\n puts 'Summary: ' + jira[:summary][0..100]\n puts 'D...
[ { "docid": "64021390471c23a6a66f45df00950719", "score": "0.7605155", "text": "def key_format(*args); end", "title": "" }, { "docid": "c361792b6e128a232ea46f6b6e44406a", "score": "0.6958892", "text": "def ssh_key_display_format\n ERB.new <<-FORMAT\n Name: <%= key.name %>\n ...
31a882ffeae44cdb884f8920129ce3bf
Menu function NOT USED
[ { "docid": "a10115064684904eeed2862b8d56e8d5", "score": "0.0", "text": "def menu(val)\n p val\nend", "title": "" } ]
[ { "docid": "ae720af357ce3809866f4492d121d2a9", "score": "0.8421687", "text": "def menu\n\n end", "title": "" }, { "docid": "c11a2619c2647dd26864741477a5e856", "score": "0.83534884", "text": "def menu\n end", "title": "" }, { "docid": "c11a2619c2647dd26864741477a5e856"...
fd49e0fb0d159509e6009937574c6add
Test if the current user is authenticated
[ { "docid": "d70538132e58cca01f66624f77d614e5", "score": "0.8482658", "text": "def authenticated?\n current_user?\n end", "title": "" } ]
[ { "docid": "c7a6b0b1678a1c5d0e96efc05486628a", "score": "0.8576886", "text": "def authenticated?\n !current_user.nil?\n end", "title": "" }, { "docid": "d54918d344819c839a923233f012d0c4", "score": "0.85705066", "text": "def authenticated?\n !current_user.blank?\n ...
e77862d17acd13e1ef4a4499e60ad7c9
Cut to end enable/disable
[ { "docid": "b4cd073c2b2a6b336a0ab6bf3a3385b3", "score": "0.66616595", "text": "def toggle_cut_to_end(buffer)\n mumble buffer, 'Toggle cut to end'\n end", "title": "" } ]
[ { "docid": "a7beb8f706dc15dc78848a11ab5419fb", "score": "0.578224", "text": "def on_disable; end", "title": "" }, { "docid": "c382eba94201c40397b77e3792f227f4", "score": "0.57795954", "text": "def control_switches(start_var, end_var, bool)\n value = eval_bool(bool)\n add_comman...
5abbbb29ff373ffdd1c1d675549e7288
classify output the results
[ { "docid": "4cfef5a544c4773505c71f0f17a184a7", "score": "0.0", "text": "def output_data(data_tab)\n\t#first element of data table containts header info\n\theader = data_tab[0]\n\t#all the other elements are mesaurements\n\tdata = data_tab[1..data_tab.length-1]\n\treturn if data.empty?\n\t#does the data_...
[ { "docid": "82aaeb278d8733ea5c178120f7815427", "score": "0.7010154", "text": "def classify; end", "title": "" }, { "docid": "82aaeb278d8733ea5c178120f7815427", "score": "0.7010154", "text": "def classify; end", "title": "" }, { "docid": "749635b86f7067bd88d99be8eb6497b0",...
8b3321eb3cfcfc307b96a24967ee9ec7
A fake page refresh that works by going to a fixed URL, and then back to the current page. In other words, we totally fake this _
[ { "docid": "8206d3ce664254f95d6b69831511a748", "score": "0.6832382", "text": "def refresh\n url=$driver.current_url\n $driver.navigate.to 'http://www.google.com/'\n quiesce\n $driver.navigate.to url\n quiesce\n $driver.current_url.should == url\n end", "title": "" } ]
[ { "docid": "218c909862e9dd7e71d170dd5ae9d3eb", "score": "0.71308887", "text": "def reload\n Howitzer::Log.info \"Reload '#{current_url}'\"\n visit current_url\n end", "title": "" }, { "docid": "ad09bd0bf511e618629b86fe79a5019a", "score": "0.7105566", "text": "def r...
2bc4bfffdafa3806a2b1472d0b2b7a7e
Feature flag related methods
[ { "docid": "33c0147fd7f70f74cab3c7dc3f8a828d", "score": "0.5862491", "text": "def feature_flag_enabled?(identifier)\n FeatureFlag.active.where(resource: user, identifier: identifier).exists?\n end", "title": "" } ]
[ { "docid": "80678fd1e38fc0367f1422f8f08dc43f", "score": "0.7768102", "text": "def feature_flags\n 0\n end", "title": "" }, { "docid": "83628f9d56a9ba9d157a4ee1e8c429d9", "score": "0.74210334", "text": "def flags; end", "title": "" }, { "docid": "507d46af90ebe99cf2...
abb75bb53e497d8297884e2c59a50846
GET /accounts/1 GET /accounts/1.json
[ { "docid": "335b170d3ce5d9ecbfce9dc3051a426e", "score": "0.74302703", "text": "def show\n authorize @accounts\n render json: @account\n end", "title": "" } ]
[ { "docid": "e7d5770316fcf0c9dfe4c64e4a22d339", "score": "0.76854396", "text": "def accounts\n get('/accounts')['accounts']\n end", "title": "" }, { "docid": "1c1a4b30252257377313131349240c9d", "score": "0.76389235", "text": "def get_accounts()\n http_get(accounts_url)\n ...