query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
efe0aa85340dec7488c8de1e712bc9d9
The position p1 + alpha(p2p1) on the Line3
[ { "docid": "f9ae81458a19e5200bf8b868a56d5d7b", "score": "0.6569453", "text": "def pos(alpha)\n return @p1 + alpha * (@p2-@p1)\n end", "title": "" } ]
[ { "docid": "f1f669934457fcd06859221d6529b1b6", "score": "0.6181559", "text": "def set_color_from_line(point1, point2)\n end", "title": "" }, { "docid": "5d4fb63071c7fa41101455fd3055dc50", "score": "0.61315", "text": "def draw_simple_line(p1, p2, z_index, colour)\n draw_line(p1....
d47222a3a5245496129f938db326e992
GET /attendance_others GET /attendance_others.json
[ { "docid": "ed8b3bf6288c92bf8170e96682667e34", "score": "0.7432543", "text": "def index\n @attendance_others = current_user.attendan_others\n end", "title": "" } ]
[ { "docid": "d306d99013c6290c0f0fd0e3cea80a2c", "score": "0.6862325", "text": "def attendances\n # nothing here, everything is asked to JSON API\n # this action should render initial template only.\n end", "title": "" }, { "docid": "40fc6db32839df89377f2b9ac0d6f72c", "score": "0.66...
9a04d9dd286864feafb34f8768fb99ba
GET /winemakers/1 or /winemakers/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "27c02bbdb70deb80b2b60eb95b2d707a", "score": "0.6909319", "text": "def index\n @wine_makers = WineMaker.all\n end", "title": "" }, { "docid": "1fb81a14412c052f93cfc601dde71f02", "score": "0.67259544", "text": "def show\n @wager = Wager.find(params[:id])\n\n rende...
705e113571ed0091bb97e6c18011ae44
Create an timeline using a predefined XML template as a REST request.
[ { "docid": "aa90f75b683a380a5fd7224733afbf5e", "score": "0.63172907", "text": "def create(name=\"Default Name\", published=\"false\", genre=\"music\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <timeline>\r\n <published type='string'>#{published}</published>\r\n <d...
[ { "docid": "a5b974e7a5cdeec890570d700ea0cacb", "score": "0.71243596", "text": "def timeline\n @timeline = tmpl(\"timeline.erb\")\n end", "title": "" }, { "docid": "b87e7cb437e5dea6d11d517f9c7dc626", "score": "0.7010694", "text": "def create_timeline(params = {})\n requ...
ce8260d1bc5f654f9b94f61f4a29dad0
Return a Hash representation of the ShadowHash data
[ { "docid": "500ff98d1545083d495c216287e2da35", "score": "0.0", "text": "def password\n { @label => @hash }\n end", "title": "" } ]
[ { "docid": "1e5105a9d34db7377bc158ff6c846d2a", "score": "0.7749659", "text": "def shadowhash\n return @shadowHash\n end", "title": "" }, { "docid": "aa2be8e4d7810b0b12442043c8e349a7", "score": "0.73092836", "text": "def hash\n raw = [name, type, values.join('/')].joi...
fe643237c2b0300ae139970721f691db
GET /referents/1 GET /referents/1.json
[ { "docid": "ac95f2f2198645080cd12271fcd716af", "score": "0.0", "text": "def show\n update_and_decorate\n smartrender\n end", "title": "" } ]
[ { "docid": "258637cc0d4db01b8dfdbbdbf2a74598", "score": "0.74763703", "text": "def index\n referents = Referent.all\n json_response(referents)\n end", "title": "" }, { "docid": "7fc62c8aa96ff7eca450213afb7faf8b", "score": "0.7229703", "text": "def show\n json_response(@refe...
b1d644dca6128ae3330aa1f14f24553a
PUT /statuses/1 PUT /statuses/1.json
[ { "docid": "330787db588ead9e144625361249e41c", "score": "0.0", "text": "def update\n\t\t@status = Status.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tif @status.update_attributes(params[:status])\n\t\t\t\tformat.html { redirect_to @status, notice: 'Status was successfully updated.' }\n\t\t\t\t...
[ { "docid": "489c0ebc678cccd84e822e177fdb11c2", "score": "0.71351594", "text": "def post(text)\n options = { :query => {:status => text}, :basic_auth => @auth }\n self.class.post(\"#{@uri}/api/twitter/statuses/update.json\", options)\n end", "title": "" }, { "docid": "9972ef5265812d362...
166a60e51fff128449e6f4801c1e7f6f
Ping this Daemon instance to prevent it from timing out
[ { "docid": "bb2fd2ae96c68b2a450a453db1cca1d2", "score": "0.6769611", "text": "def ping()\n Timer.renew(@name, @timeout)\n end", "title": "" } ]
[ { "docid": "83a33fcfda83d97373e6510d2e36e92a", "score": "0.7331358", "text": "def ping\n sanity_check\n @handle.ping\n end", "title": "" }, { "docid": "de33fb0025bfb4774c60d15d3c416ca0", "score": "0.692202", "text": "def ping\n self.last_ping = Time.now\n end", ...
abfdc672a7a391292dd99da9471ac9dd
GET /time_sheets/1 or /time_sheets/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "bdcb8c72fece1c1f791ed201d2a06868", "score": "0.73723954", "text": "def index\n @timesheets = Timesheet.all\n render json: @timesheets\n end", "title": "" }, { "docid": "c5db3e2611048c4728d14c32ae5248cf", "score": "0.7078485", "text": "def show\n @times...
a0cadd3679469a130099831ca4b09904
Enumerates all indexed files
[ { "docid": "1d9f10459085c2eb7cadedc201bd0a05", "score": "0.6039182", "text": "def files(&block)\n load_all\n Enumerator.new do |y| \n cache.each do |k,v|\n y << v\n end\n end.each(&block)\n end", "title": "" } ]
[ { "docid": "4d4a158878a0829ae4c1e236f6b1fa09", "score": "0.7349457", "text": "def all_files\n Index.new('index', @repo.git_opener).to_a\n end", "title": "" }, { "docid": "8f059f03aaacec4130b8b007ca4952c1", "score": "0.7317538", "text": "def index\n @files = Fyl...
23dafabd270562eabe78c228572bcaf5
Splits the statistical parameters.
[ { "docid": "17159a4b71fc16200af40cdc5be4a2c4", "score": "0.5812406", "text": "def format0_split_stat_params(data)\n dbs = []\n while r = data.first and /^ *Database\\:/ =~ r\n dbs << data.shift\n end\n @f0dbstat = self.class::F0dbstat.new(dbs)\n i ...
[ { "docid": "5ec060edb50734f3fe951ccb653b9c7c", "score": "0.68696856", "text": "def splitting_params\n params[:splitting]\n end", "title": "" }, { "docid": "fdf986badb064c63bdb37e73b0a003c7", "score": "0.61685383", "text": "def splitParameters(iParameters)\n rFirstPart = ...
2a77c749cf00357e60311b80689fb2de
Memoized to avoid a massive number of redundant structs.
[ { "docid": "a99854654ffe396d4ca62dad50dcecb2", "score": "0.0", "text": "def row_struct(row)\n @row_struct ||=\n Struct.new(*row.headers.map { |header| header.to_sym })\n end", "title": "" } ]
[ { "docid": "2b8bf85a581a9154c7acc69c2f317e4a", "score": "0.6570708", "text": "def __memoized; end", "title": "" }, { "docid": "52884a6298251d060573be742d8f0b13", "score": "0.6357787", "text": "def memo; end", "title": "" }, { "docid": "1481881c7503fc92b7c4350f0f8f7814", ...
e80ce5f9d2b0582e3d3a60f863a72acd
Generate a random number, doing a little extra work to make it more likely that it's suitable for cryptography. If your system doesn't have /dev/urandom then this number is not cryptographically safe. See < for more information. max is the largest possible value of such a random number, where the result will be less th...
[ { "docid": "edff2a01ed7cbe84e80c31756ee49aa7", "score": "0.7468641", "text": "def rand(max); end", "title": "" } ]
[ { "docid": "e9448df505bd725805e3e10084acb4e8", "score": "0.8480626", "text": "def generate_number(max = nil)\n rand(max)\n end", "title": "" }, { "docid": "cdcd3b52f15781f14ba8540582755230", "score": "0.81808805", "text": "def random_number(max)\n rand(max)\n end", ...
7bb2b112acb8ed846d7690f2d5f6bb3d
Parses an event's time and returns it as an array of Datetime objects "yearmonthday hourminute" This is in 24hour time, separated by a % "yearmonthday hourminute%yearmonthday hourminute"
[ { "docid": "f681971210c86d9a9e2ba2a573325785", "score": "0.6748645", "text": "def get_start_times\n times = []\n self.start_time.split('%').each do |t|\n times.push(DateTime.strptime(t, '%m-%d-%Y %H:%M'))\n end\n times\n end", "title": "" } ]
[ { "docid": "beff323e59c9b7888b2a017d07f27496", "score": "0.612541", "text": "def convert_time_and_name(event_to_print)\n ary_time_and_name = [event_to_print.start_date.strftime(\"%H:%M%P\")]\n ary_time_and_name.push(event_to_print.title.split)\n ary_time_and_name.flatten\n end", "title": "...
e604ea5f992cde08484443ff114fb188
Returns an instance of the command, just like with Kontena.run! but before calling "execute" You can use it for specs or reuse of instancemethods. Example: cmd = Kontena::FooCommand.instance(['n', 'foo']) cmd.fetch_stuff
[ { "docid": "e399a000479207d86618ab0e14659045", "score": "0.0", "text": "def instance(arguments)\n @arguments = arguments\n parse @arguments\n self\n end", "title": "" } ]
[ { "docid": "5f8a86368e162f0968f8a272ce9a596b", "score": "0.6353285", "text": "def command_line\n CommandLine.instance\n end", "title": "" }, { "docid": "c487716c721d62209020cb6ba0e2a7ff", "score": "0.62375474", "text": "def get_instance(payload)\n SmsComman...
4ec52e05bca33630a8a4942aab46c181
POST /exercise_templates POST /exercise_templates.json
[ { "docid": "1284b2fccbe6b37588cc8a922a0757e4", "score": "0.76109755", "text": "def create\n @exercise_template = ExerciseTemplate.new(exercise_template_params)\n\n if @exercise_template.save\n render json: @exercise_template, status: :created, location: @exercise_template\n else\n ...
[ { "docid": "b97b9206481ea1e310a09426601e2f65", "score": "0.6443866", "text": "def index\n @exercise_templates = ExerciseTemplate.all\n render json: @exercise_templates\n end", "title": "" }, { "docid": "8f029f1febd5bfd7d0a00580978e8ae3", "score": "0.6424446", "text": "de...
e2c9161b3665f41bfa04c2af9ec32ce1
def post_test binding.pry end
[ { "docid": "65b22757c7925eeb9e776cbde4e0343e", "score": "0.0", "text": "def show\n user = User.find(params[:id].to_i)\n if user\n render json: {name: user.name.split(\" \").first, fb_id: user.fb_id, id: user.id}\n else\n render json: {name: \"Invalid\", fb_id: ...
[ { "docid": "dbc40b7dbbc3d275c9dffc53c62ad971", "score": "0.83995754", "text": "def test\n # require \"pry\"; binding.pry\n end", "title": "" }, { "docid": "f2f4183fe480242461f738e5aed3748a", "score": "0.76253736", "text": "def test_pp\n binding.pry\n puts Time.now\n end", ...
3ca8e7fd701b093122ba225229c11b9b
Delegate to a HelpScoutDocs::Client
[ { "docid": "18fd6f3cfb8255e78e4db64aa14bcb41", "score": "0.7086968", "text": "def initialize_client\n @client = HelpScoutDocs::Client.new(@options) unless defined?(@client) && @client.hash == @options.hash\n @client\n end", "title": "" } ]
[ { "docid": "a73ff37a29f4a4a4923eb71ebfff38d7", "score": "0.6327851", "text": "def request_doc\n \n end", "title": "" }, { "docid": "7bdda5bb6c60eeb9c2b9e09545be4732", "score": "0.632531", "text": "def link_documentation; end", "title": "" }, { "docid": "d119e205d88872...
b72a0f44f3f23d8ad3de3b366dc6c476
returns the plate names of all plates that use a given product
[ { "docid": "b2dcfa5458852d724e319c8c012f9258", "score": "0.0", "text": "def related_product(product)\n @products = Friendship.where(:product_id => product.id).map {|x| [x.friend_id]}\n @products = @products.uniq\n end", "title": "" } ]
[ { "docid": "0429afb3898e54069885ef9d2261208c", "score": "0.64983726", "text": "def product_names\n products.map(&:name).uniq.join(', ')\n end", "title": "" }, { "docid": "a5f662adb41804a46848a518c2d3d35c", "score": "0.6475043", "text": "def product_name\n name = []\n @produ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "d33c0d90588638e6296959cdca2c322e", "score": "0.0", "text": "def set_item\n\t\t\t@item = Item.find(params[:id])\n\t\tend", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60326946", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015941", "text": "de...
490a9ad9b02b02d0a710318adebad767
Can be removed when resource_methods module mixed in
[ { "docid": "322f17c02d8c043cc0af1ebee60eef36", "score": "0.0", "text": "def to_param\n id ? \"#{id}-#{title.gsub(/[^a-z0-9]+/i, '-')}\" : nil\n end", "title": "" } ]
[ { "docid": "03bc6f23c8bcb48e6b2bb7ed699de141", "score": "0.7716594", "text": "def resource_operations; end", "title": "" }, { "docid": "b5ccbaaacefbed896c09131624a6765f", "score": "0.75970834", "text": "def resource_method name\n return unless resource_methods.include?(name.to_sym...
ed34b9caad76eed16dc20ce86114c238
select the M most frequent elements between 57 and 200 in the convolution to form an extended alphabet of amino acid masses
[ { "docid": "710931a7af214a1e3fafd16af0e6286a", "score": "0.8009215", "text": "def restrict(convolution, m)\n alphabet = []\n freq = convolution.each_with_object({}) { |itm, hsh| hsh[itm] = hsh[itm].to_i + 1 if convolution.include?(itm) }\n eligible = freq.select {|k, v| 57 <= k && k <= 200}\n sorte...
[ { "docid": "44440361deabd51681f6afb855112025", "score": "0.6316085", "text": "def high(x)\n x.scan(/\\w+/).max_by{ |x| x.sum - x.size * 96 }\nend", "title": "" }, { "docid": "aa881c70ee121c4754b544c95a3645d3", "score": "0.61164993", "text": "def best_letter string\n alphabet = ('a'...
c3c88d1a7f0586438f94076957a00760
GET /resource/sign_in def new super end POST /resource/sign_in
[ { "docid": "4180b651b2984d03bb560ee5e2ac9b13", "score": "0.0", "text": "def create\n param! :email, String, required: true\n param! :password, String, required: true\n\n @session_dto = SessionDto.new(@current_user)\n @session_service = SessionService.new(@current_user)\n\n @result_code = ...
[ { "docid": "f5f3b02f0da130f426a6771c51e9028a", "score": "0.7685765", "text": "def new\n @user_sign_in = UserSignIn.new\n end", "title": "" }, { "docid": "4bc9a8abda8cf4a5d086a2a8a2e92de8", "score": "0.7485276", "text": "def create\n resource = warden.authenticate!(auth_options...
30f46a2290107e5cdc9c047ecb8bc7f2
Search for a student. at least one of name, username, and employeeID must be provided as key/value in the terms hash. If multiple terms are provided, only returns records where both are true
[ { "docid": "2cc95e477a0f95531c6764c8b6c30106", "score": "0.73358446", "text": "def users_student_search terms={}\n call_path = \"users/studentSearch\"\n data = build_post_data(terms.to_json)\n perform_post(build_url(call_path), data)\n end", "title": "" } ]
[ { "docid": "1110b98f76cbba1cfe79ee3371a10aef", "score": "0.64960796", "text": "def search\n condition_string, includes, condition_array = [], [], []\n if params[:grade]\n condition_string << 'users.grade IN (?)'\n condition_array << params[:grade]\n end\n if params[:department]\n ...
3073211d2590db9718b02a0a628883d6
This method is called by DeterministicAutomaton every time it finds an occurence of some pattern
[ { "docid": "23889f2ea0ec91c7ddfd82c4f566a2ac", "score": "0.0", "text": "def report(pattern, index)\n @patterns.add(pattern) if(!@patterns.include?(pattern))\n arr = @arrays_of_indices[pattern]\n if(arr == nil)\n @arrays_of_indices[pattern] = [index]\n else\n arr[arr.cou...
[ { "docid": "79b6fbb7990e7782f1b09494d807b515", "score": "0.71754354", "text": "def find(pattern)\n end", "title": "" }, { "docid": "9d5389a1dece71632ca9b8f58a523c68", "score": "0.68328524", "text": "def add_matching(pattern); end", "title": "" }, { "docid": "6099250d89fb...
fdd907a114c7e512b020373889f45320
Setup all fixtures in test/fixtures/.(yml|csv) for all tests in alphabetical order. Note: You'll currently still have to declare fixtures explicitly in integration tests they do not yet inherit this setting fixtures :all Add more helper methods to be used by all tests here...
[ { "docid": "cacde804f321523cb7452ead5caf27a6", "score": "0.0", "text": "def todo\n flunk \"test not written\"\n end", "title": "" } ]
[ { "docid": "4e43e64263856792021d7a19ed108576", "score": "0.7760739", "text": "def load_fixtures\n # fixtures = ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(File.dirname(__FILE__), 'test', 'fixtures', '*.{yml,csv}')) \n fixtures = [ 'active_sources', 'semantic_relation...
8cd26c9b61432d9d6023c5a636e02b55
Method to manage overWrite of a part of a text
[ { "docid": "586bba8e460ee57c9be6114ff8805140", "score": "0.602341", "text": "def overwrite c, text\n pos = text =~ /\\n/\n unless pos\n if text.size > @fileContent[c.line][c.column, @fileContent[c.line].size].size\n @fileContent[c.line] = @fileContent[c.line][0, c.column] + tex...
[ { "docid": "301298c7c02b37af31d0175c7ae16037", "score": "0.64255655", "text": "def can_modify\n write_file( @output, read_file(@message).gsub(/[ ]/, \" modified text \") )\n end", "title": "" }, { "docid": "29081a2a8224e17166c31d71ee4ead17", "score": "0.5667118", "text": "def wri...
761cea40d759b600452f179c0c265110
set up parameter that is permit to be entered into data
[ { "docid": "cf5d51b3999b4ce1d26d625ff9db97af", "score": "0.0", "text": "def client_params\n params.require(:client).permit(:first_name, :last_name, :notes)\nend", "title": "" } ]
[ { "docid": "bfa951108b69c8eed106b7ad8acbcbfd", "score": "0.7358836", "text": "def data_param\n params.permit(:value)\n end", "title": "" }, { "docid": "63a1da8a56810d196593193f89b144b6", "score": "0.70293295", "text": "def data_field_params\n allow = [:name,:is_filte...
3dc73fc9a4d9cdf475b811286ff5edc4
Returns notes for contact, based on params if provided
[ { "docid": "fedcb899bf7a163ce0e9231af1c1ec3e", "score": "0.8066231", "text": "def notes params=nil\n @nimble.get \"contact/#{self.id}/notes\", params\n end", "title": "" } ]
[ { "docid": "7cf69ecb11ebebf2a0007d4ab4cd33f4", "score": "0.6895671", "text": "def notes(params = {})\n @notes ||= MailchimpAPI::Note.find(:all, params: { member_id: id }.deep_merge(prefix_options).deep_merge(params))\n end", "title": "" }, { "docid": "a5819a9d7fe36cb3ed29b975fdcbf160...
a611caca7524b646d26a55de0f493f51
number that has the number of digits specified as an argument. ( The first Fibonacci number has index 1 ) Write Fibonacci method first. Use results when writing method for problem.
[ { "docid": "cb23505f3a8d43a655ba17b0d5bc0738", "score": "0.0", "text": "def fib(length)\n arr = []\n first_num, second_num = [0, 1]\n\n length.times do\n first_num, second_num = second_num, first_num + second_num\n arr << first_num\n end\n arr\nend", "title": "" } ]
[ { "docid": "1cfe886a3521bd39a855c4bb0ad72763", "score": "0.8158545", "text": "def fibonacci_number_of_digits(digits)\n number = 1\n until digits(fibonacci(number)) == digits\n number = number + 1\n end\n number\nend", "title": "" }, { "docid": "38e6a38e7c40c88be4ee000670d2fb06", "...
e2724f8083a6484442976bfee1c01d02
called from the game class in each loop. updates options that are displayed
[ { "docid": "2aba6ac018911efc76849864372220e7", "score": "0.0", "text": "def update options\n @text = options[:time] || options[:text]\n end", "title": "" } ]
[ { "docid": "7eeb1ff25277b2645e68546ed23bb52c", "score": "0.70384496", "text": "def options \n loop do \n welcome = Artii::Base.new.asciify(\"Welcome to Battleships\")\n welcome_the_sequel = Artii::Base.new.asciify(\"please select an option\")\n welcome.split(\"\\n\").each.with_index d...
b8a167eb76862c9b391038ba0f749ef5
find all offers for a given user
[ { "docid": "b11b9a4210fbdc148bf6b57b41add334", "score": "0.0", "text": "def find_listing_id\n listings = Listing.where(\"id = ?\",params[:listing_id]).to_a\n if !listings.empty?\n listing_ids = []\n listings.each do |listing|\n listing_ids << listing.id\n end\n @offers =...
[ { "docid": "38e39f6f1d483470fc45de12860547c6", "score": "0.70861113", "text": "def matching_offers\n @user = User.find(params[:user_id])\n @matches = User.offer_matches(@user)\n end", "title": "" }, { "docid": "7e03719351cb5b5c8d6f0b2372b12c19", "score": "0.6883213", "text": "...
724341b26fc41c0e95a5b427076d0872
rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity
[ { "docid": "6f53656ad3a841fae1c80356680cb698", "score": "0.0", "text": "def to_csv_by_template(created_plans, sep = ',')\n template_names = lambda do |plns|\n unique = Set.new\n plns.each do |created_plan|\n created_plan.by_template&.each do |name_count|\n unique.a...
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.73043877", "text": "def private; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.6091824", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4...
ff224a93d85c53d1aaff27edf9324bb0
Remove a key and its value. The previous value is returned, or `nil` if the key did not exist.
[ { "docid": "decda7bea946a4f8cec7286a98137426", "score": "0.6294817", "text": "def delete(key, args={})\n data = request_data(:delete, key_uri(key), args)\n return nil unless data\n data[S_PREV_NODE][S_VALUE]\n end", "title": "" } ]
[ { "docid": "51916be552e6b4131c895cddc3f73a46", "score": "0.70966935", "text": "def del(key)\n position = find(key)\n if position != nil\n # delete\n value = @values[position]\n @slots[position] = nil\n @values[position] = nil\n value\n else\n nil\n end\n end",...
460978dc438a007f1325eb456a66bf4f
Get the user image if there is one, else return default image
[ { "docid": "7ea8092869b88a32b36e40b1615924d3", "score": "0.0", "text": "def getVideo()\n video = \"\"\n if !self.video.blank?\n video = self.video.url\n else\n video = \"video.mp4\"\n end # if !self.photo.blank? #\n end", "title": "" } ]
[ { "docid": "e73d276adcd38788506926a17ecb8d64", "score": "0.79832965", "text": "def avatar_with_default\n avatar_without_default || Avatar.find_by_filename('default_avatar.png')\n end", "title": "" }, { "docid": "e73d276adcd38788506926a17ecb8d64", "score": "0.79832965", "text": "d...
d8e38dc0364d7cb7fb7d811a1efbe8ac
:nocov: This is required to get request attributes in to the production logs. See the various lograge configurations in `production.rb`.
[ { "docid": "57d57a7752b748eb98528fd180ee76a0", "score": "0.52911407", "text": "def append_info_to_payload(payload)\n super\n payload[:referrer] = request&.referrer\n payload[:session_id] = request&.session&.id\n payload[:user_agent] = request&.user_agent\n end", "title": "" } ]
[ { "docid": "403ecca8798702fbd26447da6c084b12", "score": "0.7267659", "text": "def log_request\n # REQUEST_LOG.info( {\n # time: Time.now.to_s,\n # ip: request.remote_ip,\n # path: request.path,\n # site: request.hos...
a22f4a2040a17542ea96e202cb4be49c
PUT /series_descriptions/1 PUT /series_descriptions/1.xml
[ { "docid": "1c890ff6f309e82320cbe5a0f2b593f6", "score": "0.6208875", "text": "def update\n @series_description = SeriesDescription.find(params[:id])\n\n respond_to do |format|\n if @series_description.update(series_description_params)#params[:series_description], :without_protection => true)\...
[ { "docid": "6ab4b00b711cd84478ca1dfe32a5928b", "score": "0.6142813", "text": "def update\n @series = Series.find(params[:id])\n \n respond_to do |format|\n params[:series][:type]=determine_series_type(params[:series][:type])\n if @series.update_attributes(params[:series])\n fla...
d6b403c021793d82f39718ff291f3d38
DELETE /liquor_licenses/1 DELETE /liquor_licenses/1.xml
[ { "docid": "35e6ae344c03c0be32726368d6a92064", "score": "0.0", "text": "def delete_record\n @liquor_license = LiquorLicense.find(params[:id])\n @valid_user = User.find(:first, :conditions => [\"username = ? \", session[:user_id]])\n if session[:user_id] != nil and session[:user_id] != ''\n ...
[ { "docid": "dd59b0cd0ed62ddb99545276a947d6ff", "score": "0.66412985", "text": "def destroy\n @license = License.find(params[:id])\n @license.destroy\n\n respond_to do |format|\n format.html { redirect_to(licenses_url) }\n format.xml { head :ok }\n end\n end", "title": "" },...
7086b90aba9daae56db879158ecdf9d8
Abstract Methods Delete eventually
[ { "docid": "430cb375869bf082b61e435bf931df3b", "score": "0.0", "text": "def census\n raise \"Abstract Method census called on #{self.class} - Please define this method\"\n end", "title": "" } ]
[ { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.821486", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.821486", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "...
3add196b753806c53d4a99ad09255bff
Returns true if any parenthesis are found in the input string.
[ { "docid": "4d5c234e75d194b517ad70b78f028267", "score": "0.0", "text": "def needs_complex_structure?\n @string.match('\\(') ? true : false\n end", "title": "" } ]
[ { "docid": "0c6cf52b52b55b69b2d86cec59602bd1", "score": "0.8110868", "text": "def check_for_parenthesis\n @si_string =~ /\\(/ ? true : false\n end", "title": "" }, { "docid": "2277b7320665b0279e7110323e4bff98", "score": "0.80497926", "text": "def valid_parentheses_x(str)\n s...
6300b658c527795bbddb5351d6056dae
Patient name to be displayed in linelist
[ { "docid": "76d87ca2bc354eeae1d6d08898ef92ed", "score": "0.0", "text": "def displayed_name\n first_name.present? || last_name.present? ? \"#{last_name}#{first_name.blank? ? '' : ', ' + first_name}\" : 'NAME NOT PROVIDED'\n end", "title": "" } ]
[ { "docid": "6daadf87df88f032649fb9b8acd2ecd3", "score": "0.7043633", "text": "def patient_name\n\t\t\"#{self.patient.last_name}, #{self.patient.first_name}\"\n\tend", "title": "" }, { "docid": "243054d5a5a301eba0191c5cd4340fb8", "score": "0.69895524", "text": "def patient_name\n s...
a7a817661c0faa5c863dfc7d8fa829b2
Returns the string representation of the object
[ { "docid": "a408df9f3be79d7c20500741a990725c", "score": "0.0", "text": "def to_s\n to_hash.to_s\n end", "title": "" } ]
[ { "docid": "e0c61d22481a9b8a23b7a0620c2b5f87", "score": "0.901024", "text": "def to_s\n @object.to_s\n end", "title": "" }, { "docid": "fc45164ab937a7dc1e465646a36f565c", "score": "0.89506465", "text": "def to_s\n object.to_s\n end", "title": "" }, { "doci...
6d65bf751ae0cf9181451c01de0600c5
Hooks override these in your subclasses. Given a value, pass along one or more successful conversions or reject the value.
[ { "docid": "e9b3e97b95578318487b49c4a6fb4896", "score": "0.0", "text": "def transform_step(row)\n end", "title": "" } ]
[ { "docid": "8fd9d68eb2c23ca7030a80b494ad021b", "score": "0.6986661", "text": "def cast_value(_value)\n raise NotImplementedError\n end", "title": "" }, { "docid": "499b1b80226db4b9e31478421b8760ba", "score": "0.67974883", "text": "def lenient_value_coercions; end", "t...
43f5d2826c057e986641548b08b0ce67
GET /collect_queries/new GET /collect_queries/new.json
[ { "docid": "10c9023bcfabc29774453b8e0cc5d9b7", "score": "0.81070393", "text": "def new\n @collect_query = CollectQuery.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @collect_query }\n end\n end", "title": "" } ]
[ { "docid": "935fb914890cd47866390fe7b5c0c63c", "score": "0.74696714", "text": "def new\n @query = current_user.queries.new\n\n @new_filters = []\n (1..5).each do |num|\n @new_filters << @query.filters.new\n end\n\n respond_to do |format|\n format.html # new.html.erb\n forma...
066a74921544179d9c0ea364b3981b2d
check_box.html(cell_value) > string Get text to display in screen if check box is multi check box a result will return with html tag. cell.custom_field.text(cell.value) => "IDName cell.custom_field.text(nil) => ''
[ { "docid": "d1331f4eeed0ae58b34c64d720983f85", "score": "0.7783511", "text": "def html(cell_value)\n if multi_value?\n prefix = '<li class=\"check_box_true\"><span>'\n postfix = '</span></li>'\n end\n\n texts(cell_value).collect{|t| \"#{prefix}#{t}#{postfix}\" }.join\n end", "tit...
[ { "docid": "69d5ac324529ecbf70b2ce78c1b73537", "score": "0.6787372", "text": "def get_field_edit_html\n # if(!@value.nil? && (@value == '1' || @value == 1)) then\n if (!@value.nil? && @value == true) then\n checked = 'checked=\"true\"'\n else\n checked = ''\n end\n '<input ty...
912c0e0cf8816366872f1b29941d2de1
DELETE /events/1 DELETE /events/1.json
[ { "docid": "b080e25f7d34304798692065d9888693", "score": "0.0", "text": "def destroy\n @event = EventPost.find(params[:id])\n @event.destroy\n track_activity @event\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",...
[ { "docid": "11f7138ce2d6d84fa0d9949fbd14cb07", "score": "0.76929694", "text": "def destroy\n @event = Event.using(:shard_one).find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "2251e382fe3cd52a6a1c14d3ca5339d4", "score": "0.0", "text": "def set_batch_progress_report\n @batch_progress_report = BatchProgressReport.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;...
54a39b06d74bf1d682d869e533e793ca
The parsed HTTP Method.
[ { "docid": "b362aeb081cc5e9f154fcca2c8355df7", "score": "0.7804875", "text": "def http_method\n METHODS[self[:method]]\n end", "title": "" } ]
[ { "docid": "c0afd3cb0b6a1d62b615b3ff72e13aa1", "score": "0.8648491", "text": "def http_method\n @parser.http_method\n end", "title": "" }, { "docid": "efcd3bda8264ab727512f15f5a904c2e", "score": "0.8237775", "text": "def method\n parse_request! if @method.nil?\n ...
768e535a959171905a31e948d4fac284
Saves translation which have been built and which have nonblank values.
[ { "docid": "199f482ba811fe0ea6bbae70e9bcd693", "score": "0.6576093", "text": "def save_translations\n cache.each_value do |translation|\n next unless present?(translation.__send__ value_column)\n translation.id ? translation.save : model.send(\"add_#{singularize(association_name...
[ { "docid": "404100b52d52acfb39c5a23314dd2fe8", "score": "0.6678037", "text": "def save!\n FileUtils.mkdir_p File.dirname(self.file)\n\n File.open(self.file, \"w+\") do |f|\n f << %(#{self.namespace}.translations || (#{self.namespace}.translations = {});\\n)\n self.transla...
63436678d4cefd8bfa0e305c69c73395
Randomly orders the deck
[ { "docid": "a6ce4896512b7d6dfaf0e92e0c4b06cc", "score": "0.6829807", "text": "def shuffle\n @cards.shuffle!\n self\n end", "title": "" } ]
[ { "docid": "0963c2a1676d9511a878d556e4db7fd7", "score": "0.8023231", "text": "def shuffle\n @deck.sort_by{rand}\n end", "title": "" }, { "docid": "9ee0f24401dc083414f43cc2161e29c4", "score": "0.75456804", "text": "def shuffle\r\n @deck_of_cards.shuffle!\r\n end", "title":...
afca8e7251d2536c1cd6ffdd8bfa6748
> Prints a door of the assembly, creating the appropriate block using its parameters
[ { "docid": "dff6b4f556d2ba9abd380f9beb15897e", "score": "0.0", "text": "def print_door(door, p_coord)\n\t\tto_room_id = door.dest\n\t\t\n\t\t# Obtain needed parameters\n\t\tsub_coord = door.sub_coord\n\t\tdir = door.dir\n\t\t\n\t\tputs door.ls.sformat\n\t\t\n\t\tbegin current_page.print_asm_door(p_coord...
[ { "docid": "0993287632f69873b50917891718e738", "score": "0.67122966", "text": "def block_style_block(factory, cmd)\n factory.programbox() {\n text \"Running code from a block\"\n height 15\n width 30\n command {\n puts 'foo block'\n sleep 2\n puts 'bar block'\n sleep 2\n...
3d59f86193b822ca2742e7d64e41ba0b
Get tenants Get all tenants for a user
[ { "docid": "1513fc4ddb94992328c7cd53d208783a", "score": "0.69800633", "text": "def tenants_get(opts = {})\n data, _status_code, _headers = tenants_get_with_http_info(opts)\n return data\n end", "title": "" } ]
[ { "docid": "1cf82026f18133c9c9e35acd8b8e6c5d", "score": "0.764624", "text": "def index\n @tenants = current_user.tenants\n end", "title": "" }, { "docid": "ec13717fb98f9e43f71e57951fde31e6", "score": "0.76020366", "text": "def tenants\n @tenants\n end", "title": "" }, ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "7ab355a69e920822ec0c27cbe1eedf7c", "score": "0.0", "text": "def fee_type_params\n params.require(:fee_type).permit(:title, :amount)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.requ...
7fe919dfbf4b7b95ce4989f7e562d671
Provides a value for the name field. Order of precedence: 1. CodeInventory metadata file 2. GitHub repository name
[ { "docid": "5a0f05314fa8a235aaf74833b21a7a5d", "score": "0.7675311", "text": "def name(repo, inventory_file_metadata)\n return inventory_file_metadata[\"name\"] if inventory_file_metadata[\"name\"]\n repo[:name]\n end", "title": "" } ]
[ { "docid": "10a282626c80b7aec9ed0e0c0799e1e4", "score": "0.7378575", "text": "def name\n info[:repo_name]\n end", "title": "" }, { "docid": "75019ca9a4685edb05c116e08e94d7f9", "score": "0.7341331", "text": "def name\n @name ||= data.xpath(\"cra:repositoryInfo/c:repositor...
0b6b739424fcfdd0d2b927d7a1e129d1
find a better way to sort, not really gonna work with this (possibly sort.by)
[ { "docid": "6b177d933239eeef1c298647f2effcfb", "score": "0.0", "text": "def find_teams(league)\n teams = []\n league.each do |team|\n teams << team[:home_team]\n teams << team[:away_team]\n end\n uniq_teams = teams.uniq!\nend", "title": "" } ]
[ { "docid": "5e58770e90ee3fc676b1ba993c7ef3fb", "score": "0.76663804", "text": "def stable_sort_by(list); end", "title": "" }, { "docid": "1526fcd6ca5a8eebdf4432b341d31250", "score": "0.74764556", "text": "def bigSorting(unsorted)\n\nend", "title": "" }, { "docid": "b66eef...
1a6aa83cbf8bf05fef8b4f027c55b2f2
check if there's any invalid formatting
[ { "docid": "46c5a854f639b712b8ced9cc600813d2", "score": "0.6230667", "text": "def check_invalid_format(from_addr, to_addr, amount, _b_num, _tran)\n return 5 if from_addr.nil? || to_addr.nil? || amount.nil?\n\n is_valid = true\n is_valid = false unless from_addr.length == 6 && to_addr.length == ...
[ { "docid": "ac8023707075002556cff4c3175c729b", "score": "0.79564893", "text": "def check_format\n check_number_of_lines\n check_valid_line_length\n check_same_length_of_lines\n end", "title": "" }, { "docid": "b413fe186bb7412fefad505d03c34d94", "score": "0.74864316", ...
a4f7ae3283936e83e41920ee8a49db1b
Checks equality by comparing each attribute.
[ { "docid": "5fc8d67005c621cf369beed05d5416e2", "score": "0.0", "text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n date == o.date &&\n intraperiod == o.intraperiod &&\n frequency == o.frequency &&\n open == o.open &&\n hi...
[ { "docid": "569a6e70e3c41ee6dd68d73238c5128c", "score": "0.7291882", "text": "def ==(other)\n attributes == other.attributes\n end", "title": "" }, { "docid": "ce5eeaf80566e4180cb68653bb351220", "score": "0.7188078", "text": "def ==(other) # :nodoc:\n @attrs == other.att...
fba5c8f0fb534c7badce583732033834
retrieves familiarity for an artist Get our numerical estimation of how familiar an artist currently is to the world. todo: limit results
[ { "docid": "127a01dd4596c94743dc3a5ba0c1ade7", "score": "0.7863472", "text": "def familiarity artist\n url = \"http://developer.echonest.com/api/v4/artist/familiarity?api_key=#{ECHONEST_API_KEY}&name=#{artist}&format=json\"\n result = parseURL url\n result[\"response\"][\"artist\"][\"familiarity\"]\n...
[ { "docid": "9461f704682d44de455a8c66625fa42e", "score": "0.5813758", "text": "def recommended_artists()\n get(:session, {:method => \"user.getRecommendedArtists\"})\n end", "title": "" }, { "docid": "8e4217d4ef2fe662137acc24f1a641b9", "score": "0.56917256", "text": "def q...
cb512fa1c702d59f8bbba77802e2dd14
GET /post207s/1 GET /post207s/1.xml
[ { "docid": "3aa2f129fedc80fad961fc740566baf0", "score": "0.6732734", "text": "def show\n @post207 = Post207.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post207 }\n end\n end", "title": "" } ]
[ { "docid": "6ced72449c026189bb0caf59790e7220", "score": "0.6488852", "text": "def show\n @post170 = Post170.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post170 }\n end\n end", "title": "" }, { "docid": "13beb6...
dde7c81f7b3286d46dc923616211baa4
Validates the size of an uploaded picture.
[ { "docid": "fc0fd541408b5bab531c3a8e795ce9ce", "score": "0.80157846", "text": "def picture_size\n if picture.size > 5.megabytes\n errors.add(:picture, \"should be less than 5MB\")\n end\n end", "title": "" } ]
[ { "docid": "a31b346949fda86b85ea594d036065e5", "score": "0.83272547", "text": "def picture_size#[Jerry] Add image size validations\n\n if picture.size > 5.megabytes\n errors.add(:picture, \"should be less than 5MB\")\n end\n\n end", "title": "" }, { "docid": "7c469276757001f46568...
16997b6443172a0c63168bc3b028faae
Method to test the process movement with different inputs
[ { "docid": "7094e3bac1582d3d018c425a7f164f50", "score": "0.71929866", "text": "def test_process_movement\n game = Game.new\n puts game.process_movement(\"S\",-1)\n game.process_movement(\"T\", 0)\n game.process_movement(\"C\", 0)\n game.process_movement(\"F\", 0)\n puts \"\"\n \n ...
[ { "docid": "172672c76440333d4c51c08af681413c", "score": "0.70494056", "text": "def test_robot_moves_and_turns_successfully\n @robot.place('PLACE 1,2,EAST')\n @robot.process('MOVE')\n @robot.process('MOVE')\n @robot.process('LEFT')\n @robot.process('MOVE')\n assert_output(@r...
ddaaa2099c93b7b6feff970c03189120
POST /projects_vendors POST /projects_vendors.json
[ { "docid": "20ccd3fb500aa52b8d4472264653d76a", "score": "0.75553125", "text": "def create\n @projects_vendor = ProjectsVendor.new(projects_vendors_params)\n\n respond_to do |format|\n if @projects_vendor.save\n format.html { redirect_to @projects_vendor, notice: 'Projects vendor was su...
[ { "docid": "fe81b6a44bbf798ef608f2d7d28ad889", "score": "0.6810587", "text": "def create\n @vendor = Vendor.create!(vendor_params)\n render json: Vendor.all\n end", "title": "" }, { "docid": "e6f4e4b4bf8065092cd747811980f6f7", "score": "0.6549388", "text": "def set_projects_ve...
10f751e1d2688edc86d8f4ac7414f2f4
Delete Tax Code Product Type Exemption By Id
[ { "docid": "02b5ba589906c4179848ef34aa749200", "score": "0.5946059", "text": "def finance_tax_codes_id_product_type_exemptions_product_type_exemption_id_delete(id, product_type_exemption_id, opts = {})\n finance_tax_codes_id_product_type_exemptions_product_type_exemption_id_delete_with_http_info(id...
[ { "docid": "38fae5b13ab0f0b4fb6e5f096ef07dca", "score": "0.6938993", "text": "def destroy\n @taxe_type = Taxe::Type.find(params[:id])\n @taxe_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(taxe_types_url) }\n format.xml { head :ok }\n end\n end", "title":...
5bc8fc7e01a405ff81e552c49329b1b8
PATCH/PUT /logicians/1 PATCH/PUT /logicians/1.json
[ { "docid": "2c19ea874cc425e0600093b967f00a12", "score": "0.6421256", "text": "def update\n respond_to do |format|\n if @logician.update(logician_params)\n format.html { redirect_to @logician, notice: 'Logician was successfully updated.' }\n format.json { render :show, status: :ok, ...
[ { "docid": "03b9bc6f6cb63079513af73611e96894", "score": "0.605559", "text": "def update\n respond_to do |format|\n if @logical.update(logical_params)\n format.html { redirect_to @logical, notice: 'Logical was successfully updated.' }\n format.json { render :show, status: :ok, locat...
8b3c0f4a2ae41245605197144058de46
Returns the short URL for a link.
[ { "docid": "7cda01d4d4e625277e9c4032227d1a48", "score": "0.74057996", "text": "def short_link\n 'http://redd.it/' << id\n end", "title": "" } ]
[ { "docid": "a9e9515da921fe1730f9b29734ae29df", "score": "0.8231039", "text": "def short_url\n \t@short_url = request.base_url + '/'+ @link.slug\n end", "title": "" }, { "docid": "9fa19276094761b87eb688d91c9944b3", "score": "0.78137994", "text": "def short_url\n @short_url ||=...
2f9241530d6e0d6ce6392e10a40be6d3
Get Published Draft Author: Tejas Date: 14/08/2018 Reviewed By:
[ { "docid": "bffa0dcde477ce22fb2cbaa12267e218", "score": "0.0", "text": "def get_published_drafts\n service_response = SandboxManagement::CmsConfigurator::GetPublishedDraft.new(params).perform\n render_api_response(service_response)\n end", "title": "" } ]
[ { "docid": "abd07357231100eaaf4cbfe9cbc9a601", "score": "0.6484293", "text": "def get_author\n if (self.doc/'h3.byline').size > 0\n tmp = '' \n byline = (self.doc/'h3.byline').inner_text\n byline.split(\" \").each do |word|\n unless /and/i.match(word)\n ...
1e26588a8aeb838c56b9886b561055c0
Uncomment this if you want to make real requests to GCE (you _will_ be billed!) WebMock.disable!
[ { "docid": "2d38a2c531d08ec19613a8f9d1c0914a", "score": "0.0", "text": "def test\n connection = Fog::Compute.new(:provider => \"Google\")\n\n server = connection.servers.bootstrap\n\n raise \"Could not bootstrap sshable server.\" unless server.ssh(\"whoami\")\n raise \"Could not delete server.\" unl...
[ { "docid": "0556e6715f97326589ceaf9b4022752e", "score": "0.651635", "text": "def webmock_enable_with_http_connect_on_start!\n webmock_enable!(net_http_connect_on_start: true)\nend", "title": "" }, { "docid": "1627aa23c609d4041492465b24d49e0b", "score": "0.638023", "text": "def isola...
02ad65026b78107705805456b2fb9f46
Covnvert vector _v_ from world space coordinates to body local coordinates.
[ { "docid": "d9167c162756ad606a44b6a36f592bec", "score": "0.5930755", "text": "def world2local(v); end", "title": "" } ]
[ { "docid": "8274d1d15fd83feb5f97f841de8c56f0", "score": "0.6599854", "text": "def to_v\n Vector3.new(@x, @y, @z)\n end", "title": "" }, { "docid": "a6ac2a65f067cb0405914bba09c9c0af", "score": "0.63087595", "text": "def normalized\n vec = Vector3.new(@v)\n vec.normalize!...
78a1554d0784410447dbf6dd086b055d
Config route specified data with ordered template and url path. See: RenderTaskroute
[ { "docid": "67248f7e765d6183ed33f8deb2b59c00", "score": "0.6460988", "text": "def route(opt)\n @render_task.route(opt)\n end", "title": "" } ]
[ { "docid": "0beb8c677cf1c503574e32a4d4dd21be", "score": "0.5895851", "text": "def setup_routes\n route \"Elrte.routes(self)\"\n end", "title": "" }, { "docid": "b49d408078aa2312dfd3d2ef9d46265c", "score": "0.58126295", "text": "def define_routes; end", "title": "" }...
eaffb43c1d542e08b640ead5c1b2fb6f
GET /business_units GET /business_units.json
[ { "docid": "868b42b52150b1f5183d0b80e3f5a795", "score": "0.62167025", "text": "def index\n items = BusinessUnit.includes(:profile)\n respond_to do |format|\n format.html { render \"layouts/index\", locals: {items: @items, item_name: 'business_units'} }\n format.json { render json: @item...
[ { "docid": "23ce945b70348a772ea7a63974e7bc23", "score": "0.83262837", "text": "def business_units_list\n url = \"#{@sal_url}/api/v2/business_units/\"\n json_resp_body(url)['results']\n end", "title": "" }, { "docid": "12771960a0a2b8351daf475ceef894fc", "score": "0.7490423", ...
e2a0a9e15752c4ba452ddd194653a018
create the user account POST /account
[ { "docid": "1877819cf5988db48169ae9bc5722781", "score": "0.0", "text": "def create\n @page_title = \"Register\"\n @user = User.new(params[:user])\n @user.save!\n self.current_user = @user\n redirect_back_or_default('/')\n notify(:notice, \"Thanks for signing up!\")\n rescue ActiveReco...
[ { "docid": "df05c8bd8086aa2407716286fa95eb99", "score": "0.82177186", "text": "def create\n @useraccount = Useraccount.new(useraccount_params)\n\n respond_to do |format|\n if @useraccount.save\n format.html { redirect_to @useraccount, notice: 'Useraccount was successfully created.' }\n...
8b4889f600a021d1aeb7a5a9c71fad7c
DELETE /barcodes/1 DELETE /barcodes/1.json
[ { "docid": "86ae5cfdc9e2cc95b34086d63eec5090", "score": "0.6912562", "text": "def destroy\n\t\t@barcode = Barcode.find(params[:id])\n\t\t@barcode.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to barcodes_url }\n\t\tend\n\tend", "title": "" } ]
[ { "docid": "7e43d1f192fc640256844a89f96db7af", "score": "0.76170814", "text": "def destroy\n @bar_code.destroy\n respond_to do |format|\n format.html { redirect_to bar_codes_url, notice: 'Bar code was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "ti...
48ee1bb9cedef0a990c781bc6718dcc4
get the processed configuration for an achievement
[ { "docid": "ecd3c2e3f05bf6978ccb39e3f6bd031c", "score": "0.0", "text": "def achievement(name)\n name = name.to_sym\n check_name(name)\n achievements[name]\n end", "title": "" } ]
[ { "docid": "13c99bbe1dae90307b5cd3ac3d9081b0", "score": "0.6388789", "text": "def achievements\n disk_config.achievements\n end", "title": "" }, { "docid": "f9b4608209024da56c86483830fead5e", "score": "0.62384874", "text": "def configuration\n JSON.parse @gapi.config...
0b47c3f234cc5d094ae79aeff28ccdc2
We need to call this after we have created the CookBooks, Users
[ { "docid": "65a890842599139369da19de00a2b50d", "score": "0.0", "text": "def createRecipeFromAPI(randRecipe)\n # make a recipe obj to create for our DB\n recipe = Recipe.create(title: randRecipe[\"title\"], cookbook: Cookbook.all.sample, instructions: randRecipe[\"instructions\"])\n photo = Phot...
[ { "docid": "c3d7c34144b69216dc963ede714e8280", "score": "0.5990411", "text": "def set_up_user\n\n # TRANSACTION??\n\n #Deleting all notebooks for the user also deletes all their notes\n Notebook.destroy_all(author_id: self.id)\n\n new_notebook = Notebook.create!(author_id: self.id, title:\"F...
cd2a0c094a826214ac212ae6b78b5c7a
Make an http request and return the result.
[ { "docid": "fc6f701d14c7f7238cb1021e724c323c", "score": "0.0", "text": "def get_request(path)\n resp = nil\n begin\n Timeout::timeout(5) do\n resp = do_http_request(path)\n end\n rescue => e\n raise NetBooter::Error.new(\"Error connecting to relay: #{e.messag...
[ { "docid": "f8238d838329c32a883963ab9098254c", "score": "0.7855077", "text": "def make_request\n response = @http.request(@request)\n end", "title": "" }, { "docid": "e4e961ad065b33c3e715b929f44dab3a", "score": "0.76004374", "text": "def do_request()\n uri = URI.parse(AP...
6cd7c7124896a4ca8f95cbd320758659
PATCH/PUT /detail_of_cash_movements/1 PATCH/PUT /detail_of_cash_movements/1.json
[ { "docid": "298f5ff794bd571704a67a3b74ab8adf", "score": "0.7169669", "text": "def update\n respond_to do |format|\n if @detail_of_cash_movement.update(detail_of_cash_movement_params)\n format.html { redirect_to @detail_of_cash_movement, notice: 'Detail of cash movement was successfully up...
[ { "docid": "62c4a9137e764e8c4e7afe9eaa621866", "score": "0.6523466", "text": "def set_detail_of_cash_movement\n @detail_of_cash_movement = DetailOfCashMovement.find(params[:id])\n end", "title": "" }, { "docid": "23a4438df8e3b23da0810bb68734dd99", "score": "0.6517848", "text"...
6f77208995ce46f4817a541c1ba0a5a7
Common run definition used in run_on_additions, run_on_modifications, and run_on_removals
[ { "docid": "e2daff5c94f38072384709278b830fec", "score": "0.0", "text": "def run(paths)\n passed = @runner.run!(paths)\n\n throw :task_has_failed unless passed\n @runner.run_all! if @options[:all_on_pass]\n end", "title": "" } ]
[ { "docid": "148eccc462b51f7738f0a0a8e62b6404", "score": "0.6629037", "text": "def runs; end", "title": "" }, { "docid": "5adec94624e455cb105c19e750d10d61", "score": "0.6367891", "text": "def run(model, runner, user_arguments)\n super(model, runner, user_arguments)\n\n # use the...
639116b152cf3ad8977f30357a0dbb72
Executes Playtones with the passed argument.
[ { "docid": "f135571a4055fb3ff0141cf23f928def", "score": "0.6725746", "text": "def play_tones(argument, wait = false)\n tones = [*argument].join(\",\")\n execute(\"Playtones\", tones).tap do\n sleep tones.scan(/(?<=\\/)\\d+/).map(&:to_i).sum.to_f / 1000 if wait\n end\n ...
[ { "docid": "71d172737a845c680ebb616304d44290", "score": "0.7631062", "text": "def run(player)\n puts \"Hello!\"\n end", "title": "" }, { "docid": "71d172737a845c680ebb616304d44290", "score": "0.7631062", "text": "def run(player)\n puts \"Hello!\"\n end", "title": "" }, ...
7cf1056a5998901242e51f25c742b217
Check if a given interval overlaps this interval
[ { "docid": "d30a1682d17caa3760a4647a7ba6ab02", "score": "0.741863", "text": "def overlaps?(other)\n (start_time - other.end_time) * (other.start_time - end_time) >= 0\n end", "title": "" } ]
[ { "docid": "9b339685333ed6bb450a06832ec896e5", "score": "0.8099724", "text": "def overlaps(interval_a, interval_b)\n if interval_a[0] > interval_b[0]\n interval_a, interval_b = interval_b, interval_a\n end\n interval_a[0] < interval_b[1] && interval_a[1] > interval_b[0]\nend", "title": "" },...
4478326b112dd461b37d584c432c7c12
Upload create POST /api/1/projects/:project_id/uploads
[ { "docid": "29f543db5954929db63b80b54670b64f", "score": "0.782274", "text": "def create_project_upload(project_id, query={})\n perform_post(\"/api/1/projects/#{project_id}/uploads\", build_multipart_bodies({:upload => query}) )\n end", "title": "" } ]
[ { "docid": "3c7af02a34d90e34047145c25e4d7320", "score": "0.7519366", "text": "def create\n if params[:file]\n upload_project_csv(params[:file][:file])\n else\n add_project(params[:project])\n end\n end", "title": "" }, { "docid": "8631e1b5e17710c7bc0e1fdc9348eed0", "s...
3c0cea336c723962096a695126867d0f
Provide a detailed, user friendly representation
[ { "docid": "8f23b5cbe0288dd546200876fb605f99", "score": "0.0", "text": "def inspect\n context = @solution.map {|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Preview.TrustedComms.ImpressionsRateContext #{context}>\"\n end", "title": "" } ]
[ { "docid": "7bea0b559c41a5f338754e1c5f53f1cb", "score": "0.7074551", "text": "def details \n\t\t\"#{self.id} - #{self.name.capitalize}\"\n\tend", "title": "" }, { "docid": "6143c330d598497e31bfa9b9f780219e", "score": "0.7009431", "text": "def detail\n\t\t\t\to = ''\n\t\t\t\to += \" ...
795b075e3178deee22c2f57517e82b6b
End point: (PATCH) Usage: FundAmerica::SubscriptionAgreementTemplate.update(subscription_agreement_template_id, options) Output: Updates an subscription_agreement_template
[ { "docid": "34e40824495ec0425468ed98a07ba3cb", "score": "0.91297084", "text": "def update(subscription_agreement_template_id, options)\n API::request(:patch, \"subscription_agreement_templates/#{subscription_agreement_template_id}\", options)\n end", "title": "" } ]
[ { "docid": "94ac5861f73c461721e937b97a9002a7", "score": "0.67665887", "text": "def update(account_id, template_id, envelope_template)\n data, _status_code, _headers = update_with_http_info(account_id, template_id, envelope_template)\n return data\n end", "title": "" }, { "docid...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "3df23b3ea9cb8fcce53d1167747a2dd9", "score": "0.0", "text": "def comment_params\n params.require(:comment).permit(:body)\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...
85320b3bf7a14a992f71211e75591353
connect GET requests to exec of Pod
[ { "docid": "3b232d4a51e1be238867d18420f71488", "score": "0.65963835", "text": "def connect_get_namespaced_pod_exec_with_http_info(name, namespace, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CoreV1Api.connect_get_namespaced_pod_exec ...\"\n ...
[ { "docid": "71387a473320466c08b0d5bde4624d8e", "score": "0.6298137", "text": "def get_data()\n\t\t# change directory to some dummy path to save the intermediate files.\n\t\tDir.chdir @curl_path\n\t\tget_command = system(\"#{@curl_command} -s -X GET #{@app}/foo\")\n\t\tputs \"\"\n\t\tif get_command == tr...
70cd96322f07389679e2b8016edc9b8e
AWS states: pending , running, shuttingdown, stopped, stopping, terminated OS states: active build deleted error hard_reboot password reboot rebuild rescue resize revert_resize shutoff suspended unknown verify_resize
[ { "docid": "74a7c44c29c11ceb33ac2fc12e5c61e1", "score": "0.5003687", "text": "def map_state(key)\n {\n pending: :build,\n running: :active,\n shuttingdown: :deleted,\n stopped: :deleted,\n stopping: :deleted,\n terminated: :deleted,\n active: :active...
[ { "docid": "dd0625ed530e70b071b8d59c828211f3", "score": "0.61855", "text": "def current_state\n\n if self.state == \"terminated\"\n return self.state\n else\n puts self.AMI_name\n @ec2 = Aws::Ec2.new(AMAZON_ACCESS_KEY_ID_EC2, AMAZON_SECRET_ACCESS_KEY_EC2)\n\n @vm_description = ...
c3543fecb44092949ce7ccb975289f06
Resends a transaction. These can ge retrieved from eth_pendingTransactions(). gasPrice and gasLimit can be included together if the gas settings are being changed from their original settings in the pending_transaction object See
[ { "docid": "0ea60a76c129a3e110b0608d5fb3f1a9", "score": "0.77956945", "text": "def eth_resend(pending_transaction, gasPrice=nil, gasLimit=nil)\r\n package = [pending_transaction]\r\n if gasPrice != nil\r\n package += [gasPrice, gasLimit]\r\n end\r\n response = do_request(\"eth_resend\",...
[ { "docid": "99de77717d5ddade66a7c466007653ac", "score": "0.5698791", "text": "def resend\n if @resending && !@busy\n begin\n @busy = !@busy\n @fiat_config[:fiat][:transfer_type].each do |fiat|\n @resend_server ||= @fiat_server.send(fiat)\n count = @resend_server.r...
2ce191d9dcb2d6b083addca3c598140b
GET /otf_features/new GET /otf_features/new.xml
[ { "docid": "aa2ba684dcd57b92a6fd5f0fcba513a7", "score": "0.8011742", "text": "def new\n @otf_feature = OtfFeature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @otf_feature }\n end\n end", "title": "" } ]
[ { "docid": "3c44dd2ec66b5d9b3a825384481a77f2", "score": "0.7368295", "text": "def new\n @feature = Feature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @feature }\n end\n end", "title": "" }, { "docid": "3c44dd2ec66b5d9b3a8253...
56d1a69211e2fa20c316ba770c725045
Returns whether or not it is too close to the event to cancel RSVPs for the given audience, if it was set by the +event_group+
[ { "docid": "ed98a4665cf30f51c497076fa4c8faa5", "score": "0.49667484", "text": "def rsvps_disabled?(person_or_type)\n return false unless event_group\n hours_prior = event_group.hours_prior_disable_cancel(person_or_type)\n return false if hours_prior.blank?\n ((start_datetime.to_time - Time.n...
[ { "docid": "57418497f39e734ec6e5bdd98c76408c", "score": "0.60501456", "text": "def cancelable?\n eventbookingstatus.key != 'cancelled'\n end", "title": "" }, { "docid": "9435a81a9935ff38d350f7312a113eba", "score": "0.5839464", "text": "def can_cancel?\n !canceled? && reserve_s...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "a092fd0436cd297b49bb5f2ee28ed180", "score": "0.0", "text": "def successfulinsurance_params\n params.require(:successfulinsurance).permit(:code, :text)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7498391", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6958937", "text": "def strong_params\n params.require(:request).permit(param_white...
f770c9fa81337731325416658ab1bf5f
Parse a "ret" TDS token
[ { "docid": "665b668ba2752127e16b955f53c36a49", "score": "0.6586987", "text": "def mssql_parse_ret(data, info)\n\t\tret = data.slice!(0,4).unpack('N')[0]\n\t\tinfo[:ret] = ret\n\t\tinfo\n\tend", "title": "" } ]
[ { "docid": "afa1afcb3838a1b9783d6c92efdab5f9", "score": "0.62757814", "text": "def parse_function_return\n return_kw = expect(:KW_RETURN)\n value = nil\n\n unless peek?(:SEPARATOR)\n value = parse_expression\n end\n\n ret = StmtReturn.new(@curr_parsed_method, value, return_kw)\n\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "efdeebca82a537bdf32550cb9106ce0b", "score": "0.0", "text": "def set_order\n @order = Order::Robust.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...
188bf1bef4edf54a70f916e8354fb615
throw exception when an error occurs
[ { "docid": "74d7ba8fe855ceb3854ea632dbb3dc0f", "score": "0.0", "text": "def validate!\n unless self.validate\n if error\n exception =\n case error[:error]\n when 'invalid_request' then DiandianOAuth::InvalidateRequestError\n when 'unauthori...
[ { "docid": "dd9392d508c21ca3eb5d913a43aedb14", "score": "0.78812534", "text": "def error\n raise \"something went wrong\"\n end", "title": "" }, { "docid": "3dd49bf89ca13eba8cb278cfe6edcd89", "score": "0.7741956", "text": "def rescue_result; end", "title": "" }, { "do...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "0efd5c0b867e29b11aafdf319b35ea83", "score": "0.0", "text": "def set_offerer\n @offerer = Offerer.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;...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "b28b9a6d393dd44c9bcd87f3554ed9f1", "score": "0.0", "text": "def set_stream\n @stream = Stream.find(params[:id], _resource_id: @resource.id, _user_id: current_user.id)\n # @stream = @resource.streams.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;...
1ace82bfbca81631db929f90b27d095a
reference(["a", "b"]) is a safe version of self["a"]["b"]
[ { "docid": "346f1d9d009812737631d42dd72ac4ba", "score": "0.62335724", "text": "def ref(key_path)\n object = self\n key_path.each do |key|\n object = object.is_a?(Hash) ? object[key] : nil\n end\n object\n end", "title": "" } ]
[ { "docid": "166ab358541cbe6d12427030f718dbf4", "score": "0.6251703", "text": "def nested(ref, prefix, name, list: false)\n # Check for cycles by testing whether name was already added to\n # prefix.\n key = \"#{prefix}#{name}#{'[]' if list}\"\n if prefix == \"#{name}/\" || pr...
2146867bb5f5075301c2ea8615e4b7d9
Converts the MQL parameters to APIspecific parameters.
[ { "docid": "f7041131d206da944cf8e0d6140c3dbe", "score": "0.0", "text": "def convert\n equal('per_page', 'limit') # default 100, no maximum\n equal('page', 'page')\n\n input['subject'] && input['subject'].each do |subject|\n equal('licensee', 'name', input: subject) ...
[ { "docid": "bfeb7319e6ca0ddc74b02ba582d2e124", "score": "0.6135292", "text": "def generate_api_query(options)\r\n\r\n #removing Rails and Blacklight parameters\r\n options.delete(\"action\")\r\n options.delete(\"controller\")\r\n options.delete(\"utf8\")\r\n\r\n #translate Blacklight sear...
5b412c55b5c3502f26e68b53b7c5473e
unit tests for the TileRack:: has_tiles_for? method
[ { "docid": "1708181ab916a6d566d57351988e175e", "score": "0.57760525", "text": "def test_rack_has_needed_letters_when_letters_are_in_order_no_duplicates\n [:A,:B,:C,:D].each{|x| @newTileRack.append(x)}\n assert_equal(true,@newTileRack.has_tiles_for?('ABD'))\n end", "title": "" } ]
[ { "docid": "9e9f28bc48eaf4d951b9520b338f82e2", "score": "0.7754176", "text": "def verify_tiles\n end", "title": "" }, { "docid": "9aef254787573fe25f792527ff870236", "score": "0.67656374", "text": "def test_empty_tile_rack_should_need_max_tiles\n assert_equal(7,@newTileRack.nu...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "208bde89666a61d8a3cf6c00455d0f38", "score": "0.0", "text": "def set_broadcast_service\n @broadcast_service = BroadcastService.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...
e664fcbfb075a51e1b2449cc0a38b2b4
Sends the specified documents to the remote backend using bulk upload (if supported by the backend)
[ { "docid": "d337a1b6429dbe07bb69b7b5eebed180", "score": "0.5739734", "text": "def put_all(indexables)\n documents = indexables.map do |indexable|\n generate_document(indexable)\n end\n documents.reject!(&:empty?)\n\n publish_all(documents) unless documents.empty?\n end", ...
[ { "docid": "37f9e3a9f05a5e495e7092b0d00a84e9", "score": "0.7405971", "text": "def bulk_docs(docs)\n docs.each{|doc| doc['_id'] ||= @server.next_uuid }\n post(\"_bulk_docs\", :payload => {:docs => docs}, 'Content-Type' => 'application/json')\n end", "title": "" }, { "docid": "d84...
f9ba6d239df2aa862319c35e86590784
GET /spotify_tracks/1 GET /spotify_tracks/1.xml
[ { "docid": "b0acbbdb35c43011ddf42bc4844ba744", "score": "0.74949473", "text": "def show\n @spotify_track = SpotifyTrack.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @spotify_track }\n end\n end", "title": "" } ]
[ { "docid": "9903ed332d25b7d582fa7a6f6478e9ae", "score": "0.7364726", "text": "def get_spotify_info(url)\n xml_data = Net::HTTP.get_response(URI.parse(url)).body\n doc = REXML::Document.new(xml_data)\n return \"#{doc.elements[\"/track/name\"].text} - #{doc.elements[\"/track/artist/name/\"].text}...