query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
breakpoint.id > int Returns id of the breakpoint.
def id() #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(id)\n deleted = Byebug.started? && \n Byebug.remove_breakpoint(id) &&\n breakpoints.delete(find_by_id(id))\n raise ArgumentError, \"No breakpoint ##{id}\" if not deleted\n Pry.processor.debugging = false if to_a.empty?\n end", "def id\n get_screen_config['id']\n ...
[ "0.6414709", "0.6139297", "0.60112596", "0.60072064", "0.59930056", "0.5976972", "0.5974043", "0.5875963", "0.58625233", "0.5825077", "0.5807556", "0.57684445", "0.576734", "0.5761008", "0.5743874", "0.57435983", "0.5737679", "0.5721825", "0.57097447", "0.57097447", "0.570974...
0.0
-1
breakpoint.pos > string or int Returns the position of this breakpoint.
def pos() #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pos\n @pos || uninitialized!\n end", "def get_line_pos(pos)\n lpos = @line_ends.bsearch_index { |x, _| x >= pos }\n return lpos\n end", "def linenumber\n return @cmd.nil? ? 0 : @cmd.linenumber\n end", "def breakpoint_position(position_str, allow_condition)\n break_cmd_pa...
[ "0.6598374", "0.65575325", "0.6366797", "0.63558346", "0.63325584", "0.6332194", "0.6332194", "0.6329613", "0.63292533", "0.63181573", "0.62920386", "0.62845576", "0.6279168", "0.62100416", "0.6186055", "0.61803573", "0.61386114", "0.61104625", "0.60871965", "0.60676247", "0....
0.5677696
72
breakpoint.pos = string or int Sets the position of this breakpoint.
def pos=(p1) #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_breakpoint(source, pos, condition = nil)\n #This is a stub, used for indexing\n end", "def pos=(pos)\n if self.pos > pos\n @previous_line_number = @start_line_number\n @previous_pos = 0\n end\n super\n end", "def pos=(pos)\n @pos = pos\...
[ "0.75186574", "0.6928295", "0.6894091", "0.65645564", "0.6178737", "0.6178737", "0.6095171", "0.60911894", "0.60783964", "0.6011082", "0.596899", "0.58137643", "0.57416815", "0.5692489", "0.5634109", "0.56101984", "0.5607715", "0.56039244", "0.5596393", "0.5563009", "0.554478...
0.56112576
15
breakpoint.source > string Returns a source of the breakpoint.
def source() #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def source_line\n @source_location[1]\n end", "def source\n @source ||= raw_source.split(\"---\\n\")[2]\n end", "def source\n @source ||= raw_source.split(\"---\\n\")[2]\n end", "def source_path\n source[:path]\n end", "def source_line; end", "def source\n @source\n ...
[ "0.74322397", "0.7186143", "0.7186143", "0.68163615", "0.6783543", "0.6715445", "0.6715445", "0.668474", "0.66846323", "0.6665478", "0.6625004", "0.65374553", "0.65187323", "0.65187323", "0.6496116", "0.6473688", "0.6426417", "0.6370125", "0.6358398", "0.6353668", "0.6299374"...
0.0
-1
breakpoint.source = string Sets the source of the breakpoint.
def source= string #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_source_string(source)\n @source = source\n end", "def set_breakpoint(source, pos, condition = nil)\n #This is a stub, used for indexing\n end", "def source(arg = nil)\n set_or_return(:source, arg, kind_of: [String])\n end", "def source=(value)\n @sourc...
[ "0.7282157", "0.6793817", "0.64726", "0.636018", "0.636018", "0.6356455", "0.62840205", "0.62512916", "0.61887777", "0.6139745", "0.6083063", "0.60426253", "0.6040439", "0.60377586", "0.60091025", "0.59573513", "0.59523183", "0.5920675", "0.5889191", "0.5876663", "0.57365197"...
0.6495792
2
context.step(steps, force = false) Stops the current context after a number of +steps+ are made. +force+ parameter (if true) ensures that the cursor moves from the current line.
def step(steps, force = false) #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def step(steps = 1)\n @running = true\n \n unless @started\n do_setup\n @started = true\n end\n \n step_discrete\n steps.to_i.times do\n break if clock > clock_finish\n self.step_count += 1\n step_continuous\n step_discrete\n @running = false\n yield sel...
[ "0.59728587", "0.59317935", "0.5768815", "0.5679898", "0.5611346", "0.55906224", "0.5486114", "0.54564655", "0.5420921", "0.53006965", "0.5212678", "0.51285917", "0.51089215", "0.5106602", "0.51035166", "0.5102643", "0.5068543", "0.49807268", "0.49571222", "0.4945342", "0.492...
0.69721305
0
context.step_over(steps, frame = nil, force = false) Steps over a +steps+ number of times. Make step over operation on +frame+, by default the current frame. +force+ parameter (if true) ensures that the cursor moves from the current line.
def step_over(steps, frame = nil, force = false) #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def step(symbol = :over)\n raise RuntimeError, \"can only step top frame\" unless @index === 1\n case symbol\n when :into\n @thread.__step_over_in_frame(0)\n when :over\n @thread.__step_over_in_frame(1)\n when Fixnum\n @thread.__step_ove...
[ "0.6124069", "0.57661784", "0.561959", "0.5553481", "0.54919463", "0.5349302", "0.52394855", "0.52306765", "0.5080505", "0.5064667", "0.5062398", "0.5038954", "0.49929854", "0.4868817", "0.48618066", "0.481636", "0.4810257", "0.4691803", "0.46550697", "0.46507102", "0.4645890...
0.83142155
0
context.stop_frame(frame) Stops when a frame with number +frame+ is activated. Implements +finish+ and +next+ commands.
def stop_frame=(p1) #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def end_frame\n @frame = false\n end", "def end_frame\n end", "def cancel_frame\n end", "def remove_frame(frame)\n end", "def stop\n @playing = false\n @playing_animation = @defaults[:animation]\n @current_frame = @defaults[:frame]\n set_frame\n end", "def stop\n ...
[ "0.7293017", "0.7152878", "0.66192067", "0.6299996", "0.6293856", "0.6139231", "0.5898239", "0.5879108", "0.58512074", "0.58182174", "0.581034", "0.5722072", "0.570172", "0.570172", "0.570172", "0.570172", "0.570172", "0.570172", "0.570172", "0.570172", "0.5683779", "0.5667...
0.6171741
5
context.thread > thread Returns a thread this context is associated with.
def thread() #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def thread_id\n return @thread_id\n end", "def get_thread_by_context(username, job_key, application_id, context = 'Interviews')\n $LOG.i \"running \" + __method__.to_s\n @client.get '/mc/v1/contexts/' + username + '/' + context + ':' + job_key + ':' + application_id\n ...
[ "0.73593044", "0.7355364", "0.72682923", "0.7120313", "0.7071457", "0.6906607", "0.68539846", "0.68248516", "0.68248516", "0.68129104", "0.67198354", "0.66881317", "0.66625863", "0.6626273", "0.65915793", "0.65339196", "0.64293516", "0.64220583", "0.6412975", "0.64020413", "0...
0.5700239
86
context.thnum > int Returns the context's number.
def thnum() #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identifier\n num\n end", "def num()\n\t\treturn @num\n\tend", "def td_number_before_saison\n return 3\n end", "def num()\n @num\n end", "def num\r\n @num\r\n end", "def num\n @num\n end", "def column_number\n env(:column_number).to_i - 1\n end", "def li...
[ "0.5684912", "0.5657714", "0.55187297", "0.5484435", "0.5455073", "0.5454178", "0.5436273", "0.5424014", "0.5369638", "0.53601897", "0.52985054", "0.5270507", "0.5262721", "0.5258526", "0.52210695", "0.52201474", "0.5217972", "0.5217972", "0.5217972", "0.5217972", "0.5217972"...
0.6627264
0
context.stop_reason > sym Returns the reason for the stop. It maybe of the following values: :initial, :step, :breakpoint, :catchpoint, :postmortem
def stop_reason() #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop_symbol\n STOP\n end", "def stop(event, reason=\"\", bag={})\n step_errors << reason unless reason == \"\"\n r = StepResult.new(false, reason)\n r.bag = bag\n fire_events(event, r)\n r\n end", "def stop(flags = {})\n raise BreakControllerException.new(flags)\n end", ...
[ "0.66273147", "0.629454", "0.6262377", "0.6055388", "0.59404385", "0.5926642", "0.57250553", "0.5692453", "0.5685622", "0.5669365", "0.5666084", "0.56274426", "0.55897015", "0.5584706", "0.5584706", "0.5573017", "0.5570875", "0.55692863", "0.5534579", "0.5534198", "0.55273503...
0.76403606
0
context.suspend > nil Suspends the thread when it is running.
def suspend() #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def suspend(tid); Ragweed::Wrap32::open_thread(tid) {|x| Ragweed::Wrap32::suspend_thread(x)}; end", "def suspend!\n return if suspended?\n self.status = \"suspended\"\n self.stop = Time.now.to_s\n end", "def running?; !!@thread end", "def suspend\n end", "def suspend\n ...
[ "0.6801777", "0.6406392", "0.6278669", "0.6264639", "0.6251772", "0.6236161", "0.61998284", "0.6194493", "0.6108478", "0.61080104", "0.6104167", "0.60880065", "0.60484964", "0.59905034", "0.5990246", "0.59597796", "0.5952104", "0.5929426", "0.5926931", "0.59168667", "0.591372...
0.60294855
13
context.suspended? > bool Returns +true+ if the thread is suspended by debugger.
def suspended?() #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def suspended?\n status.suspended?\n end", "def is_suspended?\n current_teacher && current_teacher.suspended == true\n end", "def suspended?\n (status == SUSPEND)\n end", "def suspended?\n !active?\n end", "def suspended?\n (status == SUSPENDED)\n end", "def suspended\n ...
[ "0.76199895", "0.7105392", "0.7096407", "0.69690377", "0.69383776", "0.68270034", "0.67573303", "0.6369418", "0.6271647", "0.6264778", "0.6251077", "0.62107533", "0.6193293", "0.61832786", "0.6049362", "0.6015271", "0.59988904", "0.59984094", "0.5977086", "0.5952087", "0.5945...
0.7565439
1
context.resume > nil Resumes the thread from the suspended mode.
def resume() #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resume\n @suspended = false\n end", "def resume(tid); Ragweed::Wrap32::open_thread(tid) {|x| Ragweed::Wrap32::resume_thread(x)}; end", "def suspend_context(context)\n @context, back_context = context, @context\n begin\n yield back_context\n ensure\n @context = back_cont...
[ "0.72309464", "0.711389", "0.6919076", "0.67491096", "0.6730475", "0.6730475", "0.66316926", "0.65792364", "0.65478057", "0.65478057", "0.64868677", "0.64766765", "0.64691985", "0.6466904", "0.6415399", "0.6376361", "0.636416", "0.63388765", "0.63126695", "0.62864625", "0.628...
0.62666905
22
context.tracing > bool Returns the tracing flag for the current context.
def tracing() #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tracing?\n # The non-nil value of this instance variable\n # indicates if we are currently tracing\n # in this thread or not.\n self.current_trace ? true : false\n end", "def tracing?\n\n\t\tseverity_logged? :trace\n\tend", "def tracing= bool\n #This is a stub, used for in...
[ "0.80238235", "0.7582959", "0.73673874", "0.703", "0.69510657", "0.6945309", "0.66901654", "0.65891314", "0.62715226", "0.6199975", "0.6024528", "0.60131943", "0.6004989", "0.59607714", "0.59025615", "0.56553453", "0.5640354", "0.5513035", "0.5500569", "0.5382754", "0.5339196...
0.6064769
10
context.tracing = bool Controls the tracing for this context.
def tracing= bool #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tracing?\n # The non-nil value of this instance variable\n # indicates if we are currently tracing\n # in this thread or not.\n self.current_trace ? true : false\n end", "def trace(bool)\n Options[:trace] = bool\n end", "def trace_context\n TraceContextData.new trace_i...
[ "0.64751333", "0.63221496", "0.6173602", "0.6167658", "0.60902816", "0.6049188", "0.59212685", "0.576751", "0.5726613", "0.56587684", "0.5629724", "0.55955744", "0.55809015", "0.553886", "0.55050445", "0.5484302", "0.5418977", "0.54049236", "0.53941494", "0.5393414", "0.53498...
0.75297266
0
context.ignored? > bool Returns the ignore flag for the current context.
def ignored?() #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ignored?\n !!ignored\n end", "def ignored?\n @ignored\n end", "def ignore?\n @should_ignore\n end", "def ignore?\n !!@ignore\n end", "def ignored?\r\n infoxml = get_info\r\n \r\n if ignored = infoxml['ignored']\r\n return ignored == '1'\r\n end...
[ "0.8143898", "0.80886847", "0.7931794", "0.781652", "0.7487862", "0.72658706", "0.7139191", "0.7132088", "0.7122642", "0.6929333", "0.6906048", "0.678826", "0.6722457", "0.6722457", "0.6714436", "0.6696842", "0.65098417", "0.6489235", "0.6451729", "0.6409144", "0.63640094", ...
0.74085253
5
context.frame_args(frame_position=0) > list Returns frame's argument parameters
def frame_args(frame_position=0) #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def frame_args_info(frame_position=0)\n #This is a stub, used for indexing\n end", "def frame_locals(frame)\n #This is a stub, used for indexing\n end", "def args\n @function.args\n end", "def get_args\n <<-CODE\n stack_push(I2N(c->args));\n CODE\n en...
[ "0.8184107", "0.72241396", "0.6730563", "0.6720058", "0.6580736", "0.6578291", "0.6574132", "0.65566057", "0.65477014", "0.65438724", "0.652671", "0.65024203", "0.65015596", "0.64470434", "0.63704914", "0.63704914", "0.63704914", "0.63285214", "0.63285214", "0.6273936", "0.61...
0.8568744
0
context.frame_args_info(frame_position=0) > list if track_frame_args or nil otherwise Returns info saved about call arguments (if any saved).
def frame_args_info(frame_position=0) #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def frame_args(frame_position=0)\n #This is a stub, used for indexing\n end", "def frame_info(b, verbose = T.unsafe(nil)); end", "def frame_locals(frame)\n #This is a stub, used for indexing\n end", "def frame\n context.frame\n end", "def inspect_details\n\t\t\tr...
[ "0.73614925", "0.67115647", "0.62972516", "0.5916123", "0.5851767", "0.564387", "0.5492211", "0.541012", "0.5378247", "0.5325605", "0.5295451", "0.5292543", "0.5257294", "0.52423185", "0.5241608", "0.52381957", "0.52247214", "0.52034533", "0.51905805", "0.5182769", "0.5158352...
0.8432847
0
context.frame_binding(frame_position=0) > binding Returns frame's binding.
def frame_binding(frame_position=0) #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_binding\r\n binding\r\n end", "def get_binding\n binding\n end", "def get_binding\n binding\n end", "def get_binding\n binding\n end", "def get_binding\n binding\n end", "def get_binding\n binding\n end", "def get_binding...
[ "0.74325603", "0.7393375", "0.73767585", "0.73767585", "0.73767585", "0.73767585", "0.7356188", "0.7356188", "0.7356188", "0.7356188", "0.7356188", "0.7356188", "0.7356188", "0.7356188", "0.7356188", "0.72688013", "0.7268207", "0.7268207", "0.7268207", "0.7268207", "0.7268207...
0.88787585
0
context.frame_class(frame_position) > obj Returns the real class of the frame. It could be different than context.frame_self(frame).class
def frame_class(frame_position) #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def class\n __getobj__.class\n end", "def class_obj\n self.class\n end", "def class\n @object.class\n end", "def frame_type\n if compiled_code.for_module_body?\n :class\n elsif compiled_code.for_eval?\n :eval\n elsif compiled_code.is_block?\n :block\n ...
[ "0.6841166", "0.67844445", "0.66431594", "0.6633035", "0.6503256", "0.6495862", "0.6471656", "0.64012927", "0.64012927", "0.6306069", "0.61964923", "0.60963947", "0.6046081", "0.6035812", "0.6008816", "0.59466666", "0.59452647", "0.59182566", "0.5909716", "0.5890969", "0.5877...
0.8091036
0
context.frame_file(frame_position) > string Returns the name of the file.
def frame_file(frame_position) #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_name\n @file_name\n end", "def file_name\n return unless @file\n\n @file.absolute_name\n end", "def file_name\n return @file_name\n end", "def file_name\n return @file_name\n end", "def filename\n @file.basename.to_s\n ...
[ "0.6973043", "0.6971838", "0.6965045", "0.6965045", "0.6932965", "0.69196784", "0.6850235", "0.6848409", "0.6830814", "0.682201", "0.68213594", "0.6813869", "0.6743784", "0.6719572", "0.6713573", "0.6713573", "0.67050445", "0.6685707", "0.6670357", "0.66693175", "0.663121", ...
0.81086636
0
context.frame_method(frame_position=0) > sym Returns the sym of the called method.
def frame_id(*args) #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def method_symbol; end", "def sym\n @sym\n end", "def frame_method(frame_position=0)\n #This is a stub, used for indexing\n end", "def sym(name)\n #This is a stub, used for indexing\n end", "def callee\n @method\n end", "def invoked(sym)\n invocations[sy...
[ "0.69512594", "0.66349834", "0.6327612", "0.6276426", "0.61505586", "0.6141742", "0.60785204", "0.60785204", "0.60739136", "0.5959623", "0.5881692", "0.58559984", "0.58232665", "0.58047616", "0.5784338", "0.5779827", "0.57791066", "0.5752307", "0.5670308", "0.56651896", "0.56...
0.0
-1
context.frame_line(frame_position) > int Returns the line number in the file.
def frame_line(frame_position) #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def line_number(pos=pos())\n line_index(pos) + 1\n end", "def line_number\n\t\t\t@line_index + 1\n\t\tend", "def line_number(pos=pos)\n line_index(pos) + 1\n end", "def get_lineno\n RubyVM::Frame.get(1).source_location[0]\n end", "def line_number\n return unless backtrace and backt...
[ "0.78055876", "0.7755992", "0.7704092", "0.75576514", "0.7490378", "0.73755527", "0.73755527", "0.73755527", "0.73755527", "0.73755527", "0.73755527", "0.73755527", "0.7347998", "0.7309536", "0.72831947", "0.72744715", "0.72093606", "0.7189329", "0.7166153", "0.71587354", "0....
0.8047079
0
context.frame_locals(frame) > hash Returns frame's local variables.
def frame_locals(frame) #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def locals; list_all :local_variables; end", "def thread_variables\n _locals.keys\n end", "def locals; end", "def locals; end", "def locals; end", "def __locals__\n\t\t\treturn @locals\n\t\tend", "def locals\n @locals\n end", "def locals\n @locals ||= var_names.inject({}) { |...
[ "0.77082175", "0.76400006", "0.72611445", "0.72611445", "0.72611445", "0.7157868", "0.7102354", "0.7015761", "0.6967654", "0.6944298", "0.6852519", "0.6723926", "0.670076", "0.6495826", "0.6437939", "0.6430348", "0.6403234", "0.63445", "0.6321381", "0.618346", "0.61575264", ...
0.84521586
0
context.frame_method(frame_position=0) > sym Returns the sym of the called method.
def frame_method(frame_position=0) #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def method_symbol; end", "def sym\n @sym\n end", "def sym(name)\n #This is a stub, used for indexing\n end", "def callee\n @method\n end", "def invoked(sym)\n invocations[sym]\n end", "def method_name\n m = @method_stack.first || @@no_method\n m = \"##{m}\" unles...
[ "0.69514185", "0.6637146", "0.627887", "0.61497444", "0.6142605", "0.60780656", "0.60780656", "0.6073959", "0.5961963", "0.5884108", "0.5855887", "0.5825235", "0.5804225", "0.5784744", "0.5779713", "0.57790554", "0.57533264", "0.56691045", "0.566596", "0.566596", "0.5652778",...
0.63255364
2
context.frame_self(frame_postion=0) > obj Returns self object of the frame.
def frame_self(frame_postion=0) #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def frame\n context.frame\n end", "def parent_frame; end", "def current_frame\n @current_frame\n end", "def frame; end", "def current_frame\n @callstack.top\n end", "def framing\n previous, klass.current_frame = klass.current_frame, self unless @delegate_to_klass\n y...
[ "0.6888421", "0.66337323", "0.6450572", "0.62021834", "0.60720646", "0.5795501", "0.5717279", "0.57076037", "0.56626725", "0.5636085", "0.5621443", "0.5617217", "0.54911166", "0.5490457", "0.5472701", "0.54706264", "0.5400071", "0.53982496", "0.53850675", "0.5377918", "0.5377...
0.8206493
0
context.stack_size> int Returns the size of the context stack.
def stack_size() #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stack_current_size()\n if(@stack == nil)\n return 0\n end\n return @stack.length\n end", "def stack_depth\n @stack.size\n end", "def length\n return @stack.length\n end", "def stack_size\n Ruby.primitive :task_stack_size\n Kernel.raise Primitiv...
[ "0.81845665", "0.81299996", "0.8025825", "0.7454775", "0.74532986", "0.7247", "0.7117701", "0.70182985", "0.70143414", "0.6745211", "0.6312303", "0.62654024", "0.6188655", "0.61869645", "0.6097396", "0.6079325", "0.6067675", "0.59948784", "0.59613615", "0.59584624", "0.595463...
0.8126627
2
context.dead? > bool Returns +true+ if context doesn't represent a live context and is created during postmortem exception handling.
def dead?() #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dead?\n @dead\n end", "def dead?\n # question mark since this will return a boolean\n @dead\n end", "def dead?\n @dead || false\n end", "def isDead\n self.dead\n end", "def dead?\n @dead\n end", "def dead?\n false\n end", "def dead?\n @state == ...
[ "0.7592236", "0.7556629", "0.75349027", "0.74713224", "0.72932845", "0.723496", "0.71967685", "0.7017573", "0.69530815", "0.6877414", "0.6840916", "0.6792833", "0.6791779", "0.67821753", "0.67316854", "0.66445106", "0.66445106", "0.6552237", "0.6454522", "0.63933015", "0.6391...
0.7258638
5
context.breakpoint > breakpoint Returns a contextspecific temporary Breakpoint object.
def breakpoint() #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trigger_breakpoint\n local_var = 6 * 7\n local_var\n end", "def breakpoint_recipe\n recipe = tag_value(BREAKPOINT_TAG)\n end", "def breakpoint?\n type == :breakpoint\n end", "def at_breakpoint(_context, breakpoint)\n @pry ||= Pry.new\n\n output.puts bold(\"\\n ...
[ "0.5904971", "0.5815545", "0.5795219", "0.5714498", "0.5683567", "0.56551725", "0.558995", "0.5456799", "0.5372047", "0.5334532", "0.5299026", "0.52380884", "0.52353644", "0.5232896", "0.51969177", "0.5178399", "0.5041989", "0.4962011", "0.4955807", "0.4946382", "0.49107388",...
0.5933007
0
context.set_breakpoint(source, pos, condition = nil) > breakpoint Sets a contextspecific temporary breakpoint, which can be used to implement 'Run to Cursor' debugger function. When this breakpoint is reached, it will be cleared out. source is a name of a file or a class. pos is a line number or a method name if source is a class name. condition is a string which is evaluated to +true+ when this breakpoint is activated.
def set_breakpoint(source, pos, condition = nil) #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_breakpoint(ip, obj)\n Rubinius.primitive :compiledmethod_set_breakpoint\n raise ArgumentError, \"Unable to set breakpoint on #{inspect} at invalid bytecode address #{ip}\"\n end", "def set_breakpoint(cm, ip, condition=nil)\n @breakpoint_tracker.on(cm, :ip => ip, :condition => condition)...
[ "0.65271884", "0.64223367", "0.6004352", "0.5726392", "0.571453", "0.5707155", "0.55803555", "0.5499485", "0.54797536", "0.5444156", "0.5350357", "0.53241324", "0.5284938", "0.5269735", "0.5241717", "0.51789045", "0.51789045", "0.517114", "0.517083", "0.5162147", "0.51480013"...
0.83013994
0
context.jump(line, file) > bool Returns +true+ if jump to +line+ in filename +file+ was successful.
def jump(line, file) #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perform_jump target_position \n if valid_jump?(target_position) \n move!(target_position)\n return true\n else\n return false\n end \n end", "def jump(line)\n return line[/(JGT)|(JEQ)|(JGE)|(JLT)|(JNE)|(JLE)|(JMP)/]\n end", "def jump(x)\n @memory_positio...
[ "0.6069243", "0.5998537", "0.5541006", "0.5540809", "0.5530144", "0.5520676", "0.5498452", "0.53928334", "0.53591007", "0.5335214", "0.5335214", "0.5335214", "0.5328756", "0.5308026", "0.5305975", "0.52961266", "0.5288643", "0.5285649", "0.52650374", "0.52254456", "0.5215955"...
0.785503
0
context.break > bool Returns +true+ if context is currently running and set flag to break it at next line
def pause() #This is a stub, used for indexing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def break\n if ! advance? then return self end\n @@logger.debug \"Handle break.\"\n SandboxModule::set_break\n @break_at = SandboxModule::line_count\n return self\n end", "def break?\n @break\n end", "def break\n @break = true\n end", "def break!\n # -> uncomment the next...
[ "0.7567867", "0.7456614", "0.71922135", "0.68033314", "0.6754609", "0.6520653", "0.63237965", "0.62858343", "0.61815274", "0.6036262", "0.60075814", "0.6005173", "0.599018", "0.59001863", "0.5890006", "0.5839009", "0.5802711", "0.5767658", "0.57106805", "0.5706131", "0.568823...
0.0
-1
GET /oeuvres GET /oeuvres.json
def index @oeuvres = Oeuvre.includes(:auteur, :genre, :mouvement).all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getOrden \n \t@orden = Orden.where(:rest => params[:id_res])\n \trender json: @orden\n end", "def index\n @ores = Ore.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ores }\n end\n end", "def show\n @eou = Eou.find(params[:id])\n\n ...
[ "0.67836094", "0.66264963", "0.65078056", "0.6438889", "0.637393", "0.6269834", "0.62125283", "0.61551976", "0.6154848", "0.61388767", "0.61182296", "0.6109577", "0.6102972", "0.60428303", "0.6014758", "0.5997842", "0.5971432", "0.59676", "0.59676", "0.59673566", "0.59621555"...
0.6003856
15
GET /oeuvres/1 GET /oeuvres/1.json
def show @lienthemes = Lientheme.where(oeuvre:@oeuvre) @passage = Passage.where(oeuvre:@oeuvre) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getOrden \n \t@orden = Orden.where(:rest => params[:id_res])\n \trender json: @orden\n end", "def index\n @ores = Ore.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ores }\n end\n end", "def show\n @eou = Eou.find(params[:id])\n\n ...
[ "0.71232986", "0.67307174", "0.6521968", "0.6484717", "0.6470232", "0.6462635", "0.64165384", "0.63530356", "0.6259394", "0.62531155", "0.62458235", "0.62100005", "0.62045085", "0.62000763", "0.6195355", "0.6191103", "0.6142018", "0.61294115", "0.61286944", "0.6128359", "0.61...
0.0
-1
POST /oeuvres POST /oeuvres.json
def create @oeuvre = Oeuvre.new(oeuvre_params) respond_to do |format| if @oeuvre.save format.html { redirect_to oeuvres_url, notice: 'Oeuvre was successfully created.' } format.json { render :show, status: :created, location: @oeuvre } else format.html { render :new } format.json { render json: @oeuvre.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @eou = Eou.new(params[:eou])\n\n respond_to do |format|\n if @eou.save\n format.html { redirect_to @eou, :notice => 'Eou was successfully created.' }\n format.json { render :json => @eou, :status => :created, :location => @eou }\n else\n format.html { render :actio...
[ "0.65751946", "0.6121014", "0.6015937", "0.5962933", "0.59413034", "0.5875519", "0.58721125", "0.58629787", "0.5771861", "0.5770713", "0.5741544", "0.57217324", "0.57146966", "0.5704892", "0.5699557", "0.56834674", "0.5683171", "0.5682106", "0.5682001", "0.56388855", "0.56314...
0.705001
0
PATCH/PUT /oeuvres/1 PATCH/PUT /oeuvres/1.json
def update respond_to do |format| if @oeuvre.update(oeuvre_params) format.html { redirect_to oeuvres_url, notice: 'Oeuvre was successfully updated.' } format.json { render :show, status: :ok, location: @oeuvre } else format.html { render :edit } format.json { render json: @oeuvre.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_j...
[ "0.6602089", "0.64328027", "0.64328027", "0.63856256", "0.63209045", "0.6279602", "0.6263304", "0.6230885", "0.6223406", "0.62230164", "0.6217524", "0.6205897", "0.61967963", "0.6174193", "0.6151592", "0.61368465", "0.6135063", "0.6130397", "0.6130397", "0.6126867", "0.611622...
0.6475902
1
DELETE /oeuvres/1 DELETE /oeuvres/1.json
def destroy @oeuvre.destroy respond_to do |format| format.html { redirect_to oeuvres_url, notice: 'Oeuvre was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n client.delete(\"/#{id}\")\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def destroy\n @eou = Eou.find(params[:id])\n @eou.destroy\n\n respond_to do |format|\n format.html { redirect_to eous_url }\n format...
[ "0.7081451", "0.70353186", "0.7027126", "0.69298726", "0.6929632", "0.6922146", "0.6904657", "0.6898908", "0.68711233", "0.6864661", "0.6844306", "0.6844214", "0.6801516", "0.67987704", "0.67898566", "0.67778903", "0.6774174", "0.67641497", "0.6762674", "0.6760893", "0.675248...
0.706301
1
Use callbacks to share common setup or constraints between actions.
def set_oeuvre @oeuvre = Oeuvre.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def oeuvre_params params.require(:oeuvre).permit(:titre_oeuvre, :auteur_id, :genre, :mouvement, :genre_id, :mouvement_id, :date) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
Represent topic name into more subdomain computable name ie. convert "some_sub_domain" => "some.sub.domain"
def subdomain self.name.gsub('_', '.') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subscription_name(topic)\n [\n Cloudenvoy.config.gcp_sub_prefix.tr('.', '-'),\n to_s.underscore,\n topic\n ].join('.')\n end", "def subdomain\n ([self.short_name] + self.class.dalianshops.domain.split('.')[1..-1]).join('.')\n end", "def kafka_topic\n ...
[ "0.72965014", "0.6988587", "0.6768562", "0.6627067", "0.6584972", "0.65301865", "0.6466345", "0.6387129", "0.6382305", "0.6339963", "0.62927586", "0.6291936", "0.62900627", "0.62449116", "0.6220833", "0.6210845", "0.61967146", "0.6188476", "0.61666447", "0.61618036", "0.61551...
0.7384525
0
Retrieve configuration for the specific +bind_column+ Parameters +bind_column+ this column must be database specific column which are mapped over topic module editor
def module_conf(bind_column) (self.modules && self.modules.reject{|m| m['bind_column'] != bind_column} || []).first end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attributes_from_column_definition\n connection.columns(self.class.table_name, \"#{self.class.name} Columns\").inject({}) do |attributes, column| \n attributes[column.name] = column.default unless column.name == self.class.primary_key\n attributes\n end\n end", "def param_...
[ "0.607832", "0.5938183", "0.5938183", "0.5878744", "0.5772138", "0.5627764", "0.56144506", "0.5562231", "0.551527", "0.54989916", "0.5496054", "0.54786575", "0.5478362", "0.5466566", "0.54485303", "0.54111636", "0.54111636", "0.54060495", "0.53760076", "0.5370765", "0.5370765...
0.78422457
0
Determine the default host, right now the implementation is based on the +self.host_list+ array pop
def default_host host_list.first end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __default_network_host\n case version\n when /^0|^1/\n '0.0.0.0'\n when /^2/\n '_local_'\n when /^5|^6|^7/\n '_local_'\n else\n raise RuntimeError, \"Cannot determine default network host ...
[ "0.72735935", "0.6941687", "0.6821452", "0.6769229", "0.66150844", "0.6552732", "0.6551716", "0.6485285", "0.64794743", "0.64747006", "0.647166", "0.6450836", "0.6328337", "0.6321317", "0.62927413", "0.62217975", "0.62217975", "0.6194194", "0.61882544", "0.6160568", "0.614671...
0.8442449
0
To convert +self.hosts+ string into an array of hosts Space and Comma will be used for splitting host string
def host_list return @host_list if defined?(@host_list) if !self.hosts.blank? @host_list = self.hosts.split(/[,\s]+/).compact else @host_list = [] end @host_list end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hosts\n @hosts ||= match[5].split(\",\")\n end", "def hosts\n @hosts ||= match[5].split(\",\")\n end", "def parse_host\n args = ENV['host'].split(',')\n hosts = []\n args.each do |arg|\n if XP5K::Role.listnames.include? arg\n hosts << roles(arg)\n else\n hosts << arg\...
[ "0.7645588", "0.7611563", "0.69714254", "0.69393563", "0.68265784", "0.6807716", "0.667483", "0.66286397", "0.6544973", "0.64959383", "0.6479369", "0.6462997", "0.640546", "0.63898665", "0.63881177", "0.63881177", "0.6363278", "0.62512976", "0.62368053", "0.61782664", "0.6169...
0.76323605
1
Determine locale based on whether this topic is set as "default" or not. Because except all default topics we will be using +"topic.name"_en|bn+ format
def locale(locale) if default? locale.to_s else "#{self.name}_#{locale.to_s}" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_locale\n (self.locales.first || Locomotive::Mounter.locale).to_sym\n end", "def default_locale\n return nil unless localized?\n u_lc = I18n.locale.to_sym\n available_locales.include?(u_lc) ? u_lc : available_locales[0]\n end", "def full_locale(lang=I18n.locale....
[ "0.66295916", "0.6614941", "0.6576827", "0.65067136", "0.6497473", "0.6488513", "0.6477965", "0.6394625", "0.6349288", "0.62968105", "0.6285163", "0.6156663", "0.61063546", "0.6101768", "0.60899335", "0.6089187", "0.60891813", "0.60747117", "0.60435396", "0.6037219", "0.59812...
0.6253704
11
Determine public host based on if host is defined otherwise standard host with topic.subdomain
def public_host_config config = {:host => SERVER_DOMAIN[RAILS_ENV.to_sym], :subdomain => subdomain, :l => locale(:en)} if default_host config = {:host => default_host, :subdomain => 'www', :l => locale(:en)} end config end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_host\n primary_host = hosts.primary.first\n primary_host.blank? ? \"#{subdomain}.adaptapp.com\" : primary_host.hostname\n end", "def desired_hostname\n if path.start_with?('/foo/en')\n Rails.env.staging? ? 'foo-staging.infopark.com' : 'www.foo.com'\n else\n # Default hostname\n...
[ "0.74312234", "0.73352677", "0.72794926", "0.7014478", "0.69824284", "0.6938932", "0.6878307", "0.6766041", "0.67547745", "0.6752672", "0.67435485", "0.6734309", "0.6680094", "0.6675228", "0.66734195", "0.66250116", "0.6613455", "0.6581389", "0.6577574", "0.65739894", "0.6555...
0.6724507
12
Convert furniture_store to Furniture Stores
def friendly_name_pluralized @friendly_name_pluralized ||= self.name.humanize.pluralize end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize(row)\n purchaser = Purchaser.find_by_name(row.fields[0])\n purchaser = Purchaser.create!({ name: row.fields[0] }) unless purchaser\n\n item = Item.find_by_description(row.fields[1])\n item = Item.create!({ description: row.fields[1], price: row.fields[2] }) unless item\n\n purchase = P...
[ "0.51400167", "0.5015396", "0.49758878", "0.49026942", "0.4855298", "0.4855298", "0.48330295", "0.48330295", "0.48330295", "0.47857416", "0.47784436", "0.47382513", "0.47176486", "0.47131217", "0.46898845", "0.4658139", "0.4612902", "0.46062127", "0.45972738", "0.45838335", "...
0.0
-1
private. if json_item is a tweet, yield the screen_name/tweet_text/created_at and stop the event loop if block returns true
def yield_if_tweet event_machine, json_item, &block raise "expecting a block" unless block_given? parsed_item = JSON.parse json_item rescue nil screen_name = parsed_item['user']['screen_name'] rescue nil tweet_text = parsed_item['text'] rescue nil created_at = parsed_item['created_at'] rescue nil yield screen_name, tweet_text, created_at if screen_name and tweet_text and created_at nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yield_if_tweet_expected_result event_machine, tweet_json, block\n if VALID_TWEET_JSONS.include? tweet_json\n tweet = JSON.parse tweet_json\n block.should_receive(:call).with(\n tweet['user']['screen_name'],\n tweet['text'],\n ...
[ "0.6949207", "0.64927477", "0.60019374", "0.5947612", "0.59278", "0.5870051", "0.5854295", "0.5805398", "0.5805398", "0.57716703", "0.5763828", "0.572082", "0.5703999", "0.5678686", "0.5584568", "0.55102164", "0.5506693", "0.54874146", "0.5452923", "0.5438115", "0.54080975", ...
0.8055968
0
synchronously consume a twitter stream and pass each received json_item to yield_if_tweet must be called inside EventMachine::run
def twitter_stream twitter_login, content, &block raise "expecting a block" unless block_given? stream = Twitter::JSONStream.connect( :path => "/1/statuses/filter.json?#{content}", :auth => twitter_login, :ssl => true, ) stream.each_item do |json_item| yield_if_tweet EventMachine, json_item, &block end stream.on_error do |message| # No need to worry here. It might be an issue with Twitter. # Log message for future reference. JSONStream will try to reconnect after a timeout. $stderr.print message + "\n" $stderr.flush end stream.on_reconnect do |timeout, retries| # No need to worry here. It might be an issue with Twitter. # Log message for future reference. JSONStream will try to reconnect after a timeout. $stderr.print "reconnect retry #{retries}\n" $stderr.flush end stream.on_max_reconnects do |timeout, retries| # Something is wrong on your side. Send yourself an email. $stderr.print "reconnect max retries\n" $stderr.flush end nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yield_if_tweet_expected_result event_machine, tweet_json, block\n if VALID_TWEET_JSONS.include? tweet_json\n tweet = JSON.parse tweet_json\n block.should_receive(:call).with(\n tweet['user']['screen_name'],\n tweet['text'],\n ...
[ "0.7256029", "0.70286655", "0.646895", "0.63333905", "0.62585324", "0.62279046", "0.6098446", "0.6029502", "0.5943028", "0.58155", "0.57994074", "0.5742635", "0.5619084", "0.560768", "0.560768", "0.55853134", "0.55839205", "0.55636984", "0.5503414", "0.5481706", "0.54537183",...
0.76845294
0
GET admin/subcategorias GET admin/subcategorias.json
def index @subcategorias = Subcategoria.where(:status_id => Status.find_by_descricao('Ativo')) respond_to do |format| format.html # index.html.erb format.json { render :json => @subcategorias } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_subcategories\r\n sub_categories = Taxonomy.get_subcategories\r\n render json: sub_categories, root: 'categories', adapter: :json, status: :ok\r\n end", "def index\n @subcategoria = Subcategorium.all\n end", "def show\n @subcategoria = Subcategoria.find(params[:id])\n\n respond_to do |...
[ "0.8024399", "0.729906", "0.71409726", "0.71214145", "0.70274585", "0.70274585", "0.6925911", "0.68872017", "0.68795985", "0.6875233", "0.6809334", "0.6806685", "0.67931217", "0.6726925", "0.6726925", "0.6690303", "0.6661848", "0.65877706", "0.657599", "0.65683275", "0.652319...
0.6925557
7
GET admin/subcategorias/1 GET admin/subcategorias/1.json
def show @subcategoria = Subcategoria.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render :json => @subcategoria } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_subcategories\r\n sub_categories = Taxonomy.get_subcategories\r\n render json: sub_categories, root: 'categories', adapter: :json, status: :ok\r\n end", "def index\n @subcategoria = Subcategorium.all\n end", "def index\n @subcategorias = Subcategoria.where(:status_id => Status.find_by_des...
[ "0.78520715", "0.72496635", "0.7060617", "0.69838023", "0.69838023", "0.6981387", "0.69262105", "0.68186426", "0.67675656", "0.6748878", "0.67262447", "0.67148143", "0.66815466", "0.66184074", "0.6611248", "0.6583696", "0.6575992", "0.65722144", "0.65720403", "0.65720403", "0...
0.7329704
1
GET admin/subcategorias/new GET admin/subcategorias/new.json
def new @subcategoria = Subcategoria.new @subcategoria.status = Status.find_by_descricao('Ativo') respond_to do |format| format.html # new.html.erb format.json { render :json => @subcategoria } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @subcategoria = Subcategoria.new(params[:subcategoria])\n\n respond_to do |format|\n if @subcategoria.save\n format.html { redirect_to [:admin, @subcategoria], :notice => 'Subcategorias was successfully created.' }\n format.json { render :json => @subcategoria, :status => :cre...
[ "0.7911613", "0.743415", "0.7307682", "0.72365785", "0.7197062", "0.7120203", "0.71024257", "0.7053368", "0.6982711", "0.69136745", "0.6885708", "0.68805534", "0.6874008", "0.68499976", "0.6820402", "0.681752", "0.6784847", "0.67815685", "0.6745871", "0.6700839", "0.6664444",...
0.75399053
1
POST admin/subcategorias POST admin/subcategorias.json
def create @subcategoria = Subcategoria.new(params[:subcategoria]) respond_to do |format| if @subcategoria.save format.html { redirect_to [:admin, @subcategoria], :notice => 'Subcategorias was successfully created.' } format.json { render :json => @subcategoria, :status => :created, :location => @subcategoria } else format.html { render :action => "new" } format.json { render :json => @subcategoria.errors, :status => :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_subcategories\r\n sub_categories = Taxonomy.get_subcategories\r\n render json: sub_categories, root: 'categories', adapter: :json, status: :ok\r\n end", "def create\n @subcategoriaproduto = Subcategoriaproduto.new(subcategoriaproduto_params)\n\n respond_to do |format|\n if @subcategoria...
[ "0.7047645", "0.6847077", "0.679358", "0.6687973", "0.6637772", "0.6606623", "0.6606623", "0.655284", "0.64979273", "0.64876026", "0.63719493", "0.63631874", "0.63612616", "0.636099", "0.6360084", "0.6335856", "0.63269174", "0.63246834", "0.6304423", "0.6275888", "0.62607706"...
0.7745041
0
PUT admin/subcategorias/1 PUT admin/subcategorias/1.json
def update @subcategoria = Subcategoria.find(params[:id]) respond_to do |format| if @subcategoria.update_attributes(params[:subcategoria]) format.html { redirect_to [:admin, @subcategoria], :notice => 'Exemplo was successfully updated.' } format.json { head :ok } else format.html { render :action => "edit" } format.json { render :json => @subcategoria.errors, :status => :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_subcategoriaproduto\n @subcategoriaproduto = Subcategoriaproduto.find(params[:id])\n end", "def destroy\n @subcategoria = Subcategoria.find(params[:id])\n @subcategoria.update_attributes :status => Status.find_by_descricao('Inativo')\n\n respond_to do |format|\n format.html { redire...
[ "0.67660546", "0.6665121", "0.6589681", "0.6530966", "0.6484948", "0.6484031", "0.642324", "0.63102955", "0.62614506", "0.62503475", "0.62429935", "0.622766", "0.6195117", "0.6191038", "0.61899304", "0.6177532", "0.6157294", "0.61142164", "0.6073973", "0.60616064", "0.6054414...
0.7165695
0
DELETE admin/subcategorias/1 DELETE admin/subcategorias/1.json
def destroy @subcategoria = Subcategoria.find(params[:id]) @subcategoria.update_attributes :status => Status.find_by_descricao('Inativo') respond_to do |format| format.html { redirect_to admin_subcategorias_path } format.json { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @subcategorium.destroy\n respond_to do |format|\n format.html { redirect_to subcategoria_url, notice: 'Subcategorium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subcategoriaproduto.destroy\n respond_to do |format|\n ...
[ "0.75051934", "0.74020326", "0.72237676", "0.7208124", "0.7116253", "0.707014", "0.7044123", "0.7037415", "0.701259", "0.69816613", "0.69666797", "0.69357365", "0.6919372", "0.69000286", "0.68934655", "0.68713176", "0.68713176", "0.6838041", "0.6804099", "0.6800271", "0.67993...
0.7596678
0
protected The path used after resending confirmation instructions. def after_resending_confirmation_instructions_path_for(resource_name) super(resource_name) end The path used after confirmation.
def after_confirmation_path_for(resource_name, resource) unless params[:user].nil? admin_path else new_user_session_path end #super(resource_name, resource) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def after_resending_confirmation_instructions_path_for(resource_name)\n logger.debug(\"Users::ConfirmationsController.after_resending_confirmation_instructions_path_for\")\n super(resource_name)\n end", "def after_resending_confirmation_instructions_path_for(resource_name)\n super(resource_name)\n end...
[ "0.8994823", "0.8911811", "0.8635972", "0.8591973", "0.8513567", "0.8455544", "0.83953094", "0.83293205", "0.82581484", "0.82581484", "0.82581484", "0.82581484", "0.81203794", "0.80724704", "0.79927313", "0.79882735", "0.7922272", "0.7855836", "0.7789464", "0.7722189", "0.764...
0.7564139
27
Consume anything and be done
def anything(&continuation) Anything.new(&continuation) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def consume\n end", "def consume\n \n end", "def consume; end", "def consume; end", "def consume; end", "def consume_all\n end", "def consume_all\n end", "def reconsume; end", "def call\n executor.consume\n end", "def consume (workitem)\n # does nothing and doe...
[ "0.79341686", "0.7933202", "0.7810443", "0.7810443", "0.7810443", "0.7561611", "0.7561611", "0.73301184", "0.6688578", "0.66697705", "0.6602405", "0.6482781", "0.63769406", "0.6375756", "0.62979966", "0.62890655", "0.6260068", "0.62440604", "0.6218188", "0.61579907", "0.61544...
0.0
-1
Expects element and ends with it
def element(name, &continuation) Element.new(name, &continuation) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def end_element(name); end", "def end_element(name); end", "def end_element?\n @contents[0] == :end_element\n end", "def element?; end", "def element?; end", "def next_element; end", "def element; end", "def element; end", "def element; end", "def element; end", "def parse_element\n...
[ "0.7224556", "0.7224556", "0.6616512", "0.65138894", "0.65138894", "0.64364505", "0.6209515", "0.6209515", "0.6209515", "0.6209515", "0.6173722", "0.6016558", "0.5863495", "0.5863495", "0.5856069", "0.58301073", "0.58289963", "0.58030456", "0.5783154", "0.57724684", "0.576913...
0.0
-1
creates an empty board
def initialize(bounds) self.lower_bound_x = bounds[:lower_x] self.lower_bound_y = bounds[:lower_y] self.upper_bound_x = bounds[:upper_x] self.upper_bound_y = bounds[:upper_y] @occupied_space = Array.new(upper_bound_x + 1) { Array.new(upper_bound_y + 1, piece: nil) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n (0..7).each do |row|\n @board << []\n (0..7).each do |col| \n @board[row] << \"[ ]\"\n end\n end\n end", "def create_board\n\t\t8.times{|x| @board.push([nil,nil,nil,nil,nil,nil,nil,nil])}\n\t\tpopulate_board\n\tend", "def newBoard\n\t\t\t[['r', 'n', 'b', 'k', 'q', 'b'...
[ "0.837538", "0.8285081", "0.80788565", "0.80419993", "0.7865405", "0.78057", "0.7781915", "0.7764439", "0.7712955", "0.7681126", "0.7645784", "0.76427853", "0.7639404", "0.7588497", "0.75542945", "0.7540308", "0.7510428", "0.75099975", "0.750689", "0.7505773", "0.74821013", ...
0.0
-1
Do not modify this !
def test_0_before $report = Report.new() $testReport = $report.createReport($REPORT) $browser = Watir::Browser.new $current="" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def schubert; end", "def probers; end", "def suivre; end", "def refutal()\n end", "def custom; end", "def custom; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def implementation; end", "def implementation; end", "def internal; e...
[ "0.8085632", "0.69991875", "0.6978542", "0.67552", "0.6669059", "0.66564417", "0.66564417", "0.6568611", "0.6568611", "0.6568611", "0.6568611", "0.646128", "0.646128", "0.6417068", "0.6359349", "0.6340662", "0.62975645", "0.62905675", "0.628812", "0.62836665", "0.62643003", ...
0.0
-1
there are multiple ways to do this one, This is what I came up with while the interviewer guided me through this
def fizz_buzz_no_cons possible_fizz = [1, 0, 0] possible_buzz = [2, 0, 0, 0, 0] words = [None, "Fizz", "Buzz", "FizzBuzz"] n.times do |i| words[0] = i puts(words[possible_fizz[i%3] + possible_buzz[i%5]]) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def probers; end", "def who_we_are\r\n end", "def formation; end", "def schubert; end", "def anchored; end", "def stderrs; end", "def terpene; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def intensifier; end", "def identify; end"...
[ "0.6671798", "0.6447845", "0.63636583", "0.63035077", "0.62358487", "0.60044634", "0.5922552", "0.5913962", "0.5854542", "0.5854542", "0.5854542", "0.5854542", "0.58081615", "0.5761303", "0.57541853", "0.57027984", "0.56678987", "0.56678987", "0.5619919", "0.5583768", "0.5557...
0.0
-1
provides access to full_title setup a user
def setup @user = users(:michael) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def title\n object.user.full_name\n end", "def title\n if self.username != \"\" && !self.username.nil?\n self.username\n elsif self.first_name != \"\" && !self.first_name.nil?\n self.first_name\n else\n \"Anonymous\"\n end\n\n end", "def page_title(title, some_user=nil, model_na...
[ "0.752502", "0.71960604", "0.70621455", "0.69826674", "0.69826674", "0.69826674", "0.69719034", "0.6864489", "0.6789699", "0.6701373", "0.6696919", "0.6665212", "0.6660767", "0.66599286", "0.66459095", "0.6633496", "0.66135913", "0.6600513", "0.65802175", "0.65151966", "0.649...
0.0
-1
checks that rooms are available
def available? if @available_rooms.length > 0 return true end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rooms_available?\n return @available_rooms.length > 0\n end", "def room_availability_check\n if hotel_room.present? && !hotel_room.available?(check_in, check_out)\n errors.add(:hotel_room, \"is not available right now and booked already\")\n end\n end", "def availability_of_room\n ...
[ "0.8321142", "0.79922646", "0.7915131", "0.7872188", "0.7655834", "0.7499709", "0.73028463", "0.7283311", "0.72810364", "0.7165413", "0.71493065", "0.7119259", "0.7102394", "0.7030511", "0.70042366", "0.6982253", "0.6964776", "0.6941614", "0.69401157", "0.690752", "0.6906754"...
0.78100973
4
=== Get dam asset locations. Get an asset locations in dam. ==== Parameters options:: (Hash) List of Resource Collection Options shown above can be used as parameter. ==== Example
def get_dam_asset_locations(options) return @client.raw("get", "/content/dam/asset-locations", options) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dam_asset_locations(options)\n @client.raw('get', '/content/dam/asset-locations', options)\n end", "def get_locations\n response = execute_get(\"/reference/location\")\n Location.from_array(decode(response))\n end", "def locations\n get('locations')\n end", "def locations\n locati...
[ "0.8488438", "0.57955", "0.5677553", "0.55002034", "0.54844093", "0.54472375", "0.5442431", "0.5437008", "0.5427946", "0.53901917", "0.5362195", "0.53513926", "0.532409", "0.5278933", "0.52642304", "0.52588516", "0.523901", "0.5216819", "0.51875335", "0.51777947", "0.5163046"...
0.85243255
0
GET /meter_readings/1 GET /meter_readings/1.json
def show @meter_reading = MeterReading.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @meter_reading } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n\n @breadcrumb = 'read'\n @meter_detail = MeterDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meter_detail }\n end\n end", "def get_reading\n\t\turi = URI.parse('http://localhost:5000/thermometers.json...
[ "0.7321423", "0.7047203", "0.65984094", "0.6315445", "0.6308911", "0.62986785", "0.6194976", "0.6190155", "0.615303", "0.6105525", "0.6070515", "0.6067238", "0.6043172", "0.6040204", "0.601301", "0.5969378", "0.5967162", "0.59396607", "0.5920596", "0.59110016", "0.5902001", ...
0.72620803
1
GET /meter_readings/new GET /meter_readings/new.json
def new @meter_reading = MeterReading.new respond_to do |format| format.html # new.html.erb format.json { render json: @meter_reading } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @breadcrumb = 'create'\n @meter_detail = MeterDetail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meter_detail }\n end\n end", "def new\n @meter = Meter.new\n\n respond_to do |format|\n format.html # new.html.e...
[ "0.77021813", "0.7653779", "0.7373608", "0.7189721", "0.70060384", "0.69531983", "0.68428296", "0.6835296", "0.6794437", "0.6791819", "0.67398715", "0.67276716", "0.6721902", "0.6653376", "0.6624761", "0.66114044", "0.6595114", "0.6571319", "0.6571319", "0.6561486", "0.655079...
0.80487096
0
POST /meter_readings POST /meter_readings.json
def create @meter_reading = MeterReading.new(params[:meter_reading]) respond_to do |format| if @meter_reading.save format.html { redirect_to @meter_reading, notice: 'Meter reading was successfully created.' } format.json { render json: @meter_reading, status: :created, location: @meter_reading } else format.html { render action: "new" } format.json { render json: @meter_reading.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def meter_params\n params.require(:meter).permit(:start_date, :end_date, :readings)\n end", "def postReadings(info, state)\r\n params = {\r\n :device_id => info.deviceId,\r\n :sensor_data => [\r\n {\r\n :type => \"Temperature\",\r\n :value => state.temper...
[ "0.6986366", "0.66433454", "0.64047384", "0.6156628", "0.61117965", "0.6095345", "0.59844804", "0.5971278", "0.59347147", "0.5934574", "0.5878989", "0.5842113", "0.58334833", "0.57872504", "0.576797", "0.5757504", "0.57041776", "0.5680675", "0.5646113", "0.5633599", "0.563139...
0.645764
2
PUT /meter_readings/1 PUT /meter_readings/1.json
def update @meter_reading = MeterReading.find(params[:id]) respond_to do |format| if @meter_reading.update_attributes(params[:meter_reading]) format.html { redirect_to @meter_reading, notice: 'Meter reading was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @meter_reading.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @breadcrumb = 'update'\n @reading = Reading.find(params[:id])\n @meter = @reading.meter\n if !@meter.blank?\n # All associations\n @subscriber = Subscriber.find(params[:reading][:subscriber_id]) rescue nil\n @service_point = ServicePoint.find(params[:reading][:...
[ "0.65169436", "0.6498924", "0.6498924", "0.6389953", "0.6335035", "0.62145007", "0.61789846", "0.6128459", "0.61075324", "0.605506", "0.60500616", "0.6036591", "0.6012739", "0.6010731", "0.59051543", "0.5899968", "0.5878855", "0.5832523", "0.58069897", "0.5760235", "0.5757625...
0.6789502
0
DELETE /meter_readings/1 DELETE /meter_readings/1.json
def destroy @meter_reading = MeterReading.find(params[:id]) @meter_reading.destroy respond_to do |format| format.html { redirect_to meter_readings_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @meter = Meter.find(params[:id])\n @meter.destroy\n\n respond_to do |format|\n format.html { redirect_to meters_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @meter_detail = MeterDetail.find(params[:id])\n @meter_detail.destroy\n\n respo...
[ "0.71170205", "0.6979495", "0.6908651", "0.6817422", "0.67399347", "0.6729359", "0.66951615", "0.66951436", "0.66698533", "0.6635528", "0.6617531", "0.66143924", "0.65584147", "0.6533191", "0.6533191", "0.6508556", "0.6496336", "0.6466591", "0.64661485", "0.6452018", "0.64506...
0.7674331
0
This processes what messages to list down in the index page. It shows all of the messages that are linked to logged in account of the message chain.
def index @message_filter = MessageFilter.new(MessageFilter.params(params)) @messages, @pagination_collection = Message.list_paginated_messages(current_user, params[:page], @message_filter) # Determines when the find functionality is executed in index page of messages @on_filter_find = !params[:dashboard_message_filter].nil? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @messages = current_user.received_messages\n @messages = @messages.order(created_at: :desc)\n @messages = @messages.paginate(page: params[:page], per_page:5)\n @messages = @messages.to_a\n end", "def index\n @page_title = \"Messages\"\n @message_threads = MessageThread.related_to(c...
[ "0.70444006", "0.6871041", "0.687063", "0.6798259", "0.6724504", "0.67149884", "0.67110395", "0.67056376", "0.6670372", "0.6663025", "0.66606134", "0.6646532", "0.6619292", "0.6608783", "0.66083497", "0.66012573", "0.659117", "0.65744936", "0.6568933", "0.65548956", "0.652652...
0.67844665
4
This processes the message to find that was chosen from the list of messages from the index page and a list of messages that are related to it, by looking at their origin_id.
def show @message = Message.find(params[:smsg_refno], current_user) Rails.logger.debug { "Calling show method of (class) #{params[:smsg_refno]} with #{current_user}" } @message_filter = show_message_filter @messages, @pagination_collection = Message.list_paginated_messages(current_user, params[:page], @message_filter) # Don't show related messages if there is only one @messages = nil if @messages.count < 2 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n\n if params[:correspondent_id]\n\n correspondent = User.find params[:correspondent_id]\n\n if correspondent\n\n # ActiveRecord::Base.transaction do\n# http://www.codeatmorning.com/rails-transactions-complete-guide/\n @messages = Message.dialog_messages current_user....
[ "0.586511", "0.56085664", "0.5598736", "0.559142", "0.5560604", "0.5518947", "0.5472529", "0.5471836", "0.5470873", "0.5469023", "0.5441003", "0.54392374", "0.5435947", "0.54123384", "0.54076564", "0.53790736", "0.5366346", "0.53564024", "0.5350479", "0.53366214", "0.5324031"...
0.52733487
26
Processes some data to initially load up for the sending a message page. If it is a reply then carry over the :subject, :origin_id, :title and :reference.
def new @message = Message.initialise_message(current_user, params[:smsg_refno], params[:reference]) handle_file_upload(clear_cache: true) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_message_response\n # Is this email confirming receipt of a previous message? \n msg_id = find_message_id_tag(:subject=>@subject, :body=>@body)\n#puts \"**** body=#{@body}, msg_id=#{msg_id}\"\n if msg_id \n # Does the \"confirmed message\" id actually match a message?\n message = Mes...
[ "0.60446113", "0.59766436", "0.59035873", "0.57969266", "0.5790081", "0.57632834", "0.56634593", "0.56562066", "0.56248885", "0.56192535", "0.5607073", "0.5567959", "0.55288744", "0.55267274", "0.54932946", "0.5485423", "0.54658955", "0.5453976", "0.5422613", "0.54162836", "0...
0.0
-1
Processes what happens when the send button for the new page, which is the page related to sending a message
def create @message = Message.new(message_params) # Only handle a file upload if they can attach if can?(RS::AuthorisationHelper::CREATE_ATTACHMENT) render('new', status: :unprocessable_entity) && return if handle_file_upload(parent_param: :dashboard_message) @message.attachment = @resource_items[0] unless @resource_items.nil? end success, msg_refno = @message.save(current_user) # need to call return return redirect_to_confirmation_page(msg_refno) if success render('new', status: :unprocessable_entity) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_page\n send_message(\"page\")\n end", "def send_message\n current_div.button(:id=>\"send_message\").click\n wait_for_ajax\n end", "def message\n self.message_button\n self.wait_until { self.text.include? \"Send Message\" }\n self.class.class_eval { include SendMessagePopUp }\n end...
[ "0.7122466", "0.68793654", "0.630797", "0.62631035", "0.6167347", "0.6098462", "0.6009276", "0.59401083", "0.5923766", "0.58891904", "0.58891904", "0.5768818", "0.5707154", "0.5706173", "0.57035774", "0.56807506", "0.5665556", "0.5656763", "0.56310946", "0.56226903", "0.56070...
0.0
-1
Handle confirmation related message
def confirmation @message = Message.find(params[:smsg_refno], current_user) # Only handle a file upload if they can attach if can?(RS::AuthorisationHelper::CREATE_ATTACHMENT) && handle_file_upload(parent_param: :dashboard_message, before_add: :add_document, before_delete: :delete_document) render(status: :unprocessable_entity) else return unless params[:finish] # clear cache clear_resource_items redirect_to dashboard_messages_path end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confirm\n\n end", "def confirmation\n end", "def confirm\n end", "def confirm\n end", "def confirm!\n welcome_message\n super\n end", "def confirm!\n welcome_message\n super\n end", "def after_confirmation; end", "def after_confirmation\n end", "def confirm msg\n ...
[ "0.760117", "0.7553365", "0.74243987", "0.74243987", "0.7256388", "0.7256388", "0.721338", "0.7155406", "0.71505743", "0.7132966", "0.71259373", "0.70990705", "0.7088339", "0.70278484", "0.69140524", "0.68853956", "0.68735045", "0.6861199", "0.68300223", "0.6816729", "0.68099...
0.7174354
7
Call delete attachment method of message to delete document from backoffice
def delete_document(doc_refno) @message.delete_attachment(current_user, doc_refno) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n model.delete_attachment(@path)\n end", "def destroy_attachment\n a = Attachment.find(1) rescue nil\n if !a.nil?\n a.destroy\n end\n end", "def documentremove\n if self.documents.attached?\n document_urls = self.documents.map do |adoc| \n Rails.applic...
[ "0.768501", "0.71587837", "0.71533173", "0.713661", "0.7131105", "0.71274954", "0.70092916", "0.69691586", "0.6954067", "0.69525635", "0.69525635", "0.6822212", "0.6814294", "0.6794063", "0.6794063", "0.6794063", "0.6793872", "0.67922664", "0.67784137", "0.6775853", "0.677585...
0.76360685
1
Send document to back office
def add_document(resource_item) @message.add_attachment(current_user, resource_item, @message.smsg_refno) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_doc\n tpl = Template.find(params[\"template_id\"])\n tpl.load(params[:id])\n \n Notification.deliver_order_email(self, tpl)\n Notification.deliver_order_fax(self, tpl)\n \n log = OrderLog.create({\n :order_id => params[:id],\n :subject...
[ "0.7018109", "0.6892044", "0.6603079", "0.66014117", "0.65704465", "0.65088886", "0.64711136", "0.6430756", "0.62725306", "0.6247237", "0.624011", "0.6235759", "0.6207375", "0.62015903", "0.61902875", "0.6142413", "0.61187893", "0.61187893", "0.61187893", "0.61187893", "0.611...
0.0
-1
Retrieve file from backoffice
def retrieve_file_attachment return unless params[:doc_refno] || params[:type] success, attachments = retrieve_file_details_from_backoffice return unless success send_file_from_attachment(attachments[:attachment]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def retrieve_file_details_from_backoffice\n Message.retrieve_file_attachment(current_user, params[:doc_refno], params[:type])\n end", "def get\n file\n end", "def get_file(foreign_ref)\n set_client\n\n # return file data\n if service.downcase.include? \"dropbox\"\n begin\n ...
[ "0.82037985", "0.71418154", "0.6986108", "0.67921126", "0.6694361", "0.6694361", "0.6661249", "0.6661249", "0.6661249", "0.6661249", "0.66477317", "0.66423404", "0.6641619", "0.66347486", "0.66117734", "0.66040397", "0.66033584", "0.6547102", "0.65322673", "0.65019375", "0.64...
0.75429785
1
which file types are allowed to be uploaded.
def content_type_allowlist Rails.configuration.x.file_upload_content_type_allowlist.split(/\s*,\s*/) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_file_types\n Rails.configuration.allowed_file_types\n end", "def can_upload?\n klass.model_class && mime_types && mime_types.keys.include?(file_mime_type)\n end", "def supported(files)\n files.select { |f| SUPPORTED_TYPES.include?(f.extname.delete('.')) }\n end", "def accepted...
[ "0.8067096", "0.7317975", "0.7197458", "0.7190943", "0.6985637", "0.69696194", "0.69696194", "0.69696194", "0.69696194", "0.69696194", "0.69696194", "0.6968352", "0.6929568", "0.68622184", "0.67643386", "0.6759797", "0.67569244", "0.67030466", "0.6698979", "0.6690163", "0.666...
0.7837272
1
Retrieve download file details
def retrieve_file_details_from_backoffice Message.retrieve_file_attachment(current_user, params[:doc_refno], params[:type]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_file_details(id)\n uri = ENDPOINT + \"file/details/#{key}/#{id}\"\n data = JSON.parse(self.class.get(uri).body, :symbolize_names => true)\n Reach::Helper::convert_keys(data)\n end", "def get_downloaded_filename\n get_download_filename\n end", "def file_data\n @clien...
[ "0.70772684", "0.70181286", "0.69990486", "0.69918543", "0.68875283", "0.6881701", "0.68652993", "0.68099654", "0.6790346", "0.6790346", "0.67685795", "0.676332", "0.67304", "0.6717538", "0.66990966", "0.6696523", "0.6682615", "0.66624", "0.66470253", "0.6639929", "0.66306037...
0.69399625
4
Permits the access to the data passed on the .permit of :message objects
def message_params params.require(:dashboard_message).except(:resource_item) .permit(:original_smsg_refno, :subject_code, :subject_full_key_code, :reference, :title, :body, :attachment, :smsg_refno) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private_message_params\n params.require(:data)\n .require(:attributes)\n .permit(:from_user_id,\n :to_user_id,\n :message)\n end", "def direct_message_params\n params.fetch(:direct_message, {}).permit(:message)\n end", "d...
[ "0.696437", "0.6792286", "0.6745425", "0.6745425", "0.6745167", "0.6707139", "0.6691244", "0.6620308", "0.6573172", "0.656943", "0.65568537", "0.6548285", "0.6543146", "0.65392876", "0.65106845", "0.6493464", "0.6491131", "0.6465887", "0.6455464", "0.645496", "0.6447587", "...
0.0
-1
Used specifically for show method to filter message
def show_message_filter MessageFilter.new(selected_message_smsg_refno: @message.smsg_refno, smsg_original_refno: @message.original_smsg_refno) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n begin\n @message = Message.find(params[:id])\n rescue\n not_found and return\n end\n @message.visible_to = @message.flaggings.with_flag(:visible_to)\n @message.ip_info.gsub!(/,|:/, \"\\\\0 \").gsub!('\"\"', '(n/a)').gsub!(/\\{|\\}|\"/, \"\") unless @message.ip_info.nil?\n\n i...
[ "0.6923018", "0.6533215", "0.64087355", "0.6391774", "0.6131135", "0.6029347", "0.60043466", "0.59961784", "0.59619915", "0.59567344", "0.59397507", "0.5935453", "0.5902581", "0.5849988", "0.58453596", "0.5834901", "0.5834901", "0.5834901", "0.5817324", "0.5817324", "0.581732...
0.755372
0
This method will render the confirmation page if the message is successfully sent to backoffice
def redirect_to_confirmation_page(msg_refno) @message.smsg_refno = msg_refno # Need to clear the resource items for the initial submission clear_resource_items redirect_to confirmation_dashboard_message_path(smsg_refno: msg_refno) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confirmation\n @message = Message.find(params[:smsg_refno], current_user)\n # Only handle a file upload if they can attach\n if can?(RS::AuthorisationHelper::CREATE_ATTACHMENT) &&\n handle_file_upload(parent_param: :dashboard_message, before_add: :add_document,\n ...
[ "0.73833966", "0.7003299", "0.6925078", "0.67944276", "0.67355406", "0.66665536", "0.66665536", "0.6629653", "0.65699816", "0.6552889", "0.6529309", "0.6528726", "0.6514689", "0.65136397", "0.6477428", "0.6432412", "0.6427723", "0.640651", "0.6386832", "0.6362813", "0.6355229...
0.690799
3
"XForwardedFor: A.B.C.D" "XForwardedFor: A.B.C.D[,X.X.X.X,Y.Y.Y.Y,]"
def forwarded_for @forwarded_for ||= IPs.parse(@headers[HTTP_X_FORWARDED_FOR]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remote_addr_header; end", "def src_addr_on_header\n request.headers['X-Forwarded-For'] || request.headers['REMOTE_ADDR']\n end", "def setup_forwarded_info\n if @forwarded_server = self[\"x-forwarded-server\"]\n @forwarded_server = @forwarded_server.split(\",\", 2).first\n end\n @...
[ "0.5905314", "0.5751761", "0.5623776", "0.56008077", "0.55483323", "0.55411154", "0.54894924", "0.54445964", "0.5443918", "0.53129387", "0.52926993", "0.5288449", "0.52884346", "0.52101266", "0.5164882", "0.5152987", "0.51217085", "0.51126593", "0.5108088", "0.5108053", "0.50...
0.55946916
4
Headers that relate to Cloudflare See:
def target_headers @headers.select { |k, _| ALL.include? k } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request_headers; end", "def request_headers; end", "def headers; end", "def headers; end", "def headers; end", "def headers; end", "def headers; end", "def headers; end", "def headers; end", "def headers; end", "def headers; end", "def headers; end", "def headers\n {'User-Agent': '...
[ "0.72104156", "0.72104156", "0.7115704", "0.7115704", "0.7115704", "0.7115704", "0.7115704", "0.7115704", "0.7115704", "0.7115704", "0.7115704", "0.7115704", "0.70056367", "0.69685644", "0.69685644", "0.69511425", "0.69076234", "0.6886131", "0.67775846", "0.6764977", "0.67431...
0.0
-1
Indicates if the headers passed through Cloudflare
def trusted? @trusted ||= IPs.list.any? { |range| range.include? cloudflare_ip } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_header\n !request.env[\"HTTP_X_ACCESS_TOKEN\"].nil?\n end", "def headers?\n @headers.empty?\n end", "def return_headers?() @return_headers end", "def http_header?(name)\n name.start_with?(\"HTTP\") && !HTTP_NON_HEADERS.include?(name)\n end", "def head?\r\nHTTP_METHOD_LOOKU...
[ "0.7110719", "0.70624405", "0.69417554", "0.6782415", "0.6735232", "0.67330664", "0.6688704", "0.66571236", "0.66571236", "0.66298324", "0.6608161", "0.66019243", "0.6595052", "0.6577575", "0.6567616", "0.65295726", "0.64605343", "0.6456624", "0.6455155", "0.6454016", "0.6373...
0.0
-1
get response data will try one more time if code == ''
def retrieve_response(url) response = response(url) response = response(url) unless response[:code].present? response end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def response_code; end", "def response_code; end", "def response_code; end", "def response_code; end", "def check_response\n unless (res = get).valid?\n raise BadResponse, \"#{res.code} #{res['Code'].first}\"\n end\n\n res\n end", "def code\n response&.code\n ...
[ "0.65786237", "0.65786237", "0.65786237", "0.65786237", "0.6546314", "0.6406201", "0.64055943", "0.63843375", "0.62463576", "0.6159091", "0.6107313", "0.61035013", "0.60928273", "0.6054124", "0.6048303", "0.60312253", "0.60242736", "0.6017356", "0.60102767", "0.59821516", "0....
0.6256933
8
Do check status via http request
def response(url) result = {} response = RestClient.get(url, headers={}) result[:headers] = response.try(:headers) result[:code] = response.try(:code) result[:body] = response.try(:body) rescue SocketError => e Rails.logger.debug "#{e.to_s}" rescue RuntimeError => e Rails.logger.debug "#{e.to_s}" result[:code] = find_code e.to_s ensure return result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status\n @logger.info \"Checking status of #{@url}\"\n @stubbornly.retry(timeout: 10, attempts: 4) do\n HTTP.get(@url).code.tap do |result|\n @logger.info \"Result is #{result}\"\n end\n end\n end", "def status\n HTTParty.get(base_request_uri)\n end", "def healthcheck\n ...
[ "0.72256815", "0.71626276", "0.70871854", "0.70871854", "0.7029031", "0.70253974", "0.7004673", "0.69911677", "0.6965632", "0.69602454", "0.6959443", "0.6933991", "0.69163775", "0.6909888", "0.6909888", "0.689997", "0.6893301", "0.68677527", "0.6863247", "0.68231696", "0.6808...
0.0
-1
GET /pm/nodes GET /pm/nodes.json
def index @pm_nodes = Pm::Node.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nodes\r\n params = {\r\n method: :get,\r\n url: '/project/nodes',\r\n params: { prjUUID: @uuid }\r\n }\r\n @session.request(**params).perform!['nodes']\r\n end", "def __get_nodes\n JSON.parse(Net::HTTP.get(URI(\"#{__cluster_url}/_nodes/process\")))\n ...
[ "0.8072754", "0.805417", "0.76213354", "0.71823525", "0.7097894", "0.7081271", "0.7008946", "0.69134665", "0.6875637", "0.6854058", "0.68437654", "0.6720143", "0.6696069", "0.6689263", "0.66603553", "0.665606", "0.6611148", "0.65797365", "0.6564327", "0.6564327", "0.6482083",...
0.7469143
3
GET /pm/nodes/1 GET /pm/nodes/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __get_nodes\n JSON.parse(Net::HTTP.get(URI(\"#{__cluster_url}/_nodes/process\")))\n end", "def nodes\r\n params = {\r\n method: :get,\r\n url: '/project/nodes',\r\n params: { prjUUID: @uuid }\r\n }\r\n @session.request(**params).perform!['nodes']\r\n ...
[ "0.7534184", "0.7384993", "0.71133196", "0.68533635", "0.6852087", "0.66408205", "0.6572738", "0.656783", "0.6509809", "0.6448845", "0.6413468", "0.6358714", "0.63061637", "0.6267034", "0.6267034", "0.6267034", "0.6267034", "0.6267034", "0.62515384", "0.6250215", "0.6203045",...
0.0
-1
POST /pm/nodes POST /pm/nodes.json
def create @pm_node = Pm::Node.new(pm_node_params) respond_to do |format| if @pm_node.save format.html { redirect_to @pm_node, notice: 'Node was successfully created.' } format.json { render :show, status: :created, location: @pm_node } else format.html { render :new } format.json { render json: @pm_node.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def method_missing(method, *args, &block)\n data = { method: method, parameters: args }\n request.post(path: nodes_path, data: data, auth_token: auth_token)\n end", "def create_nodes(nodes)\n nodes.each do |node|\n (raise CloudLB::Exception::MissingArgument, \"Must provide :address for a...
[ "0.7167608", "0.6996519", "0.69445604", "0.68515563", "0.68202585", "0.6769154", "0.67286754", "0.66552764", "0.66552764", "0.66552764", "0.6629944", "0.66239005", "0.65775156", "0.65345186", "0.65146667", "0.64988273", "0.64807045", "0.6459999", "0.64433324", "0.6435111", "0...
0.7191648
0
PATCH/PUT /pm/nodes/1 PATCH/PUT /pm/nodes/1.json
def update respond_to do |format| if @pm_node.update(pm_node_params) format.html { redirect_to @pm_node, notice: 'Node was successfully updated.' } format.json { render :show, status: :ok, location: @pm_node } else format.html { render :edit } format.json { render json: @pm_node.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n authorize! :manage, @node\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to @node, notice: 'Node was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n ...
[ "0.6675063", "0.6586168", "0.6581259", "0.65767145", "0.65767145", "0.65767145", "0.65448654", "0.65425414", "0.6540101", "0.6540101", "0.6540101", "0.6479884", "0.64760935", "0.6446388", "0.6410545", "0.6367041", "0.634948", "0.6241918", "0.62344617", "0.6227126", "0.6224563...
0.69978875
0
DELETE /pm/nodes/1 DELETE /pm/nodes/1.json
def destroy @pm_node.destroy respond_to do |format| format.html { redirect_to pm_nodes_url, notice: 'Node was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @node = Node.find_key(params[:id] || params[:name])\n @node.destroy\n respond_to do |format|\n format.html { redirect_to deployment_path(@node.deployment_id) }\n format.json { render api_delete @node }\n end\n end", "def destroy\n chef_server_rest.delete(\"nodes/#{name}\...
[ "0.7258929", "0.725263", "0.71837646", "0.71633816", "0.7111229", "0.71105987", "0.71105987", "0.71105987", "0.70422876", "0.7019231", "0.69978327", "0.6996421", "0.69772583", "0.6964292", "0.6924297", "0.69151676", "0.69066286", "0.68442446", "0.6842221", "0.6842221", "0.684...
0.7406122
0
Use callbacks to share common setup or constraints between actions.
def set_pm_node @pm_node = Pm::Node.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def pm_node_params params.require(:pm_node).permit(:percent, :content, :name, :plan_id, :sort_seq, :start_date, :end_date) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
Perform Author:Aman Date: 31/10/2017 Reviewed By: Kedar
def perform _perform do update_token_sale_ended_data end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def submission_decision_author(submission)\n @submission = submission\n\n @authors_text = @submission.get_authors_submitted.map{ |a| a.full_name }.join(', ')\n @title_text = @submission.get_text_submitted.title rescue ''\n\n @journal = @submission.journal\n @user = @submission.us...
[ "0.57090974", "0.5470896", "0.5362092", "0.5340645", "0.5337601", "0.5300116", "0.5284581", "0.5282038", "0.5269437", "0.52436936", "0.5153369", "0.5153369", "0.513956", "0.51183546", "0.5096341", "0.5082339", "0.50735414", "0.5069931", "0.5061169", "0.50330573", "0.5009601",...
0.0
-1
Update token sale ended variable Author:Aman Date: 31/10/2017 Reviewed By: Kedar
def update_token_sale_ended_data sale_variable_obj = SaleGlobalVariable.sale_ended.first sale_variable_obj.variable_data = '1' sale_variable_obj.save! end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_token\n update_columns(token: set_token, updated_at: Time.current)\n end", "def new_token\n update_columns(token: set_token, updated_at: Time.current)\n end", "def perform\n _perform do\n update_token_sale_ended_data\n end\n end", "def update_token(token)\n DB[:Toke...
[ "0.6041524", "0.6040474", "0.6026158", "0.58346725", "0.57031304", "0.556283", "0.55573416", "0.5529503", "0.55120885", "0.54810435", "0.54792607", "0.54792607", "0.54490316", "0.539904", "0.53811127", "0.5368417", "0.535266", "0.5350358", "0.53451127", "0.53348583", "0.53060...
0.7427053
0
Sends a message to the listener instance
def send_message(message) message_uuid = @uuid.generate message = "#{message_uuid}\t" + message.join("\t") message_sent = false until message_sent unless is_locked? request_file lock_file request_file open(request_file, "a") do |file| file.write("#{message}\n") end unlock_file request_file message_sent = true end break if message_sent sleep (0.06) end response = false until response response = retrieve_response message_uuid break if response sleep (0.06) end response end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_message(message)\n @networking.send_message(message)\n end", "def send_message(message); end", "def send_message(message); end", "def send_message(msg); end", "def send_message( msg )\n @session.send_message msg\n self\n end", "def send_message msg\n timeline ...
[ "0.662796", "0.6553952", "0.6553952", "0.6512548", "0.6495877", "0.64861214", "0.6461321", "0.645963", "0.64402014", "0.639431", "0.63908464", "0.632898", "0.62991273", "0.6298751", "0.62520933", "0.6222563", "0.6222563", "0.6199915", "0.61985916", "0.61973655", "0.6189569", ...
0.0
-1
Starts the listener thread
def listen Thread.new do while true retrieve_messages sleep (0.1) end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start\n subscribe &Proc.new { |message| listener(message) }\n end", "def listen\n if @listener.nil? then\n @listener = Thread.new do\n loop do\n \t\t\t#sleep(0.001) # Why windows needs this, i don't know.\n @buffer = getd\n\t\t\t Thread.pass\n end\n ...
[ "0.75598377", "0.7471054", "0.74470514", "0.7335808", "0.71491206", "0.71286696", "0.7108812", "0.7096337", "0.7096337", "0.70209634", "0.6966214", "0.69304496", "0.68993425", "0.6802867", "0.6770113", "0.67640936", "0.6739892", "0.6738903", "0.67346644", "0.67219144", "0.672...
0.68614954
13
Parses a request retrieved via retrieve_messages() and sends the response back to the requester instance
def parse_request request request_uuid = request.shift request_method = request.shift begin request_response = @notifier_engine.process_input request_method.to_sym, request rescue => exc request_response = "#{exc.class}: #{exc.message}" end send_response request_uuid, request_response end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start request\n if request['method']\n message = Message.select(request['method']).new(self, request)\n begin\n message.process\n rescue Exception => e\n STDERR.puts e.message\n STDERR.puts e.backtrace\n message.set_error Solargraph:...
[ "0.6402019", "0.62466466", "0.62109023", "0.613401", "0.60234195", "0.60060793", "0.59601325", "0.595463", "0.59411806", "0.5917576", "0.5911113", "0.59066725", "0.59063053", "0.58897066", "0.58844393", "0.58698285", "0.5863208", "0.5856833", "0.5852034", "0.5840984", "0.5809...
0.6112192
4
Checks the requests file to see if any requests have been sent to the listener
def retrieve_messages if FileTest::file? request_file and not is_locked? request_file lock_file request_file requests = File.read(request_file).split("\n") requests.each do |request| @notifier_engine.log "New request: #{request}" parse_request request.split("\t") end open(request_file, 'w') {} unlock_file request_file end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_requests\n if requests.empty?\n errors.add('requests', 'there were no requests')\n return\n end\n\n requests.each do |request|\n next if request.valid?\n\n request.errors.each do |k, v|\n errors.add(k, v)\n end\n end\n ...
[ "0.67491055", "0.6583199", "0.641747", "0.6162272", "0.6092249", "0.5817395", "0.5789131", "0.57797474", "0.5767393", "0.576585", "0.5745202", "0.56806356", "0.56625915", "0.5620641", "0.56126624", "0.559842", "0.559842", "0.55726814", "0.5480182", "0.5438931", "0.5437941", ...
0.644935
2