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
GET /accounts/1 GET /accounts/1.json
def show @account = Account.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @account } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accounts\n get('/accounts')['accounts']\n end", "def get_accounts()\n http_get(accounts_url)\n end", "def get_account\n as_json(get_results('/account'))\n end", "def account(id)\n make_json_api_request :get, \"v2/accounts/#{id}\"\n end", "def show\n authorize @account...
[ "0.76854396", "0.76389235", "0.76367265", "0.75433934", "0.74302703", "0.72776824", "0.7264478", "0.72200984", "0.72200984", "0.72200984", "0.72200984", "0.72200984", "0.7190633", "0.71900064", "0.71897256", "0.71785915", "0.71748847", "0.716882", "0.71648955", "0.71421146", ...
0.7209649
12
GET /accounts/new GET /accounts/new.json
def new @account = Account.new respond_to do |format| format.html # new.html.erb format.json { render json: @account } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @account }\n end\n end", "def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @account }\n ...
[ "0.78650784", "0.78650784", "0.78650784", "0.78650784", "0.78650784", "0.7803738", "0.77698904", "0.7757964", "0.7560944", "0.7444087", "0.7443985", "0.742651", "0.7275879", "0.721831", "0.7198656", "0.71947694", "0.714344", "0.71269023", "0.7125235", "0.71228045", "0.7076539...
0.7639224
8
POST /accounts POST /accounts.json
def create @account = Account.new(params[:account]) respond_to do |format| if @account.save # If we provide tokens (manually) if !@account.tokens? redirect_to '/auth/twitter?screen_name=' + @account.username return else format.html { redirect_to @account, notice: 'Account was successf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n megam_rest.post_accounts(to_hash)\n end", "def post_accounts(json_hash)\n @options = {:path => '/users.json',\n :body => json_hash[:json]}.merge(@options)\n\n request(\n :expects => 201,\n :method => :post,\n :body => @options[:body]\n )\n ...
[ "0.77059096", "0.74428105", "0.6998076", "0.68458116", "0.684345", "0.68387824", "0.6831728", "0.680515", "0.67691255", "0.67659897", "0.67633784", "0.6748523", "0.67459255", "0.67459255", "0.67459255", "0.67459255", "0.67459255", "0.67459255", "0.67459255", "0.67459255", "0....
0.65157336
32
PUT /accounts/1 PUT /accounts/1.json
def update @account = Account.find(params[:id]) respond_to do |format| if @account.update_attributes(params[:account]) format.html { redirect_to @account, notice: 'Account was successfully updated.' } format.json { head :ok } else format.html { render action: "edit" } format.json { render jso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update \n begin\n @resource = Account.find(params[:id])\n @resource.update_attributes!(params[:account])\n render :response => :PUT\n rescue Exception => e\n @error = process_exception(e)\n render :response => :error\n end\n end", "def update\n authorize @account\n ...
[ "0.7171354", "0.68998396", "0.6831369", "0.6614414", "0.6534509", "0.65298426", "0.650217", "0.650217", "0.6489508", "0.64866304", "0.648625", "0.6464929", "0.646357", "0.6462444", "0.64484173", "0.64045215", "0.64007765", "0.6391459", "0.6370063", "0.636715", "0.6366587", ...
0.6291741
24
DELETE /accounts/1 DELETE /accounts/1.json
def destroy @account = Account.find(params[:id]) @account.destroy respond_to do |format| format.html { redirect_to accounts_url } format.json { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_account\n @connection.request({\n :method => 'DELETE'\n }) \n end", "def destroy\n @api_v1_account.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_accounts_url, notice: 'Account was successfully destroyed.' }\n format.jso...
[ "0.76617646", "0.75542223", "0.7549606", "0.7352131", "0.7352131", "0.7346889", "0.7346889", "0.7346889", "0.7327806", "0.7327806", "0.7327806", "0.7327806", "0.7327806", "0.7327806", "0.7280886", "0.7280886", "0.725647", "0.7194611", "0.7172228", "0.71403325", "0.7105254", ...
0.6911621
69
Define the collections that this script knows how to harvest per yml files in the config/collections directory
def collections config_dir = File.join(File.dirname(__FILE__), '..', 'config', 'collections') files = Dir.glob("#{config_dir}/*.yml") files.map! { |x| File.basename(x, '.yml') } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collection_names\n case config[\"collections\"]\n when Hash\n config[\"collections\"].keys\n when Array\n config[\"collections\"]\n when nil\n []\n else\n raise ArgumentError, \"Your `collections` key must be a hash or an array.\"\n end\n end", "de...
[ "0.6989244", "0.6909401", "0.67757946", "0.67678046", "0.67434514", "0.6660916", "0.6519331", "0.6516706", "0.65046185", "0.64061207", "0.6206938", "0.6154501", "0.6139639", "0.6117748", "0.61045593", "0.6040191", "0.6025074", "0.59908533", "0.59803045", "0.5972431", "0.59658...
0.81655353
0
CLicks the logout link
def logout user_name.click logout_link.click end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logout\n self.logoutlink.click\n end", "def comp_signout_link\n # click_link 'Sign out'\n find('a[href*=\"mylogout=\"]').click\n end", "def logout_link(text=nil)\n text ||= browserid_config.logout.text\n target = browserid_config.logout.path || '#'\n link_to text, target...
[ "0.7908806", "0.76935714", "0.75391835", "0.7443705", "0.7443705", "0.7379084", "0.73530567", "0.7326772", "0.7222327", "0.7209906", "0.7156072", "0.71241426", "0.71159273", "0.70929986", "0.7082103", "0.70786446", "0.70751506", "0.7057689", "0.7028689", "0.7017951", "0.70081...
0.75761026
2
CLicks the home button
def go_home wait_for_home_button home_button.click end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def go_home\n self.homelink.click\n end", "def move_to_home!\n print \"\\e[H\"\n end", "def move_to_home!\n print \"\\e[H\"\n end", "def move_to_home!\n print \"\\e[H\"\n end", "def move_to_home!\n print \"\\e[H\"\n end", "def set_home\n end", "def home()\n@ss.close\n @titleL...
[ "0.7020916", "0.66718966", "0.66718966", "0.66718966", "0.66718966", "0.651163", "0.6414855", "0.6336861", "0.6336861", "0.6306273", "0.6268822", "0.6258503", "0.6212929", "0.6202885", "0.61798257", "0.61798257", "0.6170692", "0.6141431", "0.6108978", "0.6108978", "0.6108263"...
0.75449264
0
Clicks the admin button
def go_to_admin_page user_name.click admin_link.click end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def click_admin_link\n click_header_dropdown\n wait_for_update_and_click_js admin_link_element\n wait_for_title 'Admin'\n end", "def admin_login\n @driver.get \"#{$admin_host}/logout\"\n @driver.find_element(:id, \"login_user\").clear\n @driver.find_element(:id, \"login_user\").send_keys \"adm...
[ "0.7786384", "0.6849737", "0.67552215", "0.65358144", "0.6506523", "0.64983386", "0.64983386", "0.64983386", "0.64983386", "0.6489333", "0.6458711", "0.6456881", "0.6421587", "0.6383656", "0.6332959", "0.63244116", "0.6283021", "0.62800014", "0.6260531", "0.6234725", "0.62347...
0.79693234
0
Clicks the Helpdesk link
def go_to_helpdesk_page edit_user_link.click helpdesk_link.click end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_NeedHelpLink\n\n loginpage = Hudl_Login_Page.new @@driver\n\n loginpage.ClickNeedHelp()\n\n end", "def help\n self.helplink.click\n end", "def click(link); end", "def click_JustGiving_Home_link\n div = get_Payment_div\n div.link(:text, JUSTGIVING_HOME_LINKS_TEXT).click\n end", "...
[ "0.7468448", "0.734896", "0.7332666", "0.71505004", "0.70651525", "0.6995841", "0.69154096", "0.68991125", "0.673647", "0.67131054", "0.6632512", "0.65749663", "0.65553534", "0.6494979", "0.6467241", "0.6412133", "0.6313143", "0.6245313", "0.62303406", "0.62152743", "0.620198...
0.82486784
0
verify flash notification message
def verify_notification(exp_msg_text) msg_found = false all_messages.each do |msg| if msg.text.include? exp_msg_text msg_found = true end msg.find_link('Close Message').click end raise "Message '#{exp_msg_text}' not found" unless msg_found end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flash_is(message)\n within(\".notifications\") do\n expect(page).to have_text message\n end\n end", "def flash_messages?; flash.any?; end", "def flash_message?; flash.blank?; end", "def display_flash_notifications\n html = nil\n\n if session[:notification] and session[:notification].is_a?(A...
[ "0.7042599", "0.68949217", "0.6782112", "0.67034036", "0.6588084", "0.65726113", "0.65290564", "0.65156335", "0.64898044", "0.6486164", "0.64358884", "0.6399554", "0.6398154", "0.6385518", "0.63675463", "0.6362052", "0.63538903", "0.6352239", "0.63288563", "0.63239026", "0.63...
0.64760727
10
Write Your Code Here
def bubblesort(arr) swaps = 0 check = true while check newswaps = 0 for i in 0...arr.count - 1 if arr[i] > arr[i + 1] arr[i], arr[i + 1] = arr[i + 1], arr[i] newswaps+=1 end end if newswaps == 0 check = false...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def code; end", "def code; end", "def code; end", "def code; end", "def code; end", "def code; end", "def code; end", "def method\n\t\t# code code\n\tend", "def custom; end", "def custom; end", "def suivre; end", "def do()\r\n\tend", "def how_it_works\r\n end", "def run\n end", "def ru...
[ "0.70354235", "0.70354235", "0.70354235", "0.70354235", "0.70354235", "0.70354235", "0.70354235", "0.6532344", "0.6368296", "0.6368296", "0.63615525", "0.63176733", "0.62030923", "0.6051641", "0.6022816", "0.6022816", "0.6022816", "0.6022816", "0.6022816", "0.6022816", "0.602...
0.0
-1
test "should correctly show search results" do
def perform_search terms = { vehicle_year: 2006, vehicle_brand: "Yamaha", vehicle_model: "Yz250", vehicle_submodel: "-- Base", category_name: "Complete Wheel Assembly" } perform_search(terms) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_search\n get :index, :q => 'Amazon'\n assert_response :success\n assert_template 'searches/index'\n assert_equal(1, assigns(:companies).size)\n assert_equal(1, assigns(:news).size)\n assert_equal(0, assigns(:gossip).size)\n assert_equal(0, assigns(:questions).size)\n assert_select ...
[ "0.83393484", "0.79943234", "0.77772033", "0.7695275", "0.74424416", "0.7377621", "0.7317642", "0.72423583", "0.71961325", "0.70511526", "0.70403314", "0.6976388", "0.6953439", "0.6906389", "0.69027704", "0.6899221", "0.689076", "0.684946", "0.6828682", "0.67526823", "0.67226...
0.0
-1
:cv, :resume, :repertoire_list :received_messages, :token will be calling user.issue_token method then return the received token
def specialty if object.field == "vocalist" object.vocal else object.instrumental end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request_token\n consumer.get_request_token\n end", "def request_token(options={})\n @request_token ||= consumer.get_request_token(options)\n end", "def request_token\n consumer.get_request_token(:oauth_callback => Koprol.callback_url)\n end", "def request_token(options={}, *argume...
[ "0.6190354", "0.61324614", "0.60861284", "0.60641813", "0.6046056", "0.60439193", "0.6042884", "0.6034633", "0.60187286", "0.6017258", "0.5908396", "0.58706546", "0.58490676", "0.58490676", "0.5839468", "0.5782115", "0.5771739", "0.57629406", "0.5751046", "0.5734832", "0.5732...
0.0
-1
starts a new user session
def create user = User.find_by({email: params[:email]}) if user && user.authenticate(params[:password]) session[:user_id] = user.id redirect_to user_flashcards_path else @email = params[:email] flash.now[:error] = "Sorry, unknown combo! Try again, please!" render :new end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_session(user)\n session[:user] = User.find(user).id\n end", "def start_session\n generate_token(:token)\n setup_session\n update_last_session\n end", "def start_session(savedUserId)\n \tsession[:user] = savedUserId\n \trender:nothing => true\n end", "def start_session\n ...
[ "0.77985495", "0.73457813", "0.7225558", "0.71222913", "0.7055026", "0.70265687", "0.7015192", "0.7009647", "0.6885311", "0.6872503", "0.6862245", "0.6856004", "0.68125945", "0.6799488", "0.6793333", "0.6788924", "0.66705763", "0.66607475", "0.6650775", "0.66463166", "0.66421...
0.0
-1
destroy session on logout
def destroy reset_session redirect_to new_session_path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logout\n close_session\n end", "def logout!\n session.clear\n end", "def logout!\n session.clear\n end", "def logout!\n session.clear\n end", "def logout\n session[:user] = nil\n end", "def logout\n @session[:user] = nil\n end", "def log_out \n session.clea...
[ "0.86395377", "0.8515137", "0.8515137", "0.8486437", "0.8430284", "0.83900243", "0.83636254", "0.83510333", "0.83507246", "0.83374524", "0.8320089", "0.8314745", "0.8290737", "0.82736593", "0.82736593", "0.82631236", "0.8262906", "0.82277274", "0.82267857", "0.8222766", "0.82...
0.0
-1
Wrapper to Interactor.call Set general logs: Start/Finish and send exception to admin
def interactor_logging(interactor) Rails.logger.info "#{self.class} START" context.interactor_start_time = Time.now # run current interactor interactor.call rescue => exp Rails.logger.error "#{self.class}.#{__method__} ERROR #{exp.message}" Rails.logger.error exp.backtrace.join($/) contex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log; end", "def log; end", "def log; end", "def log; end", "def log; end", "def log; end", "def log; end", "def log; end", "def invoke_with_call_chain(*args)\n super\n @logger.flush\n exit(1) if respond_to?(:error?) && error?\n end", "def log(*args); end", "def log_stuff\r...
[ "0.6010062", "0.6010062", "0.6010062", "0.6010062", "0.6010062", "0.6010062", "0.6010062", "0.6010062", "0.60054183", "0.5952837", "0.5942137", "0.5933312", "0.59209746", "0.59192675", "0.58864963", "0.58688766", "0.58455867", "0.5822818", "0.5816232", "0.5788351", "0.5788351...
0.6915195
0
Default validator to Current Interactor
def validation # Rails.logger.debug "#{self.class}.#{__method__} Default validator is empty" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validator; end", "def validation_default; true; end", "def validation_default; true; end", "def validator=(_); end", "def validation_default; false; end", "def validate\n super \n end", "def validator(arg = nil)\n set_or_return(\n :validator,\n arg,\n kind_of: [T...
[ "0.7006155", "0.69541085", "0.69541085", "0.6928034", "0.665923", "0.64321345", "0.63724136", "0.6334438", "0.6292393", "0.6288099", "0.6260124", "0.6248048", "0.62347794", "0.62193084", "0.621148", "0.6142603", "0.6064522", "0.6040814", "0.60236585", "0.59822816", "0.5972076...
0.693148
3
before_action :authorize_request, except: GET /users
def index @posts = Post.all render json: @posts end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authorize\n redirect_to '/login' unless current_user\n end", "def authorize\n redirect_to '/login' unless current_user\n end", "def authorize\n redirect_to '/login' unless current_user\n end", "def authorize\n redirect_to '/login' unless current_user\n end", "def authorize\n redirect...
[ "0.76026344", "0.76026344", "0.76026344", "0.76026344", "0.76026344", "0.76026344", "0.76026344", "0.76026344", "0.7577003", "0.75571", "0.7540927", "0.75397563", "0.7426563", "0.7319072", "0.73184305", "0.72689027", "0.72501564", "0.7245227", "0.7214507", "0.7183768", "0.716...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_posts @posts = Post.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 post_params params.require(:post).permit(:title, :imgURL, :content) 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
def campus=(campus_name) write_attribute("campus", campus_name) if target_area write_attribute("region", self.school.region) self.univerityState = self.school.state end end
def target_area return school if school.present? self.school = case when campus.present? && universityState.present? TargetArea.find_by(name: campus, state: universityState) when campus.present? TargetArea.find_by(name: campus) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def campus_code=(v)\n @campus_code = alma_string v, 50\n end", "def set_campus\n @campus = Campus.find(params[:id])\n end", "def set_campus\n @campus = Campus.find(params[:id])\n end", "def set_campus\n @campus = FortyTwo::Campus.find(params[:id])\n end", "def campus_params\n p...
[ "0.68998486", "0.6733237", "0.6733237", "0.672755", "0.6607543", "0.6314489", "0.62280494", "0.61772233", "0.61615473", "0.60905015", "0.60635364", "0.6036137", "0.5966368", "0.5966368", "0.58508414", "0.5826321", "0.58093536", "0.5807148", "0.57702214", "0.5764109", "0.57641...
0.6560578
5
a little more than an alias. Nickname is the preferred_name if one is listed. Otherwise it is first name
def nickname (preferred_name && !preferred_name.strip.empty?) ? preferred_name : first_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def firstname; preferred_name; end", "def nickname\n (f, l) = full_name.split(\" \", 2)\n \"#{f}#{l.split(/[\\s']/).collect(&:first).join}\"\n end", "def preferred_name(default, preferred)\n if default.nil? && preferred.nil?\n 'No one'\n elsif preferred.nil?\n default\n else...
[ "0.77372473", "0.71166825", "0.7062574", "0.6989944", "0.695817", "0.6941988", "0.69090635", "0.6873415", "0.6868262", "0.6864109", "0.6773599", "0.6752864", "0.67187494", "0.6632765", "0.661703", "0.65665585", "0.65665585", "0.6535309", "0.64967585", "0.648583", "0.64789194"...
0.8314464
0
nickname is an alias for preferred_name
def nickname=(name) write_attribute('preferred_name', name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nickname\n (preferred_name && !preferred_name.strip.empty?) ? preferred_name : first_name\n end", "def naming\n name || nickname\n end", "def firstname; preferred_name; end", "def nickname\n (f, l) = full_name.split(\" \", 2)\n \"#{f}#{l.split(/[\\s']/).collect(&:first).join}\"\n end", "...
[ "0.874877", "0.78176415", "0.77307874", "0.7710144", "0.76891524", "0.75599706", "0.7548387", "0.7519871", "0.7411991", "0.7407074", "0.73590636", "0.7342978", "0.72978073", "0.7290496", "0.72904646", "0.7249781", "0.72356033", "0.722015", "0.72053087", "0.7089255", "0.706619...
0.8168421
1
an alias for yearInSchool
def year yearInSchool end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def w_year; end", "def year() end", "def year; end", "def year; end", "def cwyear\n end", "def year_name(number); end", "def raw_year\n start_on.year\n end", "def year\n end", "def year\n self.range('year')\n end", "def year\n ((semester - 1) / 2) + 1\n end", "def year\n 2020\n...
[ "0.7864525", "0.76556915", "0.7486218", "0.7486218", "0.7470623", "0.74378467", "0.7378024", "0.73679626", "0.72882384", "0.72807777", "0.72064817", "0.71814555", "0.71558905", "0.71350384", "0.7077785", "0.70754546", "0.70653695", "0.7065319", "0.7049748", "0.70379966", "0.7...
0.83695793
0
set dateChanged and changedBy
def stamp_changed return unless changed? self.dateChanged = Time.now self.changedBy = ApplicationController.application_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def changed_by=(value)\n @changed_by = value\n end", "def changed_by\n return @changed_by\n end", "def stamp\n self.dateChanged = Time.now\n self.changedBy = ApplicationController.application_name\n end", "def stamp\n self.dateChanged = Time.now\n...
[ "0.7340227", "0.6804354", "0.68031806", "0.68031806", "0.68031806", "0.678587", "0.6256568", "0.61542565", "0.61542565", "0.61542565", "0.6126632", "0.6067539", "0.600188", "0.59776086", "0.5972799", "0.59125406", "0.59060276", "0.59043753", "0.59043753", "0.5855236", "0.5853...
0.74564546
0
def email_address current_address ? current_address.email : user.try(:username) end [email1, email2, email3] => primary email, or email
def email_address (email_addresses.where(primary: true).first || email_addresses.first).try(:email) || current_address.try(:email) || permanent_address.try(:email) || user.try(:username) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def email\n if self.alternate_email.blank?\n if self.alumni?\n \"#{self.username}@alumni.calvin.edu\"\n else\n \"#{self.username}@students.calvin.edu\"\n end\n else\n self.alternate_email\n end\n end", "def user_email\n msg['email'] || entry['email'] || reject['emai...
[ "0.74189025", "0.74174523", "0.7339469", "0.73203266", "0.7264714", "0.71734697", "0.71274936", "0.7113294", "0.70737225", "0.70531934", "0.70499396", "0.69935536", "0.6933993", "0.6925941", "0.6919043", "0.69188863", "0.69188863", "0.6900483", "0.6898858", "0.6853403", "0.68...
0.86936724
0
Sets the primary email address in email_addresses table
def primary_email_address=(email) old_primaries = email_addresses.select { |email| email.primary == true } old_primaries.each do |old_primary| old_primary.primary = 0 old_primary.save! end old_email_record = email_addresses.select { |email_record| email_record.email == email }.first if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def primary_smtp_address=(value)\n @primary_smtp_address = value\n end", "def set_person_email_address\n @person_email_address = PersonEmailAddress.find(params[:id])\n end", "def email_set(address)\n self.email.set address\n end", "def set_next_email_as_primary\n ...
[ "0.73774964", "0.721159", "0.71333647", "0.7028849", "0.7028849", "0.6977318", "0.6977318", "0.6977318", "0.6977318", "0.6977318", "0.6977318", "0.6977318", "0.6977318", "0.6977318", "0.6977318", "0.6977318", "0.6977318", "0.6977318", "0.6977318", "0.6977318", "0.6977318", ...
0.7466834
0
Sets a phone number in the phone_numbers table
def set_phone_number(phone, location, primary = false, extension = nil) if primary old_primaries = phone_numbers.select { |phone| phone.primary == true } old_primaries.each do |old_primary| old_primary.primary = 0 old_primary.save! end end old_phone_record = phone_numbers....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_phone_num\n @phone_num = PhoneNum.find(params[:id])\n end", "def mobile_phone=(n)\n pull unless @details\n pn = Quickbooks::Model::TelephoneNumber.new\n pn.free_form_number = n\n @details.mobile_phone = pn\n #update our locally stored number too\n update_mobile_phone_number\n e...
[ "0.812292", "0.77778137", "0.7757968", "0.7685202", "0.76363325", "0.75811434", "0.75153977", "0.7480439", "0.7443054", "0.74345726", "0.74345726", "0.74345726", "0.74345726", "0.74345726", "0.74345726", "0.74086934", "0.7383669", "0.73660505", "0.72444874", "0.71018517", "0....
0.7478907
8
This method shouldn't be needed because nightly updater should fill this in
def is_secure? isSecure == 'T' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def outdated; end", "def outdated?; end", "def patch_version; end", "def bump_patch_version; end", "def patch; end", "def patch; end", "def target_version; end", "def updated_source_file?; end", "def old_sync; end", "def version_mismatch_detected\n end", "def updated_so...
[ "0.64420235", "0.63834226", "0.6268923", "0.6187456", "0.590989", "0.57970965", "0.57970965", "0.57839495", "0.57603884", "0.5747855", "0.5725816", "0.5721099", "0.57101876", "0.56410265", "0.5599732", "0.5540949", "0.5540321", "0.5535492", "0.5501868", "0.5501868", "0.550186...
0.0
-1
def all_team_members(remove_self = false) my_local_level_ids = teams.collect &:id mmtm = TeamMember.get('filters[team_id]' => my_local_level_ids) order("last_name, first_name ASC") people = mmtm.collect(&:person).flatten.uniq people.delete(self) if remove_self return people end
def to_s informal_full_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def team_members\n self.team_member_ids.collect{|user_id| User.find(user_id)}\n end", "def get_team_members\n team_members = []\n self.students.each do |student|\n team_members.append(student.user)\n end\n return team_members\n end", "def team_members\n @team_members ||= team.map { |...
[ "0.73472565", "0.7249958", "0.70776707", "0.7011102", "0.6822828", "0.68085974", "0.6749756", "0.6663979", "0.6594712", "0.6543463", "0.6540787", "0.64776653", "0.64364946", "0.63968563", "0.6388457", "0.63624066", "0.6361808", "0.63207805", "0.6304629", "0.6304629", "0.63046...
0.0
-1
TODO: determine if we need this.. user has no balance_bookmark defined def account_balance result = nil if user && user.balance_bookmark result = user.balance_bookmark.value end result end
def updated_at dateChanged end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def account_balance\n @account_balance\n end", "def balance(account)\n return balances[account] || infer_balance(account) # need to infer the balance if the account is not in ledger's output\n end", "def checking_account_balance\n return @checking_account_balance\n end", "def get_balance\n r...
[ "0.7903857", "0.77263093", "0.7596754", "0.7554249", "0.75370544", "0.7311336", "0.7306051", "0.7300479", "0.7269061", "0.7263263", "0.72000694", "0.7174935", "0.71651024", "0.7154764", "0.7117207", "0.71000105", "0.7086457", "0.7049843", "0.70324093", "0.70098877", "0.698565...
0.0
-1
GET /listings/1 GET /listings/1.json
def show @listing = Listing.find(params[:id]) @favorite = current_user.favorites.find_by_listing_id(params[:id]) if @favorite != nil @favorite.mark_read end render :layout => false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @listings = Listing.all\n render json: @listings\n end", "def index\n @listings = Listing.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @listings }\n end\n end", "def index\n @listings = Listing.all\n\n respond_to d...
[ "0.78890157", "0.7694565", "0.769423", "0.76560944", "0.7541643", "0.735787", "0.735787", "0.735787", "0.735787", "0.735787", "0.735787", "0.7326875", "0.7326875", "0.7326875", "0.73026395", "0.7253904", "0.72402346", "0.72342604", "0.72247696", "0.72227794", "0.72227794", ...
0.0
-1
POST /listings POST /listings.json
def create @listing = Listing.new(listing_params) respond_to do |format| if @listing.save format.html { redirect_to @listing, notice: 'Listing was successfully created.' } format.json { render action: 'show', status: :created, location: @listing } else format.html { render a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n\n @listing = Listing.new(listing_params)\n\n @listing.save\n\n render json: @listing\n redirect_to listings_path # redirect to home page\n end", "def index\n @listings = Listing.all\n render json: @listings\n end", "def create\n #debugger\n #TODO: DELETE A...
[ "0.7446066", "0.7005275", "0.6834559", "0.6828408", "0.6827981", "0.6775853", "0.6734454", "0.6673963", "0.6612273", "0.66121864", "0.6581905", "0.6568161", "0.65660554", "0.6559053", "0.6555972", "0.65158397", "0.6491164", "0.6446251", "0.6435303", "0.6434414", "0.6434414", ...
0.6723492
8
PATCH/PUT /listings/1 PATCH/PUT /listings/1.json
def update respond_to do |format| if @listing.update(listing_params) format.html { redirect_to @listing, notice: 'Listing was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @listing.errors, s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n #updating the listings\n respond_to do |format|\n if @listing.update(listing_params)\n format.html { redirect_to @listing, notice: \"Listing was successfully updated.\" }\n format.json { render :show, status: :ok, location: @listing }\n else\n format.html { render ...
[ "0.6856242", "0.68164784", "0.6815726", "0.680796", "0.6584647", "0.6548128", "0.6548128", "0.6548128", "0.6548128", "0.6548128", "0.6548128", "0.6548128", "0.6548128", "0.6548128", "0.6548128", "0.6548128", "0.6541613", "0.6539757", "0.6521254", "0.64486593", "0.64431477", ...
0.6574686
7
DELETE /listings/1 DELETE /listings/1.json
def destroy @listing.destroy respond_to do |format| format.html { redirect_to listings_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n api_delete(\"/listings/#{@listing_id}\")\n end", "def destroy\n @listing = Listing.find(params[:id])\n @listing.destroy\n\n respond_to do |format|\n format.html { redirect_to listings_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @listi...
[ "0.82345164", "0.74539715", "0.74539715", "0.74539715", "0.74539715", "0.74539715", "0.73037916", "0.72940636", "0.7221047", "0.7205228", "0.7195688", "0.7195688", "0.7195688", "0.71829325", "0.7143359", "0.70798117", "0.70783144", "0.7071188", "0.70169014", "0.70110226", "0....
0.7326562
10
Use callbacks to share common setup or constraints between actions.
def set_listing @listing = Listing.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 listing_params params.require(:listing).permit(:name, :time, :location, :body, :category) 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
set the job id on the fiery server to retrieve job information and preview get the first page preview of the job
def get_job_preview_sample(client) response = client["jobs/#{$job_id}/preview/1"].get p '' p 'Get job preview' uri = "data:image/jpeg;base64,#{Base64.strict_encode64 response}" p uri end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @job_id = @part.job.id\n end", "def show\n @job = Job.find(params[:id])\n end", "def show\n @job = Job.find(params[:id])\n end", "def show\n @job = Mugen::Job.find(params[:id])\n @preview = Mugen::Job.preview(@job['job_id'])\n @comments = Mugen::Job.comments(@job['job_...
[ "0.69422555", "0.67487645", "0.67487645", "0.6741761", "0.6703484", "0.6661501", "0.66545194", "0.66545194", "0.66545194", "0.66545194", "0.66545194", "0.66545194", "0.66545194", "0.66545194", "0.66545194", "0.66545194", "0.66545194", "0.66545194", "0.66545194", "0.66545194", ...
0.7097455
0
get job information from all jobs on the fiery server
def get_jobs_sample(client) response = client['jobs'].get p '' p 'Get jobs' p response end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_jobs\n\n find_jobs()\n end", "def getCurrentJobs\n getJobs('0/')\n end", "def job\n fetch('games.final_fantasy_xiv.jobs')\n end", "def fetch_job\n JSON.parse(RestClient.get(url).body)\n end", "def find_jobs(params:)\n response = HTTParty.get(\"#{@host}/api/jobs\...
[ "0.6998771", "0.69159925", "0.68930906", "0.6888588", "0.6812373", "0.6699806", "0.6643808", "0.661838", "0.6618216", "0.6576048", "0.65474874", "0.653104", "0.6529018", "0.6529018", "0.64217913", "0.63765085", "0.63738513", "0.6369825", "0.63528585", "0.6350947", "0.63483447...
0.59818494
46
get job information of a single job on the fiery server
def get_single_job_sample(client) response = client["jobs/#{$job_id}"].get p '' p 'Get single job' p response end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_job(job_id)\n response = HTTParty.get(\"#{@host}/api/jobs/#{job_id}\")\n\n return response['job']\n end", "def get_job(id)\n conn = @client.get do |req|\n req.url \"/api/v2/job/#{id}\"\n req.headers[\"Authorization\"] = @token\n end\n conn.body\n end...
[ "0.78445053", "0.74019146", "0.7289604", "0.7247924", "0.7247924", "0.7232583", "0.7229363", "0.703426", "0.7001", "0.69913864", "0.6922482", "0.69218653", "0.6910799", "0.6888833", "0.6871879", "0.68634665", "0.6851121", "0.6817782", "0.67754513", "0.6772666", "0.6758163", ...
0.69714075
10
login to the fiery server
def login_sample() login_json = { :username => $username, :password => $password, :accessrights => $api_key } client = RestClient::Resource.new "https://#{$hostname}/live/api/v3/", :headers => {}, :verify_ssl => OpenSSL::SSL::VERIFY_NONE request = login_json.to_json response = client['login'].po...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run()\n login()\n end", "def login\n make_login_call\n end", "def login\n end", "def login; end", "def login\n end", "def login\n end", "def login\n end", "def login\n end", "def login\n end", "def login\n end", "def login\n end", "def login\n end", "def log...
[ "0.7613818", "0.75021905", "0.7438519", "0.74141675", "0.73407125", "0.73407125", "0.73407125", "0.73407125", "0.73407125", "0.73407125", "0.73407125", "0.73407125", "0.73407125", "0.7232954", "0.7232954", "0.7176842", "0.7176769", "0.71623296", "0.7117574", "0.7117574", "0.7...
0.0
-1
logout from the fiery server
def logout_sample(client) response = client['logout'].post nil client.options[:headers][:cookies] = response.cookies p '' p 'Logout' p response end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logout\n BrickFTP::API::Authentication.logout\n end", "def logout\n BrickFTP::API::Authentication.logout\n end", "def logout\n @client.make_request :post,\n auth_path('logout')\n end", "def exec_logout\n core_destroySession\n redirect_to lat...
[ "0.7784155", "0.7784155", "0.7760734", "0.77224815", "0.7719792", "0.7719792", "0.7699615", "0.76955277", "0.76899475", "0.7667137", "0.76525867", "0.7592993", "0.75486344", "0.75157285", "0.7496344", "0.7484524", "0.74566543", "0.74520415", "0.7451164", "0.74410754", "0.7426...
0.0
-1
create a new job on the fiery server
def post_job_content_sample(client) job_multipart = { :file => File.new($full_path), 'num copies' => 10 } response = client['jobs'].post job_multipart p '' p 'Submit a new job' p response end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_job(job:, params: {})\n response = HTTParty.post(\"#{@host}/api/jobs\", body: {job: job, api_key: @api_key}.merge(params))\n \n return response\n end", "def new_job\n j = self.class.new\n j.save\n end", "def create_job(params = {})\n Bitmovin::Job.create(params)\n en...
[ "0.7430075", "0.7283598", "0.72130626", "0.7201947", "0.7104332", "0.7085807", "0.69170755", "0.69049734", "0.68818957", "0.6862891", "0.6851347", "0.68362373", "0.6817716", "0.6801917", "0.6784928", "0.67781734", "0.67472273", "0.6694078", "0.6668", "0.6646668", "0.656748", ...
0.0
-1
send a print action to a job on the fiery server
def print_job_sample(client) response = client["jobs/#{$job_id}/print"].put nil p '' p 'Print a job' p response end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_job\n @scanjob = Scanjob.find(params[:id])\n update_scanjob_state(@scanjob)\n\n render :template => 'admin/scanjobs/print_job', :layout => 'print'\n end", "def do_print\n @printer.exec(@buddy)\n end", "def perform(time)\n puts \"This job was published at #{}\"\n end", "def set_pri...
[ "0.6869328", "0.6401", "0.63645756", "0.62635076", "0.6206444", "0.60929954", "0.60482657", "0.60419285", "0.60331297", "0.58922344", "0.5883175", "0.5875137", "0.58675843", "0.5834282", "0.5830127", "0.58155435", "0.57850635", "0.5773942", "0.57697695", "0.56979954", "0.5668...
0.7004024
0
main method executing all sample code
def main client = login_sample post_job_content_sample client get_jobs_sample client get_single_job_sample client update_job_attribute_sample client print_job_sample client get_job_preview_sample client logout_sample client end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main\n end", "def main\n\n end", "def run_main\n end", "def main; end", "def main\n\nend", "def execute\n setup\n begin\n data = main\n rescue ArgumentError => e\n warn e.message\n exit 1\n end\n puts format_data(data)\n end", "def main(argv)\n ...
[ "0.78450924", "0.78393257", "0.78224057", "0.78155065", "0.7323036", "0.7168527", "0.71081525", "0.6866358", "0.6838477", "0.6838477", "0.67258215", "0.67258215", "0.67258215", "0.67258215", "0.67258215", "0.67258215", "0.67258215", "0.6672494", "0.66410494", "0.6637047", "0....
0.6244612
54
Ax + By = C, return A,B,C
def matrix_row return [ self.run, self.rise * -1, (p1.y * self.run - self.rise*p1.x)] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test(i,j,k)\nreturn @A[i]*$x + @B[j]*$y + @C[k]*$z\nend", "def solve(a, b, c)\n par = (b * b - 4 * a * c).sqrt\n [(-b + par) / (2 * a), (-b - par) / (2 * a)]\n end", "def cross (a, b, c)\n return (b[0]-a[0])*(c[1]-a[1]) - (c[0]-a[0])*(b[1]-a[1])\nend", "def cramers_rule(ax,ay,az,a)\n # ax = a...
[ "0.5895035", "0.57118493", "0.5691333", "0.5636467", "0.5437456", "0.54296756", "0.54296756", "0.5325066", "0.53163534", "0.52969545", "0.51944506", "0.51866376", "0.5122645", "0.51126915", "0.51080877", "0.5106475", "0.5106475", "0.50977916", "0.5054088", "0.5040763", "0.504...
0.0
-1
Initialize override, setting config options default values for merging
def initialize super @users = UNSET_VALUE end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def options\n original_options = super\n user_defaults = @config\n user_defaults.merge(original_options)\n end", "def init_config()\n options_apply_filter(\"DEFAULT\")\n end", "def initial_config\n default_config.deep_merge(@passed_config)\n end", "def initialize\n @config = ...
[ "0.73474175", "0.71641374", "0.71337235", "0.70976746", "0.7014052", "0.69488114", "0.69190717", "0.6902788", "0.6825064", "0.68118304", "0.6718081", "0.6716808", "0.6702684", "0.6672344", "0.6656738", "0.6648838", "0.6643266", "0.6624218", "0.6590411", "0.65770596", "0.65660...
0.0
-1
finalize! override, unseting config options
def finalize! @users = nil if @users == UNSET_VALUE end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def finalize_config!(kitchen_instance)\n super kitchen_instance\n\n kitchen_instance\n .transport\n .tap do |transport|\n configure_inspec_connection_options(\n transport_connection_options:\n transport\n .send(\n :connection_options,\n ...
[ "0.73861945", "0.7094549", "0.6896561", "0.6770697", "0.6712097", "0.66568506", "0.66545415", "0.66413504", "0.6614776", "0.6595371", "0.658138", "0.6535354", "0.6528782", "0.64951324", "0.6480363", "0.6466411", "0.6457106", "0.64440346", "0.64440346", "0.64290845", "0.642822...
0.0
-1
$ANTLR start parse dice.g:42:1: parse : expr ;
def parse() begin @ruleStack.push('parse') # dice.g:42:8: ( expr ) # dice.g:42:8: expr #@following.push(FOLLOW_expr_in_parse50) expr() #@following.pop rescue ANTLR::RecognitionException => e report_error(e) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expr()\n\n\n begin\n @ruleStack.push('expr')\n # dice.g:52:7: ( mult ( '+' mult | '-' mult )* )\n # dice.g:52:7: mult ( '+' mult | '-' mult )*\n\n #@following.push(FOLLOW_mult_in_expr65)\n mult()\n #@following.pop\n\n\n # dice....
[ "0.6419266", "0.64132065", "0.6256584", "0.5989779", "0.5979114", "0.5953655", "0.59394544", "0.57624596", "0.57487595", "0.5674672", "0.55899876", "0.55447286", "0.5515783", "0.55147153", "0.5513165", "0.5486725", "0.5424189", "0.54167414", "0.5408839", "0.53597397", "0.5356...
0.70998985
0
$ANTLR end parse $ANTLR start expr dice.g:52:1: expr : mult ( '+' mult | '' mult ) ;
def expr() begin @ruleStack.push('expr') # dice.g:52:7: ( mult ( '+' mult | '-' mult )* ) # dice.g:52:7: mult ( '+' mult | '-' mult )* #@following.push(FOLLOW_mult_in_expr65) mult() #@following.pop # dice.g:52:12: ( '+' mul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mult\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 26 )\n\n\n value = nil\n\n\n type = nil\n a = nil\n b = nil\n\n\n begin\n # at line 166:5: a= unary (type= ( '*' | '/' | '%' | '^' ) b= mult )?\n @state.following.push( TOK...
[ "0.6592982", "0.62966394", "0.6139795", "0.605094", "0.60306954", "0.5977342", "0.58850384", "0.5884814", "0.58594865", "0.5835688", "0.5823744", "0.57719064", "0.57712376", "0.56769294", "0.5636333", "0.56354105", "0.5611678", "0.5610611", "0.5605249", "0.560326", "0.5567311...
0.7133189
0
$ANTLR end expr $ANTLR start mult dice.g:65:1: mult : dice ( '' dice | '/' dice ) ;
def mult() begin @ruleStack.push('mult') # dice.g:65:7: ( dice ( '*' dice | '/' dice )* ) # dice.g:65:7: dice ( '*' dice | '/' dice )* #@following.push(FOLLOW_dice_in_mult100) dice() #@following.pop # dice.g:65:12: ( '*' di...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mult\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 59 )\n return_value = MultReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal268 = nil\n ...
[ "0.6214328", "0.61687005", "0.5703305", "0.5508596", "0.52002835", "0.5186409", "0.5180467", "0.5177721", "0.5081635", "0.50815225", "0.50516737", "0.50133294", "0.49957025", "0.49638844", "0.48003423", "0.47942403", "0.4771531", "0.4768028", "0.47469", "0.47072744", "0.47057...
0.661781
0
$ANTLR end mult $ANTLR start dice dice.g:88:1: dice : ( atom ( 'd' ( cent | atom ) ) | ( 'd' ( cent | atom ) ) );
def dice() begin @ruleStack.push('dice') # dice.g:88:7: ( atom ( 'd' ( cent | atom ) )* | ( 'd' ( cent | atom ) )* ) alt7 = 2 look_ahead7_0 = input.look_ahead(1).token_type if look_ahead7_0 == NUMBER || look_ahead7_0 == 12 alt7 = 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def roll(args, nick)\n if(!args || args.empty?)\n return SCRIPT_DESC\n end\n \n if args =~ /^(\\d+)/\n # starts with an integer we can use to roll\n @count = $1.to_i\n @text = $'.strip\n if @text =~ /^d(\\d+)/\n # we also have a type of dice to roll\n @sides = $1.to_i\n @text = $'...
[ "0.5310164", "0.5035694", "0.49706697", "0.49480253", "0.49409366", "0.48537937", "0.48124257", "0.47926414", "0.4765588", "0.4725687", "0.47180462", "0.47148", "0.4540199", "0.45348907", "0.4534032", "0.45280042", "0.45264363", "0.45173568", "0.45151708", "0.45035276", "0.45...
0.79493624
0
$ANTLR end dice $ANTLR start cent dice.g:110:1: protected cent : '%' ;
def cent() begin @ruleStack.push('cent') # dice.g:110:7: ( '%' ) # dice.g:110:7: '%' match(11, nil) # FOLLOW_11_in_cent192 @stack.push(100) rescue ANTLR::RecognitionException => e report_error(e) #raise e ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dice()\n\n\n begin\n @ruleStack.push('dice')\n # dice.g:88:7: ( atom ( 'd' ( cent | atom ) )* | ( 'd' ( cent | atom ) )* )\n alt7 = 2\n look_ahead7_0 = input.look_ahead(1).token_type\n if look_ahead7_0 == NUMBER || look_ahead7_0 == 12 \n ...
[ "0.56542945", "0.55500317", "0.51826125", "0.48427925", "0.46390554", "0.45953178", "0.45899183", "0.44714522", "0.44269896", "0.42936882", "0.42698336", "0.42672735", "0.4246408", "0.423574", "0.42208964", "0.4212487", "0.4201917", "0.4171423", "0.4171423", "0.41583133", "0....
0.71770424
0
$ANTLR end cent $ANTLR start atom dice.g:119:1: atom : (n= NUMBER | '(' expr ')' );
def atom() token_n = nil begin @ruleStack.push('atom') # dice.g:119:7: (n= NUMBER | '(' expr ')' ) alt8 = 2 look_ahead8_0 = input.look_ahead(1).token_type if look_ahead8_0 == NUMBER alt8 = 1 elsif look_ahead8_0 ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def atom\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 5 )\n\n\n value = nil\n\n\n a = nil\n e = nil\n\n\n begin\n # at line 24:3: (a= INTEGER |a= DECIMAL | LPARENT e= expression RPARENT )\n alt_5 = 3\n case look_5 = @input.pee...
[ "0.6670258", "0.6479729", "0.6265896", "0.6208113", "0.5823564", "0.56305325", "0.55649924", "0.5487264", "0.5469332", "0.53017694", "0.51485455", "0.51466274", "0.5123281", "0.5122652", "0.5074886", "0.5017342", "0.49999088", "0.4995218", "0.49938262", "0.49444333", "0.49349...
0.79858834
0
GET /structure_drawings GET /structure_drawings.json
def index if params[:group_type].present? structures = @sub_project.structure_drawings.where(:group_type => params[:group_type]) else structures = @sub_project.structure_drawings end if params[:structure_type].present? && params[:structure_type] == "Photos" @structure_drawings = s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_structure_drawing\n @structure_drawing = @sub_project.structure_drawings.find(params[:id])\n end", "def create\n @structure_drawing = @sub_project.structure_drawings.build(structure_drawing_params)\n\n respond_to do |format|\n if @structure_drawing.save\n format.html { redirect_...
[ "0.67598397", "0.6520328", "0.63992935", "0.6393113", "0.62682897", "0.6142452", "0.5960943", "0.58107316", "0.5713205", "0.5698926", "0.56949514", "0.5541865", "0.55132616", "0.5449143", "0.53882194", "0.5362791", "0.5360303", "0.5355815", "0.5346409", "0.5332212", "0.527403...
0.63949263
3
GET /structure_drawings/1 GET /structure_drawings/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_structure_drawing\n @structure_drawing = @sub_project.structure_drawings.find(params[:id])\n end", "def show\n @drawing = Drawing.find(params[:id])\n\n render json: @drawing\n end", "def create\n @structure_drawing = @sub_project.structure_drawings.build(structure_drawing_params)\n\n ...
[ "0.69846183", "0.6694759", "0.6626258", "0.65000737", "0.63077116", "0.6199984", "0.6199104", "0.61259437", "0.60417473", "0.58259636", "0.575467", "0.5739104", "0.56629497", "0.55632764", "0.5563036", "0.55174917", "0.55042815", "0.5471741", "0.54583085", "0.54497427", "0.54...
0.0
-1
POST /structure_drawings POST /structure_drawings.json
def create @structure_drawing = @sub_project.structure_drawings.build(structure_drawing_params) respond_to do |format| if @structure_drawing.save format.html { redirect_to project_sub_project_structure_drawings_path(@project, @sub_project), notice: 'Structure drawing was successfully created.' } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @structure_drawing.update(structure_drawing_params)\n format.html { redirect_to project_sub_project_structure_drawings_path(@project, @sub_project), notice: 'Structure drawing was successfully updated.' }\n format.json { render :show, status: :ok, loca...
[ "0.66776365", "0.66677886", "0.66650903", "0.6573904", "0.6324716", "0.614717", "0.60205996", "0.5997886", "0.59317917", "0.58495814", "0.5504267", "0.5488534", "0.5362245", "0.5302267", "0.5286745", "0.5281696", "0.5267002", "0.5249035", "0.5230916", "0.5212372", "0.5211682"...
0.75717354
0
PATCH/PUT /structure_drawings/1 PATCH/PUT /structure_drawings/1.json
def update respond_to do |format| if @structure_drawing.update(structure_drawing_params) format.html { redirect_to project_sub_project_structure_drawings_path(@project, @sub_project), notice: 'Structure drawing was successfully updated.' } format.json { render :show, status: :ok, location: @st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @drawing = Drawing.find(params[:id])\n\n if @drawing.update_attributes(params[:drawing])\n head :no_content\n else\n render json: @drawing.errors, status: :unprocessable_entity\n end\n end", "def set_structure_drawing\n @structure_drawing = @sub_project.structure_drawings...
[ "0.6959759", "0.6759387", "0.6619122", "0.65463936", "0.6433013", "0.6291946", "0.6165376", "0.60206354", "0.5957917", "0.5913645", "0.5891081", "0.5883582", "0.58828884", "0.5846206", "0.58404744", "0.5808737", "0.57797974", "0.57321894", "0.5730022", "0.56889564", "0.567801...
0.7610802
0
DELETE /structure_drawings/1 DELETE /structure_drawings/1.json
def destroy @structure_drawing.destroy respond_to do |format| format.html { redirect_to project_sub_project_structure_drawings_path(@project, @sub_project), notice: 'Structure drawing was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @draw = Draw.find(params[:id])\n @draw.destroy\n\n respond_to do |format|\n format.html { redirect_to draws_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @drawing = Drawing.find(params[:id])\n @drawing.destroy\n\n head :no_content\n end", "...
[ "0.71645004", "0.7156162", "0.70195645", "0.6809302", "0.66571206", "0.65788907", "0.64547765", "0.64547765", "0.6453264", "0.6449431", "0.64363116", "0.64094895", "0.64064187", "0.6343764", "0.63083947", "0.6306671", "0.6271388", "0.62546444", "0.6227058", "0.62235636", "0.6...
0.7584273
0
Use callbacks to share common setup or constraints between actions.
def set_structure_drawing @structure_drawing = @sub_project.structure_drawings.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 structure_drawing_params params.require(:structure_drawing).permit(:title, :description, :structure_type, attachments_attributes: [:attach_type, :attachment, :id, :_destroy]) 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
A link helper to create a 'default' Quill text edit
def quill_editor(name=nil, options={}) mod_options = { name: 'quill-value', id: 'quill-value', toolbar: [ ['bold', 'italic', 'underline', 'link'], [{ 'list': 'ordered'}, { 'list': 'bullet' }], ['clean'] ], placeholder: '' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def link_to_faq(text, options={})\n html = \"<a\"\n html += \" class=\\\"#{options[:class]}\\\"\" if options[:class]\n html += \" href=\\\"/faq\\\"\"\n html += \">\" \n html += text\n html += \"</a>\"\n html\n end", "def help_link(wiki_entry_name=nil)\n wiki_url = \"https...
[ "0.5854612", "0.58123946", "0.5776367", "0.5760104", "0.5731775", "0.57088816", "0.5703252", "0.56986207", "0.5680681", "0.5608237", "0.5589311", "0.55796504", "0.55776775", "0.5540712", "0.5532579", "0.552212", "0.55218536", "0.5509913", "0.54325885", "0.54257166", "0.542388...
0.5314137
35
Setup all fixtures in test/fixtures/.yml for all tests in alphabetical order. Note: You'll currently still have to declare fixtures explicitly in integration tests they do not yet inherit this setting fixtures :all Add more helper methods to be used by all tests here...
def assert_attribute_is_validated(model, attribute, value, flag) model.assign_attributes(attribute => value) if flag == 1 assert_not model.valid? else assert model.valid? end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_default_fixtures(files = ['sample_actors' , 'users', 'wiki_entries'])\n Fixtures.reset_cache\n files.each do |f|\n Fixtures.create_fixtures( File.dirname(__FILE__) + '/../fixtures' , File.basename( f , '.*'))\n end\nend", "def load_all_fixtures\n \n end", "def load_fixtures\n # f...
[ "0.77609247", "0.7656494", "0.7538532", "0.7126103", "0.7044488", "0.6966213", "0.69298637", "0.6864607", "0.68423563", "0.68381697", "0.6802254", "0.6685895", "0.6626513", "0.65285975", "0.651842", "0.6497795", "0.6439143", "0.63435024", "0.63287276", "0.63111407", "0.631114...
0.0
-1
Builds core opal runtime + core libs, and returns as a string. This can then just be used directly by any compiled code. The core lib is then auto loaded so it is ready for running.
def build_core code = '' code += File.read(RUNTIME_PATH) code += build_stdlib('core.rb', 'core/*.rb') code += "opal.require('core');" code end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def common_build\n puts \"common_build dir=#{pwd} #{SHOES_TGT_ARCH}\"\n #mkdir_p \"#{TGT_DIR}/ruby\"\n #cp_r \"#{EXT_RUBY}/lib/ruby/#{RUBY_V}\", \"#{TGT_DIR}/ruby/lib\"\n %w[req/ftsearch/lib/* req/rake/lib/*].each do |rdir|\n FileList[rdir].each { |rlib| cp_r rlib, \"#{TGT_DIR}/lib/ruby/#{TGT_RUB...
[ "0.57759714", "0.56869906", "0.54696596", "0.5456468", "0.54257846", "0.5351883", "0.53246325", "0.52442867", "0.51909447", "0.51367897", "0.51317644", "0.5094026", "0.50877327", "0.5082577", "0.50670457", "0.50590825", "0.50321734", "0.5019413", "0.49943116", "0.49817783", "...
0.8871263
0
Builds the opal parser and dev.rb file, and returns as a string.
def build_parser code = '' %w[opal/ruby/nodes opal/ruby/parser opal/ruby/ruby_parser].each do |src| full = File.join OPAL_PATH, 'opal_lib', src + '.rb' compiled = compile_source full code += "opal.register('#{src}.rb', #{compiled});" end code += build_stdlib 'racc/parse...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build\n puts \"---> erase_old_files\" if verbose\n erase_old_files\n puts \"---> load_source\" if verbose\n load_source\n puts \"---> compose\" if verbose\n compose\n puts \"---> save_lilypond_file\" if verbose\n save_lilypond_file\n\n # Production du PDF ou du PNG\n res = case ou...
[ "0.6044809", "0.5956772", "0.58305496", "0.57379687", "0.56658065", "0.56464595", "0.55553925", "0.54854274", "0.5471344", "0.5451604", "0.5442242", "0.54096085", "0.5404168", "0.5390017", "0.53337777", "0.5327102", "0.53026867", "0.5252323", "0.52381635", "0.5221121", "0.517...
0.7987602
0
Build the given sources from the standard library. These can be globs. Returns a string of all content.
def build_stdlib(*files) code = [] Dir.chdir(STDLIB_PATH) do Dir.[](*files).each do |lib| full_path = File.join STDLIB_PATH, lib code << wrap_source(full_path, lib) end end code.join '' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_sources\n sources = [File.join(source_dir, 'jasmine-webos-core.js'),\n File.join(source_dir, 'proxy-app-assistant.js')]\n\n sources += Dir.glob(\"#{source_dir}/**/*.js\").reject { |f| sources.include?(f) }.sort\n sources += Dir.glob(\"#{plugin_dir}/spec/helpers/*.js\")\n sources\nend", ...
[ "0.69330186", "0.6379206", "0.6345242", "0.63373536", "0.6320644", "0.63101524", "0.61326545", "0.6116032", "0.6053967", "0.6036549", "0.60130614", "0.5979695", "0.5964747", "0.5924883", "0.58887523", "0.5823987", "0.5771131", "0.57470685", "0.57288986", "0.57146513", "0.5714...
0.6746977
1
Does the actual rebuild of a project
def rebuild(options) puts "rebuilding to #{options[:out]}" puts options[:files].inspect File.open(options[:out], 'w') do |out| # out.write @pre if @pre options[:files].each do |file| out.write wrap_source file end if options[:main] main = options[:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rebuild_files\n @project.rebuild_files()\n end", "def rebuild\n build addl_cmake_bld_args: '--clean-first'\n end", "def rebuild\n announcing 'Rebuilding' do\n chroot 'rebuild'\n end\n send_to_state('build', 'rebuild')\n end", "def rebuild\n success = Utils.call_e...
[ "0.73709184", "0.7005881", "0.6863437", "0.6780687", "0.6452377", "0.6429082", "0.642813", "0.6347612", "0.6199824", "0.6199824", "0.61304015", "0.6060395", "0.6053975", "0.6040717", "0.59550685", "0.590677", "0.58266175", "0.58136505", "0.5796157", "0.5689028", "0.5689028", ...
0.0
-1
Time Complexity: ? Space Complexity: ?
def balanced(string) strStack = Stack.new opens_and_closes = { "}" => "{", ")" => "(", "]" => "[" } string.each_char do |char| if ['(', '[', '{'].include?(char) strStack.push(char) else element = strStack.pop if opens_and_closes[char] != element return false ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_dublicate(array)\n sum = 1000000*(1000000+1)/2 # (n*(n+1))/2\n array.each do |el| \n sum -= el\n end\n return sum\nend", "def largest_subsum(list)\n max = list[0] # O(1)\n current_sum = list[0] # O(1)\n\n (1...list.length).each do |i| # O(n)\n # debugger\n if current_sum < ...
[ "0.62574106", "0.6005434", "0.5977816", "0.5976574", "0.5916582", "0.59069425", "0.5885494", "0.5884955", "0.5868798", "0.58640856", "0.58033556", "0.5767254", "0.57608736", "0.5750557", "0.5727338", "0.57079476", "0.56690526", "0.56547195", "0.56431", "0.56296796", "0.561061...
0.0
-1
Time Complexity: ? Space Complexity: ?
def evaluate_postfix(postfix_expression) raise NotImplementedError, "Not implemented yet" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_dublicate(array)\n sum = 1000000*(1000000+1)/2 # (n*(n+1))/2\n array.each do |el| \n sum -= el\n end\n return sum\nend", "def largest_subsum(list)\n max = list[0] # O(1)\n current_sum = list[0] # O(1)\n\n (1...list.length).each do |i| # O(n)\n # debugger\n if current_sum < ...
[ "0.62574106", "0.6005434", "0.5977816", "0.5976574", "0.5916582", "0.59069425", "0.5885494", "0.5884955", "0.5868798", "0.58640856", "0.58033556", "0.5767254", "0.57608736", "0.5750557", "0.5727338", "0.57079476", "0.56690526", "0.56547195", "0.56431", "0.56296796", "0.561061...
0.0
-1
GET /restaurants/1 GET /restaurants/1.json
def show @restaurant = Restaurant.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @restaurant } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @restaurants = Restaurant.all\n # render json: @restaurants\n end", "def listRestaurants\n _restaurants = Restaurant.all\n render json: _restaurants\n end", "def index\n json_response(Restaurant.all)\n end", "def index \n restaurant = Restaurant.all\n rend...
[ "0.76428044", "0.76170033", "0.74424565", "0.74388343", "0.7430328", "0.7365656", "0.7240364", "0.7104386", "0.7100202", "0.7009134", "0.6966368", "0.69241005", "0.6914525", "0.68920505", "0.68920505", "0.68920505", "0.6850629", "0.6850514", "0.6819365", "0.6814623", "0.68146...
0.7469194
4
GET /restaurants/new GET /restaurants/new.json
def new @restaurant = Restaurant.new respond_to do |format| format.html # new.html.erb format.json { render json: @restaurant } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\r\n @restaurant = Restaurant.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @restaurant }\r\n end\r\n end", "def new\n \t@restaurant = Restaurant.new\n\n \trespond_to do |format|\n format.html # new.html.erb\n format.json {...
[ "0.7824766", "0.76456857", "0.73905593", "0.72719264", "0.72491527", "0.718493", "0.718493", "0.718493", "0.718493", "0.718493", "0.718493", "0.71834356", "0.71470314", "0.7097366", "0.70964795", "0.7064354", "0.7064354", "0.7064354", "0.70408577", "0.7038255", "0.70099425", ...
0.7893294
4
POST /restaurants POST /restaurants.json
def create @restaurant = Restaurant.new(params[:restaurant]) notice = 'Restaurant was successfully created.' if (@restaurant.linkedRestaurator != '') @restaurant.restaurator_id = @restaurant.linkedRestaurator else notice = 'Vous avez ajoute un restaurant sans lui assigner un restaurateur.' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n json_response(Restaurant.create!(restaurant_params), :created)\n end", "def create\n @restaurant = Restaurant.new(restaurant_params)\n if @restaurant.save\n render json: {success: true, restaurant: @restaurant} \n else\n render json: {success: false, errors: @restauran...
[ "0.7553225", "0.7397055", "0.7266951", "0.7172426", "0.71451044", "0.7098898", "0.7098898", "0.7098898", "0.7058568", "0.7058568", "0.7058568", "0.6995636", "0.698664", "0.6964008", "0.69118476", "0.6900323", "0.6880705", "0.6873217", "0.68118536", "0.6810355", "0.6808565", ...
0.6402294
40
PUT /restaurants/1 PUT /restaurants/1.json
def update @restaurant = Restaurant.find(params[:id]) temp_restaurant = Restaurant.new(params[:restaurant]) notice = 'Restaurant was successfully updated.' if (temp_restaurant.linkedRestaurator != '') @restaurant.restaurator_id = temp_restaurant.linkedRestaurator else notice = 'Vous ave...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n json_response(@restaurant.update!(restaurant_params))\n end", "def update\n update_restaurant\n end", "def update\n if @restaurant.update(restaurant_params)\n render json: {success: true, restaurant: @restaurant} \n else\n render json: {success: false, errors: @rest...
[ "0.75259", "0.7013629", "0.6843627", "0.6610468", "0.6610468", "0.6610468", "0.6610468", "0.6576204", "0.65444547", "0.6535978", "0.65320945", "0.652328", "0.6459057", "0.64206225", "0.6417137", "0.6417137", "0.6417137", "0.6398985", "0.63684773", "0.63684773", "0.63538617", ...
0.6036387
65
DELETE /restaurants/1 DELETE /restaurants/1.json
def destroy @restaurant = Restaurant.find(params[:id]) @restaurant.destroy respond_to do |format| format.html { redirect_to restaurants_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @restaurant.destroy\n render json: {success: true}\n end", "def destroy\r\n @restaurant = Restaurant.find(params[:id])\r\n @restaurant.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to restaurants_url }\r\n format.json { head :no_content }\r\n end\r\n...
[ "0.7482664", "0.74340403", "0.74022", "0.74022", "0.74022", "0.7302487", "0.7254974", "0.7199624", "0.7158352", "0.7158352", "0.7155533", "0.7146797", "0.7146797", "0.7146797", "0.7146797", "0.7118331", "0.70847684", "0.70801747", "0.70475596", "0.7034764", "0.7022267", "0....
0.7505612
6
end for loops, not shared but here by analogy
def loop_sequence_urn_id Instance.first.prefix + Instance.sep + selp_prefix + Instance.sep + id.to_s.rjust(Instance.just, '0') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generateLoop2\n for i in 1...10 do #do optional\n puts i\n end\n end", "def determine_pair(main_code)\n #double for loop?\n test_code = main_code.clone\n\n for i in (0..99) do\n\n test_code[1] = i\n\n for i in (0..99) do\n test_code[2] = i\n computed = test_code.clone...
[ "0.5793566", "0.5729891", "0.5692252", "0.5692252", "0.5692252", "0.5692252", "0.5692252", "0.5692252", "0.56682265", "0.5663763", "0.5658185", "0.5547864", "0.55414724", "0.553", "0.553", "0.553", "0.553", "0.553", "0.553", "0.553", "0.553", "0.553", "0.553", "0.553", ...
0.0
-1
for IfThenElses, not shared but here by analogy
def then_sequence_urn_id Instance.first.prefix + Instance.sep + seth_prefix + Instance.sep + id.to_s.rjust(Instance.just, '0') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conditionally(*) end", "def conditionally(*) end", "def process_if exp\n exp = exp.dup\n condition = exp[1] = process exp.condition\n\n if true? condition\n exp[2] = process exp.then_clause if exp.then_clause\n exp[3] = nil\n elsif false? condition\n exp[2] = nil\n exp[3] = ...
[ "0.6715173", "0.6715173", "0.6562178", "0.6537596", "0.6411782", "0.6335294", "0.61715627", "0.60296834", "0.60055083", "0.59678894", "0.5946078", "0.5946078", "0.5946078", "0.59221935", "0.5916294", "0.59023", "0.59023", "0.5893692", "0.5870783", "0.5837661", "0.58318955", ...
0.0
-1
for instances, not shared but here by analogy
def category_scheme_urn_id Instance.first.prefix + Instance.sep + category_scheme_prefix + Instance.sep + scheme_id.to_s.rjust(Instance.just, '0') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def instance; end", "def instance; end", "def instance; end", "def instances; end", "def instances; end", "def private; end", "def instance_cache; end", "def instance_variables() end", "def active_instances; end", "def instance=(instance); end", "def same; end", "def list_of_instances\n ...
[ "0.68614584", "0.68614584", "0.68614584", "0.6831182", "0.6831182", "0.6651728", "0.645031", "0.63469", "0.63031", "0.6290686", "0.62792236", "0.61417496", "0.6067518", "0.59882426", "0.5954526", "0.5916954", "0.59052885", "0.59052885", "0.5895716", "0.58878064", "0.58633065"...
0.0
-1
representing the base of a pyramid. The function should return a 2D array representing a complete pyramid with the given base. To construct a level of the pyramid, we take the sum of adjacent elements of the level below. For example, the base [1, 4, 6] gives us the following pyramid 15 5 10 1 4 6
def pyramid_sum(base) new_arr = [base] i = 0 while new_arr.length < base.length new_arr.unshift(add_arrays(new_arr[i])) end return new_arr end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pyramid_sum(base)\n levels = [base]\n (base.length-1).times do ||\n tmp_arr = []\n (0..levels[0].length-2).each do |i|\n tmp_arr << levels[0][i] + levels[0][i+1]\n end\n levels.unshift(tmp_arr)\n end\n return levels\n end", "def pyramid_sum(base)\r\n thisBase = base\r...
[ "0.85138446", "0.829402", "0.8145667", "0.80746627", "0.8063882", "0.8053611", "0.8049441", "0.7910506", "0.78587824", "0.7856966", "0.7850533", "0.7785696", "0.7587297", "0.7562244", "0.74749464", "0.6943334", "0.65114737", "0.64686835", "0.6345471", "0.6227191", "0.6154744"...
0.7999785
7
GET /restaurants GET /restaurants.json
def index if !params[:cuisine] query = params[:search][:term].split(",") result = Restaurant.get_results_from_google_places(query, current_user) @restaurants = result else query = params[:cuisine] result = Restaurant.get_results_from_google_places(query, current_user, true) @...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def listRestaurants\n _restaurants = Restaurant.all\n render json: _restaurants\n end", "def index\n @restaurants = Restaurant.all\n # render json: @restaurants\n end", "def index\n json_response(Restaurant.all)\n end", "def index \n restaurant = Restaurant.all\n rend...
[ "0.81240284", "0.793202", "0.7784178", "0.76538736", "0.7602805", "0.7457101", "0.74286824", "0.7388505", "0.72810537", "0.72810537", "0.72810537", "0.72033757", "0.71918005", "0.7118298", "0.70634925", "0.69991785", "0.69862187", "0.6964812", "0.6964812", "0.6964812", "0.696...
0.0
-1
GET /restaurants/1 GET /restaurants/1.json
def show if params[:yelp_rating] && params[:google_rating] && params[:foursquare_rating] @ratings = {:yelp_rating => params[:yelp_rating], :foursquare_rating => params[:foursquare_rating], :google_rating => params[:google_rating], :weighted_rating => params[:weighted_rating]} end @social = {:yelp_id =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @restaurants = Restaurant.all\n # render json: @restaurants\n end", "def listRestaurants\n _restaurants = Restaurant.all\n render json: _restaurants\n end", "def show\n @restaurant = Restaurant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n ...
[ "0.76432896", "0.76176935", "0.7469569", "0.7469569", "0.7469569", "0.744326", "0.74385506", "0.7431174", "0.73655623", "0.72411054", "0.7105461", "0.7101599", "0.70095706", "0.6966909", "0.69250673", "0.6915002", "0.6893555", "0.6893555", "0.6893555", "0.6852325", "0.6851735...
0.0
-1
POST /restaurants POST /restaurants.json
def create @restaurant = Restaurant.new(restaurant_params) respond_to do |format| if @restaurant.save format.html { redirect_to @restaurant, notice: 'Restaurant was successfully created.' } format.json { render action: 'show', status: :created, location: @restaurant } else f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n json_response(Restaurant.create!(restaurant_params), :created)\n end", "def create\n @restaurant = Restaurant.new(restaurant_params)\n if @restaurant.save\n render json: {success: true, restaurant: @restaurant} \n else\n render json: {success: false, errors: @restauran...
[ "0.7553225", "0.7397055", "0.7266951", "0.7172426", "0.71451044", "0.7098898", "0.7098898", "0.7098898", "0.7058568", "0.7058568", "0.7058568", "0.698664", "0.6964008", "0.69118476", "0.6900323", "0.6880705", "0.6873217", "0.68118536", "0.6810355", "0.6808565", "0.6762182", ...
0.6995636
11
PATCH/PUT /restaurants/1 PATCH/PUT /restaurants/1.json
def update respond_to do |format| if @restaurant.update(restaurant_params) format.html { redirect_to @restaurant, notice: 'Restaurant was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @resta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n json_response(@restaurant.update!(restaurant_params))\n end", "def update\n if @restaurant.update(restaurant_params)\n render json: {success: true, restaurant: @restaurant} \n else\n render json: {success: false, errors: @restaurant.errors}, status: :unprocessable_entity\...
[ "0.7477148", "0.6957465", "0.6846762", "0.6846762", "0.6846762", "0.6846762", "0.68326247", "0.6769237", "0.6757842", "0.6701046", "0.66524756", "0.664744", "0.664744", "0.664744", "0.65908915", "0.6584008", "0.6583151", "0.65627086", "0.6526378", "0.6493327", "0.6461868", ...
0.6745448
10
DELETE /restaurants/1 DELETE /restaurants/1.json
def destroy @restaurant.destroy respond_to do |format| format.html { redirect_to restaurants_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @restaurant = Restaurant.find(params[:id])\n @restaurant.destroy\n\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant = Restaurant.find(params[:id])\n @restaurant.destroy\n\n...
[ "0.7505612", "0.7505612", "0.7505612", "0.7505612", "0.7505612", "0.7505612", "0.7505612", "0.7505612", "0.7482664", "0.74340403", "0.7302487", "0.7254974", "0.7199624", "0.7158352", "0.7158352", "0.7155533", "0.7146797", "0.7146797", "0.7146797", "0.7146797", "0.7118331", ...
0.74022
12
Use callbacks to share common setup or constraints between actions.
def set_restaurant @restaurant = Restaurant.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 restaurant_params params.permit(:restaurant, :name, :location, :term) 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
This values the new velocity after the collision m1, v1, c1 : Mass, velocity, and center for this object. m2, v2, c2 : Mass, velocity, and center for the other object. The calculations are taken from the last equation of The velocity and centers must be Vector's.
def new_velocity(m1, m2, v1, v2, c1, c2) f = (2*m2)/(m1+m2) ## Number dv = v1 - v2 ### Vector dc = c1 - c2 ### Vector v_new = v1 - f * (dv.inner_product(dc))/(dc.inner_product(dc)) * dc ### Vector ## If the two objects are already moving away from each, then don't change the velocity. if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collide(other_ball)\n # puts \"COLLISION between #{self} and #{other_ball}\"\n\n # Calculate in a rotated frame of reference where the line between the\n # balls' centers is the x axis.\n # Math lifted from http://hoomanr.com/Demos/Elastic2/\n\n m1 = self.mass\n u1 = self.total_velocity\n ...
[ "0.66420174", "0.61793846", "0.6178024", "0.6103629", "0.6032971", "0.5809018", "0.55546427", "0.55498964", "0.5507063", "0.54956967", "0.54854673", "0.5470605", "0.5453728", "0.542255", "0.5415313", "0.54052657", "0.5388731", "0.53530496", "0.53284025", "0.5317639", "0.53143...
0.7875574
0
Calculate miles per gallon
def mpg(dt, ag) return (dt / ag) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def miles\n self.distance * KM_TO_MILE\n end", "def miles\n# 1 meter = 0.000621371 miles\n if self.u == 'meters'\n self.distance * 0.000621371\n elsif self.u == 'miles' # mile in mile\n self.distance\n# 1 kilometer = 0.621371 miles\n elsif self.u == 'kilometers'\n self.distance *...
[ "0.7782979", "0.7159356", "0.6937148", "0.6837495", "0.67023885", "0.6645583", "0.6638475", "0.6620311", "0.6549054", "0.6273448", "0.6273448", "0.6196259", "0.6176593", "0.61613727", "0.61533356", "0.5951086", "0.59464157", "0.58328676", "0.5769637", "0.5734191", "0.56998414...
0.0
-1
looking at db path?
def db_path?( path ) path.split( "|" ).size == 3 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def db_path\n @db\n end", "def ext_db_path; end", "def ext_db_path; end", "def db_file\n self.class.db_root.join(id) if id\n end", "def ext_db_path=(_arg0); end", "def ext_db_path=(_arg0); end", "def find_db\n log_debug\n file_name = 'com.plexapp.plugins.library.db'\n # for dev it ...
[ "0.8144953", "0.75246644", "0.75246644", "0.74261487", "0.72561646", "0.72533983", "0.7237397", "0.7158336", "0.6893732", "0.6878303", "0.6869455", "0.6869455", "0.6814429", "0.6746371", "0.66639936", "0.6613014", "0.6591111", "0.65813136", "0.65569955", "0.6551346", "0.64879...
0.7220276
7
looking at cltn path?
def cltn_path?( path ) path.split( "|" ).size == 4 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cltn_request?( path )\n path.size == 3\n end", "def cspsearchpath\n eval @paths_key\n end", "def pathSourceHyper\n\t\"../../HyperOpen/\"\nend", "def find_default_ca_path; end", "def get_target_path(path_ofs, lnk_file)\n name = []\n lnk_file.sysseek(path_ofs, ::IO::SEEK_SET)\n ...
[ "0.59319156", "0.55100316", "0.5461038", "0.542286", "0.54192656", "0.53386575", "0.53386575", "0.53386575", "0.53324795", "0.52700883", "0.52632123", "0.5259098", "0.52407473", "0.5213845", "0.5162278", "0.5158396", "0.51569396", "0.51569396", "0.5144739", "0.51439303", "0.5...
0.6497035
0
Pop paths 1 level
def back_paths! path_ids = session[:path_ids] new_path_ids = path_ids.split( "|" ) new_path_ids.pop path_names = session[:path_names] new_path_names = path_names.split( "|" ) new_path_names.pop update_paths!( new_path_ids.join( "|" ), new_path_names.join( "|...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unfinish(paths)\n if paths.empty?\n raise Plan::Advice.new('please drill down to a level to unfinish')\n end\n # go to the right depth and unfinish\n item = path_tree.descend(paths)\n item.unfinish!\n save_path_tree\n # print what happened here\n ...
[ "0.7233814", "0.6688107", "0.6523611", "0.6480385", "0.6420089", "0.62534964", "0.6140033", "0.607784", "0.60528165", "0.6013616", "0.5957443", "0.5893762", "0.5891796", "0.5888213", "0.5875722", "0.5841875", "0.5834803", "0.5830033", "0.580527", "0.5788776", "0.57670385", ...
0.59367937
11
compute title from path
def title_for( path_names ) tokens = path_names.split( "|" ) buff = case tokens.size when 2 "zone" when 3 "database" else "collection" end db = tokens.size > 3 ? "<span class=\"ctx\">#{tokens[2]}</span>." : "" "<p class=\"ctx\" s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_title(path)\n filename_from_path(path).split(\".\")[0]\n end", "def title\n if has_local? :title\n locals[:title]\n else\n File.basename(logical_path).titleize\n end\n end", "def title\n #Flip off the part after the last dot, including that dot: find ...
[ "0.7816459", "0.7740889", "0.73287666", "0.7286498", "0.7257626", "0.7237139", "0.72298396", "0.70068216", "0.70047224", "0.69958323", "0.6961981", "0.6936963", "0.69359195", "0.6903645", "0.6868821", "0.6862677", "0.68294525", "0.6828284", "0.67782474", "0.677812", "0.677678...
0.66585225
28
Whether this reservation has started yet?
def has_started? Time.now >= start_time end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_started?\n Date.current >= start_date\n end", "def started?\n !self.started_at.nil?\n end", "def started?\n !@time_started.nil?\n end", "def started?\n start_date.present?\n end", "def started?\n !@start_time.nil?\n end", "def started?\n started_at.present?\n end",...
[ "0.7709264", "0.75575954", "0.7449489", "0.74250925", "0.7423806", "0.74176115", "0.74161625", "0.74106807", "0.74055713", "0.7307265", "0.72706383", "0.7225856", "0.7214144", "0.71977973", "0.71489465", "0.71175283", "0.7110202", "0.7104825", "0.7102481", "0.704436", "0.7041...
0.7583817
1
Whether this reservation has ended yet?
def has_ended? Time.now >= end_time end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ended?\n return(self.ends_at < Time.now)\n end", "def ending?\n active? && !canceled_at.nil?\n end", "def ended?\n end_time < Time.now.utc\n end", "def is_done?\n return self.status == Erp::Reservations::Reservation::STATUS_DONE\n end", "def has_ended?\n Date.current > en...
[ "0.77437025", "0.77409196", "0.7704188", "0.7671375", "0.7465334", "0.73989487", "0.7339638", "0.7314567", "0.7265313", "0.7193107", "0.71764684", "0.7163796", "0.71493906", "0.7103341", "0.70882374", "0.706819", "0.70313746", "0.70193416", "0.69930935", "0.6959474", "0.69579...
0.7452251
5
The list of nodes that are completely free to use
def free_nodes nodes.select(&:is_free?) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unused_nodes\n s = []\n (0..7).each do |i|\n if position[i] && !position[i].used\n s << i\n end\n end\n s\n end", "def nodes\n []\n end", "def nodes\n @nodes = [] if !instance_variable_defined?(:@nodes) or @nodes.nil?\n @nodes\n end", "def nodelist; ...
[ "0.7093885", "0.7022146", "0.6761872", "0.670865", "0.670865", "0.6679719", "0.6654358", "0.6642968", "0.6642968", "0.6610985", "0.6610358", "0.65657645", "0.6516864", "0.649035", "0.6469234", "0.6404094", "0.63378155", "0.63369256", "0.6308968", "0.6301898", "0.6300635", "...
0.87892115
0
Convert object to string
def to_s id end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_s\n object.to_s\n end", "def to_s\n @object.to_s\n end", "def serialize(object)\n object.to_s\n end", "def to_s\n @string || @object.to_s('F')\n end", "def to_s\n @string || @object.to_s('F')\n end", "def to_s_safe(obj)\n if obj.respond_to?(:to_...
[ "0.86652863", "0.8627003", "0.84286654", "0.8230664", "0.8230664", "0.77413636", "0.76580167", "0.76192427", "0.7565023", "0.7565023", "0.7565023", "0.7565023", "0.7565023", "0.7565023", "0.7565023", "0.7565023", "0.7565023", "0.7565023", "0.7565023", "0.7565023", "0.7565023"...
0.0
-1
The comparison operator for sorting values
def <=>(other) to_s <=> other.to_s end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compare(x, y); end", "def <=>(other)\n self.comparison_criteria <=> other.comparison_criteria\n end", "def compare(attr, statable)\r\n a = self.send(attr)\r\n\tb = statable.send(attr)\r\n#\treturn 0 if a.nil? || b.nil?\r\n\t\r\n\torder = StatSummary::STATS[attr][:order]\r\n\tif order == 1\r\n\t retu...
[ "0.68448925", "0.68341535", "0.68100697", "0.67759424", "0.67698383", "0.6708117", "0.6656816", "0.66501224", "0.6640268", "0.66264266", "0.6611789", "0.6611789", "0.6604208", "0.6593306", "0.6593306", "0.6593306", "0.65614855", "0.65461737", "0.65446377", "0.652237", "0.6508...
0.0
-1
Check whether objects are identical to each other
def eql?(other) self.class == other.class && self == other end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def object_equal(obj1, obj2)\n vars1 = obj1.instance_variables\n vars2 = obj2.instance_variables\n return false unless vars1.length == vars2.length\n # if they don't have exactly the same instance_variables names then return false\n return false unless vars1.map(&:to_s).sort.to_s == vars2.map(&:to_s).sort.to_...
[ "0.7192201", "0.7009408", "0.6974962", "0.6902903", "0.6882747", "0.6881419", "0.68759584", "0.68759584", "0.6864566", "0.68439716", "0.67608976", "0.67577326", "0.67577326", "0.674206", "0.6719728", "0.670374", "0.6687354", "0.6684728", "0.66736174", "0.66651946", "0.6664926...
0.0
-1
Generate a hash value for this object
def hash [self.class, to_s].hash end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash\n @hash || @hash = (value.hash * -1)\n end", "def hash\n @hash ||= begin\n result = 17\n result = 31 * result + self.class.hash\n ...
[ "0.779179", "0.779179", "0.779179", "0.779179", "0.779179", "0.779179", "0.779179", "0.7725012", "0.7700632", "0.7700632", "0.7588217", "0.74741197", "0.7443239", "0.74276406", "0.740216", "0.7382884", "0.7369049", "0.7363316", "0.72556597", "0.72437376", "0.7189056", "0.71...
0.0
-1
Is this node free to be used?
def is_free? ppn_used == 0 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def full?\n !free?\n end", "def free?\n blank? && neighbors.all?(&:blank?)\n end", "def free_nodes\n nodes.select(&:is_free?)\n end", "def free?\n \tcost.zero?\n end", "def free?\n cost.zero?\n end", "def free?\n time_now >= end_time\n end", "def free_space_o...
[ "0.7625323", "0.7569569", "0.74504185", "0.74087083", "0.7382067", "0.7284481", "0.7224723", "0.7161868", "0.71150583", "0.69188607", "0.669425", "0.6639086", "0.661649", "0.6590383", "0.65508366", "0.6550539", "0.6527267", "0.6512957", "0.6501722", "0.64608485", "0.645772", ...
0.79485846
0