query
stringlengths
7
6.41k
document
stringlengths
12
28.8k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Override this method so that we can provide a fake file name. Several views depend on the datastream label, which is just the the original_filename of the file. This allows you to effectively change what label is displayed in those views. Otherwise, you will see the same label for every file.
def original_filename fake_file_name || super end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_name\n self.name ||= File.basename(data_file.filename, '.*').titleize if data_file.filename && !self.name\n end", "def filename= name\n #This is a stub, used for indexing\n end", "def label_for(file)\n if file.is_a?(Hyrax::UploadedFile) # filename not pres...
[ "0.68464684", "0.6685372", "0.6605989", "0.65241575", "0.65241575", "0.6507999", "0.6501411", "0.64688045", "0.64307356", "0.64101726", "0.64101726", "0.6382542", "0.62657756", "0.6256786", "0.62493485", "0.62307256", "0.6227845", "0.6227813", "0.6227725", "0.6198651", "0.619...
0.7238634
0
Creates or finds an object by id. If an actor is given, will use the actor to create the object. Otherwise, will just use the new method on the model given
def find_or_create(model, actor, id, user, params) curation_concern = model.where(desc_metadata__identifier_tesim: id).first if curation_concern.nil? curation_concern = model.new(identifier: id) if actor.present? actor.new(curation_concern, user, params).create else curation_concern.attribut...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_or_create( id )\n begin\n get( id )\n rescue\n create!( :id => id )\n end \n end", "def set_actor\n @actor = Actor.find(params[:id])\n end", "def get_object\n class_name.create_from_database(id)\n end", "def set_actor\n ...
[ "0.6491675", "0.6340175", "0.62531507", "0.6214431", "0.6214431", "0.6214431", "0.6080644", "0.6033748", "0.5943735", "0.5898148", "0.58860064", "0.58745116", "0.58000165", "0.57822293", "0.57809085", "0.5729493", "0.57106215", "0.56893176", "0.5664932", "0.5632625", "0.56208...
0.64547354
1
Creates or finds a library collection by description. If an actor is given, will use the actor to create the object. Otherwise, will just use the new method on the model given
def find_or_create_library_collection(description, user, params) collection = LibraryCollection.where(desc_metadata__description_tesim: description).first if collection.nil? collection = LibraryCollection.new collection.attributes = params collection.apply_depositor_metadata(user.user_key) collectio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_collection\n Models::Collection.new\n end", "def find_or_create_collection(collection)\n\t # collection is response from sohpify api\n\t\tc = collections.find_by_shopify_collection_id(collection.id)\n \tRails.logger.debug(\"Found existing collection (#{collection.class.name}): #{c.title}...
[ "0.55714256", "0.5533466", "0.55154943", "0.5514012", "0.54876447", "0.5331431", "0.53138965", "0.52313167", "0.52232236", "0.52202266", "0.5167979", "0.515217", "0.51007354", "0.49806887", "0.49253234", "0.4910403", "0.49039218", "0.49008265", "0.4878139", "0.48753464", "0.4...
0.6880261
0
Checkin date should not be less than today's date.
def checkin_at_after_or_on_today return if dates_blank if checkin_at < Date.today self.errors.add(:checkin_at, ": Should be greater than or equal to today's date") end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_in_cannot_be_in_the_past\n if check_in.present? && check_in < Date.today\n errors.add(:check_in, \"can't be in the past\")\n end\n end", "def checkout_before_checkin\n errors.add(:guest_id, \"Check out date must be before Check In date\") if checkin != nil && checkout != nil && checkout ...
[ "0.7624395", "0.7586155", "0.7478645", "0.7250873", "0.72344786", "0.72283113", "0.7192968", "0.7068701", "0.699601", "0.6960622", "0.6960622", "0.68803966", "0.6801893", "0.67565036", "0.6746318", "0.67265224", "0.6720884", "0.67051125", "0.666174", "0.66460663", "0.6625849"...
0.7987446
0
Restriction to book only upto 6 months. User can do checkin within 6 months. Checkout is not restricted.
def checkin_before_6_months return if dates_blank if checkin_at >= (Date.today + 6.months) self.errors.add(:checkin_at, ': Should be less than or equal to 6 months') end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_period_for_room_reservation\n time_period = (self.start_date.year * 12 + self.start_date.month) - (Date.today.year * 12 + Date.today.month)\n errors.add(:start_date, \"you can book your room before 6 months only\") if time_period > 6\n end", "def bookable?(date)\n date < booking_date_limit\n ...
[ "0.65613383", "0.6254185", "0.61772865", "0.58629364", "0.5851184", "0.58436793", "0.581441", "0.5775874", "0.5738204", "0.573172", "0.571981", "0.57090956", "0.5690138", "0.567225", "0.56311065", "0.56303257", "0.56210506", "0.56154925", "0.5610927", "0.56055796", "0.5603714...
0.6652991
0
Checks if the system is properly setup. This method is used by the bootstrapper to see if the system should be initialized. If the system is not properly setup, the bootstrapper will crash. Checks are performed to see if all the tables exists.
def check unless check_tables puts "CBAC: not properly initialized: one or more tables are missing. Did you install it correctly? (run generate)" return false end return true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialized?\r\n if ENV[\"RAILS_ENV\"] == \"test\" || !User.table_exists? || $setup_disabled \r\n return false\r\n else \r\n $tmp_env = ENV[\"RAILS_ENV\"] || \"development\"\r\n return true\r\n end \r\n end", "def sanityCheck\n @executor.nil? and raise \"Executor has not been ...
[ "0.7000241", "0.639725", "0.62109065", "0.61498785", "0.6081087", "0.59626234", "0.59558016", "0.59019995", "0.59019995", "0.5891363", "0.58892536", "0.58763915", "0.586858", "0.5817226", "0.5798799", "0.5797024", "0.57703197", "0.5764787", "0.57598954", "0.5753579", "0.57528...
0.7547931
0
get counts of various records belonging to a repository
def get_counts(repo_uri) types = %w(pui_collection pui_archival_object pui_record_group pui_accession pui_digital_object pui_agent pui_subject) counts = archivesspace.get_types_counts(types, repo_uri) # 'pui_record' as defined in AppConfig ('record_badge') is intended for archival objects only, # which ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count\n size = 0\n core_search.group(\"name.id, #{main_group_by_columns}\").each do |_x|\n size += 1\n end\n size\n end", "def project_counts\n @project_counts ||= Kithe::Model.joins(:contains_contained_by).\n where(published: true, contains_contained_by: {container_id: project_...
[ "0.68711966", "0.6806252", "0.677834", "0.6774241", "0.6767395", "0.6765067", "0.67167723", "0.67054987", "0.6692752", "0.665436", "0.6565099", "0.6556102", "0.6518391", "0.6428198", "0.640877", "0.6387814", "0.63485754", "0.63485754", "0.6326861", "0.6313247", "0.6310123", ...
0.6806599
1
find a team's updated events, for the schedule.
def updated_events(team) return team.future_events if team.schedule_last_sent.nil? team.future_events.select do |event| !event.last_edited.nil? && event.last_edited > team.schedule_last_sent end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def schedule_updated(app_event)\n team = app_event.obj\n return [] unless team.schedule_updates? \n event_ids = team.updated_events.map(&:id)\n generate_nis(app_event, \"schedule_updated\", event_ids)\n end", "def create_or_update_google_calendar_events\n client = Google::Apis::Calenda...
[ "0.6999584", "0.603998", "0.59195554", "0.5888743", "0.58881843", "0.58482814", "0.5760947", "0.56692815", "0.56352264", "0.56202865", "0.5536202", "0.55358547", "0.55117476", "0.5509245", "0.547375", "0.5459001", "0.5457908", "0.5454145", "0.54526347", "0.54355556", "0.54353...
0.8029248
0
Render straight markdown partial templates. As no ruby will be evaluated the locals and content block will be ignored.
def partial(template_name, locals, &content) self.kramdown_source.render(template_name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def partial(page, locals={})\n haml page, {:layout => false}, locals\n end", "def render_md page, content\n markdown(content || self.body) # HACK\n end", "def render_md page, content\n markdown(content || self.body) # HACK\n end", "def partial(template, locals = {})\n haml(template, { layout: ...
[ "0.7001233", "0.6778516", "0.6778516", "0.67237145", "0.6688345", "0.6688345", "0.6649767", "0.66445214", "0.6524422", "0.6524422", "0.6514172", "0.6492352", "0.642148", "0.642148", "0.6387135", "0.6384678", "0.6332803", "0.63063526", "0.6269621", "0.6229147", "0.61983186", ...
0.7253534
0
check if chapter is completed
def completed?(chapter) chapters_completed.include? chapter end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_chapter?()\n end", "def whole_chapter?\n starting_bibleverse.verse.zero?\n end", "def whole_book?\n starting_bibleverse.chapter.zero?\n end", "def chapter_valid?(chapter)\n chapter.positive? && chapter <= nr_of_chapters\n end", "def chapters?\n !chapters.empty?\n end", "def ...
[ "0.7454416", "0.7354883", "0.7082739", "0.6996206", "0.69689006", "0.6820225", "0.67828554", "0.6707823", "0.6693948", "0.66886413", "0.66775817", "0.66647863", "0.6630133", "0.6594676", "0.65755224", "0.6534223", "0.65311223", "0.64830786", "0.644937", "0.6446057", "0.644072...
0.82123095
0
calculate progress of lesson
def progress(lesson) "%0.2f%" % (chapters_completed.where(lesson: lesson).count / lesson.chapters.count.to_f * 100) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def progress\n total_steps_count = self.steps.count\n\n if total_steps_count.zero?\n 0.0\n else\n approved_steps_count = self.steps.where(state: 'approved').count\n (approved_steps_count * 100.0 / total_steps_count).round(2)\n end\n end", "def calc_progress\n p = 0.25\n unless s...
[ "0.771072", "0.7305538", "0.726116", "0.71067166", "0.70205104", "0.6955883", "0.69348335", "0.6862262", "0.6855532", "0.6753974", "0.6659185", "0.6659185", "0.6659185", "0.6652969", "0.6642433", "0.66372055", "0.6595403", "0.6595403", "0.6595403", "0.6595403", "0.6595403", ...
0.8135817
0
set role to student prior to initial registration
def ensure_there_is_a_role if role.blank? self.role = "student" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_default_role\n self.role ||= :student\n end", "def set_default_role\n self.role ||= :student\n end", "def set_role\n return if role?\n\n self.role = 'regular'\n end", "def assign_role\n self.role = Role.find_by name: \"Regular\" if self.role.nil?\n end", "def set_initial_role\n ...
[ "0.76837623", "0.76837623", "0.7334064", "0.72828394", "0.7263591", "0.7050061", "0.70451283", "0.70170414", "0.694737", "0.6940768", "0.6921373", "0.692065", "0.691259", "0.691259", "0.691259", "0.6871036", "0.68561524", "0.685213", "0.68275684", "0.6790663", "0.6779628", ...
0.81538695
0
Returns the current context for this thread, or nil if none exists.
def current all_contexts[Thread.current.object_id] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def context\n Thread.current[:ctx] ||= {}\n Thread.current[:ctx]\n end", "def thread_context\n Thread.current[:runshell_context] ||= Context.new(main_context.to_h)\n end", "def context\n Thread.current[NAME] ||= Hash.new\n end", "def context\n self.current_custom_context || ...
[ "0.7655154", "0.6975651", "0.6944315", "0.6748186", "0.6727816", "0.65430796", "0.6531631", "0.6488136", "0.6460435", "0.64238375", "0.63846403", "0.63006943", "0.62653214", "0.62554944", "0.62480384", "0.6219154", "0.6214809", "0.62039614", "0.6193466", "0.61918724", "0.6174...
0.76682615
0
Assigns a context instance to the current thread.
def current=(context) all_contexts[Thread.current.object_id] = context end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def local=(ctx)\n Thread.current[@key] = ctx\n end", "def thread_context\n Thread.current[:runshell_context] ||= Context.new(main_context.to_h)\n end", "def context\n Thread.current[:ctx] ||= {}\n Thread.current[:ctx]\n end", "def context=(ctx)\n @context.local = ctx\n end", ...
[ "0.68504316", "0.6741534", "0.6576933", "0.6523754", "0.64893126", "0.6470508", "0.63716793", "0.633284", "0.62927586", "0.62610793", "0.6169457", "0.61591464", "0.612363", "0.6121851", "0.6097193", "0.6097007", "0.6081057", "0.6069125", "0.60365206", "0.6027005", "0.6010464"...
0.67486894
1
Clears the assigned context for the current thread.
def clear_current all_contexts.delete(Thread.current.object_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_context\n @current_context = nil\n end", "def clear\n context.clear if Thread.current[NAME]\n self\n end", "def clear\n context.clear if Thread.current[NAME]\n self\n end", "def clear!\n context_manager.clear!\n end", "def reset_context\n @context = ni...
[ "0.8428168", "0.81905293", "0.81905293", "0.7738027", "0.7592086", "0.7390783", "0.7390783", "0.73234934", "0.7300959", "0.7300959", "0.72644985", "0.72190547", "0.72048604", "0.6845888", "0.67057955", "0.663552", "0.65859765", "0.63439965", "0.6276657", "0.621809", "0.603469...
0.821916
1
cmd[0] : name of currNode cmd[1] : name of destNode cmd[2] : ip of currNode cmd[3] : time edge was made
def edgeb_network(cmd) node = $node_info.new $lock.synchronize{ node.src = $hostname node.dst = cmd[1] node.cost = 1 node.nexthop = cmd[1] $rt[cmd[1]] = node if $local_ip == nil then $local_ip = cmd[2] end $network.undir_connection($hostname, c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edgeu(cmd)\n $dist[cmd[0]] = cmd[1].to_i\n $neighbors[cmd[0]] = cmd[1].to_i\n client = $clients[cmd[0]]\n msg = Msg.new\n msg.setConfig(\"type\", 2)\n msg.setMessage($hostname + \" \" + cmd[1].to_i.to_s)\n sendMessage(client, msg)\n fillInNodes()\nend", "def edgeu(cmd)\n time = nil\n $lock.sync...
[ "0.6386743", "0.6305659", "0.6026351", "0.60089004", "0.5930569", "0.57697797", "0.56592053", "0.5602687", "0.5590002", "0.55648386", "0.55371714", "0.5525014", "0.545143", "0.5281572", "0.5271316", "0.5220897", "0.5171023", "0.516839", "0.5148021", "0.5145073", "0.5144903", ...
0.6612269
0
cmd[0] : DEST cmd[1] : COST
def edgeu(cmd) time = nil $lock.synchronize{ time = $clock.to_i $network.update_cost($hostname, cmd[0], cmd[1].to_i, time) if $rt.has_key? cmd[0] $rt[cmd[0]][:cost] = cmd[1].to_i end } client = TCPSocket.open($local_ip, $nodesFile[cmd[0]]["PORT"]) client...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edgeu_network(cmd)\n $lock.synchronize{\n $network.update_cost($hostname, cmd[0], cmd[1].to_i,cmd[2].to_i)\n \n if $rt.has_key? cmd[0]\n $rt[cmd[0]][:cost] = cmd[1].to_i\n end\n }\nend", "def command(cmd, arg = 2)\n return if @sp == nil\n #<SOT><CMD_BYTE><...
[ "0.58614534", "0.56380147", "0.55545676", "0.5505499", "0.5289272", "0.52743083", "0.5253263", "0.52382857", "0.5230898", "0.5194175", "0.5187378", "0.51801586", "0.5164179", "0.51584613", "0.51559526", "0.51432997", "0.51432997", "0.5137132", "0.5135012", "0.512023", "0.5099...
0.61732787
0
cmd[0] : DEST cmd[1] : COST cmd[2] : Time of updated edge
def edgeu_network(cmd) $lock.synchronize{ $network.update_cost($hostname, cmd[0], cmd[1].to_i,cmd[2].to_i) if $rt.has_key? cmd[0] $rt[cmd[0]][:cost] = cmd[1].to_i end } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edgeu(cmd)\n time = nil\n $lock.synchronize{\n time = $clock.to_i\n $network.update_cost($hostname, cmd[0], cmd[1].to_i, time)\n\n if $rt.has_key? cmd[0]\n $rt[cmd[0]][:cost] = cmd[1].to_i\n end\n } \n\n client = TCPSocket.open($local_ip, $nodesFile[cmd[0]][\"P...
[ "0.75870264", "0.678527", "0.6460501", "0.61730546", "0.6092415", "0.58193505", "0.57349604", "0.55861866", "0.55764824", "0.5494816", "0.537581", "0.529418", "0.529418", "0.529418", "0.5195012", "0.51921046", "0.5174208", "0.5133308", "0.5125066", "0.5058883", "0.5056944", ...
0.714894
1
GET /liners GET /liners.json
def index @liners = Liner.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @trainer = Trainer.find(params[:id])\n\n render json: @trainer.as_json(only: [:name], include: [:trainees])\n end", "def index\n @litters = Litter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @litters }\n end\n end", "def index...
[ "0.6039168", "0.58767325", "0.58016515", "0.57443225", "0.57294405", "0.5728215", "0.5728215", "0.5728215", "0.5728215", "0.5711922", "0.5696984", "0.5663344", "0.5617804", "0.5560731", "0.5555264", "0.55024165", "0.5497077", "0.5494845", "0.5459527", "0.5457283", "0.5456509"...
0.704166
0
POST /liners POST /liners.json
def create company_name = params[:liner][:company_name] company = Company.find_or_create_by name: company_name @liner = company.liners.new(liner_params) respond_to do |format| if @liner.save format.html { redirect_to @liner, notice: 'Liner was successfully created.' } format.json ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n p'*'*800\n p params\n\n @trainer = Trainer.new(trainer_params)\n\n p @trainer\n\n if @trainer.save\n render json: @trainer, status: :created, location: @trainer\n else\n render json: @trainer.errors, status: :unprocessable_entity\n end\n end", "def create\n @line_l...
[ "0.6214964", "0.5854367", "0.5851985", "0.5804397", "0.57401246", "0.5656456", "0.5631725", "0.5631725", "0.55973405", "0.54875636", "0.54869634", "0.54577047", "0.54260683", "0.5419705", "0.541122", "0.54039025", "0.53778136", "0.53751636", "0.5367665", "0.5345483", "0.53257...
0.64722174
0
PATCH/PUT /liners/1 PATCH/PUT /liners/1.json
def update respond_to do |format| liner = Liner.find_by(liner_reference: liner_params["liner_reference"]) original_thickness = liner.original_thickness.to_i current_thickness = liner_params["current_thickness"].to_i thickness_loss_per_day = original_thickness - current_thickness liner_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch!\n request! :patch\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def update\n @line = Line....
[ "0.63021463", "0.6240131", "0.62213457", "0.6167319", "0.6144966", "0.61180913", "0.60936266", "0.60936266", "0.60729194", "0.6064583", "0.6004544", "0.5993123", "0.5982784", "0.59353393", "0.59270674", "0.5896436", "0.58894765", "0.5865916", "0.5860658", "0.5841712", "0.5834...
0.6334987
0
DELETE /liners/1 DELETE /liners/1.json
def destroy @liner.destroy respond_to do |format| format.html { redirect_to liners_url, notice: 'Liner was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @line = Line.find(params[:id])\n @line.destroy\n\n respond_to do |format|\n format.html { redirect_to new_line_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @line_item1 = LineItem1.find(params[:id])\n @line_item1.destroy\n\n respond_to do |fo...
[ "0.6721495", "0.6701221", "0.66580856", "0.6639705", "0.65312654", "0.6512321", "0.64748347", "0.6471383", "0.64278835", "0.64278835", "0.6427347", "0.64245266", "0.64131874", "0.64053595", "0.6404969", "0.6404969", "0.6404969", "0.6404969", "0.63895476", "0.63891643", "0.635...
0.71730655
0
Tabulation Min cost for a stair is the min for either of the last 2, plus itself O(N) time, O(N) space (table)
def min_cost_climbing_stairs(cost) cost = cost + [0] table = Array.new(cost.length) { nil } table[0] = cost[0] table[1] = cost[1] table.each_with_index do |_val, i| next if i < 2 table[i] = [table[i-1], table[i-2]].min table[i] += cost[i] end table.last end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min_cost(stairs)\n min_step_cost = [stairs[0], stairs[1]]\n idx = 2\n while idx < stairs.length\n min_step_cost[idx] = stairs[idx] + [min_step_cost[idx - 1], min_step_cost[idx - 2]].min\n idx += 1\n end\n p min_step_cost\n [min_step_cost[-2], min_step_cost[-1]].min\nend", "def min_cost_climbing_s...
[ "0.7375758", "0.73328644", "0.7282645", "0.7211329", "0.71643794", "0.70403475", "0.69406575", "0.6725482", "0.66565967", "0.65938365", "0.6552746", "0.6501378", "0.6259403", "0.6194432", "0.61776084", "0.6142893", "0.6129097", "0.61223733", "0.6067645", "0.6051536", "0.60426...
0.8278453
0
Public: Build a list of 'file' objects (same as used when showing the loglist(s)) and return the items that are related to the current post (specified by the 'title' parameter). Params: title Title of article to compare with filelist to find current. pre Boolean indicating whether this is a finished or workinprogress (...
def related_logs(title, pre=false) logs = begin if pre with_cache('log-pre-file-list') { log_list(LOG_PRE_META[:path], LOG_PRE_META[:regex], pre) } else with_cache('log-file-list') { log_list(LOG_META[:path], LOG_META[:regex]) } end end ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_by_title(title)\n if title.is_a?(Array)\n return self.root_collection.file_by_title(title)\n else\n return files(\"q\" => [\"title = ?\", title], \"maxResults\" => 1)[0]\n end\n end", "def formatted_file_list(title, source_files); end", "def list...
[ "0.5901373", "0.54093146", "0.53490376", "0.51821136", "0.5099016", "0.50472564", "0.5040822", "0.5007242", "0.5007242", "0.48155662", "0.48111278", "0.4796713", "0.47855008", "0.47633484", "0.47456014", "0.47180527", "0.46884465", "0.46787164", "0.46664047", "0.4666243", "0....
0.73172647
0
The visibility of a post to users user => nil can everyone see this post? user => User can a specific user see this post?
def visible?(user=nil) return true if author == user and not deleted? return false unless category.allow_viewing? user return false unless available? true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def viewable?(user)\n !deleted && !hidden?\n end", "def visible?(user=User.current)\n user.allowed_to?(:view_pulls, self.project)\n end", "def preview_only?(user)\n !listed && !author?(user)\n end", "def visible?(user=User.current)\n true\n end", "def viewable?(user=:false)\n (user !...
[ "0.7126053", "0.69971746", "0.69805413", "0.693687", "0.68877417", "0.68426013", "0.6834691", "0.6696283", "0.6695636", "0.66778594", "0.6672065", "0.6569134", "0.6543863", "0.653839", "0.65341496", "0.65249795", "0.65151787", "0.64947087", "0.6493367", "0.6474173", "0.646922...
0.71227986
1
if this is a video and playable?
def playable? video_source end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def video?\n self.type == \"Video\"\n end", "def video?\n self.type == \"Assetabler::Video\"\n end", "def has_video?\n false\n end", "def video?\n !!( content_type =~ Transit.config.video_regexp )\n end", "def video?\n !!video_stream\n end", "def is_video_type?\n file_conte...
[ "0.83826864", "0.82667106", "0.7903742", "0.7889886", "0.78727937", "0.7813366", "0.77756286", "0.7705342", "0.76434153", "0.7614785", "0.7571292", "0.74946797", "0.7446947", "0.7446692", "0.7424836", "0.7242139", "0.7026879", "0.7007215", "0.6989685", "0.69199246", "0.691845...
0.87688667
0
GET /bbhks GET /bbhks.json
def index @bbhks = Bbhk.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @kb = Kb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @kb }\n end\n end", "def index\n @kbs = Kb.search(params[:q]).page(params[:page]).order(\"id desc\")\n\n respond_to do |format|\n format.html # index.html....
[ "0.6529878", "0.6384841", "0.62493914", "0.61285436", "0.60566956", "0.60449934", "0.5923724", "0.5897469", "0.5897469", "0.5850435", "0.5835839", "0.57870173", "0.5773025", "0.57696986", "0.57627964", "0.5758721", "0.57558113", "0.57492137", "0.5688765", "0.56869996", "0.567...
0.6896141
0
POST /bbhks POST /bbhks.json
def create @bbhk = Bbhk.new(bbhk_params) respond_to do |format| if @bbhk.save format.html { redirect_to @bbhk, notice: 'Bbhk was successfully created.' } format.json { render action: 'show', status: :created, location: @bbhk } else format.html { render action: 'new' } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @kb = Kb.new(params[:kb])\n\n respond_to do |format|\n if @kb.save\n format.html { redirect_to @kb, :notice => 'Kb was successfully created.' }\n format.json { render :json => @kb, :status => :created, :location => @kb }\n else\n format.html { render :action => \"n...
[ "0.65196216", "0.6079189", "0.60184276", "0.5886781", "0.5866635", "0.5811435", "0.5782131", "0.57805413", "0.5707289", "0.56398", "0.5636428", "0.5621697", "0.56122386", "0.5609455", "0.5607152", "0.5572045", "0.5535471", "0.5514561", "0.5513518", "0.5503112", "0.5487763", ...
0.6793989
0
PATCH/PUT /bbhks/1 PATCH/PUT /bbhks/1.json
def update respond_to do |format| if @bbhk.update(bbhk_params) format.html { redirect_to @bbhk, notice: 'Bbhk was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @bbhk.errors, status: :unproce...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @kb = Kb.find(params[:id])\n\n respond_to do |format|\n if @kb.update_attributes(params[:kb])\n format.html { redirect_to @kb, :notice => 'Kb was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format...
[ "0.64221394", "0.6211864", "0.62026685", "0.6200728", "0.6144037", "0.61410624", "0.6128951", "0.6025062", "0.59966755", "0.59834015", "0.5965815", "0.59571236", "0.59554297", "0.59436226", "0.59330934", "0.5911566", "0.58994687", "0.58981985", "0.5878253", "0.5878253", "0.58...
0.65022373
0
DELETE /bbhks/1 DELETE /bbhks/1.json
def destroy @bbhk.destroy respond_to do |format| format.html { redirect_to bbhks_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @kb = Kb.find(params[:id])\n @kb.destroy\n\n respond_to do |format|\n format.html { redirect_to kbs_url }\n format.json { head :ok }\n end\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def destroy\n @hk.d...
[ "0.6856093", "0.6775672", "0.6773763", "0.67693406", "0.6764606", "0.6667239", "0.66556567", "0.66301256", "0.65291506", "0.65151274", "0.6487478", "0.6487478", "0.6487478", "0.6487478", "0.64871603", "0.6428292", "0.6417436", "0.6410501", "0.6404583", "0.63994753", "0.639735...
0.72690946
0
This method will enable/disable strong password policy for users.
def set_strong_password(handle:, enable: false) mos = handle.query_classid(class_id: "AaaUserPolicy") user_policy = mos[0] enable ? user_policy.set_prop(:user_password_policy, "enabled") : user_policy.set_prop(:user_password_policy, "disabled") handle.set_mo(mo: user_policy) return handle.query_dn(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allow_users_to_change_passwords?\n @policy.allow_users_to_change_password\n end", "def apply_password_policy\n build_password_policy.apply\n end", "def skip_password!\n # Securely remove all password fields, otherwise user cannot confirm.\n self.password = nil\n self.password_confirmat...
[ "0.63576", "0.6284358", "0.62140554", "0.61868924", "0.61498594", "0.61363536", "0.6079338", "0.6014652", "0.5957391", "0.5901183", "0.58850247", "0.58391345", "0.5820849", "0.58182645", "0.58035684", "0.58035684", "0.58035684", "0.5801583", "0.5789339", "0.57699084", "0.5749...
0.7639294
0
This method will check if strong password policy is enabled.
def is_strong_password_set(handle:) mos = handle.query_classid(class_id: "AaaUserPolicy") if mos.size == 0 raise ImcOperationError.new("Check Password Strength", "MO does not exist") end return (mos[0].user_password_policy == "enabled") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def password_required?\n @password_required\n end", "def require_password?\n if self.new_record?\n APP_CONFIG[:auto_activate] or self.password\n else\n true and !self.password.nil?\n end\n end", "def validate_password?\n active? && (password_hash.blank? || password.present?...
[ "0.65472996", "0.65444314", "0.6535785", "0.65058935", "0.65026397", "0.6471411", "0.64578056", "0.6443475", "0.64409345", "0.64409345", "0.6432411", "0.6424905", "0.6424799", "0.6417333", "0.6415642", "0.6405205", "0.6405205", "0.6361693", "0.6346202", "0.6346202", "0.632689...
0.76257044
0
This method will check if the password expiration policy exists
def password_expiration_exists(handle:, **kwargs) mo = AaaUserPasswordExpiration.new(parent_mo_or_dn: "sys/user-ext") mo = handle.query_dn(dn: mo.dn) if mo.nil? return false, nil end return mo.check_prop_match(**kwargs), mo end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expire_password_on_demand?\n expire_password_after.present? && expire_password_after == true\n end", "def password_expires?\n @password_expires\n end", "def check_password_expiration\n # check inactive mins\n if current_user && current_user.password_expires_at && current_user.pass...
[ "0.7371907", "0.72259814", "0.718002", "0.7102107", "0.7082474", "0.70229137", "0.68210095", "0.67888993", "0.67438114", "0.6703612", "0.6703612", "0.669852", "0.6686004", "0.6649779", "0.66445786", "0.6641466", "0.6601076", "0.6600784", "0.6540958", "0.6496776", "0.6492925",...
0.7295262
1
GET /logincms GET /logincms.json
def index @logincms = Logincm.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @login = Login.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @login }\n end\n end", "def getLogin( login_id)\n params = Hash.new\n params['login_id'] = login_id\n return doCurl(\"get\",\"/login\",params)\n end", ...
[ "0.62309784", "0.62117326", "0.6147455", "0.6121151", "0.6116952", "0.6116952", "0.61017126", "0.6091954", "0.60704756", "0.5985689", "0.59348506", "0.5892269", "0.58425117", "0.58425117", "0.58358234", "0.5807124", "0.58065164", "0.5777034", "0.5775717", "0.57529545", "0.574...
0.6821947
0
POST /logincms POST /logincms.json
def create @logincm = Logincm.new(logincm_params) respond_to do |format| if @logincm.save format.html { redirect_to @logincm, notice: 'Logincm was successfully created.' } format.json { render :show, status: :created, location: @logincm } else format.html { render :new } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logincm_params\n params.require(:logincm).permit(:content)\n end", "def login\n @rest.headers[:content_type] = \"application/json\"\n\n response = api_request { @rest[\"login\"].post({:username => @username, :password => @password}) }\n\n @rest.headers[:x_opsview_token] = response[:token]...
[ "0.6122274", "0.60951006", "0.6030115", "0.6030039", "0.60276663", "0.60276663", "0.6020652", "0.597549", "0.5950285", "0.5947875", "0.5947875", "0.5901616", "0.5900529", "0.5899142", "0.58969116", "0.58904505", "0.58904505", "0.5859339", "0.5847378", "0.58425814", "0.5826458...
0.62735856
0
GET /consultationcharges/1 GET /consultationcharges/1.xml
def show @consultationcharge = Consultationcharge.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @consultationcharge } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @diabetes_consultation = DiabetesConsultation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @diabetes_consultation }\n end\n end", "def show\n @consultation = Consultation.find(params[:id])\n\n respond_to do |format|...
[ "0.67220753", "0.671936", "0.6691476", "0.6628015", "0.6534748", "0.6488349", "0.64504176", "0.6445887", "0.62742025", "0.6259485", "0.6259485", "0.6259485", "0.6177886", "0.6176701", "0.61440873", "0.61200315", "0.61176187", "0.6111644", "0.61042196", "0.6098044", "0.6094731...
0.7296233
0
POST /consultationcharges POST /consultationcharges.xml
def create @consultationcharge = Consultationcharge.new(params[:consultationcharge]) respond_to do |format| if @consultationcharge.save format.html { redirect_to(@consultationcharge, :notice => 'Consultationcharge was successfully created.') } format.xml { render :xml => @consultationcha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def charge(attrs = {})\n post :charges, {}, attrs.to_xml(:root => :charge)\n end", "def create\n @consultation = Consultation.new(params[:consultation])\n\n respond_to do |format|\n if @consultation.save\n format.html { redirect_to(@consultation, :notice => t(\"flash.notices.model.consu...
[ "0.66658425", "0.60315293", "0.58918804", "0.5879767", "0.5838339", "0.5794557", "0.5782371", "0.57703924", "0.5766089", "0.5759834", "0.56913656", "0.5675829", "0.56500065", "0.5647769", "0.5589518", "0.55893445", "0.5588488", "0.55737865", "0.5572595", "0.5501081", "0.54945...
0.6697496
0
PUT /consultationcharges/1 PUT /consultationcharges/1.xml
def update @consultationcharge = Consultationcharge.find(params[:id]) respond_to do |format| if @consultationcharge.update_attributes(params[:consultationcharge]) format.html { redirect_to(@consultationcharge, :notice => 'Consultationcharge was successfully updated.') } format.xml { head...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @pfs_consultation = PfsConsultation.find(params[:id])\n\n respond_to do |format|\n if @pfs_consultation.update_attributes(params[:pfs_consultation])\n format.html { redirect_to(@pfs_consultation, :notice => 'Pfs consultation was successfully updated.') }\n format.xml { head :...
[ "0.6245957", "0.62359864", "0.6153786", "0.59262246", "0.591418", "0.58875775", "0.5866888", "0.5866888", "0.58563316", "0.58557457", "0.57737565", "0.5761195", "0.573807", "0.5726965", "0.57141674", "0.56835145", "0.56654924", "0.56565315", "0.5629517", "0.5614929", "0.56103...
0.6577601
0
DELETE /consultationcharges/1 DELETE /consultationcharges/1.xml
def destroy @consultationcharge = Consultationcharge.find(params[:id]) @consultationcharge.destroy respond_to do |format| format.html { redirect_to(consultationcharges_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end", "def destroy\n @consultation = Consultation.find(params[:id])\n @consultation.destroy\n\n respond_to do |format|\n format.html { redirect_to(cons...
[ "0.6980386", "0.6904357", "0.68982357", "0.6822708", "0.6690675", "0.66335124", "0.66335124", "0.6594275", "0.6512669", "0.6512026", "0.64318705", "0.6375002", "0.63468033", "0.6345942", "0.634269", "0.633389", "0.63335264", "0.63291353", "0.63254994", "0.62756485", "0.626538...
0.7276909
0
Challenge II: Hash with Data shipping_manifest returns a hash with key/value pairs describing oldtimey items set a variable called `the_manifest`, equal to a hash fill that hash with key/value pairs that describe the following information: We have 5 whale bone corsets, 2 porcelain vases and 3 oil paintings
def shipping_manifest the_manifest = {"whale bone corsets" => 5, "porcelain vases" => 2, "oil paintings" => 3} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shipping_manifest\n the_manifest = {\"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3}\nend", "def shipping_manifest\n shipping_manifest = {\n \"whale bone corsets\" => 5,\n \"porcelain vases\" => 2,\n \"oil paintings\" => 3\n }\nend", "def shipping_manifest\n shippi...
[ "0.78442127", "0.7546124", "0.7546124", "0.7457613", "0.6570351", "0.6488464", "0.64694744", "0.64540035", "0.6430159", "0.6420317", "0.6230764", "0.62144035", "0.61396486", "0.5907613", "0.5788022", "0.5510948", "0.542372", "0.5393345", "0.5367835", "0.5365915", "0.5342259",...
0.77538717
1
Challenge III: Retrieving Data retrieval operates on the shipping_manifest hash to return the value of the 'oil paintings' key Look up the value of the "oil paintings" key in the shipping_manifest hash below
def retrieval shipping_manifest = {"whale bone corsets" => 5, "porcelain vases" => 2, "oil paintings" => 3} shipping_manifest["oil paintings"] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def retrieval\n shipping_manifest = { \"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3 }\n\n shipping_manifest[\"oil paintings\"]\nend", "def retrieval\n shipping_manifest['oil paintings']\nend", "def retrieval\n shipping_manifest = {\n \"whale bone corsets\" =...
[ "0.81601053", "0.8157861", "0.8017714", "0.7990587", "0.79893243", "0.724268", "0.724268", "0.7154802", "0.71107197", "0.68546134", "0.5993058", "0.59607154", "0.59378505", "0.58808833", "0.5747803", "0.56566864", "0.5654441", "0.56174874", "0.5582411", "0.55625093", "0.55487...
0.81682825
0
Challenge IV: Adding Data adding operates on the shipping_manifest hash to add a key/value pair add 2 muskets to the shipping_manifest hash below add 4 gun powder to the shipping_manifest hash below return the shipping_manifest hash below
def adding shipping_manifest = {"whale bone corsets" => 5, "porcelain vases" => 2, "oil paintings" => 3} shipping_manifest["muskets"] = 2 shipping_manifest["gun powder"] = 4 shipping_manifest end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adding\n shipping_manifest = {\"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3}\n\n shipping_manifest[\"pearl necklace\"] = 1\n return shipping_manifest\nend", "def adding\n shipping_manifest = {\"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3}\n ...
[ "0.7171773", "0.716788", "0.69416595", "0.691989", "0.6856666", "0.67448306", "0.67448306", "0.65470046", "0.5821235", "0.57083327", "0.5674804", "0.5561942", "0.55503345", "0.5329685", "0.5328865", "0.5328451", "0.5315217", "0.5299678", "0.5147505", "0.51407367", "0.51326483...
0.72442776
0
A panel has been refreshed Parameters:: iPanel (Wx::Panel): The panel just refreshed
def notifyRefresh(iPanel) if (!@DuringInit) # Find the Tab containing this Panel lIdx = @DependencyPanels.index(iPanel) lDepUserChoice = @DepsUserChoices[lIdx] lIconName = "#{@IconsDir}/Dependency.png" if (lDepUserChoice.Locate) if (lDe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def refreshUI; @apPanel.redrawwin; @entryPanel.redrawwin; @entryListBox.refresh; @apListBox.refresh end", "def _draw_panel\n @apotomo_emit_raw_view = true\n render :view => param(:panel)\n end", "def refresh!; end", "def refresh; end", "def refresh!\n refresh\n @window.refresh\n end", "def ...
[ "0.5962467", "0.59367937", "0.5551284", "0.552696", "0.54813856", "0.5412496", "0.5412432", "0.53638077", "0.53235126", "0.53016245", "0.52987516", "0.5287404", "0.5279883", "0.5279396", "0.52771014", "0.5269382", "0.5237463", "0.5237463", "0.5221807", "0.5219583", "0.5207147...
0.61301386
0
Calculate the numerical identifier of the report based on the 01/06/2020 report, which was 91
def day_identifier day_baseline = Date.parse("2020-06-01") number_baseline = 91 baseline_shift = date.mjd - day_baseline.mjd number_baseline + baseline_shift end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ref_number\n batch = check.batch\n facility_name = facility.name.upcase\n if (facility_name == 'AHN' || facility_name == 'SUBURBAN HEALTH' ||\n facility_name == 'UWL' || facility_name == 'ANTHEM')\n file_number = batch.file_name.split('_')[0][3..-1] rescue \"0\"\n date = batch.date....
[ "0.6702216", "0.6660935", "0.6379788", "0.62252164", "0.60224944", "0.5978005", "0.5799169", "0.5764095", "0.5642951", "0.5611011", "0.55981743", "0.5590689", "0.55649954", "0.5564428", "0.55217636", "0.55108225", "0.548926", "0.5482215", "0.54808813", "0.54787314", "0.546298...
0.671612
0
GET /informacoes GET /informacoes.json
def index @informacoes = Informacao.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @acoes = Acao.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @acoes }\n end\n end", "def index\n @colegios = Colegio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @colegios }\n ...
[ "0.6734839", "0.67044973", "0.6600473", "0.65711117", "0.6565081", "0.65589184", "0.65585595", "0.6537309", "0.65300554", "0.6513718", "0.6507799", "0.6490077", "0.64828587", "0.64579546", "0.6457692", "0.6450913", "0.640981", "0.6407589", "0.63979065", "0.63931197", "0.63851...
0.7033731
0
POST /informacoes POST /informacoes.json
def create @informacao = Informacao.new(informacao_params) respond_to do |format| if @informacao.save format.html { redirect_to @informacao, notice: 'Informacao was successfully created.' } format.json { render action: 'show', status: :created, location: @informacao } else f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @oferta_academica = OfertaAcademica.new(params[:oferta_academica])\n\n if @oferta_academica.save\n render json: @oferta_academica, status: :created, location: @oferta_academica\n else\n render json: @oferta_academica.errors, status: :unprocessable_entity\n end\n end", "def cre...
[ "0.62956244", "0.6102647", "0.60587376", "0.60551256", "0.5969321", "0.59630847", "0.59245616", "0.5913291", "0.59069043", "0.58761394", "0.587593", "0.5864844", "0.58629566", "0.58441293", "0.58415395", "0.5834704", "0.5833787", "0.5833706", "0.5833143", "0.5828265", "0.5828...
0.61918765
1
Returns annual rate of return given an initial value, and final value and number of years (may be fractional) NB answer is expressed as percentage Reference Wikipedia: ERV == P (1 + T) ^ n where P == a hypothetical initial payment of $1,000 T == average annual total return n == number of years Solving for T gives T == ...
def annual_ror(initial_value, final_value, years) if years <= 0 0 elsif initial_value == 0 # BigDecimal::INFINITY Float::INFINITY else 100.to_d * if final_value < 0 # fudge if final value is less than zero (((initial_value.to_d - final_value.to_d) / initial_v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mortgage_calc principle, annual_interest, years\n n = years * 12\n r = (annual_interest / 100)/ 12 #since this is usually expressed as a percentage\n return (principle * r * (1 + r)**n / ((1 + r)**n - 1)).round(2)\nend", "def total_amount_owed(principal, interest_rate_percentage, number_of_years)\n annua...
[ "0.71803", "0.7060131", "0.7031164", "0.69293207", "0.69113183", "0.6909753", "0.67350924", "0.6611021", "0.6590617", "0.6555558", "0.6550064", "0.65337557", "0.6530538", "0.64723784", "0.6447123", "0.64417917", "0.6412424", "0.6351784", "0.63419807", "0.6322064", "0.6322064"...
0.7825729
0
NOTE: We call redirect_params AFTER super in these methods intentionally the OAuth2 strategy uses the authorize_params and token_params methods to set up some state for testing that we need in redirect_params
def authorize_params params = super params = params.merge(request_params) unless OmniAuth.config.test_mode redirect_params.merge(params) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authorize_params\n super.tap do |params|\n %w(scope team redirect_uri).each do |v|\n if !request.params[v].to_s.empty?\n params[v.to_sym] = request.params[v]\n end\n end\n log(:debug, \"Authorize_params #{params.to_h}\")\n end\n e...
[ "0.7227562", "0.7089455", "0.69590807", "0.6955094", "0.68463266", "0.6838749", "0.67946094", "0.65502334", "0.6477877", "0.64064735", "0.6325004", "0.62828195", "0.6242743", "0.61860657", "0.61687076", "0.6152864", "0.6129026", "0.61270374", "0.6091774", "0.602243", "0.60042...
0.77745366
0
This job will alert the user when they've been invited to a contest
def perform(inviter, user_id, contest_id, email = nil) @inviter = inviter @user = User.joins("JOIN email_preferences ON email_preferences.user_id = users.id").select(:id, :email, :name, :token_1, :token_2, :contest_invitation, :email_validated).where(id: user_id).first if @user @contest = Contest.find(contest_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accept_candidate\n authorize(@job_candidate)\n @job_candidate.accepted!\n tracker = Mixpanel::Tracker.new(ENV[\"NT_MIXPANEL_TOKEN\"])\n tracker.track('employer-' + current_employer.email, 'accepted candidate')\n CandidateMailer.send_job_hire(@job_candidate.candidate.email, @job_candidate.job).de...
[ "0.6265306", "0.62034196", "0.61915934", "0.61722887", "0.6166607", "0.6158446", "0.61425185", "0.61394966", "0.613072", "0.6121585", "0.610391", "0.610049", "0.6031447", "0.6030711", "0.6020831", "0.59820503", "0.59682935", "0.5959971", "0.5951934", "0.5947938", "0.59401923"...
0.6614172
0
Write a function that accepts a positive number N. The function should console log a step shape with N levels using the character. Make sure the step has spaces on the right hand side! Examples steps(2) ' ' '' steps(3) ' ' ' ' '' steps(4) ' ' ' ' ' ' ''
def steps(n) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def steps (n, row = 0, stair = '')\n return if n == row\n\n if n == stair.length\n puts stair\n return steps(n, row + 1)\n end\n\n stair.length <= row ? stair += '#' : stair += ' '\n\n steps(n, row, stair)\nend", "def how_many_steps?\n puts \"Left\"\n puts \"Right\"\n puts \"/1\\n...
[ "0.72871125", "0.66319036", "0.6181501", "0.6157394", "0.6135781", "0.608254", "0.60357237", "0.59547776", "0.59492236", "0.59403527", "0.5890433", "0.58537525", "0.5842024", "0.5811479", "0.5797087", "0.5797031", "0.5795863", "0.57883704", "0.5744695", "0.57434213", "0.57240...
0.69546527
1
helper to decide if a user is online student or normal student
def is_a_online_student? current_user.mode == "Online" ? true : false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_user_is_student?\n if current_user.user_type == \"student\"\n true\n else\n redirect_to user_path(@current_user)\n end\n end", "def logged_in_as_student?\n !current_student.nil?\n end", "def student?\n return logged_in? && (current_user.class == Student)\n end", "def s...
[ "0.7305143", "0.72661877", "0.7209433", "0.719262", "0.7156094", "0.6969046", "0.6910181", "0.68802935", "0.6865148", "0.68130404", "0.6788277", "0.6705275", "0.6654445", "0.66370004", "0.65740055", "0.65714514", "0.6562667", "0.65451485", "0.65362275", "0.65109736", "0.64291...
0.84800327
0
Returns true if the fft_geomancy feature exists
def has_geomancy_feature? !features(:geomancy_element_shift).empty? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_feat ( f )\n return false\n end", "def feature?(feature)\n definition[:features]&.include?(feature)\n end", "def aperture?\n !aperture.nil?\n end", "def float_dtype?\n [:float32, :float64].include?(dtype)\n end", "def is_mag?(); @type == GRT_MAG; end", "def focal_length?\n...
[ "0.6759936", "0.64259964", "0.6272171", "0.62395585", "0.59958404", "0.5974579", "0.5963551", "0.5955584", "0.5871518", "0.586599", "0.5791189", "0.5754336", "0.5753596", "0.5734952", "0.56590253", "0.56559", "0.5640304", "0.5625225", "0.55964494", "0.5590869", "0.5571228", ...
0.7363119
0
Determines if the supplied user is an owner of the account.
def has_owner? user self.account_users.where(user: user, is_owner: true).count > 0 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def owner?(user)\n user == owner || owners.include?(user)\n end", "def owner? (user)\n user == owner\n end", "def is_owner?(user)\n !user.nil? && (self.user_id == user.id)\n end", "def is_owner?(this_user)\n user == this_user\n end", "def is_owner?(user)\n user.id == self...
[ "0.82786024", "0.8251542", "0.8152414", "0.79650974", "0.7939119", "0.79154015", "0.7902074", "0.7867498", "0.78300935", "0.7815641", "0.77649164", "0.77649164", "0.76464283", "0.7631401", "0.75297576", "0.75031", "0.749518", "0.7440216", "0.7437757", "0.74172765", "0.7387799...
0.8629043
0
Define where we can find the header files to parse Can give an array of directories, a glob, or just a string. All file names should be full paths, not relative. Options can be any or all of the following: :include_paths Path(s) to be added as I flags :library_paths Path(s) to be added as L flags :libraries Path(s) to ...
def sources(dirs, options = {}) parser_options = { :includes => [], :cxxflags => [ # Force castxml into C++ mode "-x c++", # Allow things like `<::` "-fpermissive" ] } if (code_dir = options.delete(:include_source_dir)) options[:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def header_include_paths\n cmd = RbConfig::MAKEFILE_CONFIG[\"CC\"]\n args = %w{-Wp,-v -xc /dev/null -fsyntax-only}\n paths = []\n reading_paths = false\n run_command(cmd, *args) do |line|\n line.chomp!\n if reading_paths\n if line == 'End of search list.'\n reading_paths = false\n elsif...
[ "0.6914934", "0.6285592", "0.60384244", "0.58239883", "0.5822146", "0.57213515", "0.5713939", "0.5686055", "0.5673936", "0.5671525", "0.5652372", "0.56276816", "0.55707955", "0.5570621", "0.5567354", "0.55640113", "0.55187756", "0.5454527", "0.5442466", "0.5412935", "0.540044...
0.65172637
1
Specify the mode with which to write out code files. This can be one of two modes: :multiple (default) Each class and module gets it's own set of hpp/cpp files :single Everything gets written to a single file
def writer_mode(mode) raise "Unknown writer mode #{mode}" unless [:multiple, :single].include?(mode) @writer_mode = mode end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write\n Logger.info \"Writing code to files\"\n prepare_working_dir\n process_other_source_files\n\n # Create the code\n writer_class = @writer_mode == :multiple ? Writers::MultipleFilesWriter : Writers::SingleFileWriter\n writer_class.new(@builder, @working_dir).write\n\n # ...
[ "0.61586547", "0.60897255", "0.56814134", "0.5643226", "0.5630379", "0.5551736", "0.55042124", "0.5504173", "0.5431309", "0.53551745", "0.53501123", "0.534584", "0.5301392", "0.5222702", "0.5208211", "0.51636547", "0.51636547", "0.51636547", "0.51636547", "0.5163312", "0.5142...
0.62678695
0
Compile the extension. This will create an rbpp_compile.log file in +working_dir+. View this file to see the full compilation process including any compiler errors / warnings.
def compile Logger.info "Compiling. See rbpp_compile.log for details." require 'rbconfig' ruby = File.join(RbConfig::CONFIG["bindir"], RbConfig::CONFIG["RUBY_INSTALL_NAME"]) FileUtils.cd @working_dir do system("#{ruby} extconf.rb > rbpp_compile.log 2>&1") system("rm -f *.so") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compile\n Dir.chdir(build_path) do\n do_compile\n end\n end", "def compile\n end", "def build\n raise ConfigurationError.new(\"Must specify working directory\") unless @working_dir\n raise ConfigurationError.new(\"Must specify which sources to wrap\") unless @parser\n\n ...
[ "0.6823948", "0.6362989", "0.63502246", "0.61257815", "0.60613436", "0.60349697", "0.60108215", "0.6002097", "0.59822905", "0.5947855", "0.5895054", "0.5806892", "0.57201964", "0.57150155", "0.57021344", "0.56926584", "0.56812584", "0.5639252", "0.56190336", "0.5608342", "0.5...
0.78810585
0
Check ARGV to see if someone asked for "console"
def requesting_console? @requesting_console end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def commandline\n ui == \"commandline\"\n end", "def console?\n defined?(::Rails::Console) && $stdout.isatty && $stdin.isatty\n end", "def validate_argv\n if ARGV.empty? then\n ARGV << \"start\"\n else\n if not %w{start stop restart zap status}.include? ARGV.first then\n ...
[ "0.7050839", "0.638266", "0.6313518", "0.63002616", "0.6237337", "0.62016934", "0.5997924", "0.59475183", "0.5905552", "0.5887037", "0.5845508", "0.58440936", "0.58061516", "0.5805057", "0.5805057", "0.5805057", "0.5799348", "0.5799348", "0.57903284", "0.5789808", "0.57686764...
0.6389698
1
Start up a new IRB console session giving the user access to the RbGCCXML parser instance to do realtime querying of the code they're trying to wrap
def start_console puts "IRB Session starting. @parser is now available to you for querying your code. The extension object is available as 'self'" IRB.start_session(binding) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(*args)\n ## maybe set some opts here, as in parse_opts in irb/init.rb?\n\n unless @@irb_setup_done\n @@irb_setup_done = true\n\n conf = IRB.conf\n \n if File.directory?(\"tmp\")\n conf[:HISTORY_FILE] = \"tmp/.irb_shell_history\"\n else\n conf[:HISTORY_FIL...
[ "0.65019333", "0.64288914", "0.6155321", "0.60915166", "0.60181373", "0.59680706", "0.59327716", "0.59311205", "0.58957195", "0.58705044", "0.5767094", "0.575434", "0.5736025", "0.5735212", "0.5720628", "0.56802", "0.5676554", "0.56409335", "0.56183326", "0.5579454", "0.55589...
0.77239615
0
If the working dir doesn't exist, make it and if it does exist, clean it out
def prepare_working_dir FileUtils.mkdir_p @working_dir unless File.directory?(@working_dir) FileUtils.rm_rf Dir["#{@working_dir}/*"] if @force_rebuild end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_up\n FileUtils.rm_rf \"#{@path}\" unless create_in_current_directory?\n FileUtils.rm_rf \"#{@cache}\"\n end", "def clean_dir\n\n path = self.get_dir\n _clean_dir(path)\n end", "def clean_dir\n File.join clean_dir_parent, name\n end", "def clean\n needs_cleaning ...
[ "0.76405054", "0.7408624", "0.7186648", "0.71587247", "0.70376396", "0.70326406", "0.7000289", "0.69984543", "0.6984926", "0.6920283", "0.6874696", "0.67769", "0.67683226", "0.67443323", "0.67343736", "0.6714536", "0.6714536", "0.6690504", "0.66625756", "0.66347367", "0.66268...
0.82474655
0
Make sure that any files or globs of files in :include_source_files are copied into the working directory before compilation
def process_other_source_files files = @options[:include_source_files].flatten files.each do |f| FileUtils.cp Dir[f], @working_dir end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update include_dirs, source\r\n if not @source_files.include? source\r\n @source_files << source\r\n end\r\n update_depends include_dirs, source\r\n end", "def setup_source_files\n project.sources.each do |src|\n # Figure out where stuff should come from and go to\n source_f...
[ "0.67724407", "0.67555416", "0.6641602", "0.6449673", "0.64423573", "0.62240994", "0.6183724", "0.61246365", "0.60495454", "0.60196936", "0.5957298", "0.5891985", "0.5861465", "0.5851464", "0.5845209", "0.5845209", "0.5802774", "0.5775919", "0.5772304", "0.5753653", "0.575107...
0.7868463
0
GET /desinfectantes GET /desinfectantes.json
def index @desinfectantes = Desinfectante.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @desinfectante.destroy\n respond_to do |format|\n format.html { redirect_to desinfectantes_url, notice: 'Desinfectante was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def emergencias_en_curso\n @emergencies = Emergency.where(:estado => 'f')\n ...
[ "0.64389193", "0.623495", "0.61304295", "0.60649556", "0.60498655", "0.6040296", "0.6034668", "0.60063785", "0.59972966", "0.5948474", "0.59429896", "0.59263563", "0.59120077", "0.5791583", "0.5770066", "0.5764881", "0.5750057", "0.57298476", "0.5708329", "0.568885", "0.56845...
0.72310925
0
POST /desinfectantes POST /desinfectantes.json
def create @desinfectante = Desinfectante.new(desinfectante_params) respond_to do |format| if @desinfectante.save format.html { redirect_to @desinfectante, notice: 'Desinfectante was successfully created.' } format.json { render :show, status: :created, location: @desinfectante } el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def desinfectante_params\n params.require(:desinfectante).permit(:marca, :tipo, :precio, :presentacion, :stock, :liquido)\n end", "def destroy\n @desinfectante.destroy\n respond_to do |format|\n format.html { redirect_to desinfectantes_url, notice: 'Desinfectante was successfully destroyed.' }...
[ "0.6715804", "0.64218324", "0.62631243", "0.6013901", "0.58974636", "0.58731997", "0.5789425", "0.577496", "0.5768931", "0.57493615", "0.57434523", "0.5661222", "0.5650956", "0.56354165", "0.56324345", "0.5581517", "0.5562345", "0.5549814", "0.5548201", "0.55382335", "0.55382...
0.66236925
1
PATCH/PUT /desinfectantes/1 PATCH/PUT /desinfectantes/1.json
def update respond_to do |format| if @desinfectante.update(desinfectante_params) format.html { redirect_to @desinfectante, notice: 'Desinfectante was successfully updated.' } format.json { render :show, status: :ok, location: @desinfectante } else format.html { render :edit } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @servicio = Servicio.find(params[:id])\n\n respond_to do |format|\n if @servicio.update_attributes(params[:servicio])\n format.html { redirect_to @servicio, :notice => 'Servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { ...
[ "0.6500287", "0.6442837", "0.64224625", "0.63979876", "0.6375225", "0.63302875", "0.6328817", "0.6291803", "0.62866145", "0.6285924", "0.62819654", "0.6257505", "0.6249846", "0.6248789", "0.62433636", "0.62423736", "0.6232456", "0.62319374", "0.62314755", "0.6229124", "0.6226...
0.6531241
0
DELETE /desinfectantes/1 DELETE /desinfectantes/1.json
def destroy @desinfectante.destroy respond_to do |format| format.html { redirect_to desinfectantes_url, notice: 'Desinfectante was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @detalle = Detalle.find(params[:id])\n @detalle.destroy\n\n respond_to do |format|\n format.html { redi...
[ "0.71394247", "0.7127553", "0.71198034", "0.70285964", "0.7027966", "0.70126766", "0.7010169", "0.7007926", "0.69764686", "0.69739956", "0.6956925", "0.69524306", "0.6950972", "0.6937087", "0.693446", "0.6929953", "0.6928403", "0.69081795", "0.6901356", "0.6900193", "0.689963...
0.7309257
0
Using your is_prime? method, write a new method, primes that takes a (nonnegative, integer) number max and returns an array of all prime numbers less than max.
def primes(max) array = [] i = 2 while i < max.abs if is_prime?(i) array << i end i += 1 end array end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def primes(max)\n primes = []\n number = 2\n \n while number <= max\n primes << number if is_prime? number\n number += 1\n end\n primes\nend", "def primes(max)\n primes = []\n number = 2\n \n while number <= max\n primes << number if is_prime? number\n number += 1\n end\n primes\nend", ...
[ "0.83949995", "0.83949995", "0.8016834", "0.7953333", "0.7952573", "0.78910017", "0.78560436", "0.7841761", "0.78091115", "0.78061825", "0.78059363", "0.7792239", "0.7710655", "0.7699948", "0.76808125", "0.76653236", "0.7654771", "0.7654771", "0.7654771", "0.75961375", "0.755...
0.86498326
0
create one or more CSV files (one CSV file per survey_schema) and archive it with ZIP
def create_zip_file(destination_file_name, csv_filenames_prefix, survey_schemas, administration_id) raise 'empty survey_schemas are unsupported' if survey_schemas.empty? working_dir = create_unique_dir csv_filepaths = create_csv_files(working_dir, csv_filenames_prefix, survey_schemas, administration_id) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_records_file(format)\n file = Tempfile.new(\"patients-#{Time.now.to_i}\")\n patients = Record.where(\"test_id\" => self.id)\n \n if format == 'csv'\n Cypress::PatientZipper.flat_file(file, patients)\n else\n Cypress::PatientZipper.zip(file, patients, format.to_sym)\n end\n ...
[ "0.6584274", "0.6402949", "0.63745075", "0.6325527", "0.6291515", "0.6248007", "0.62397605", "0.61585194", "0.6032448", "0.59960437", "0.59375465", "0.58912754", "0.58630097", "0.5854191", "0.5815545", "0.5760578", "0.57358134", "0.5724562", "0.5718807", "0.5694275", "0.56907...
0.6876076
0
removing all stored nodes and edges with this node for a particular node
def remove_node(node) @nodes_being_worked_on.delete(node) @nodes.delete(node) # the last edge keeps getting ignored when you remove this, so handling the final case assign_node(@edges[0][1]) if @edges.size == 1 @edges.reject! { |edge| edge.include?(node) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove(node)\n node.inputs.each do |producer_edge|\n producer_edge.from.outputs.reject! { |edge| edge.to == node }\n end\n\n node.outputs.each do |consumer_edge|\n consumer_edge.to.inputs.reject! { |edge| edge.from == node }\n end\n\n nodes.del...
[ "0.7532265", "0.70715094", "0.70563966", "0.69391334", "0.69204074", "0.6869052", "0.67679524", "0.6723454", "0.6667144", "0.66671157", "0.6653908", "0.6612068", "0.66102505", "0.6605932", "0.65623885", "0.6544049", "0.6544049", "0.6488497", "0.6462139", "0.6447844", "0.64476...
0.72997206
1
First assign nodes to workers, and then count the seconds off each worker
def process_second @seconds += 1 assign_nodes process_workers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def workers(count); end", "def worker_count\n @action == 'run' ? 1 : workers\n end", "def active_on_cluster_count\n (waiting_count + running_count)\n end", "def worker_count()\n @workers.size\n end", "def worker_count()\n @workers.size\n end", "def missing_workers\n @opti...
[ "0.7240735", "0.6631506", "0.6394284", "0.6354455", "0.6354455", "0.629941", "0.61719173", "0.61647886", "0.6072421", "0.6066781", "0.604655", "0.59918296", "0.59715456", "0.594274", "0.5942223", "0.59413034", "0.5925082", "0.58989596", "0.58748287", "0.5855831", "0.5835867",...
0.72736335
0
Returns true if this a start state.
def start_state? @state_type == :start end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def started?\n @state == STATE_STARTED\n end", "def running?\n @state == :started\n end", "def start?\r\n start\r\n end", "def started?\n @started\n end", "def started?\n @started\n end", "def started?\n @state != :created\n end", "def started?\n ...
[ "0.8546305", "0.8046395", "0.7930488", "0.78981346", "0.78981346", "0.78764534", "0.7728927", "0.7708898", "0.7657222", "0.76489013", "0.7647868", "0.7639584", "0.7617122", "0.75985754", "0.75985754", "0.7503758", "0.7485786", "0.744257", "0.74422014", "0.74149424", "0.736786...
0.91267204
0
Returns true if this an end state.
def end_state? @state_type == :end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ended?\n\t\t\tstate == 'ended'\n\t\tend", "def end?\n @status == :end\n end", "def ended?\n !!@ended\n end", "def ended?\n @ended\n end", "def ended?\n !!@finished && !transition?\n end", "def ended?\n return(self.ends_at < Time.now)\n end", "def ended?\n en...
[ "0.8354746", "0.8338693", "0.7862258", "0.78419566", "0.76578397", "0.76541805", "0.7490499", "0.7454582", "0.74293077", "0.7343483", "0.7333606", "0.7327331", "0.73170483", "0.72842264", "0.72469896", "0.72145516", "0.71146953", "0.70591986", "0.70328486", "0.70161873", "0.7...
0.89814514
0
Returns true if this State matches x or is a substate of x.
def === x # $stderr.puts "#{self.inspect} === #{x.inspect}" case x when self.class self.is_a_substate_of?(x) else super end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_a_substate_of? x\n self.ancestors.include?(x)\n end", "def is_a_superstate_of? x\n x.ancestors.include?(self)\n end", "def contains_x?(x)\n\t\t(self.left..self.right).include?(x);\n\tend", "def state?(state)\n @state == state\n end", "def in_or_after_state?(test_state)\n r...
[ "0.7849539", "0.69354314", "0.62772065", "0.58552575", "0.5783112", "0.57808584", "0.5702207", "0.5694464", "0.567237", "0.5665709", "0.5665709", "0.5652542", "0.56418973", "0.5599023", "0.55965835", "0.5564319", "0.55438274", "0.5501651", "0.54580486", "0.54479164", "0.54479...
0.740121
1
Returns true if this State is a substate of x. All States are substates of themselves.
def is_a_substate_of? x self.ancestors.include?(x) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_a_superstate_of? x\n x.ancestors.include?(self)\n end", "def === x\n # $stderr.puts \"#{self.inspect} === #{x.inspect}\"\n case x\n when self.class\n self.is_a_substate_of?(x)\n else\n super\n end\n end", "def isSubmachineState\n ! ! @submachine\n ...
[ "0.7557768", "0.70673037", "0.6455087", "0.5892427", "0.5886137", "0.57861155", "0.5657961", "0.5624698", "0.5515374", "0.54992735", "0.54143417", "0.5406614", "0.53588253", "0.5335014", "0.5286561", "0.52826935", "0.52713877", "0.52675635", "0.5247119", "0.52331185", "0.5232...
0.8677874
0
Returns true if this State is a superstate of x. All States are superstates of themselves.
def is_a_superstate_of? x x.ancestors.include?(self) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_a_substate_of? x\n self.ancestors.include?(x)\n end", "def === x\n # $stderr.puts \"#{self.inspect} === #{x.inspect}\"\n case x\n when self.class\n self.is_a_substate_of?(x)\n else\n super\n end\n end", "def super_and_sub?(sup, sub); end", "def is_supe...
[ "0.77484745", "0.708355", "0.5812886", "0.56504595", "0.5633534", "0.53952336", "0.537603", "0.52856153", "0.52422816", "0.5228173", "0.5222996", "0.52215654", "0.52214503", "0.52096343", "0.5181934", "0.5152315", "0.5145117", "0.51106036", "0.5055891", "0.5050865", "0.504403...
0.82940197
0
A state with isOrthogonal=true is said to be an orthogonal composite state. An orthogonal composite state contains two or more regions. Default value is false.
def isOrthogonal raise Error::NotImplemented, :message => :isOrthogonal, :object => self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def orthogonal?\n @colt_property.isOrthogonal(@colt_matrix)\n end", "def composite?\n false\n end", "def composite?\n false\n end", "def composite?\n !shapes.empty?\n end", "def fOOrth\r\n end", "def fOOrth\r\n end", "def Matrix3dIsOrthogonal(arg0)\n ret = _invo...
[ "0.6146887", "0.52151644", "0.52151644", "0.51851517", "0.51488584", "0.51488584", "0.51258343", "0.5104288", "0.5079847", "0.5079044", "0.5079044", "0.50709265", "0.50416905", "0.50009125", "0.49915877", "0.49877498", "0.49842927", "0.49645686", "0.49493575", "0.48900872", "...
0.66913474
0
A state with isSubmachineState=true is said to be a submachine state. Such a state refers to a state machine (submachine). Default value is false.
def isSubmachineState ! ! @submachine end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state?(state)\n @_state == state\n end", "def state?(state)\n @state == state\n end", "def get_state\n return self.state == 't' || self.state == true\n end", "def has_state?\n !!current_state\n end", "def state?\n usa?\n end", "def isComposite\n ! ! @submachine\...
[ "0.6294503", "0.6210016", "0.6182318", "0.6178241", "0.61162686", "0.61064464", "0.6078177", "0.6032297", "0.60144484", "0.60070306", "0.59886426", "0.5981271", "0.59673", "0.59620607", "0.5946726", "0.5945685", "0.5945685", "0.5914703", "0.5874971", "0.58738726", "0.5859875"...
0.8428747
0
Returns a NamedArray of all ancestor States. self is the first element.
def ancestors @ancestors ||= begin x = [ self ] if ss = superstate x.push(*ss.ancestors) end NamedArray.new(x.freeze, :state) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ancestors\n []\n end", "def all_active_states\n return [] unless __is_current__?\n return [self] if @substates.empty?\n\n @substates.reduce([]) do |arr, substate|\n arr.concat(substate.all_active_states) if substate.__is_current__? # concat mutates ;)\n arr\n end\n end", ...
[ "0.7137159", "0.70319986", "0.68577975", "0.67584234", "0.67583287", "0.66906005", "0.6610407", "0.65746146", "0.6526029", "0.65129197", "0.6512119", "0.648894", "0.6464761", "0.6456015", "0.6425596", "0.64116263", "0.6409109", "0.6406646", "0.6396961", "0.6374533", "0.635124...
0.80961573
0
Called after this State is added to the StateMachine.
def state_added! statemachine transitions_changed! end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def after_state(state)\n end", "def after_created\n super.tap do |val|\n app_state_bundle(self)\n end\n end", "def after_created\n super.tap do |val|\n app_state_ruby(self)\n end\n end", "def after_appending( state )\n\t\t# Nothing to d...
[ "0.7086918", "0.68461746", "0.684084", "0.67249316", "0.6607615", "0.6184547", "0.6177497", "0.6144093", "0.60873175", "0.60567564", "0.5937094", "0.5930762", "0.59305817", "0.5927014", "0.59043527", "0.59043527", "0.59043527", "0.59043527", "0.59043527", "0.59043527", "0.590...
0.68584603
1
Called after a State removed from its StateMachine.
def state_removed! statemachine transitions_changed! end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_state(state)\n states.remove(state)\n end", "def erase_state(state_id)\n super\n check_state_remove_effects(state_id)\n end", "def pop_state\n @state.pop\n end", "def destroy\n @state.destroy\n end", "def destroy\n @state.destroy\n end", "def destroyed(event)\n ...
[ "0.7106296", "0.70077455", "0.6975829", "0.6958535", "0.6958535", "0.6926397", "0.69051963", "0.663011", "0.6600804", "0.6598869", "0.6598869", "0.6502423", "0.64411944", "0.63950866", "0.63798195", "0.63691187", "0.63545805", "0.62847775", "0.62550706", "0.6246275", "0.62190...
0.83318
0
Add a data attribute to each option of the select to indicate which category the choice is linked to, if any. This allows us to show and hide appropriate fields in JavaScript based on the category.
def options_for_select choices.map do |choice| data = {} data["choice-category"] = choice.category_id if choice.category_id content_tag( :option, choice.short_name, :value => choice.id, :selected => selected_choice?(item, choice), :data => data ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def option_selects\n content_profile_entries.map do |cpe|\n [cpe.description, cpe.id, {'data-description': \"#{cpe.content_type}:#{cpe.topic_type}\"} ]\n end\n end", "def drink_categories \n # indicate this is coming from signup\n @create_drink_profile = true\n \n # set defaults\n @bee...
[ "0.55089647", "0.51406014", "0.51390284", "0.5078232", "0.4972901", "0.49673536", "0.4945094", "0.48930055", "0.4880096", "0.48542184", "0.48444992", "0.4839115", "0.48358876", "0.48354906", "0.48238724", "0.48172763", "0.4780239", "0.47694516", "0.4758345", "0.4750634", "0.4...
0.6419283
0
Create a new Item Record.
def new_item(opts={}) defaults = {:number => @items.count + 1} @items << ItemRecord.new(defaults.merge(opts)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n \n #debug\n write_log(\n Const::SL::LOG_PATH_SL,\n \"items_controller#create(params[:item] => #{params[:item]})\",\n # __FILE__,\n __FILE__.split(\"/\")[-1],\n __LINE__.to_s)\n\n \n @item = Item.new(params[:item])\n\n r...
[ "0.71818566", "0.70745796", "0.706473", "0.6996472", "0.6975625", "0.695367", "0.6938458", "0.69055516", "0.68687993", "0.68202734", "0.6817313", "0.6815403", "0.6807482", "0.68023145", "0.67395693", "0.67165935", "0.67165935", "0.67165935", "0.66843593", "0.66820943", "0.668...
0.7281687
0
Verbosely checks if file should be processed filename file whose existance will be checked step name of pipeline step
def skip_step?(filename, step) if File.exist?(filename) && !@force_overwrite print_e "SKIPPED #{step}: #{filename} already exists." true else print_e "RUN #{step} => #{filename}" false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_fixture_exists?(filename, step = '')\n return true if File.exist?(Rails.root.join(UPLOADED_FILES_DIR, filename))\n\n raise \"ERROR in step: '#{step}'\\n\" +\n \" The file #{filename}\\n\" +\n \" must exist in #{UPLOADED_FILES_DIR}\\n\" +\n \" but it doesn't. Either correct ...
[ "0.7120127", "0.6571621", "0.6322864", "0.63166326", "0.62577915", "0.6230915", "0.6212493", "0.6163979", "0.60827714", "0.6009272", "0.5990768", "0.5990521", "0.5979753", "0.5979753", "0.5974482", "0.5944724", "0.5919892", "0.5919619", "0.5919449", "0.59115267", "0.5900052",...
0.69970137
1
Quality filters reads minlen discard all shorter reads Returns nothing
def filter(minlen) return if skip_step?(@names.get('filter'), 'filtering') # Only filter input files from Illumina CASAVA 1.8 pipeline if `head -n 1 #{@names.get('reads')} | cut -d ' ' -f 3`.empty? run_cmd( 'fastq_illumina_filter' \ " --keep N -v -l #{minlen} "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_quality(min_quality)\n mode_lines = @raw_data.scan(/harminv.*:, (\\d.*)/).join \"\\n\"\n CSV.parse(mode_lines,\n :converters => :numeric).find_all {|nums| nums[2].abs > min_quality}\n end", "def truncate_samples\n @samples.sort!{|a,b| a.duration <=> b.duration}\n ...
[ "0.6319621", "0.59022206", "0.56703275", "0.554758", "0.547377", "0.5358833", "0.52611023", "0.52033067", "0.5195612", "0.518653", "0.5154959", "0.5139686", "0.5112837", "0.50397307", "0.5037474", "0.5036198", "0.5016747", "0.5008545", "0.49940056", "0.49842885", "0.49832982"...
0.7177229
0
Clips linker from 3' linker string to be clipped from 3' software clipping software (fastx, cutadapt) error_rate allowed error rate (only for cutadapt) minlen discard all shorter reads Returns nothing.
def clip(linker, software, error_rate, minlen) return if skip_step?(@names.get('clip'), 'clipping') clipper_cmd = { fastx: \ 'fastx_clipper' \ ' -Q33 -c -n -v' \ " -a #{linker}" \ " -l #{minlen}" \ " #{@names.base}" \ " -...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spelling_penalty\n chars.inject_with_index(0) do |penalty, char, i| \n if i < @options[:target].size\n # add to penalty the differences between ascii values in the two strongs * the multiplier\n penalty + ((@options[:target][i] - char[0]).abs * @options[:spelling_multiplier])\n ...
[ "0.48733142", "0.47056305", "0.47010913", "0.47010913", "0.46958846", "0.46873704", "0.4680276", "0.45950803", "0.45738348", "0.45472252", "0.45407587", "0.4518334", "0.4510734", "0.44531837", "0.44484276", "0.44479308", "0.44177917", "0.43902066", "0.43876725", "0.43861017", ...
0.66380143
0
PreComputes index if it does not exist ref path to reference ref_base path to reference without file extension software alignment software (bowtie1, bowtie2, bwa, star) annotation path to GTF annotation (only star) Returns nothing
def index(ref, ref_base, software, annotation = '') index_suffix = { bowtie1: '4.ebwt', bowtie2: '4.bt2', bwa: '.sa', star: '.star' } index_cmd = { bowtie1: "bowtie-build -p #{ref} #{ref_base}", bowtie2: "bowtie2-build -p #{ref} #{ref_b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute\n index(@ref, @ref_base, @software, @annotation)\n\n if @err_rate > 0\n bucketized_alignment\n else # software == :star || err_rate == 0\n unbucketized_alignment\n end\n end", "def initialize(annot)\n @annot = annot\n @id2name = {}\n @...
[ "0.55707574", "0.5537845", "0.52282965", "0.5211746", "0.514618", "0.5114455", "0.50818527", "0.5056654", "0.504273", "0.50184566", "0.50184566", "0.49482235", "0.4944961", "0.49263582", "0.48924422", "0.48880744", "0.48818028", "0.48589686", "0.48510918", "0.48327085", "0.47...
0.6362013
0
Performs alignment ref path to genomic reference ref_base path to reference without file extension software alignment software (bowtie1, bowtie2, bwa, star, tophat) opts stepspecific options :annotation path to genomic annotation :mismatches max num of mismatches in alignment :seedlen seed length for ncRNA alignment :t...
def align(ref, ref_base, software, opts = {}) if software == :tophat bt_flag = opts[:tophat_aligner] == :bowtie1 ? '--bowtie1' : '' gap_flag = opts[:mismatches] < 2 ? "--read-gap-length #{opts[:mismatches]}" : '' end aln_cmd = { bowtie1: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unbucketized_alignment\n align(\n @ref, @ref_base, @software,\n { annotation: @annotation,\n tophat_aligner: @tophat_aligner,\n mismatches: @mismatches\n }\n )\n mapped_all = @software == :star ? \\\n @names.get('mapped_all_star') :...
[ "0.5709553", "0.5528572", "0.54516274", "0.5200783", "0.51840615", "0.5138118", "0.50645435", "0.49660274", "0.49483785", "0.4883737", "0.4859847", "0.48551404", "0.483638", "0.48274213", "0.48274213", "0.4795258", "0.47941756", "0.47817165", "0.47717196", "0.47586805", "0.47...
0.7185728
0
Initializes genomic alignment parameters annotation genomic annotation, needed for splicing awareness tophat_aligner software that Tophat uses (bowtie2 or bowtie1) mismatches max number of allowed mismatches in Tophat alignment err error rate for STAR / bucketizing
def initialize(names, force_overwrite, ref, software, annotation, tophat_aligner, mismatches, err_rate) super(names, force_overwrite, ref, software) @annotation = annotation @tophat_aligner = tophat_aligner @mismatches = mismatches @err_rate = err_rate ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(seq_name,seq_fasta,seq_qual, seq_comment = '')\n super\n\n @actions = []\n @seq_fasta_orig = seq_fasta\n @seq_fasta = seq_fasta\n \n @seq_qual_orig = seq_qual\n @seq_qual = seq_qual \n \n @insert_start = 0\n @insert_end = seq_fasta.length-1 \n \n @stats={}\n ...
[ "0.52725923", "0.5269229", "0.5243173", "0.515901", "0.51487947", "0.50884366", "0.5077564", "0.49884474", "0.49591947", "0.49542058", "0.4874891", "0.4868386", "0.48597658", "0.48050168", "0.47810596", "0.475977", "0.47541583", "0.4708687", "0.4702784", "0.47009873", "0.4695...
0.6461289
0
Performs genomic alignment with relative error rate (buckets)
def bucketized_alignment # split reads into buckets according to their size and err_rate @buckets = bucketize(@err_rate) # perform alignment on each bucket @buckets.reverse_each do |lower, upper, mismatches| @names.set_bucket(lower, upper) mapped, unmapped = align( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute\n index(@ref, @ref_base, @software, @annotation)\n\n if @err_rate > 0\n bucketized_alignment\n else # software == :star || err_rate == 0\n unbucketized_alignment\n end\n end", "def genome(liszt)\n=begin\n[samopen] SAM header is present: 2 sequences\n...
[ "0.6932818", "0.62225187", "0.59439397", "0.56329626", "0.56171745", "0.56026036", "0.5581892", "0.5529177", "0.54790694", "0.54771227", "0.53738934", "0.53588796", "0.5328883", "0.53188115", "0.52838665", "0.5278783", "0.5278012", "0.52259076", "0.5207305", "0.51924706", "0....
0.74868
0
Performs genomic alignment with fixed number of allowed mismatches
def unbucketized_alignment align( @ref, @ref_base, @software, { annotation: @annotation, tophat_aligner: @tophat_aligner, mismatches: @mismatches } ) mapped_all = @software == :star ? \ @names.get('mapped_all_star') : @names.get('ma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_alignment\n # init vars\n @names = []\n @seqs = []\n \n @alignment = \"-B #{@basename}.aln\"\n\n # import alignment file\n @content = IO.readlines(@infile).map {|line| line.chomp}\n \n #check alignment for gap-only columns\n remove_inserts\n \n #write query-file\n ...
[ "0.62253803", "0.58747196", "0.5843623", "0.5830741", "0.5824848", "0.5820188", "0.58144766", "0.5750869", "0.5593341", "0.55397415", "0.5529191", "0.54764867", "0.54322106", "0.5425921", "0.54136413", "0.5409192", "0.5378132", "0.53759843", "0.53000605", "0.5279042", "0.5265...
0.61717033
1
Splits reads into several files containing a read length range to allow for seperate alignments with a relative number of errors. error rate = num of errors / read length Returns array.
def bucketize(error_rate) buckets = [] run_cmd( "fastq-bucketize #{@names.get('fp')} #{error_rate} " \ "2> #{@names.get('buckets')}" ) # parse buckets and compute corresponding absolute number of errors File.readlines(@names.get('buckets')).each do |line| ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def array_by_40_characters \n recieve_and_read_file.scan(/.{1,40}/)\n end", "def sub_chunks(data_offset: 0, sub_chunk_size_length: @size_length, sub_chunk_header_size: @header_size, sub_chunks_format: @chunks_format, warnings: @warnings, debug: @debug, &callback)\n data_size = self.size\n data_size...
[ "0.52647674", "0.51238215", "0.49227256", "0.4905906", "0.4859709", "0.48278394", "0.47935632", "0.47273198", "0.47244495", "0.4696616", "0.4696616", "0.4687543", "0.4668299", "0.46392527", "0.4590947", "0.4578109", "0.45562068", "0.4546629", "0.4539287", "0.4511761", "0.4499...
0.55839044
0
Merges bucketed alignments into single bam file infiles array of filenames outfile merged file
def unbucketize(infiles, outfile) run_cmd("samtools merge -f #{outfile} #{infiles.join(' ')}") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bucketized_alignment\n # split reads into buckets according to their size and err_rate\n @buckets = bucketize(@err_rate)\n\n # perform alignment on each bucket\n @buckets.reverse_each do |lower, upper, mismatches|\n @names.set_bucket(lower, upper)\n mapped, unmappe...
[ "0.627244", "0.6105935", "0.60039854", "0.58686095", "0.56690675", "0.5590018", "0.556866", "0.55033255", "0.54632646", "0.5396619", "0.53854", "0.5342837", "0.5342266", "0.53063905", "0.52958137", "0.5234907", "0.51962095", "0.5195997", "0.5194503", "0.5163467", "0.51433927"...
0.7179231
0
Extracts uniquely mapping reads
def extract_uni # Extract all uniquely mapping reads run_cmd( "samtools view -H #{@names.get('mapped_merged')} " \ "> #{@names.get('mapped_uniq')}" ) run_cmd( "samtools view -h #{@names.get('mapped_merged')} " \ "| grep -P 'NH:i:1(\t|$)' " \ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remapped_reads(input_file, output_file, read_length, mm=2)\n\t\tremapped = {}\n\t\t\n\t\t# Filter remapped reads\n\t\tinput_file.each do |line|\n\t\t\tmdz = line.match(/MD:Z:\\S*/).to_s\n\t\t\tline = line.strip.split(/\\s+/)\n\t\t\tqname, mate = line[0].split('/')\n\t\t\tpos = line[2].split(':')\n\t\t\tcigar =...
[ "0.6373402", "0.6143493", "0.59263504", "0.57691497", "0.5676399", "0.5657573", "0.5556849", "0.5538333", "0.55204505", "0.5498366", "0.5496701", "0.5448031", "0.53502053", "0.5329921", "0.52846646", "0.52826154", "0.5208021", "0.5208021", "0.51964045", "0.51787305", "0.51546...
0.740286
0
POST /apps/exists.xml POST /apps/exists.json
def exists @record = Record.new app = App.find_by_packageName(params[:packageName], :select => :id) if app.nil? @record.exists = false else @record.id = app.id @record.exists = true end respond_to do |format| format.xml {render :xml => @record} format.json {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exists?\n json['exists']\n end", "def has_app_action\n validate :uuid, /^[a-zA-Z0-9]+$/\n validate :application, /^[a-zA-Z0-9]+$/\n uuid = request[:uuid]\n app_name = request[:application]\n if File.exist?(\"/var/lib/openshift/#{uuid}/#{app_name}\")\n reply[:ou...
[ "0.6413426", "0.6083834", "0.57530457", "0.5716068", "0.55992895", "0.5566655", "0.5526369", "0.55217683", "0.5510037", "0.549786", "0.5477157", "0.5470329", "0.5452816", "0.544372", "0.54398584", "0.543484", "0.5399404", "0.5377472", "0.53333384", "0.5328893", "0.53184444", ...
0.68885815
0
Subclassification of the packaging type for this deposit, such as a METS profile.
def deposit_package_subtype 'https://jats.nlm.nih.gov/publishing/' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deposit_package_subtype\n 'ProQuest'\n end", "def writeup_classification\n classification_label().split(\"-\").first\n end", "def sub_type\n @sub_type || parse_and_return(:@sub_type)\n end", "def writeup_classification\n classification_label.split(\"-\").first\n en...
[ "0.7367067", "0.59793675", "0.5879135", "0.58740616", "0.5836648", "0.5623186", "0.5592812", "0.5577389", "0.5480861", "0.541264", "0.541264", "0.54093224", "0.5404062", "0.53890365", "0.5334105", "0.5334105", "0.5327387", "0.5320731", "0.531167", "0.5271905", "0.5266696", ...
0.6812239
1
Create a new server connection FluidDB::Connection.new(:test) will use the sandbox Params: __username__ __password__ __server__ __schema__ Could be 'http' or 'https' __port__ Change default port (443 for https and 80 for http)
def initialize(args) @params = args == :test ? SANDBOX : DEFAULT.merge(args) @params[:port] ||= @params[:scheme] == 'https' ? 443 : 80 connect end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_test_server\n {\n 'name' => 'test_db',\n 'address' => '172.19.108.5',\n 'database' => 'MigrationTest',\n 'username' => 'jenkins',\n 'password' => 'QDfVkyVn8tk6'\n }\nend", "def initialize(host, port, password, type=HLDS)\n @host = host\n @port = port\n @password = password\...
[ "0.6575973", "0.63804036", "0.62315804", "0.61822844", "0.6164898", "0.6145027", "0.61370987", "0.6126241", "0.6084073", "0.60745937", "0.6043617", "0.60184824", "0.59785104", "0.5972319", "0.59659743", "0.5921441", "0.5912027", "0.5903905", "0.58972245", "0.5890872", "0.5845...
0.69465876
0
GET /uang_masuks/1 GET /uang_masuks/1.json GET /uang_masuks/new
def new @uang_masuk = UangMasuk.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @manga = Manga.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @manga }\n end\n end", "def new\n @jamaat = Jamaat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @jamaat }\n end\n e...
[ "0.74359715", "0.72972745", "0.72335505", "0.71722674", "0.7165662", "0.715485", "0.71110934", "0.70961934", "0.7043198", "0.7035463", "0.6986085", "0.69837177", "0.6966193", "0.69611734", "0.6947536", "0.6927173", "0.6924353", "0.69206536", "0.69088465", "0.68979883", "0.686...
0.73136866
1
POST /uang_masuks POST /uang_masuks.json
def create @uang_masuk = UangMasuk.new(uang_masuk_params) respond_to do |format| if @uang_masuk.save format.html { redirect_to uang_masuks_path, notice: 'Uang masuk was successfully created.' } else format.html { render :new } format.json { render json: @uang_masuk.errors, s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uang_masuk_params\n params.require(:uang_masuk).permit(:jumlah, :tanggal, :keterangan)\n end", "def create\n @mata_matum = MataMatum.new(mata_matum_params)\n\n respond_to do |format|\n if @mata_matum.save\n format.html { redirect_to @mata_matum, notice: 'Mata matum was successfully ...
[ "0.6765135", "0.6558367", "0.64361453", "0.64069957", "0.6372077", "0.63490796", "0.6300831", "0.62534034", "0.6252394", "0.6232137", "0.62242776", "0.6219938", "0.61723536", "0.61279565", "0.61261934", "0.6087251", "0.607512", "0.6014324", "0.5990471", "0.5990286", "0.597366...
0.74192625
0
PATCH/PUT /uang_masuks/1 PATCH/PUT /uang_masuks/1.json
def update respond_to do |format| if @uang_masuk.update(uang_masuk_params) format.html { redirect_to @uang_masuk, notice: 'Uang masuk was successfully updated.' } format.json { render :show, status: :ok, location: @uang_masuk } else format.html { render :edit } format.jso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @municao.update(municao_params)\n format.html { redirect_to @municao, notice: 'A Munição foi editada com sucesso!' }\n format.json { render :show, status: :ok, location: @municao }\n else\n format.html { render :edit }\n format.json ...
[ "0.6621979", "0.66182715", "0.6617474", "0.6602954", "0.6565074", "0.6554986", "0.65191126", "0.6513416", "0.65086436", "0.65006024", "0.6457103", "0.6387565", "0.63814646", "0.63745594", "0.6361265", "0.6346211", "0.6342107", "0.63342166", "0.6324423", "0.6323482", "0.630938...
0.6941636
0
DELETE /uang_masuks/1 DELETE /uang_masuks/1.json
def destroy @uang_masuk.destroy respond_to do |format| format.html { redirect_to uang_masuks_url, notice: 'Uang masuk was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @jamaat = Jamaat.find(params[:id])\n @jamaat.destroy\n\n respond_to do |format|\n format.html { redirect_to jamaats_url }\n format.json { head :ok }\n en...
[ "0.7298238", "0.72319317", "0.72173846", "0.7208355", "0.71664023", "0.7165098", "0.71593475", "0.71474856", "0.71457386", "0.7130274", "0.71219695", "0.7111745", "0.7110901", "0.7098837", "0.70826423", "0.7076899", "0.7068214", "0.70646155", "0.7061949", "0.7060429", "0.7059...
0.74981093
0
Ensure that every criterion that is supposed to be in this level is selectable, and that every criterion that is not supposed to be in this level is not selectable. rubocop:disable Metrics/MethodLength
def only_correct_criteria_selectable(level) Criteria.keys do |query_level| Criteria[query_level].each do |criterion| if query_level == level assert_select '#' + criterion.to_s assert_select "#project_#{criterion}_status_met" elsif !Criteria[level].key?(criterion) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_conditions level\n (get_level <= level and !@turn_off)\n end", "def actual_level_of_effort_only_on_completion\n if actual_level_of_effort.nil? && status == \"completed\"\n errors.add(:status, \"must have actual level of effort if complete\")\n elsif !actual_level_of_effort.nil?\n ...
[ "0.6053208", "0.56069434", "0.54321605", "0.5352756", "0.52428716", "0.5224901", "0.5192965", "0.5175696", "0.5145365", "0.5132913", "0.51296735", "0.5120049", "0.5120049", "0.5113218", "0.5041589", "0.5032248", "0.50028133", "0.4991241", "0.49846005", "0.4965926", "0.4957848...
0.7640995
1
:section: Basics Some commands sometimes cause side effects. When evaluating arguments, if you discover that undoing doesn't make sense, and will be confusing to the user, call dont_undo, and the interpreter will ignore the call for purposes of undoing
def dont_undo @should_undo = false return nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def undo\n\t\t\n\tend", "def undo\n\t\t\n\tend", "def test_undo_quick_start\n job 'jobbist'\n\n start 'jobbist'\n pause\n start\n message = undo\n assert_message(lines(undid_prefix('quick_start'),\n undid_restart_quickly('jobbi...
[ "0.64404494", "0.64404494", "0.626697", "0.6181161", "0.6152248", "0.61470264", "0.60993606", "0.60690165", "0.59408873", "0.59353113", "0.5875205", "0.5849912", "0.5845147", "0.5778812", "0.5750887", "0.57296675", "0.5691882", "0.5619012", "0.5612826", "0.55998266", "0.55998...
0.68540466
0