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 /sections/new GET /sections/new.json
def new @section = Section.new respond_to do |format| format.html # new.html.erb format.json { render json: @section } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @sections = Section.find(:all) # TODO: refactor so I don't have to repeat this all over the place\n @section = Section.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @section }\n end\n end", "def new\n @section = Section.new\n\n ...
[ "0.79719824", "0.7935501", "0.7935501", "0.7289376", "0.7213905", "0.7178259", "0.7141323", "0.71182656", "0.71052045", "0.70701444", "0.7042326", "0.6891428", "0.68402475", "0.6786688", "0.6784632", "0.6784632", "0.6780562", "0.6769147", "0.67535955", "0.6741617", "0.6720035...
0.7856098
3
POST /sections POST /sections.json
def create @section = Section.new(params[:section]) respond_to do |format| if @section.save format.html { redirect_to @section, notice: 'Section was successfully created.' } format.json { render json: @section, status: :created, location: @section } else format.html ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @section = Section.new(section_params)\n if @section.save\n render json: SectionSerializer.new(@section)\n else\n render json: @section.errors, status: :unprocessable_entity\n end\n end", "def create\n @section = Section.new(section_params)\n\n if @section.save\n re...
[ "0.72419673", "0.71176845", "0.69759166", "0.68933696", "0.68642396", "0.6807736", "0.6784175", "0.67841625", "0.67841625", "0.67841625", "0.67841625", "0.67433083", "0.6704145", "0.66558677", "0.66396844", "0.6633165", "0.6616084", "0.66085", "0.65884894", "0.6554451", "0.65...
0.6827682
5
PUT /sections/1 PUT /sections/1.json
def update @section = Section.find(params[:id]) respond_to do |format| if @section.update_attributes(params[:section]) format.html { redirect_to @section, notice: 'Section was successfully updated.' } format.json { head :ok } else format.html { render action: "edit" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @section = Section.find(params[:id])\n\n respond_to do |format|\n if @section.update_attributes(params[:section])\n format.html { redirect_to @section, notice: 'Section was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"...
[ "0.6851484", "0.68453336", "0.68296593", "0.68250585", "0.6751193", "0.6744648", "0.6724289", "0.66593486", "0.662534", "0.6578779", "0.6540702", "0.6540702", "0.6540702", "0.6540702", "0.6540702", "0.6540702", "0.65346265", "0.65325975", "0.6531278", "0.6510368", "0.64629793...
0.68411994
2
DELETE /sections/1 DELETE /sections/1.json
def destroy @section = Section.find(params[:id]) @section.destroy respond_to do |format| format.html { redirect_to :back } format.json { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @section.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @section = Section.find(params[:id])\n @section.destroy\n\n respond_to do |format|\n format.html { redirect_to sections_url }\n format.json { head :no_content ...
[ "0.7680669", "0.75949883", "0.75949883", "0.75782114", "0.75782114", "0.7464437", "0.7425009", "0.7399472", "0.7321908", "0.7321908", "0.7268021", "0.7209629", "0.7209629", "0.7209629", "0.7209629", "0.7209629", "0.7209629", "0.7204781", "0.71828485", "0.7168917", "0.71149045...
0.7286962
10
Method to do a transfer. Returns: true if can do the transfer and false if has a problem.
def transfer return false if @source_account_id == @destination_account_id return false unless @amount > 0 return false unless Account.exists?(@source_account_id) && Account.exists?(@destination_account_id) return false if AccountService.new(@source_account_id).balance < @amount ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transfer_success?(source)\n return source.successful? if source.respond_to?(:successful?)\n source.valid? && source.persisted?\n end", "def is_transfer?\n case params[:is_transfer]\n when '1', 't', 'true', 'on'\n return true\n when '0', 'f', 'false', 'off'\n return false\n else\n...
[ "0.671618", "0.65935457", "0.6528988", "0.64629716", "0.6235912", "0.61890745", "0.6123721", "0.6100465", "0.6087465", "0.60499144", "0.60001165", "0.5988607", "0.59815264", "0.5833177", "0.58057714", "0.5679282", "0.56557834", "0.5640324", "0.5640324", "0.563021", "0.5624584...
0.66731346
1
Config hash api_key server_url
def initialize if File.exists?(ENV['HOME']+'/.sheep_config.yml') sheep_config = YAML.load_file(ENV['HOME']+'/.sheep_config.yml') foo = sheep_config if sheep_config (class << self; self; end).class_eval do foo.each_pair do |key, value| define_method key.to_sym do val...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def host_key; end", "def config(api_id, api_key, options={})\n @api_id = api_id\n @api_key = api_key\n @api_endpoint = URI.parse(options.delete(:url))\n @api_options = options\n end", "def config(api_id, api_key, options={})\n @api_id = api_id\n @api_key ...
[ "0.698367", "0.6980301", "0.6980301", "0.6960067", "0.69450265", "0.69450265", "0.6940677", "0.69037604", "0.6808248", "0.6802027", "0.67840016", "0.67840016", "0.6747362", "0.66361076", "0.6626965", "0.6592995", "0.6527995", "0.6527995", "0.6527995", "0.6527995", "0.65090877...
0.0
-1
Create a new caller location
def create_caller_locations(account_number, caller_location_form) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/caller_locations' # process optional query parameters ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createLocation _args\n \"createLocation _args;\" \n end", "def generate_location\n raise \"Cannot generate default location for #{self.class}, I don't know how\"\n end", "def location=(_arg0); end", "def create_location(address, rent)\n # binding.pry\n Location.new(address, ...
[ "0.70715326", "0.6442979", "0.63492316", "0.63054436", "0.61608994", "0.6063875", "0.60139066", "0.5972102", "0.59518886", "0.58294636", "0.58067095", "0.5804935", "0.5685064", "0.56509984", "0.56509984", "0.56282437", "0.56282437", "0.56282437", "0.56282437", "0.56282437", "...
0.6075392
5
Get a caller location by Id
def get_caller_location_by_id(account_number, caller_location_id) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/caller_locations/{caller_location_id}' # process optional q...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def location(id)\n @client.get(\"/BikePoint/#{id}\")\n end", "def get_location(id)\n response = perform(:get, \"Location/#{id}\", nil, headers)\n raise Common::Exceptions::BackendServiceException, 'LIGHTHOUSE_FACILITIES404' if response[:status] == 404\n\n response.body\n ...
[ "0.6812426", "0.6798127", "0.6635388", "0.64955854", "0.6338979", "0.6246372", "0.6117898", "0.6026075", "0.600963", "0.6004306", "0.5982989", "0.5951239", "0.5930432", "0.5904735", "0.5883278", "0.5869685", "0.5851645", "0.58389384", "0.58357936", "0.5801298", "0.5773212", ...
0.7418466
0
Delete all caller locations
def delete_caller_locations(account_number) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/caller_locations' # process optional query parameters query_builder = APIH...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanup_locations\n Location.all.each do |location|\n location.destroy if has_different_location_uid?(location)\n end\n end", "def destroy_all\n begin\n Location.destroy_all\n Affiliation.destroy_all\n Person.destroy_all\n\n render json: {\n ...
[ "0.7359653", "0.620543", "0.6202474", "0.60987264", "0.60582876", "0.60483843", "0.60483843", "0.60478914", "0.600587", "0.5995339", "0.5994114", "0.5979599", "0.5961475", "0.5961475", "0.59568155", "0.59508514", "0.5947566", "0.59406614", "0.5911356", "0.59073603", "0.589941...
0.6310815
1
Update a caller location
def update_caller_location_by_id(account_number, caller_location_id, caller_location_form) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/caller_locations/{caller_location_id}' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change_curr_location(new_location)\n @curr_location = new_location\n end", "def update!(**args)\n @location = args[:location] if args.key?(:location)\n end", "def update!(**args)\n @location = args[:location] if args.key?(:location)\n end", "def update!(**args)\n ...
[ "0.6929147", "0.6634132", "0.6634132", "0.6634132", "0.6509408", "0.6448848", "0.62829494", "0.62258786", "0.621406", "0.6202743", "0.61710745", "0.6157548", "0.6131514", "0.6129354", "0.6087978", "0.6081428", "0.6080334", "0.60414845", "0.60255736", "0.60222465", "0.5993741"...
0.6218753
8
Delete a caller location by id
def delete_caller_location_by_id(account_number, caller_location_id) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/caller_locations/{caller_location_id}' # process optiona...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @locid = params[:id]\n Location.destroy(@locid)\n end", "def delete(id_to_delete)\n DATABASE.execute(\"DELETE FROM locations WHERE id = '#{id_to_delete}'\")\n end", "def deleteLocation _args\n \"deleteLocation _args;\" \n end", "def delete\n CONNECTION.execute(\"DELETE FRO...
[ "0.76269317", "0.7449719", "0.72346735", "0.700759", "0.69981873", "0.6908398", "0.67772394", "0.6748129", "0.660153", "0.6526832", "0.65134686", "0.6426172", "0.6403813", "0.63921356", "0.63803685", "0.6371195", "0.63678306", "0.63608354", "0.63106227", "0.6304571", "0.63025...
0.77581316
0
Allow clients to get the list of caller locations for the specific account.
def get_caller_locations(account_number, page = 1, limit = 10) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/caller_locations' # process optional query parameters q...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_caller_locations(account_number, caller_location_form)\r\n # the base uri for api requests\r\n query_builder = Configuration.base_uri.dup\r\n\r\n # prepare query string for API call\r\n query_builder << '/accounts/{account_number}/caller_locations'\r\n\r\n # process optional que...
[ "0.6464391", "0.62850446", "0.6259337", "0.6224576", "0.617309", "0.61101973", "0.6068094", "0.60627383", "0.6031786", "0.60197836", "0.5992579", "0.59626156", "0.5960343", "0.5958611", "0.5920939", "0.5892647", "0.5886058", "0.58840674", "0.585983", "0.57943046", "0.57943046...
0.7406475
0
Allow the admin to get the list of all accounts.
def get_accounts(page = 1, limit = 10, filter = nil) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts' # process optional query parameters query_builder = APIHelper.append_url_with_que...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_accounts\n HTTP.headers(:accept => @@accept).basic_auth(:user => ENV[\"API_USERNAME\"], :pass => ENV[\"API_PASSWORD\"])\n .get(\"#{@@base_url}/users/#{self.guid}/accounts\").parse[\"accounts\"]\n end", "def all_accounts\n with_exclusive_scope { self.all }\n end", "def index\n #if adm...
[ "0.7846909", "0.78277314", "0.78131217", "0.777815", "0.7741897", "0.77089113", "0.76184285", "0.7600706", "0.7558218", "0.7558218", "0.7557024", "0.7525279", "0.7496262", "0.7482591", "0.74301934", "0.7417207", "0.7375441", "0.73450124", "0.7318701", "0.73174846", "0.7314452...
0.0
-1
Create a new account.
def create_account(account_form) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts' # validate and preprocess url query_url = APIHelper.clean_url query_builder # prepare header...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(body = {})\n @client.account.create(body)\n end", "def create_account(options)\n form_data = options.merge({ 'action' => 'createaccount' })\n res, dummy = make_api_request(form_data)\n res\n end", "def create_account\n\n end", "def create\n response = UserAccount::Cre...
[ "0.8371108", "0.81679463", "0.80373466", "0.7924758", "0.78475875", "0.7845356", "0.7766071", "0.7729785", "0.7719368", "0.7690479", "0.76555777", "0.7650229", "0.76410425", "0.7635543", "0.76273406", "0.762574", "0.7621533", "0.76152205", "0.7606271", "0.7602326", "0.760134"...
0.0
-1
Allow clients to get a specific account.
def get_account(account_number) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}' # process optional query parameters query_builder = APIHelper.append_url_with_templat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def account\n get('account')\n end", "def get_account(account_id)\n get(\"/account/#{account_id}\")\n end", "def account(params = {})\n make_get_request('/account', params)\n end", "def account; Account.get(self.account_id); end", "def account; Account.get(self.account_id); end", "def...
[ "0.77582973", "0.7698144", "0.76275444", "0.74175805", "0.74175805", "0.74175805", "0.74175805", "0.74175805", "0.74175805", "0.74175805", "0.74175805", "0.74175805", "0.74175805", "0.72583", "0.72583", "0.7140455", "0.709391", "0.70747185", "0.7046236", "0.70307785", "0.6992...
0.648196
61
Update an account by a given account_number
def update_account(account_number, account_form) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}' # process optional query parameters query_builder = APIHelper.append...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(organisation_id, account_number, name, classification, type, tax, currency, options = {})\n body = options.has_key?(:body) ? options[:body] : {}\n body[:organisation_id] = organisation_id\n body[:account_number] = account_number\n body[:name] = name\n body[:classificat...
[ "0.7325152", "0.72175527", "0.7160591", "0.71175385", "0.7016773", "0.7014737", "0.70025426", "0.69859445", "0.69639885", "0.6912855", "0.68683386", "0.6817779", "0.679803", "0.67482", "0.6748041", "0.6733792", "0.6727416", "0.67267483", "0.6714071", "0.66934776", "0.66898626...
0.78692263
0
Deletes all cdrs requests from customer's account.
def delete_cdrs(account_number) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/cdrs' # process optional query parameters query_builder = APIHelper.append_url_with_te...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_requests\n self.requests.each {|request| request.destroy}\n end", "def delete_all(date = Date.today)\n delete(date.strftime(@request_path))\n end", "def remove_customers\n @import.customers.destroy_all\n @import.update(state: :created, started_at: nil, completed_at: nil, invali...
[ "0.67804563", "0.62446076", "0.62214607", "0.6149997", "0.6077202", "0.60351366", "0.5876623", "0.5859137", "0.57294166", "0.56119233", "0.5580546", "0.55753946", "0.5490166", "0.54777294", "0.54559726", "0.5444265", "0.54229355", "0.5422543", "0.5413828", "0.5404027", "0.537...
0.6330397
1
Allow clients to get the list of cdr request for the specific account.
def get_cdrs(account_number, page = 1, limit = 10, filter = nil) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/cdrs' # process optional query parameters query_build...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_list_acc\n JSON.parse(curl_get(\"accounts\").body_str)\n end", "def customer_list\n perform_get_request('/customer/list')\n end", "def list(account_id = nil, params={})\n path = 'comments'\n path = \"accounts/#{account_id}/#{path}\" if account_id.present?\n wrike.exec...
[ "0.64464784", "0.6250205", "0.6241779", "0.62197304", "0.6212534", "0.61898154", "0.6187833", "0.61575955", "0.60929996", "0.6082819", "0.6052483", "0.5964365", "0.595204", "0.5931013", "0.5893056", "0.5886826", "0.5879299", "0.58416855", "0.58343834", "0.5834009", "0.5808027...
0.60827804
10
Creates a cdr request
def create_cdrs(account_number, cdrs_form) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/cdrs' # process optional query parameters query_builder = APIHelper.append_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_request(path)\n Fron::Request.new \"#{@rest_options.url}/#{path}\", 'Content-Type' => 'application/json'\n end", "def create_request(path)\n Fron::Request.new \"#{@rest_options.url}/#{path}\", 'Content-Type' => 'application/json'\n end", "def build_request path, opts = {}\n ...
[ "0.71114886", "0.71114886", "0.6820143", "0.67406225", "0.67172223", "0.6694065", "0.6648034", "0.6630451", "0.6568998", "0.649716", "0.64616066", "0.64464515", "0.6423818", "0.6409986", "0.6359481", "0.63122296", "0.6306909", "0.6299303", "0.62976575", "0.6287404", "0.627834...
0.0
-1
Allow clients to download the cdrs in a file
def get_cdr_by_id(account_number, cdr_id) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/cdrs/{cdr_id}' # process optional query parameters query_builder = APIHelper...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download\n send_file @cfile.path.to_s\n end", "def download_incident_list(file_name)\n raw_file_name = File.expand_path(\"~/Downloads/incidents.csv\")\n if File.exists?(raw_file_name)\n puts \"Deleted old Downloads file #{raw_file_name}\"\n FileUtils.rm(raw_file_name)\n end\n \n pu...
[ "0.6717148", "0.6446675", "0.6265749", "0.6225024", "0.6217949", "0.6158575", "0.6098047", "0.6072326", "0.6067047", "0.6054717", "0.60226566", "0.59798235", "0.5938358", "0.59358567", "0.592049", "0.5910191", "0.5907688", "0.5892015", "0.58741903", "0.58722913", "0.58628595"...
0.0
-1
Deletes a cdr file from customer's account.
def delete_cdr_by_id(account_number, cdr_id) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/cdrs/{cdr_id}' # process optional query parameters query_builder = APIHel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deleteFile(filePath, dryRun)\n #N Without this, the deletion command won't be run at all\n sshAndScp.deleteFile(filePath, dryRun)\n end", "def delete_file(path)\n \n puts \"Sending path via MCollective Files client\"\n @mc.delete(:path => path)\n printrpcstats\n \n end", "...
[ "0.6500105", "0.6437037", "0.6354012", "0.63125604", "0.63125604", "0.62958854", "0.62109596", "0.616036", "0.6125343", "0.61109084", "0.61050487", "0.6073362", "0.6040593", "0.60262024", "0.5994966", "0.59846663", "0.5978658", "0.597133", "0.5951967", "0.595164", "0.59481436...
0.6061286
12
Deletes all phone_number from customer's account. These numbers must be unassigned and returned to Magic stock.
def delete_dids(account_number) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/dids' # process optional query parameters query_builder = APIHelper.append_url_with_te...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_customer_phone(customer_id, phone_id)\n delete(\"customers/#{customer_id}/phones/#{phone_id}\")\n end", "def phone_number\n value = Faker::PhoneNumber.phone_number\n remove_extension(value)\n end", "def phone_number\n value = Faker::PhoneNumber.phone_number\n remove_extens...
[ "0.7321627", "0.65466547", "0.65466547", "0.64785516", "0.6421673", "0.63690525", "0.6320066", "0.61665833", "0.61397904", "0.61150205", "0.61150205", "0.60771304", "0.6050767", "0.6000205", "0.5963887", "0.595264", "0.59307986", "0.5913623", "0.5896412", "0.58839625", "0.587...
0.0
-1
Deletes a phone_number from customer's account. This number must be unassigned and returned to Magic stock.
def delete_telephone_number(account_number, telephone_number) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/dids/{telephone_number}' # process optional query parameters ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_customer_phone(customer_id, phone_id)\n delete(\"customers/#{customer_id}/phones/#{phone_id}\")\n end", "def phone_number\n value = Faker::PhoneNumber.phone_number\n remove_extension(value)\n end", "def phone_number\n value = Faker::PhoneNumber.phone_number\n remove_extens...
[ "0.8024573", "0.72299016", "0.72299016", "0.70714444", "0.7027344", "0.68887824", "0.6704314", "0.66157824", "0.65793836", "0.65548325", "0.6537307", "0.64977294", "0.64865375", "0.6477541", "0.64678365", "0.63842654", "0.6340755", "0.63340616", "0.63340616", "0.6227188", "0....
0.71828645
3
Allow clients to get the a specific phone number.
def get_telephone_number(account_number, telephone_number) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/dids/{telephone_number}' # process optional query parameters ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get\n PhoneNumber.get self\n end", "def phone_number\n\t\t\trecipient.phone_number\n\t\tend", "def phone\n @json['user']['content']['phonenumber'] || ''\n end", "def phone_number\n get_attribute(Yoti::Attribute::PHONE_NUMBER)\n end", "def phone_number; end", "def phone...
[ "0.7274739", "0.7193024", "0.71083635", "0.7091826", "0.7087575", "0.7087575", "0.7063711", "0.70155066", "0.7006868", "0.6927122", "0.68556577", "0.6827858", "0.67935586", "0.6793251", "0.67207664", "0.6674318", "0.66742444", "0.66555065", "0.6648086", "0.66377944", "0.66377...
0.6412671
44
Allow client to perform operations on a specific did
def update_telephone_number(account_number, telephone_number, telephone_number_form) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/dids/{telephone_number}' # process optio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perform_action(data); end", "def performed_by(params = {})\n #TODO\n end", "def performed?; end", "def performed?; end", "def read(id)\n # do not respond with anything\n end", "def deleted(item)\n end", "def method_missing(method_id, *arguments, &block)\n if %i[get post pu...
[ "0.5681259", "0.55464846", "0.5234814", "0.5234814", "0.52080107", "0.5102206", "0.50726515", "0.50538415", "0.50538415", "0.50402427", "0.50246125", "0.5002323", "0.4983171", "0.49427408", "0.49301705", "0.4928182", "0.4922493", "0.4917435", "0.4913291", "0.49108464", "0.491...
0.0
-1
Allow clients to get the list of numbers for the specific account
def get_dids(account_number, page = 1, limit = 10, filter = nil) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/dids' # process optional query parameters query_build...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_account_telephone_numbers limit: nil, page: nil, pattern: nil\r\n # the base uri for api requests\r\n query_builder = Configuration.BASE_URI.dup\r\n\r\n # prepare query string for API call\r\n query_builder << \"/tns/\"\r\n\r\n # process optional query parameters\r\n query_bu...
[ "0.68850005", "0.6652624", "0.6543105", "0.6426073", "0.6381734", "0.63613164", "0.62858766", "0.62578875", "0.6237613", "0.6161144", "0.6144403", "0.6075538", "0.6071874", "0.6059819", "0.60476375", "0.60476375", "0.5996408", "0.5988085", "0.59653133", "0.5959924", "0.594548...
0.5857325
30
Deletes all trunks from customer's account. Numbers on that trunk must be unassigned and returned to Magic stock
def delete_trunks(account_number) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/trunks' # process optional query parameters query_builder = APIHelper.append_url_wit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_customers\n @import.customers.destroy_all\n @import.update(state: :created, started_at: nil, completed_at: nil, invalid_customers: 0)\n redirect_to root_path\n end", "def delete_temp_bills\n for temp_bill in self.temp_bills do\n self.temp_bills.delete(temp_bill)\n temp_bill.dest...
[ "0.6296934", "0.601119", "0.5915008", "0.57537854", "0.5750575", "0.5681099", "0.5647228", "0.56471556", "0.5509492", "0.55040336", "0.54950166", "0.54813224", "0.5475598", "0.54684854", "0.5385696", "0.5383412", "0.53792435", "0.5376081", "0.5341847", "0.53410256", "0.533517...
0.63237983
0
Allow clients to get the list of trunks for the specific account
def get_trunks(account_number, page = 1, limit = 10, filter = nil) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/trunks' # process optional query parameters query_b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_trunk_by_id(account_number, trunk_id)\r\n # the base uri for api requests\r\n query_builder = Configuration.base_uri.dup\r\n\r\n # prepare query string for API call\r\n query_builder << '/accounts/{account_number}/trunks/{trunk_id}'\r\n\r\n # process optional query parameters\r\n ...
[ "0.66050214", "0.63767874", "0.62050337", "0.61836606", "0.611151", "0.60567254", "0.5894747", "0.5830812", "0.582849", "0.5813316", "0.5734538", "0.5731651", "0.5698766", "0.5695157", "0.56918055", "0.5667475", "0.56308293", "0.5591718", "0.5585911", "0.55490535", "0.5538759...
0.6841914
0
Deletes a trunk from customer's account. Numbers on that trunk must be unassigned and returned to Magic stock.
def delete_trunk_by_id(account_number, trunk_id) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/trunks/{trunk_id}' # process optional query parameters query_builder ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_trunks(account_number)\r\n # the base uri for api requests\r\n query_builder = Configuration.base_uri.dup\r\n\r\n # prepare query string for API call\r\n query_builder << '/accounts/{account_number}/trunks'\r\n\r\n # process optional query parameters\r\n query_builder = API...
[ "0.6164212", "0.58277375", "0.557329", "0.5539942", "0.5496329", "0.5476334", "0.54715246", "0.54639745", "0.5432449", "0.5420471", "0.5386155", "0.53746104", "0.53704405", "0.53323305", "0.5327773", "0.5325125", "0.5323488", "0.5295705", "0.528668", "0.5268167", "0.5266204",...
0.6896116
0
Allow clients to get the a specific trunk
def get_trunk_by_id(account_number, trunk_id) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/trunks/{trunk_id}' # process optional query parameters query_builder = A...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_trunk_unit\n @trunk_unit = TrunkUnit.find(params[:id])\n end", "def get_instance(payload)\n TrunkInstance.new(@version, payload)\n end", "def index\n @trunk_units = TrunkUnit.all\n end", "def trunk() @trunk ||= simple? ? s : left ...
[ "0.628188", "0.58584243", "0.5818555", "0.5816197", "0.5732654", "0.5712801", "0.56438404", "0.5623798", "0.56193644", "0.5491291", "0.5461759", "0.5278976", "0.5255572", "0.52172357", "0.52107936", "0.5209804", "0.51966584", "0.51781267", "0.511535", "0.5078047", "0.5067439"...
0.7151958
0
Delete all carts from an account
def delete_carts(account_number) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/carts' # process optional query parameters query_builder = APIHelper.append_url_with_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_carts\n current_user.carts.each_with_index do |cart, i|\n cart.delete if i != current_user.carts.length - 1\n end\n end", "def clear_cart\n items=CartItem.where(:cart_id=>self.id)\n items.each do |item|\n item.destroy\n end\n end", "def delete_cart(id)\n db = databas...
[ "0.76563185", "0.7376912", "0.69338393", "0.68201584", "0.67153466", "0.6693128", "0.6633457", "0.660925", "0.6589645", "0.65695006", "0.652633", "0.65047973", "0.6504613", "0.6481876", "0.6451622", "0.64093095", "0.6385232", "0.63675773", "0.6366765", "0.6309582", "0.6293496...
0.68801486
3
Allow clients to get the list of carts.
def get_carts(account_number, page = 1, limit = 10, filter = nil, sort = nil) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/carts' # process optional query parameters ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all\n @carts = Cart.get_all_of_carts(@user, params[:page])\n if @carts.present?\n @carts\n else\n @object = 'Cart'\n render \"api/v1/errors/404\", status: 401\n end\n end", "def index\n @cart_items = CartItem.all\n end", "def index\n @cart_items = CartItem.all\n end", ...
[ "0.7613774", "0.72064817", "0.72064817", "0.72064817", "0.72064817", "0.72064817", "0.7173069", "0.7169149", "0.7169149", "0.7169149", "0.7169149", "0.71659565", "0.71540725", "0.7150736", "0.7117103", "0.7086235", "0.69774276", "0.694384", "0.6934443", "0.6920388", "0.689888...
0.0
-1
Allow clients to get a specific cart.
def get_cart(account_number, cart_id) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/carts/{cart_id}' # process optional query parameters query_builder = APIHelper.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_the_cart\n @cart_items = Nacho.find(cart)\n end", "def cart\n Product.find(session[:user_cart])\n end", "def find_cart\n\t @cart = Cart.find(params[:id])\n\tend", "def show\n @cart = Cart.find(params[:id])\n end", "def cart\n current_cart\n end", "def get_cart\n if session[:c...
[ "0.738116", "0.73062617", "0.71753716", "0.7098824", "0.709338", "0.70853955", "0.70589304", "0.6983644", "0.6970458", "0.6946321", "0.6941005", "0.69388056", "0.6908647", "0.6905084", "0.6866294", "0.68641037", "0.683674", "0.68365717", "0.68269944", "0.6826586", "0.6825224"...
0.66622484
58
Checkout a cart and create an order
def create_cart_checkout(account_number, cart_id, cart_checkout_form) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/carts/{cart_id}/checkout' # process optional query para...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @cart = current_user.cart \n unless current_user.cart.nil? || @cart.empty?\n @order = @cart.create_order\n @order.user = current_user\n @order.save\n redirect_to checkout_order_path(@order)\n else\n flash[:notice] = \"There is nothing in your cart.\"\n redirec...
[ "0.7874459", "0.78251064", "0.7742136", "0.7622642", "0.75941664", "0.749191", "0.748377", "0.7466677", "0.744516", "0.74440885", "0.7427935", "0.7421873", "0.7362955", "0.7310226", "0.725648", "0.72258747", "0.7222599", "0.72153294", "0.7202901", "0.7166625", "0.71563554", ...
0.6837533
80
Delete all carts items
def delete_items(account_number, cart_id) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/carts/{cart_id}/items' # process optional query parameters query_builder = A...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_cart\n items=CartItem.where(:cart_id=>self.id)\n items.each do |item|\n item.destroy\n end\n end", "def delete\n\t\t@cart.delete(:item_id)\n end", "def clear_carts\n current_user.carts.each_with_index do |cart, i|\n cart.delete if i != current_user.carts.length - 1\n end\n ...
[ "0.8201145", "0.78332233", "0.76104516", "0.75409174", "0.7470122", "0.7403357", "0.72924554", "0.7249027", "0.72251153", "0.7199775", "0.71281654", "0.71214443", "0.7080319", "0.7050114", "0.7023684", "0.7010774", "0.6989257", "0.69710225", "0.6962485", "0.69512045", "0.6944...
0.6594063
36
Allow clients to get the list of cart items.
def get_items(account_number, cart_id, page = 1, limit = 10) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/carts/{cart_id}/items' # process optional query parameters ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @cart_items = CartItem.all\n end", "def index\n @cart_items = CartItem.all\n end", "def index\n @cart_items = CartItem.all\n end", "def index\n @cart_items = CartItem.all\n end", "def index\n @cart_items = CartItem.all\n end", "def show_the_cart\n @cart_items = Nacho.fi...
[ "0.7427163", "0.7427163", "0.7427163", "0.7427163", "0.7427163", "0.73520726", "0.7299072", "0.7289567", "0.7231912", "0.71881723", "0.706148", "0.7023675", "0.7009667", "0.7001291", "0.69963294", "0.6984348", "0.6940739", "0.69172084", "0.69168645", "0.6883381", "0.68488127"...
0.633591
76
TODO: type endpoint description here
def create_items(account_number, cart_id, item_form) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/carts/{cart_id}/items' # process optional query parameters query_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def endpoint; end", "def endpoint; end", "def endpoint; end", "def endpoint; end", "def endpoint\n raise NotImplementedError\n end", "def service_endpoint; end", "def service_endpoint; end", "def endpoints; end", "def get_endpoint()\n end", "def endpoint=(_arg0); end", "def e...
[ "0.8112581", "0.8112581", "0.8112581", "0.8112581", "0.7629666", "0.746777", "0.746777", "0.7420307", "0.7420145", "0.7357874", "0.7183796", "0.7183796", "0.68851274", "0.6775194", "0.6647232", "0.65895265", "0.6526732", "0.64789647", "0.64789647", "0.64623034", "0.64623034",...
0.0
-1
Delete a cart item
def delete_item(account_number, cart_id, item_id) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/carts/{cart_id}/items/{item_id}' # process optional query parameters ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n\t\t@cart.delete(:item_id)\n end", "def destroy\n @cart_item.destroy\n\n head :no_content\n end", "def delete_item\n if current_user\n @item = Item.find(params[:id].to_i)\n current_cart.items.delete(@item)\n redirect_to cart_path\n else\n delete_item_in_guest_cart(...
[ "0.89142406", "0.82527757", "0.82380116", "0.8183238", "0.8153385", "0.8123722", "0.80902684", "0.8049402", "0.80040175", "0.7991092", "0.7987267", "0.7932994", "0.7932032", "0.7919643", "0.7918153", "0.79040754", "0.79040754", "0.78890955", "0.7878671", "0.7874198", "0.78697...
0.74428487
49
Allow clients to get a specific cart item.
def get_item(account_number, cart_id, item_id) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/carts/{cart_id}/items/{item_id}' # process optional query parameters qu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_the_cart\n @cart_items = Nacho.find(cart)\n end", "def fetch_cart_item(current_user)\n user_cart = Cart.find_by(user_id: current_user.id)\n\n if user_cart\n cart_item = CartItem.find_by(cart_id: user_cart.id, menu_item_id: id)\n if cart_item\n return cart_item\n end\n ...
[ "0.71114534", "0.7025734", "0.69683826", "0.69683826", "0.6951347", "0.6925688", "0.69094634", "0.6849485", "0.6849485", "0.6849485", "0.6849485", "0.6849485", "0.6849485", "0.6849485", "0.6849485", "0.6739923", "0.66897243", "0.66534626", "0.66534626", "0.66534626", "0.66187...
0.714101
0
Allow clients to get the list of orders.
def get_orders(account_number, page = 1, limit = 10, filter = nil) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/orders' # process optional query parameters query_b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def orders\n return [] if !is_client?\n client.orders\n end", "def get_orders\n return ShopifyAPI::Order.all\n end", "def list_orders\n Order.list(@current_user)\n end", "def get_orders\n orders\n end", "def orders\n authenticated_post(\"auth/r/orders\").body\n end", "d...
[ "0.83106875", "0.8082682", "0.80443007", "0.78507423", "0.78188556", "0.78012776", "0.77456", "0.7727244", "0.7726307", "0.769829", "0.75615317", "0.75490725", "0.75407666", "0.7340438", "0.7340438", "0.7323475", "0.72200084", "0.721176", "0.72091025", "0.72091025", "0.715010...
0.0
-1
Allow clients to get a specific order.
def get_order(account_number, order_id) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/orders/{order_id}' # process optional query parameters query_builder = APIHelp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_order(order_id)\n authenticated? do\n query_and_build \"marketplace/orders/#{order_id}\"\n end\n end", "def get_order(order_id)\n\tputs \"Getting order: \" + order_id\n\tresponse = request_get(\"/api/order/\" + order_id)\n\tputs response.body\nend", "def get_order\n @order = Order.find(p...
[ "0.76442516", "0.7497409", "0.73348486", "0.73348486", "0.7202272", "0.71829015", "0.7128565", "0.70849276", "0.6895128", "0.6840086", "0.6753069", "0.6706757", "0.67027783", "0.6637077", "0.66301376", "0.6623912", "0.6593885", "0.6565419", "0.65316105", "0.6529284", "0.65243...
0.67273027
11
Allow clients to get the list of tokens for the specific account.
def get_access_tokens(account_number, page = 1, limit = 10) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/access-tokens' # process optional query parameters query_b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetchTokens\n self.class.request.get \"#{id}/tokens\" \n end", "def token\n @api.get(\"#{Paths::TOKENS}\")\n end", "def get_list_acc\n JSON.parse(curl_get(\"accounts\").body_str)\n end", "def listtokens(session)\n\tbegin\n\t\tprint_status(\"Getting Tokens...\")\n\t\tdt = ''\n\t\ts...
[ "0.76505965", "0.68276125", "0.6826826", "0.6707267", "0.6624176", "0.6506224", "0.6427559", "0.6414222", "0.639894", "0.6393929", "0.6361767", "0.6359481", "0.63485706", "0.6316659", "0.630498", "0.62592614", "0.62588245", "0.6234318", "0.6225211", "0.6221121", "0.62151366",...
0.65077114
5
Delete an access token
def delete_access_token(account_number, token) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/access-tokens/{token}' # process optional query parameters query_builde...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_access_token(id:)\n client.make_request('/delete-access-token', 'post', params: {id: id})\n end", "def delete_access_token(access_token_id)\n @redis.del(auth_domain_key(access_token_id))\n end", "def destroy_current_access_token\n AccessToken.find(current_access_token_id).dest...
[ "0.8437613", "0.82893336", "0.80531317", "0.80357987", "0.7981037", "0.757317", "0.73777217", "0.7284716", "0.72211415", "0.72089756", "0.7187539", "0.7115489", "0.70924824", "0.70891196", "0.7070453", "0.7047338", "0.6998197", "0.6991155", "0.693913", "0.6908752", "0.6903237...
0.76521105
5
Allow clients to get a specific token.
def get_access_token(account_number, token) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/access-tokens/{token}' # process optional query parameters query_builder =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def token\n client.token if client\n end", "def get_token\n get(TOKEN_URL)\n end", "def token\n @api.get(\"#{Paths::TOKENS}\")\n end", "def request_token\n @token = current_client_application.create_request_token\n if @token\n render :text => @token.to_query\n el...
[ "0.7737974", "0.7557864", "0.74255973", "0.7385697", "0.7357491", "0.7345289", "0.72598183", "0.709964", "0.6995073", "0.6975275", "0.69494337", "0.6925046", "0.6909259", "0.6879527", "0.67902476", "0.67765534", "0.67730457", "0.67390907", "0.67389476", "0.67273086", "0.66904...
0.0
-1
Update an account by a given account_number
def update_access_token(account_number, token, token_form) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/access-tokens/{token}' # process optional query parameters ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_account(account_number, account_form)\r\n # the base uri for api requests\r\n query_builder = Configuration.base_uri.dup\r\n\r\n # prepare query string for API call\r\n query_builder << '/accounts/{account_number}'\r\n\r\n # process optional query parameters\r\n query_build...
[ "0.7869943", "0.7323619", "0.72124994", "0.7156982", "0.7114172", "0.7012978", "0.701191", "0.69994473", "0.6982494", "0.69627845", "0.6909878", "0.6864603", "0.68139035", "0.679605", "0.67520064", "0.6744043", "0.67295665", "0.6725145", "0.6724107", "0.67102057", "0.6689776"...
0.0
-1
Create a new Access Token.
def create_access_tokens(account_number, access_token_form) # the base uri for api requests query_builder = Configuration.base_uri.dup # prepare query string for API call query_builder << '/accounts/{account_number}/access-tokens' # process optional query parameters query_b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n require 'digest/sha1'\n \n @access_token = AccessToken.new\n @access_token.user_id = current_user.id\n @access_token.last_access = Time.now\n @access_token.token = Digest::SHA1.hexdigest Time.now.to_s\n @access_token.active = true\n \n respond_to do |format|\n if @acces...
[ "0.80000424", "0.7673346", "0.7464421", "0.7439363", "0.7439363", "0.74382466", "0.7401727", "0.7330901", "0.73251265", "0.72907823", "0.7210443", "0.7204741", "0.7117395", "0.71051574", "0.7042569", "0.70289236", "0.70040596", "0.6954452", "0.69424725", "0.68734115", "0.6873...
0.6520017
37
101109 Small Problems Easy 1: Reverse It (Part 1) Write a method that takes one argument, a string, and returns the same string with the words in reverse order.
def reverse_sentence(str) str.split.reverse.join(" ") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reverse(string)\n words = string.split(' ')\n words.reverse!\n return words.join(' ')\nend", "def reverse_words(string)\n words = string.split()\n words.each_with_index { |word, index| words[index] = word.reverse() }\n p words.join(\" \")\nend", "def reverse_string word\n\t\treturn word.reverse\nend"...
[ "0.8337785", "0.82834226", "0.8221618", "0.8218094", "0.82133955", "0.82133955", "0.8187851", "0.8134805", "0.8122015", "0.8109053", "0.8086197", "0.8084856", "0.8079202", "0.80779123", "0.80582196", "0.8057685", "0.80576515", "0.8056622", "0.80559856", "0.8052454", "0.805111...
0.0
-1
lambdastyle squarebracket function call
def add(collision_type) unless @known_types.include? collision_type bind(collision_type) @known_types.add collision_type end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mutate_empty_bracket(_)\n '[]'\n end", "def array_brackets(member)\n\n\n\n # 352:7: '[' ']'\n match(:LEFT_SQUARE_BRACKET)\n match(:RIGHT_SQUARE_BRACKET)\n member.type += '[]' \n\n\n\n end", "def square_bracketed(atom)\n lsquare >> atom >> rsquare\n end", ...
[ "0.6560277", "0.63500845", "0.63169086", "0.6218894", "0.619047", "0.6121927", "0.6074355", "0.6072291", "0.60459065", "0.604029", "0.6034524", "0.6033916", "0.59769446", "0.593459", "0.59004474", "0.59004474", "0.59004474", "0.5873445", "0.5873445", "0.5866581", "0.579874", ...
0.0
-1
Logs in the given user.
def log_in(admin) session[:admin_id] = admin.id end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_login(user)\n click_log_in\n fill_login_credentials(user)\n end", "def login_as(user)\n login(users(user).email, users(user).password)\n end", "def sign_in(user)\n login_as user\n end", "def login(user=:joerg)\r\n login_as(user)\r\n end", "def log_user_in(user)\n note \"W...
[ "0.7925763", "0.7896426", "0.78723115", "0.77748597", "0.76522505", "0.7573472", "0.7571692", "0.7565311", "0.7543444", "0.7480138", "0.74693316", "0.74497837", "0.7436831", "0.7427152", "0.7387903", "0.73557717", "0.734555", "0.73241425", "0.732062", "0.7314264", "0.73051864...
0.0
-1
Returns the current loggedin user (if any).
def current_admin @current_admin ||= Admin.find_by(id: session[:admin_id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_user\n if session[:user_id]\n return User.find(session[:id])\n else\n return nil\n end\n end", "def current_user\n if session[:user_id]\n User.find(session[:user_id])\n else\n nil\n end\n end", "def current_user\n return unless session[:user_id...
[ "0.85960984", "0.8593657", "0.855797", "0.8545853", "0.8534344", "0.8497545", "0.847914", "0.8460573", "0.8457271", "0.84556973", "0.84472865", "0.8442264", "0.8441092", "0.84366953", "0.8400402", "0.83765614", "0.8368829", "0.8337418", "0.8337418", "0.8314651", "0.8311652", ...
0.0
-1
Returns true if the user is logged in, false otherwise.
def logged_in? !current_admin.nil? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_is_logged_in()\n user = get_user()\n if user != nil\n true\n else\n false\n end\n end", "def logged_in?\n user._logged_in?\n end", "def logged_in?\n if session[:username]\n if session[:logged_in?]\n return true\n end\n else\n r...
[ "0.9082417", "0.8764097", "0.87552106", "0.8718715", "0.86894006", "0.86498255", "0.86469626", "0.86372185", "0.8631328", "0.86285406", "0.86285406", "0.8582609", "0.85669243", "0.85613596", "0.85613596", "0.8551865", "0.85491496", "0.85443276", "0.85409296", "0.8539988", "0....
0.0
-1
GET /states/1/municipalities/1 GET /states/1/municipalities/1.json
def show @municipality = Municipality.find(params[:state_id],params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @municipality } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @municipality = Municipality.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @municipality }\n end\n end", "def index\n if params[:estado]\n @municipios = Uf.find(params[:estado]).municipios\n else\n @municipio...
[ "0.683277", "0.6819034", "0.662771", "0.662771", "0.6516159", "0.6451001", "0.63829505", "0.62926984", "0.6279568", "0.62729794", "0.6245404", "0.62414134", "0.6213477", "0.61912173", "0.61477274", "0.6146042", "0.61128443", "0.6097431", "0.6092971", "0.6069205", "0.6063263",...
0.7333686
0
call on a category
def select_unanswered_question_by_category(slug) questions = remaining_questions.select do |q| # q.category.id == category_id.to_i q.category.slug == slug end questions.sample end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_category\n end", "def category; end", "def method_missing(method, args)\n @categories.send(method, *args)\n end", "def category=(cat, *args, &block)\n cat = $game_system.masai_category if $game_system.masai_category.is_a?(Symbol)\n # Run Original Method\n super(cat, *args, &block)...
[ "0.7405868", "0.72876537", "0.7156825", "0.66018933", "0.6489952", "0.6476935", "0.6470424", "0.64582366", "0.64582366", "0.6356234", "0.6307629", "0.62640566", "0.6222366", "0.6213003", "0.61743957", "0.6167574", "0.615073", "0.6135785", "0.61275727", "0.6127382", "0.6124385...
0.0
-1
call on an answer or question
def nsfw_filter if self.class == AnswersController answer = Answer.find_by(id: params[:id]) if answer.question.nsfw_flag filter = true end elsif self.class == QuestionsController category= Category.find_by_slug(params[:id]) if category.name.include?("nsfw") filter =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ask_question\n\n end", "def ask(question)\n ui.ask question\n end", "def find_answer\nend", "def perform(user, questions)\n \n end", "def pre_answer &block\n application \"pre_answer\", &block\n end", "def invoke_question(object, message, *args, &block)\n options = Utils.extra...
[ "0.65202373", "0.6489532", "0.6431957", "0.6417326", "0.64069486", "0.6387888", "0.63740724", "0.6356258", "0.6323705", "0.6305631", "0.62868625", "0.62868625", "0.61643314", "0.6135089", "0.6135089", "0.6084333", "0.6070897", "0.60451937", "0.60399824", "0.6037607", "0.60323...
0.0
-1
after one minute, we are considered dead
def with_instance_locked_for(operation, &block) return yield unless operation.version key = "#{app}:#{operation.key}" lock = Redis::Lock.new(key, LOCK_OPTIONS.merge(:redis => Promiscuous::Redis.connection)) unless lock.lock raise Promiscuous::Error::LockUnavailable.new(lock.key) end beg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dead? \n if (timer <= 0.0) \n return true\n else \n return false\n end\n end", "def is_dead?\n @lifespan < 0.0\n end", "def is_dead?\n @lifespan < 0.0\n end", "def dead\n @alive = false\n on_dead.call(self) if on_dead\n end", "def dead?; end", "def dead\n end...
[ "0.71791846", "0.70932865", "0.70932865", "0.7072529", "0.70397985", "0.7024288", "0.6935418", "0.6935405", "0.6882368", "0.6875344", "0.68410635", "0.6783802", "0.677076", "0.67413175", "0.6733182", "0.67000985", "0.6670657", "0.66598374", "0.662992", "0.657911", "0.6574219"...
0.0
-1
XXX Used for hooking into e.g. by promiscuousnewrelic
def execute_operation(operation) with_instance_locked_for(operation) do operation.execute end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def before_processing_hook(msg, connection); end", "def process_vrfy\n send_data \"502 Command not implemented\\r\\n\"\n end", "def packets; end", "def reserved_net_checker; end", "def vcap_commands\n\nend", "def promiscuous?\n\t\t\treturn false\n\t\tend", "def intensifier; end", "def cap...
[ "0.5743114", "0.5658647", "0.5636098", "0.5576992", "0.55218303", "0.5513375", "0.5471858", "0.54687536", "0.54687536", "0.54687536", "0.5453622", "0.5451484", "0.54487306", "0.54428834", "0.54372257", "0.541784", "0.5414055", "0.54094", "0.5407283", "0.5390995", "0.53767645"...
0.0
-1
Public: The status priority is a simple map between the status and an integer used to sort launched jobs by priority.
def set_status_priority self.status_priority = STATUS_PRIORITY_MAP[self.status] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def acquire_priority\n case @event['status']\n when '0', '1'\n 'low'\n when '2', '3'\n 'normal'\n end\n end", "def job_priority\n case params[:queue]\n when 'high'\n 0\n when 'medium'\n 1\n when 'low'\n 2\n end\n end", "def collect_min_priority(...
[ "0.6952509", "0.6551405", "0.6535663", "0.6292588", "0.6171395", "0.61434156", "0.613293", "0.6097689", "0.6097689", "0.6092697", "0.60880023", "0.6052911", "0.5994329", "0.5977477", "0.5957101", "0.5939798", "0.5936967", "0.59002477", "0.5894617", "0.58924997", "0.5879084", ...
0.79208815
0
Public: Used to get the total run time of the launched job. If the job is currently running, it will return the difference between the start time and the current time. Returns a time value.
def run_time return nil unless self.start_time (self.end_time || Time.now) - self.start_time end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_running_time(job)\n case job.status \n when 'running' then ChronicDuration.output((Time.now - job.started_at+1).to_i, :format => :short) \n when 'done' then ChronicDuration.output((job.completed_at - job.started_at+1).to_i, :format => :short)\n else ''\n end\n end", "def running_time_i...
[ "0.76123744", "0.75547683", "0.73535883", "0.73340636", "0.7192823", "0.6976606", "0.69022334", "0.6887858", "0.685685", "0.6854619", "0.67899394", "0.67030305", "0.66834426", "0.6677064", "0.66446424", "0.664225", "0.6637027", "0.66238433", "0.66133577", "0.6609771", "0.6572...
0.76608264
0
Public: Every time the Rufus scheduler executes a job, it calls this method. This method instantiates a new LaunchedJob and calls LaunchedJobrun_job. rjob A Rufus job object that contains various metadata about the status of a job. time The time when the job got cleared for triggering. Returns nothing.
def call(rjob, time) # Since Rufus scheduler starts a new thread for each job, we must manage the connection # pool ourselves. # http://stackoverflow.com/questions/11248808/connection-pool-issue-with-activerecord-objects-in-rufus-scheduler ActiveRecord::Base.connection_pool.with_connection do ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_launched_job\n @launched_job = LaunchedJob.find(params[:id])\n end", "def reschedule(job, time = T.unsafe(nil)); end", "def run_template\n launched_job.update(status_message: \"Running TplDevTest job\")\n launched_job.job_log.info \"Logging within TplDevTest job\"\n\n sleep self.sleep_...
[ "0.61478686", "0.61362517", "0.6084354", "0.60185575", "0.5962999", "0.5886744", "0.588263", "0.5845259", "0.5843733", "0.5843733", "0.58357805", "0.57965845", "0.57757336", "0.5762747", "0.57406014", "0.5733998", "0.5702876", "0.5691428", "0.5683454", "0.56658435", "0.565085...
0.68376744
0
Public: Shortcut to get the JobSpecid of this LaunchedJob
def job_spec_id self.job_spec.id end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getJobId()\n return @helper.getJobId()\n end", "def getJobId()\n return @helper.getJobId()\n end", "def getJobId()\n return @helper.getJobId()\n end", "def getJobId()\n return @helper.getJobId()\n end", "def getJobId()\n ...
[ "0.7710142", "0.7710142", "0.7710142", "0.7710142", "0.7710142", "0.7710142", "0.7710142", "0.72955704", "0.72906065", "0.72561723", "0.7089052", "0.6998633", "0.6869676", "0.6542901", "0.6384798", "0.63793683", "0.6186538", "0.61864626", "0.61783797", "0.6121858", "0.6097190...
0.83188003
0
Public: Shortcut to get the JobSpecname of this LaunchedJob
def job_spec_name self.job_spec.name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name\n application_job_overrides_method!(__method__)\n\n # default implementation for framework jobs\n job_id\n end", "def display_name\n job_class\n end", "def job_spec_id\n self.job_spec.id\n end", "def job_type_name\r\n job_type.job_name rescue nil\r\n end", ...
[ "0.7249618", "0.69768167", "0.6931277", "0.68296325", "0.6801959", "0.67977697", "0.6768748", "0.6768748", "0.6768748", "0.6768748", "0.6768748", "0.6768748", "0.6768748", "0.6671167", "0.65956897", "0.6322936", "0.6298125", "0.62516606", "0.6249402", "0.62271357", "0.6221205...
0.87263644
0
Public: This is the method that is called when the job is to be executed. It wraps the run_template job that is defined in and specific to individual job template models. Returns nothing.
def run_job begin set_initial_status initialize_job run_job_template rescue => err job_error_handler(err) ensure close_job end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_job_template\n self.job_spec.job_template.run_template\n end", "def run_template\n launched_job.update(status_message: \"Running TplDevTest job\")\n launched_job.job_log.info \"Logging within TplDevTest job\"\n\n sleep self.sleep_seconds\n\n launched_job.status\n end", "def job_templat...
[ "0.8198692", "0.69262666", "0.676922", "0.6259819", "0.6150083", "0.6124113", "0.60593396", "0.5944977", "0.5876692", "0.58128905", "0.5811727", "0.56773907", "0.5676723", "0.5675013", "0.5669826", "0.565654", "0.562186", "0.55972815", "0.55705833", "0.5564815", "0.5561249", ...
0.65287477
3
Public: This method is used to kill a job. It first stops the thread from executing in the JobScheduler and then it closes out the launched job as it would if it exited normally. Returns nothing.
def kill_job raise UnableToKillJobNotRunningError unless self.status == RUNNING begin JobScheduler.find.try(:kill_job, self) raise KilledJobError.new 'Job Killed' rescue => err job_error_handler(err) ensure close_job end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kill\n if TerminateJobObject(@job_handle, Process.pid) == 0\n raise Error, get_last_error\n end\n end", "def stop\n # TODO: can this be elsewhere?\n puts \"Stopping job #{@sandbox.job.id}\"\n\n @thread.kill\n ActiveRecord::Base.clear_active_connections!\n @mutex.s...
[ "0.77258694", "0.7395548", "0.70896137", "0.7019453", "0.6809563", "0.6559323", "0.65538615", "0.655086", "0.65468943", "0.6523986", "0.65008", "0.6457051", "0.6451367", "0.6446415", "0.6435251", "0.6435251", "0.63750196", "0.6336413", "0.63257205", "0.6296262", "0.62527686",...
0.80146474
0
Private: Set defaults for the model.
def defaults self.status ||= UNKNOWN end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_defaults\n end", "def set_defaults\n end", "def set_defaults\n\n end", "def set_defaults\n\n end", "def set_defaults\n\n end", "def set_defaults\n\n end", "def set_defaults\n\n end", "def set_defaults\n\n end", "def new_model_defaults\n end", "def set_default_values\n # ...
[ "0.79470146", "0.79470146", "0.7907524", "0.7907524", "0.7907524", "0.7907524", "0.7907524", "0.7907524", "0.78448457", "0.7636732", "0.74614656", "0.7447769", "0.74142516", "0.7400496", "0.7366204", "0.7366204", "0.7360436", "0.73078734", "0.7301919", "0.729381", "0.729381",...
0.0
-1
Private: This method is run before the specific run_template method is executed. It is used to intialize any instance variables that may need to be set before running the job (at either the launched_job or job_template level). Returns nothing.
def initialize_job launched_job_initializers job_template_initializers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pre_run_initialize\n @evaluator = @evaluator_class.new(self) if @evaluator.nil?\n @evolver = @evolver_class.new(self) if @evolver.nil?\n end", "def pre_initialize\n end", "def job_template_initializers\n job_template = self.job_spec.job_template\n job_template.launched_job = self\n\...
[ "0.623984", "0.61554605", "0.6076871", "0.5892419", "0.5858241", "0.5827551", "0.58233446", "0.58043087", "0.5788092", "0.56686455", "0.56195974", "0.561659", "0.5615153", "0.5602298", "0.55766124", "0.55669564", "0.5559494", "0.555422", "0.55397636", "0.550606", "0.550606", ...
0.6715821
0
Private: Initializes any modules defined at the launched_job level. Any modules included in the LaunchedJob that need initialization should append the name of the initialization method to the job_initializers class variable. Examples module JobLog def self.included(klass) klass.job_initializers << :initialize_job_log e...
def launched_job_initializers self.class.job_initializers.each do |job_initializer| self.send(job_initializer) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_job\n launched_job_initializers\n \n job_template_initializers\n end", "def job_template_initializers\n job_template = self.job_spec.job_template\n job_template.launched_job = self\n\n job_template.class.job_initializers.each do |job_initializer|\n job_template.send(job_initi...
[ "0.6956243", "0.6424494", "0.62844783", "0.5902482", "0.58118427", "0.5577496", "0.557116", "0.54072833", "0.5363324", "0.5361472", "0.53152746", "0.5314293", "0.5270019", "0.5165706", "0.5163906", "0.5162414", "0.5161039", "0.5160709", "0.51352197", "0.5120324", "0.51084584"...
0.6952708
1
Private: Associates the job template instance with this launched_job instance. Initializes any modules defined at the job template level. Any modules included in the job template that need initialization should append the name of the initialization method to tje job_initializers class variable. Examples module BirstSoa...
def job_template_initializers job_template = self.job_spec.job_template job_template.launched_job = self job_template.class.job_initializers.each do |job_initializer| job_template.send(job_initializer) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_job\n launched_job_initializers\n \n job_template_initializers\n end", "def launched_job_initializers\n self.class.job_initializers.each do |job_initializer|\n self.send(job_initializer)\n end\n end", "def job_template_class\n @job_template_class ||= AnsibleTowerClient...
[ "0.7672168", "0.60567755", "0.56232566", "0.5549965", "0.54645586", "0.5454102", "0.5434136", "0.5399727", "0.5397724", "0.53606856", "0.53229237", "0.53191626", "0.5256556", "0.5220996", "0.5196366", "0.5177154", "0.5173425", "0.5161459", "0.51316464", "0.5126023", "0.510432...
0.7414695
1
Private: Saves launched_job instance and Sets the initial status. Returns the launched_job instance.
def set_initial_status if LaunchedJob.where(job_spec: self.job_spec, status: LaunchedJob::RUNNING).size > 0 self.update(status: ERROR, start_time: Time.now) raise "JobSpec already running" else self.update(status: RUNNING, start_time: Time.now) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_launched_job\n @launched_job = LaunchedJob.find(params[:id])\n end", "def set_saved_job\n @saved_job = SavedJob.find(params[:id])\n end", "def create\n @job = Job.new(params[:job])\n\n respond_to do |format|\n if @job.save\n # after @job.save, initially the job is in a...
[ "0.6609783", "0.63676924", "0.62247485", "0.6113746", "0.5973174", "0.5795176", "0.5754507", "0.573616", "0.57197547", "0.56587267", "0.56579757", "0.5629362", "0.5536834", "0.5534085", "0.5524096", "0.55221564", "0.55138403", "0.5499347", "0.5497823", "0.5497823", "0.5488757...
0.56699353
9
Private: Runs the job specified in the job template. Returns the result of running the job template.
def run_job_template self.job_spec.job_template.run_template end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_job\n begin\n set_initial_status\n initialize_job\n run_job_template\n rescue => err\n job_error_handler(err)\n ensure\n close_job\n end\n end", "def run_template\n launched_job.update(status_message: \"Running TplDevTest job\")\n launched_job.job_log.info \"Lo...
[ "0.750822", "0.716339", "0.66863", "0.6365175", "0.6299157", "0.6195119", "0.6128418", "0.60982615", "0.60661614", "0.5995691", "0.5969639", "0.58255225", "0.58221394", "0.58027107", "0.578348", "0.57538", "0.5750213", "0.5717256", "0.5717256", "0.5708714", "0.5683693", "0....
0.83071333
0
Private: Log error message to the log, update the status of the launched job, and reraise the error. Also send job notification email Returns nothing.
def job_error_handler(err) UserMailer.job_notification_email(job_spec, @job_log_s3_full_path).deliver self.update(status: ERROR, status_message: error_message(err)) @job_log.error error_message(err) raise err end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def jobfail(log,msg)\n Rails.logger.error(\"#{log} #{self.id}\")\n self.update_attributes(:status =>'error',:errormsg => msg)\n user = User.find_by_email(self.email)\n UserMailer.job_failed(user,self).deliver \n UserMailer.admin_job_failed(self).deliver\n end", "def error job, exception\n if t...
[ "0.7410205", "0.6801426", "0.6506282", "0.6437341", "0.64348733", "0.63806194", "0.62750757", "0.6254097", "0.6252931", "0.62399787", "0.62041736", "0.6186614", "0.6162249", "0.6139675", "0.6049808", "0.6022697", "0.60136414", "0.5990909", "0.5982339", "0.5938036", "0.5916059...
0.7510564
0
Private: Defined the format of the error message. Returns a string with the error message.
def error_message(err) "Backtrace: #{err.class.name}: #{$!}\n\t#{err.backtrace.join("\n\t")}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def message\n msg = \"Format error found in %s tuple: %s\" % [@identifier, @invalid_data.inspect]\n return msg\n end", "def format_error(error)\n msgstr = <<END_OF_MESSAGE\n<p><b>#{ERRORPREFIX}</b></p>\n<p><i>#{error}</i></p>\nEND_OF_MESSAGE\n end", "def error_message(message)\n ...
[ "0.7892135", "0.7603115", "0.73929703", "0.7269643", "0.72591734", "0.716594", "0.716594", "0.712297", "0.70730954", "0.70019937", "0.6922895", "0.6911726", "0.68908465", "0.6868792", "0.6826348", "0.6820963", "0.6820963", "0.67835194", "0.6766629", "0.673698", "0.66929895", ...
0.0
-1
Private: Performs any tasks needed to close the job, whether it was successful or not. Currently, this is just to set the final status of the job and save the logs. Returns nothing.
def close_job begin set_close_status self.update(log_file: @job_log_s3_full_path) rescue => err @job_log.error error_message(err) raise err ensure close_job_log end nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_and_shutdown\n handle_action_exceptions(__method__) do\n unload_toolshck\n shutdown\n unload_winrm_ps\n logger('debug', 'close') { 'done!' }\n @closed = true\n @json ? { 'result' => 'Success' } : true\n end\n end", "def finish_job!(job)\n job.finish!\n job...
[ "0.61675906", "0.61036694", "0.6058066", "0.6022594", "0.60182005", "0.590168", "0.58972585", "0.588264", "0.58455247", "0.5755515", "0.5755336", "0.57363594", "0.57133305", "0.5710424", "0.56953627", "0.5690179", "0.5687592", "0.5668112", "0.5618143", "0.5601293", "0.5567760...
0.7007089
0
Private: Sets the status of the job on completion. Returns the launched_job instance.
def set_close_status case self.status when RUNNING self.update(status: SUCCESS, status_message: "Completed successfully", end_time: Time.now) when UNKNOWN self.update(status: ERROR, status_message: "UNKNOWN job terminated", end_time: Time.now) else self.update(end_time: Time.now) e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perform\n self.status = STATUS_DONE\n self.save\n job.update_status\n end", "def status\n (@remote_job || fetch_job).merge(attributes)\n end", "def update_job_status(status)\n @csv_report_job.status = status\n @csv_report_job.save!\n end", "def update #:nodoc:\n job = Jo...
[ "0.66361", "0.6201852", "0.61885494", "0.6178735", "0.60613865", "0.59069026", "0.58850116", "0.58548343", "0.58305067", "0.58305067", "0.58166844", "0.57801235", "0.5771766", "0.57195675", "0.569379", "0.5693684", "0.56662595", "0.56175613", "0.55930316", "0.55555534", "0.55...
0.5581454
19
route is GET /client
def index render json: Client.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clients\r\n ClientsController.instance\r\n end", "def show\n @client = clients.find(params[:id])\n end", "def show\n # @client = Client.find(params[:client_id])\n end", "def index\n @clients = Client.all\n @uuid = params[:uuid]\n respond_to do |format|\n format.html # index.ht...
[ "0.69801825", "0.68882114", "0.68001187", "0.6758556", "0.67533106", "0.67406034", "0.6738744", "0.6721165", "0.671989", "0.671989", "0.671989", "0.671989", "0.67130846", "0.67090464", "0.66839254", "0.66703117", "0.66694814", "0.6658873", "0.6658873", "0.6658873", "0.6658873...
0.617706
72
route is POST /client
def create client = Client.new(client_params) if !client.billing_plan render json: {error: "you need to select a plan"} else client.save render json: client, status: :created end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def POST; end", "def post(path, **args); end", "def create\n #create the object of client and assign the attributes in the request\n @client = Client.new(params[:client])\n \n #save the client\n if @client.save\n #if saved, return and redirect to client show page with success message\n ...
[ "0.67970437", "0.6484928", "0.645203", "0.6404161", "0.6404009", "0.6402609", "0.6325029", "0.6296894", "0.62878275", "0.62804127", "0.62772244", "0.62746996", "0.6256436", "0.6254091", "0.62530124", "0.62530124", "0.62530124", "0.62530124", "0.62145483", "0.6200864", "0.6200...
0.0
-1
route is PUT /client/:id
def update @client.update(client_params) render json: @client end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit_client\n\t\t@client = Client.find(params[:id])\n\tend", "def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to @client, :notice => 'Klijent je uspjesno izmjenjen.' }\n format.json { ...
[ "0.7402501", "0.72398794", "0.7232439", "0.71781605", "0.7154707", "0.713003", "0.71101433", "0.7098045", "0.7093189", "0.7093189", "0.7085627", "0.7085461", "0.70501786", "0.70501786", "0.7048664", "0.70323914", "0.7028822", "0.70242864", "0.7024088", "0.7019962", "0.7010083...
0.708343
12
route is GET /client/:id
def show render json: @client end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @client = Client.find_by(id: params[:id])\n end", "def show\n @client = clients.find(params[:id])\n end", "def show\n @client = Client.find params[:id]\n end", "def show\n # @client = Client.find(params[:client_id])\n end", "def show\n @client = Client.find params[:client_id]\n ...
[ "0.785807", "0.78151035", "0.77642316", "0.775611", "0.7744727", "0.7730752", "0.77000237", "0.7688295", "0.76874256", "0.76874256", "0.76874256", "0.76874256", "0.74610436", "0.73024887", "0.72655624", "0.7264671", "0.7264671", "0.7264671", "0.7264671", "0.7264671", "0.72646...
0.0
-1
flashes message if current_user can't find a loggedin merchant
def require_login unless current_user flash[:error] = "You must be logged in to do that." redirect_back fallback_location: root_path end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merchant_guard\n \treturn unless self.controller_name == \"merchants\"\n \tif current_user.nil?\n \t\tflash[:notice] = \"You must be signed into an account to access this page.\"\n \t\tredirect_to root_path\n \telsif !current_user.is_admin\n \t\t@m = Merchant.find_by_id(params[:id])\n \t\tif @m.owner !=...
[ "0.7498758", "0.74923253", "0.74203616", "0.7231747", "0.69494975", "0.6835861", "0.68351454", "0.68227804", "0.661688", "0.66085845", "0.65055305", "0.64914644", "0.64827394", "0.64242136", "0.6373328", "0.63588184", "0.63570166", "0.6351714", "0.6343309", "0.6335305", "0.63...
0.0
-1
Init list, optionally with a string of serialized events
def init(str = nil) Thread.current[:ga_events] = [] if str.present? raw_events = JSON.parse(str) raw_events.each { |raw_event| GaEvents::Event.from_hash(raw_event) } end rescue JSON::ParserError nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(list, event)\n @list = list.collect do |command|\n EventPrinter::EventCommand.new(command.code, command.indent, command.parameters, event)\n end\n @event = event\n end", "def initialize(name)\n @events = []\n @name = name\n end", "def init(str = nil)\n ...
[ "0.65386", "0.6472476", "0.63202953", "0.62787646", "0.6166069", "0.6052836", "0.60484457", "0.59654945", "0.57935196", "0.5775661", "0.569228", "0.56763333", "0.56729376", "0.5633054", "0.5612784", "0.5582835", "0.55655444", "0.55357194", "0.55244243", "0.55134624", "0.55015...
0.66362435
0
priority of version 1. node.foobar.source.version 2. node.foobar.source.git_commit[0, 7] 3. node.foobar.source.git_tag 4. node.foobar.source.git_branch's commit[0, 7]
def set_version_by_git! return unless use_git? if attr[:github] && !attr[:git_repository] default_attr.git_repository = "https://github.com/#{attr[:github]}.git" end unless attr[:git_branch] default_attr.git_branch = 'master' end unless attr[:version] default_attr.version = case w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_that_bumping_with_prereleases\r\n v = Bumper::Version.new\r\n assert_equal '0.0.0.0', v.to_s\r\n assert_equal 1, v.bump_minor\r\n assert_equal '0.1.0.0', v.to_s\r\n assert_equal 'beta', v.bump_patch_tag('beta')\r\n assert_equal '0.1.1-beta.0', v.to_s\r\n assert_equal 'beta2', v.bump_p...
[ "0.59201604", "0.5790222", "0.57739055", "0.57415986", "0.57180643", "0.5699509", "0.5671046", "0.565658", "0.56480825", "0.56212646", "0.5616976", "0.5607618", "0.56064886", "0.5597245", "0.55931586", "0.558225", "0.55818814", "0.55673575", "0.5565033", "0.55596113", "0.5552...
0.57272834
4
Uses the slug as the :id parameter in URLs
def to_param slug end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_param\n slug || id\n end", "def to_param\n slug ? slug.to_friendly_id : id.to_s\n end", "def to_param\n \"#{id}-#{slug}\"\n end", "def to_param\n \"#{id}-#{slug}\"\n end", "def id\n slug\n end", "def to_param_from_slug\n slug? ? slug.to_friendly_id : id.to_s\n end",...
[ "0.7967363", "0.7960363", "0.79011863", "0.79011863", "0.78813297", "0.7875968", "0.7875968", "0.7875968", "0.7824331", "0.78030074", "0.78030074", "0.78030074", "0.7795972", "0.76843685", "0.76843685", "0.7683692", "0.75976694", "0.75976694", "0.75371146", "0.7460174", "0.74...
0.7453142
37
The URL for the blog post.
def url(request = nil) @url ||= begin if request.try(:ssl?) "https://#{ENV.fetch('HOST')}/blog/tags/#{slug}" else "http://#{ENV.fetch('HOST')}/blog/tags/#{slug}" end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def blog_url(path)\n \"http://blog.jtribe.com.au#{path}\"\n end", "def noter_blog_url\n\t\t\"blogs/#{self.noter.main_blog_id}\"\n\tend", "def feed_url\n blog_url + \"posts.atom\"\n end", "def bloglink\n @@URL = params[:blog_url]\n end", "def posts_url\n if forum?\n foru...
[ "0.81895393", "0.79820275", "0.79319644", "0.78483886", "0.7814713", "0.78015727", "0.77777565", "0.7604136", "0.7510996", "0.7409261", "0.7312502", "0.728453", "0.7229392", "0.7224872", "0.71783483", "0.712711", "0.7076441", "0.707231", "0.6996239", "0.6936965", "0.6925615",...
0.64006543
64
GET /attention_centers GET /attention_centers.json
def index @attention_centers = AttentionCenter.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @evac_centers = EvacCenter.all\n render json: @evac_centers\n end", "def index\n @treatment_centers = TreatmentCenter.all\n end", "def index\n #@centers = Center.page(params[:page]).per(Settings.pagination.per_page)\n # https://github.com/ryanb/cancan/wiki/authorizing-controller-ac...
[ "0.62814593", "0.62341774", "0.6119783", "0.60469526", "0.60377467", "0.5978479", "0.5948648", "0.5910049", "0.58277863", "0.5780385", "0.57764405", "0.5769304", "0.5720679", "0.5644856", "0.56348485", "0.5580194", "0.5547058", "0.55131143", "0.5509902", "0.5480705", "0.54764...
0.78426176
0
GET /attention_centers/1 GET /attention_centers/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @attention_centers = AttentionCenter.all\n end", "def index\n @evac_centers = EvacCenter.all\n render json: @evac_centers\n end", "def index\n @datacenters = Datacenter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @datacenters...
[ "0.76148915", "0.62533605", "0.62031114", "0.6197012", "0.6038668", "0.6015869", "0.59896535", "0.5928775", "0.5838141", "0.57548076", "0.5745335", "0.5680434", "0.56666565", "0.5645026", "0.5519073", "0.55119044", "0.55071795", "0.5495186", "0.5470808", "0.5462526", "0.54478...
0.0
-1
POST /attention_centers POST /attention_centers.json
def create @attention_center = AttentionCenter.new(attention_center_params) respond_to do |format| if @attention_center.save format.html { redirect_to @attention_center, notice: 'Attention center was successfully created.' } format.json { render :show, status: :created, location: @attenti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @attention_centers = AttentionCenter.all\n end", "def attention_center_params\n params.require(:attention_center).permit(:code, :name, :place, :capacity, :center_type)\n end", "def create\n respond_to do |format|\n @center = Center.new(center_params)\n if @center.save\n ...
[ "0.6597174", "0.64631903", "0.6046579", "0.59624", "0.5960125", "0.5937983", "0.5815831", "0.5659441", "0.5622279", "0.5619247", "0.55832803", "0.555594", "0.5554436", "0.5518261", "0.5477735", "0.54031205", "0.53733444", "0.5369571", "0.53255945", "0.53056353", "0.5305102", ...
0.72039604
0
PATCH/PUT /attention_centers/1 PATCH/PUT /attention_centers/1.json
def update respond_to do |format| if @attention_center.update(attention_center_params) format.html { redirect_to @attention_center, notice: 'Attention center was successfully updated.' } format.json { render :show, status: :ok, location: @attention_center } else format.html { ren...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @attention.update(attention_params)\n format.html { redirect_to @attention, notice: 'Attention was successfully updated.' }\n format.json { render :show, status: :ok, location: @attention }\n else\n format.html { render :edit }\n for...
[ "0.6259019", "0.6214799", "0.6162037", "0.6122546", "0.6071579", "0.60692906", "0.6062794", "0.60350925", "0.59481096", "0.58477205", "0.58390176", "0.58155376", "0.58127564", "0.58014333", "0.57801336", "0.57750386", "0.57503194", "0.57375765", "0.57350093", "0.5727708", "0....
0.72710896
0
DELETE /attention_centers/1 DELETE /attention_centers/1.json
def destroy @attention_center.destroy respond_to do |format| format.html { redirect_to attention_centers_url, notice: 'Attention center was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @attention.destroy\n respond_to do |format|\n format.html { redirect_to attentions_url, notice: 'Attention was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @attention.destroy\n respond_to do |format|\n format.html { redire...
[ "0.7053487", "0.7053487", "0.6876657", "0.68164235", "0.67600435", "0.67563117", "0.6711229", "0.66904974", "0.6665749", "0.66605026", "0.6642485", "0.66406107", "0.6623645", "0.6617271", "0.6565379", "0.65589786", "0.65393263", "0.65244853", "0.6517431", "0.6514664", "0.6510...
0.77901
0
Use callbacks to share common setup or constraints between actions.
def set_attention_center @attention_center = AttentionCenter.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 attention_center_params params.require(:attention_center).permit(:code, :name, :place, :capacity, :center_type) 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.6980629", "0.67819995", "0.67467666", "0.67419875", "0.67347664", "0.65928614", "0.6504013", "0.6498014", "0.64819515", "0.64797956", "0.64562726", "0.64400834", "0.6380117", "0.6377456", "0.63656694", "0.6320543", "0.63002014", "0.62997127", "0.629425", "0.6293866", "0.62...
0.0
-1
Return an array of historic trading values based on a start and finish
def historic_trading_by_range(region, start, finish) region = AEMO::Region.new(region) if region.is_a?(String) required_data = [] (start..finish).map { |d| { year: d.year, month: d.month } } .uniq.each do |period| required_data += historic_trading(region, period...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def historical_values(end_time, history_length, unit = DEFAULT_UNIT)\n unit = :hour if (1.send(unit) / 1.hours) < 1\n finish_time = unit == :hour ? floor_hour(end_time) : end_time.midnight\n hours = 1.send(unit) / 1.hours\n (0..(history_length-1)).map{|i| finish_time - i.send(unit)}.reverse.map...
[ "0.6654632", "0.6053329", "0.5948154", "0.5948154", "0.5812933", "0.57502776", "0.5732537", "0.5720517", "0.56528205", "0.5634415", "0.5625411", "0.56220424", "0.5609448", "0.5605884", "0.56016326", "0.55840015", "0.55654037", "0.5550402", "0.5540874", "0.5524703", "0.5515561...
0.76039916
0
Return an array of historic trading values for a Year, Month and Region As per the historical data from AEMO
def historic_trading(region, year, month) region = AEMO::Region.new(region) if region.is_a?(String) month = Kernel.format('%02d', month) url = 'https://aemo.com.au/aemo/data/nem/priceanddemand/' \ "PRICE_AND_DEMAND_#{year}#{month}_#{region}1.csv" response = HTTParty.get(u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def historic_trading_by_range(region, start, finish)\n region = AEMO::Region.new(region) if region.is_a?(String)\n\n required_data = []\n (start..finish).map { |d| { year: d.year, month: d.month } }\n .uniq.each do |period|\n required_data += historic_trading(reg...
[ "0.70347434", "0.6475102", "0.58445853", "0.5727892", "0.5720813", "0.56856877", "0.5666964", "0.55862665", "0.5550863", "0.5541358", "0.55193967", "0.5512884", "0.5477064", "0.5461932", "0.5439205", "0.5439205", "0.5426756", "0.540033", "0.53876865", "0.537158", "0.53704244"...
0.7651269
0
GET /digital_objects/1 GET /digital_objects/1.json
def show render json: { digital_object: @digital_object } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def digital_objects\n digital_objects_field = fetch('digital_objects_ssm', []).reject(&:empty?)\n return [] if digital_objects_field.blank?\n\n digital_objects_field.map do |object|\n DigitalObject.from_json(object)\n end\n end", "def call_digital_object_api(archival_object, actionable_urn, act...
[ "0.7199482", "0.6542423", "0.64362216", "0.6287824", "0.6272402", "0.6193185", "0.6167995", "0.60372084", "0.6021821", "0.5997328", "0.5978642", "0.5974395", "0.58471", "0.58443", "0.5787945", "0.5761857", "0.57380813", "0.5685125", "0.5679975", "0.5652222", "0.56327486", "...
0.72749096
0
GET /subcategoria GET /subcategoria.json
def index @subcategoria = Subcategorium.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_subcategories\r\n sub_categories = Taxonomy.get_subcategories\r\n render json: sub_categories, root: 'categories', adapter: :json, status: :ok\r\n end", "def show\n @subcategoria = Subcategoria.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json...
[ "0.79706407", "0.7589479", "0.7340915", "0.7177562", "0.70955664", "0.70955664", "0.70624113", "0.69309163", "0.6930482", "0.68655866", "0.6820049", "0.67710423", "0.6705785", "0.67015475", "0.6693339", "0.65554094", "0.6550407", "0.6542479", "0.6539902", "0.6539902", "0.6535...
0.7273133
3
GET /subcategoria/1 GET /subcategoria/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @subcategoria = Subcategoria.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @subcategoria }\n end\n end", "def get_subcategories\r\n sub_categories = Taxonomy.get_subcategories\r\n render json: sub_categories, root: ...
[ "0.7800588", "0.7761", "0.75541794", "0.73963964", "0.72559166", "0.71511036", "0.7099225", "0.69893867", "0.694048", "0.694048", "0.6838237", "0.6834955", "0.68317556", "0.6757964", "0.672871", "0.6710086", "0.6694382", "0.66759217", "0.6668347", "0.6661512", "0.664596", "...
0.0
-1
POST /subcategoria POST /subcategoria.json
def create @subcategorium = Subcategorium.new(subcategorium_params) respond_to do |format| if @subcategorium.save format.html { redirect_to @subcategorium, notice: 'Subcategorium was successfully created.' } format.json { render :show, status: :created, location: @subcategorium } el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @subcategoria = Subcategoria.new(params[:subcategoria])\n\n respond_to do |format|\n if @subcategoria.save\n format.html { redirect_to [:admin, @subcategoria], :notice => 'Subcategorias was successfully created.' }\n format.json { render :json => @subcategoria, :status => :cre...
[ "0.76835424", "0.7096991", "0.7038747", "0.6948298", "0.6852623", "0.67624116", "0.6761055", "0.67274624", "0.6624717", "0.661913", "0.6617904", "0.6574716", "0.6540989", "0.65004945", "0.64875036", "0.646536", "0.6452022", "0.64366394", "0.64366394", "0.63494116", "0.6299981...
0.71382916
1
PATCH/PUT /subcategoria/1 PATCH/PUT /subcategoria/1.json
def update respond_to do |format| if @subcategorium.update(subcategorium_params) format.html { redirect_to @subcategorium, notice: 'Subcategorium was successfully updated.' } format.json { render :show, status: :ok, location: @subcategorium } else format.html { render :edit } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @subcategoria = Subcategoria.find(params[:id])\n\n respond_to do |format|\n if @subcategoria.update_attributes(params[:subcategoria])\n format.html { redirect_to [:admin, @subcategoria], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n ...
[ "0.75229865", "0.6952139", "0.68850815", "0.6763188", "0.6703223", "0.6685678", "0.66583085", "0.665562", "0.66246957", "0.6602675", "0.65400875", "0.6507519", "0.65005565", "0.64974433", "0.64875096", "0.64816713", "0.6469218", "0.6446891", "0.6437276", "0.6423055", "0.63966...
0.685722
3
DELETE /subcategoria/1 DELETE /subcategoria/1.json
def destroy @subcategorium.destroy respond_to do |format| format.html { redirect_to subcategoria_url, notice: 'Subcategorium was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @subcategoria = Subcategoria.find(params[:id])\n @subcategoria.update_attributes :status => Status.find_by_descricao('Inativo')\n\n respond_to do |format|\n format.html { redirect_to admin_subcategorias_path }\n format.json { head :ok }\n end\n end", "def destroy\n @subcat...
[ "0.7688465", "0.75142336", "0.7302029", "0.72326636", "0.72138554", "0.7165999", "0.7157791", "0.71560425", "0.71479183", "0.71280384", "0.70687354", "0.7038668", "0.70225585", "0.70201087", "0.69896144", "0.69896144", "0.6958727", "0.6957559", "0.68998367", "0.68974483", "0....
0.7721558
0
Use callbacks to share common setup or constraints between actions.
def set_subcategorium @subcategorium = Subcategorium.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 subcategorium_params params.require(:subcategorium).permit(:nombre, :categorias_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
know if self is followed by model Example:
def follower?(model, relation = "follow") self.followers.where(follower_type: model.class.name, :follower_id => model.id, relation: relation).exists? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def followed?(model)\n model.follower_ids.include?(self.id)\n end", "def follow(model)\n unless self.followed?(model)\n model.before_followed_by(self) if model.respond_to?('before_followed_by')\n model.follows.create!(follower: self)\n model.followers << self\n model.inc(...
[ "0.6117002", "0.5972158", "0.59578127", "0.5929285", "0.5878258", "0.58662504", "0.583668", "0.5773405", "0.5593441", "0.5568962", "0.5532568", "0.55254734", "0.552472", "0.55080485", "0.54785645", "0.54785645", "0.54563445", "0.545604", "0.53998244", "0.53634614", "0.5356155...
0.58484
6