query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
5401785af5fb90039588fd48f9e701d2
GET /team_player_days/new GET /team_player_days/new.json
[ { "docid": "de3c005e27b1d40f7c99075d3a0471fc", "score": "0.78883153", "text": "def new\n @team_player_day = TeamPlayerDay.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @team_player_day }\n end\n end", "title": "" } ]
[ { "docid": "bd8705f34086b5670b391584f4fbf1de", "score": "0.7418971", "text": "def create\n @team_player_day = TeamPlayerDay.new(params[:team_player_day])\n\n respond_to do |format|\n if @team_player_day.save\n format.html { redirect_to @team_player_day, notice: 'Team player day was suc...
393b6b65e70edf4c9be7315b8de7c3ba
GET /showings GET /showings.json
[ { "docid": "df78137ecd85427ec6778e022e1b15f0", "score": "0.7593232", "text": "def index\n @showings = Showing.all\n end", "title": "" } ]
[ { "docid": "33e2ff430fe0d1d2105b115214c458e8", "score": "0.75293833", "text": "def index\n @showings = Showing.all\n \n \n\n end", "title": "" }, { "docid": "e0cd9e8423e6b1ebbaad2a2b5f7e9d95", "score": "0.730613", "text": "def show\n render json: @listing\n end", "ti...
212536c840e026fffb55863862ea8677
Limit versions of a library to the given constraint. Unlike `activate` this does not reduce the possible versions to a single library, but only reduces the number of possibilites.
[ { "docid": "b3da6518fa4ca59a84d187a79f10efb9", "score": "0.6725279", "text": "def constrain(name, constraint)\n name = name.to_s\n\n libraries = self[name]\n\n case libraries\n when Library\n if libraries.version.satisfy?(constraint)\n #@ledger[name] = [li...
[ { "docid": "7651aa0bbce502d40b609ddd0895f0d1", "score": "0.70131034", "text": "def constrain(lib)\n cmp = index[lib.name]\n if Array === cmp\n index[lib.name] = lib\n else\n if lib.version != cmp.version\n raise VersionError\n end\n end\n end", "t...
7299a993421526269437268c25fab542
Borra una sesion de entrenamiento
[ { "docid": "84764ecc239f4586c5a95835bdcdd906", "score": "0.0", "text": "def delete\r\n if request.post?\r\n get_object.destroy\r\n flash[:notice] = \"Training session deleted.\"\r\n end\r\n redirect_to :action=>'index'\r\n end", "title": "" } ]
[ { "docid": "fd0777191b041038601bac396154cd7f", "score": "0.64858973", "text": "def activar\n # flash[:notice] = \"klkkkk\"\n \n session[:cliente_id] = \"desktop\" # SETEADO MANUAL ADMINISTRATIVAMENTE OK TED.\n session[:tipo_cliente] = \"123\" # SETEADO MANUAL ADMINISTRATIVAMENTE OK TED.\n\n...
54cb733c8cdf85375fdcd5dddf00d36d
Turns the raw launch request info into a LaunchItem instance.
[ { "docid": "d10dfb7188e9e9ea16c55c4cf439f16f", "score": "0.6418365", "text": "def to_launchitem (o)\n\n return o if o.is_a?(OpenWFE::LaunchItem)\n return OpenWFE::LaunchItem.new(o) unless o.is_a?(String)\n\n li = OpenWFE::LaunchItem.new\n\n if %w{ < [ - }.include?(o.strip[0, 1]) or o...
[ { "docid": "be8ec0dbad49b54bd31c230a30208863", "score": "0.5842644", "text": "def launch_process( launch_item_or_definition_or_uri, fields = {} )\n launch_item = if launch_item_or_definition_or_uri.kind_of?(RuoteKit::Client::LaunchItem)\n launch_item_or_definition_or_uri\n else\n ...
adb8f49872b50b182fa6b64d04fd7345
Displays the scribd object for the attachment on the given +object+. If +alt_text_or_attribute+ is given, then it will be used as the alternate text for an Attachment_fu model, or as the attribute name for a Paperclip model. If you want to specify alternate text for a Paperclip model, use the last parameter, +alt_text_...
[ { "docid": "c115dc5ddde44658e8e96662ffab6de5", "score": "0.63157845", "text": "def display_scribd(object, options = {})\n # Resolve the right scribd ID, access key, and alt text.\n if object.respond_to?(\"scribd_id\")\n scribd_id = object.scribd_id\n scribd_ak = object.scribd_access_key\...
[ { "docid": "079e0c5ccb3d42d64cd9d9faa7cf2a39", "score": "0.6814456", "text": "def display_scribd(object, alt_text_or_attribute = '', alt_text_if_paperclip = nil)\n # Resolve the right scribd ID, access key, and alt text.\n if object.respond_to?(\"scribd_id\")\n scribd_id = object.scribd_id\n ...
86529a686394238113b0d73a21a5f93d
PATCH/PUT /trackers/events/1 PATCH/PUT /trackers/events/1.json
[ { "docid": "749ca15ef4aa71789c6729c71dcf1783", "score": "0.70900625", "text": "def update\n respond_to do |format|\n if @trackers_event.update(trackers_event_params)\n format.html { redirect_to @trackers_event, notice: 'Event was successfully updated.' }\n format.json { render :sho...
[ { "docid": "dc4ff2adcbcefec9118bdd7e8716ad75", "score": "0.6880264", "text": "def update\n event = event.find(params[\"id\"]) \n event.update_attributes(event_params) \n respond_with event, json: event\n end", "title": "" }, { "docid": "f3fc5aab29d640f22d1f2f386c264d87", "score...
9c29d7a0ffa05b38dcd9e752c85b21d5
Returns true if this layout is unique and already taken by another page.
[ { "docid": "f5589ddf7c6bed8711a7f1974daa264b", "score": "0.85594654", "text": "def already_taken?(layout)\n layout[\"unique\"] && page_with_layout_existing?(layout[\"name\"])\n end", "title": "" } ]
[ { "docid": "76596f39f901e02ae6e125996da48935", "score": "0.6760708", "text": "def unique?\n if defined?(@unique)\n @unique\n else\n true\n end\n end", "title": "" }, { "docid": "2362d09a7d827aa407c9b949d193caf8", "score": "0.666749"...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "2651d104916260bc22ec409891b862b1", "score": "0.0", "text": "def set_payment\n @payment = Payment.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;...
f21122fc273e062bfe0bff796374a928
Get messages from a queue.
[ { "docid": "793a3a14ced62f18f0d370941f53a740", "score": "0.668747", "text": "def get_messages\n @@log.debug \"clearer client starting, thread is: #{Thread.current}\"\n received = nil\n #\n # Note: in the subscribe loop there is actually a separate\n # thread!!\n #\n @client.subscrib...
[ { "docid": "6e901b2aed0879b79cdf1332a1ba24e0", "score": "0.80447197", "text": "def get_messages (queue, params={})\n\n queue = resolve_queue(queue)\n\n params[\"Action\"] = \"ReceiveMessage\"\n\n doc = do_action :get, queue.host, \"/#{queue.name}\", params\n\n ...
d89720516c22987b049a0e5fbb91e7b8
RR::DoubleInjectionreset removes the injected dispatcher method. It binds the original method implementation on the subject if one exists.
[ { "docid": "5865915048c9ed876de04332dfc0c2ca", "score": "0.6773096", "text": "def reset\n if subject_has_original_method?\n subject_class.__send__(:remove_method, method_name)\n subject_class.__send__(:alias_method, method_name, original_method_alias_name)\n subject_cla...
[ { "docid": "afa199e3e1ff3425175d9e65e53be184", "score": "0.74389577", "text": "def reset_double(subject, method_name)\n double_injection = @double_injections[subject].delete(method_name)\n @double_injections.delete(subject) if @double_injections[subject].empty?\n double_injection.reset\n ...
c169fbe630ad6f2eddd366bcd1fa380c
GET /namespaces/new GET /namespaces/new.xml
[ { "docid": "0c9f026732585f301bb939ab77576231", "score": "0.7072749", "text": "def new\n @namespace = Namespace.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @namespace }\n end\n end", "title": "" } ]
[ { "docid": "c7f2c9d8d1b587c3b66f9aed12dc9296", "score": "0.64273673", "text": "def create\n @namespace = Namespace.new(namespace_params)\n\n respond_to do |format|\n if @namespace.save\n format.html { redirect_to namespaces_url, notice: '命名空间创建成功' }\n else\n format.html { r...
1a17f0883ef3366eba8c732be45e4e91
Returns whether the problem is solvable or not. If the parity of permutations and parity of manhattan distance are the same, then this puzzle is unsolvable.
[ { "docid": "d166033ed152e152c559179af907cc73", "score": "0.6335247", "text": "def solvable?\n end", "title": "" } ]
[ { "docid": "33b0e4cd86a92c8f1f2190e92dffb190", "score": "0.72506565", "text": "def is_solved?\n for x in 0...9\n arr = []\n for y in 0...9\n arr << @board[x][y].value.to_i\n end\n if !no_dups(arr)\n return false\n end\n end\n\n # checks all columns\n fo...
1a8f0a2e1b977e0c6aa7087e2417e7f8
The parse tree for the final expression.
[ { "docid": "f1e241a5ce46c0ee6c8a8353a90c955d", "score": "0.0", "text": "def to; end", "title": "" } ]
[ { "docid": "55c9c7d377d6deea16a2e994d28c8829", "score": "0.7106074", "text": "def tree\n @expression\n end", "title": "" }, { "docid": "f18ea729015a9c0393cb881218e9e19e", "score": "0.708277", "text": "def parse\r\n if finished?\r\n return abstract_syntax_tree\r\n ...
cc44bfa59266f71f9c2bed9a6844da6c
END OF REQUIRED FUNCTIONS
[ { "docid": "40b36fd4ec6cfe87dba62b71f9329cbe", "score": "0.0", "text": "def sync\r\n\t\tsend('SYN', '0 0')\r\n\t\treturn 1\r\n\tend", "title": "" } ]
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.7658212", "text": "def private; end", "title": "" }, { "docid": "0b8b7b9666e4ed32bfd448198778e4e9", "score": "0.72421616", "text": "def probers; end", "title": "" }, { "docid": "65ffca17e416f77c52ce148aeafbd826", ...
0f7fd0172b0d17de88814ae0fc284890
Runs the Trapeze program using the application options in _options_.
[ { "docid": "64b78d8e20bd82e74b22cb16d86443eb", "score": "0.63195", "text": "def run!\n options = @args.options\n input_files = Dir.glob(options[:input_files_pattern])\n loader = Trapeze::Loader.new(*input_files)\n unless options[:quiet]\n loader.exceptions.each do |filename, exception|\...
[ { "docid": "10cb23ce06c67b1d4a06c8f06fd20b18", "score": "0.72856516", "text": "def run(options)\n act_on_options(options)\n end", "title": "" }, { "docid": "9af59a60faa2c2d29aab834f7840f90d", "score": "0.67708546", "text": "def run(filename, options) end", "title": "" }...
fd270d1be5e7f12d0e5734b3056b5ac1
POST /case_answers POST /case_answers.xml
[ { "docid": "51cc90d06faf359079687edfe5e86ac6", "score": "0.6399162", "text": "def create\n debugger\n g = \"\"\n g = true\n @case = Case.find(params[:case_id])\n @survey = Survey.find(params[:survey_id])\n @survey.verify_and_update(params, @case)\n errors = []\n if params[:answer...
[ { "docid": "3f2f49ce28fc5a94649a733a4b327e9f", "score": "0.64505994", "text": "def create\n @answer = @question.answers.build(:identity_url => session[:identity_url])\n @answer.set_content(params)\n\n respond_to do |format|\n if @answer.save\n flash[:success] = _('Answer was success...
daf47cf28681fe8d55d9b2209644258a
Property getter for +uuid+
[ { "docid": "426a6662259e8c1bf4c5bb6741943988", "score": "0.61866707", "text": "def uuid\n if @property_hash[:uuid]\n @property_hash[:uuid]\n else\n volumes = self.class.parse lsfs\n volume = volumes.find { |vol| vol[:name] == resource[:name] }\n return volume[:uuid] if volume\n...
[ { "docid": "27f92a644900e449eb402cfe20a2c4ff", "score": "0.81415755", "text": "def get(uuid)\n end", "title": "" }, { "docid": "61994ad5ac9c6fbb1c2ed648465b5d8d", "score": "0.7832721", "text": "def uuid\n @attributes[:uuid]\n end", "title": "" }, { "docid": "...
8836fd5a1a4c7ec487e8379b6e3a6cf3
Callback that will be called by Essbase for each message written to the server or application log.
[ { "docid": "7a533fd2c9055637a98c147928312e47", "score": "0.0", "text": "def process_message(msg_num, msg_lvl, msg_txt)\n unless @suppress_message_nums.include?(msg_num)\n msg_parts = []\n msg_parts << @connection_id if @connection_id\n msg_parts <<...
[ { "docid": "7cb8af10546bbeaf75288bc36e65bb83", "score": "0.7253941", "text": "def on_send_log(message)\n end", "title": "" }, { "docid": "e16fa6a348b96ce38c46e9c439c8ed1e", "score": "0.6968031", "text": "def on_message body\n logger.info body\n end", "title": "" }, ...
7787257345b20f0ba370da9dba1f9ac8
Logins into the service and sets the credentials
[ { "docid": "3dbea05a476e5ddb4db757f898a3c7b5", "score": "0.64137", "text": "def login\n\t\tresource = \"/user/login\"\n\t\t\n\t\tconnection = Faraday.new(:url => @options[:base_url]) do |faraday|\n\t\t\tfaraday.headers['Accept'] = @accept\n\t\t\tfaraday.headers['user-agent'] = @options[:user_agent]\...
[ { "docid": "1eb95787e6c000f14d11db13d9a67982", "score": "0.7679127", "text": "def login\n enterCredentials\n authenticate\n end", "title": "" }, { "docid": "a2bd0ce8d98e1377eeef0b7938de4dc3", "score": "0.68111926", "text": "def login\n endpoint = \"https://#{sel...
fbe2560a3770e3e7c1db1c4dd4d0a4c4
PATCH/PUT /staffs/1 PATCH/PUT /staffs/1.json
[ { "docid": "dc4d5468d03671993c2e45eac5870936", "score": "0.65332407", "text": "def update\n @staff_code = \"s%03d\" % (Staff.find(params[:id]).id.to_i)\n \n respond_to do |format|\n if @staff.update(staff_params)\n format.html { redirect_to staffs_path, notice: 'Staff was successful...
[ { "docid": "949cfec9b44fb2821b5fd2147e4d7dbe", "score": "0.7524374", "text": "def update\n @staff = Staff.find(params[:id])\n\n respond_to do |format|\n if @staff.update_attributes(params[:staff])\n format.html { redirect_to @staff, notice: 'Staff was successfully updated.' }\n ...
cc8f891b45d9527121c6d97934577605
POST /baz76s or /baz76s.json
[ { "docid": "13e5db43e0b82726309fa43baa57645a", "score": "0.5389982", "text": "def create\n @baz76 = Baz76.new(baz76_params)\n\n respond_to do |format|\n if @baz76.save\n format.html { redirect_to @baz76, notice: \"Baz76 was successfully created.\" }\n format.json { render :show,...
[ { "docid": "7acdb16652feaf175da3c582691caee5", "score": "0.64101976", "text": "def post_rest(path, json) \n run_request(:POST, create_url(path), json) \n end", "title": "" }, { "docid": "d150a70b29ba6a251519dff4d7479c13", "score": "0.6279268", "text": "def post(pa...
98e4441e82a24eab037c375111deaa33
POST /staff_codes POST /staff_codes.json
[ { "docid": "a3d66c838b10e4566c803b40b5b8c4a1", "score": "0.70270914", "text": "def create\n @staff_code = StaffCode.new(staff_code_params)\n\n respond_to do |format|\n if @staff_code.save\n format.html { redirect_to edit_company_setting_path(current_user.company.company_setting, anchor...
[ { "docid": "b8b9e049a5dd52ba7fce058bd16d189b", "score": "0.7481272", "text": "def create\n @staff_code = StaffCode.new(staff_code_params)\n\n respond_to do |format|\n if @staff_code.save\n format.html { redirect_to @staff_code, notice: 'Staff code was successfully created.' }\n ...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "92ae202c90b55064768976cebec6489f", "score": "0.0", "text": "def update!(**args)\n @annotation_set_ids = args[:annotation_set_ids] if args.key?(:annotation_set_ids)\n @reference_id = args[:reference_id] if args.key?(:reference_id)\n @reference_name = args[:reference...
[ { "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...
c5770984cf98451ac455f14b99c24c2d
GET /janitors GET /janitors.json
[ { "docid": "414c6b9d7d885a88d5a384329c229255", "score": "0.75853634", "text": "def index\n @janitors = Janitor.all\n end", "title": "" } ]
[ { "docid": "ad988096002019b144182430507b66fd", "score": "0.6832618", "text": "def index\n @creators = Creator.all\n\n render json: @creators\n end", "title": "" }, { "docid": "1f5a7ef87feb2fd358e9332e3e14f416", "score": "0.6755471", "text": "def index\n @competitors = @ladd...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "9d5485a132722e9a5a5691efea62a10f", "score": "0.0", "text": "def set_booking\n @booking = Booking.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;...
32ae5833ad87adff0e05375e5c0ca131
Partially override the content of several objects and wait end of indexing
[ { "docid": "b616d27f3ff21434b301f45438b6988c", "score": "0.5553653", "text": "def partial_update_objects!(objects, create_if_not_exits = true, request_options = {})\n res = partial_update_objects(objects, create_if_not_exits, request_options)\n wait_task(res['taskID'], WAIT_TASK_DEFAULT_TIME_B...
[ { "docid": "b2929ece38598c35d699e81b41d9ba7c", "score": "0.6165885", "text": "def replace_all_objects(objects, request_options = {})\n safe = request_options[:safe] || request_options['safe'] || false\n request_options.delete(:safe)\n request_options.delete('safe')\n\n tmp_index = @c...
519bc7112fb2cc176890e8745641df22
Creates a currentstackname symlink for each deploy for easier tailing filename String of the current run log filename stack String containing the stack for this deploy
[ { "docid": "65cfaf88a7298436ad73885f86d8c14b", "score": "0.7141197", "text": "def link_stack_logfile(filename, stack)\n run_cmd %Q{ln -nfs #{Deployinator.root_dir}/#{run_log_path}#{filename} #{Deployinator.root_dir}/#{run_log_path}current-#{stack}}\n end", "title": "" } ]
[ { "docid": "da3f4a7767337250f887f5c32476cef5", "score": "0.5940017", "text": "def file_name\n prefix = 'broken-links-in-'\n timestamp = Time.now.strftime('_%m-%d_%H-%M-%S')\n prefix + current_branch + timestamp\n end", "title": "" }, { "docid": "4a88f4dc837b21356d4108adb2a800d0", ...
bbb65461b729933bea17133b5f641c64
POST /orders must change database flash notices do not have color def create
[ { "docid": "151fdb44e7cecb2f4d3c671b085eb71e", "score": "0.0", "text": "def update\n if @current_order.order_items.nil?\n flash[:warning] = \"You have zero items in your cart\"\n redirect_to products_path\n elsif @current_order.update(order_params)\n flash.now[:success] = \"Order wa...
[ { "docid": "f1c614091253f083b3f37e12e1fca2c8", "score": "0.70717096", "text": "def create\r\n @order = Order.new(order_params)\r\n @order.status = false\r\n @order.order_state = true\r\n respond_to do |format|\r\n if @order.save\r\n format.html { redirect_to '/order_details/' + @...
101517de699961169334caf37a0a8a9e
Whether or not the content is xml content type
[ { "docid": "4573550045745d50689e0d57e354b035", "score": "0.86225545", "text": "def xml?\n (['xml', 'html'].any? { |word| @headers[:content_type].include?(word) }) ? true : false\n end", "title": "" } ]
[ { "docid": "16abeb0534c72fb00e322165ba531d3f", "score": "0.90304834", "text": "def xml?\n is_content_type?('text/xml')\n end", "title": "" }, { "docid": "9de7dd788cf5957f2120dd7aecca4855", "score": "0.8983311", "text": "def xml?\n is_content_type?('text/xml') || \\\n ...
c062dbe78c7c7d2e870b0ea2989af5d3
Inverts order of multiplication, so that built math operators can be used for types that don't know how to deal Quaternions q = Qua.new(1.0, 2.0, 3.0, 4.0) 2q => Qua(2.0; Vector[4.0, 6.0, 8.0])
[ { "docid": "5de8a9118b625df7060d9f96bb1034ae", "score": "0.0", "text": "def coerce(n)\n [self, n]\n end", "title": "" } ]
[ { "docid": "d26a46be4c38dd1d1f0a4473b325b502", "score": "0.7051044", "text": "def *(q)\n if q.is_a?(Numeric)\n return Quaternion.new(@beta0 * q, *(@beta_s * q))\n elsif q.is_a?(Quaternion)\n beta0, beta_s = quatMult(q)\n result = Quaternion.new(beta0, *beta_s)\n return result\n...
06ed1128f871c68dab7d31274c028637
use this if you're using RSpec
[ { "docid": "e2d54fe949f4a33306be2cfaa7987e60", "score": "0.0", "text": "def buildwise_start_build(options)\n options[:stage] ||= \"Acceptance\"\n the_response_content = contact_buildwise_post(\"/builds/begin\", \"options\" => YAML.dump(options))\n new_build_id = the_response_content\nend", "title...
[ { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.7926263", "text": "def spec; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.7926263", "text": "def spec; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "sc...
9b1f8b6e14d0eec7b5fdec7ecddaf419
Replace uswest2 with the AWS Region you're using for Amazon S3.
[ { "docid": "1fad76b496999082943e64a7826fa4f2", "score": "0.0", "text": "def run_me\n bucket_name = 'doc-example-bucket'\n object_key = 'my-file.txt'\n object_content = 'This is the content of my-file.txt.'\n region = 'us-west-2'\n s3_client = Aws::S3::Client.new(region: region)\n\n if upload_file_...
[ { "docid": "3e50af9d8f588c615ab454583a9bb8c2", "score": "0.7126182", "text": "def aws_region\n @aws_region || \"us-east-1\"\n end", "title": "" }, { "docid": "a859fba4932f82666640034ba9534728", "score": "0.7082211", "text": "def s3\n @s3 ||= ::AWS::S3.new(region: 'us-east-...
7813035bc6e740d7f2e28049d0f6c443
def update category = Item.find(params[:id]) category.update(name: params[:name]) respond_with category end
[ { "docid": "84b5dd160d7f64399677579bf959789b", "score": "0.0", "text": "def get\n\t\titems = Item.where(category_id: params[:category_id])\n\t\trespond_to do |format|\n\t\t\tformat.json { render :json => items }\n\t\tend\n\tend", "title": "" } ]
[ { "docid": "d2bfe837bfbbfe02c322d6d69cb88623", "score": "0.8582579", "text": "def update\n params[:category].try(:delete, :name)\n @category = Category.find(params[:id])\n @category.update_attributes(params[:category])\n respond_with @category, :location => categories_path\n end", "titl...
d6ec72611a3334361a38f29267efdfc2
PATCH/PUT /scafrocks/1 PATCH/PUT /scafrocks/1.json
[ { "docid": "f53ed365eaac7f658500c2964f0671a9", "score": "0.635537", "text": "def update\n respond_to do |format|\n if @scafrock.update(scafrock_params)\n format.html { redirect_to @scafrock, notice: \"Scafrock was successfully updated.\" }\n format.json { render :show, status: :ok,...
[ { "docid": "2572fb900123dab962d92dfd5cd31505", "score": "0.6384492", "text": "def update\n spice = Spice.find_by(id: params[:id])\n spice.update(spice_params)\n render json: spice\nend", "title": "" }, { "docid": "585ca0c9953820724e4c314b8b4a6914", "score": "0.6287223", "tex...
87a7aae38935b8427ed074e7116d0bdd
Returns the value of attribute types.
[ { "docid": "f35a829e821b6fc3c8d2bfb9a1e9a435", "score": "0.0", "text": "def types; end", "title": "" } ]
[ { "docid": "c93434bf3d196879d2a1566e067d5d59", "score": "0.8402676", "text": "def types\n @type_attributes.collect { |att| att.type }\n end", "title": "" }, { "docid": "df89d6c6500697f16de9c1372442411c", "score": "0.7915002", "text": "def attribute_types; @attribute_types end", ...
f2e4fd2975146aceb51acabd9c97298e
double Highest user count number in time period
[ { "docid": "2aeb3a4015c07adbda1ec94e5e080384", "score": "0.55219185", "text": "def high_water_user_count\n @attributes[:high_water_user_count]\n end", "title": "" } ]
[ { "docid": "a7aab1bc4934717ed5046ddabdd5a846", "score": "0.6837073", "text": "def most_popular_time(sign_up_times)\n hash = sign_up_times.each_with_object(Hash.new(0)) do |time, new_hash|\n new_hash[time] += 1\n end\n\n hash.max_by{|key, value| value}[0]\nend", "title": "" }, { "docid"...
3b56863f1f0e66ddb9c98c275a337cbd
Returns the type of the current parent extracted form a request path
[ { "docid": "23d59883cf0206b85e5f1ed5de126cdc", "score": "0.81949234", "text": "def parent_type_from_request\n [*belongs_to].find { |parent| request.path.split('/').include? parent.to_s }\n end", "title": "" } ]
[ { "docid": "a633df65c68f4301e454f9b7279c7418", "score": "0.81738114", "text": "def parent_type_from_request\n [*belongs_to].find { |parent| request.path.split('/').include? parent.to_s }\n end", "title": "" }, { "docid": "91bfce05bcebe8893144d5df8f13e226", "score": "0.756...
45e93b5b58f46033055822512f4cf728
GET /poems/1 GET /poems/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "db015a9c8d949339ed9e0353ce108e25", "score": "0.68825865", "text": "def index\n if current_user == @user\n @poems = @user.poems.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @poems }\n end\n else\n redirect_to ...
ba21fe0f2356bcec11e52945292026e3
Checks if the calendar item is from today to tomorrow.
[ { "docid": "9029c90705f1337b8c454727b601a112", "score": "0.71265197", "text": "def between_tomorrow_and_the_day_after_tomorrow?\n tomorrow = Date.today + 1\n day_after_tomorrow = Date.today + 2\n @start_time.between?(tomorrow, day_after_tomorrow)\n end", "title": "" } ]
[ { "docid": "f33238bf3197cfdc22457743af357ee5", "score": "0.7581376", "text": "def tomorrow?\n @date == (@today + 1)\n end", "title": "" }, { "docid": "ca780c9ea445ba4ea78eee60d496b85c", "score": "0.7199414", "text": "def move_to_today_if_necessary\n tomorrow_midnight = T...
3387d3011a81e15b69934bf71567658d
Gets the hideForgotMyPassword property value. Option to hide the selfservice password reset (SSPR) 'Forgot my password' hyperlink on the signin form.
[ { "docid": "feca976514ea4316d43b2ba4565659cb", "score": "0.8269082", "text": "def hide_forgot_my_password\n return @hide_forgot_my_password\n end", "title": "" } ]
[ { "docid": "39d8a6f86cd573fe8842b06b8819447c", "score": "0.7983658", "text": "def hide_forgot_my_password=(value)\n @hide_forgot_my_password = value\n end", "title": "" }, { "docid": "d165967d0fa83bee45783c6731fdfa73", "score": "0.6685291", "text": "def hide...
1bdbca7ebb5189f128792ad30467ec64
Gets the message's DisplayText value, if any.
[ { "docid": "fc3b32d9a02f024d700f91182d894221", "score": "0.57457846", "text": "def display_text\n\t\t\t\t@bsc_blocks[0].display_text\n\t\t\tend", "title": "" } ]
[ { "docid": "0cfb2db2a9ea125325c26dea6930440f", "score": "0.6833132", "text": "def get_message\n message_text.text\n end", "title": "" }, { "docid": "0cfb2db2a9ea125325c26dea6930440f", "score": "0.6833132", "text": "def get_message\n message_text.text\n end", "titl...
73a6e1ce9efd106a655fc364dcd82c42
Find a customer's token by its ID. Params: +customer_id+:: ID of the customer +token_id+:: ID of the token +options+:: +Hash+ of options
[ { "docid": "4689166e50bfab210c34590f909c61c7", "score": "0.84546614", "text": "def find(customer_id, token_id, options = nil)\n request = Request.new(@client)\n path = \"/customers/\" + CGI.escape(customer_id) + \"/tokens/\" + CGI.escape(token_id) + \"\"\n data = {\n\n }\n\n ...
[ { "docid": "ef84e007acc4fbeb09d7796a708eb512", "score": "0.70243454", "text": "def find(customer_id, options = nil)\n request = Request.new(@client)\n path = \"/customers/\" + CGI.escape(customer_id) + \"\"\n data = {\n\n }\n\n response = Response.new(request.get(path, dat...
c1bb338bd8e9a7d39e22c34e3538b3a8
Outputs text along with how long it took to run its block. If the block returns an integer it assumes it is the number of rows affected. source://activerecord//lib/active_record/migration.rb897
[ { "docid": "b2dd0f2756bc165485105d645cbd482d", "score": "0.0", "text": "def say_with_time(message); end", "title": "" } ]
[ { "docid": "4c23ea25c0e4862676745719a3d72397", "score": "0.62109345", "text": "def say_with_time(words)\n ActiveRecord::Migration.say_with_time(\"#{words}...\") do\n yield\n end\nend", "title": "" }, { "docid": "c2c1f0b841bbb561e1d8bdbcce66c48e", "score": "0.6189289", "text": "d...
6289b10020e9cb345c92946cb3972f6f
Yield each in song in the album to a block
[ { "docid": "d5e592f64f2b74de9d086c887d7ca81e", "score": "0.76440364", "text": "def each\n songs.each { |song| yield song }\n end", "title": "" } ]
[ { "docid": "7f1788cfad077ed0eb5de2dde2b38cda", "score": "0.7952545", "text": "def each\n song.each do |song|\n yield song\n end\n end", "title": "" }, { "docid": "05bba76e770a92745cedb48a923290e3", "score": "0.7906942", "text": "def each\n songs.each do |song|\n ...
39f9c8396c0af9717a788b7a70d00674
The show action renders the individual task after retrieving the the id
[ { "docid": "8914ff37cfc5afe72cfd2de575e08ced", "score": "0.0", "text": "def show\n find_task\n @comments = @task.comments.page(params[:page]).per(5)\n end", "title": "" } ]
[ { "docid": "99850deafb545da2c4d52373af8ad72e", "score": "0.8262259", "text": "def show\n set_task_for_show\n render 'tasks/index'\n end", "title": "" }, { "docid": "995e45bab595d36e1265292986ce378d", "score": "0.8165621", "text": "def show\n @task = Task.find(params[:id])\n...
dd914f537a953e94f6d000442aafe5b1
Returns the node in dot syntax.
[ { "docid": "3e601f1805d50100120ced9babe4ca93", "score": "0.0", "text": "def to_s\n if self.attributes? then\n \"%-20p [ %-20s ]\" % [name, attributes.join(',')]\n else\n \"#{name.inspect}\"\n end\n end", "title": "" } ]
[ { "docid": "46b071d72f7d7007f2b749c91a5ad513", "score": "0.8155611", "text": "def dot\n @dot\n end", "title": "" }, { "docid": "043e247b4d56027a3f7e5e0fbd64ba5b", "score": "0.7331898", "text": "def dot?; end", "title": "" }, { "docid": "043e247b4d56027a3f7e5e0fbd6...
70589f80ace0cfa7c99e38be835962a8
Pass every HTML document that the agent parses to a given block.
[ { "docid": "8e52491a3a4e3589268bde5d9ea794ad", "score": "0.6846812", "text": "def every_html_doc\n every_page do |page|\n if (block_given? && page.html?)\n if (doc = page.doc)\n yield doc\n end\n end\n end\n end", "title": "" } ]
[ { "docid": "4a7dd86fe16d99c48e997937ec8a2680", "score": "0.6611376", "text": "def extract!\n @blocks = doc.css('body').children.map { |child| Block.new(child).tap(&:process!) }\n @results = @blocks.reject { |b| b.result.nil? }.map(&:result)\n end", "title": "" }, { "docid": "b8c...
7192aa1c7e79fcf531ebcd404bbbcf20
=begin rdoc Reads and returns the deserialized data of the oldest file in the spool, yielding the deserialized data to an optionally passed block.. Deletes the file only if no exception was raised within the block. Ordering is based on the filename (which in turn is based on the files creation time), but the ordering i...
[ { "docid": "f6dfd02f262776468819a5f8d1c40a69", "score": "0.675038", "text": "def get(&block)\n file = oldest_spooled_file\n return nil unless file\n data = if block_given?\n SpoolPool::File.safe_read( file ) { |data| block.call( deserialize(data) ) }\n else\n ...
[ { "docid": "aa54e0f1906be928eff22482b73b02f5", "score": "0.5567246", "text": "def blockify_file_or_data\n if self.local_file =~ /^DATA:(.*)/m\n data = $1\n elsif ::File.file?(self.local_file) and ::File.readable?(self.local_file)\n data = ::File.open(self.local_file, \"rb\") {|f| f.read ...
456793284fddcf064c4f2f896e947231
once you've got some planets added it will print their information pulling from the planet's data
[ { "docid": "b6fba285da83b464a7fce1badb4f6873", "score": "0.84858966", "text": "def print_planets\n puts \"\\n#{@name} has #{@planets.length} planets and was formed #{@formation_year} years ago.\"\n puts \"\\nHere are the planets in the #{@name} solar system:\\n\\n\"\n @planets.each do |planet|\...
[ { "docid": "f0af76b88802565fdc06f13fda9b28b4", "score": "0.83299315", "text": "def display_planet_list\n puts \"Here are the current planets in our solar system:\"\n @all_planets.each do |planet_info|\n puts planet_info.name\n end\n end", "title": "" }, { "docid": "c57c10b34...
f3fae8051af2788a544066b516e57df0
create an image name using prefix and VM name Returns: [String] image name
[ { "docid": "764ba1da86f655bc4115fd59455ede88", "score": "0.74085253", "text": "def unique_name(prefix)\n image_name = \"#{@instance_client.get_instance.name} #{Time.new.to_s}\"\n image_name = \"#{prefix} #{image_name}\" if prefix\n image_name.gsub(/[^0-9A-Za-z.\\-]/, '-') # sanitize it!\n...
[ { "docid": "5d473feedb19b6ba955986185d858216", "score": "0.6760011", "text": "def image_name\n return generate_name if @options[:generate]\n return @@image_name if @@image_name\n return \"tongueroo/demo-kubes:kubes-12345678\" if ENV['TEST']\n\n unless File.exist?(image_state_path)\n ...
5caaab7358989b2bacb6a7ae0dfa3490
Separator in the table
[ { "docid": "db02a6fe8a9ea0da2470368f841e3c59", "score": "0.77149564", "text": "def table_separator(headers)\n @io << @templates[:table_separator].result(binding)\n end", "title": "" } ]
[ { "docid": "ea94cffad9baaceb273250be5e5f4e1f", "score": "0.81222904", "text": "def table_separation\n line = \"|#{TABLE_COLUMN_LINE}|#{TABLE_COLUMN_LINE}\".dup\n line << \"\\n\"\n end", "title": "" }, { "docid": "fffea6f933127e7ce36ffbd19cdc07fe", "score": "0...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "4ddd97b1d986f68dee27792e9f09155d", "score": "0.0", "text": "def set_list\n @list = List.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163754", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045816", "text": "def action_hook;...
6e9258f12b05c6c5adbeffea0dffec63
rubocop:enable all rubocop:disable all
[ { "docid": "cb92890f59038d43195667b1a8031d47", "score": "0.0", "text": "def destroy\n if @commentable.comments.find(params[:id]).destroy\n render json: { success: true }\n end\n end", "title": "" } ]
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.7601276", "text": "def private; end", "title": "" }, { "docid": "0b8b7b9666e4ed32bfd448198778e4e9", "score": "0.6417272", "text": "def probers; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", ...
255615943f48854e089eb4010a1b399e
Scans the directory and pattern for constants.
[ { "docid": "dd1ef3ed4e3ff95d7f33216cda0bb55a", "score": "0.74960643", "text": "def scan(dir, pattern=\"**/*.rb\")\n constants = {}\n \n root = Root.new(dir)\n root.glob(pattern).each do |path|\n Lazydoc::Document.scan(File.read(path)) do |const_name, type, ...
[ { "docid": "0149fa7ccf27925e35e3ca492db6ccb4", "score": "0.755688", "text": "def scan(constant)\n segment = constant_to_path(constant)\n paths = Dir.glob(glob_pattern(segment))\n\n # Lets see if we can find anything when using dashes for the directory\n # names instead of underscor...
653fad330ccac5f937c96df98217b882
Gets the fullhost for the ServerUser context.
[ { "docid": "0d7a8c3341e2dc0f14f2015ed6a31a58", "score": "0.80770624", "text": "def fullhost\r\n return for_context(nil, false) { |c| c.fullhost }\r\n end", "title": "" } ]
[ { "docid": "03fbc60b24c1787b3746e05a996ccd06", "score": "0.70702064", "text": "def host\n @host = self.hostuser\n end", "title": "" }, { "docid": "b80883b752371ec02d9532a2688f4f8e", "score": "0.7035412", "text": "def cur_user_host_address\n DocumentHelper.cur_user_host_addre...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "67b9bd9ee55208a603927deb693559bb", "score": "0.0", "text": "def marca_params\n params.require(:marca).permit(:nombre, :logotipo, :direccion, :correo)\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...
1bcd49a9d231fe0cb4c49f7fe33861b4
DELETE /parties/1 DELETE /parties/1.json
[ { "docid": "6479ae5a3fda9dcb6e09a81850d07657", "score": "0.6633144", "text": "def destroy\n @party.destroy\n respond_to do |format|\n format.html { redirect_to parties_url, notice: 'Party was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" ...
[ { "docid": "af9bf7ba197f2826206b3e8108dcdbe2", "score": "0.7078116", "text": "def destroy\n @pokeparty = Pokeparty.find(params[:id])\n @pokeparty.destroy\n\n respond_to do |format|\n format.html { redirect_to pokeparties_url }\n format.json { head :ok }\n end\n end", "title": ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "73830191d55e52dbdadf1f0e2e5dfb34", "score": "0.0", "text": "def set_relatorio_jogo\n @relatorio_jogo = RelatorioJogo.where(jogo_id: params[:id])[0]\n @associados = Associado.all.order(:nome)\n @parentes = Parente.all.order(:nome)\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...
09bd97e856155b364686a4094eb9028e
use a timestamp in filenames
[ { "docid": "89c7adcdb3bb886e316b88310ac17ec5", "score": "0.6402751", "text": "def filename\n @name ||= \"#{timestamp}-#{super}\" if original_filename.present? and super.present?\n end", "title": "" } ]
[ { "docid": "865caf93bbd76938cb9b723b4ad2ccc2", "score": "0.7805888", "text": "def timestamp(file_name)\n \"#{Time.now.to_i}_#{file_name}\"\n end", "title": "" }, { "docid": "0c68746ae52645241806799c409f7b67", "score": "0.76561147", "text": "def file_for(timestamp); end", ...
058a44d2cf1e4532c1619050925bff19
Fetches the previous page in the resource list (if there is one). This method will try to respect the count of the current page. If none was given, the default count will be fetched again.
[ { "docid": "0d2199faea1072e68a10ef8815e9e9a1", "score": "0.7535789", "text": "def previous_page(params = {})\n new_offset = (offset || 0) - (count || 20)\n new_offset = 0 if new_offset < 0\n\n params = {\n :count => count, # may be nil\n :offset => new_offset,...
[ { "docid": "b8831e4472f86e9e9e126d29c0fb88b9", "score": "0.78233933", "text": "def previous_page\n if previous_page_number\n resource_class.all(default_options.merge(page: previous_page_number))\n end\n end", "title": "" }, { "docid": "dcfa292961439082c031fadba148...
d2370e74280c45090174f40b0a98799a
move, bind, rebind > taken care in bind unbind, dav_delete > taken care in unbind lock, lockrefresh, unlock, mkcol, propfind > in their respective methods
[ { "docid": "335424d98ebfb2bde28facecc77262a6", "score": "0.0", "text": "def resourcetype(xml)\n xml.D(:resourcetype){ xml.D :locknullresource }\n end", "title": "" } ]
[ { "docid": "312153bcd071e7c9e0632d482f740f2d", "score": "0.5997113", "text": "def unbind; end", "title": "" }, { "docid": "312153bcd071e7c9e0632d482f740f2d", "score": "0.5997113", "text": "def unbind; end", "title": "" }, { "docid": "312153bcd071e7c9e0632d482f740f2d", ...
d0e1236bc1271f9bd234a9fb91fa0b36
Returns TRUE if a file for this wallet is already in the queue.
[ { "docid": "219caffbbf98fc03922478d52a9f56c5", "score": "0.0", "text": "def exists?(id, body)\n DirItems.new(@dir).fetch.each do |f|\n next unless f.start_with?(\"#{id}-\")\n return true if safe_read(File.join(@dir, f)) == body\n end\n false\n end", "title": "" } ]
[ { "docid": "0ef97ceba9046341b954782f4bbd3e59", "score": "0.68967134", "text": "def queued?(url)\n @queue.include?(url)\n end", "title": "" }, { "docid": "34caececd2a06703870eca8fadcf0f61", "score": "0.6841667", "text": "def queue_exists?(name)\n !queue_search(name).e...
85578481d67bb3112a8574931c515459
To fetch the surveyor age
[ { "docid": "91a1f1d9a69ef5f06751ff0bf77809b1", "score": "0.7935244", "text": "def surveyor_age\n @surveyor_age ||= surveyor.age\n end", "title": "" } ]
[ { "docid": "a4c03dda0bba27abaf7f4a6b7671cfd5", "score": "0.75700545", "text": "def get_age(user_details)\n Date.today.year - (Date.parse user_details[:date_of_birth]).year\n end", "title": "" }, { "docid": "2374f19dbfbbe77246aed808218e7279", "score": "0.75414217", "text": "def ag...
bfc2761263e328c03284f80d14941e2c
Feel free to google "how to generate a random number in ruby" Using a Range
[ { "docid": "e88e261ebf6a3421ea38a775b1630db8", "score": "0.0", "text": "def die\n puts 1 + rand(6)\nend", "title": "" } ]
[ { "docid": "8b9b92f926a6c3cece0f39f7d78a2164", "score": "0.84392893", "text": "def rand_num(range)\n num = @rng.rand(range) + 1\n num\n end", "title": "" }, { "docid": "b4d2bb29e362cd47a8318a787f278ae3", "score": "0.8365243", "text": "def random(range)\n return rand(range + 1...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "5d10ba9a201fd95ecaf77ad6ecda4048", "score": "0.0", "text": "def store_house_params\n params.require(:store_house).permit(:usedSpace, :totalSpace, :reception, :dispatch, :external)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title"...
b6b9cd199dfaed08c4c534812e0ac109
Check to see if the all the properties in the model are valid
[ { "docid": "c0e4df26d06ebea8a0f43705cfc497c9", "score": "0.0", "text": "def valid?\n return false if !@compounding_rate.nil? && @compounding_rate < -1\n return false if !@risk_score.nil? && @risk_score > 100\n return false if !@risk_score.nil? && @risk_score < 0\n recommend_type_vali...
[ { "docid": "162d0e63d65b0cd6795543bab63498f2", "score": "0.78992486", "text": "def validate_properties\n true\n end", "title": "" }, { "docid": "162d0e63d65b0cd6795543bab63498f2", "score": "0.78992486", "text": "def validate_properties\n true\n end", "title": "" ...
293113091b78b1127b9ad5a1fc58b39d
Updates the content of this noncdmi dataobject and publish it in CDMI server
[ { "docid": "472809265121b345e363b0180683eced", "score": "0.56528246", "text": "def UPDATE( dataobjectName, filename, mimetype = nil )\n\t\treturn CREATE( dataobjectName, filename, mimetype )\n\tend", "title": "" } ]
[ { "docid": "8482a820ab283aa406d45d7b159445ad", "score": "0.65223783", "text": "def update\n # UPDATE OPERATIONS ARE NOT ALLOWED: USERS WILL HAVE TO LOG INTO ESS TO EDIT THEIR DATA. DON'T WANT THINGS TO GET OUT OF SYNC\n end", "title": "" }, { "docid": "dd4cd78e45f32d63df20a604d562fcdd",...
6bddaa9395bb6605a59cd005358c5c77
Sets path to dispatch
[ { "docid": "33aa3a9937b8b320c206dbcc6d44c410", "score": "0.0", "text": "def path=(value)\n raise PathError.new(\"Path must be absolute.\") unless value.match(/^\\//)\n @path = value\n end", "title": "" } ]
[ { "docid": "bcbeb603b23fdb74fcf3964f27aab6f8", "score": "0.7642434", "text": "def set_path\n self.path = \"#{controller}/#{action}\"\n end", "title": "" }, { "docid": "b0221c10228ec6f6cdd87bbc7731ac0b", "score": "0.6930365", "text": "def set_path(path)\n @path = path\n en...
70197b69dce003f1610dddb16c05aebd
reduce 342 omitted reduce 343 omitted
[ { "docid": "df1aa11f48633756129abfa68b5f9da2", "score": "0.0", "text": "def _reduce_344(val, _values, result)\n result = val[1]\n \n result\nend", "title": "" } ]
[ { "docid": "0da8d4bc1271fbb8d2119d79e776a4f3", "score": "0.75811553", "text": "def _reduce_603(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "a72ccd2cf9eac3ad24d997538b04c62e", "score": "0.7456761", "text": "d...
3e7eb595abcaedbd3b9bb0a606e8da34
Splits a archive into multiple archives if the size of the archive is greater than the segment_size received as argument and returns a array that contains the paths to each of the archives that were resulted after splitting
[ { "docid": "7a1a6fd9003c06766b1585347a7a0c30", "score": "0.7910182", "text": "def split_archive(archive, partial_name, segment_size)\n indexes = Zip::File.split(archive, segment_size, true, partial_name)\n archives = Array.new(indexes) do |index|\n File.join(File.dirname(archive), \"#{p...
[ { "docid": "e3ca85c6feec00b24e6fb0fa002837de", "score": "0.7142405", "text": "def partition_files_into_segments\n segments = []\n off = 0\n while off < @main_file_len\n seg_len = [@main_file_len - off, @max_chunk_size].min\n segments << [off, seg_len]\n off += seg_len...
bb858f5bbba320fba65d0a11bfcdc1a6
PATCH/PUT /locations/1 PATCH/PUT /locations/1.json
[ { "docid": "2c784e50018ae5bf4a2a36e5884b305f", "score": "0.6220844", "text": "def update\n respond_to do |format|\n if @location.update(location_params)\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { render :show, status: :ok, ...
[ { "docid": "d474b6ea63b1185cfbb77cbc16afa016", "score": "0.7319044", "text": "def update\n render json: Location.update(params[\"id\"], params[\"location\"])\n end", "title": "" }, { "docid": "734175b9fdecd8ca522bd4a275b59224", "score": "0.69410664", "text": "def update\r\n @l...
47306411744bae5eb8d4f80d91ea126a
GET /reviews GET /reviews.json
[ { "docid": "a0f7b17c9b42b31ec0ea81a48b9decda", "score": "0.0", "text": "def index\n @page_title = 'Reviews'\n @pagy, @reviews = pagy(Review.includes(:user, :movie).all, items: 60)\n end", "title": "" } ]
[ { "docid": "65faade885828a58f963a57fb216fab2", "score": "0.78963757", "text": "def index\n @reviews = @reviewable.reviews\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reviews }\n end\n end", "title": "" }, { "docid": "65faade8858...
661db0da9818d083af47706db70ad25f
Convert all dates to DateTime in the UTC time zone for consistency.
[ { "docid": "e581e1af45f317672cf8e1390f9a0895", "score": "0.0", "text": "def normalize_dates!(resource)\n resource.attributes.each { |k, v| resource.send(\"#{k}=\", normalize_date_values(v)) }\n end", "title": "" } ]
[ { "docid": "7354725cf3670fb8a70e201c2ebce8a4", "score": "0.65112215", "text": "def utc_dates\n dates = @rdatelist.getDatesUtc\n dates.map do |d|\n JTime.utc(d.year, d.month, d.day)\n end\n end", "title": "" }, { "docid": "5e27f475b53afe5d527de22519808d2a", "score": "0.6144...
dcde17514c58cd103c5d5dbebcaa8e74
Create or update a Tier1 interface If an interface with the interfaceid is not already present, create a new interface. If it already exists, update the interface for specified attributes.
[ { "docid": "33b88031d3535368966221ba4d81bf61", "score": "0.6439672", "text": "def patch_tier1_interface_with_http_info(tier_1_id, locale_services_id, interface_id, tier1_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingCo...
[ { "docid": "fbb6bcd7401422d0ecbbbc7e2b2b2ac8", "score": "0.72403055", "text": "def create_or_replace_tier1_interface(tier_1_id, locale_services_id, interface_id, tier1_interface, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_interface_with_http_info(tier_1_id, locale_services_...
2f3d755af89a0088c44e80f47cb6ce45
POST /raids POST /raids.json
[ { "docid": "d50e28e4b1caceb4efa8667b52752414", "score": "0.5978433", "text": "def create\n @raid = @city.raids.build(raid_params)\n\n respond_to do |format|\n if @raid.save\n format.html { redirect_to [:raiding, @player], notice: 'Raid was successfully created.' }\n format.json ...
[ { "docid": "f6d5c13c29e0033bf0c138b234d06cbd", "score": "0.59857744", "text": "def create\n @going_to_raid = current_user.going_to_raids.build(going_to_raid_params)\n\n respond_to do |format|\n if @going_to_raid.save\n format.html { redirect_to @going_to_raid, notice: 'Going to raid wa...
b98ec31883b8bac26757e59651fd6d63
return jagged array containing padded subarrays of teams spanning multiple rounds split each row of games into 2 rows of teams since each game has 2 teams
[ { "docid": "7165d39b127f3aa430d9d2861f5154c7", "score": "0.56618005", "text": "def extract_teams_and_define_links(jagged_games_arr)\n jagged_games_arr.collect do |row_of_games|\n [row_of_games.collect{|game| !!game ? \"<a href='/teams/#{game.teams[0].name_abbreviation.downcase}'>#{game.teams[0]....
[ { "docid": "df43e5c3fb28c0e350178775fe67a274", "score": "0.7326862", "text": "def pad_and_transpose(rounds_arr)\n rounds_arr.collect do |games_arr|\n case games_arr.size\n when 16 then [ 4, 9,14,19].each{|idx| games_arr.insert(idx, [nil]*4)}\n when 8 then [ 2, 5, 8,11].each{|idx| game...
60bc9292aa2a02d12cf88f5fef00faee
NOTE: do not call self.class (unless you've defined the public method class), otherwise method_missing will keep calling itself and overflow the stack.
[ { "docid": "dcf10e4d56fe2a0f4cf6e08a12358f11", "score": "0.0", "text": "def class_name\n \"ChainedMock\"\n end", "title": "" } ]
[ { "docid": "c9250c4f5ebff94572b80ac1d6990243", "score": "0.78711736", "text": "def method_missing(method, *args, &blk); end", "title": "" }, { "docid": "16bce6062a84424b4f2eebb10c12d1c2", "score": "0.7795299", "text": "def method_missing(meth,*args)\n self\n end", "title"...
e849c7990312e39135c03225bde8493b
Removes item from soldier's backpack ==== Syntax unit removeItemFromBackpack item ==== Parameters +unit+ Object +item+ String ==== Returns Nothing ==== Multiplayer ==== See Also Official Wiki: ==== Examples ====== Example 1:
[ { "docid": "bf26398c50f686380da195f28e557619", "score": "0.74011385", "text": "def removeItemFromBackpack _obj, _args\n \"_obj removeItemFromBackpack _args;\" \n end", "title": "" } ]
[ { "docid": "df2b9b255353dbc54975338e0f3c81b4", "score": "0.6826507", "text": "def remove_item(item, grocery_bag)\n grocery_bag.delete(item)\n p grocery_bag\nend", "title": "" }, { "docid": "c7a7d06dad692e3fcebb2a99404e14de", "score": "0.67774296", "text": "def remove(item)\n i...
7275677c634978097a85bc0a03c6324b
:callseq: on_regexp_end: (String value) > RegexpEnd source://syntax_tree//lib/syntax_tree/parser.rb3175
[ { "docid": "ffe9118ef5ea31a914b49c1d0eea8d4b", "score": "0.90710825", "text": "def on_regexp_end(value); end", "title": "" } ]
[ { "docid": "3eeb2a84341de2d84712bf845c42e128", "score": "0.8724844", "text": "def visit_regexp_end(node); end", "title": "" }, { "docid": "d3582d34440fc506c2f7b4c470b78afe", "score": "0.8515393", "text": "def on_regexp_end(value)\n RegexpEnd.new(\n value: value,\n ...
e91d8397cf2bda06bf1a98fc65c1b871
Write data to the underlying socket
[ { "docid": "421927b279183739563e467510fc0d81", "score": "0.72373086", "text": "def write(dcerpc, data)\r\n\t\tdcerpc.socket.write(data)\r\n\t\tdata.length\r\n\tend", "title": "" } ]
[ { "docid": "1205fe47135776840f8f7ceffa4a1a07", "score": "0.89898324", "text": "def write(data)\n @socket.write(data)\n end", "title": "" }, { "docid": "30c8a236a4a1af2af12933878ae04a25", "score": "0.88791364", "text": "def write(data)\n @socket << data\n end",...
567ef0ec00475bdf2c7c98fd32f47416
returns an array with each ordinal day of the rent 1 being first day of rent 2 being second day of rent etc ...
[ { "docid": "6584c8d14d8cd146fcb874cdbca9980f", "score": "0.67704135", "text": "def days_of_rent\n (1..(Rules.compute_rental_duration(@rental_data))).to_a\n end", "title": "" } ]
[ { "docid": "97cdf2d75b8830f27d0fac194c9bc78d", "score": "0.6298028", "text": "def day_array(add_pick)\n\t\tret = (0..6).map {|num| [Date::DAYNAMES[num], num]}\n\t\tret.unshift([\"<< Pick >>\",nil]) if add_pick\n\t\tret\n\tend", "title": "" }, { "docid": "837a77b3c2890d905bf8c1bcd5ddcec3", ...
0da4604786fad4a6f0dd4fa342d7fd30
DELETE /code_submissions/1 DELETE /code_submissions/1.xml
[ { "docid": "ab57dc7b7ad59ad742a645a54b23478b", "score": "0.7207573", "text": "def destroy\n @code_submission = CodeSubmission.find(params[:id])\n @code_submission.destroy\n\n respond_to do |format|\n format.html { redirect_to(code_submissions_url) }\n format.xml { head :ok }\n end...
[ { "docid": "01d9f4bd8e135f3c64f8ddac0e7da5d0", "score": "0.68124616", "text": "def destroy\n @app_submission = AppSubmission.find(params[:id])\n @app_submission.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_app_submissions_url) }\n format.xml { head :ok }\n ...
a3f122e80d9a2a31df4a522aa21dce53
Parses a file. This bypasses the filename cache.
[ { "docid": "0fc0f3866101660cbb7212e38db03fe2", "score": "0.0", "text": "def parse_from(path, short = path.relative_path_from(root))\n contents = path.read\n digest = Digest::SHA2.digest(contents)\n\n cache.fetch(digest) do\n scanner = Scanner.new(contents, short, options)\n ...
[ { "docid": "7cbc638f0e5ab808806c779db7119cd6", "score": "0.7991669", "text": "def parse_file(filename); end", "title": "" }, { "docid": "18d6fca4baa96d2f15f7bb167c9f85e9", "score": "0.78442836", "text": "def parse_file(path); end", "title": "" }, { "docid": "18d6fca4baa96...
6972937e8681ba049ac785d390d653ea
DELETE /buchungs/1 DELETE /buchungs/1.json
[ { "docid": "285032bd203fa9491c7ec5b164c9093d", "score": "0.68971235", "text": "def destroy\n @buchung.destroy\n respond_to do |format|\n format.html { redirect_to buchungs_url, notice: 'Buchung was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title...
[ { "docid": "c6078ad61b66af6bd3141aef04bad11f", "score": "0.7140301", "text": "def destroy \n @buchung = Buchung.find(params[:id])\n @buchung.destroy\n\n respond_to do |format|\n format.html { redirect_to buchungs_url }\n format.json { head :no_content }\n end\n end", "title...
5a69dbe358f1657d5b1391fbbcea429b
Default root path of the controller for requests
[ { "docid": "17e7de9a4f8c3685c639ef278006c46a", "score": "0.70264536", "text": "def default_path\n\t\t\t\tmodules = underscore.split('/')\n\t\t\t\tparts = modules.pop.split('_')\n\t\t\t\tparts.shift if parts.first == 'index'\n\t\t\t\tparts.pop if %w[controller ctrl].include? parts.last\n\t\t\t\tparts = [...
[ { "docid": "58baed1be65fd9c8264fd1a22fd72665", "score": "0.7836938", "text": "def default_path\n root_path\n end", "title": "" }, { "docid": "d214cb988cc7b3a90949dc6e96ee9f97", "score": "0.7817124", "text": "def root\n get('/')\n end", "title": "" }, { "do...
7e051849bbbfe9e1787a5ddf689376ba
Set the value of the Origins input for this Choreo.
[ { "docid": "a0b9b22c4b41b7994b51b6d20639e337", "score": "0.79514253", "text": "def set_Origins(value)\n set_input(\"Origins\", value)\n end", "title": "" } ]
[ { "docid": "0aa680b6f089245963fd65295d59f221", "score": "0.7289118", "text": "def origins=(origins)\n @origin = origins.inject(PropertyBundle.new) do |os, o|\n os << o if ORIGIN_VALUES.include? o\n os\n end\n end", "title": "" }, { "docid": "2c20bd3a80dd752af412539...
0a0df16601d1c6f6b7f1cd6d874d9ebf
Triggered automatically by Devise when the user resets its password
[ { "docid": "f85ca839f8211d2994f65086720c4f8b", "score": "0.0", "text": "def reset_password_instructions(user, token, _opts={})\n tribunal_case = TribunalCase.latest_case(user)\n set_template(template(tribunal_case.language, :reset_password_instructions))\n\n set_personalisation(\n reset_ur...
[ { "docid": "a4e789808bff850576f14a0b8f61e57e", "score": "0.80557334", "text": "def after_reset_password\n\n end", "title": "" }, { "docid": "eac451187ea1f5c08a986feacb491105", "score": "0.7765018", "text": "def password_reset\n \n end", "title": "" }, { "docid": ...
955d261b39ec87f4d402705dbb6d7a38
(((3))) is an expression with too many parentheses. The rule for "too many parentheses" around part of an expression is that if removing matching parentheses around a section of text still leaves that section enclosed by parentheses, then those parentheses should be removed as extraneous. (3) is the proper stripping of...
[ { "docid": "042a8ce009da995618abaca85d976a00", "score": "0.0", "text": "def matching_parens(code)\r\n pairs = []\r\n depth = 0\r\n depth_position = {}\r\n string.chars.each_with_index do |char, position|\r\n if char == \"(\"\r\n depth_position[depth] = position\r\n depth += 1\r\n els...
[ { "docid": "b34fbcf66568743f2c5462d24ed4b194", "score": "0.71765196", "text": "def reduce_parenthesis_expression(exp)\n\t\t\t# There should always be at least one innermost parenthesis pair\n\t\t\tif PARENTHETICAL_REGEX =~ exp\n\t\t\t\tplaceholder = get_next_placeholder\n\n\t\t\t\t# Get the tokens for t...
acadfae8831053899cad2882b371c545
An array containing the 6 custom elements
[ { "docid": "e430e6990c1d7040baed28af68188499", "score": "0.0", "text": "def custom\n params.values_at('apc_1', 'apc_2', 'apc_3', 'apc_4', 'apc_5', 'apc_6')\n end", "title": "" } ]
[ { "docid": "a15b1e7248ee52796ff2a80843a77f1f", "score": "0.6657893", "text": "def custom_element_tags\n []\n end", "title": "" }, { "docid": "050bea5ca1589e87b5597c3bf130ba26", "score": "0.66416603", "text": "def elements; end", "title": "" }, { "docid...
066675d4dedb4f6f6bebce652b9d552f
Execute the Choreo using the specified InputSet as parameters, wait for the Choreo to complete and return a ResultSet containing the execution results.
[ { "docid": "546f796abecb4a53efd4abd86391d9fe", "score": "0.71439046", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ColumnsResultSet.new(resp)\n return results\n end", "title": "" } ]
[ { "docid": "c4ca32683e8ce75eb6a187d63df8fa77", "score": "0.7665761", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = DoneResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "6f7a7d9be674ad4cf17d6743eb1f7836", "score...
d2c034b599a2c7993e0de7ab2f6c1cd8
Control which instance vars are emitted when dumped to YAML.
[ { "docid": "a0b1447deee10618040dc28f82d63993", "score": "0.0", "text": "def encode_with(coder)\n vars = instance_variables.map { |x| x.to_s }\n no_emit = Configurizer::Configuration._no_emit_vars.reject { |x| x.nil? or x.empty? }\n no_emit = no_emit | [\"_no_emit_vars\"]\n\n vars = v...
[ { "docid": "356bc5df1217d3ca240005cafea06f08", "score": "0.6676614", "text": "def to_yaml_properties\n instance_variables - [:@logger]\n end", "title": "" }, { "docid": "c7c1ffff1e1f9c823c5c53fd0275fbf6", "score": "0.60821825", "text": "def save\r\n props = {}\r\n insta...
43020ff3be44b4e46c26b8371802f7af
We need to setup the environment variables and the response in the controller
[ { "docid": "36a3771baa7e1147fd153cd608ca6534", "score": "0.0", "text": "def setup_controller_for_warden\n @request.env['action_controller.instance'] = @controller\n end", "title": "" } ]
[ { "docid": "b842e419f11e948122475ba0b5adf88e", "score": "0.71193534", "text": "def setup_env \n config_api_version\n config_login_url\n config_content_type\n end", "title": "" }, { "docid": "bc9428a3e5da565044523aca789ae9da", "score": "0.7035085", "te...
63c17eadaaa146819f6090c86f7c8756
is current association an belongs_to relation?
[ { "docid": "16f759a4b0c70c649cf8500c657f7cd4", "score": "0.79862154", "text": "def belongs_to?\n type == :belongs_to\n end", "title": "" } ]
[ { "docid": "88706ad75512df6f744c9476bab572d1", "score": "0.81013393", "text": "def belongs_to?\n true\n end", "title": "" }, { "docid": "e514f39ca8a5bd0bd80c42f9e1b22115", "score": "0.80360013", "text": "def belongs_to?\n true\n end", "title": "" }, { ...
f8ba239ce8e350176159b172fa7241d9
Filter instances of JobPosting from `graph`
[ { "docid": "5e2c463c2304d780fd811172157e3071", "score": "0.7716642", "text": "def select_job_postings(graph) \n graph.select { |obj| obj.key?(\"@type\") && (obj[\"@type\"] == \"JobPosting\") }\n end", "title": "" } ]
[ { "docid": "eccaa143a36fbd1ab7b7b48c5c4b3ad7", "score": "0.68611175", "text": "def filter_job_posting(job_posting)\n job_posting.reject do |k, v|\n (REJECTED_KEYS.include? k) ||\n ((k == \"@id\") && v.empty?) \n end \n end", "title": "" }, { "docid": "dddc3b7f7e49aec5b302d3a...
c6e98521451f9df0f14af4749e584cec
Loads the generated code back into ruby
[ { "docid": "9ca2120ae7213ca7c6e8e5768c29f219", "score": "0.0", "text": "def load\n require \"#{so_name}\"\n end", "title": "" } ]
[ { "docid": "71ec2a71d46664b48896d0f6cc6e6282", "score": "0.6569737", "text": "def load! ; end", "title": "" }, { "docid": "5917a21f5601ac39a46b3a1ace212a05", "score": "0.65450567", "text": "def generate_ruby(vocabulary)\n output = StringIO.new\n @dumper = ActiveFacts::Generators::R...
eabcaefcb8f7abd510edfa744f174d5f
Public: Create a payment token. payment_id Payment ID that the token will be created for. Returns a PaymentTokenCreateResponse object.
[ { "docid": "dcb8de43bdea7970e32fc2d5e0e9d0bf", "score": "0.8747265", "text": "def create_payment_token(payment_id)\n post_with_auth 'payment_initiation/payment/token/create',\n PaymentTokenCreateResponse,\n payment_id: payment_id\n end", "title": "" ...
[ { "docid": "b2ea38842362cbc62025ea124143c12b", "score": "0.7197833", "text": "def create_payment_token(payment_token, opts = {})\n data, _status_code, _headers = create_payment_token_with_http_info(payment_token, opts)\n data\n end", "title": "" }, { "docid": "495db1e1ccec...
fd9027890e041c0fe54edf1f621d0d2b
GET /order_details/1 GET /order_details/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "113c8dd82e467b75c2ff78b5e64fdbe5", "score": "0.7963226", "text": "def show\n @order = Order.find(params[:id])\n respond_to do |format|\n format.html # _details.html.erb\n format.json { render json: @order }\n end\n end", "title": "" }, { "docid": "4740f7df12fa...
672bc5ea9f3be6704ed3ba5527c179b4
Get the width of the terminal window.
[ { "docid": "2b0166ca29d302b9f661e4c663301d03", "score": "0.81273264", "text": "def terminal_width\n terminal_size.first\n end", "title": "" } ]
[ { "docid": "82a7484092eaceee9742f133a388599a", "score": "0.8266569", "text": "def width\n Terminal.width\n end", "title": "" }, { "docid": "fd55f0605528f035ca2b12b0362cf78c", "score": "0.8016956", "text": "def term_width\n return @@terminal_width unless @terminal_width =...
5e1f4b614ccbda13f101220b62a1283b
Note: If using oauth with a web app, be sure to provide :oauth_callback. Options: :oauth_callback => String, url that teambox should redirect to
[ { "docid": "8f261bfba08fa66dca8a8d48a5bb9277", "score": "0.0", "text": "def request_token(options={})\n @request_token ||= signing_consumer.get_request_token(options)\n end", "title": "" } ]
[ { "docid": "6581587a46b4e9e8385a321ee2c0121e", "score": "0.7115662", "text": "def oauth_callback_url\n end", "title": "" }, { "docid": "a9d643c247d22632437d921aafd46106", "score": "0.70924157", "text": "def oauth_authorize\n redirect_to facebook_client.authorize(oauth_callback_ur...