query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "ec01b7c934f7f44da0548580617234fc",
"score": "0.0",
"text": "def survey_params\n params.require(:survey).permit(data: {})\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.79438955",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.6958061",
"text": "def permitted_params\n params.permit!\n end",
"title"... |
1fe7affee59db8c2ffd2c8d0a5e89941 | Find or generate a new valid Doorkeeper Access Token | [
{
"docid": "ed4ab75ed78839c0f95ba562243e3427",
"score": "0.76273257",
"text": "def valid_token\n access_token = find_or_create_doorkeeper_access_token\n create_doorkeeper_access_token if access_token.expired? || access_token.revoked?\n access_token\n end",
"title": ""
}
] | [
{
"docid": "dee2a241918641cb33157ac2bdddaaa9",
"score": "0.76233774",
"text": "def generate_token\n token_hash = SecureRandom.hex\n token_hash.force_encoding('utf-8')\n access_tokens.create(token: token_hash, token_expire: Time.now + DEFAULT_TOKEN_EXPIRE)\n end",
"title": ""
},
{
"... |
f8029013d922eea2936af8bd8ec61aa8 | fonction sauvegarder sous csv | [
{
"docid": "2675f390824bfbb7143f23704e717757",
"score": "0.0",
"text": "def save\n file = CSV.open(File.expand_path(\"../../db/gossip.csv\", __FILE__), \"ab\") do |csv|\n csv << [@author, @content]\n end\n file.close\n end",
"title": ""
}
] | [
{
"docid": "2a71509de38bcf1485913e99264a0d91",
"score": "0.6977571",
"text": "def export_csv\n export_string = \"#{@id},#{type_string},#{@name.gsub(/[\\,,\\s]/,\"\")},\"\n @details.each{|k,v| export_string << \"#{k}=#{v};\".gsub(/[\\,,\\s]/,\"\") }\n export_string\n end",
"ti... |
5574d2cd70c86ea0031ef5e44b5147fd | Cannot generate string with empty length of characters. | [
{
"docid": "30f0ab7fd1366531350ed144189af104",
"score": "0.6786507",
"text": "def test_string_empty_length\n GENERATORS.each do |func_name|\n assert_raises TypeError do\n RFauxFactory.send(func_name, '')\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "d3b417c68519c41fd1825e2b3b25889f",
"score": "0.7462396",
"text": "def random_string(length, chars = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "a99a2136495de94cd92a63b61654b995",
"score": "0.7132901",
"text": "def test_gen_strings_zero_length\n assert_raises Argum... |
ce7e7b4622318ba0faae0559a457992e | Returns `true` if `self` and `other` have the same attributes and values. | [
{
"docid": "19e00bde8a14994c31aa7d61ecb848d2",
"score": "0.0",
"text": "def ==(other)\n super &&\n @value == other.value\n end",
"title": ""
}
] | [
{
"docid": "d52d1042a4b5533455a8d5852ae59fd7",
"score": "0.8746246",
"text": "def eql?(other)\n self.class.attributes.each do |attr|\n return false unless send(attr).eql?(other.send(attr))\n end\n end",
"title": ""
},
{
"docid": "6116481353e0f0ca7013e10c66d7d724",
"sc... |
09016b3a6feb1dde62d87ec2fdf5c677 | GET /mealtimes GET /mealtimes.json | [
{
"docid": "7f0e96af54ef0ffd9d57eb921f5389e7",
"score": "0.7276955",
"text": "def index\n @mealtimes = Mealtime.all\n end",
"title": ""
}
] | [
{
"docid": "170b90b753125c040fd59b327cf2c370",
"score": "0.72328246",
"text": "def show\n @meal_time = MealTime.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meal_time }\n end\n end",
"title": ""
},
{
"docid": "3d... |
8bcc7f15885488fa8daa7df95a19d0b9 | This method is called by SketchUp to determine what file extension is associated with your importer. | [
{
"docid": "b42e070c4ffcea56f7a100447b03fdac",
"score": "0.6552873",
"text": "def file_extension\n\t\t\treturn \"txt\"\n\t\tend",
"title": ""
}
] | [
{
"docid": "2912611a1d3064a46c02e931e09c02e6",
"score": "0.74405503",
"text": "def file_extension; end",
"title": ""
},
{
"docid": "2912611a1d3064a46c02e931e09c02e6",
"score": "0.74405503",
"text": "def file_extension; end",
"title": ""
},
{
"docid": "2912611a1d3064a46c02... |
6f7160c565134a18eaee315794288f09 | Run the pull request cleanup process. | [
{
"docid": "82b7317e2cf72b0aaa3c64329750e627",
"score": "0.6820491",
"text": "def clean_up_closed_pull_requests\n pull_requests_to_clean = @pull_requests.list_closed\n clean_up_pull_request_docker_resources(pull_requests_to_clean)\n clean_up_pull_request_site_export(pull_requests_to_clean)\n e... | [
{
"docid": "1ee24afdc63f32b023bd842c6cd98a67",
"score": "0.7010097",
"text": "def final_cleanup\n puts \"\\nThe hotfix has been deployed. Let's delete the github branch\"\n open_pr\n $stdout.print 'Delete the branch and press Enter when complete '\n $stdin.gets\n\n puts \"\\nLet's close t... |
72c65298093b82f5b3e8f614f2ee7198 | Return true if the string is a known command, false otherwise. | [
{
"docid": "8abcec53cb3479f1109ca41e08aad953",
"score": "0.7416738",
"text": "def command? command\n Commands.method_defined? command\n end",
"title": ""
}
] | [
{
"docid": "847026f0b182d0a8350fa4bb64477bc8",
"score": "0.78027105",
"text": "def command_is?(command)\n @command.to_s == command\n end",
"title": ""
},
{
"docid": "5e5d61478608054894473ff3a2dc7a7e",
"score": "0.76854724",
"text": "def os_command?(str)\n str.start_with?... |
b6ac03f00d031317ecb2726de1e712f7 | GET /directory_objects/1 GET /room/1 GET /start/R0070/end/R2169 GET /start/R0070/directory/1234 | [
{
"docid": "dec039e565d7ab823faf7d6bea4eeb63",
"score": "0.0",
"text": "def show\n respond_to do |format|\n format.html\n format.json { render json: @object }\n end\n end",
"title": ""
}
] | [
{
"docid": "f218c5ae4cc59055b617204c1fd71324",
"score": "0.57712144",
"text": "def get_list dir = '/', options = { :amount => 3, :offset => 3 }\n options = URI.escape(options.collect{ |k,v| \"#{k}=#{v}\"}.join('&'))\n req = Net::HTTP::Propfind.new dir + '/?' + options\n req.basic_auth @login, @... |
def0e64c0c3142aceb069e43f94a58a7 | retrun a hash that contains each row of the table | [
{
"docid": "9077ac37e2f176ea242be8830e3a74ad",
"score": "0.0",
"text": "def content_line_matrix(line_total, dt_merged)\n { total: line_total }\n .merge(add_line_total(sum_by_cat_cont(dt_merged)))\n .each do |key, values|\n key = ' ' if key.nil?\n values.merge!(empty:... | [
{
"docid": "98c7419ccc3935ff17a94ca75c31294b",
"score": "0.802988",
"text": "def hash\n @rows.hash\n end",
"title": ""
},
{
"docid": "7f3158b6ef74bc5318074feb75db151e",
"score": "0.7677883",
"text": "def hashes\n all_rows = rows.locate\n header_row = all_rows.first || r... |
0a37ddda8b13b8a494582b3927d34c6c | finds the factorial of n using a base case and recursion | [
{
"docid": "5db8d790b1335cedc5a1aca1f8413757",
"score": "0.0",
"text": "def fact(n)\n if (n == 1)\n return 1\n end \n return n * fact(n - 1)\nend",
"title": ""
}
] | [
{
"docid": "502bc3c0adf76c372002da9de6f848b6",
"score": "0.8804181",
"text": "def factorial_of_a_number(n)\n #base case\n if n == 0\n 1\n #recursive case\n else\n n * factorial_of_a_number(n-1)\n end\nend",
"title": ""
},
{
"docid": "5292fc8eef1e60e02771b562bff80e0e",
"score":... |
3bab78e5d0230105d305c665c06ce624 | Creates and initializes a new instance of the Web class. | [
{
"docid": "b716e2eab6b0cce582efd27c6177f8a8",
"score": "0.0",
"text": "def initialize(client)\n @client = client\n end",
"title": ""
}
] | [
{
"docid": "4fd9091b57eee8b221231f3248f7645c",
"score": "0.7012912",
"text": "def new\n @web= Web.new\n end",
"title": ""
},
{
"docid": "ff452e0b648d6351de09399e0e5a9223",
"score": "0.66679406",
"text": "def create_web(name, template, options = {}, &blk)\n\t\t\t # create our new... |
8b82933f0950adeed5b3d652e1b062a8 | Implement calls for canvas data via ESB e.g. /users/self/upcoming_events?as_user_id=sis_login_id:studenta initialize variables local to this access method | [
{
"docid": "f50273e58dd13a8e33a5871b74d520ea",
"score": "0.5982968",
"text": "def initialize\n super()\n @canvasESB_w = \"\"\n @canvasESB_yml = \"\"\n @canvasESB_response = \"\"\n @canvasCalendarEvents = nil\n end",
"title": ""
}
] | [
{
"docid": "0acf43dbeaf675503f7d97ddbcdec3c1",
"score": "0.5846775",
"text": "def user_data; end",
"title": ""
},
{
"docid": "0acf43dbeaf675503f7d97ddbcdec3c1",
"score": "0.5846775",
"text": "def user_data; end",
"title": ""
},
{
"docid": "e1fa8eca3dab66bd4483139b3305a583... |
4c35db85142fc182a7e154fc238dd3d0 | PATCH/PUT /admintreatmentprocesstypes/1 PATCH/PUT /admintreatmentprocesstypes/1.json | [
{
"docid": "bfbc338a8ff9ad6e0c9a151ff73b8c2b",
"score": "0.6906792",
"text": "def update\n respond_to do |format|\n if @admintreatmentprocesstype.update(admintreatmentprocesstype_params)\n format.html { redirect_to @admintreatmentprocesstype, notice: 'Admintreatmentprocesstype was success... | [
{
"docid": "263dc93776ec25a9d61e68402f6707a2",
"score": "0.66194487",
"text": "def update\n @count = @procedure_type.requirements.count\n respond_to do |format|\n if @procedure_type.update(procedure_type_params)\n format.html { redirect_to procedure_types_path, notice: 'Tipo de tramite... |
fb9178a33d14c0d1a0476907379e0eb8 | Test for empty arguments | [
{
"docid": "04b1c1a36c58a2b319cb7fabc0569e4d",
"score": "0.7080681",
"text": "def arguments?\n arguments.any?\n end",
"title": ""
}
] | [
{
"docid": "5d2b48ecd780e1d0a737d951ccc207db",
"score": "0.85059386",
"text": "def empty?\n @args.nil?\n end",
"title": ""
},
{
"docid": "fe7048342a5230dc52eac6745d523708",
"score": "0.821891",
"text": "def arg_empty?(arg)\n return arg.empty? || (arg.is_a?(Array) && arg.... |
3dbf5d7214f22a1993bd2c1f8b2fb4bf | syntactic predicate synpred53_Plsql (in plsql.ruby.g) 119:4: synpred53_Plsql : plsql_block ; This is an imaginary rule inserted by ANTLR to implement a syntactic predicate decision | [
{
"docid": "d3bc6e932a4fc339ed0d3bb5e35c83e9",
"score": "0.8293924",
"text": "def synpred53_Plsql\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 420 )\n\n # at line 119:4: plsql_block\n @state.following.push( TOKENS_FOLLOWING_plsql_block_IN_s... | [
{
"docid": "bb97c737dc05d19b379655fd94e01405",
"score": "0.7464541",
"text": "def synpred529_Plsql\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 896 )\n\n # at line 1164:7: ( 'PRIOR' )? sql_condition\n # at line 1164:7: ( 'PRIOR' )?\n a... |
ba9547a094b39c59cd375e0cccad35cc | CALLBACK METHODS Method to regularize email format | [
{
"docid": "e12dfdb163383b1fa8aabe04fb59e76f",
"score": "0.0",
"text": "def strip_and_downcase_value\n if self.value.present?\n self.value.strip!\n self.value.downcase!\n end\n end",
"title": ""
}
] | [
{
"docid": "3c66ed4e2b39d0f54a018a5b8c8a9d2f",
"score": "0.7015266",
"text": "def process_email_body(message_body)\n # take everything in front of the first 'Respond by replying to this email - above this line'\n message_body = message_body.split(EMAIL_SEPARATOR).first\n\n # remove any leading ... |
a3d38d0de4a8e5a1979e04e22b2b3fcc | Retrieves the configuration value for the given option See Autoproj.user_config | [
{
"docid": "8119d27ef682cc32c6b44ebeeed805d8",
"score": "0.6091352",
"text": "def user_config(key)\n Autoproj.user_config(key)\nend",
"title": ""
}
] | [
{
"docid": "fa302e8dd4ae5516354b35cff25c194f",
"score": "0.7591898",
"text": "def option\n return @manager.configurable.class.configuration.options[key]\n end",
"title": ""
},
{
"docid": "1b5d8c3328a0b97f2505eb998a950ce5",
"score": "0.7198401",
"text": "def retrieve_option(na... |
f831b52ba4b6951cce3d6b635d116241 | Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.r2eoallocatem.sendeoallocatemail.subject | [
{
"docid": "9070f4491ee79899dfd44114cddea7de",
"score": "0.0",
"text": "def sendeoallocatemail(emails, engineorder, user)\n #@greeting = \"Hi\"\n\n #mail to: \"to@example.org\"\n\n @user = user\n\n @engineorder = engineorder\n\n mail to: emails, subject: \"【重要】R2システム(本社)からの引当登録通知です。\"\n\n... | [
{
"docid": "ea740e704e8f1173fb87b45dfcaaf989",
"score": "0.78743285",
"text": "def subject_for(key)\n I18n.t(:subject, scope: [:mailer, key])\n end",
"title": ""
},
{
"docid": "8928fe4f050d7ebd3e9aa992b07e320a",
"score": "0.76828146",
"text": "def subject_for\n ActiveSuppo... |
c53c956d70c778a7be8446ecd3494ce7 | Role checker, from low of guest to high of super | [
{
"docid": "f05e03b415b46e3e02da80148353257d",
"score": "0.592596",
"text": "def is_super?\n return has_role?('super')\n end",
"title": ""
}
] | [
{
"docid": "4b8d99b222043be76dc8e52a0da4f619",
"score": "0.72466165",
"text": "def role\n self.roles_mask = 0 if self.roles_mask < 0 || self.roles_mask >= ROLES.count\n self.roles_mask ? ROLES[self.roles_mask].to_sym : guest\n end",
"title": ""
},
{
"docid": "4b8d99b222043be76dc8e52a0... |
faac0fb2f5b069807cd0f55820582b88 | Raccourci : pour ajouter un message au log | [
{
"docid": "6ad71715765b66cd3061864db571ebe8",
"score": "0.0",
"text": "def log_check mess, is_op = nil ; LogCheck.mess(mess, is_op) end",
"title": ""
}
] | [
{
"docid": "20c422b40dc88fb82a87457197dc2814",
"score": "0.7663355",
"text": "def log(message); end",
"title": ""
},
{
"docid": "cf44f47ab212014f096a89e104d4742a",
"score": "0.7292226",
"text": "def log_message\n #History.new(\n # mailbox_name: 'N/A',\n # name: @update... |
87aeef4b10b8dac4e086f2f6a8bd6349 | PUT /tags/1 PUT /tags/1.json | [
{
"docid": "68817bd49ad4025ba0f0815b490f8912",
"score": "0.0",
"text": "def update\n if tag_params[:description] == ''\n tag_params[:description] = nil\n end\n\n @tag = Tag.find(params[:id])\n\n if @tag.update_attributes(tag_params)\n redirect_to tags_path, notice: (I18n.t 'Tag was... | [
{
"docid": "2630f0ef272ef5070065909506fa3a9b",
"score": "0.7164035",
"text": "def update\n begin\n tag = Tagger::Tag.find(params[:id])\n tag.update({ name: params[:name] })\n render json: tag, status: 201\n rescue Exception => e\n render json... |
c955cfc6b3c1ffcf278d2d6e0b35212d | POST /clients POST /clients.json | [
{
"docid": "ed95d79022a732399b12243c5dc73a5d",
"score": "0.64883107",
"text": "def create\n @client = Client.new(client_params)\n respond_to do |format|\n # if @client.valid? \n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n... | [
{
"docid": "5a9b702fa7d00d174a626f7d00acc016",
"score": "0.72085994",
"text": "def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to clients_url, notice: 'El cliente se creó correctamente' }\n format.json { rend... |
a28e478681ac9d29c5dd796aa824781d | PATCH/PUT /users/1 PATCH/PUT /users/1.json | [
{
"docid": "f708367638debca0868469b5d7a648b0",
"score": "0.0",
"text": "def update\n respond_to do |format|\n if @cms_user.update(user_params)\n Rails.logger.info \"#{current_user.username} updated #{@cms_user.username}\"\n format.html { redirect_to @cms_user, notice: 'User was suc... | [
{
"docid": "f0686f191a0def3b6c3ad6edfbcf2f03",
"score": "0.724332",
"text": "def update_user(email)\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users/2.json'\n ).to_s\n\n puts RestClient.patch(\n url,\n { user: { email: email } }\n )... |
08c6b982670a3bb23c5b4001284550ae | PATCH/PUT /call_records/1 PATCH/PUT /call_records/1.json | [
{
"docid": "4c9db5607aaf2592cad3c92a6136465e",
"score": "0.68337214",
"text": "def update\n respond_to do |format|\n if @call_record.update(call_record_params)\n format.html { redirect_to @call_record, notice: 'Call record was successfully updated.' }\n format.json { render :show, ... | [
{
"docid": "36855a593f88f92ee181e1ae26060353",
"score": "0.6612235",
"text": "def update\n @call_detail_record = CallDetailRecord.find(params[:id])\n\n respond_to do |format|\n if @call_detail_record.update_attributes(params[:call_detail_record])\n format.html { redirect_to @call_detai... |
023e9153d322194ff3670e163139129f | int.ord > self Returns the +int+ itself. 97.ord => 97 This method is intended for compatibility to character literals in Ruby 1.9. For example, ?a.ord returns 97 both in 1.8 and 1.9. | [
{
"docid": "054ca0a3a960e9150ab2687e2a2cfafb",
"score": "0.6490187",
"text": "def ord()\n #This is a stub, used for indexing\n end",
"title": ""
}
] | [
{
"docid": "fa24462c05afd6a2ca3f359d2a8485fa",
"score": "0.7046037",
"text": "def test_Integer_InstanceMethods_ord\n\t\tassert_equal(1, 1.ord)\n\t\tassert_equal(65, ?A.ord)\n\t\tassert_equal(66, ?B.ord)\n\tend",
"title": ""
},
{
"docid": "b8c5913330e37ff41c27c31693c5943e",
"score": "0.70... |
00365f419adc0bf8c06eb5c12d242946 | Test that a valid xml string returns a cause object with correct data. | [
{
"docid": "f86f9fa0c046e0027621ff9402956c98",
"score": "0.6542521",
"text": "def test_parse_valid_xml_returns_hash\n name = \"A name\"\n type = \"A type\"\n xml = \"<data><name>#{name}</name><type>#{type}</type></data>\"\n parser = ChainReactor::Parsers::XmlSimpleParser.new get_logger\n ... | [
{
"docid": "0b55093f5115ad4c0cb250e7ef522ce7",
"score": "0.6400494",
"text": "def assert_xml(xml)\n expect(xml).not_to be_empty\n expect do\n assert REXML::Document.new(xml)\n end.not_to raise_error\nend",
"title": ""
},
{
"docid": "a68290e0891250156785f4f9ae910d69",
"score": "0.62... |
4c30a3740e1d7f75094990695fe2ea9f | PUT /children/1 PUT /children/1.xml | [
{
"docid": "066af881e25a77510fdf3f135e9ede28",
"score": "0.5178758",
"text": "def update\n @child = Child.get(params[:id])\n new_photo = params[:child].delete(:photo)\n @child.update_properties_with_user_name current_user_name, new_photo, params[:child]\n \n respond_to do |format|\n ... | [
{
"docid": "8367027b0ecdd345dfa72a907915e7f0",
"score": "0.71790344",
"text": "def update\n @children = Children.find(params[:id])\n\n respond_to do |format|\n if @children.update_attributes(params[:children])\n flash[:notice] = 'Children was successfully updated.'\n format.html... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "e7e769488d15bc753aaddc22a0d663a3",
"score": "0.0",
"text": "def adminmatrixspec_params\n params.require(:adminmatrixspec).permit(:m_species)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74968386",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6958337",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
bc663a89b03df0aac26d63a248adc9e9 | POST /admincp/site_settings POST /admincp/site_settings.json | [
{
"docid": "857c481e825b38d82bb2d6763b2748a6",
"score": "0.76602435",
"text": "def create\n @site_setting = ::SiteSettings.new(params[:site_settings])\n\n respond_to do |format|\n if @site_setting.save\n ::SiteSettings[@site_setting.var] = YAML::load(@site_setting.value)\n forma... | [
{
"docid": "0b3b307ee9d995529a03b40246afa173",
"score": "0.74802417",
"text": "def create\n settings = params[:site_settings]\n settings.each do |k,v|\n s = Setting.find_or_create_by(name: k)\n s.value = v\n s.save\n end\n redirect_to admin_settings_path, notice: 'Settings sav... |
6dc46ab9edb4a0c445785262e1043a48 | def self.newest_movies order('created_at desc').limit(5) end | [
{
"docid": "595e230a9ebf1126325fb52535ccb028",
"score": "0.0",
"text": "def newest_comment\n self.comments.order('created_at desc').limit(1)\n end",
"title": ""
}
] | [
{
"docid": "5d1d93e8ac91aaff2eacdd3bef8b32d3",
"score": "0.74948144",
"text": "def most_popular_questions\n @questions = Question.order(:created_at).first(5)\n end",
"title": ""
},
{
"docid": "d33103d5620a8474d6d60febcae90bec",
"score": "0.7386482",
"text": "def most_recent_scor... |
ee0253cd83c72979cdefc5a5ce4eefd0 | Returns the parent connection. | [
{
"docid": "3519b6e257b8471796f0ac232e7a1150",
"score": "0.0",
"text": "def connection\n Connection.wrap(Cproton.pn_session_connection(@impl))\n end",
"title": ""
}
] | [
{
"docid": "87c72133d79a4b2560b0e8c79306891e",
"score": "0.8865486",
"text": "def connection\n return @parent if @parent.is_a? Connection\n\n @parent.connection\n end",
"title": ""
},
{
"docid": "0a3f24f514bfc220ad207c15bec437df",
"score": "0.74603397",
"text": "def pare... |
4e64dde8737d11dc7ba274ac4a9f868b | def parse_message check end | [
{
"docid": "2a42be66d4fa5e5cfd2d78c4f7a9ea6a",
"score": "0.0",
"text": "def parse_expenses\n expense_string = @message.split(' ')\n expense = {}\n puts (expense_string.length)\n if (expense_string[0][0].to_f.is_a? Numeric)\n expense[:reason] = @message[@message.index(' ')+1..-1]\n ... | [
{
"docid": "d10d6722dded89b63de5f923df1bdc5b",
"score": "0.7270117",
"text": "def process_message(message)\n end",
"title": ""
},
{
"docid": "4a6b1e1faf0249bb70eda5d60239a991",
"score": "0.72543013",
"text": "def parse message\n\t\t\treturn nil unless message.valid_encoding?\n\t\t\t... |
6dedcb0bc48862fd51d521dbea72860c | override to get test files within dirs under specified dir | [
{
"docid": "b442bb8d6941c12e6156953c237db98b",
"score": "0.6304157",
"text": "def build_tests_list\n if ! @test_list.nil?\n return @test_list\n end\n @test_list = []\n Find.find(@ruby_tests_location) do |path|\n if FileTest.directory?(path)\n if F... | [
{
"docid": "49c33ef6d359a1a34f8d5c9225a09af3",
"score": "0.8006027",
"text": "def test_files\n get_folder_files(TESTS_PATH)\n end",
"title": ""
},
{
"docid": "4bea79cebb0368840eb003928446b176",
"score": "0.7447437",
"text": "def find_files dir = test_dir\n glob file_pattern(... |
d2fd79a00beda8da5d50fcb34c30ae6e | Create a file system folder at path | [
{
"docid": "1fbc0d3abea8f27d7e7ef40eedef6544",
"score": "0.796222",
"text": "def create\n FileUtils.mkdir_p path\n end",
"title": ""
}
] | [
{
"docid": "5d9c1d5ace23de050f44827569a2335e",
"score": "0.8192909",
"text": "def create_dir path\n ::Dir.mkdir path\n end",
"title": ""
},
{
"docid": "7a51bed43e41003584d5dd5bde1a8f35",
"score": "0.8130854",
"text": "def create_dir path\n path = with_root path... |
38a06beefe75858dba80e0142bfc2c5c | Remove songs from the reproduction queue [+params[:songs_ids]+] Array of PlayListSong ids to remove | [
{
"docid": "92a0f754d80331fa35478199893d59bd",
"score": "0.8461798",
"text": "def remove_queue_songs(params)\n\n ids = params[:play_list_song_ids]\n puts \"Removing #{ids.length} songs from playlist\"\n\n # If we are deleting the current playing song, stop the play\n restart_server = false\n... | [
{
"docid": "7e5cc0b30e2152076be878ca9329fd16",
"score": "0.7095972",
"text": "def delete_songs(params)\n\n ids = params[:songs_ids]\n\n # Check if the current playing song will be deleted:\n @player_state = PlayerState.load_state\n stopped = false\n if @player_state.play_list_song && ids.... |
7edd606c27af625664176500d4e7f970 | Update a level Permissions Needed: LEVELING_ADMIN | [
{
"docid": "0be027febc47d06422cf012fa1e7a00d",
"score": "0.0",
"text": "def update_level_with_http_info(name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: GamificationLevelingApi.update_level ...\"\n end\n # verify the required param... | [
{
"docid": "122afa525ac22a917953633813968d15",
"score": "0.7539041",
"text": "def admin!\n permission = self.permissions.first\n permission.level_id = SecurityLevel.find_by_level(\"high\").id\n permission.save\n end",
"title": ""
},
{
"docid": "aef37fb56e4014dabb21b02e74d7b845",
... |
2162d6cd83f29c81ec49131f578dd0c3 | Returns an array of 100 profiles | [
{
"docid": "41e6987499f493b1eb0b848971812dc5",
"score": "0.0",
"text": "def user_api_call\n api_key = \"33d7ed1cc08d6f5586e8dd45dd409b\"\n url = \"https://uifaces.co/api\"\n request= \"\"\n response = RestClient.post(\n url,\n request,\n :content_type => :json, :accept => :json, :'X-API-KEY... | [
{
"docid": "9ee787efb791a462add5b31501901125",
"score": "0.6989667",
"text": "def profiles\n @list.map{ |c| c.profile }\n end",
"title": ""
},
{
"docid": "59e884f036e32b0d395a3408427c9655",
"score": "0.6707478",
"text": "def get_profiles\n if authenticate\n pa... |
280b0dc7d6dbd9c48cf65b8fe08e020f | Forces generators to produce javascript instead of coffeescript. | [
{
"docid": "2e46e982de6808b0b8ba863cc17c6483",
"score": "0.63695973",
"text": "def javascript!\n @coffeescript = false\n end",
"title": ""
}
] | [
{
"docid": "de03e807985050df0bc3f15acdd0a00a",
"score": "0.6322607",
"text": "def js_generator\n Apotomo.js_generator\n end",
"title": ""
},
{
"docid": "083fd3f0fd9bc70f44646d1b8fa647ef",
"score": "0.6304279",
"text": "def coffeescript!\n @coffeescript = true\n en... |
57a25ed50908cc3f3f044067247837d3 | Is obligation completion still pending? | [
{
"docid": "1710acb5b75a34b303dd9d17fd20c489",
"score": "0.6735276",
"text": "def pending?\n state == :pending\n end",
"title": ""
}
] | [
{
"docid": "152c107784acf969c462bb18a43cdfb8",
"score": "0.8194343",
"text": "def complete?\n !pending?\n end",
"title": ""
},
{
"docid": "cc31c4baf8aa03d7b066a938278fa590",
"score": "0.76920325",
"text": "def complete?\n !incomplete?\n end",
"title": ""
},
{
... |
63e7417afd13eab8a44cfcdf89b6e60c | Manually revoke a network encryption key policy for ungraceful rekey Manually revoke a network encryption key policy for ungraceful rekey | [
{
"docid": "032913984ef3d252d1b4a0976f836890",
"score": "0.5845745",
"text": "def revoke_dne_key_policy_revoke_with_http_info(key_policy_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.revoke_dne_key_policy_revoke ...\"\n end... | [
{
"docid": "2960983f1276c3f200b7529f637dcc7a",
"score": "0.7195202",
"text": "def revoke\n Lib.keyctl_revoke id\n self\n end",
"title": ""
},
{
"docid": "9796b10e5b1e2d8bec5f94ff09a7585b",
"score": "0.6463915",
"text": "def revoke\n \n end",
"title": ""
},
{
... |
9333b0582a8700435f7f15d740082b22 | Offset of this chunk within the input file | [
{
"docid": "43f2e427560b313641beba9a06bee408",
"score": "0.59268326",
"text": "def map_input_start_offset\n ENV['map_input_start']\n end",
"title": ""
}
] | [
{
"docid": "a9e1907e80102fd832332670fdcd4d75",
"score": "0.7363777",
"text": "def offset\n fil_header[:offset]\n end",
"title": ""
},
{
"docid": "685d3e9440d2405a2cd63ea4222782b2",
"score": "0.69336796",
"text": "def tell\n @offset\n end",
"title": ""
},
{
"do... |
7cde435b2171cf07e29fb7619fae1f8a | custom validator pour la duration | [
{
"docid": "9b5f74e89c13dde18b05df35b85c7950",
"score": "0.6611534",
"text": "def duration_must_be_multiple_of_5\n errors.add(:duration, 'must be a multiple of 5') if\n duration%5 != 0\n end",
"title": ""
}
] | [
{
"docid": "a9e77098126030ebb7b8f4a97866e619",
"score": "0.72494084",
"text": "def validate_timing\n v = Float(@duration_number) rescue false\n puts \"v = #{v}\"\n if @until_radio == \"date\" && !(Float(@duration_number) rescue false)\n errors.add(:timing_duration, \"you need a duration\... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "36aa580800be6b7aff4f4d376a9b7ee1",
"score": "0.0",
"text": "def update!(**args)\n @description = args[:description] if args.key?(:description)\n @expression = args[:expression] if args.key?(:expression)\n @location = args[:location] if args.key?(:location)\n ... | [
{
"docid": "184b1b1ed771473d3eb9f338c0734c38",
"score": "0.73066413",
"text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end",
"title": ""
},
{
"docid": "5076c5a88404ae72986f958710f5687a",
"score": "0.72631145",
"text": "def update... |
a98df87e896113cf49b71b87ccac1ab0 | Get the model object for the logged in user. | [
{
"docid": "4a8fe0e5d0548dcbe54260dcd951a446",
"score": "0.0",
"text": "def current_user\n model = (@controller || self).class.rauth_options[:user_model].constantize\n @current_user ||= (logged_in? ? model.find(session[:user_id]) : model.new)\n end",
"title": ""
}
] | [
{
"docid": "2f1c8f6b0a6dfe7a0364f477dbc07003",
"score": "0.7388867",
"text": "def user_model_object\n user_model = Bolt::Config.user_model_class\n\n # simplest case, existing user model record\n user = user_model.find_by_bolt_identity_id(id)\n return user if user\n \n if user_model.res... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "6737fbc16653a35983475268e7b3cacb",
"score": "0.0",
"text": "def note_params\n params.fetch(:note, {}).permit(:description)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7497801",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6957249",
"text": "def strong_params\n params.require(:request).permit(param_white... |
50f9f185a7e0a4b735aeced6110bd841 | Calculates hash code according to all attributes. | [
{
"docid": "e474520632b81bd3f48716436188d5c5",
"score": "0.0",
"text": "def hash\n [message_id, from, date, chat, forward_from, forward_from_chat, forward_from_message_id, forward_date, reply_to_message, edit_date, text, entities, caption_entities, audio, document, game, photo, sticker, video, voic... | [
{
"docid": "d63333ed15c27e3f7526f0c6f8099546",
"score": "0.7120696",
"text": "def attr_hash\n Digest::MD5.hexdigest(\"#{@name}:#{@ruby_type}\")\n end",
"title": ""
},
{
"docid": "23cdf6a080837fbe407633be0799ea0e",
"score": "0.7040001",
"text": "def hash() end",
"title": "... |
738cae62f25004e236738acb19372399 | Time Complexity: O(nm) loops through two different arrays, first word and then all words Space Complexity: O(1) returns the longest prefix regardless of the size of the strings array | [
{
"docid": "7de6ab8707cc88c09b66817d399b8801",
"score": "0.78854686",
"text": "def longest_prefix(strings)\n prefix = \"\"\n strings[0].each_char.with_index do |letter, index|\n strings.each do |string|\n return prefix if letter != string[index]\n end\n prefix += letter\n end\nend",
... | [
{
"docid": "1fb255a1a73026770aebe36ac7c3520e",
"score": "0.8508403",
"text": "def longest_prefix(strings)\n longest_common_prefix = \"\"\n\n if strings == nil || strings.length == 0\n return longest_common_prefix\n end\n\n strings[0].each_char.with_index do |char, i|\n strings.each do |word|\n... |
a5053cd235b3eeccaefec42f15f55a1d | Validates the users UPDATE right | [
{
"docid": "342734553a4c6343a928c6523ac85038",
"score": "0.0",
"text": "def has_edit_right?\n Rails.logger.info \"--> filter has_edit_right?\"\n if @project.writer?(current_user)\n true\n else\n render 'public/403', layout: nil\n end\n end",
"title": ""
}
] | [
{
"docid": "49d0f203b3040d8244f0a78b6413dd19",
"score": "0.7133213",
"text": "def can_update?\n !is_valid?\n end",
"title": ""
},
{
"docid": "3af31c6216e7aa82d8a1ea08f817d5d2",
"score": "0.6909724",
"text": "def update?\n user.admin? || (user.is_valid? && client.owner?(user))\... |
bedc8e6351c2d6f5212b648b7352b4d9 | When passed a block, yields WebhookInstance records from the API. This operation lazily loads records as efficiently as possible until the limit is reached. source://twilioruby//lib/twilioruby/rest/verify/v2/service/webhook.rb94 | [
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.0",
"text": "def each; end",
"title": ""
}
] | [
{
"docid": "228ee2ca9f050d8bbfaf5058d3557b45",
"score": "0.5789531",
"text": "def each_message(timeline_name, &block)\n finished = false\n waterline = nil\n DG::loop_until(proc { finished }) do\n query = {:limit => 40}\n query[:max] = waterline if waterline\n\n get_js... |
1f39f936224ba5b960b48eae8157dedd | Updates data in films table: | [
{
"docid": "417c3ea26f5929951f261c60a19c1a41",
"score": "0.6977055",
"text": "def update()\n sql = \"UPDATE films SET (title, price) = ($1, $2) WHERE id = $3\"\n values = [@title, @price, @id]\n SqlRunner.run(sql, values)\n end",
"title": ""
}
] | [
{
"docid": "e8dbc031d5bbe4c90d8728c9af46873a",
"score": "0.7116198",
"text": "def update\n sql = \"\n UPDATE films\n SET (title, price) =\n ()$1, $2)\n WHERE id = $3\n \"\n values = [@title, @price, @id]\n SqlRunner.run(sql, values)\n end",
"title": ""
},... |
1d28e07204724a0aad0c612aebfd586f | Click "Cancel" button on create new site page | [
{
"docid": "0622dd2ce4b55574deaa7372012cd158",
"score": "0.86551553",
"text": "def new_site_cancel\n inactive_submit.click\n end",
"title": ""
}
] | [
{
"docid": "165edb61d2c22c984dc07c4de7f9507b",
"score": "0.68436563",
"text": "def new_site_save\n active_submit.click\n end",
"title": ""
},
{
"docid": "fb2bbed7d1ec0636ff0b60f3da2ad7ca",
"score": "0.67573017",
"text": "def cancel\n # renders static page\n end",
... |
a4343553a316b981708866de5a9e466c | TODO Do you smell something here? | [
{
"docid": "c7e1aa673d3218323380b2a884542348",
"score": "0.0",
"text": "def find_index(arg=nil, &block)\n return each unless arg || block_given?\n\n each_with_index.map do |elem, index|\n if arg\n return index if arg == elem\n else\n return index if yield(elem)\n end\n... | [
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"score": "0.68084437",
"text": "def desired; end",
"title": ""
},
{
"docid": "2811397aefca145cecd731fd0748b1e6",
"score": "0.6250385",
"text": "def preparable; end",
"title": ""
},
{
"docid": "2811397aefca145cecd731fd0748b1e6... |
ae94ce5ce2132ff96bed0ebd63f566d6 | Es una estado de licitado | [
{
"docid": "5cadbf3087aba997f51194fa3f8c778e",
"score": "0.0",
"text": "def is_tendered?\n\t\ttag_name.eql?(TENDERED)\n\tend",
"title": ""
}
] | [
{
"docid": "f1251baa4fba78f8c249771f4064efa8",
"score": "0.6951444",
"text": "def pending?\n @activated\n end",
"title": ""
},
{
"docid": "ef119ff02afb6547d0d5db633f06c23d",
"score": "0.68988806",
"text": "def pending?\r\n\t\t@activated\r\n\tend",
"title": ""
},
{
"... |
0f6c8ea24633d8530fe5d84e0d6695b3 | Update a &39;equipment.ExpanderModule&39; resource. | [
{
"docid": "38f2f11a2b80f2d89c2bed200861674a",
"score": "0.6781611",
"text": "def update_equipment_expander_module_with_http_info(moid, equipment_expander_module, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: EquipmentApi.update_equipment_expand... | [
{
"docid": "d79c0764dab5149dbd125c3254784bb5",
"score": "0.75955063",
"text": "def update_equipment_expander_module(moid, equipment_expander_module, opts = {})\n data, _status_code, _headers = update_equipment_expander_module_with_http_info(moid, equipment_expander_module, opts)\n data\n en... |
610b0df99cce32f2e0e2a759d9f368aa | GET /sr_notes/1 GET /sr_notes/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "fedcb899bf7a163ce0e9231af1c1ec3e",
"score": "0.7350461",
"text": "def notes params=nil\n @nimble.get \"contact/#{self.id}/notes\", params\n end",
"title": ""
},
{
"docid": "c39cb4c316f2298491506c68cf719e11",
"score": "0.73377156",
"text": "def show\n render jso... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "19ae241069a54d6b5bc36ff95a4457e8",
"score": "0.0",
"text": "def set_user_competence\n @user_competence = UserCompetence.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.6031952",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6015048",
"text": "def... |
f2ebfdf42a64d70db6bf7af268c0fdbb | GET /places GET /places.xml | [
{
"docid": "176c791afeba24a13dff2bcae61a1459",
"score": "0.7233012",
"text": "def index\n @places = Place.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @places }\n end\n end",
"title": ""
}
] | [
{
"docid": "fc9a3618e238a94f09538e554b08a8a6",
"score": "0.71559745",
"text": "def index\n @address_places = Address::Place.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @address_places }\n end\n end",
"title": ""
},
{
"docid... |
bf2df1afb8ffc1e04481a028c16020d2 | GET /accountadmin_accountgroups/1 GET /accountadmin_accountgroups/1.xml | [
{
"docid": "e00fdd8be20c0783eba9b43123d75b5c",
"score": "0.72128445",
"text": "def show\n @accountadmin_accountgroup = AccountadminAccountgroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @accountadmin_accountgroup }\n end\... | [
{
"docid": "969340bdec55bd0a0d30915610e2786e",
"score": "0.745446",
"text": "def index\n @accountadmin_accountgroups = AccountadminAccountgroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @accountadmin_accountgroups }\n end\n end",
... |
09a0c75f9789187e95eb532ce0deb450 | GET /posts/new GET /posts/new.xml | [
{
"docid": "7c3610a76c36344b648c33bab0c07bc7",
"score": "0.0",
"text": "def new\n if signed_in? && author_signed_in?\n @post = Post.new\n @post.user_id = current_user.id\n\n respond_to do |format|\n format.html\n end\n else\n redirect_to root_path\n end\n end",
... | [
{
"docid": "850b9b1ecb72d16ce9d6459d00a509f6",
"score": "0.78365606",
"text": "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n make_rss\n end",
"title": ""
},
{
"docid": "9599b99da7ed3d2b... |
7efd5d543ab2b7ced74f83a26f28b599 | PUT /sponsor_types/1 PUT /sponsor_types/1.xml | [
{
"docid": "75e4086fb8b4e8f3a42576c72dbe6d25",
"score": "0.6872126",
"text": "def update\n @sponsor_type = SponsorType.find(params[:id])\n\n respond_to do |format|\n if @sponsor_type.update_attributes(params[:sponsor_type])\n \texpire_action :action => :index\n\t expire_action :action... | [
{
"docid": "ee1bdf4a191b39b244c2ad353ffb7730",
"score": "0.7176315",
"text": "def update\n respond_to do |format|\n if @sponsor_type.update(sponsor_type_params)\n format.html { redirect_to @sponsor_type, notice: 'Sponsor type was successfully updated.' }\n format.json { render :sho... |
bf621ae423751b403c8201abdc94de4e | Create the following class methods say_name, should print the hero's name to the terminal maximize_energy, should update the energy_level to 1000 gain_power, should take an argument of a number and INCREASE the power_level by that number | [
{
"docid": "37638da2f05a122b3dc5388b87ca87ad",
"score": "0.0",
"text": "def say_name\n puts self.name\n end",
"title": ""
}
] | [
{
"docid": "e3abb561777b8d1d7fe6e1cd6cfe6e58",
"score": "0.66175723",
"text": "def eat\n @energy_level += 10\n end",
"title": ""
},
{
"docid": "ead36d57254573655d77cbdcd96291ea",
"score": "0.66076064",
"text": "def initialize(name)\n @name = name\n @level = 1\n ... |
5b81b30f23f7c87f36b689b6a9482fe3 | Catch errors for integration tests, and report stats re completed request. | [
{
"docid": "fd1719299e91f76322757b2509d3aba7",
"score": "0.6378414",
"text": "def catch_errors_and_log_request_stats\n clear_user_globals\n stats = request_stats\n yield\n IpStats.log_stats(stats)\n logger.warn(request_stats_log_message(stats))\n rescue StandardError => e\n raise(@err... | [
{
"docid": "4633110cd8f569750df79c70e5428b3f",
"score": "0.6836854",
"text": "def test_should_capture_multiple_errors\n 40.times do\n get('/error/controller_error')\n end\n\n assert_errors_reported('this is an uncaught controller error',\n NewRelic::Agent::ErrorCollector::MAX_ERROR_QU... |
abc053cc9d1ce3e8a413c234261917fb | account_type : > String Spells out the User's role rather than the cryptic messages above. | [
{
"docid": "d724f3e6a0d2e996ca3d337d64201301",
"score": "0.74559844",
"text": "def account_type\n self.role.name\n end",
"title": ""
}
] | [
{
"docid": "c029f4aff3e09813044f7bab59cd2411",
"score": "0.7052885",
"text": "def account_type=(type)\n case type\n when TEMP_DUPLICATE\n @account_type = 'duplicate'\n when NORMAL\n @account_type = 'normal'\n when INTERDOMAIN_TRUST\n @ac... |
e53935f5a484434683749e541f9976f7 | Ask whether the game has concluded. returns a boolean indicating if the game has concluded. | [
{
"docid": "e3b95899c37d1401cb1768f3002192d9",
"score": "0.0",
"text": "def is_game_over\n self.game.is_over\n end",
"title": ""
}
] | [
{
"docid": "fea96dab7a9a957e71650960b173d57a",
"score": "0.7030991",
"text": "def concluded?\n !scene.nil? and scene.kind_of?(Scene::Conclusion)\n end",
"title": ""
},
{
"docid": "b9618ae59db5725bf73206c52d02f5ac",
"score": "0.701944",
"text": "def concluded?\n !scene.ni... |
10bee6d24420e5f3185c983b635be7be | PUT /harvests/1 PUT /harvests/1.json | [
{
"docid": "513556a19665f7a715c6bc03be79b5e4",
"score": "0.72718674",
"text": "def update\n @harvest = Harvest.find(params[:id])\n\n respond_to do |format|\n if @harvest.update_attributes(params[:harvest])\n format.html { redirect_to @harvest, notice: 'Harvest was successfully updated.... | [
{
"docid": "9a0859b07aae5ae01d2f4f3e7ef69869",
"score": "0.7226768",
"text": "def update\n respond_to do |format|\n if @harvest.update(harvest_params)\n format.html { redirect_to @harvest, notice: 'Harvest was successfully updated.' }\n format.json { render :show, status: :ok, loca... |
09f06eb45add9fb32721c54057029da8 | No NTLM header sent, ask for one and close the connection. | [
{
"docid": "cafc2285727345b0bb3684d16bb4bdf4",
"score": "0.5442546",
"text": "def process_no_auth(request, response)\n response.start(401, true) do |head,out|\n head['WWW-Authenticate'] = 'NTLM'\n end\n end",
"title": ""
}
] | [
{
"docid": "cb6e10348a4fb7c1cc1300dc6eac0ca8",
"score": "0.5885048",
"text": "def negotiate_auth(opts={})\n\n to = opts['timeout'] || 20\n opts['username'] ||= ''\n opts['password'] ||= ''\n\n if opts['provider'] and opts['provider'].include? 'Negotiate'\n provider = \"Negotiate \"\n ... |
2db06808f8bc7952c5ae6a9f5fe53683 | Takes count and returns hash with articles set URL and get article id's generate articles and return article array | [
{
"docid": "27692f3ce7564013b44acefaecc7cfa3",
"score": "0.6130469",
"text": "def latest_articles(count = 10)\n stories = get_page_data(\"newstories\")\n @loaded_articles[:latest_stories] ||= generate_article(stories, count)\n end",
"title": ""
}
] | [
{
"docid": "0b6e034dd0e49b9d82c1f16b23e62dc0",
"score": "0.6925478",
"text": "def fetch_articles(url)\n req = open(url)\n response_body = req.read\n articles_json = JSON.parse(response_body)\n articles_array = articles_json[\"articles\"]\n last_articles = []\n articles_array.each do |a|\n artic... |
45b491633d0d6a863e09722d435c2cf2 | build a param_string from given parameters | [
{
"docid": "0afcc1556b872114369e0adf27233da3",
"score": "0.7111483",
"text": "def param_string\n keys.collect do |p|\n \"#{ p }=#{ CGI.escape(@params[:\"#{ p }\"].to_s) }\"\n end.join('&')\n end",
"title": ""
}
] | [
{
"docid": "587e6a9d6bb65b88c5fe9143632387a4",
"score": "0.82200587",
"text": "def build_paramstring\n raise 'not implemented'\n end",
"title": ""
},
{
"docid": "a066312fe3a2139f540144826b79162f",
"score": "0.78806275",
"text": "def build_param_string(param_hash)\n retur... |
6d2f4098446fd85d037a11c0512c743a | PATCH/PUT /merchant/transaction_rules/1 PATCH/PUT /merchant/transaction_rules/1.json | [
{
"docid": "c01e1b0e0cfffc24d91f4eb82b10eda4",
"score": "0.6249369",
"text": "def update\n @form = Merchant::TransactionRuleForm.new(@merchant_transaction_rule)\n if @form.validate(merchant_transaction_rule_params)\n if @form.save\n flash[:success] = '修改成功'\n record_activities('... | [
{
"docid": "d14372c012ecaa0c8676b91bbd3407f7",
"score": "0.68902797",
"text": "def update\n @transaction_rule = @business.transaction_rules.find(params[:id])\n\n respond_to do |format|\n if @transaction_rule.update_attributes(transaction_rule_params || {})\n format.html { redirect_to b... |
d1dbe799e1431594adc84c85fea3f4cb | GET /user_personal_programs GET /user_personal_programs.json | [
{
"docid": "490ebb3de02e5f2bb6a09f674d17e2c6",
"score": "0.75481355",
"text": "def index\n @user_personal_programs = UserPersonalProgram.all\n end",
"title": ""
}
] | [
{
"docid": "6add403963bed4591875dd1f22e9524a",
"score": "0.74643815",
"text": "def my_loyalty_programs\n if @user\n @user_programs = @user.loyalty_programs\n if params[:q]\n @user_programs = @user.loyalty_programs.order(\"#{params[:q]} desc\")\n end\n render json: {\n ... |
39d0203e3b3bd2bc5f40c5b289772721 | Returns the value of attribute logger. source://scout_apm//lib/scout_apm/server_integrations/unicorn.rb4 | [
{
"docid": "5f6a5a5b87d242d7ee00054f5ad92955",
"score": "0.0",
"text": "def logger; end",
"title": ""
}
] | [
{
"docid": "46bcec6d36c020dc4778bebc6ecd5b62",
"score": "0.64463323",
"text": "def logger=(value); end",
"title": ""
},
{
"docid": "dabd8c9603d0e223bf4caaa6b814445f",
"score": "0.6387219",
"text": "def get_logger()\n return @config.read('library.logger')\n end",
"title": ... |
a815641c1a8971d236c57a92e5f2bd49 | Invoked when data is received over the channel. | [
{
"docid": "8e34d1cc8041e91fed4995e574976f72",
"score": "0.7436623",
"text": "def on_receive( channel, data )\n @client.send data, 0\n end",
"title": ""
}
] | [
{
"docid": "f1db80831dba29eef5b315033d8427c7",
"score": "0.7480887",
"text": "def receive_data(data)\n @channel << data\n end",
"title": ""
},
{
"docid": "93eaaccce0d699a8fd199c3c46931b37",
"score": "0.72326493",
"text": "def gets_channel_data(channel, data)\n events... |
10ff5d9261a0a5ca0933d82ac0dc1fbe | Determine response to the event, 3 possible returned values: true => attending false => not attending nil => no response yet to the event | [
{
"docid": "bedc5fd1a31f3b027c3f52dc6882449d",
"score": "0.6505044",
"text": "def attend_to?(event)\n attendances.find_by(event_id: event).try(:attend)\n end",
"title": ""
}
] | [
{
"docid": "7355f70f12f80293cb042295c2430ea6",
"score": "0.65846837",
"text": "def responded?\n !approval_response.blank?\n end",
"title": ""
},
{
"docid": "1d1abda45244dd3a25de31c086cb4536",
"score": "0.6462278",
"text": "def response(ent)\n type?(ent, Config)\n sn... |
83992b5aff9b28bd080b2ee706d4c49c | Halt using Unprocessable Entity if request was not valid. | [
{
"docid": "506793e18b5e3c78e3a408f837d79915",
"score": "0.76989347",
"text": "def halt_using_if_invalid(request)\n unless request.valid?\n halt 422, json({ message: request.reason })\n end\n end",
"title": ""
}
] | [
{
"docid": "33620d6b4f205d6ce8ab16026963aa12",
"score": "0.6398851",
"text": "def respond_bad_request; make_response(nil, false, 400, \"Bad Request\") end",
"title": ""
},
{
"docid": "212b67c77b25ee44ee4a4e211c6c539c",
"score": "0.6225427",
"text": "def halt\n throw :halt, respo... |
293884874413dc0af7370c4801ceb531 | If the user already has an identity for this oauth response, get it otherwise create one and associate it with this user | [
{
"docid": "bb29b2146b7975e3954f9e94795312c3",
"score": "0.7421139",
"text": "def find_or_create_identity!(auth)\n ident = Identity.from_oauth auth\n\n # Identity already exist. Make sure it's valid...\n if ident.persisted? && ident.user != self\n raise \"Identity is associated with anothe... | [
{
"docid": "d42d0c5ff02f78e22ffd54065fc56ebf",
"score": "0.6695836",
"text": "def find_or_create_via_omniauth(attributes, existing_user=nil)\n identity = lookup(attributes[:uid], attributes[:provider])\n if(identity)\n Fission::Data.logger.info \"Found existing identit... |
868635a981558e06090926b2eb576b23 | Returns +true+ if +other+ is also a Duration instance with the same +value+, or if other == value. source://activesupport//lib/active_support/duration.rb335 | [
{
"docid": "bfa0a40342998386d3cf689f199fa6d3",
"score": "0.0",
"text": "def ==(other); end",
"title": ""
}
] | [
{
"docid": "d22d4f7ffa7482cc7431c34bee94fa70",
"score": "0.89211035",
"text": "def eql?(other)\n Duration === other && other.value.eql?(value)\n end",
"title": ""
},
{
"docid": "d22d4f7ffa7482cc7431c34bee94fa70",
"score": "0.89211035",
"text": "def eql?(other)\n Duration... |
ed849227904c9f1b37e94d3c8c7ffd92 | test not nil and records numbers | [
{
"docid": "a716a57c24c8fcf8e09690c55fc306a1",
"score": "0.63196194",
"text": "def test_records_numbers\n assert_not_equal [], @test_records\n assert_equal 15, @test_records.size\n end",
"title": ""
}
] | [
{
"docid": "f5680f3311524cd5517ca1c310ed0c88",
"score": "0.6428465",
"text": "def test_nil_records\n user_csv = \"test_files/user_nil.csv\" \n business_csv = \"test_files/biz_nil.csv\" \n\n filter = RecordFilter.new\n filter.create(user_csv, business_csv)\n filter.calc_stats()\n #f... |
f9e05183d53511fd29afdffbaae01bd6 | PATCH/PUT /iterations/1 PATCH/PUT /iterations/1.json | [
{
"docid": "e6888e87ee2f0e4f89d5260951adfa02",
"score": "0.59778637",
"text": "def update\n\t\t\t#1st you retrieve the post thanks to params[:post_id]\n\t\t\t@idea = Idea.find(params[:idea_id])\n\t\t\t#2nd you retrieve the comment thanks to params[:id]\n\t\t\t@iteration = @idea.iterations.find(params[:i... | [
{
"docid": "b34ca15ae3e2a80eb21e8c41d7608567",
"score": "0.6886839",
"text": "def update\n @iteration = Iteration.find(params[:id])\n\n respond_to do |format|\n if @iteration.update_attributes(params[:iteration])\n format.html { redirect_to @iteration, :notice => 'Iteration was success... |
6674ca9ed25aca0967e7dc8287f9fd9e | Operation pour le debut d'une annee | [
{
"docid": "67f45d1fd2d80e9235a2f4b44d70242e",
"score": "0.5817095",
"text": "def debutAnnee\n Famille.debutAnnee\n flash[:notice] = \"Remise à zéro pour début d'année complétée\"\n redirect_to(familles_url)\n end",
"title": ""
}
] | [
{
"docid": "871ec6288b069a405aae843577098ab9",
"score": "0.6285628",
"text": "def oportunidade\n\tend",
"title": ""
},
{
"docid": "e99fcb6a5ed95ddb28c63a7bfafc3f15",
"score": "0.60913116",
"text": "def producirFruta\n @edad + 2 \n end",
"title": ""
},
{
"docid": "bd39... |
42d1420341eade47a788d776e9e61e5e | GET /purchases/1 GET /purchases/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "8588dd22561e312be2cc7e4c7309ac42",
"score": "0.76505417",
"text": "def purchases; JSON[Api::get_purchases(self)]; end",
"title": ""
},
{
"docid": "69c3956eab68345b758f3320de7f890b",
"score": "0.7519314",
"text": "def index\n @purchases = Purchase.all\n\n respond_to ... |
ae15e2fb0bbd16e5a97708a9a89a49db | so that your flash calls still work | [
{
"docid": "1a9d944afc0ba4e9436e053d8db4e288",
"score": "0.59174603",
"text": "def flash\n {}\n end",
"title": ""
}
] | [
{
"docid": "34e3191e00c2789052358885aaa7793b",
"score": "0.72502744",
"text": "def flash=(_arg0); end",
"title": ""
},
{
"docid": "a0d7a78b08db00833ddc7a84e1a2763c",
"score": "0.724396",
"text": "def flash; end",
"title": ""
},
{
"docid": "a0d7a78b08db00833ddc7a84e1a2763c... |
1d110a5501c4302813f874f2e034d039 | GET /reserve_parkings GET /reserve_parkings.json | [
{
"docid": "f7c5a60cf57eb89e459ee871fa921a89",
"score": "0.7582235",
"text": "def index\n @reserve_parkings = ReserveParking.all\n end",
"title": ""
}
] | [
{
"docid": "8ff973c8e553a2484b81c58ace619e55",
"score": "0.72304523",
"text": "def index\n @parkings = Parking.all\n json_response(@parkings)\n end",
"title": ""
},
{
"docid": "acecc46aead26c34e0ce441511595581",
"score": "0.7107146",
"text": "def set_reserve_parking\... |
b2c1a69b5f28d05156347bba4c79a0b2 | Dumps to source code of a snippet to stderr when there is a problem (for example a syntax error during the compile phase). When unit tests are running output is disabled. Output to stderr can be overridden by passing a file handle | [
{
"docid": "e80f458ae9200ad9980853d264efa560",
"score": "0.6865177",
"text": "def dump handle=nil\n\t\tbegin\n\t\t\tTest::Unit.class\n\t\t\t# if unit testing do nothing\n\t\trescue NameError\n\t\t\t# if not unit testing\n\t\t\thandle = $stderr if handle == nil\n\t\t\thandle.print \"\\n==== Snippet #{@fn... | [
{
"docid": "942741992811c0fc014764a06efee520",
"score": "0.62602305",
"text": "def without_stderr; end",
"title": ""
},
{
"docid": "3b20d1fdd130acbb9e7bfc90428de97f",
"score": "0.61074287",
"text": "def format_compile_warning(file_name, file_path, reason, line, cursor); \"\"; end",
... |
f12249bd7d5fc8fa81a6a91a8c7175f2 | GET /destinations or /destinations.json | [
{
"docid": "fad229aa691225fef6cbe80f7553e3c0",
"score": "0.6033581",
"text": "def index\n @destinations = Destination.all.sort { |a, b| a[:name] <=> b[:name] }\n end",
"title": ""
}
] | [
{
"docid": "587785bbadf3c74cf399a5a856455e60",
"score": "0.7424074",
"text": "def index\n\t @destinations = Destination.all\n\n\t respond_to do |format|\n\t\tformat.html # index.html.erb\n\t\tformat.json { render json: @destinations }\n\t end\n\tend",
"title": ""
},
{
"docid": "d307... |
744b4a41042b438ac04189642b4500b0 | GET /allies GET /allies.json | [
{
"docid": "33a3d27741f169cd04321caf61cd1a0b",
"score": "0.7377413",
"text": "def index\n @allies = Ally.all\n end",
"title": ""
}
] | [
{
"docid": "3e5c65cf21c383f4ba3c25e93a00d6d1",
"score": "0.6335594",
"text": "def index\n @alleys = Alley.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @alleys }\n end\n end",
"title": ""
},
{
"docid": "ee3ce4efac07c038f6e00fe2... |
f36444d8f1eddb39c8540fc21e8aaabf | GET /trypointss/1 GET /trypointss/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "fdbd0865b697c31fc36700ecdcee5022",
"score": "0.64191484",
"text": "def index\n @trypoints = Trypoint.all\n end",
"title": ""
},
{
"docid": "8320f474956c9131e2f19eb0cd0dcd46",
"score": "0.6243227",
"text": "def show\n @rtdp = RescueTimeDp.find(params[:id])\n if @... |
b8b9e4637f79d9339f63234bf31466f8 | === SERIALIZATION : === | [
{
"docid": "a1c1e30b003f336b7491a597b45397cf",
"score": "0.0",
"text": "def serialize\n { focal: @focal, near: @near, far: @far, center: @center }\n end",
"title": ""
}
] | [
{
"docid": "a126e681346630c4ec31fd99d7ebfee1",
"score": "0.8338175",
"text": "def serialize; end",
"title": ""
},
{
"docid": "a126e681346630c4ec31fd99d7ebfee1",
"score": "0.8338175",
"text": "def serialize; end",
"title": ""
},
{
"docid": "762bca0e2db3ff19d91cc4521bb1e1d9... |
c7e3eba7fa5d1ea4aa73b6a1b569c911 | Destroy (delete from the database) the current category | [
{
"docid": "ecabeb4fb47fb25269e2afe53ed3b5d7",
"score": "0.7563359",
"text": "def destroy\n category = Category.find(params[:id]).destroy\n flash[:notice] = \"Category '#{category.name}' deleted\"\n redirect_to(action: 'index')\n end",
"title": ""
}
] | [
{
"docid": "d61ea668960612ff0005d107595dd07b",
"score": "0.88038874",
"text": "def destroy\n @category.destroy\n end",
"title": ""
},
{
"docid": "a2db90d4416314449d7d2f4f14368add",
"score": "0.86445665",
"text": "def destroy\n @category.destroy\n end",
"title": ""
... |
cff4696d369e70ab3db3d2a39cbc272e | GET /contacts/new GET /contacts/new.xml | [
{
"docid": "7db2ad7abc0cea4ffb177fff815d561b",
"score": "0.0",
"text": "def new\n if logged_in?\n @contact = Contact.new\n @contact.user = current_user\n @contact.city = \"San Diego\"\n @contact.state = \"CA\"\n @contact.zip = \"9212\"\n end\n \n respond_to do |f... | [
{
"docid": "e8426e45133acb834f50682f112f9adf",
"score": "0.7933003",
"text": "def new\n @contact = @company.contacts.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contact }\n end\n end",
"title": ""
},
{
"docid": "47e0816a0bee... |
a527f4620c5f73ed3e6f1699719122aa | add a bottom border to string | [
{
"docid": "fd195cade1a034bd83e14af0e75abf91",
"score": "0.7583611",
"text": "def bottom_border\n \"#{self.align_center} \\n#{BORDER}\"\n end",
"title": ""
}
] | [
{
"docid": "58af23b5a229f4873414a2cc3d3c8831",
"score": "0.7156233",
"text": "def bottom_border_stroke\n line_stroke(\n settings.border.style.bottom_left,\n settings.border.style.bottom_junc,\n settings.border.style.bottom_right\n ) do\n settings.border.... |
b25e7a8403bb132d3271b42773e1d684 | Get current device session step. | [
{
"docid": "e8c42dbd03fe6def8e8f4f8bd022b071",
"score": "0.0",
"text": "def get_current_device_session_step_using_get1_with_http_info(device_session_id, project_id, run_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AllEndpointsApi.get_curren... | [
{
"docid": "dc2c02a3ad32ce32a4cbb7880bc766fb",
"score": "0.7435626",
"text": "def current_step\n @current_step || steps.first\n end",
"title": ""
},
{
"docid": "dc2c02a3ad32ce32a4cbb7880bc766fb",
"score": "0.7435626",
"text": "def current_step\n @current_step || steps.first\n ... |
d43cbd7f31bf507fa531ec6a53862fa6 | Show the details of a single hook | [
{
"docid": "40eacc15c02163a83d9208ead4d36ee5",
"score": "0.0",
"text": "def show(id = nil)\n method_url = @resource + \"/\" + id\n params = {}\n return self.get(method_url, params)\n end",
"title": ""
}
] | [
{
"docid": "7d64557d4ea2bba6b4010ff57cea381c",
"score": "0.67293435",
"text": "def hook_id; end",
"title": ""
},
{
"docid": "f3a4982c09ff155f22e2b98c94f24fda",
"score": "0.6653966",
"text": "def hook(id)\n get(\"/hooks/#{id}\")\n end",
"title": ""
},
{
"docid": "9... |
5ed9052ea3387ec665b5e10e4a371b15 | DELETE /visions/1 DELETE /visions/1.json | [
{
"docid": "b7710a49e248b5f7f829c2210ecff1bd",
"score": "0.70918274",
"text": "def destroy\n @vision = Vision.find(params[:id])\n @vision.destroy\n\n respond_to do |format|\n format.html { redirect_to visions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
... | [
{
"docid": "bd5a0300d47d3247e7003fde29d9b199",
"score": "0.7220855",
"text": "def destroy\n @revision.destroy\n respond_to do |format|\n format.html { redirect_to revisions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "23d519d8e298e833f... |
44bb05f7cfc630ce91c5c50d2799c906 | Searches for a input port object that matches the type and name specification. +type+ is either a string or a Typelib::Type class, +port_name+ is either a string or a regular expression. This is a helper method used in various places | [
{
"docid": "a480f6d2a0a93a0f16bce442497cc3da",
"score": "0.7906027",
"text": "def find_input_port(type, port_name=nil)\n candidates = find_all_input_ports(type, port_name)\n if candidates.size > 1\n type_name = if !type.respond_to?(:to_str)\n ... | [
{
"docid": "ae66ab4efb0b7b07ae198b03455a0c19",
"score": "0.7826231",
"text": "def find_port(type, port_name=nil)\n candidates = find_all_ports(type, port_name)\n if candidates.size > 1\n type_name =\n if !type.respond_to?(:to_str)\n ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "9f115c5fa99d2562228902ca385bcdd8",
"score": "0.0",
"text": "def set_zhicheng\n @zhicheng = Zhicheng.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;... |
8cfbf92b73239ce4addd55a381406d8f | GET /cases GET /cases.json | [
{
"docid": "88ba60649a44b0dfcd47c289db09d1bc",
"score": "0.0",
"text": "def index\n @q=params[:q]\n cas = Case.active.any_of({:title => /#{@q}/i}, {:description => /#{@q}/i})\n if params[:min_time].to_i > 0 && params[:max_time].to_i > 0\n if params[:min_time].to_i > params[:max_time].to_i... | [
{
"docid": "0935a2a67b9ed0a673aaa5061ed8f1aa",
"score": "0.7242294",
"text": "def index\n @it_cases = ItCase.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @it_cases }\n end\n end",
"title": ""
},
{
"docid": "1291cd387b3cc032549... |
c5d2e5a71683bf52d3a7e79610ca7b0a | POST /projects POST /projects.json | [
{
"docid": "92257ecf6f10d82a079890de81ee5267",
"score": "0.0",
"text": "def create\n params[:project][:start_date] = Date.strptime(params[:project][:start_date], \"%m/%d/%Y\")\n params[:project][:end_date] = Date.strptime(params[:project][:end_date], \"%m/%d/%Y\")\n @project = current_user.proj... | [
{
"docid": "3987b362caed851c61fc0c13c211f4a8",
"score": "0.733839",
"text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.json { render :json => @project, :status => :created, :location => @project }\n format.html {... |
6e8e97207b9c855402c54d4627a77556 | When the wait will timeout and fail. | [
{
"docid": "1bee91640468bcaf897ef9c6b034c136",
"score": "0.0",
"text": "def up_to(seconds)\n @timeout = seconds\n self\n end",
"title": ""
}
] | [
{
"docid": "cd024b2284f2452f6ba4ed562b80cb83",
"score": "0.7589239",
"text": "def test_rescuing_timeout\n options = {:delay => DELAY, :attempts => 2, :timeout => 1}\n wait = Wait.new(options)\n result = wait.until do |attempt|\n case attempt\n when 1 then sleep\n when 2 then \"fo... |