query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
5302a711545da07f9315857c7e93dd2d | verify the hash of the given array of blocks print error message if any hash is wrong the range to check is in [start_index, end_index) | [
{
"docid": "57538c83fae631b08b2b6bce2f8db532",
"score": "0.7954338",
"text": "def valid_hash?(blocks, start_index, end_index)\n index = start_index\n loop do\n break if index >= end_index\n\n # verify the index-th line here\n strings = blocks[index].split('|')\n str = strings[0...-1].join(... | [
{
"docid": "7e57abe750a2cd36c5f7b58cce2ca5ee",
"score": "0.68385714",
"text": "def hash_check(block)\r\n unpacked_string = block.line_num + '|' + block.last_hash + '|' + block.transactions + '|' + block.time_val\r\n unpacked_string = unpacked_string.unpack('U*')\r\n sum = 0\r\n unpacked_stri... |
e7c77e77ff0fc607924d25d55e2b6b97 | Register a block which will be called only when necessary during the lookup of tasks | [
{
"docid": "f92d3132d1345311478dce46e18faa09",
"score": "0.0",
"text": "def register_lazy_definition(&block)\n cur_scope = @scope\n lazy_definitions[cur_scope.path] ||= []\n lazy_definitions[cur_scope.path] << ->() { in_scope(cur_scope, &block) }\n end",
"title": ""
}
] | [
{
"docid": "b5ed1e6de274ca245aa84100b4f53d51",
"score": "0.6761756",
"text": "def register_block_for(type, &blk); end",
"title": ""
},
{
"docid": "3d8363b59f626a49b0f311a78264678d",
"score": "0.6702764",
"text": "def run_registration_block(&block)\n instance_exec &block if block... |
9eb869a36f4597626699cec1f6e36195 | Returns a list of all files in this directory that match `pattern`, relative to the directory root. This includes files within HRX files in this directory. | [
{
"docid": "367251208c4d96fa16de79ec1555d36f",
"score": "0.77391195",
"text": "def glob(pattern)\n if hrx?\n @archive.glob(pattern).select {|e| e.is_a?(HRX::File)}.map(&:path)\n else\n recursive = pattern.include?(\"**\")\n physical_pattern =\n if recursive\n \"{#{Fi... | [
{
"docid": "65310fdfef10f61a2549657ef5069aba",
"score": "0.77161795",
"text": "def glob(pattern)\n if hrx?\n @archive.glob(pattern).select {|e| e.is_a?(HRX::File)}.map(&:path)\n else\n recursive = pattern.include?(\"**\")\n physical_pattern = recursive ? \"{#{pattern},**/*.hrx}\" : ... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "5b8ac6bc791b43d8eb4218ae5e197997",
"score": "0.0",
"text": "def program_uses_relation_params\n params.require(:program_uses_relation).permit(:program_id, :relation_id)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7497761",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6959097",
"text": "def strong_params\n params.require(:request).permit(param_white... |
5f72ea2d64022aa0d0145f311a56c864 | Gets the object value (an instance of a PRclass) from a node. This function is needed since it doesn't always suffice with calling evaluate() on the node, as is the case when the node for example is a VariableReferenceNode. | [
{
"docid": "603567eb112b4db0945598d193c537e1",
"score": "0.6891876",
"text": "def object_value(node, scope_frame)\n\tobj = node.evaluate(scope_frame)\n\tif obj.is_a?(NAVariable)\n\t\treturn obj.value\n\tend\n\treturn obj\nend",
"title": ""
}
] | [
{
"docid": "5c81b47fed2dd3744dbe513c28b13750",
"score": "0.6616929",
"text": "def ctValue\n return @rawObject if (@rawObject.kind_of?(Ruby::Node))\n ctValue = Helpers.convertRubyToRipperObject(@rawObject)\n #ctValue.prolog = prolog if ctValue.respond_to?(:prolog)\n ctValue\n end",
"titl... |
0d0d2b1d7252be1fac67880733e01dbc | create method that will update a recipe and show the results. | [
{
"docid": "d22893ecb4617568c47858531d5b5851",
"score": "0.0",
"text": "def update_recipe(db, update_info)\n db.execute(\"UPDATE RECIPES SET recipes='#{update_info[:recipe_info]}' WHERE id='#{update_info[:recipe_id]}'\")\nend",
"title": ""
}
] | [
{
"docid": "108e59f3cbd46e39151f2aeded0ac6fa",
"score": "0.75666094",
"text": "def update\n respond_with @recipe.update( description: params[ :description ], title: params[ :title ] )\n end",
"title": ""
},
{
"docid": "8a17f415d6e8667c9b16382de4a873b4",
"score": "0.71653384",
"te... |
80bb6c663be3054f787eb42d82d4b0f4 | Create a claim_reward_balance operation and broadcasts it right away. Examples: voilk = VoilkRuby::Chain.new(chain: :voilk, account_name: 'your account name', wif: 'your wif') voilk.claim_reward_balance!(reward_vsd: '100.000 VSD') | [
{
"docid": "2a30938c7fec4eb8e93675e24e3c69f2",
"score": "0.7491559",
"text": "def claim_reward_balance!(permlink); claim_reward_balance(permlink).broadcast!(true); end",
"title": ""
}
] | [
{
"docid": "76d9e03e36fb0c6da643ee1d0c035de4",
"score": "0.7206959",
"text": "def claim_reward_balance(options)\n reward_steem = options[:reward_steem] || '0.000 STEEM'\n reward_sbd = options[:reward_sbd] || '0.000 SBD'\n reward_vests = options[:reward_vests] || '0.000000 VESTS'\n \n... |
671a3eb28166f1e9febcff5179ada3f1 | now available in all views | [
{
"docid": "356eecbee1c9c64698de6d9a5cb99f77",
"score": "0.0",
"text": "def most_recent_book\n book = Book.find_by(id: session[:most_recent_book_id]) if session[:most_recent_book_id]\n if book\n book\n else\n session[:most_recent_book_id] = Book.last.id\n Book.last\n end\n en... | [
{
"docid": "18362da27fb3966ac2a80ac45e32ec42",
"score": "0.7422432",
"text": "def views; end",
"title": ""
},
{
"docid": "18362da27fb3966ac2a80ac45e32ec42",
"score": "0.7422432",
"text": "def views; end",
"title": ""
},
{
"docid": "c5d23a1d8161e7d7adcc240789013bd6",
"... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "3dc4ca15b084ae5a33624c63c1c52cae",
"score": "0.0",
"text": "def set_cryptostable\n @cryptostable = Cryptostable.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163754",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6045816",
"text": "def action_hook;... |
cf7b699561d3a7da129a8a8bdd4d8f1a | GET /tweets/1 GET /tweets/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "fce057d1ab7b06aa74bf2c38d3ef7120",
"score": "0.77780634",
"text": "def tweets\n user = User.find(params[:id])\n render json: user.list_tweets, status: :ok\n end",
"title": ""
},
{
"docid": "df2f7b385ae5789e5610a0e261193cd0",
"score": "0.77396023",
"text": "def inde... |
4e6a99a897de54f9dc4565f6298a2de2 | POST /for_pags POST /for_pags.json | [
{
"docid": "0a5890a5f2ed5bf19581c0c78724d9bc",
"score": "0.6289221",
"text": "def create\n @for_pag = ForPag.new(for_pag_params)\n\n respond_to do |format|\n if @for_pag.save\n format.html { redirect_to @for_pag, notice: 'For pag was successfully created.' }\n format.json { rend... | [
{
"docid": "b9ea413de76c9c655e767bd1d4db7c07",
"score": "0.6356638",
"text": "def index\n\n @pagy, @posts = pagy(Post.cleaner)\n\n paginationObj = {\n page: @pagy.page,\n prev: @pagy.prev,\n next: @pagy.next,\n last: @pagy.last, \n }\n\n render :json => { postsArr: @... |
fc4f05a3f68c2e158e80a22ac8834c85 | Applies the value transform for data loaded from the database. | [
{
"docid": "2667b0f2cda7a8144d06f508e675f0c3",
"score": "0.0",
"text": "def transform_load(r)\n r.inject({}) do |m, kv|\n k, v = *kv\n m[k] = (tt = @transform[k]) ? tt[0][v] : v\n m\n end\n end",
"title": ""
}
] | [
{
"docid": "3d9958908e1ec3d8c5be6a14e398760a",
"score": "0.7107071",
"text": "def transform_values!; end",
"title": ""
},
{
"docid": "1ace1619a59b4eb4d65dfcdaf395eb93",
"score": "0.6579869",
"text": "def transform(value)\n value\n end",
"title": ""
},
{
"docid... |
3b826b26e95f6641981684ee5ff65358 | Provide a user friendly representation | [
{
"docid": "7096b23651caedaed74bf1d9ddacf642",
"score": "0.0",
"text": "def to_s\n values = @params.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Bulkexports.V1.ExportInstance #{values}>\"\n end",
"title": ""
}
] | [
{
"docid": "8813d23ea53482a215f5e5b971468e2d",
"score": "0.75752455",
"text": "def representation; end",
"title": ""
},
{
"docid": "dad7e7041772f906c35bc43f5390a274",
"score": "0.70985687",
"text": "def to_human\n super\n end",
"title": ""
},
{
"docid": "1e72b... |
e96910d8ad8429d73311a50735fa6d98 | Cancels notification for given task instance | [
{
"docid": "cef444f4a88efb5fb24ef64cab612eb0",
"score": "0.6194435",
"text": "def cancel_notification_with_http_info(id, t_instance_id, notification_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UserTasksAdministrationBPMApi.cancel_notifica... | [
{
"docid": "544c8eb076103ebc38c72c0a76eff0f6",
"score": "0.7483061",
"text": "def task_cancel(task_opaqueref)\n @connect.call('task.cancel', @session, task_opaqueref)\n end",
"title": ""
},
{
"docid": "687dcc228e8908b05b362d6f31deeca9",
"score": "0.67651594",
"text": "def cancel(... |
990a638f3090c35e512f878a652a2e45 | DELETE /hmm_score_criteria/1 DELETE /hmm_score_criteria/1.json | [
{
"docid": "6375cfed49753ed25c02a77189674c76",
"score": "0.78109443",
"text": "def destroy\n @hmm_score_criterion = HmmScoreCriterion.find(params[:id])\n @hmm_score_criterion.destroy\n\n respond_to do |format|\n format.html { redirect_to hmm_score_criteria_url }\n format.json { head :... | [
{
"docid": "d806f7e3391c3ff945337669ea950778",
"score": "0.7189049",
"text": "def destroy\n @score_criterium = ScoreCriterium.find(params[:id])\n @score_criterium.destroy\n\n respond_to do |format|\n format.html { redirect_to score_criteria_url }\n format.json { head :no_content }\n ... |
64f876aa888ab19548479ca287f28ca6 | Returns the authorization header from the request's headers | [
{
"docid": "1c75ac378a52935e37f4f8242cb5860c",
"score": "0.8721065",
"text": "def authorization_header\n @request.authorization_header\n end",
"title": ""
}
] | [
{
"docid": "a79f2a662609a5d8aef084738c179d36",
"score": "0.88159823",
"text": "def header_authorization\n request.headers['Authorization']\n end",
"title": ""
},
{
"docid": "3a7f9750bfcea35074f2334978ce677c",
"score": "0.8797777",
"text": "def auth_header\n request.h... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "b2149127533d643939e3e192f9f45142",
"score": "0.0",
"text": "def set_admins_area_code\n @admins_area_code = Admins::AreaCode.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... |
9f8f1d344f6256fbcee3c5b630d88184 | Set the value of the PageStart input for this Choreo. | [
{
"docid": "a0dd0c9a0e51e43e1988140d64e46c00",
"score": "0.80142874",
"text": "def set_PageStart(value)\n set_input(\"PageStart\", value)\n end",
"title": ""
}
] | [
{
"docid": "c2aa7ea50b184f9296ef33b5d2a67dc8",
"score": "0.75134754",
"text": "def set_start_page(start_page = nil)\n return if start_page.nil?\n\n @page_start = start_page\n @custom_start = 1\n end",
"title": ""
},
{
"docid": "f4646e25f1c733be640133479fc8c8ae",
"score": "0... |
c854a8ef8e94459246800134564ebf40 | Check that 'krb5.conf' is difined in cm.list and exist. | [
{
"docid": "cb6356e4b15ab2dd0c426bd18b4dddce",
"score": "0.77965415",
"text": "def chk_krb_config(cm, cm_config, svc_type)\n msg = \"'krb5.conf' is not defined in #{CM_LIST} for '#{cm}:#{svc_type}'\"\n krb5conf = cm_config.dig('service', svc_type, 'kerberos', 'krb5.conf')\n raise CM... | [
{
"docid": "07c03721827423c34b239e2c494d1e9a",
"score": "0.65653414",
"text": "def check_conf\n ['user', 'pass', 'cookie'].map{|i|\n if not $CONF.keys.include?(i)\n aputs \"Configuration error: key #{i} not found\"\n exit 2\n end\n if not $CONF[i]\n aputs \"Configu... |
fa7808b6af359d07a42070a4af054a68 | GET /api/uploads/:tid/status Return status of this transaction | [
{
"docid": "8077c9a05ad864911673a54af39f92ea",
"score": "0.7106764",
"text": "def trx_status\n #parse out trx_id\n trx_id = params[:tid]\n\n begin\n status = ApiTransaction.find(trx_id).trx_status\n render json: { trx_id: trx_id, status: status }, status: :ok\n rescue ActiveRecord:... | [
{
"docid": "adf167964bed340bda2b0a48f454c092",
"score": "0.6821727",
"text": "def tsv_status\n tsv_file = TsvFile.where(:uuid => params[:uuid]).first\n status = tsv_file.status\n percentage = tsv_file.percentage\n response = {\"status\" => status, \"percentage\" => percentage}\n respond_t... |
3370ee32356e9a65ced503a18917073f | GET /style_settings/1 GET /style_settings/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "aeb4791348876558a3518ba53ba5f05c",
"score": "0.7602092",
"text": "def index\n @style_settings = StyleSetting.all\n end",
"title": ""
},
{
"docid": "8eca8c41c66b5ae17536cd0a0bb91d7e",
"score": "0.70602643",
"text": "def set_style_setting\n @style_setting = StyleSe... |
a69cd1c7ca8d012167f0a811dea00f9d | Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.notifications.new_message.subject | [
{
"docid": "43c21b08bd593e22a829b1e1a6341253",
"score": "0.0",
"text": "def new_message(recipient)\n @message = recipient\n mail to: @message.recipient.email\n end",
"title": ""
}
] | [
{
"docid": "c4a674d85e621eef1f1b8d2584c5ccf4",
"score": "0.7680801",
"text": "def subject\n I18n.t('flowdock.inbox_message.subject', message_type: I18n.t(\"flowdock.inbox_message.type.#{@type}\"), store_name: current_store.name)\n end",
"title": ""
},
{
"docid": "8928fe4f050d7ebd3e9a... |
edd6cf805a01a052a1b5ed31f57d184b | Returns +true+ if the model is not persisted. Otherwise, returns +false+. Example: class User "John") u.new? => true u.save u.new? => false | [
{
"docid": "afd650efc9e9a17fc18abae09ad0bb85",
"score": "0.0",
"text": "def new?\n !(defined?(@id) && model.exists?(id))\n end",
"title": ""
}
] | [
{
"docid": "42539341b2207ee2fa98eb69fd10ad53",
"score": "0.81948036",
"text": "def persisted?\n !new_record?\n end",
"title": ""
},
{
"docid": "88b278f7e174780fca051de40511c0f4",
"score": "0.8187739",
"text": "def persisted?\n !new_record?\n end",
"title": ""
... |
49db1da7514a60d5ea2e9a7788310b6a | load a file containing json data and return a hash | [
{
"docid": "004a124d4832e23fd11ed6885f491049",
"score": "0.0",
"text": "def load_json_doc( filename )\n File.open( filename, 'r') do |file|\n json_str = file.read( )\n doc = JSON.parse json_str\n return doc\n end\n end",
"title": ""
}
] | [
{
"docid": "65fd87e042e027db6b0aeedfca03173c",
"score": "0.83516884",
"text": "def load_hash(file_path) \n file=File.read(file_path)\n JSON.parse(file)\n end",
"title": ""
},
{
"docid": "5a92ee1d5b21f3ec07c9f5964ae3528e",
"score": "0.820724",
"text": "def read_file(filename)\n... |
82c7156f7dcebea5447abf0840dad4c0 | If only one argument is given then it is the key, and so we call the method that accepts only the key | [
{
"docid": "d9782e8bc84dcdea74b450db0dd46916",
"score": "0.0",
"text": "def key_down(element, key = nil)\n if not key\n @actions.keyDown(sym_to_key(element))\n else\n @actions.keyDown(element.node, sym_to_key(key))\n end\n self\n end",
"title": ""
}
] | [
{
"docid": "0d25302cde0f4a74709891043652d26e",
"score": "0.7323561",
"text": "def key=(_arg0); end",
"title": ""
},
{
"docid": "0d25302cde0f4a74709891043652d26e",
"score": "0.7323561",
"text": "def key=(_arg0); end",
"title": ""
},
{
"docid": "0d25302cde0f4a74709891043652... |
4f331a8a747445d7b9793fbec37432d5 | num + 2 num binding.pry end Alternative solution | [
{
"docid": "04eb35438a31d24065baae94c947585a",
"score": "0.74262196",
"text": "def plus_two(num)\n\t num = num + 2\n\t num\nend",
"title": ""
}
] | [
{
"docid": "4a1c1d29e10c1b1503c0f22fdfc9816c",
"score": "0.74724627",
"text": "def add_two(number)\n p number += 2\n end",
"title": ""
},
{
"docid": "37e15a93df7ba526ad4c6c7f2289626f",
"score": "0.7460281",
"text": "def plus_two(num)\n\tnum + 2\n\t#binding.pry\nend",
"title"... |
df2b94c47dcf566a5d59bc015a12ceec | POST /body_parameters POST /body_parameters.json | [
{
"docid": "fa5da359f7a227c0148452cc55fb07ee",
"score": "0.70832497",
"text": "def create\n @body_parameter = BodyParameter.new(body_parameter_params)\n\n respond_to do |format|\n if @body_parameter.save\n format.html { redirect_to @body_parameter, notice: 'Body parameter was successfu... | [
{
"docid": "3491de4948726e1f3545aaeac3f6c0f5",
"score": "0.6878859",
"text": "def post_body(path, body = {})\n r = self.class.post(api_prefix + path, body: JSON.generate(body))\n begin\n unless [200, 201].include? r.code\n raise RequestFailed, \"POST #{path} & #{body.inspect} with stat... |
3cff5bb0eb709c4217e5f13cb2db98a4 | attribute is exclusively assigned internally | [
{
"docid": "1929d53455308381fd097151b4bfedd2",
"score": "0.0",
"text": "def internal?\n endpoint_rebound.internal?\n end",
"title": ""
}
] | [
{
"docid": "d309dffd28fdac85d4496f776991c611",
"score": "0.725855",
"text": "def attribute=(attr_name, value); end",
"title": ""
},
{
"docid": "b604b3c25737a8be03fb68d01d2e7620",
"score": "0.7035412",
"text": "def attribute_will_change!(attr_name); end",
"title": ""
},
{
... |
f64df9156643a57f6d86ef7654aa8127 | POST /inschools POST /inschools.json | [
{
"docid": "4d27910c92dc06ccc150e357d65b6cdd",
"score": "0.6229288",
"text": "def create\n @inschool = Inschool.new(params[:inschool])\n\n respond_to do |format|\n if @inschool.save\n format.html { redirect_to @inschool, notice: 'Inschool was successfully created.' }\n format.js... | [
{
"docid": "bd3125e36a468967fb0435b830b58663",
"score": "0.6128372",
"text": "def create\n @student = Student.find(params[:student_id])\n @inschool = @student.inschools.create(params[:inschool])\n\n respond_to do |format|\n if @inschool.save\n StudentMailer.mailer_inschool(@student,... |
d742f77344123f9e41404df8fccb405e | PATCH/PUT /petclub_memberships/1 PATCH/PUT /petclub_memberships/1.json | [
{
"docid": "36ac8ef618a4696b04734e45b048050b",
"score": "0.7702117",
"text": "def update\n respond_to do |format|\n if @petclub_membership.update(petclub_membership_params)\n format.html { redirect_to @petclub_membership, notice: 'Petclub membership was successfully updated.' }\n f... | [
{
"docid": "b2adf9cf6429e48bbdfc9f148a38103f",
"score": "0.7042966",
"text": "def update\n if @membership.update(membership_params)\n render json: @membership, status: :ok\n else\n render json: @membership.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
... |
ffbeb8a2f5d9f479a7bc696f420482c1 | Sets the returned_type. If it has been already set to a different value it's set to :any, which means that the returned type cannot be determined. | [
{
"docid": "810236fc33469262c1d1b43be483a019",
"score": "0.81080514",
"text": "def returned_type=(type)\n current = function_table[:rettype]\n if type.nil?\n function_table[:rettype] = :any\n elsif current.nil?\n function_table[:rettype] = type\n elsif current != type\n functi... | [
{
"docid": "660177ed0d333248f5202beb10ebc41b",
"score": "0.75252354",
"text": "def set_return_type(type); @_method.setType(type.to_s); end",
"title": ""
},
{
"docid": "8d94e00daf7882f5760954f17bf6f50f",
"score": "0.681602",
"text": "def return_type(type)\n unless type.is_a?(Stri... |
066675d4dedb4f6f6bebce652b9d552f | Execute the Choreo using the specified InputSet as parameters, wait for the Choreo to complete and return a ResultSet containing the execution results. | [
{
"docid": "ee7c8808e3f5be4244d277ffa1d0fdde",
"score": "0.0",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetSubscriptionResultSet.new(resp)\n return results\n end",
"title": ""
}
] | [
{
"docid": "c4ca32683e8ce75eb6a187d63df8fa77",
"score": "0.766411",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = DoneResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "6f7a7d9be674ad4cf17d6743eb1f7836",
"score"... |
57532c102d44a308313d606696a66185 | GET /projects/1 GET /projects/1.json | [
{
"docid": "301704a147583c53d81582fd7829ea70",
"score": "0.0",
"text": "def show\n @university = University.find( @project.university_id )\n @project_images = @project.project_images.paginate(:page => params[:page], :per_page => 9)\n @project_components = @project.project_components.paginate(:p... | [
{
"docid": "dc8505687156cb859adc07f1e0435407",
"score": "0.81856775",
"text": "def projects\n return get(\"/projects/list\")\n end",
"title": ""
},
{
"docid": "e5cff083faf736771900db26645e7ffe",
"score": "0.8016424",
"text": "def get_projects\n self.class.get(\"/projects.jso... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "d3fe25d46ff5b74289819b7b4a69e781",
"score": "0.0",
"text": "def copyright_params\n params.require(:copyright).permit(:title, :owns_sound_recording, :year, :genre, :country_id, :language, :is_explicit, :is_cover, :existing, :main_artist_id)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7943618",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.69572574",
"text": "def permitted_params\n params.permit!\n end",
"title"... |
cbb31fc8040462ef06fae2115667a43c | PATCH/PUT /frame_storages/1 PATCH/PUT /frame_storages/1.json | [
{
"docid": "7fa4f979d520f613c8d2525c259c02d3",
"score": "0.73104393",
"text": "def update\n respond_to do |format|\n if @frame_storage.update(frame_storage_params)\n format.html { redirect_to @frame_storage, notice: 'Frame storage was successfully updated.' }\n format.json { render... | [
{
"docid": "6fb7eab49699aaf12abd1f4a07899b4f",
"score": "0.6689482",
"text": "def update # rubocop:disable Metrics/AbcSize\n storageconfig = BlockStorage.new(@options[:id_domain], @options[:user_name], @options[:passwd],\n @options[:rest_endpoint])\n case @optio... |
d6fd6730cacbac15d6028ea3d018acdb | Remove any preceeding '~/', since this is on the remote, and remove any trailing `/`. | [
{
"docid": "abc345b7dd41f2a30609fb5da6589723",
"score": "0.0",
"text": "def dest_path\n @dest_path ||= path.sub(%r{^~/}, \"\").sub(%r{/$}, \"\")\n end",
"title": ""
}
] | [
{
"docid": "48ab1ea3a61743fa6c3033acce883ced",
"score": "0.7172542",
"text": "def sanitized_dirname\n @remote.gsub(/[^@\\w\\.-]/, '-')\n end",
"title": ""
},
{
"docid": "48ab1ea3a61743fa6c3033acce883ced",
"score": "0.7172542",
"text": "def sanitized_dirname\n @remote.gsub(/[^@... |
fd873a485090016d739a66558d1dcf52 | matcher for detecing < specified number of warnings | [
{
"docid": "dc19bcdfdaa6fc7c2fc7b23977b53889",
"score": "0.70178044",
"text": "def have_less_than_specified_number_of_warnings_in(page,number)\n RspecW3cMatchers::Notices.new(page,:<,number,:warnings)\n end",
"title": ""
}
] | [
{
"docid": "1a6ffd27028d0027332deb133bbafca3",
"score": "0.71502024",
"text": "def have_more_than_specified_number_of_warnings_in(page,number)\n RspecW3cMatchers::Notices.new(page,:>,number,:warnings)\n end",
"title": ""
},
{
"docid": "f3fb493fc905b9723d409828e69abe66",
"score": ... |
1ae97bf14ac2d84a34cf89892f9677dd | Checks if message is from a channel operator | [
{
"docid": "9b5af8fe8dcc5e64a8e8df204588491b",
"score": "0.6575373",
"text": "def is_op?\n ops = self.channel.ops.map { |usr| usr.host }\n ops.include? self.user.host\n end",
"title": ""
}
] | [
{
"docid": "602733cdc2bf1358fcaa713ec9932bb9",
"score": "0.70420843",
"text": "def from_channel?\n self.target && [?#, ?&].include?(self.target[0])\n end",
"title": ""
},
{
"docid": "0208a31436f87eda1658d23eb3395092",
"score": "0.66578615",
"text": "def channel?\n !!chan... |
e561e11bcf379ef5dc139c210017366b | Only allow a list of trusted parameters through. | [
{
"docid": "2496c52e6b6e1aeb903df2b1ab4ceac8",
"score": "0.0",
"text": "def artist_balance_params\n params.require(:artist_balance).permit(:artist_id, :balance)\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... |
1702899541f56ff9cef49e947ef9be38 | Provides the version used in the request string generation | [
{
"docid": "9583ad1861dfcdcf7de314cfeebdd4e3",
"score": "0.68492",
"text": "def version\n raise InvalidRequestException unless defined?(API_VERSION)\n API_VERSION\n end",
"title": ""
}
] | [
{
"docid": "53fcb999fc7ab63cbd08d41131ae9c7a",
"score": "0.80355996",
"text": "def version\n build_string\n end",
"title": ""
},
{
"docid": "d2f5448776ab9c5d16fe9f201596cda6",
"score": "0.76037216",
"text": "def versionString()\n\t\t\t\treturn \"#{major}.#{minor}.#{build}\"\n\t\t... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "5a48327cc4e5bfb525186d797222d280",
"score": "0.0",
"text": "def profile_params\n params.require(:profile).permit(:phonenumber, :telegram, :country, :city, :state, :first_time,\n :expectancy, :agile_id, :agile_description, :hobbies, :bring, :proposal,\n ... | [
{
"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... |
2b9fdf5bece63da35b7d446ec2f6bd72 | commits edit to DB | [
{
"docid": "5761417c0ba1ddad7124cc67130898fb",
"score": "0.0",
"text": "def update\n @interest = Interest.find(params[:id])\n if @interest.update_attributes(params[:interest])\n redirect_to interests_path\n else\n ... | [
{
"docid": "88b8c4b033ae2da28f1feca46751ae2a",
"score": "0.7519679",
"text": "def commit\n update\n end",
"title": ""
},
{
"docid": "b4003008064700df89de1cbf40139c4a",
"score": "0.7159242",
"text": "def commit; end",
"title": ""
},
{
"docid": "b4003008064700df89de1cbf... |
f8498dba6ad17815fab3a39a86473fba | Read a &39;ippool.ShadowBlock&39; resource. | [
{
"docid": "a79d7d7f22d1378c9f2e4ae999b716be",
"score": "0.47599635",
"text": "def get_ippool_shadow_block_by_moid_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: IppoolApi.get_ippool_shadow_block_by_moid ...'\n end\n ... | [
{
"docid": "aaceed71bfa6e4b1ba74f2b57f06024c",
"score": "0.6529669",
"text": "def read_block(block_id)\n \n end",
"title": ""
},
{
"docid": "ebd66ee46a13ea5afa484cf6a8c265ea",
"score": "0.6384842",
"text": "def read_block(block_id, nonce)\n \n end",
"title": ""
},
{
... |
9b7abc890744d5529d256fd38161d468 | This API is used to Verify MFA Email OTP by MFA Token | [
{
"docid": "f8b269cc210b30032bacc6b83288e693",
"score": "0.6607558",
"text": "def mfa_validate_email_otp(multi_factor_auth_model_by_email_otp, second_factor_authentication_token, rba_browser_email_template = '', rba_city_email_template = '', rba_country_email_template = '', rba_ip_email_template = '')\n... | [
{
"docid": "c6b823fbddfd0ff07e0849a2a181cf62",
"score": "0.681773",
"text": "def mfa_validate_email_otp_by_access_token(access_token, multi_factor_auth_model_by_email_otp_with_lockout)\n if isNullOrWhiteSpace(access_token)\n raise LoginRadius::Error.new, getValidationMessage('access_token')\... |
04c06d14343e261ff07fdd4308b6e8f4 | update admin dashboard with new stats | [
{
"docid": "70fa90be26e0013abfa51dc7de67c328",
"score": "0.7808529",
"text": "def update_dashboard\n fleet_utilized_percentage = (StatsService.percent_utilized_within_range(Date.today, Date.tomorrow) * 100).to_i\n car_actions_count = Reservation.get_actionable_reservation_count\n\n StatsService... | [
{
"docid": "e01bcc045385b7baed9b9695e292c354",
"score": "0.73547053",
"text": "def update_dashboard\n fleet_size = Car.all.count\n update_fleet_utilization_percentage\n StatsService.update_admin_dashboard('fleet_size', 'current', fleet_size )\n end",
"title": ""
},
{
"docid": "ef54... |
6e8a50785a704bdf0f6849101fcc20e0 | Returns a description of how to use this plugin | [
{
"docid": "e6b1238b9d7a84b7119efd806f55a1bf",
"score": "0.0",
"text": "def usage\n \"whois <domain> - Returns the WHOIS information for a domain\"\n end",
"title": ""
}
] | [
{
"docid": "d0c46dc42d0e4690f70bb943deca1a05",
"score": "0.8001723",
"text": "def desc\n\t\t\"Demonstrates using framework plugins\"\n\tend",
"title": ""
},
{
"docid": "4916269b68c6537437a2025201abff1e",
"score": "0.77831924",
"text": "def description\n 'This is a reference implem... |
304777c0be9177c4a85fa380ba2695fd | method mill half pipe indention on X axis this is commonly used to mill pipe entrance and exits Maximum depth will be 1/2 specified diam This area is formed by starting a circle and working around it in the Z Axis To form a 1 inch outlet area. We have a string function which allows us to calculate points on a curve eve... | [
{
"docid": "78941e797a043d9b8522c522de09bfb5",
"score": "0.62585604",
"text": "def mill_z_circ(mill, x,y, diam, beg_z=@cz, adjust_for_bit_radius=false, beg_degree=90, end_degree=180)\n # - - - - - - - - - - - - - - - - - -\n #print \"mill circle x=\", x, \" y=\", y, \" diam=\", diam, \" depth=\", d... | [
{
"docid": "d108b754d299138a8589ebd64d172504",
"score": "0.6312886",
"text": "def mill_lopsided_circle(mill, cx, cy, beg_diam, end_diam, beg_degree, end_degree, beg_depth, end_depth)\r\n# # # # # # # # # # # # # # # # # # # # # # # # # # \r\n degree_inc = 1.0\r\n deg_sweep = end_degree - beg... |
bafeeb2759f9736ecd3929f5cccf4d5c | Render a cleared output. | [
{
"docid": "57dc1fd27e109b80f3cb759fcc3ad437",
"score": "0.7387895",
"text": "def clear\n render({})\n end",
"title": ""
}
] | [
{
"docid": "5aff56f9fe39865db926366d0cfe8900",
"score": "0.72954243",
"text": "def render; ''; end",
"title": ""
},
{
"docid": "2413f3769da7e92449ed39569963cc46",
"score": "0.70825124",
"text": "def render\n clear\n\n Vedeu::Direct.write(value: output, x: bx, y: by)\n ... |
9bbd04758b7a0b71689279b3592b674a | attr_accessible :username, :email, :password | [
{
"docid": "9d365a896146f165e87c945345a7ac42",
"score": "0.0",
"text": "def admin?\n admin\n end",
"title": ""
}
] | [
{
"docid": "c21eec2d5e2cd9301f7550d4f6f4450c",
"score": "0.76432157",
"text": "def user_params\n params.permit(:username, :first_name, :last_name, :email, :password)\nend",
"title": ""
},
{
"docid": "e6879d17f6bb7f8af871dc5401092997",
"score": "0.7614247",
"text": "def user_params\n... |
e5ebc4fc479cea561c08f74c93673c91 | Complete the compareTriplets function below. | [
{
"docid": "e6927ab14accab2dc58dbb382f6bac5f",
"score": "0.6560202",
"text": "def compareTriplets(a, b)\n res = [0,0]\n a.each_with_index {|val, i|\n if a[i] > b[i] then res[0] += 1\n elsif a[i] < b[i] then res[1] += 1\n end\n }\n res\nend",
"title": ""
}
] | [
{
"docid": "587f88831f753be82b72d26d77738dd6",
"score": "0.6822944",
"text": "def compareTriplets(a, b)\na_r =0\nb_r =0\n\n a.zip(b).each{|ar, br| \n if ar > br then\n a_r += 1\n elsif ar < br then\n b_r += 1\n end\n }\nreturn a_r.to_s + \" \" +b_r.to_s\nend",
"title": "... |
2928e34aec5fee68171b38567c55ae10 | code will be a hash of code numeber=>option in order to redeem properly | [
{
"docid": "682f504398489dcc64b334f52a735bd2",
"score": "0.0",
"text": "def generateCode(washPackage)\r\n genCode=Kernel.rand(10000) unless @customerCodes.has_key?(genCode)\r\n @customerCodes[genCode]= washPackage\r\n return genCode\r\n end",
"title": ""
}
] | [
{
"docid": "9a3436d1e415f414df38e46b4f2f88cb",
"score": "0.70153666",
"text": "def redeem_code params\n private_request 'redeem_code', params\n end",
"title": ""
},
{
"docid": "0d5ace6fa3696d953aad0e1925aea118",
"score": "0.68350756",
"text": "def set_code\n begin\n self.... |
d647339e3e8dcc3e5f1d27375bfb88bf | PATCH /users/:id(.:format) usersupdate PUT /users/:id(.:format) usersupdate | [
{
"docid": "8688b2066844cac1f696a824f11a0596",
"score": "0.0",
"text": "def update\n user = User.find(params[:id])\n user.update(user_params)\n redirect_to \"/users/profile\"\n # redirect_to user_path(user)\n end",
"title": ""
}
] | [
{
"docid": "8883f8815a6b9292435769a8a84d49f6",
"score": "0.7983723",
"text": "def update\n @user = User.patch(params[:id], params[:user])\n respond_with(@user)\n end",
"title": ""
},
{
"docid": "77dc518adf976c10fd53e7c05b8ddcac",
"score": "0.7919807",
"text": "def update\n ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "f3bca39eab635704380db7c478f1c406",
"score": "0.0",
"text": "def set_herb_property\n @herb_property = HerbProperty.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60322535",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6012846",
"text": "de... |
89eeb02209531f39bdae516d10c7b22d | Returns a string containing the controller name + '/' + controller.action_name | [
{
"docid": "681e6697b9e32a8a9b33ae7dec270195",
"score": "0.7841279",
"text": "def controller_action\n @controller_action ||= [controller.controller_name, controller.action_name].join('/')\n end",
"title": ""
}
] | [
{
"docid": "0e161ac53b6ec2c6c46077a918202b4b",
"score": "0.7952354",
"text": "def controller_name\n [namespace.module_name, resource_name.plural.camelize + \"Controller\"].compact.join(\"::\")\n end",
"title": ""
},
{
"docid": "f7cdeadb8ff0da707cd30d0a1c2edff1",
"score": "0.7... |
70348e280ee9647de2280554dfb7b5a1 | new_ips_mode new_ips_protection new_firewall_mode new_firewall_ruleset new_application_mode new_application_ruleset new_enforcement_policy | [
{
"docid": "c49dec0b3e05856b2f17aabbf54de889",
"score": "0.0",
"text": "def update_hips_policies(message)\n request(:update_hips_policies, Boolean, message)\n end",
"title": ""
}
] | [
{
"docid": "685c2fbcd35d808a5f0bc00fb94931bd",
"score": "0.59354436",
"text": "def editFirewall()\n puts \"Editing the firewall\"\n `sudo systemctl restart nfs-server`\n `sudo firewall-cmd --zone=public --add-port=2049/tcp --permanent`\n `sudo firewall-cmd --zone=public --add... |
8c0991916392c3a8e109ff188b1bb076 | Set JWT Your secret JSON Web Token | [
{
"docid": "18591b81e9a08490a4afa4890c6656d1",
"score": "0.7331122",
"text": "def set_jwt(value)\n add_header('x-appwrite-jwt', value)\n\n self\n end",
"title": ""
}
] | [
{
"docid": "6d08ac1fba6a2da5aea5d0007c3a6e28",
"score": "0.7488419",
"text": "def jwt_auth_token( secret )\n\n # expire in 5 minutes\n exp = Time.now.to_i + 5 * 60\n\n # just a standard claim\n exp_payload = { exp: exp }\n\n return JWT.encode exp_payload, secret, 'HS256'\n\n ... |
92cf092cd24a6a5cc82c56dca21706f1 | Returns the error message of an invalid xml | [
{
"docid": "3c4e8de27924367f46d280a31f640e97",
"score": "0.6655492",
"text": "def error_message_from_invalid_xml(xml)\n xml.include?('INVALID ORIGIN') ? RATE_LIMIT_MESSAGE : INVALID_BODY_MESSAGE\n end",
"title": ""
}
] | [
{
"docid": "4d85ad7787cf5322db0176a589016246",
"score": "0.76277226",
"text": "def check_error(xml) #:nodoc:\n err = xml.elements['Error']\n raise Error, err.elements['Message'].text if err\n end",
"title": ""
},
{
"docid": "9d2cfd48a268652a7eaefc4d61bd26fc",
"score": ... |
2ae635087c9b6e93d6ae29d603a07b8f | Create an instance of this Awesome class that holds a Ruby value. Like a String, Number or true for example. | [
{
"docid": "ce4863abc9222feb3e8b6bcb399983fe",
"score": "0.7108584",
"text": "def new_value(value)\n AwesomeObject.new(self, value)\n end",
"title": ""
}
] | [
{
"docid": "a24a55bb73e27aab19f42b9aeb001cb6",
"score": "0.70599705",
"text": "def new_with_value(value)\n AwesomeObject.new(self, value)\n end",
"title": ""
},
{
"docid": "7f179c5a4181917df3ca30f675ee820a",
"score": "0.68873435",
"text": "def initialize(awesome_class, ruby_value... |
08dde22d2d556b8ec3ebf154c00f31a8 | A note on subqueries: we can refer to values in the outer SELECT within the inner SELECT. We can name the tables so that we can tell the difference between the inner and outer versions. | [
{
"docid": "f57ffbb7361778e51839d5f380f487a9",
"score": "0.6519935",
"text": "def example_select_with_subquery\n execute(<<-SQL)\n SELECT\n name\n FROM\n countries\n WHERE\n population > (\n SELECT\n population\n FROM\n countries\n WHERE\n ... | [
{
"docid": "21a4549c36cb129a5d7f2f2d133a4913",
"score": "0.68052816",
"text": "def inner_query\n self.class.\n select(\"#{SUBQUERY_TABLE_ALIAS}.*\").\n from(\"#{table_name} AS #{SUBQUERY_TABLE_ALIAS}\")\n end",
"title": ""
},
{
"docid": "962045fa4d98acaee4c35bc0d04feab1",
"... |
e08214c1e3a252c4b8f2f2b6cf77d021 | this section tests individual helper methods within Authorization module testing: is_person_in_whitelist?(person_id, whitelist_owner_user_id) | [
{
"docid": "c2c6ff92d3857233e7d8e5fd8af1a7e0",
"score": "0.792897",
"text": "def test_is_person_in_whitelist__should_yield_true\n res = Seek::Permissions::Authorization.is_person_in_whitelist?(people(:person_for_owner_of_fully_public_policy), users(:owner_of_a_sop_with_complex_permissions))\n \n ... | [
{
"docid": "21ab93cba3cb2823070b625b4d80b31a",
"score": "0.714667",
"text": "def test_person_in_whitelist_and_use_whitelist_set_to_true\n temp = sops(:sop_with_custom_permissions_policy).policy.use_whitelist\n assert temp, \"use_whitelist should have been set to 'true'\"\n\n temp = Seek::Permis... |
6218889ddb51020a8615d7150b9a3ef3 | PATCH/PUT /votes/1 or /votes/1.json | [
{
"docid": "4293838d82586c1e7e8bf98f37ffdc14",
"score": "0.68149966",
"text": "def update\n respond_to do |format|\n if @vote.update(vote_params)\n format.html { redirect_to @vote, notice: \"Vote was successfully updated.\" }\n format.json { render :show, status: :ok, location: @vo... | [
{
"docid": "cfe15a9be7082d3279babb1db772605a",
"score": "0.7259179",
"text": "def update\n @vote = @votable.votes.find(params[:id])\n\n respond_to do |format|\n if @vote.update(vote_params)\n format.html { redirect_to build_path_vote(@vote), notice: 'Vote was successfully updated.' }\n... |
a62be7f4bf5c90a288242f49dcff9f9a | Get the description of the battle formation | [
{
"docid": "6389ca075b5a583869efde3035ac286e",
"score": "0.857938",
"text": "def description()\n return Vocab::battle_formations_strings[@v_index][0]\n end",
"title": ""
}
] | [
{
"docid": "eab53b0a7d00a7d6ed72bb1e70836091",
"score": "0.73007685",
"text": "def description\r\n @military.name # TODO - skill/job\r\n end",
"title": ""
},
{
"docid": "c4b5812122d356b4187570e52d869118",
"score": "0.7263191",
"text": "def description\n # if range is 0 or the ... |
6f5f17be8df6038df1efe256d5f3ed3d | administrator or author can update the items | [
{
"docid": "19d803afd8c9efdfb9519e63b37b64e8",
"score": "0.0",
"text": "def update?\n user.admin? or ( !record[:author_id].nil? and record[:author_id] == user.id )\n end",
"title": ""
}
] | [
{
"docid": "20d39ac5569542997ba810275bfe8778",
"score": "0.7637877",
"text": "def update\n # Add code here to check if the user is an owner, moderator, or admin\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, :notice => 'Item wa... |
16e5365322888c9e999729f592f20364 | GET /people/1 GET /people/1.json | [
{
"docid": "b96d465f884c943f32e5a2befa817a65",
"score": "0.0",
"text": "def show\n @comment = Comment.new\n @title = \"Dhokebaaz profile of #{@dhokebaaz.dhokebaaz_name} #{@dhokebaaz.last_name} #{@dhokebaaz.address} #{@dhokebaaz.city}\"\n end",
"title": ""
}
] | [
{
"docid": "ceff4753a00843a8de33f099e86535f4",
"score": "0.73654115",
"text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.json { render :json => @person }\n end\n end",
"title": ""
},
{
"docid": "e385dbbc66b18d2cc68aaa5bf83b2798",
"sc... |
b01c7a6f0d2f307219b69bce7ad7f4c7 | Piperesetting literal digit 3. | [
{
"docid": "84fb959c8c73367dcc069c70a328a161",
"score": "0.6298563",
"text": "def l3\n set \"3\"\n end",
"title": ""
}
] | [
{
"docid": "dff7eec7320f57393c5150baae8d43f0",
"score": "0.6275359",
"text": "def prefix_for_three_digits_number(number_for_prefix)\n \"#{NUMERALS[number_for_prefix][:singular]} hundred\" unless is_it_zero?(number_for_prefix)\n end",
"title": ""
},
{
"docid": "9e45c3bd95a4e56667f96d94861... |
8203895e9f55152b75f61eaa18608ebd | Returns an array of nsqds instances that have messages for that topic. nsqd instances returned are strings in this format: ':' discovery.nsqds_for_topic('atopic') => ['127.0.0.1:4150', '127.0.0.1:4152'] If all nsqlookupd's are unreachable, raises Nsq::DiscoveryException | [
{
"docid": "ffc9fd3f5dfd04869802a93a10fce035",
"score": "0.7646706",
"text": "def nsqds_for_topic(topic)\n gather_nsqds_from_all_lookupds do |lookupd|\n get_nsqds(lookupd, topic)\n end\n end",
"title": ""
}
] | [
{
"docid": "8eabd040573162e9fbadcdb126f4ccd1",
"score": "0.71153986",
"text": "def get_nsqds(lookupd, topic = nil)\n uri_scheme = 'http://' unless lookupd.match(%r(https?://))\n uri = URI.parse(\"#{uri_scheme}#{lookupd}\")\n\n uri.query = \"ts=#{Time.now.to_i}\"\n if topic\n u... |
e9aee29c52004b2d73ec2139db9698e9 | Responds to `GET /institutions/:key` | [
{
"docid": "4545727af7f9fc73fabbac5720f53b53",
"score": "0.0",
"text": "def show\n @review_count = review_items(0, 0).count\n @submissions_in_progress_count = submissions_in_progress(0, 0).count\n end",
"title": ""
}
] | [
{
"docid": "9cb245176712218a4faf5f73e061d7f9",
"score": "0.66328317",
"text": "def request_institutions\n # listing institutions for a project is public data, but still\n # we require login to protect from unwanted requests\n \n project_id = white_list(params[:id])\n institution_list = ni... |
f523e215ba422950ab3dbb19f8636556 | Methods The layout used by the Newsletter. Since Newsletter::Layout is not a regular ActiveRecord inhereited class, we can't use the classic has_one :layout, class_name: 'Newsletter::Layout' So we just save the layout_id in the model and manually find the corresponding layout. | [
{
"docid": "db153129d6917e2937f35a715a0dc0d5",
"score": "0.8340692",
"text": "def layout\n Newsletter::Layout.where(id: self.layout_id).first\n end",
"title": ""
}
] | [
{
"docid": "dd4d7d46db9fd526fd7f41504141c40b",
"score": "0.74128675",
"text": "def set_layout\n @layout = Layout.find(params[:id])\n end",
"title": ""
},
{
"docid": "dd4d7d46db9fd526fd7f41504141c40b",
"score": "0.74128675",
"text": "def set_layout\n @layout = Layout.find... |
e977245d31ee7616447f1070c2bf3060 | XXX Convierte este objeto a un string, para que entre otras cosas se pueda ver bonito con un puts | [
{
"docid": "da95ad28d4a0bd1b8683f08237d71676",
"score": "0.0",
"text": "def to_s\n \"login: #{@data[\"login\"]}\\n\" +\n \"username: #{@data[\"login\"]}\\n\" +\n \"avatar_url: #{@data[\"avatar_url\"]}\\n\" +\n \"url: #{@data[\"url\"]}\\n\" +\n \"starred_url: #{@data[\"starred_url\"]}\\n\"... | [
{
"docid": "dc73a9d4b2f3f5af5439c5442043164a",
"score": "0.6886284",
"text": "def puts(str); end",
"title": ""
},
{
"docid": "dc73a9d4b2f3f5af5439c5442043164a",
"score": "0.6886284",
"text": "def puts(str); end",
"title": ""
},
{
"docid": "dc73a9d4b2f3f5af5439c5442043164a... |
cfad8542397fb9d432396e3021c8eb27 | Query the GeoIP database for a given IP address, and returns information about the region/country where the IP address is allocated. Takes a search string (eg: '205.128.54.202') for country info Returns an array of IpFilter::Results. | [
{
"docid": "1f7c97479095575b26449ffe9b20f753",
"score": "0.0",
"text": "def search(query)\n results(query).map { |r| result_class.new(r) }\n end",
"title": ""
}
] | [
{
"docid": "839a1720e4ff4af884357e7787215971",
"score": "0.62583846",
"text": "def geoiplookup(ip, geo=false)\n checkip?(ip)\n t = country(ip, geo)\n city(ip, geo)\n unless t == false\n # Check if @longitude / @latitude exists for Reverse Geocoding options\n if instance... |
f4b8f3add9c2640f569e75ee57ca5609 | Gets monster parameters for typeahead | [
{
"docid": "52a29e9df73d4616c70fb22485624cbe",
"score": "0.674873",
"text": "def typeahead_json\n\tmonster = monster_name_json_params\n\tresults = search_monster_by_name_json(monster.upcase)\n\trender :json => results\n end",
"title": ""
}
] | [
{
"docid": "2af1af2642a92a9a093741650fe3fd98",
"score": "0.6685743",
"text": "def query\n sanitize typeahead_params['query']\n end",
"title": ""
},
{
"docid": "af84de6cefb3b618b71cd7c0df629681",
"score": "0.6047003",
"text": "def monster_params\n params.fetch(:monster, {... |
be6fd54da47d1c4684a1c6bddcefdb80 | GET /exibitor_categories/new GET /exibitor_categories/new.json | [
{
"docid": "b59ef1c41013b1e4faa46687506334fe",
"score": "0.75916773",
"text": "def new\n @exibitor_category = ExibitorCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @exibitor_category }\n end\n end",
"title": ""
}
] | [
{
"docid": "142c9843af460205672a84a30fb00da4",
"score": "0.7628778",
"text": "def new\n @new_category = NewCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_category }\n end\n end",
"title": ""
},
{
"docid": "052db73887... |
0ecc88253a45370a0b27edd8646473a6 | GET /characters/1 GET /characters/1.json | [
{
"docid": "1d868fdee6953773b1c1a6852a902364",
"score": "0.75050735",
"text": "def show\n @character = Character.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @character }\n end\n end",
"title": ""
}
] | [
{
"docid": "88cafa7a033606d025267eba1a107313",
"score": "0.786345",
"text": "def characters(options = {})\n # v1/public/characters\n get('characters', options)\n end",
"title": ""
},
{
"docid": "5ffbd3f19adb997532de824827790b52",
"score": "0.7736232",
"text": "def charac... |
4fc6e8d061a9f0af61c003493af75cb3 | DELETE /cs_members/1 DELETE /cs_members/1.json | [
{
"docid": "9a4cbf647eb47311ea5086d8813cfd28",
"score": "0.75932395",
"text": "def destroy\n @cs_member = CsMember.find(params[:id])\n @cs_member.destroy\n\n respond_to do |format|\n format.html { redirect_to cs_members_url }\n format.json { head :ok }\n end\n end",
"title": "... | [
{
"docid": "e50ade7d29f88b823964d36c90bf8e61",
"score": "0.74765426",
"text": "def deleteCardMember(cardId, idMember)\n\n\thash = Hash.new\n\thash[:idMember] = idMember\n\thash[:key] = $key\n\thash[:token] = $token\t\n\n\tresponse = RestClient.delete 'https://api.trello.com/1/cards/'+cardId+'/members/'+... |
8d9f3ed232a24fd3f8847c407a06c608 | Moves the schedule file to the system directory if not there. Should only be if upgrading from version 0.0.7 and below | [
{
"docid": "67326ad457923281f7b6bc4cb2b4899b",
"score": "0.6512728",
"text": "def move_time_schedule_files(dirs, excluded)\n if @time_schedule_files.nil?\n @time_schedule_files = time_schedule_files(dirs, excluded) \n end\n @time_schedule_files.each do |file|\n to_file = \"#{SYC_DIR}/... | [
{
"docid": "f619a8bebff76cdce36cef9dd6710ec8",
"score": "0.55295223",
"text": "def install!\n schedule = render\n unless schedule.blank?\n file = Tempfile.new('schedule')\n file << schedule\n file.close\n status = system(\"crontab\",file.path)\n e... |
abcb833b7d314271096c2e16eb8178ec | GET /people/1 GET /people/1.xml | [
{
"docid": "2ee650a0f735199659acf07bf6628a40",
"score": "0.0",
"text": "def show\n @person = Person.find(params[:id])\n authorize! :read, @person\n @current_events = @person.events_as_presenter_in(@conference)\n @other_events = @person.events_as_presenter_not_in(@conference)\n clean_event... | [
{
"docid": "e4f5f9360f3d4d8e2a853f7c91f23ee9",
"score": "0.70983076",
"text": "def show\n\n @people = People.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @people }\n end\n end",
"title": ""
},
{
"docid": "90331487... |
852f5055c23d6950ad0e395be2881443 | does not recognize variable nesting, but now it does not matter | [
{
"docid": "b27dfa733140c67133777179aa0ac973",
"score": "0.0",
"text": "def cover_def_by(file_name, lookup_str, external_def)\n expect_end = 0\n found = false\n accepted_content = ''\n File.readlines(file_name).each do |line|\n expect_end += 1 if found && line =~ /\\sdo\\s/\n ... | [
{
"docid": "056660d10c5f8b234f613b378d94ac98",
"score": "0.73187816",
"text": "def nesting; end",
"title": ""
},
{
"docid": "056660d10c5f8b234f613b378d94ac98",
"score": "0.73187816",
"text": "def nesting; end",
"title": ""
},
{
"docid": "056660d10c5f8b234f613b378d94ac98",... |
e705893f07e57ec339635e75b74a283d | GET /checkins/1 GET /checkins/1.json | [
{
"docid": "a76e993b51012400d44b95b42195e440",
"score": "0.0",
"text": "def show\n if current_user.id == @checkin.user_id || current_user.admin?\n @checkin = Checkin.find(params[:id])\n @student_comments = @checkin.comments.select { |c| c if c.user_id == @checkin.user.id }\n @admin_com... | [
{
"docid": "2c673bb21d63a5081e0ba2e9c6061d13",
"score": "0.719667",
"text": "def index\n if current_user.try(:admin?)\n @checkins = Checkin.all\n @checkins_for_json = current_user.checkins\n elsif user_signed_in?\n @checkins = current_user.checkins\n @checkins_for_json = @check... |
cd60f6cfb71ed250df5c8c32556fdb38 | The greeting returned in the initial connection message to the client. | [
{
"docid": "00655cc19c614805c8b0a6d30439bf73",
"score": "0.6384435",
"text": "def server_greeting\n \"EventMachine SMTP Server\"\n end",
"title": ""
}
] | [
{
"docid": "9712db4d4b85026e91e1d3d7426c8035",
"score": "0.7133631",
"text": "def greeting\n read_dictionary(:greeting)\n end",
"title": ""
},
{
"docid": "fcfa10c4ca604e17fd6c2ee77f284da8",
"score": "0.70604503",
"text": "def greeting\n ver = @data.unpack(\"C\").firs... |
4e0ba2d7e4397116ef17c5a1142f8864 | Linked image in a container which clears floats, so images will occupy entire row. | [
{
"docid": "9d4cb0fb43c3f126d5d9ebfae4990a09",
"score": "0.62176216",
"text": "def cleared_linked_display\n h.content_tag(:div, linked_display, class:'images single clear').html_safe\n end",
"title": ""
}
] | [
{
"docid": "515a28745dab3c5ba1b1206c8ab43cec",
"score": "0.62185174",
"text": "def cleared_linked_display\n h.content_tag(:div, linked_display, class: 'images single clear').html_safe\n end",
"title": ""
},
{
"docid": "dbef89f525e0be751fb7ea6a9dfe29b2",
"score": "0.5764145",
"tex... |
bfdee5dc230e7f6a5dc7e4ea1388c8d6 | Add Multiple Rules in a Section Create multiple firewall rules in existing firewall section bounded by limit of 1000 firewall rules per section. Adding multiple firewall rules in a section modifies parent section entity and simultaneous update (modify) operations on same section are not allowed to prevent overwriting s... | [
{
"docid": "beb89b5bdd3258a3f2e049a56cf63042",
"score": "0.7057805",
"text": "def add_rules_in_section_create_multiple_with_http_info(section_id, firewall_rule_list, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesFirewal... | [
{
"docid": "2325cbbe0da387938772129066d3124d",
"score": "0.7283616",
"text": "def add_rules_in_section_create_multiple(section_id, firewall_rule_list, opts = {})\n data, _status_code, _headers = add_rules_in_section_create_multiple_with_http_info(section_id, firewall_rule_list, opts)\n data\n ... |
ebabbd10512e5f383dcd629a2348dd4c | Check attribute value(s) are not NULL/nil. | [
{
"docid": "8b8609515a6acb56a21934c2575a9c42",
"score": "0.7288861",
"text": "def validates_not_null(atts, opts=OPTS)\n validatable_attributes_for_type(:not_null, atts, opts){|a,v,m| validation_error_message(m) if v.nil?}\n end",
"title": ""
}
] | [
{
"docid": "388da06947b8a8e62ab60d1a12604141",
"score": "0.7822279",
"text": "def has_nil_values?(attribute)\n @validations.each{ |v| return true unless v.send(attribute) } \n return false\n end",
"title": ""
},
{
"docid": "23a1ffa4cbe2cc34ef8ae46ed926a9c0",
"score": "0.74687755",... |
f491a7d0bbf45d8cc76cb48213bcb7e5 | Currently groups_base isn't returned from the REST API. There's a bug report. | [
{
"docid": "fd12eb28c4f5e4d4a241a64ef1d418b5",
"score": "0.7805833",
"text": "def groups_base\n get_groups_base\n# get_attribute_from_auth_source('groups_base')\n end",
"title": ""
}
] | [
{
"docid": "fcaeb91c7c1f576224cb97e72d53ecc8",
"score": "0.72186375",
"text": "def groups\r\n @groups ||= fetch_groups\r\n end",
"title": ""
},
{
"docid": "5cbba4ce5c8e853d29b08eaeca89de24",
"score": "0.7154529",
"text": "def groups\n return [] if self.group_list.nil?\n ... |
018c019b36b6baac42cff8cea96badf2 | removing previous image from S3 | [
{
"docid": "5aa22ae1fe542a792324c424eb67f032",
"score": "0.7016106",
"text": "def remove_previous_image\n self.picture_url.remove!\n self.picture_url.thumb.remove!\n self.update_column(:picture_url, '')\n end",
"title": ""
}
] | [
{
"docid": "f1591ae48b20f7c6d40166e016116fe2",
"score": "0.77831733",
"text": "def remove_from_s3\n PublicEarth::Db::Photo.connect_to_s3 unless AWS::S3::Base.connected?\n AWS::S3::S3Object.delete s3_key, s3_bucket if AWS::S3::S3Object.exists? s3_key, s3_bucket\n end",
... |
79652292280700afaa7f5438fe6ccbf6 | Reset current page indexes | [
{
"docid": "4bc6571a889bf01074afbbac0dfd3267",
"score": "0.66771597",
"text": "def reset!\n @start_index = nil\n @end_index = nil\n end",
"title": ""
}
] | [
{
"docid": "82789de1e65de11030a51d96ee34ea9b",
"score": "0.7582263",
"text": "def reset_index\n\t\t@index = 0\n\tend",
"title": ""
},
{
"docid": "df88b3b9f26d5279b665ca0ef195cdfc",
"score": "0.7479806",
"text": "def reset_indexing\n @indexes = [0]\n end",
"title": ""
},... |
d5da517d756e87b7a7978fe1d2061806 | Private Write Gemfile data Returns nil | [
{
"docid": "2f48f150e17731fd6f7f334c47a8aed2",
"score": "0.67845666",
"text": "def write_gemfile\n File.open(gemfile_location, 'w') { |file| file.write(output) }\n end",
"title": ""
}
] | [
{
"docid": "e8a8e9ee261c4c683ce0f87e3db05f80",
"score": "0.7571975",
"text": "def write\n File.open('Gemfile', 'w') do |f|\n f.write(content)\n end\n end",
"title": ""
},
{
"docid": "2c78a12671b5a3b6706509d0bebfff23",
"score": "0.74266076",
"text": "def wr... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "0dc7813e561d8fdf897e0d5daa57c06e",
"score": "0.0",
"text": "def update!(**args)\n @filters = args[:filters] if args.key?(:filters)\n @histogram_query = args[:histogram_query] if args.key?(:histogram_query)\n @require_precise_result_size = args[:require_precise_resu... | [
{
"docid": "150fa2bdc1fc43d28ac45e2278a1f797",
"score": "0.7012677",
"text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"t... |
7f33f9288571d6304802b3138ade96fa | DELETE /quiz_questions/1 DELETE /quiz_questions/1.json | [
{
"docid": "e71c6d27b333de7fb23e10a90b7f04c3",
"score": "0.76139694",
"text": "def destroy\n @quiz_question.destroy\n respond_to do |format|\n format.html { redirect_to quiz_questions_url, notice: 'Quiz question was successfully destroyed.' }\n format.json { head :no_content }\n end\n... | [
{
"docid": "e030cbcfdf71c561a228839806401f6e",
"score": "0.7876492",
"text": "def destroy\n render json: question.destroy!, status: :ok\n end",
"title": ""
},
{
"docid": "28bf34b9a08f2ffb8775d4c6959a913d",
"score": "0.7828216",
"text": "def destroy\n @question.destroy\n res... |
e561e11bcf379ef5dc139c210017366b | Only allow a list of trusted parameters through. | [
{
"docid": "48b4d72f2b46e0e2ae76fd8b3785f31c",
"score": "0.0",
"text": "def anamnese_params\n params.require(:anamnese).permit(:atividade_trabalho, :desc_atividade_trabalho, :data_exame_clinico, :descricao_exame_clinico, :cardiopatia, :cirurgia, :descricao_cirurgia, :problema_saude, :dor_corporal, ... | [
{
"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... |
e166654922e2fc9365be15a80864591e | GET /dearness_allowances GET /dearness_allowances.json | [
{
"docid": "f093f2571fa70e8780a14bc7e9a1e553",
"score": "0.0",
"text": "def index\n \n end",
"title": ""
}
] | [
{
"docid": "1a8a372698cc387e0bb12f800392d929",
"score": "0.67516863",
"text": "def set_dearness_allowance\n @dearness_allowance = DearnessAllowance.find(params[:id])\n end",
"title": ""
},
{
"docid": "4ea39b8bdfe2ce27c609cead6ab76a5c",
"score": "0.6200311",
"text": "def show\... |
735fee41545ef390dd48094874801973 | sets title of the controller | [
{
"docid": "9d2719c285374748a9ea14a5bd43898a",
"score": "0.7868368",
"text": "def set_title\n @title = t(:edoctorand_system, :scope => [:controller, :account])\n end",
"title": ""
}
] | [
{
"docid": "04e37f0429dd0a9f86e71dd547b0c1d7",
"score": "0.8716493",
"text": "def set_title\n @title = \"#{controller_name}.#{action_name}.title\"\n end",
"title": ""
},
{
"docid": "092ad9a0392dfd62a95945412cb0ac9f",
"score": "0.82933915",
"text": "def set_title\n @title = \"... |
b67c3b2371f7b3e3cbc862b6bc751334 | Gets the operating order of the companies The operating order is determined by price, with the tiebreaker being the company that entered that space on the market first. | [
{
"docid": "b95350892d6cf5839cc6607a34cfaa68",
"score": "0.764298",
"text": "def operating_order\n @current_prices.keys.sort_by do |company|\n -@current_prices.fetch(company)\n end\n end",
"title": ""
}
] | [
{
"docid": "d1d5845fc6f124dc3512ea2b450f706d",
"score": "0.7205867",
"text": "def operating_order\n game.market.operating_order\n end",
"title": ""
},
{
"docid": "1a1ad256fd3535f1450abd22ab606ae4",
"score": "0.68447214",
"text": "def operating_order\n corporation... |
8d1b538f730444a68b6870205226d1ed | The commands/steps to cleanup any temporary files/directories. | [
{
"docid": "2bc50b01c5098c955e5dd73f91e77d83",
"score": "0.0",
"text": "def clean(&block)\n if block\n @clean = block\n else\n @clean\n end\n end",
"title": ""
}
] | [
{
"docid": "63e2706d64157ee26f3b2013e6c8e78d",
"score": "0.7880096",
"text": "def clean_up\n FileUtils.rm_rf @temp_root\n end",
"title": ""
},
{
"docid": "ab6480ae0c613172697e8609db60d804",
"score": "0.765237",
"text": "def delete_temporary_files\n\t\t`rm -fr tmp/*`\n\tend",
... |
e48d320e3e396ba6ddcc5b53b691a586 | POST /qx/messages POST /qx/messages.json | [
{
"docid": "9ea8ddb7971c3b3c80f54c5605f1b780",
"score": "0.6890091",
"text": "def create\n @qx_message = Qx::Message.new(qx_message_params)\n\n respond_to do |format|\n if @qx_message.save\n format.html { redirect_to @qx_message, notice: 'Message was successfully created.' }\n f... | [
{
"docid": "e18d18e71266c27bcbba27d76e6fe2b4",
"score": "0.6775371",
"text": "def post(content)\n post_to(\"/api/v1/messages/\", {:body => content})\n end",
"title": ""
},
{
"docid": "c9b71292cd0b9852a116b9de197a6882",
"score": "0.63645935",
"text": "def create_message(user_id, r... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "942b54cd23cf13b3156be96ef1cb4ee3",
"score": "0.0",
"text": "def memory_type_params\n params.require(:memory_type).permit(:quantity, :unit)\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... |
c0bff3fc7185bafeb3eccd2ce965ba85 | gets a valid one letter guess and returns it | [
{
"docid": "14c5d8a15b16acfc63a8f9587a23b8b5",
"score": "0.7751016",
"text": "def get_guess\n\t\tguess = gets.chomp.downcase\n\t\tif guess == \"save\"\n\t\telse\t\n\t\t\tif guess.length > 1\n\t\t\t\tputs \"A valid guess must only be one letter\"\n\t\t\t\tguess = nil\n\t\t\telsif guess.scan(/\\d/).empty?... | [
{
"docid": "f7f7a18e7264e4fa04e0bcd076aa1a65",
"score": "0.84002084",
"text": "def guess_a_letter(letter)\r\n\tend",
"title": ""
},
{
"docid": "283d32863f22c4dbec076dd79c0358a3",
"score": "0.82594806",
"text": "def get_guess\n\t\tbegin\n\t\t\tprint \"Guess a letter (or press '1' to s... |
a1380ba073986c231a66142606ae7bea | Doing the the join calculations | [
{
"docid": "b5241bb441f0f21ad5d90a626b135991",
"score": "0.0",
"text": "def mutual_follower_ids(my_follows, other_follows)\n other_follows & my_follows\n end",
"title": ""
}
] | [
{
"docid": "c89e1f95cee87d4860295564589f8a5e",
"score": "0.6705155",
"text": "def collect_join_chain; end",
"title": ""
},
{
"docid": "89415edf7058d3ef89d6eae25c8350dd",
"score": "0.649769",
"text": "def calc_join_condition(from, to, done)\n from = from.sub(/\\..*/, \"\")\n ... |
2cf8e86156c1f98621b80ba6034fecfc | TODO Consider renaming these methods as they are mainly used for databinding | [
{
"docid": "8e42f4ee41c2ddb052b97f571bd7ba9b",
"score": "0.0",
"text": "def can_add_observer?(property_name)\n auto_exec do\n @swt_widget.class.ancestors.map {|ancestor| widget_property_listener_installers[ancestor]}.compact.map(&:keys).flatten.map(&:to_s).include?(property_name.to_s)\n ... | [
{
"docid": "59fb77a0a26b512d1662dd5222488075",
"score": "0.5772472",
"text": "def bound_value\n end",
"title": ""
},
{
"docid": "2a282879441295a4e8035905955c191c",
"score": "0.55909425",
"text": "def binding\n super\n end",
"title": ""
},
{
"docid": "ad... |
76920c38854d058e678228a080644201 | ZipCode formatted as or | [
{
"docid": "e0ca737a89e0bb5f99080922b3682552",
"score": "0.0",
"text": "def to_s(format = nil)\n return '' if to_str.empty?\n return to_str if to_str.length == 5\n \"#{to_str[0..4]}-#{to_str[5..8]}\"\n end",
"title": ""
}
] | [
{
"docid": "d6d9d52496e9e65fee1049b799393805",
"score": "0.7278711",
"text": "def zip_code\n @zip_code || (@address_line3 if @address_line3 =~ /(?i)^[a-z0-9][a-z0-9\\- ]{0,10}[a-z0-9]$/)\n end",
"title": ""
},
{
"docid": "cfc5b621c98a9b83ecf3867c7ee3bcb5",
"score": "0.6750994",
"... |
dbfd04011a70c1b94963df98aeaee6a8 | PUT /system_modules/1 PUT /system_modules/1.xml | [
{
"docid": "2bd363df01fa6eb56515c41e2b7dc683",
"score": "0.6830228",
"text": "def update\n @system_module = SystemModule.find(params[:id])\n\n respond_to do |format|\n if @system_module.update_attributes(params[:system_module])\n format.html { redirect_to(@system_module, :notice => 'Sy... | [
{
"docid": "d41dceabfdf8350161f0796885950c74",
"score": "0.58832926",
"text": "def update\n respond_to do |format|\n if @h2omodule.update(h2omodule_params)\n format.html { redirect_to @h2omodule, notice: 'H2omodule was successfully updated.' }\n format.json { head :no_content }\n ... |