query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Unlinks a Github account of a project
def unlink_github @project = Project.find(params[:project_id]) Project.delete_hooks(@project) @project.github_token = nil @project.github_user = nil @project.repo_name = nil @project.save redirect_to boards_project_path(@project) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_link(project_link)\n self.project_links.destroy(project_link)\n end", "def unlink_project\n self.project.remove_groupID(self.id.to_s)\n end", "def del_project(username, projectname)\n project = GithubRepo.find_by(github_user: username, project_name: projectname, user_id: current_user)\n ...
[ "0.6746134", "0.6409688", "0.6373998", "0.6308269", "0.61432177", "0.6113208", "0.5977645", "0.593244", "0.59294844", "0.5882664", "0.5840274", "0.5822531", "0.5811494", "0.5777927", "0.57752156", "0.5702263", "0.567641", "0.567641", "0.56446224", "0.56415427", "0.5628786", ...
0.7925624
0
Creates the information for a new project, set it status, and set it Project Manager
def create @project = Project.new(params[:project]) @project.initial_date = Time.now respond_to do |format| if @project.save if @project.github_token? && @project.repo_name? create_hook end Status.create({name: 'Backlog', project_id: @project.id, order: 1 }) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @project = Project.new(params[:project])\n @project.status = \"Etat zero\"\n creator = current_user\n ProjectUser.create(:project => @project, :user => creator, :admin => true)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Proje...
[ "0.76414704", "0.7507408", "0.74869543", "0.7455397", "0.74453115", "0.7384747", "0.73751885", "0.7363166", "0.7307042", "0.7288339", "0.7281036", "0.72638863", "0.7214287", "0.7194598", "0.7191992", "0.7174456", "0.7169203", "0.71615064", "0.7157427", "0.7150102", "0.7144460...
0.0
-1
Changes the information of a project
def update @project = Project.find(params[:id]) #@old_repo = @project.repo_name respond_to do |format| if @project.update_attributes(params[:project]) if @project.github_token? && @project.repo_name? create_hook end format.html { redirect_to projects_path, notice: 'P...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_project(project, ptProject)\n project.title = ptProject.name\n project.current_iteration_id = ptProject.current_iteration_number\n project.save\n end", "def change_project(name)\n update!(name: name)\n end", "def update_project\n self.project.update_project\n #not updating when a...
[ "0.79321295", "0.77655214", "0.7603246", "0.746007", "0.7339929", "0.7329757", "0.7167107", "0.71178883", "0.71005803", "0.71005803", "0.7025863", "0.7025504", "0.70186955", "0.6999068", "0.6963989", "0.6934113", "0.6933989", "0.69297177", "0.69279075", "0.69079244", "0.69034...
0.0
-1
Deletes a project of the application and redirects the webpage
def destroy @project = Project.find(params[:id]) @project.destroy respond_to do |format| format.html { redirect_to projects_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n redirect_to index_project_path\n end", "def destroy\n if @project.destroy\n redirect_to root_path\n else\n redirect_to root_path\n end\n end", "def destroy\n @project.destroy\n\n head :no_content\n end", "def destroy\n @project.destroy\n head :no_content\n ...
[ "0.81624764", "0.8147857", "0.80395293", "0.80106455", "0.789567", "0.7869901", "0.7751657", "0.77338284", "0.77244455", "0.7710693", "0.7702147", "0.7701186", "0.7678099", "0.76577705", "0.7637539", "0.76181376", "0.76125723", "0.7596481", "0.7594361", "0.7590717", "0.758341...
0.7588872
20
Declares a project as Finished
def finish @project = Project.find(params[:id]) @project.project_status = ProjectStatus.where(:name => "Finished") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def finish\n @finish = true\n end", "def finish\n end", "def finish\n #\n end", "def finish\n @Done = true \n end", "def finish\n #\n end", "def finish\r\n #\r\n end", "def finished\n @finished = true\n end", "def finish\n true\n end", ...
[ "0.65256995", "0.6503717", "0.6410144", "0.6382301", "0.63808155", "0.6316272", "0.6311282", "0.6218554", "0.6149412", "0.6149412", "0.6149412", "0.6149412", "0.6149412", "0.6149412", "0.6149412", "0.6149412", "0.6139405", "0.61347246", "0.6074108", "0.605456", "0.5988429", ...
0.6883656
0
Deletes the link of a project with Dropbox
def delete_dbtoken @project = Project.find(params[:id]) @project.dropbox_token=nil @project.save redirect_to session[:return_to] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_from_dropbox\n s = Entry.dropbox_session\n begin\n self.update_attributes :public_url=>nil,:is_private=>true\n to = \"Public#{self.dropbox_dir}/#{self.dropbox_file}\"\n if File.exists?(\"#{DROPBOX.home}/#{to}\")\n s.delete(to)\n end\n rescue Exception => msg\n lo...
[ "0.74035084", "0.7082595", "0.70525914", "0.68942463", "0.6860184", "0.6854707", "0.682341", "0.6729651", "0.672934", "0.67265064", "0.67249113", "0.6680352", "0.6664429", "0.6626331", "0.66125846", "0.66093284", "0.6594352", "0.6576699", "0.6557553", "0.6554012", "0.65519893...
0.7147793
1
Sends confirmation document, and read me document to a recent linked Dropbox's repository Puts a README file on the folder of Dropbox, when the link has just been done.
def send_confirmation_doc if params[:project_id] project = Project.find(params[:project_id]) dbsession = DropboxSession.deserialize(project.dropbox_token) file_path = project.name + "/" + "README_DROPBOX.txt" file = open('doc/README_DROPBOX.txt') begin client = DropboxClient.n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_quest\n send_file(\"#{RAILS_ROOT}/public/questionnaire.doc\") \n end", "def download_note\n document = Document.find(params[:id])\n authorize! :download_note, document\n \n begin\n upload = Upload.find(params[:upload_id])\n rescue\n puts \"### ERROR: \" + e.message\n ...
[ "0.57542014", "0.5734561", "0.551981", "0.5469831", "0.54009384", "0.53989506", "0.5392556", "0.53840905", "0.53827345", "0.5370552", "0.5265827", "0.5262181", "0.5177055", "0.5176141", "0.51667", "0.5153549", "0.5149573", "0.51486766", "0.5146515", "0.5145998", "0.51347136",...
0.75388074
1
Render a JSON file for report user's hours between two given dates
def reports_hours_users @initial_date = Date.strptime(params[:initial_date], "%m/%d/%Y") @final_date = Date.strptime(params[:final_date], "%m/%d/%Y") @count = @project.count_confirmed_users respond_to do |format| format.json end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hv_export_user_hours(oHarvest, oStartDate, oEndDate, iDbg =0)\n\n users = oHarvest.users.all\n repos = oHarvest.reports\n\n summary = Array.new()\n\n\tusers.each do |u|\n if (u.is_active == true && u.is_admin == false) \n \n printf(\"Processing User[%s] ...\\n\", u.first_n...
[ "0.6514752", "0.6421403", "0.63968194", "0.61914665", "0.61464137", "0.5881335", "0.58793277", "0.58585054", "0.5839321", "0.5796528", "0.5760908", "0.5720097", "0.56752104", "0.56607443", "0.5646421", "0.5644735", "0.56303334", "0.56016904", "0.5586002", "0.5567389", "0.5554...
0.66229826
0
Render a JSON file for report project's tasks between two given dates
def reports_tasks_project @initial_date = Date.strptime(params[:initial_date], "%m/%d/%Y") @final_date = Date.strptime(params[:final_date], "%m/%d/%Y") respond_to do |format| format.json end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @task = Task.new\n if params[:range].blank?\n @daterange = Date.today.beginning_of_month.strftime('%Y/%m/%d') + ' - ' + Date.today.end_of_month.strftime('%Y/%m/%d')\n else\n @daterange = params[:range]\n end\n @tasks = Task.between(@daterange).includes(:project)\n\n if param...
[ "0.6721312", "0.64667714", "0.6405863", "0.621128", "0.62036014", "0.6127452", "0.6103549", "0.5998134", "0.59397745", "0.5935825", "0.59073144", "0.59039104", "0.5885069", "0.5882833", "0.5880427", "0.5733348", "0.57272345", "0.57212704", "0.5719472", "0.5705208", "0.5587422...
0.72180927
0
Render a JSON file for report user's tasks between two given dates
def reports_tasks_user @initial_date = Date.strptime(params[:initial_date], "%m/%d/%Y") @final_date = Date.strptime(params[:final_date], "%m/%d/%Y") @count = @project.count_confirmed_users respond_to do |format| format.json end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reports_tasks_project\n @initial_date = Date.strptime(params[:initial_date], \"%m/%d/%Y\")\n @final_date = Date.strptime(params[:final_date], \"%m/%d/%Y\")\n \n respond_to do |format|\n format.json\n end\n end", "def get_events\t\t\t\n @task = UserEvent.where(\"user_id\"=>current_...
[ "0.67848104", "0.6637397", "0.63284135", "0.6295654", "0.6290339", "0.6212802", "0.6105855", "0.6009811", "0.59161454", "0.5903486", "0.5893841", "0.58611006", "0.5860559", "0.5844663", "0.5841802", "0.5841726", "0.57987463", "0.579225", "0.56975067", "0.5694378", "0.5692782"...
0.67821354
1
param t [Numeric] a timestamp param ms [Bool] whether the timestamp is in milliseconds
def initialize(time, in_ms = false) @t = time @ms = in_ms end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timing(stat, ms, sample_rate=1)\n send_stat(stat, ms, :ms, sample_rate)\n end", "def timing(stat, ms, sample_rate=1)\n send_stats stat, ms, :ms, sample_rate\n end", "def timing(stat, ms, sample_rate=1); send stat, ms, 'ms', sample_rate end", "def timestamp t\n\n\t\t::Pantheios::Core.timestamp...
[ "0.6278772", "0.617219", "0.61196303", "0.5920793", "0.5827216", "0.5571296", "0.5564369", "0.55586344", "0.5513094", "0.5512877", "0.54780227", "0.543683", "0.5430267", "0.54209656", "0.54005224", "0.5389783", "0.5389783", "0.5363131", "0.5336264", "0.5299455", "0.5287532", ...
0.6222301
1
GET /daughters GET /daughters.json
def index if (params[:redirect] == "on") sql = <<-SQL WITH src AS (SELECT id, daughters(id) FROM kine WHERE owner_id = #{params[:search_owner]}) SELECT json_agg(src) FROM src; SQL render json: ActiveRecord::Base.connection.select_value(sql) else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index_attending\n puts \"user: #{@current_user.json_hash[:id]}\"\n dinners = []\n @dinners = @current_user.attended_dinners\n @dinners.each do |dinner|\n dinners << dinner.all_info\n end\n render json: dinners\n end", "def index\n puts \"user: #{@current_user.json_hash[:id]}\"\n ...
[ "0.64410955", "0.62631136", "0.616297", "0.6066369", "0.6055556", "0.6048744", "0.60483015", "0.60377634", "0.5994807", "0.59811044", "0.59159106", "0.5899348", "0.58975494", "0.58632755", "0.5861067", "0.58549124", "0.583721", "0.5811735", "0.58050966", "0.5801655", "0.58010...
0.6952484
0
GET /daughters/1 GET /daughters/1.json
def show if (params[:redirect] == "on") sql = <<-SQL with src AS (SELECT daughters(ear_num) FROM kine WHERE id = #{params[:id]}) select json_agg(src) FROM src; SQL render json: ActiveRecord::Base.connection.select_value(sql) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n if (params[:redirect] == \"on\")\n sql = <<-SQL\n WITH src AS (SELECT id, daughters(id)\n FROM kine WHERE owner_id = #{params[:search_owner]})\n SELECT json_agg(src) FROM src;\n SQL\n render json: ActiveRecord::Base.connection.select_value(sql)\...
[ "0.6732967", "0.6227481", "0.61197037", "0.6099191", "0.6090196", "0.60754496", "0.6063017", "0.6057639", "0.60047877", "0.5960744", "0.59535515", "0.5922553", "0.59179", "0.5899176", "0.5898833", "0.58757645", "0.5872451", "0.5849521", "0.58379185", "0.5834095", "0.5833086",...
0.5921644
12
POST /daughters POST /daughters.json
def create @daughter = Daughter.new(daughter_params) respond_to do |format| if @daughter.save format.html { redirect_to @daughter, notice: 'Daughter was successfully created.' } format.json { render action: 'show', status: :created, location: @daughter } else format.html { r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def daughter_params\n params.require(:daughter).permit(:owner_id)\n end", "def destroy\n @daughter.destroy\n respond_to do |format|\n format.html { redirect_to daughters_url }\n format.json { head :no_content }\n end\n end", "def set_daughter\n # @daughter = Daughter.find(param...
[ "0.58734417", "0.5799347", "0.57280344", "0.5706291", "0.565495", "0.5640241", "0.55595624", "0.5500485", "0.5491674", "0.54856557", "0.54805136", "0.5475756", "0.54699785", "0.5449389", "0.54474837", "0.5425771", "0.5425641", "0.5403521", "0.5396979", "0.53969467", "0.539585...
0.6812
0
PATCH/PUT /daughters/1 PATCH/PUT /daughters/1.json
def update respond_to do |format| if @daughter.update(daughter_params) format.html { redirect_to @daughter, notice: 'Daughter was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @daughter.erro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @bubble_tea = BubbleTea.find(params[:id])\n\n if @bubble_tea.update(bubble_tea_params)\n render json: @bubble_tea\n else\n render plain: \"Failed to update drink information\"\n end\n end", "def update\n if @person.seat\n render json: {errors: 'Cannot update a seated p...
[ "0.6255135", "0.6196896", "0.6118413", "0.61164534", "0.60464406", "0.5994017", "0.5986388", "0.59475285", "0.59287924", "0.5904465", "0.5904465", "0.5904465", "0.5900245", "0.58838326", "0.58799523", "0.58746976", "0.5850866", "0.580956", "0.57989407", "0.57828635", "0.57724...
0.6917803
0
DELETE /daughters/1 DELETE /daughters/1.json
def destroy @daughter.destroy respond_to do |format| format.html { redirect_to daughters_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @d_dungeoneer.destroy\n respond_to do |format|\n format.html { redirect_to d_dungeoneers_url, notice: 'D dungeoneer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n #add ad...
[ "0.69272935", "0.68941224", "0.68666065", "0.68558174", "0.6805596", "0.6768924", "0.67554295", "0.6746297", "0.668739", "0.66828275", "0.66432166", "0.6615899", "0.6611136", "0.6601472", "0.6597113", "0.6597113", "0.6595695", "0.6580509", "0.6573838", "0.65736747", "0.656909...
0.75362
0
Use callbacks to share common setup or constraints between actions.
def set_daughter # @daughter = Daughter.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def daughter_params params.require(:daughter).permit(:owner_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_review review = Review.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Only allow a list of trusted parameters through.
def review_params params.require(:review).permit(:first_name, :last_name, :product_name, :image_url, :location, :feedback, :stars, :category_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "def param_whitelist\n [:role, :title]\...
[ "0.69497335", "0.6812623", "0.6803639", "0.6795365", "0.67448795", "0.67399913", "0.6526815", "0.6518771", "0.64931697", "0.6430388", "0.6430388", "0.6430388", "0.63983387", "0.6356042", "0.63535863", "0.63464934", "0.63444513", "0.6337208", "0.6326454", "0.6326454", "0.63264...
0.0
-1
This challenge took me 1 hours. Pseudocode Input: Integer Output: Boolean result with string description indicating whether number is part of Fibonacci sequence Steps: 1. Define a method that takes in a parameter, num. 2. Create a counter and assign it a value of 0. 3. Initialize an array and store it with the numbers ...
def is_fibonacci?(num) array = [0,1] while array[-1] < num do array << (array[-1] + array[-2]) end return array[-1] == num end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_fibonacci?(num)\n array = [0, 1, 1]\n current = 0\n while current <= num\n array << array[array.length - 1] + array[array.length - 2]\n current = array[array.length - 1]\n end\n if array.include?(num)\n p true\n else \n p false\n end\nend", "def is_fibonacci?(num)\n newarray = [0,1]\n ...
[ "0.86957765", "0.86216414", "0.86146635", "0.8535797", "0.85069525", "0.8471718", "0.8467941", "0.84678197", "0.8414427", "0.8405667", "0.8402335", "0.84015685", "0.8390885", "0.83854353", "0.83696735", "0.83373225", "0.8329044", "0.8319227", "0.8309688", "0.82943887", "0.828...
0.86258316
1
Create new Relation object. If +id+ is +nil+ a new unique negative ID will be allocated.
def initialize(id=nil, user=nil, timestamp=nil, members=[], uid=-1, version=1, visible=nil) @members = members super(id, user, timestamp, uid, version, visible) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new(relation, attributes = self.attributes)\n self.class.new(relation, attributes)\n end", "def new(relation, **new_options)\n self.class.new(relation, **options, **new_options)\n end", "def new(new_relation)\n self.class.build(new_relation, **options, source: relation)\n end", ...
[ "0.60958904", "0.6049032", "0.5904735", "0.5896471", "0.5887213", "0.5803244", "0.57957876", "0.57703936", "0.57665205", "0.57653207", "0.5746039", "0.57356995", "0.5538576", "0.5531756", "0.5517599", "0.5472835", "0.54177976", "0.54074585", "0.5397509", "0.5397509", "0.53468...
0.0
-1
Add one or more tags or members to this relation. The argument can be one of the following: If the argument is a Hash or an OSMLib::Element::Tags object, those tags are added. If the argument is an OSMLib::Element::Member object, it is added to the relation If the argument is an Array the function is called recursively...
def <<(stuff) case stuff when Array # call this method recursively stuff.each do |item| self << item end when OSMLib::Element::Member members << stuff else tags.merge!(stuff) end self # return self to allow chaining ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(*arguments)\n Element.parse(arguments.flatten, @options).each do |element|\n data << element.added_to_bibliography(self)\n end\n self\n end", "def push(*members)\n @members.concat members.map(&method(:cast_value))\n self\n end", "def <<(member)\n sha...
[ "0.59140795", "0.55787265", "0.54993045", "0.5464552", "0.54486245", "0.54464674", "0.53934973", "0.53708196", "0.53276503", "0.5265452", "0.5172255", "0.5166112", "0.51641184", "0.5152275", "0.50802106", "0.5064316", "0.5063033", "0.5059002", "0.5023264", "0.49743", "0.49617...
0.65866494
0
Returns a polygon made up of all the ways in this relation. This works only if it is tagged with 'polygon' or 'multipolygon'.
def polygon raise OSMLib::Error::NoDatabaseError.new("can't create Polygon from relation if it is not in a OSMLib::Database") if @db.nil? raise OSMLib::Error::NoDatabaseError.new("can't create Polygon from relation if it does not represent a polygon") if self['type'] != 'multipolygon' and self['type'] !...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_polygon\n GeoRuby::SimpleFeatures::Polygon.from_points([@points[0] == @points[-1] ? @points : (@points + [@points[0].clone])])\n end", "def georss_simple_representation(options)\r\n georss_ns = options[:georss_ns] || \"georss\"\r\n geom_attr = options[:geom_attr]\r\n \"<#...
[ "0.6929214", "0.65187573", "0.6475501", "0.625394", "0.6125536", "0.61036867", "0.6023687", "0.6002644", "0.5975511", "0.5902019", "0.58667105", "0.58483064", "0.58363086", "0.5804994", "0.57052374", "0.57037073", "0.56810164", "0.5676538", "0.5585769", "0.5567893", "0.554624...
0.736391
0
Return all the member objects of this relation.
def member_objects members.collect do |member| obj = case member.type when :node, 'node' then @db.get_node(member.ref) when :way, 'way' then @db.get_way(member.ref) when :relation, 'relation' then @db.get_relation(member.ref) end rais...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def members\n @members ||= relation_members.map do |member|\n [member.member_type, member.member_id, member.member_role]\n end\n end", "def members\n return @members\n end", "def members\n return @members\n end", "def members\n re...
[ "0.78076506", "0.7674348", "0.7674348", "0.7674348", "0.7674348", "0.76589996", "0.7297979", "0.7240682", "0.72166216", "0.72166216", "0.7134804", "0.7126747", "0.7126201", "0.70761", "0.7029549", "0.70167905", "0.701676", "0.69783956", "0.6928454", "0.6928122", "0.68805635",...
0.7028534
15
Return string version of this Relation object. callseq: to_s > String
def to_s if @visible == nil "#<OSMLib::Element::Relation id=\"#{@id}\" user=\"#{@user}\" timestamp=\"#{@timestamp}\">" else "#<OSMLib::Element::Relation id=\"#{@id}\" user=\"#{@user}\" timestamp=\"#{@timestamp}\" visible=\"#{@visible}\">" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_s\n string\n end", "def to_s\n @string\n end", "def to_s\n @string\n end", "def to_s\n @string\n end", "def to_s\n @string\n end", "def to_s\n toString\n end", "def to_s\n @string\n end", "def to_s\n @string\n end"...
[ "0.7838819", "0.78379697", "0.78379697", "0.78379697", "0.78379697", "0.77854186", "0.778239", "0.778239", "0.778239", "0.778239", "0.7737509", "0.77331793", "0.7719591", "0.77142173", "0.76687026", "0.7610636", "0.75890994", "0.75886333", "0.7577925", "0.7577925", "0.7577925...
0.0
-1
Return the member with a specified type and id. Returns nil if not found. callseq: member(type, id) > OSMLib::Element::Member
def member(type, id) members.select{ |member| member.type == type && member.ref == id }[0] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_member_by_id(id)\n @board.members.find { |m| m.id == id }\n end", "def get_member(id)\n is_admin? ? ::Refinery::Memberships::Member.find(id) : current_refinery_user\n end", "def find_member\n @member = Member.find(params[:id])\n end", "def member\n Member.find(@member...
[ "0.67088604", "0.662976", "0.62341094", "0.61532784", "0.6071528", "0.6061155", "0.59401643", "0.58684343", "0.5857592", "0.58278555", "0.5774734", "0.57629067", "0.57343894", "0.5606643", "0.55461633", "0.5508799", "0.54977024", "0.54958475", "0.54611033", "0.5458939", "0.54...
0.8151998
0
Return XML for this relation. This method uses the Builder library. The only parameter ist the builder object.
def to_xml(xml) xml.relation(attributes) do members.each do |member| member.to_xml(xml) end tags.to_xml(xml) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_xml\n builder.target!\n end", "def to_xml\n @builder.to_xml\n end", "def to_xml\n to_xml_builder.to_xml\n end", "def to_xml\n to_xml_builder.to_xml\n end", "def to_xml\n Builder.new(self).to_s\n end", "def to_xml(*)\n self\n end",...
[ "0.7793908", "0.75434244", "0.7518911", "0.7518911", "0.7459911", "0.7105695", "0.696428", "0.69376", "0.693415", "0.693415", "0.69181496", "0.6875789", "0.68251413", "0.6762833", "0.6760778", "0.6747187", "0.67372465", "0.67033917", "0.67033917", "0.6690555", "0.66835356", ...
0.6278342
50
Create a new Member object. Type can be one of 'node', 'way' or 'relation'. Ref is the ID of the corresponding Node, Way, or Relation. Role is a freeform string and can be empty.
def initialize(type, ref, role='') if type !~ /^(node|way|relation)$/ raise ArgumentError.new("type must be 'node', 'way', or 'relation'") end if ref.to_s !~ /^[0-9]+$/ raise ArgumentError end @type = type @ref = ref.to_i @role = role en...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(type, ref, role='')\n if type !~ /^(node|way|relation)$/\n raise ArgumentError.new(\"type must be 'node', 'way', or 'relation'\")\n end\n if ref.to_s !~ /^[0-9]+$/\n raise ArgumentError\n end\n @type = type\n @ref = ref.to_i\n @role = role\n end...
[ "0.70764077", "0.6987924", "0.62861145", "0.6108126", "0.60743475", "0.6033059", "0.5793556", "0.56955445", "0.56955445", "0.56955445", "0.56955445", "0.5664617", "0.56554127", "0.5607738", "0.5574434", "0.54715276", "0.5446199", "0.54303265", "0.5429742", "0.5402976", "0.539...
0.70344317
1
Return XML for this way. This method uses the Builder library. The only parameter ist the builder object.
def to_xml(xml) xml.member(:type => type, :ref => ref, :role => role) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_xml\n builder.target!\n end", "def xml_builder\n return Builder::XmlMarkup.new(:indent=>2, :margin=>4)\n end", "def to_xml\n @builder.to_xml\n end", "def builder\n @builder ||= Builder::XmlMarkup.new(:indent => 2)\n end", "def to_xml\n builder = Builder::...
[ "0.8139294", "0.80651015", "0.7963489", "0.7810626", "0.75285476", "0.7469606", "0.7455174", "0.7455174", "0.7365866", "0.7252702", "0.72349054", "0.72161746", "0.72138447", "0.72072166", "0.71695065", "0.7131512", "0.7113893", "0.7086759", "0.70460683", "0.7037614", "0.70339...
0.0
-1
Given a whole number n, a factorial is the product of all whole numbers from 1 to n. Example method call factorial(5) > 120 5! = 5 4 3 2 1
def factorial(n) for i in (1...n) n = n * i # puts n end puts n end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def factorial(n)\n product = 1\n for i in (1..n)\n product *= i\n end\n product\nend", "def factorial(n)\n (1..n).inject(1) {|product, n| product * n }\nend", "def factorial(n)\n result = 1\n\n while n > 1\n result *= n\n n -= 1\n end\n\n result\n end", "def factorial(n)\n if ...
[ "0.88029885", "0.8648249", "0.8616155", "0.85436475", "0.8485107", "0.8466493", "0.84444064", "0.8437644", "0.84350586", "0.8430868", "0.843072", "0.84282255", "0.84282255", "0.84282255", "0.84282255", "0.84246445", "0.83940005", "0.83875036", "0.83861244", "0.8384732", "0.83...
0.0
-1
POST /imagen_articulos POST /imagen_articulos.json
def create @imagen_articulo = ImagenArticulo.new(imagen_articulo_params) respond_to do |format| if @imagen_articulo.save if params[:articulo_id] @articulo = Articulo.find(params[:articulo_id]) @articulo.imagen_articulo = @imagen_articulo authorize! :editar, @art...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @objeto = Imagen.new(imagen_params)\n\n respond_to do |format|\n if @objeto.save\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Imagen was successfully created.' }\n format.json { render :show, status: :created, location: @objeto }\n else\n ...
[ "0.672632", "0.6717394", "0.65373504", "0.6388067", "0.6308456", "0.6300923", "0.6253933", "0.6232069", "0.6206124", "0.6193156", "0.6136341", "0.61337054", "0.60877025", "0.60853046", "0.60457695", "0.6038882", "0.5991689", "0.59864473", "0.59677935", "0.596435", "0.5953092"...
0.6758239
0
DELETE /imagen_articulos/1 DELETE /imagen_articulos/1.json
def destroy authorize! :eliminar, @imagen_articulo @imagen_articulo.destroy respond_to do |format| format.html { redirect_to imagen_articulos_url, notice: 'Imagen articulo was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @imagen_pedido = ImagenPedido.find(params[:id])\n @imagen_pedido.destroy\n\n respond_to do |format|\n format.html { redirect_to imagen_pedidos_url }\n format.json { head :no_content }\n end\n end", "def delete\n item = FormImage.last\n id = item[:id]\n item.destroy\n...
[ "0.7423819", "0.7264535", "0.723182", "0.7224075", "0.7218515", "0.7163902", "0.7147662", "0.71144986", "0.7094294", "0.7071957", "0.7071957", "0.7071957", "0.7049325", "0.7041043", "0.70361376", "0.7034827", "0.70109737", "0.7008894", "0.6963438", "0.6943159", "0.6935933", ...
0.6851328
40
Use callbacks to share common setup or constraints between actions.
def set_imagen_articulo @imagen_articulo = ImagenArticulo.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def imagen_articulo_params params.require(:imagen_articulo).permit(:imagen, :nombre_articulo, :modelo_articulo, :laboratorio_id, :tipo_articulo) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
Job is called by agreements controller via send_progress_percentage in concerns perform seems to be called by perform_now or perform_later; For prgress bar, perform_now
def perform(progress_payload_object, channel) # parameters passed from send_progress_percentage # Calls action cable broadcast for user's channel. # KEY!! Sender has its own channel which is craeted when user uses refreshes to navigates to booking confirmation in the frontend # progress_payload_object ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def indicate_progress\n end", "def perform #param1, param2, ...\n # some heavy job here\n end", "def work\n if @busy && @remaining_job_time > 0\n @remaining_job_time -= 1\n end\n end", "def done_working\n job, start = @balancer_start\n usage = (Time.now.to_f - start.to_f) / b...
[ "0.63779527", "0.63003135", "0.62797874", "0.6277038", "0.61527294", "0.61527294", "0.61527294", "0.61527294", "0.61527294", "0.6149506", "0.6104963", "0.6098752", "0.6087288", "0.6074654", "0.6069425", "0.60504174", "0.6036145", "0.6025292", "0.6006152", "0.5994906", "0.5963...
0.6579725
0
load_and_authorize_resource before_action :authenticate_user! before_filter :load_permissions GET /service_prov_types GET /service_prov_types.json
def index @service_masters = ServiceMaster.all.paginate(:page => params[:page], :per_page => 5).order('id desc') @service_prov_types = ServiceProvType.all.paginate(:page => params[:page], :per_page => 5).order('id desc') @provider_masters = ProviderMaster.joins(:service_prov_type).where(service_prov_types: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_permissions\n authorize! :manage, :all\n end", "def load_additional_resource(url,type=0)\n\t\t# type = 0 => print, 1 => revise\n\t\tif url.present?\n\t\t\tauthorize = authorize_url(url)\n\t\t\tif authorize == true\n\t\t\t\tuser_group = UserGroup.find(current_user.try(:user_group_id))\n\t\t\t\tme...
[ "0.6994001", "0.6471119", "0.6275229", "0.60954416", "0.60666096", "0.60666096", "0.6025094", "0.6024863", "0.60237414", "0.59583706", "0.5930217", "0.59197843", "0.5917924", "0.59055257", "0.5893159", "0.5863269", "0.5862736", "0.5862322", "0.5850868", "0.5850679", "0.585052...
0.0
-1
GET /service_prov_types/1 GET /service_prov_types/1.json
def show @service_prov_types = ServiceProvType.all.paginate(:page => params[:page], :per_page => 5).order('id desc') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_service_prov_type\n @service_prov_type = ServiceProvType.find(params[:id])\n end", "def service_types\n get_info :service_types\n end", "def show\n @service_type = ServiceType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { rend...
[ "0.6599701", "0.65373284", "0.64713717", "0.6186737", "0.61530995", "0.6144828", "0.6045314", "0.6027342", "0.6017622", "0.59686005", "0.59621084", "0.59466755", "0.5917061", "0.591666", "0.58764786", "0.58654654", "0.5858907", "0.58390224", "0.5783794", "0.5777443", "0.57632...
0.6564769
1
PATCH/PUT /service_prov_types/1 PATCH/PUT /service_prov_types/1.json
def update respond_to do |format| if @service_prov_type.update(service_prov_type_params) @service_prov_types = ServiceProvType.all.paginate(:page => params[:page], :per_page => 5).order('id desc') format.js { flash.now[:notice] = "Provider type was successfully updated." } format.html ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @service_type = ServiceType.find(params[:id])\n\n respond_to do |format|\n if @service_type.update_attributes(params[:service_type])\n format.html { redirect_to @service_type, notice: 'Service type was successfully updated.' }\n format.json { head :no_content }\n else\n ...
[ "0.6404438", "0.6199455", "0.6168953", "0.61669904", "0.61149466", "0.6031799", "0.59792805", "0.59739196", "0.5973804", "0.59555966", "0.59165955", "0.5910268", "0.59089357", "0.5906445", "0.5893084", "0.5888121", "0.58524597", "0.58400565", "0.5814096", "0.5803474", "0.5788...
0.6659893
0
DELETE /service_prov_types/1 DELETE /service_prov_types/1.json
def destroy @service_prov_type.destroy respond_to do |format| format.html { redirect_to service_prov_types_url, notice: 'Service prov type was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @servicetype = Servicetype.find(params[:id])\n @servicetype.destroy\n\n respond_to do |format|\n format.html { redirect_to servicetypes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @servicetype = Servicetype.find(params[:id])\n @servicetype.dest...
[ "0.7183073", "0.7183073", "0.7177558", "0.67666024", "0.67294997", "0.6718935", "0.67145395", "0.67094254", "0.67021817", "0.66747624", "0.66568714", "0.66448325", "0.66316384", "0.662279", "0.65834343", "0.6565242", "0.6555456", "0.6544072", "0.654129", "0.6538829", "0.65274...
0.77918434
0
Use callbacks to share common setup or constraints between actions.
def set_service_prov_type @service_prov_type = ServiceProvType.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def service_prov_type_params params.require(:service_prov_type).permit(:service_prov_type_title, :comment, :entity_id, :user_id, :active_status, :change_status) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
Creates a new TradeClearedEvent
def initialize(cleared_trade) @cleared_trade = cleared_trade end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def event_type\n :trade_cleared\n end", "def trade_cleared(event)\n trade = event.cleared_trade\n @all_prices[trade.commodity] << trade.price\n @max_prices[trade.commodity] = trade.price if trade.price > @max_prices[trade.commodity]\n @min_prices[trade.commodity] = trade.price if trade.price < @m...
[ "0.6710089", "0.5912641", "0.56351984", "0.54522544", "0.5421176", "0.5297148", "0.5297148", "0.5297148", "0.52888185", "0.52800816", "0.5214333", "0.51893044", "0.51147246", "0.50651133", "0.4932833", "0.49147236", "0.49119207", "0.49040842", "0.49003392", "0.4886694", "0.48...
0.56244427
3
The type of event
def event_type :trade_cleared end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type ; :event ; end", "def event_type\n metadata[:event_type] || self.class.name\n end", "def event_type\n @attributes[:event_type]\n end", "def event_type\n @event_type ||= Event.get_event_result_type(@event_name)\n end", "def event_types; end", "def type\n cas...
[ "0.84242696", "0.82492965", "0.817733", "0.8001517", "0.79295033", "0.77951974", "0.7706871", "0.7460592", "0.7367701", "0.7286154", "0.7282107", "0.71921736", "0.7130149", "0.708369", "0.7054816", "0.7017101", "0.6960318", "0.6881943", "0.6881943", "0.6880944", "0.6736818", ...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_user @user = User.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Only allow a trusted parameter "white list" through.
def user_params # Ensure a user can't give themselves admin priveleges params.delete(:admin) if current_user.admin? params.require(:user).permit(:name, :email, :admin, :image) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", ...
[ "0.7121987", "0.70541996", "0.69483954", "0.6902367", "0.6733912", "0.6717838", "0.6687021", "0.6676254", "0.66612333", "0.6555296", "0.6527056", "0.6456324", "0.6450841", "0.6450127", "0.6447226", "0.6434961", "0.64121825", "0.64121825", "0.63913447", "0.63804525", "0.638045...
0.0
-1
GitHub issues include Pull Requests, filter those out
def actual_issues @actual_issues ||= issues.select { |i| i[:pull_request].nil? } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pull_requests_from_github\n @github.search_issues(\"is:pr state:open user:#{ORGANISATION}\").items\n end", "def query_pull_requests\n # This line is where we want to add :accept => 'application/vnd.github.shadow-cat-preview+json' for draft PRs\n pull_requests = github_query(@client) { @client.pull_...
[ "0.7182644", "0.6780908", "0.67738616", "0.6655893", "0.66009414", "0.6539029", "0.65254974", "0.6497355", "0.6385088", "0.62770677", "0.62735367", "0.6250042", "0.6249607", "0.623611", "0.6228027", "0.61890936", "0.61754787", "0.61564803", "0.6141001", "0.61180574", "0.61053...
0.6613496
4
Retrieve Checkpoint ID's from get_roadmap response
def get_checkpoint(checkpoint_id) response = self.class.get(base_uri("checkpoints/#{checkpoint_id}"), headers: { "authorization" => @auth_token }) JSON.parse(response.body) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAllTripIds(route_id)\n trips_array = JSON.parse(File.read(TRIPS))\n all_trip_ids = []\n for trip in trips_array\n if trip[\"route_id\"] == route_id\n all_trip_ids << trip[\"trip_id\"]\n end\n end\n puts \"all_trip_ids is #{all_trip_ids[0, 10]}\"\n return getCurrentTrips(al...
[ "0.5679168", "0.56539977", "0.55081993", "0.53532577", "0.5321775", "0.5284273", "0.5284273", "0.5250138", "0.52305007", "0.51869464", "0.5178571", "0.5163879", "0.5162283", "0.51611495", "0.51385915", "0.51235306", "0.5115237", "0.5046952", "0.5045964", "0.50306726", "0.5029...
0.46750858
76
redefine your position_taken? method here, so that you can use it in the valid_move? method above.
def position_taken?(board, position) if board[(position.to_i) - 1] == " " || board[(position.to_i) - 1] == "" || board[(position.to_i) - 1] == nil false elsif board[(position.to_i) - 1] == "X" || board[(position.to_i) - 1] == "O" false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def position_taken?(board, position)\n return false if valid_move?(board, position)\n return true unless valid_move?(board, position)\nend", "def position_taken?\nend", "def valid_move?(board, index)\n if index.between?(0, 8)\n # re-define your #position_taken? method here, so that you can use it in the #v...
[ "0.8409533", "0.8161412", "0.80915326", "0.802741", "0.80150443", "0.78980684", "0.7893883", "0.7886275", "0.78447807", "0.7843449", "0.7831682", "0.78148174", "0.7813732", "0.7810363", "0.78020334", "0.7801113", "0.7800951", "0.7789361", "0.7782831", "0.777421", "0.7774137",...
0.0
-1
Pokemon initialized w/ keyword arguments of id, name, type & db
def initialize(id:, name:, type:, db:) @id = id @name = name @type = type @db = db end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(id:,name:,type:,db:) \n #step 2:making sure it needs to be initilized and needs a pokemon class\n @id = id \n @name = name \n @type = type \n @db = db\n end", "def initialize(hp=nil)\n @db = db\n @id = id\n @name = name\n @type = type\n @hp = hp\n end", "def initi...
[ "0.8556652", "0.7017254", "0.6862388", "0.6681287", "0.6662093", "0.66050833", "0.6590321", "0.65460473", "0.6525123", "0.65229636", "0.6497856", "0.64813864", "0.64813864", "0.64813864", "0.64813864", "0.64813864", "0.6476302", "0.6406956", "0.62818956", "0.62710285", "0.625...
0.66763675
4
GET /joining_forms GET /joining_forms.json
def index @joining_forms = JoiningForm.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_joining_form\n @joining_form = JoiningForm.find(params[:id])\n end", "def create\n @joining_form = JoiningForm.new(joining_form_params)\n\n respond_to do |format|\n if @joining_form.save\n format.html { redirect_to @joining_form, notice: 'Joining form was successfully created.' ...
[ "0.6512914", "0.6415783", "0.62938285", "0.6104714", "0.6103907", "0.6060443", "0.60588956", "0.5851475", "0.5796728", "0.5781689", "0.576192", "0.5751869", "0.565416", "0.55798537", "0.5567944", "0.5506974", "0.54862964", "0.547234", "0.544807", "0.5446092", "0.5435486", "...
0.76165694
0
GET /joining_forms/1 GET /joining_forms/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @joining_forms = JoiningForm.all\n end", "def set_joining_form\n @joining_form = JoiningForm.find(params[:id])\n end", "def create\n @joining_form = JoiningForm.new(joining_form_params)\n\n respond_to do |format|\n if @joining_form.save\n format.html { redirect_to @joi...
[ "0.75702965", "0.66820496", "0.64762306", "0.6358706", "0.61183107", "0.60848963", "0.6035615", "0.59547883", "0.5861563", "0.5849404", "0.57658494", "0.57641196", "0.5761017", "0.57110876", "0.5704631", "0.56990033", "0.56675345", "0.56619334", "0.5607903", "0.5607434", "0.5...
0.0
-1
POST /joining_forms POST /joining_forms.json
def create @joining_form = JoiningForm.new(joining_form_params) respond_to do |format| if @joining_form.save format.html { redirect_to @joining_form, notice: 'Joining form was successfully created.' } format.json { render :show, status: :created, location: @joining_form } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @joining_forms = JoiningForm.all\n end", "def set_joining_form\n @joining_form = JoiningForm.find(params[:id])\n end", "def joining_form_params\n params.require(:joining_form).permit(:age, :english_proficiency, :available, :software, :years_experience, :interests, :notes, :pilot_at...
[ "0.6661765", "0.6445704", "0.59270716", "0.5872048", "0.58559936", "0.58497673", "0.5798883", "0.5786943", "0.5698445", "0.56347734", "0.5622634", "0.56071675", "0.5552761", "0.55310875", "0.55277", "0.5515625", "0.5512821", "0.54967695", "0.5493128", "0.54904675", "0.5461031...
0.71523476
0
PATCH/PUT /joining_forms/1 PATCH/PUT /joining_forms/1.json
def update respond_to do |format| if @joining_form.update(joining_form_params) format.html { redirect_to @joining_form, notice: 'Joining form was successfully updated.' } format.json { render :show, status: :ok, location: @joining_form } else format.html { render :edit } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @filled_form = FilledForm.find(params[:id])\n @form_template = FormTemplate.find(@filled_form.form_template_id)\n\n respond_to do |format|\n if @filled_form.update_attributes(params[:filled_form])\n format.html { redirect_to form_template_filled_form_path(@filled_form.form_templat...
[ "0.62817425", "0.6118845", "0.60790384", "0.6034893", "0.59712833", "0.59292525", "0.5887293", "0.5871626", "0.5869788", "0.58410007", "0.58410007", "0.58267224", "0.5819622", "0.5801543", "0.5754754", "0.57433486", "0.5741028", "0.57409936", "0.57289624", "0.5720393", "0.571...
0.68594766
0
DELETE /joining_forms/1 DELETE /joining_forms/1.json
def destroy @joining_form.destroy respond_to do |format| format.html { redirect_to joining_forms_url, notice: 'Joining form was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @filled_form = FilledForm.find(params[:id])\n @filled_form.destroy\n\n respond_to do |format|\n format.html { redirect_to form_templates_path }\n format.json { head :ok }\n end\n end", "def delete_form(id)\n @client.raw('delete', \"/content/forms/#{id}\")\n end", "def d...
[ "0.7217262", "0.71634704", "0.70023966", "0.6987643", "0.6963682", "0.6948193", "0.6928391", "0.6912126", "0.6886296", "0.68830806", "0.6784538", "0.6764743", "0.67624664", "0.67562675", "0.6735583", "0.670962", "0.66996306", "0.669543", "0.66664475", "0.666172", "0.66385", ...
0.73617476
0
Use callbacks to share common setup or constraints between actions.
def set_joining_form @joining_form = JoiningForm.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def joining_form_params params.require(:joining_form).permit(:age, :english_proficiency, :available, :software, :years_experience, :interests, :notes, :pilot_attributes, softwares_ids:[]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
uses an event in a separate base table as the cohort grouping and an event in second table to calculate the follow up activity
def occurence(base_table, activity_table, object_id, query = {}, options = {}) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cohort_field\n @@start_date = params[\"start_date\"]\n @@end_date = params[\"end_date\"]\n\n if params[\"field\"]\n\n if params[\"start_date\"]\n start_date = params[\"start_date\"]\n else\n start_date = Time.now.strftime(\"%Y-%m-%d\")\n end\n if params[\"end_date\"]\...
[ "0.5294836", "0.5246967", "0.517551", "0.5162354", "0.50491", "0.5045555", "0.47975755", "0.46924338", "0.46764565", "0.4658077", "0.46501037", "0.4643162", "0.46304077", "0.46280614", "0.46280542", "0.4624415", "0.4622955", "0.46132573", "0.4608367", "0.46079317", "0.4587272...
0.44549125
44
TODO: add user specific fty
def chart_for(user) user_data = historical_data_for(user) LazyHighCharts::HighChart.new('graph') do |f| f.options[:chart][:defaultSeriesType] = 'area' f.yAxis([ {:title => {:text => 'Distance'}}, {:title => {:text => 'Number of Digits'}, :max => 6, :opposite => 'true'} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user; end", "def user; end", "def user_type; end", "def user\n end", "def make_user\n end", "def set_user; end", "def user_provider; end", "def user(*eras); end", "def user_handle; end", "def username; end", "def username; end", "def username; end", "def username; end", "def user_fo...
[ "0.6970131", "0.6970131", "0.67145616", "0.65840733", "0.64771926", "0.6407735", "0.6397864", "0.63891715", "0.63110304", "0.62286246", "0.62286246", "0.62286246", "0.62286246", "0.6217411", "0.62024", "0.61601484", "0.61071455", "0.6075119", "0.6059266", "0.60588264", "0.604...
0.0
-1
Gets the id property.
def id return @values['ai.operation.id'] if @values.key?('ai.operation.id') @defaults['ai.operation.id'] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_id()\n return @id\n end", "def id\n raise MissingID if not defined?(@id)\n @id.to_i\n end", "def id\n @attributes.fetch('id', nil)\n end", "def id\n @attributes.fetch('id', nil)\n end", "def id\n @attributes.fetch('id', nil)\n end...
[ "0.83863515", "0.8283802", "0.807074", "0.807074", "0.807074", "0.8057875", "0.8044084", "0.8044084", "0.80042106", "0.79815215", "0.79815215", "0.7953012", "0.790304", "0.7898481", "0.78505045", "0.7821917", "0.7808949", "0.7808949", "0.77622014", "0.77483314", "0.77483314",...
0.0
-1
Sets the id property.
def id=(value) if value == @defaults['ai.operation.id'] @values.delete 'ai.operation.id' if @values.key? 'ai.operation.id' else @values['ai.operation.id'] = value end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_id(id)\n unless id.nil?\n @id = id\n end\n @id\n end", "def id=(value)\n @id = value\n end", "def id=(value)\n @id = value\n end", "def id=(value)\n @id = value\n end", "def id=(value)\n @id ...
[ "0.881569", "0.8574447", "0.8574447", "0.8574447", "0.8574447", "0.8574447", "0.8574447", "0.8574447", "0.8404134", "0.83317405", "0.8274738", "0.8257124", "0.8257124", "0.8202525", "0.8128775", "0.80849206", "0.8051343", "0.8038396", "0.8037951", "0.79821944", "0.7951165", ...
0.0
-1
Gets the name property.
def name return @values['ai.operation.name'] if @values.key?('ai.operation.name') @defaults['ai.operation.name'] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_name\n return @m_name\n end", "def get_name\n return @m_name\n end", "def get_name\n return @m_name\n end", "def get_name\n return @m_name\n end", "def get_name\n @name\n end", "def get_name\n return @name\n end", "de...
[ "0.80742097", "0.80742097", "0.80742097", "0.80742097", "0.80682695", "0.8067547", "0.78736776", "0.7864398", "0.7864398", "0.7836551", "0.78159046", "0.78159046", "0.77993304", "0.77970624", "0.779376", "0.7791233", "0.7791233", "0.7791233", "0.7791233", "0.7791233", "0.7791...
0.0
-1
Sets the name property.
def name=(value) if value == @defaults['ai.operation.name'] @values.delete 'ai.operation.name' if @values.key? 'ai.operation.name' else @values['ai.operation.name'] = value end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_name(name)\n @name = name\n end", "def set_name(name)\n unless name.nil?\n @name = name\n end\n @name\n end", "def name=(val)\n @name = val\n end", "def name_setter(new_name)\n @name = new_name\n end", "def set_name(a_name)\n @name = a_name\n end", "def ...
[ "0.8733373", "0.86772954", "0.8608486", "0.8595329", "0.85585433", "0.85491025", "0.85491025", "0.85491025", "0.85491025", "0.85491025", "0.85491025", "0.85491025", "0.85491025", "0.85491025", "0.85491025", "0.85491025", "0.85491025", "0.85491025", "0.85491025", "0.85491025", ...
0.0
-1
Gets the parent_id property.
def parent_id return @values['ai.operation.parentId'] if @values.key?('ai.operation.parentId') @defaults['ai.operation.parentId'] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parent_id\n self.parent._id.to_s\n end", "def parent_id\n data[:parent_id]\n end", "def parent_id\n object[\"parent_id\"]\n end", "def parent_id\n self[self.nested_set_options[:parent_column]]\n end", "def parent_id\n parent_ids.last\n end", "def pa...
[ "0.89527214", "0.87185115", "0.862189", "0.8429486", "0.8363757", "0.8288423", "0.82311016", "0.8222148", "0.81244504", "0.7969431", "0.7885272", "0.7858053", "0.77803427", "0.7771055", "0.77503794", "0.77315634", "0.7716634", "0.7638481", "0.7564935", "0.75401914", "0.748699...
0.8062627
9
Sets the parent_id property.
def parent_id=(value) if value == @defaults['ai.operation.parentId'] @values.delete 'ai.operation.parentId' if @values.key? 'ai.operation.parentId' else @values['ai.operation.parentId'] = value end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parent_id=(value)\n self[self.nested_set_options[:parent_column]] = value\n end", "def parent=(value)\n @parent = value\n end", "def set_parent(parent)\n @parent = parent\n end", "def set_parent(parent)\n @parent = parent\n end", "def parent=(pa...
[ "0.84798265", "0.7948914", "0.7930635", "0.7930635", "0.79304093", "0.7929137", "0.7929137", "0.7929137", "0.7929137", "0.7929137", "0.7929137", "0.7886259", "0.7843516", "0.78174454", "0.7723705", "0.7723705", "0.7712357", "0.770692", "0.75634897", "0.7519692", "0.74997395",...
0.763275
19
Gets the root_id property.
def root_id return @values['ai.operation.rootId'] if @values.key?('ai.operation.rootId') @defaults['ai.operation.rootId'] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def root_id\n if is_root?\n id\n else\n root.id\n end\n end", "def root_id\n data[:root_id]\n end", "def root_id\n @values.fetch('ai.operation.rootId') { \n @values['ai.operation.rootId'] = nil\n }\n end", "def root_id\n if ancestor_ids.emp...
[ "0.9026887", "0.90221214", "0.8282217", "0.7824634", "0.77305716", "0.7610809", "0.73863393", "0.73643965", "0.73643965", "0.72446245", "0.718745", "0.7146867", "0.69958854", "0.69876665", "0.69876665", "0.69667536", "0.69617707", "0.6920883", "0.6907472", "0.6896851", "0.686...
0.8066933
3
Sets the root_id property.
def root_id=(value) if value == @defaults['ai.operation.rootId'] @values.delete 'ai.operation.rootId' if @values.key? 'ai.operation.rootId' else @values['ai.operation.rootId'] = value end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def root_id\n data[:root_id]\n end", "def root_id\n if is_root?\n id\n else\n root.id\n end\n end", "def root_id\n @values.fetch('ai.operation.rootId') { \n @values['ai.operation.rootId'] = nil\n }\n end", "def root=(v)\n @@root = v\n en...
[ "0.7631072", "0.7516293", "0.73417974", "0.70907015", "0.705117", "0.7042205", "0.70141923", "0.70141923", "0.6967101", "0.6819332", "0.6679867", "0.667591", "0.66721106", "0.66526556", "0.6536061", "0.65120834", "0.64938915", "0.64938915", "0.64620876", "0.64581716", "0.6439...
0.7815276
1
team should be either "red" or "white" assume ticket_id is valid and not voted
def do_vote(ticket_id,team) # record as vote REDIS.hset("ticket_info",ticket_id,team) # vote it! REDIS.incr("vote_result.#{team}") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def winning_team\n blue_team.winner? ? blue_team : red_team\n end", "def verify_team\n set_team_from_team_id\n unless ( @team )\n flash[:error] = I18n.t(:invalid_action_request) + ' - ' + I18n.t('meeting.errors.missing_team_id')\n redirect_to( meetings_current_path() ) and return\n end\n ...
[ "0.60847616", "0.6012142", "0.5939248", "0.5903048", "0.5877651", "0.58669454", "0.58324116", "0.5799297", "0.5794954", "0.5761654", "0.5759354", "0.57298833", "0.5705241", "0.5697729", "0.56824124", "0.56574994", "0.5642563", "0.563299", "0.5630432", "0.5621948", "0.5599977"...
0.64438856
0
Sets the barcode to the given value. This method converts an Integer to a String.
def barcode=(value) value = value.to_s if Integer === value setBarcode(value) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def barcode\n return if not_registered\n barcode_string.to_i(2)\n end", "def barcode_string\n return if not_registered\n @mim.barcode_bits.map do |b|\n b ? '1' : '0'\n end.join.reverse\n end", "def barcode_string\n b_string = self.custom_barcode\n if b_string.emp...
[ "0.6505776", "0.6358458", "0.6321204", "0.6184149", "0.5793151", "0.57729316", "0.5735135", "0.57345116", "0.5707456", "0.5657961", "0.56573975", "0.56374574", "0.5605998", "0.56011546", "0.55883497", "0.55883497", "0.5587919", "0.5548701", "0.5532858", "0.5452789", "0.543731...
0.8378671
0
Relaxes the +CaRuby::Persistable.fetch_saved?+ condition for a Specimen as follows: If the Specimen available_quantity was updated, then fetch the saved Specimen.
def fetch_saved? super and available_quantity_changed? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save()\n\n qty_available = Album.qty_available(@sli_alb_id)\n\n if(qty_available >= @sli_qty)\n\n if(@sli_id && @sli_id != 0)\n update()\n else\n insert()\n end\n end\n end", "def preserve_immutable_quantity\n self.immutable_quantity = true if immutable_quantity_cha...
[ "0.5850713", "0.5802028", "0.5784658", "0.5605494", "0.5573313", "0.5567385", "0.5567385", "0.5532669", "0.5532477", "0.5532477", "0.54927355", "0.54652005", "0.5464478", "0.54132503", "0.53735673", "0.53219193", "0.52919066", "0.52895415", "0.52783155", "0.5275087", "0.52591...
0.7862651
0
Returns the Specimen in others which matches this Specimen in the scope of an owner SCG. This method relaxes +Jinx::Resource.match_in_owner_scope+ to include a match on at least one external identifier.
def match_in_owner_scope(others) super or others.detect do |other| other.class == self.class and external_identifier_match?(other) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def match_in_owner_scope(others)\n others.detect do |other|\n self.class == other.class and specimen_type == other.specimen_type and pathological_status == other.pathological_status and\n characteristics and characteristics.matches?(other.characteristics)\n end\n end", "def on(owner =...
[ "0.7231308", "0.63069576", "0.58604497", "0.5814097", "0.5793725", "0.5773383", "0.5723355", "0.5708711", "0.5701248", "0.5599045", "0.55111724", "0.5481038", "0.5419002", "0.5418083", "0.53950596", "0.53915936", "0.53710693", "0.537042", "0.5369352", "0.5344972", "0.534456",...
0.71331906
1
Convenience method which returns the SCG collection protocol.
def collection_protocol specimen_collection_group.collection_protocol end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type\n \"collection\"\n end", "def getCollection\n return @coll\n end", "def collection_type\n components[0].to_sym rescue nil\n end", "def collection\n @collector.collection\n end", "def collection_type\n Deprecation.warn(\"'##{__method__}' will be removed in Hyrax 4.0...
[ "0.6591508", "0.63603586", "0.6328686", "0.62996286", "0.61665684", "0.6157035", "0.61516964", "0.61516964", "0.6092603", "0.6010284", "0.6010284", "0.59863096", "0.5937082", "0.58974546", "0.58918214", "0.58520615", "0.58520615", "0.5840843", "0.57883835", "0.56802684", "0.5...
0.74284405
0
Permanently dispose of this specimen.
def dispose(reason=nil) CaTissue::DisposalEventParameters.new(:specimen => self, :reason => reason) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dispose\n nil\n end", "def dispose\n call Memory.deAlloc(self)\n end", "def dispose\n call Memory.deAlloc(self)\n end", "def close\n Common.uncontain\n self\n end", "def dispose\n raise \"not implemented\"\n\n @disposed = true\n end", "def t...
[ "0.68384653", "0.6744483", "0.6744483", "0.6143765", "0.6084946", "0.6080276", "0.60674053", "0.6006564", "0.59825224", "0.5906652", "0.5896406", "0.5858375", "0.5845279", "0.5808748", "0.57470876", "0.5717276", "0.5650018", "0.56447506", "0.56260926", "0.56260926", "0.561574...
0.60872716
4
The specimen is available by default if there is a positive available quantity.
def default_availablility available_quantity.zero? ? nil : true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def available\n @available ||= product.available(inventory, lot_code)\n end", "def is_available\n\t\tself.stock_qty > 0\n\tend", "def is_available?\n return self.available_inventory > 0\n end", "def available(inventory)\n component.available(inventory, nil) / quantity\n end", "def available?\n ...
[ "0.6472964", "0.6394257", "0.63159984", "0.61578715", "0.6097121", "0.60826105", "0.60642403", "0.605225", "0.6017511", "0.5936652", "0.59290206", "0.5925514", "0.5848513", "0.58251977", "0.5789446", "0.5784124", "0.5779936", "0.5777622", "0.5751343", "0.5723375", "0.5723313"...
0.6769861
0
Adds default collection and received event parameters. The specimen receiver is the SCG receiver. The specimen collector is the SCG collector, if it exists, otherwise the receiver.
def add_default_event_parameters rep = received_event_parameters || create_default_received_event_parameters || return if collection_event_parameters.nil? then create_default_collection_event_parameters(rep) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_default_collection_event_parameters(rep)\n cep = parent.collection_event_parameters if parent\n user = cep.user if cep\n user ||= scg_collector || rep.user || return\n cep = CaTissue::CollectionEventParameters.new(:specimen => self, :user => user)\n logger.debug { \"Created defa...
[ "0.69591415", "0.65164006", "0.52645785", "0.5175928", "0.5159034", "0.5092663", "0.50335336", "0.50318843", "0.50220853", "0.49360022", "0.49286678", "0.49259743", "0.4923748", "0.48857826", "0.48353425", "0.48110887", "0.47994286", "0.47518545", "0.47300345", "0.47152317", ...
0.72698605
0
The default CEP user is, by order of preference: this specimen's parent specimen collector this specimen's SCG collector the receiver
def create_default_collection_event_parameters(rep) cep = parent.collection_event_parameters if parent user = cep.user if cep user ||= scg_collector || rep.user || return cep = CaTissue::CollectionEventParameters.new(:specimen => self, :user => user) logger.debug { "Created default #{qp} c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collector\n ep = collection_event_parameters\n ep.user if ep\n end", "def child_task_assignee(parent, params)\n if [:assigned_to_type, :assigned_to_id].all? { |key| params.key?(key) }\n super\n elsif (parent.type == DocketSwitchMailTask.name) && RequestStore[:current_user]\n ...
[ "0.6085284", "0.57666403", "0.5753398", "0.57257867", "0.5685537", "0.5650872", "0.5640092", "0.5601558", "0.55937916", "0.55817777", "0.5542715", "0.5528476", "0.55104315", "0.55094486", "0.5476488", "0.5470839", "0.5460297", "0.54586655", "0.545181", "0.54470396", "0.542102...
0.6067794
1
Decrements this parent's available quantity by the given child's initial quantity, if the specimen types are the same and there are the relevant quantities.
def decrement_derived_quantity(child) return unless specimen_type == child.specimen_type and child.initial_quantity if available_quantity.nil? then raise Jinx::ValidationError.new("Derived specimen has an initial quantity #{child.initial_quantity} but the parent is missing an available quantity") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decrement_qty!\n val = get_product.the_qty(object.variation_id) - object.qty\n if object.variation_id.present?\n product_variation.update_column(:qty, val)\n else\n product.update_field_value('ecommerce_qty', val)\n end\n val\n end", "def release_quantity_of_item(item, quantity)\r\n...
[ "0.60437363", "0.57989615", "0.56835043", "0.56804764", "0.5640957", "0.5616821", "0.55729663", "0.5531793", "0.5461392", "0.5451346", "0.53590727", "0.53534895", "0.53417283", "0.5324336", "0.5297183", "0.52774286", "0.5264915", "0.52593315", "0.52472675", "0.5246589", "0.52...
0.82626814
0
TODO: Is there any better way?
def override_event_store_with(even_store) allow(Rails.configuration).to receive(:event_store).and_return(event_store) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def probers; end", "def schubert; end", "def offences_by; end", "def formation; end", "def suivre; end", "def identify; end", "def intensifier; end", "def verdi; end", "def from; end", "def f...
[ "0.69161946", "0.6028671", "0.6028671", "0.6028671", "0.6028671", "0.6002579", "0.59390986", "0.5648035", "0.560181", "0.5578423", "0.5575699", "0.5475295", "0.5442406", "0.54130304", "0.54130304", "0.54130304", "0.54130304", "0.53947556", "0.53480583", "0.53187555", "0.53187...
0.0
-1
TODO: Is there any better way?
def override_command_bus_with(command_bus) allow(Rails.configuration).to receive(:command_bus).and_return(command_bus) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def probers; end", "def schubert; end", "def offences_by; end", "def formation; end", "def suivre; end", "def identify; end", "def intensifier; end", "def verdi; end", "def from; end", "def f...
[ "0.69161946", "0.6028671", "0.6028671", "0.6028671", "0.6028671", "0.6002579", "0.59390986", "0.5648035", "0.560181", "0.5578423", "0.5575699", "0.5475295", "0.5442406", "0.54130304", "0.54130304", "0.54130304", "0.54130304", "0.53947556", "0.53480583", "0.53187555", "0.53187...
0.0
-1
Validates the composite object and throws errors on failure
def validate(composite_object) # Get the hash from the composite object target_hash = composite_object.hash target_hash.each_key do |key| error_messages.push("Invalid Key: #{key}, at: #{composite_object.location}. Allowed keys: #{@allowed_keys}.") unless @allowed_keys....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate(composite_object)\n # Get the hash value from the composite object\n target_value = composite_object.hash[@key]\n target_values = target_value.is_a?(Array) ? target_value : [target_value]\n\n return unless target_value\n\n valid_modals = find_moda...
[ "0.72378546", "0.710065", "0.7048856", "0.7042624", "0.6943672", "0.69427454", "0.6795399", "0.665898", "0.6644035", "0.6643077", "0.66301644", "0.6629661", "0.6629661", "0.6629661", "0.6629661", "0.66195923", "0.6598383", "0.6592246", "0.65424985", "0.6537917", "0.65362656",...
0.6780762
7
GET /courses GET /courses.json
def index @courses = Course.all.paginate(:page => params[:page], :per_page => 10) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n\t\t@courses = Course.all\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render json: @courses }\n\t\tend\n\tend", "def index\n @courses = Course.all\n render json: @courses, status: :ok\n end", "def courses\n @courses = Course.where(faculty_id: params[:faculty_id]).or...
[ "0.7943173", "0.78570646", "0.7742099", "0.7729055", "0.7729055", "0.76939315", "0.76708746", "0.76526207", "0.752899", "0.74440956", "0.74415404", "0.73988724", "0.7373047", "0.7365082", "0.73555565", "0.7347125", "0.7311683", "0.7271882", "0.7270879", "0.72251445", "0.72230...
0.0
-1
GET /courses/1 GET /courses/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def course\n\t\t@course = Course.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.json\n\t\tend\n\tend", "def index\n @courses = Course.all\n render json: @courses, status: :ok\n end", "def courses\n @courses = Course.where(faculty_id: params[:faculty_id]).order(:name)\n respond_to do...
[ "0.7639248", "0.7600732", "0.7561499", "0.7498261", "0.7492566", "0.7492566", "0.7460362", "0.7459336", "0.7438278", "0.7280991", "0.7248682", "0.7241407", "0.723878", "0.72222453", "0.72222453", "0.72222453", "0.72222453", "0.72222453", "0.72222453", "0.721023", "0.71961445"...
0.0
-1
POST /courses POST /courses.json
def create @course = Course.new(course_params) respond_to do |format| if @course.save format.html { redirect_to @course, notice: 'Course was successfully created.' } format.json { render :show, status: :created, location: @course } else format.html { render :new } fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n # render plain: params[:courses].inspect\n @courses = Courses.new(courses_params)\n\n respond_to do |format|\n if @courses.save\n format.html { redirect_to @courses, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @cour...
[ "0.76898974", "0.73798543", "0.7334656", "0.72327256", "0.72273064", "0.7157716", "0.7128817", "0.71268123", "0.7109645", "0.71044004", "0.71044004", "0.71044004", "0.71044004", "0.71044004", "0.71044004", "0.71044004", "0.7092889", "0.70824045", "0.70697033", "0.70405245", "...
0.7053714
26
PATCH/PUT /courses/1 PATCH/PUT /courses/1.json
def update respond_to do |format| if @course.update(course_params) format.html { redirect_to @course, notice: 'Course was successfully updated.' } format.json { render :show, status: :ok, location: @course } else format.html { render :edit } format.json { render json: @co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @course.update(course_params)\n render_jsonapi_response(@course)\n end", "def update\n @course = Course.find(params[:id])\n respond_to do |format|\n if @course.update(courses_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n f...
[ "0.72374034", "0.7137671", "0.7121435", "0.7102951", "0.708175", "0.708175", "0.708175", "0.708175", "0.708175", "0.708175", "0.708175", "0.708175", "0.70531946", "0.70469433", "0.6967811", "0.696716", "0.6964841", "0.6954444", "0.6949194", "0.6934083", "0.6929629", "0.6929...
0.6830851
45
DELETE /courses/1 DELETE /courses/1.json
def destroy @course.destroy respond_to do |format| format.html { redirect_to courses_url, notice: 'Course was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :ok }\n end\n end", "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n ...
[ "0.77230847", "0.77079666", "0.77079666", "0.77079666", "0.77079666", "0.76962376", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.76494783", "0.76408905", "0.7619815", "0.76093...
0.73929405
63
Use callbacks to share common setup or constraints between actions. def set_course
def course_params params.require(:course).permit(:course_name, :cq1, :cq2, :cq3, :cq4, :cq5, :cq6, :cq7, :cq8, :cq9, :cq10, :gq1, :gq2, :gq3, :gq4, :gq5, :gq6, :gq7, :gq8, :gq9, :gq10, :gq11, :gq12, :gq13, :gq14, :gq15, :gq16, :gq17, :gq18, :gq19, :gq20, :gw1, :gw2, :gw3, :gw4, :gw5, :gw6, :gw7, :gw8, :gw9, :gw10...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_course\n @course = Course.find(params[:course_id])\n \n end", "def set_course\n @course = Course.find(params[:course_id])\n end", "def set_course\n @course = Course.find(params[:course_id])\n end", "def set_course\n\t\t@course = Course.find(params[:id])\n\n\tend", "def ...
[ "0.71940374", "0.71723276", "0.71723276", "0.7143228", "0.71336645", "0.71196735", "0.704631", "0.704631", "0.70145774", "0.7003764", "0.7003764", "0.7003764", "0.7003764", "0.7003764", "0.7003764", "0.7003764", "0.7003764", "0.7003764", "0.7003764", "0.7003764", "0.7003764",...
0.0
-1
I added this method to restrict access from pages students shouldn't have access to.
def logged_in_as_teacher? redirect_to :back, notice: "You do not have permission to access that page." unless current_user && current_user.person_type == "Teacher" rescue ActionController::RedirectBackError redirect_to root_path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def restrict_access\n render :\"/home/http_404\" unless @profile && @profile.user == current_user\n end", "def restrict_access\t\n\t\tif current_user.owner == false\n\t\t\tredirect_to user_path(current_user), notice: \"You can't view this page, contact your box owner\"\n\t\tend\t\n\tend", "def restrict_ac...
[ "0.70729506", "0.6989881", "0.6889781", "0.6797055", "0.6700216", "0.6700216", "0.6700216", "0.66787505", "0.66603196", "0.6649882", "0.6649383", "0.6634378", "0.6586139", "0.6517126", "0.6496242", "0.64884955", "0.647461", "0.6468432", "0.64545465", "0.6432307", "0.64194477"...
0.0
-1
Consume Items If the specified object is a consumable item, the number in investory will be reduced by 1.
def consume_item(item) lose_item(item, 1, false, nil, nil, false) if item.is_a?(RPG::Item) && item.consumable end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def consume_item(item)\n if item.is_a?(RPG::Item) and item.consumable\n lose_item(item, 1)\n end\n end", "def use_item_by_object(item, e)\n index = has_item_by_object(item)\n if (index != -1)\n actual_item = inventory[index].first\n actual_item.use(e)\n if actual_item.consumable ...
[ "0.7275281", "0.62131", "0.6070002", "0.606315", "0.6010248", "0.58670205", "0.58345735", "0.5734028", "0.57294637", "0.57166374", "0.56895363", "0.561284", "0.5541753", "0.5533155", "0.55006105", "0.54919755", "0.5487975", "0.5448351", "0.5444494", "0.5437536", "0.5434516", ...
0.7347197
0
Gold & Max gold
def gold(quick_access = true) @gold = BlockChain.account_balance(Vocab::Player) if !quick_access return @gold end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_gold\n MAX_GOLD_VARIABLE == -1 ? MAX_GOLD : $game_variables[MAX_GOLD_VARIABLE]\n end", "def gain_gold\n if $game_troop.gold_total > 0\n rate = Grade.rate(:gold)\n gold = $game_troop.gold_total\n gold = gold * rate / 100\n $game_party.gain_gold(gold)\n else\n gold = 0\n ...
[ "0.76121414", "0.70414174", "0.70219487", "0.7006365", "0.67865026", "0.6690918", "0.6634085", "0.6621512", "0.65757895", "0.6529051", "0.64794123", "0.64256054", "0.6377527", "0.63138294", "0.63135207", "0.6297109", "0.6274487", "0.62643164", "0.6255317", "0.62285805", "0.62...
0.6101361
30
Overwrite: Get Number of Items Possessed
def item_number(item) return nil if item.nil? container = item_container(item.class) container ? container[item.id] || 0 : 0 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def item_count\n @items.length\n end", "def count\r\n items.size\r\n end", "def item_count\n @items.length \n end", "def count_items\n @items.size\n end", "def item_count\n return @item_count\n end", "def items_count\n counter = 0\n ...
[ "0.8254791", "0.818544", "0.817774", "0.81582314", "0.8156183", "0.81058055", "0.80252534", "0.79568565", "0.79087436", "0.78971857", "0.78946817", "0.7867429", "0.78657705", "0.7844157", "0.7820042", "0.77807945", "0.7768676", "0.7748209", "0.7724053", "0.76972324", "0.76972...
0.0
-1
Synchronize data with Block Chain
def sync_blockchain(item = nil) return if BlockChain.node_empty? puts "[BlockChain]: Synchronize party container" pc = Vocab::Player if item.nil? data = BlockChain.all_data(pc) @items.each do |key, number| @items[key] = data[:item][$data_items[key].hashid] @items.delete(key) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sync() end", "def sync() end", "def sync() end", "def sync; end", "def synchronize_block(&block)\n @lock.synchronize(&block)\n end", "def synchronize\n lock(&block)\n end", "def sync\n end", "def sync\n end", "def sync()\n #This is a stub, used for indexing\n end", ...
[ "0.7202386", "0.7202386", "0.7202386", "0.6883332", "0.66815597", "0.6636648", "0.66042364", "0.66042364", "0.65541214", "0.643901", "0.643901", "0.643901", "0.64251614", "0.6340897", "0.6331738", "0.63200593", "0.6310667", "0.6310667", "0.6310667", "0.6310667", "0.6299026", ...
0.6086847
31
Lose Items include_equip : Include equipped items
def lose_item(item, amount, include_equip = false, opp = Vocab::Coinbase, info = '', display = true) gain_item(item, -amount, true, opp, info, display) if include_equip gain_item(item, -amount, false, opp, info, display) if !include_equip end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unequip_item\n\t\tself.equiped = false\n\t\tself.save\n\tend", "def storage_equip_items\n storage_weapons + storage_armors\n end", "def withInventory\n\t\t@inventoryItems = Item.where(:inventory > 0)\n\tend", "def include item\n\tend", "def include?(item)\n return false if item == nil\n retur...
[ "0.66600883", "0.64979684", "0.64830303", "0.64602375", "0.6459365", "0.6417234", "0.641404", "0.6372774", "0.63296145", "0.6193762", "0.60635644", "0.6037169", "0.5984545", "0.5982989", "0.596439", "0.5963066", "0.5948383", "0.5945803", "0.5933692", "0.5924475", "0.58873904"...
0.6122112
10
Return usable general items for hotkey usage
def get_valid_items list = [] @items.each do |id, number| item = $data_items[id] list << item if item.for_friend? || item.for_opponent? end return list end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_all_shortcuts\n # Interface method\n end", "def default_shortcuts\r\n {\r\n \"Ctrl+Shift+S\" => {\"description\"=>\"Displays Tr8n shortcuts\", \"script\"=>\"Tr8n.UI.Lightbox.show('/tr8n/help/lb_shortcuts', {width:400});\"},\r\n \"Ctrl+Shift+I\" => {\"description\"=>\"Turn...
[ "0.65206814", "0.6295005", "0.61524886", "0.60501015", "0.6008976", "0.5862093", "0.5860301", "0.57996696", "0.5788796", "0.5768459", "0.5716046", "0.5619148", "0.5558418", "0.55098855", "0.54968846", "0.54841596", "0.5479871", "0.54752463", "0.54723203", "0.5463108", "0.5452...
0.0
-1
Change current control character to next alive member
def recurrence_leader all_members.each_with_index do |member, index| next if member.dead? next if member == leader if !@battle_members_array.include?(member.actor.id) @battle_members_array << member.actor.id end swap_order(0, index) puts "recurrence leader: #{all_members[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_char\n @current_char_pos += 1\n @current_char = @string[@current_char_pos, 1]\n end", "def next_char\n self.cursor += 1\n end", "def advance \n \n @pos += 1\n if @pos > @text.length - 1\n @currentChar = nil\n else \n @currentChar = @text[@pos]\n end\n \n end...
[ "0.7233617", "0.71833444", "0.67800987", "0.64734036", "0.64010084", "0.6362396", "0.629941", "0.618559", "0.61367714", "0.6132175", "0.6079921", "0.6075501", "0.6049753", "0.603179", "0.5922679", "0.589918", "0.58386433", "0.58334714", "0.5831755", "0.5831755", "0.5816409", ...
0.0
-1
Make all party member's exp as closer as possible
def gain_exp(xp) return if xp == 0 info = sprintf(Vocab::Party::EXPGain, xp) SceneManager.display_info(info) # Number of pones msize = members.size # xp that disputed disputed = 0 # average xp of the party xp_avg = 0 # average xp for everypony xp_gained_avg = (xp / msize).t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gain_exp\n rate = Grade.rate(:exp)\n $game_party.all_members.each do |actor|\n actor.gain_exp_cpv($game_troop.exp_total, rate)\n end\n return $game_troop.exp_total * rate / 100\n end", "def update_exp_gain()\n if !@complete\n total_remaining = 0\n \n for i in 0 .. $game_pa...
[ "0.7002103", "0.6304434", "0.60306656", "0.5965251", "0.58847106", "0.5850487", "0.5813022", "0.57003736", "0.5693982", "0.5603371", "0.5601628", "0.5595798", "0.55750597", "0.55504936", "0.5538658", "0.55305576", "0.55191165", "0.5502298", "0.54867965", "0.548638", "0.548398...
0.6663091
1
Determine if Everyone is Dead
def all_dead?(check_only = false) return false if !check_only && !$game_system.allow_gameover? re = super() && ($game_party.in_battle || members.size > 0) @dead_confirm_timer = 0 if @dead_confirm_timer.nil? @dead_confirm_timer = re ? @dead_confirm_timer + 1 : 0 BattleManager.send_flag(in_battle: tru...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_dead?\n @life <= 0\n end", "def is_dead?\n @lifespan < 0.0\n end", "def is_dead?\n @lifespan < 0.0\n end", "def dead?()\n\t\tnot alive?()\n\tend", "def dead?\n @dead\n end", "def isDead\n self.dead\n end", "def dead?\n @dead || false\n end", "def...
[ "0.7612503", "0.7550412", "0.7550412", "0.7433685", "0.7410537", "0.73430705", "0.7325752", "0.73120314", "0.7274965", "0.7265373", "0.7259749", "0.7129893", "0.7111045", "0.70925325", "0.7003884", "0.6982193", "0.6955741", "0.6866668", "0.68561345", "0.68238944", "0.679813",...
0.6906634
17
Add an Actor. tag: effectus [REP]
def add_actor(actor_id) @actors.push(actor_id) unless @actors.include?(actor_id) $game_player.refresh trigger_symbol = :"actor_id_#{actor_id}" unless $game_temp.effectus_triggers.include?(trigger_symbol) $game_temp.effectus_triggers << trigger_symbol end $game_map.effectus_need_refresh = t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_actor(actor)\n @actors << actor\n return actor\n end", "def add(interactor)\n interactors << interactor\n end", "def add_actor(actor_id)\r\n # アクターを取得\r\n actor = $game_actors[actor_id]\r\n # パーティ人数が 4 人未満で、このアクターがパーティにいない場合\r\n if @actors.size < 4 and not @actors.inclu...
[ "0.63788825", "0.63785964", "0.6114883", "0.609213", "0.60380673", "0.6034524", "0.59591186", "0.59570533", "0.59467775", "0.58468205", "0.5744557", "0.57421416", "0.5696365", "0.5675786", "0.5572048", "0.55417925", "0.5526808", "0.5515616", "0.54680836", "0.54673153", "0.545...
0.69076097
0
Overwrite: Initial Party Setup
def setup_starting_members(mode) init_actid = mode.init_party || [] if init_actid.empty? @actors = $data_system.party_members.clone else @actors = init_actid end #-- validate actors @actors.each do |id| next if (id || 0).between?(1, $data_actors.size - 1) raise "Invalid s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_setup; \"\" end", "def post_setup\n end", "def prepare_for_installation; end", "def post_install; end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t# Do nothing\n\tend", "def setup\n\t\t# Do nothing\n\tend", "def ...
[ "0.6951523", "0.69157976", "0.6862457", "0.66676486", "0.6584947", "0.6584947", "0.658474", "0.658474", "0.65277505", "0.6525396", "0.6501542", "0.6501062", "0.6497758", "0.6477073", "0.64489895", "0.63851047", "0.63785434", "0.6268264", "0.6219998", "0.6219998", "0.61870813"...
0.0
-1
depends_on :ack => :recommended depends_on :the_silver_searcher => :recommended
def install bin.install "sack", "sag", "sgrep", "F" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def direct_dependencies; end", "def expand_dependency(dependency, parent)\n\t\t\t\t# The job of this function is to take a dependency and turn it into 0 or more provisions. The dependency could be a normal fully-qualified name or a wildcard. It's not clear at which point pattern matching should affect dependency...
[ "0.59860003", "0.59564906", "0.58492315", "0.57927954", "0.57927954", "0.57927954", "0.5770508", "0.5696298", "0.5696298", "0.553499", "0.55061394", "0.54978186", "0.54978186", "0.5425489", "0.54220307", "0.5366948", "0.53600556", "0.5346871", "0.5286383", "0.5275242", "0.526...
0.0
-1
GET /register registration page
def register @user = User.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n #showing the registration page\n end", "def register_page\n render template: \"/register/registerPage\"\n end", "def get_registration\n path = self.api_root + '/register'\n process_firecloud_request(:get, path)\n end", "def register\r\n @user = User.new\r\n @visit_register = \"...
[ "0.7444627", "0.7231776", "0.7195817", "0.7038188", "0.68781435", "0.6826008", "0.6713466", "0.66902244", "0.6684264", "0.65789306", "0.65773624", "0.6567695", "0.65508926", "0.65508926", "0.65508926", "0.6524237", "0.64725095", "0.64677155", "0.64509434", "0.6425886", "0.640...
0.0
-1