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
finds the lowest prime factor of n and returns that factor and the dividend in a hash
def first_prime_factor(n) if factor = first_primes.find { |p| n % p == 0 } { :factor => factor, :dividend => n / factor } else { :factor => n, :dividend => 1 } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_min_prime_factor (n)\n # Find the minimum prime factor from 2 to √n.\n # If no element does, return nil.\n 2.upto(Math.sqrt(n)).lazy.select { |i| (n % i).zero? }.first\nend", "def larget_prime_factor(n)\n temp = n\n largest = 0\n div = 2\n\n while temp >= div * div\n if temp % div == 0\n ...
[ "0.75268126", "0.7417357", "0.73548204", "0.7313275", "0.72570354", "0.72387403", "0.7228344", "0.7222027", "0.72064406", "0.7185144", "0.7184545", "0.7125075", "0.71217424", "0.70828617", "0.7071668", "0.70570964", "0.7056092", "0.70389515", "0.7007971", "0.6996036", "0.6971...
0.7937877
0
2. In order to keep yourself organized, sort your zombie_apocalypse_supplies in alphabetical order. Do not use any special builtin methods.
def runs_pass(input) input.map! do |item| item.downcase end corrections_made = false (input.length - 1).times do |index| if input[index] > input[index+1] corrections_made = true val_0 = input[index] val_1 = input[index + 1] input[index] = val_1 input[index + 1] = val_0 en...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_zombies\n index = 0\n while index < @zombie_apocalypse_supplies.length\n index2 = index + 1\n while index2 < @zombie_apocalypse_supplies.length\n if @zombie_apocalypse_supplies[index2] < @zombie_apocalypse_supplies[index]\n @zombie_apocalypse_supplies[index], @zombie_apocalypse_supplies[index2] = ...
[ "0.679815", "0.6730806", "0.665094", "0.656551", "0.6388091", "0.6244115", "0.61922073", "0.61689585", "0.6153145", "0.6115795", "0.61000675", "0.60666364", "0.60550064", "0.605267", "0.60155755", "0.6012719", "0.6008296", "0.5994361", "0.5990724", "0.5979311", "0.59527576", ...
0.0
-1
3. Create a method to see if a particular item (string) is in the zombie_apocalypse_supplies. Do not use any special builtin methods. For instance: are boots in your list of supplies? Define a method that iterates over an array, and checks if each item is equal to a particular string. Returns true if the item exists in...
def search_array(array_list, particular_string) array_list.each do |item| if item == particular_string return true end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_item(string)\n zombie_apocalypse_supplies = [\"hatchet\", \"rations\", \"water jug\", \"binoculars\",\n \"shotgun\", \"compass\", \"CB radio\", \"batteries\"]\n\n i = 0\n is_supply = false\n\n while i < zombie_apocalypse_supplies.length\n if zombie_apocalypse_supplies[...
[ "0.7719772", "0.7560946", "0.75596553", "0.73909456", "0.7234053", "0.7028437", "0.7017083", "0.6367569", "0.6290596", "0.62241256", "0.6206075", "0.6185368", "0.61630833", "0.6084735", "0.6070218", "0.606855", "0.60675275", "0.60643417", "0.60549283", "0.6043593", "0.6002791...
0.5733171
53
Return the current account
def current_account @current_account end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_account\n load_session\n @current_account\n end", "def current_account\n Account.find(session[:account_id]) if session[:account_id]\n end", "def current_account\n Account.find(session[:account_id]) if session[:account_id]\n end", "def current_user\n current_account...
[ "0.867234", "0.8382236", "0.8382236", "0.8359867", "0.82969916", "0.82937926", "0.82862765", "0.8239908", "0.8221975", "0.8207374", "0.82066035", "0.8194237", "0.81896985", "0.8165017", "0.81503695", "0.81420195", "0.8096096", "0.80920064", "0.80727637", "0.7970901", "0.78668...
0.8781393
0
Return the current useraccount membership
def current_membership @current_membership end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_user_membership\n space_membership\n end", "def get_current_account_and_membership\n if !@current_membership || !@current_account\n account_id = params[:account_id]\n authenticate_user! unless current_user\n @current_membership = Landlord::Membership.find_by(user_id: cur...
[ "0.7518775", "0.721587", "0.71362066", "0.68495166", "0.68003064", "0.66826284", "0.66826284", "0.66486454", "0.66383255", "0.6628744", "0.66233313", "0.66108984", "0.6576923", "0.65385777", "0.649854", "0.6461155", "0.6378361", "0.63717705", "0.63459927", "0.6344719", "0.632...
0.75072205
1
Require a current account and user membership
def require_account get_current_account_and_membership return user_not_authorized unless @current_account end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def require_account_owner\n get_current_account_and_membership\n return user_not_authorized unless @current_account\n\n if @current_membership && !@current_membership.owner?\n redirect_to account_path(@current_account)\n end\n end", "def require_active_account\n get_current_account_and_membe...
[ "0.7066654", "0.6761174", "0.67164135", "0.6618951", "0.66135436", "0.6548479", "0.6494021", "0.64836067", "0.64385587", "0.64191204", "0.6400973", "0.6398904", "0.6385256", "0.6382755", "0.6371471", "0.6370612", "0.6359959", "0.63599396", "0.6358384", "0.6351949", "0.6339604...
0.80757064
0
Require a current active account and user membership
def require_active_account get_current_account_and_membership return user_not_authorized unless @current_account if @current_account.billing_error? if @current_membership.owner? redirect_to account_billing_path(@current_account), alert: 'Your account is past due. Please enter payment details ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def require_account\n get_current_account_and_membership\n return user_not_authorized unless @current_account\n end", "def require_account_owner\n get_current_account_and_membership\n return user_not_authorized unless @current_account\n\n if @current_membership && !@current_membership.owner?\n ...
[ "0.78914434", "0.69789785", "0.69599104", "0.6743651", "0.6544153", "0.65035796", "0.6499469", "0.6472633", "0.63642895", "0.6356882", "0.6301948", "0.6274428", "0.62713194", "0.6251983", "0.6231822", "0.6220241", "0.62107533", "0.62073976", "0.6201409", "0.6184592", "0.61715...
0.7394895
1
Require a current account, and require that the current user owns it
def require_account_owner get_current_account_and_membership return user_not_authorized unless @current_account if @current_membership && !@current_membership.owner? redirect_to account_path(@current_account) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def require_account\n get_current_account_and_membership\n return user_not_authorized unless @current_account\n end", "def require_ownership\n\t\tunless current_user\n\t\t\tredirect_to login_path\n\t\tend\n\tend", "def require_active_account\n get_current_account_and_membership\n return user_not_a...
[ "0.8170411", "0.7483639", "0.7428225", "0.7122641", "0.69648373", "0.69242334", "0.69051695", "0.67837983", "0.667955", "0.66723174", "0.6621441", "0.6591704", "0.65384007", "0.65311146", "0.64626086", "0.6452147", "0.64519805", "0.64509743", "0.64321715", "0.6399615", "0.638...
0.8007474
1
Get the current account and user membership
def get_current_account_and_membership if !@current_membership || !@current_account account_id = params[:account_id] authenticate_user! unless current_user @current_membership = Landlord::Membership.find_by(user_id: current_user.id, account_id: account_id) if account_id @current_ac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_membership\n @current_membership\n end", "def current_user_membership\n space_membership\n end", "def current_user\n authentication.account\n end", "def current_account\n @current_account\n end", "def current_user\n current_account\n end", "def current_account\n ...
[ "0.7067306", "0.70592666", "0.70196146", "0.6982262", "0.69814473", "0.69468755", "0.68834543", "0.68426704", "0.67590654", "0.6712854", "0.66851884", "0.6672146", "0.6672146", "0.66663116", "0.6643167", "0.6591143", "0.65803325", "0.6577173", "0.6544291", "0.6522781", "0.650...
0.80154586
0
Returns a string containing this user's first name and last name
def full_name "#{first_name} #{last_name}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name\n if first_name.present? || last_name.present?\n [first_name, last_name].join(\" \").strip\n else\n username\n end\n end", "def user_full_name\n first_name + \" \" + last_name\n end", "def full_name\n if user_data\n \"#{user_data['first_name']&.downcase&.cap...
[ "0.85857236", "0.8380011", "0.8375095", "0.82984203", "0.82834274", "0.8279718", "0.82276964", "0.81935614", "0.8136241", "0.8109481", "0.8075295", "0.80506283", "0.8028242", "0.8000852", "0.8000852", "0.7996801", "0.7990294", "0.7985008", "0.7982472", "0.79586166", "0.795284...
0.0
-1
Returns all posts from this user's friends and self
def friends_and_own_posts myfriends = friends our_posts = [] myfriends.each do |f| f.posts.each do |p| our_posts << p end end posts.each do |p| our_posts << p end our_posts end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def friends_posts\r\n\t\tPost.where(user_id: [Friendship.where(user_id: id).map{|f| f.friend_id}])\r\n\tend", "def index\n @all_posts = [] + current_user.posts\n current_user.friends.each { |friend| friend.posts.each { |post| @all_posts.push post } }\n @posts = @all_posts\n puts @posts.inspect\n end...
[ "0.81106234", "0.76203144", "0.7614495", "0.74785244", "0.7425504", "0.732361", "0.72728723", "0.72355735", "0.71402574", "0.71256334", "0.70646185", "0.7058468", "0.6895628", "0.687204", "0.68386936", "0.68365574", "0.68365574", "0.6808631", "0.67593837", "0.674353", "0.6696...
0.7684348
1
Validates the size of an uploaded picture.
def picture_size #errors.add(:image, 'should be less than 1MB') if image.size > 1.megabytes end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def picture_size\n if picture.size > 5.megabytes\n errors.add(:picture, \"should be less than 5MB\")\n end\n end", "def picture_size\n if picture.size > 5.megabytes\n errors.add(:picture, \"should be less than 5MB\")\n end\n end", "def picture_size\n errors.add(:pictu...
[ "0.8246438", "0.8246069", "0.8203719", "0.8203224", "0.8199266", "0.8188133", "0.8187386", "0.8179088", "0.81592035", "0.81588674", "0.8158672", "0.81494313", "0.81494313", "0.81494313", "0.81494313", "0.81494313", "0.81494313", "0.81494313", "0.81494313", "0.81494313", "0.81...
0.8086152
25
This is the constructor for the MovieNode class.
def initialize(name, box_office = nil, year = nil, adjacency_list = []) @name = name @box_office = box_office @year = year @adjacency_list = adjacency_list end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def movie_initializer\r\n new_movie = Movie.new\r\n end", "def initialize(node)\n @node = node\n end", "def initialize( node )\n @node = node\n end", "def initialize(node:)\n @node = node\n end", "def initialize(node)\n @bitrate = (node / \"bitrate\").text\n @duration = (n...
[ "0.6459482", "0.64392114", "0.63931304", "0.6368139", "0.6312933", "0.6309956", "0.6309956", "0.6309956", "0.6309956", "0.62957346", "0.62957346", "0.62520134", "0.6251621", "0.6251621", "0.62396944", "0.62064296", "0.6185481", "0.61603814", "0.61527765", "0.6127501", "0.6126...
0.0
-1
This converts the node to a hash.
def to_hash { name: @name, box_office: @box_office, year: @year, adjacency_list: @adjacency_list } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash\n node_id.hash\n end", "def node_hash(node_id)\n \n end", "def hash # Hack for Ruby 1.8.6\n @node.id.hash ^ self.class.hash\n end", "def node_to_hash(node)\n puts \"You must define a `node_to_hash` method in your child class to parse the Nokogiri nodes\"\n end", "de...
[ "0.770562", "0.74160385", "0.7357649", "0.7130249", "0.7074411", "0.7006441", "0.69501686", "0.6917111", "0.68813366", "0.68551207", "0.6804467", "0.67406404", "0.6740176", "0.6712918", "0.66963446", "0.66905177", "0.6617243", "0.6604243", "0.65348196", "0.65348196", "0.65348...
0.0
-1
Initialize new request object
def initialize(request) @req = request @version = @req[:version] @session = parse_session unless @type == :audio_player @context = parse_context unless @req[:context].nil? @id = nil @timestamp = nil @locale = nil parse_base_params(@req[:request]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(request)\n @request = request\n end", "def new\n @request = Request.new\n end", "def initialize(initial_params = {})\n raise \"Cannot directly instantiate a #{self.class}.\" if\n self.class == Request\n @params = initial_params\n end", "def post_init\n...
[ "0.8027148", "0.79955894", "0.7879021", "0.7634993", "0.7591413", "0.7588808", "0.7531158", "0.7495769", "0.7428573", "0.741174", "0.7408069", "0.73773223", "0.7371157", "0.73644793", "0.7285804", "0.72657245", "0.7238449", "0.7217902", "0.7200914", "0.7144505", "0.7131535", ...
0.6766147
50
Check if it is a valid Amazon request
def valid? validator = Validator.new(certificates_chain_url, signature, @req) validator.valid_request? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_AmazonMarketplace_request?(request_hash)\n hash = request_hash.symbolize_keys\n signature = hash.delete(:signature) || ''\n AmazonMarketplace::SignatureUtils.authentic?(hash, signature)\n end", "def valid?\n utils = Amazon::FPS::SignatureUtilsForOutbound.new(@access_...
[ "0.7354387", "0.69724756", "0.65813106", "0.64933234", "0.64166635", "0.6378661", "0.6307512", "0.6215964", "0.61243975", "0.6113884", "0.61065894", "0.60111254", "0.60111254", "0.59901077", "0.5964179", "0.59239525", "0.58543015", "0.5800851", "0.58004636", "0.5775469", "0.5...
0.5925779
15
Return JSON representation of given request
def json Oj.to_json(@req) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_json(*_args)\n @request.to_json\n end", "def to_json(*_args)\n @request.to_json\n end", "def to_json\n request.clone.to_json\n end", "def to_json\n @request.perform\n end", "def paper_request_json(input)\n Value::PaperRequest.new(input...
[ "0.77788275", "0.77788275", "0.72264504", "0.7108525", "0.6918197", "0.6831", "0.6767322", "0.6720847", "0.6687441", "0.66473705", "0.6619696", "0.6619696", "0.6518748", "0.647388", "0.6428244", "0.6424322", "0.6406251", "0.6361311", "0.6351221", "0.6351221", "0.63356686", ...
0.7622886
2
Build a request context object
def parse_context Context.new(@req[:context]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request_context(request)\n @request_context ||= Request.retriever_for_request(request)&.call\n end", "def create_request_context path, params, data=nil, opts={}\n url = build_url path, params\n full_url = prepend_base url\n context = {:path => path, :url => full_url, :params => params, :quer...
[ "0.7418889", "0.70794666", "0.69709206", "0.66481215", "0.65386426", "0.6379136", "0.63196737", "0.63174236", "0.631158", "0.62935865", "0.62885284", "0.6285475", "0.6216347", "0.6206785", "0.6141408", "0.60924286", "0.6003924", "0.59994775", "0.59951955", "0.5963934", "0.595...
0.66348857
4
get_ methods are automatically detected as possible metadata properties this plugin can fill. The property name filled by such method is given by the method's name: get_my_property will fill the :my_property metadata. The method get_others is used specifically to return properties whose name is unknown before fetching ...
def property_dependencies { host_keys: %i[hostname host_ip] } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def properties\n decorate_with_methods(read_attribute(:properties))\n end", "def properties_get(opts = {})\n data, _status_code, _headers = properties_get_with_http_info(opts)\n return data\n end", "def get_properties\n instance_methods.each_with_object([]) { |key, acc| acc << k...
[ "0.6137491", "0.6045409", "0.5987218", "0.5929459", "0.5929459", "0.59057975", "0.5904911", "0.5821407", "0.58035135", "0.5782626", "0.5766095", "0.57435066", "0.5706469", "0.5699358", "0.5670164", "0.56647605", "0.5660711", "0.5660711", "0.5660711", "0.5660711", "0.565692", ...
0.0
-1
Get a specific property for a given set of nodes.
def get_host_keys(_nodes, metadata) updated_metadata = {} # Get the list of nodes, per hostname (just in case several nodes share the same hostname) # Hash<String, Array<String> > hostnames = Hash.new { |hash, key| hash[key] = [] } metadata.each do |node, node_metadata|...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_property!(node, name)\n value = node.xpath(name).text\n raise \"missing property '#{name}' in node: #{node}\" if value.empty?\n value\n end", "def get_property(node, name)\n node.xpath(name).text\n end", "def get_property(prop)\r\n prop = URI.parse(prop) unless ...
[ "0.6640873", "0.66138035", "0.6349521", "0.62225103", "0.6019771", "0.5957624", "0.59467894", "0.5935073", "0.5858492", "0.5851378", "0.5840351", "0.57447684", "0.5743132", "0.5709641", "0.5683587", "0.568273", "0.56745034", "0.566736", "0.563507", "0.56124777", "0.56045467",...
0.0
-1
Discover the host keys associated to a list of hosts. Parameters:: hosts (Array): The hosts to check for Result:: Hash >: The corresponding host keys, per host name
def host_keys_for(*hosts) results = {} log_debug "Get host keys of #{hosts.size} hosts..." for_each_element_in( hosts, parallel: true, nbr_threads_max: MAX_THREADS_SSH_KEY_SCAN, progress: log_debug? ? 'Gather host keys' : nil ) do |...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_host_keys(_nodes, metadata)\n updated_metadata = {}\n # Get the list of nodes, per hostname (just in case several nodes share the same hostname)\n # Hash<String, Array<String> >\n hostnames = Hash.new { |hash, key| hash[key] = [] }\n metadata.each do |node, node...
[ "0.7010076", "0.6519172", "0.6465215", "0.64049375", "0.62742233", "0.6152927", "0.61525685", "0.6152293", "0.60267967", "0.5945095", "0.59006613", "0.58878976", "0.5877657", "0.58608174", "0.5839294", "0.5815761", "0.5790457", "0.571605", "0.5697684", "0.568382", "0.56769675...
0.8399703
0
Instance method to return the full name of the author an instance belongs to, so that we don't have to have as much code in our views.
def author_full_name self.author.full_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def author_name\n if self.author\n self.author.name\n else\n nil\n end\n end", "def getAuthorName\n\t\treturn User.find(self.user_id).username\n\tend", "def author\n return User.find(self.user_id).user_name\n end", "def author_name\n self.author.name if author \n end", "def aut...
[ "0.84701186", "0.8381216", "0.8351683", "0.8245533", "0.82347506", "0.82143724", "0.8165476", "0.815929", "0.80744475", "0.80608946", "0.8036731", "0.803341", "0.79679906", "0.79679906", "0.7941502", "0.78952134", "0.78034484", "0.77906156", "0.77854323", "0.77458215", "0.774...
0.83832276
1
Use callbacks to share common setup or constraints between actions.
def set_user @user = User.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Only allow a trusted parameter "white list" through.
def user_params params.require(:user).permit(:userEmail, :userPhoneNumber, :userName, :lastName, :userDate, :freeShmeals, menuitems: [:mealName, :userID, :menuItemDate]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", ...
[ "0.7120904", "0.70538116", "0.69469863", "0.6901261", "0.67348766", "0.6717708", "0.66874576", "0.6676195", "0.66601187", "0.65563625", "0.6525127", "0.64565873", "0.64494514", "0.644928", "0.64452374", "0.6433947", "0.6412815", "0.6412815", "0.6391939", "0.63792473", "0.6379...
0.0
-1
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Initialize a new 2D maze with the given width and height. Default seed value will give "random" behavior. Usersupplied seed value will give "deterministic behavior. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
def initialize( w=DEFAULT_WIDTH, h=DEFAULT_HEIGHT, s=DEFAULT_SEED ) @width = w @height = h @seed = s srand(@seed) @grid = Array.new(h) { Array.new(w,0) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(width, height)\n @grid = Array.new(height) { Array.new(width) }\n create_maze(0, 0, 3)\n end", "def initialize(options = {})\n @width = (options[:width] || 10).to_i\n @height = (options[:height] || @width).to_i\n @seed = (options[:seed] || rand(0xFFFF_FFFF)).to_i\n @grid...
[ "0.7020565", "0.69973075", "0.6772718", "0.6763071", "0.6649502", "0.66487896", "0.6632382", "0.6334554", "0.6325998", "0.631875", "0.6185068", "0.61392444", "0.61091554", "0.610465", "0.6062848", "0.60615", "0.60611784", "0.6041827", "0.6041052", "0.60138595", "0.5991732", ...
0.61078256
14
+++++++++++++++++++++++++++++++++++++++++++++++++++++++ Draw the grid, starting in the upperleft hand corner. +++++++++++++++++++++++++++++++++++++++++++++++++++++++
def draw # # Draw the "top" line. # puts " " + "_" * (@width * 2 - 1) # # Draw each of the rows. # @height.times do |y| print "|" @width.times do |x| # render "bottom" using "S" switch print( (@grid[y][x] & @@S != 0) ? " " : "_" ) # render "side" using "E" switch if @grid[y...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_grid\n print_cap\n (0...@vertical).each do |vert_index|\n (0..@v_size).each do |block_height|\n (0...@horizontal).each do |horizontal_index|\n if block_height == (@v_size/2)\n print \"|\" + \" \"*(@h_size/2)\n \"#{print @contents[horizontal_in...
[ "0.7916472", "0.7450136", "0.7443763", "0.7387318", "0.73456913", "0.730984", "0.7300191", "0.7259425", "0.7144599", "0.7138436", "0.71056086", "0.7096572", "0.7090665", "0.7042555", "0.69667536", "0.6919772", "0.6899661", "0.68962663", "0.68935144", "0.6893095", "0.6889548",...
0.71143824
10
++++++++++++++++++++++++++++++ Output generic maze metadata. ++++++++++++++++++++++++++++++
def metadata "#{$0} #{@width} #{@height} #{@seed}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_and_print_simple_file(file)\n\n line = file.gets\n if line == nil then return end\n \n # read 1st line, must be maze header\n sz, sx, sy, ex, ey = line.split(/\\s/)\n puts \"+-\" * Integer(sz) + \"+\";\n counter = 0\n bottom = \"+\"\n maze = Maze.new(sz,sx,sy,ex,ey)\n maze.initMaze(file)\n xC...
[ "0.60588557", "0.60472983", "0.60472983", "0.5823733", "0.5732401", "0.5716289", "0.5669657", "0.5657651", "0.56491786", "0.5631224", "0.5612229", "0.5612229", "0.5612229", "0.5612229", "0.5612229", "0.5612229", "0.5612229", "0.5574359", "0.5562239", "0.55181015", "0.54634607...
0.60914946
0
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Walk down the maze, cellbycell, carving a maze using the binary tree algorithm. Because we walk down the maze, cellbycell, in a linear fashion, this algorithm is amenable to animation. Animated version is implemented in the overridden dr...
def carve_passages @height.times do |y| @width.times do |x| # # Render updates of the maze on a "cell-by-cell" basis # if @animate display(x,y) sleep @delay end dirs = [] dirs << @@N if y > 0 dirs << @@W if x > 0 if ( dir = dirs[rand(dirs.length)] ) dx,dy = x ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solve_maze\n matrix = @maze[:matrix] # get matrix from maze hash\n exit_found = false # exit not found yet\n room = Room.new(@maze[:start_x], @maze[:start_y], nil) # create new room from start position\n queue = Queue.new # queue to store the current working node...
[ "0.6541505", "0.6297715", "0.6249027", "0.6247691", "0.6165773", "0.61620665", "0.6135506", "0.6135356", "0.6078852", "0.6076077", "0.6068673", "0.6032132", "0.60133135", "0.60061955", "0.59661365", "0.58907056", "0.588295", "0.58779496", "0.5876098", "0.5873971", "0.5808145"...
0.57497
24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Method only needs to be overridden if we are animated. If we are drawing the maze statically, defer to the superclass. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
def draw(update=false) if update or not @animate print "\e[H" if not @animate; print "\e[2J"; end super() else print "\e[2J" carve_passages end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw\n\n\t # \n\t # Clear the screen.\n\t #\n\t print \"\\e[2J\"\n\t if not @animate\n\t \n\t # \n\t\t# Move to upper left and defer to superclass\n\t\t#\t\t\n\t print \"\\e[H\"\n\t\tsuper()\n\t else\n\t\t#\n\t\t# If we are animating, clear the screen and start carving!\n\...
[ "0.72397953", "0.6705396", "0.6501508", "0.633965", "0.633965", "0.6255103", "0.6164024", "0.60871977", "0.6054346", "0.60402143", "0.5976627", "0.5920232", "0.5920232", "0.58646643", "0.5826775", "0.5816853", "0.5815633", "0.5815072", "0.580266", "0.5780719", "0.57799035", ...
0.5530302
46
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Display needs the (x,y) coordinates of where it is presently rendering, in order to color the "current cursor" cell a different color (in this case, red). We've already used the symbols "x" and "y" in a previous implementation of this a...
def display(i,j) # # Draw the "top" line # print "\e[H" puts " " + "_" * ( 2 * @width - 1) # # Step through the maze, one cell at a time # @height.times do |y| print "|" @width.times do |x| # # Color gray if empty, red if "current" cursor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display(i,j)\n \t print \"\\e[H\"\n\t puts \" \" + \"_\" * (@width * 2 - 1)\n\t \n\t @grid.each_with_index do |row,y|\n\t print \"|\"\n\t\t row.each_with_index do |cell,x|\n\t\t # \n\t\t\t # Color gray if empty, red if \"current\" cursor\n\t\t\t #\n\t\t\t if cell =...
[ "0.7160739", "0.6522927", "0.6331884", "0.6323098", "0.6263971", "0.6248166", "0.62480325", "0.6204907", "0.6138353", "0.6112473", "0.6112473", "0.6106079", "0.6039115", "0.6032869", "0.6025962", "0.6023858", "0.60232675", "0.6021561", "0.59844506", "0.59646714", "0.59556633"...
0.6361513
2
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Override metadata to inform what type of maze we are carving +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
def metadata super() + " [BinaryTree]" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def metadata; end", "def metadata; end", "def metadata; end", "def metadata; end", "def metadata; end", "def metadata; end", "def metadata; end", "def initialize(maze, meta={})\n @maze = maze\n @paths = Hash.new(0)\n @cells = Hash.new(0)\n @meta = meta\n end", "def type ; met...
[ "0.58311456", "0.58311456", "0.58311456", "0.58311456", "0.58311456", "0.58311456", "0.58311456", "0.5456248", "0.5390124", "0.5305186", "0.5159333", "0.51190674", "0.51082087", "0.50660807", "0.50338686", "0.50186616", "0.5002921", "0.49762917", "0.4965119", "0.49601865", "0...
0.5305498
9
GET /reviews GET /reviews.json
def index @reviews = Review.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @reviews = reviewable.reviews\n\n respond_to do |format|\n format.html\n format.json { render json: @reviews }\n end\n end", "def index\n @reviews = Review.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reviews }\n en...
[ "0.8128604", "0.76803666", "0.76803666", "0.76768506", "0.7594319", "0.7533078", "0.75313497", "0.75313497", "0.7528348", "0.7404546", "0.7360395", "0.7340902", "0.7319881", "0.73067623", "0.7281126", "0.72661823", "0.721507", "0.7189025", "0.7180426", "0.71802807", "0.710852...
0.7115584
30
GET /reviews/1 GET /reviews/1.json
def show @review = Review.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @reviews = reviewable.reviews\n\n respond_to do |format|\n format.html\n format.json { render json: @reviews }\n end\n end", "def index\n @reviews = Review.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reviews }\n en...
[ "0.7880492", "0.7516436", "0.7516436", "0.7505044", "0.73925704", "0.7352914", "0.7343858", "0.7342996", "0.73315644", "0.73315644", "0.728288", "0.7160869", "0.71298265", "0.71298265", "0.71298265", "0.71298265", "0.71298265", "0.7088055", "0.7069302", "0.7066715", "0.705522...
0.6665149
56
GET /reviews/new GET /reviews/new.json
def new @review = Review.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @new_review = NewReview.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_review }\n end\n end", "def new\n @review = Review.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @review }...
[ "0.81673604", "0.784093", "0.784093", "0.784093", "0.784093", "0.784093", "0.784093", "0.78267056", "0.77887195", "0.7446452", "0.72677046", "0.7107704", "0.7100102", "0.7100102", "0.70130605", "0.69590384", "0.6907051", "0.6907051", "0.6907051", "0.6898528", "0.6897657", "...
0.7013424
19
POST /reviews POST /reviews.json
def create pr = params[:review] review = Review.new if review.cadastrar(current_user, pr[:project_id], pr[:tipo], pr[:texto]) redirect_to project_path(review.project_id), :notice => 'Revisao Cadastrada Com Sucesso.' else flash[:error] = "Revisao Nao Cadastrada #{review.errors.messages}....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @review = current_author.reviews.create(review_params)\n render json: @review, status: 201\n end", "def create\n review = course.reviews.new(review_params)\n \n if review.save\n render json: ReviewSerializer.new(review).serialized_json\n else\n render...
[ "0.7576602", "0.75637454", "0.7493771", "0.747111", "0.747111", "0.747111", "0.7300367", "0.72989565", "0.7201945", "0.7201945", "0.71795744", "0.717838", "0.71406734", "0.7120858", "0.7118763", "0.7002209", "0.6988962", "0.6979939", "0.69722533", "0.69606304", "0.6958055", ...
0.0
-1
"Blesses" model object with client information
def bless_model(model) model.bless(self) if model end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(model, client = nil)\n @model = model\n @client = client\n end", "def initialize(model, client = nil)\n @model = model\n @client = client\n end", "def set_model\n @model = ClientService.find(params[:id])\n end", "def object_from_client(object, co...
[ "0.66312164", "0.66312164", "0.6237039", "0.61616665", "0.6118584", "0.5965743", "0.5922296", "0.5917769", "0.5897679", "0.589317", "0.5871051", "0.58554894", "0.58422875", "0.58294004", "0.58132255", "0.58042943", "0.5794605", "0.57903945", "0.57903945", "0.57903945", "0.579...
0.5953566
7
Removes the columns which represent the Money object Removes the two columns added by money. The money amount and the currency column. If there are no remaining money amount columns and a common currency column exists. then it is also removed
def remove_monetize(*column_names) column_names.each do |name| remove "#{name}_money" remove "#{name}_currency" end remove_currency unless has_money_columns? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_currency\n remove :currency\n money_columns do |money_column|\n column \"#{money_column}_currency\", \"string\"\n end\n end", "def remove_currency table_name, options={}\n remove_column table_name, :currency\n money_columns(table_name) do ...
[ "0.77999204", "0.6991338", "0.65278655", "0.5734943", "0.5398996", "0.5384424", "0.5244076", "0.52041084", "0.5199466", "0.5179057", "0.51556605", "0.51425606", "0.508505", "0.5055616", "0.4960999", "0.49246076", "0.4905847", "0.48998913", "0.48963904", "0.4858302", "0.482116...
0.7233383
1
Add a common currency column
def currency options = {} remove_currency_columns column :currency, :string, options end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_currency(currency)\n @change.add_currency(currency)\n end", "def add_table_price_column\n return if price_additional_currency.blank?\n price_column = 'price_' + price_additional_currency.downcase\n\n # Ensure the column price_XXXX exists in a history table\n CoinsHistory.ensure_fi...
[ "0.68812084", "0.68663776", "0.6730829", "0.65013736", "0.649366", "0.6482458", "0.6304222", "0.6304222", "0.6126449", "0.6126449", "0.60745656", "0.60745656", "0.6017412", "0.5905653", "0.58344847", "0.5776568", "0.57662266", "0.5755727", "0.57044935", "0.57015604", "0.56949...
0.6829866
2
Removes the common currency column Usually we create an currency column for each money columns. We can have multiple money columns in the same record, in which case we can have a single currency column. This helper removes that common curremcy column. For the existing money column it adds back their currency columns as...
def remove_currency remove :currency money_columns do |money_column| column "#{money_column}_currency", "string" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_currency table_name, options={}\n remove_column table_name, :currency\n money_columns(table_name) do |money_column|\n add_column table_name, \"#{money_column}_currency\", :string, options\n end\n end", "def remove_monetize(*column_names)\n column_n...
[ "0.75380975", "0.712924", "0.64004034", "0.59375983", "0.59375983", "0.56261045", "0.55361426", "0.5337181", "0.5246493", "0.5241447", "0.5241447", "0.5174624", "0.515601", "0.515601", "0.51335686", "0.5062821", "0.50341433", "0.49855885", "0.49688262", "0.49466088", "0.49068...
0.82563436
0
GET /lessons GET /lessons.xml
def index if @user @lessons = Lesson.view(@user.login, "lessons_by_author", {:author => @user.login}) else @lessons = [] end #This could be done within the users's branch.... @public_lessons = Lesson.view("master", "lessons_by_public") respond_to do |format| format.ht...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @lessons = Lesson.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @lessons }\n end\n end", "def index\n @lessons = current_user.organization.lessons.all\n\n respond_to do |format|\n format.html # index.html.erb\n format....
[ "0.7614941", "0.7436788", "0.67860043", "0.667213", "0.66620094", "0.6644565", "0.6644565", "0.6644565", "0.6644565", "0.6626902", "0.63257134", "0.6299166", "0.6291663", "0.6185604", "0.6176208", "0.6134992", "0.61129767", "0.6095444", "0.60835344", "0.60645705", "0.60403544...
0.64006877
10
GET /lessons/1 GET /lessons/1.xml
def show @branch = "master" @version = "HEAD" if @user && !params[:pub] @branch = @user.login end if params[:version] @version = params[:version] @lesson = Lesson.find(@branch, params[:id], params[:version]) else @lesson = Lesson.find(@branch, params[:id]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @lessons = Lesson.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @lessons }\n end\n end", "def index\n @lessons = current_user.organization.lessons.all\n\n respond_to do |format|\n format.html # index.html.erb\n format....
[ "0.7524934", "0.71440697", "0.69982904", "0.6617536", "0.65826476", "0.65436774", "0.651503", "0.6466071", "0.6466071", "0.6466071", "0.6466071", "0.6436428", "0.6387303", "0.63829553", "0.63501513", "0.6276717", "0.61620855", "0.6138304", "0.6132828", "0.61247313", "0.612250...
0.0
-1
GET /lessons/new GET /lessons/new.xml
def new if @user @lesson = Lesson.new(@user.login) else @lesson = nil end respond_to do |format| format.html # new.html.erb format.xml { render :xml => @lesson } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @lesson = Lesson.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lesson }\n end\n end", "def new\n @tutorials = Tutorials.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tutorials...
[ "0.7466328", "0.7082798", "0.6953619", "0.69174623", "0.6908872", "0.68506694", "0.68506694", "0.68506694", "0.6839078", "0.68335605", "0.6832434", "0.6817324", "0.6782419", "0.6782361", "0.6744521", "0.6718401", "0.6718401", "0.67111725", "0.6706269", "0.6686382", "0.6685205...
0.0
-1
POST /lesson POST /lesson.xml
def create if @user pub = false if params[:lesson][:public] == "1" pub = true end lesson = Lesson.save(@user.login, params[:lesson], pub) end if params[:form_type] redirect_to :controller => "ui", :action => :lesson_view, :id => lesson.attributes["_id"] else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @lesson = Lesson.new(params[:lesson])\n\n respond_to do |format|\n if @lesson.save\n format.html { redirect_to @lesson, notice: 'Lesson was successfully created.' }\n format.json { render json: @lesson, status: :created, location: @lesson }\n else\n format.html { r...
[ "0.70957786", "0.7026067", "0.7026067", "0.7026067", "0.6953013", "0.6918335", "0.6861296", "0.6808703", "0.68029344", "0.67262506", "0.66937727", "0.6693337", "0.66415393", "0.6632215", "0.6622177", "0.65288705", "0.6522294", "0.6414647", "0.63285875", "0.625017", "0.6238925...
0.6320432
19
PUT /lessons/1 PUT /lessons/1.xml
def update if @user @lesson = Lesson.find(@user.login, params[:id]) pub = false if params[:public] == "1" pub = true end @lesson = Lesson.save(@user.login, params[:lesson], pub) else @lesson = nil end respond_to do |format| flash[:notice] = 'less...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end", "def update\n @lesson = current_user.organization.lessons.find(params[:id])\n\n respond_to do |format|\n if @lesson.update_attributes(params[:lesson])\n flash[:no...
[ "0.6022954", "0.59576774", "0.5886994", "0.5872107", "0.5750412", "0.5624966", "0.55874395", "0.55212575", "0.54770863", "0.54765606", "0.5469926", "0.5445384", "0.5402295", "0.5400507", "0.5354723", "0.53460574", "0.5335959", "0.5276658", "0.5245534", "0.5245534", "0.5245534...
0.5288106
17
DELETE /lessons/1 DELETE /lessons/1.xml
def destroy if @user @lesson = Lesson.delete(@user.login, params[:id]) else @lesson = nil end respond_to do |format| format.html { redirect_to(:controller => "ui", :action => "home") } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @lesson = Lesson.find(params[:id])\n @lesson.destroy\n\n respond_to do |format|\n format.html { redirect_to(lessons_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @lesson = current_user.organization.lessons.find(params[:id])\n @lesson.destroy\n\n resp...
[ "0.7211881", "0.71481925", "0.67306405", "0.6663372", "0.6663372", "0.6584028", "0.6564889", "0.6496989", "0.64757127", "0.64753014", "0.64753014", "0.64594895", "0.6429487", "0.6426076", "0.64252335", "0.63975483", "0.6383382", "0.6382368", "0.6342693", "0.6335457", "0.63331...
0.6195179
41
that contains all of the values from the argument Array's. There should be no duplication of values in the returned Array, even if there are duplicares in the original Arrays. Example: merge([1, 3, 5], [3, 6, 9]) == [1, 3, 5, 6, 9] Given two array objects Initialize a new, empty array Iterate through each argument arra...
def merge(arr1, arr2) merged_array = [] arr1.each do |x| merged_array << x unless merged_array.include?(x) end arr2.each do |x| merged_array << x unless merged_array.include?(x) end merged_array end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge_array(input_array1, input_array2)\n\toutput_array = []\n\toutput_array = input_array1 + input_array2\n\treturn output_array.uniq\nend", "def merge(array_1, array_2)\n (array_1 + array_2).uniq\nend", "def merge(array_1, array_2)\n (array_1 + array_2).uniq\nend", "def merge(array1, array2)\n (arra...
[ "0.7337691", "0.72070795", "0.72070795", "0.71631175", "0.7053004", "0.7008907", "0.6977716", "0.69604117", "0.693748", "0.69242007", "0.69052744", "0.6904376", "0.6904376", "0.6900324", "0.6897409", "0.68791646", "0.68761295", "0.6863725", "0.6854463", "0.6844747", "0.683628...
0.6676867
38
Write a list of translations to filesystem Returns a hash of paths and the keys that have been written
def write_to_file keys init_translations_and_ignore_app_mode_file_dump if self.class.mode == :origin # Hash to capture the files updated on origin mode and the keys for each one result = {} keys.each do |key, value| # # Search the files where the translation will be applied to decide_f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save!\n FileUtils.mkdir_p File.dirname(self.file)\n\n File.open(self.file, \"w+\") do |f|\n f << %(#{self.namespace}.translations || (#{self.namespace}.translations = {});\\n)\n self.translations.each do |locale, translations_for_locale|\n f << %(#{self.namespace}.tra...
[ "0.62176347", "0.61906713", "0.60803497", "0.6069346", "0.59656304", "0.59280235", "0.5879037", "0.5877575", "0.56939703", "0.5648071", "0.56174695", "0.55969834", "0.55249244", "0.5491172", "0.54764485", "0.539968", "0.53779256", "0.5377726", "0.5342664", "0.53422344", "0.53...
0.7362603
0
Decide in which files the translations supplied will be saved
def decide_filenames key filenames = [] # Origin or developer mode, the translations will be applied to the original # file where those where setup, including plugin folders if self.class.mode == :origin filename, found_locale = get_translation_origin_filename(key) # If filename is outside r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save!\n if self.file =~ LOCALE_INTERPOLATOR\n I18n.available_locales.each do |locale|\n write_file(file_for_locale(locale), self.translations.slice(locale))\n end\n else\n write_file\n end\n end", "def save!\n FileUtils.mkdir_p File.dirna...
[ "0.69104457", "0.6726206", "0.66098505", "0.65430754", "0.65307987", "0.6490456", "0.64355683", "0.64065576", "0.63620555", "0.62524503", "0.61169827", "0.60704637", "0.60159165", "0.5930144", "0.5930144", "0.5906725", "0.58757234", "0.58574456", "0.58116937", "0.580847", "0....
0.67030096
2
We reset i18n load_path to avoid the application mode dump files
def init_translations_and_ignore_app_mode_file_dump # Get the current yaml file list sorted files = (I18n.load_path + Dir.glob(File.join("config", "locales", "**","*.{rb,yml}"))).uniq.sort # Avoid application mode file paths files -= I18n.available_locales.map{|l| application_mode_file_path(l)} file...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_i18n\n I18n.backend.class.send(:include, I18n::Backend::Pluralization)\n I18n.load_path.unshift(*locale_files)\n\n I18n.reload!\n end", "def load_translations\n super(@load_paths)\n end", "def load_translations\n super(@load_paths)\n end", "def init_i18n\n I18n.b...
[ "0.70971864", "0.70659333", "0.70659333", "0.69961977", "0.69073784", "0.6737836", "0.6703618", "0.66747254", "0.6588324", "0.65454984", "0.6486605", "0.6422381", "0.6295906", "0.6262855", "0.6230866", "0.61808896", "0.61340237", "0.6100075", "0.60746187", "0.60681623", "0.60...
0.7515528
0
Return a unique backup filename for this translation storage request It will contain all the translations requested
def log_file_path @translation_session ||= "#{Time.now.strftime("%Y-%m-%d-%H-%M-%S-%3N").parameterize}_#{rand(2**8)}" file_path = File.join(self.class.root_dir, "tmp", "locales", "log", locale.to_s, "#{@translation_session}.yml.backup") create_empty_translations_file(file_path) if !File.exists?(file_path) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_backup_file_name_with_generation(backup_options = nil, generation = 1)\n backup_options ||= @backup_options\n template = backup_options[:backup_file_name_template]\n file_name = backup_options[:backup_name]\n # The new backup is always 1\n file_number = generation\n ...
[ "0.6524159", "0.64446265", "0.6428307", "0.63547283", "0.632649", "0.61618125", "0.6159369", "0.60873586", "0.60655344", "0.60363126", "0.60322255", "0.5975984", "0.59680945", "0.5914698", "0.5808234", "0.58065796", "0.579242", "0.5734294", "0.56923664", "0.5687838", "0.56732...
0.55719054
25
Return a path to the dump file of the locale provided
def application_mode_file_path locale = locale File.join(Translate::Storage.root_dir, "config", "locales", "#{locale}.yml") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def locale_file_path(locale)\n \"config/locales/#{locale}.yml\"\n end", "def log_file_path\n @translation_session ||= \"#{Time.now.strftime(\"%Y-%m-%d-%H-%M-%S-%3N\").parameterize}_#{rand(2**8)}\"\n file_path = File.join(self.class.root_dir, \"tmp\", \"locales\", \"log\", locale.to_s, \"#{@tran...
[ "0.70543474", "0.6504013", "0.63553697", "0.6340335", "0.6130651", "0.61249334", "0.6123083", "0.6116637", "0.6078563", "0.6075877", "0.60754466", "0.60202366", "0.5992743", "0.5982457", "0.5951764", "0.59415466", "0.5863167", "0.58559716", "0.5825286", "0.57879096", "0.57825...
0.69072545
1
Main plugin action, called by Jekyllcore
def generate(site) @site = site @app_engine = source_config unless app_yaml_exists? unless @app_engine raise "App engine base configration not found" end @app_engine["handlers"] ||= {} write @site.keep_files ||= [] @site.keep_files << "app.y...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process\n # Check if plugin settings are set, if not, set a default or quit.\n #-------------------------------------------------------------------------\n \n self.config['exclude_from_localizations'] ||= []\n \n if ( !self.config['languages'] or\n self.config['languages'].em...
[ "0.658346", "0.65760946", "0.63315046", "0.63315046", "0.63315046", "0.63315046", "0.6237595", "0.62305754", "0.6122522", "0.6090735", "0.59496915", "0.5918766", "0.59173656", "0.5903042", "0.58927506", "0.5880997", "0.5875273", "0.58722043", "0.5871418", "0.5865877", "0.5826...
0.0
-1
Checks if a optional _app.yaml partial already exists
def source_partial_exists? if @site.respond_to?(:in_source_dir) File.exists? @site.in_source_dir("_app.yaml") else File.exists? Jekyll.sanitized_path(@site.source, "_app.yaml") end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def app_yaml_exists?\n if @site.respond_to?(:in_source_dir)\n File.exists? @site.in_source_dir(\"app.yaml\")\n else\n File.exists? Jekyll.sanitized_path(@site.source, \"app.yaml\")\n end\n end", "def check_config\n list = []\n %w(app_key secret_key endpoint).map do |...
[ "0.7191621", "0.61728376", "0.6083289", "0.60196203", "0.59345824", "0.5867654", "0.586587", "0.58471733", "0.5842081", "0.5813202", "0.58118016", "0.5794382", "0.57565594", "0.57432115", "0.57010084", "0.56957144", "0.56865245", "0.5678471", "0.5629559", "0.56248206", "0.559...
0.70061296
1
Path to optional _app.yaml partial
def source_path if @site.respond_to?(:in_source_dir) @site.in_source_dir("_app.yaml") else Jekyll.sanitized_path(@site.source, "_app.yaml") end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def app_yaml_exists?\n if @site.respond_to?(:in_source_dir)\n File.exists? @site.in_source_dir(\"app.yaml\")\n else\n File.exists? Jekyll.sanitized_path(@site.source, \"app.yaml\")\n end\n end", "def yaml_path\n File.join(base_path, \"resource_map.yml\")\n end", "def sou...
[ "0.6330451", "0.61741567", "0.6170576", "0.61427903", "0.61427903", "0.61198807", "0.60195756", "0.60084414", "0.5995646", "0.5968562", "0.59499437", "0.5894462", "0.5821994", "0.5789068", "0.57873344", "0.5767727", "0.5766501", "0.5757053", "0.5757053", "0.57489777", "0.5736...
0.632842
1
Destination for app.yaml file within the site source directory
def destination_path if @site.respond_to?(:in_dest_dir) @site.in_dest_dir("app.yaml") else Jekyll.sanitized_path(@site.dest, "app.yaml") end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deploy_to\n \"/data/#{app_name.downcase}/app\"\n end", "def source_path\n if @site.respond_to?(:in_source_dir)\n @site.in_source_dir(\"_app.yaml\")\n else\n Jekyll.sanitized_path(@site.source, \"_app.yaml\")\n end\n end", "def generate(site)\n @site = site\n ...
[ "0.6907952", "0.67348284", "0.66277176", "0.6429075", "0.62702507", "0.62634104", "0.6237363", "0.61341375", "0.60992175", "0.6086678", "0.60747707", "0.5993835", "0.59888744", "0.5979113", "0.5944595", "0.5907752", "0.5865426", "0.58519953", "0.584063", "0.5804115", "0.57638...
0.7962151
0
Document specific app.yaml configuration provided in yaml frontmatter
def document_overrides(document) if document.respond_to?(:data) and document.data.has_key?("app_engine") document.data.fetch("app_engine") else {} end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config_for_yaml(opts = {})\n path = opts[:yaml] || fixture('app_config.yml')\n config_for({ yaml: path }.merge(opts))\n end", "def generate_configuration\n template \"mebla.yml\", \"config/mebla.yml\"\n end", "def config\n @config ||= yaml_content || {\n 'apiVersion' => 'v1',...
[ "0.65206313", "0.6265206", "0.6064929", "0.59667", "0.5922024", "0.58960474", "0.5790568", "0.57715714", "0.5748882", "0.5748312", "0.5733001", "0.5711915", "0.568833", "0.568833", "0.5684811", "0.5683197", "0.567904", "0.56694144", "0.5625727", "0.56248176", "0.5620825", "...
0.0
-1
Checks if a app.yaml already exists in the site source
def app_yaml_exists? if @site.respond_to?(:in_source_dir) File.exists? @site.in_source_dir("app.yaml") else File.exists? Jekyll.sanitized_path(@site.source, "app.yaml") end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def source_partial_exists?\n if @site.respond_to?(:in_source_dir)\n File.exists? @site.in_source_dir(\"_app.yaml\")\n else\n File.exists? Jekyll.sanitized_path(@site.source, \"_app.yaml\")\n end\n end", "def exists?(app_name)\n File.exists? File.join(path, app_name)\n end"...
[ "0.7508295", "0.64757854", "0.6461875", "0.64194137", "0.63742083", "0.6367011", "0.63307387", "0.63101864", "0.62095046", "0.61519873", "0.61378676", "0.6105355", "0.6039499", "0.60257894", "0.6025113", "0.6007977", "0.5983499", "0.59244657", "0.5915082", "0.59026074", "0.58...
0.86784786
0
Compute length and set +len+ field
def calc_length Base.calculate_and_set_length self, header_in_size: false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_length\n self[:length].value = Base.calculate_and_set_length(self)\n end", "def calc_length\n self.length = Base.calculate_and_set_length(self)\n end", "def calc_length\n Base.calculate_and_set_length self\n end", "def set_len!()\n @user_len = @user.len...
[ "0.8015684", "0.7946832", "0.7707141", "0.76369876", "0.76032686", "0.75450885", "0.74998367", "0.7442403", "0.7396131", "0.7310758", "0.7305725", "0.72731215", "0.725626", "0.7250911", "0.72505826", "0.720145", "0.71152276", "0.70423025", "0.7028181", "0.7018561", "0.7018561...
0.7269009
13
Get IPv6 part of pseudo header checksum.
def pseudo_header_checksum sum = 0 self[:src].to_a.each { |word| sum += word.to_i } self[:dst].to_a.each { |word| sum += word.to_i } sum end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_checksum\n ipv6 = ip_header(self)\n sum = ipv6.pseudo_header_checksum\n sum += IP_PROTOCOL\n sum += self.sz\n sum += IP.sum16(self)\n self.checksum = IP.reduce_checksum(sum)\n end", "def ipv6_calc_sum_on_addr(cksum=0)\n checksum = cksum\n [ipv6_sr...
[ "0.7568236", "0.7391345", "0.69811416", "0.68004835", "0.6743295", "0.66052186", "0.6590104", "0.6426277", "0.6413673", "0.63473564", "0.6339002", "0.62834406", "0.62552214", "0.6135046", "0.60651857", "0.6059138", "0.6045005", "0.59932256", "0.5988119", "0.5986253", "0.59335...
0.62941414
11
Invert source and destination addresses
def reply! self[:src], self[:dst] = self[:dst], self[:src] self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invert() end", "def complement\n l = self.clone\n l.from = to\n l.from_orient = (to_orient == :+ ? :- : :+)\n l.to = from\n l.to_orient = (from_orient == :+ ? :- : :+)\n l.overlap = complement_overlap\n l\n end", "def invert\n clone.invert!\n end", "def invert; end", "def ...
[ "0.60425806", "0.59211665", "0.59092885", "0.59034556", "0.5801605", "0.5790867", "0.57673556", "0.5739945", "0.57093596", "0.57015204", "0.5693625", "0.5661994", "0.5575896", "0.5569107", "0.549127", "0.5476956", "0.5441812", "0.5431628", "0.54269165", "0.5424584", "0.542458...
0.0
-1
Bind a upper header to IPv6 and its defined extension headers.
def bind(header_klass, args={}) IPv6.old_bind header_klass, args [IPv6::HopByHop].each do |klass| klass.bind header_klass, args end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ipv6=(new_value)\n Zsock.set_ipv6(@zocket, new_value ? 1 : 0)\n end", "def ipv6_saddr\n\t\t\tself[:ipv6_src].to_x\n\t\tend", "def ipv6_daddr\n\t\t\tself[:ipv6_dst].to_x\n\t\tend", "def ipv6_src=(i); typecast i; end", "def ipv6_dst=(i); typecast i; end", "def ipv6_class=(i); self[:ip_class...
[ "0.62103146", "0.598284", "0.5974874", "0.5892171", "0.58694285", "0.585055", "0.5828725", "0.58165824", "0.57075167", "0.5650497", "0.56447566", "0.5627043", "0.56098855", "0.5588268", "0.55806", "0.5511965", "0.5504971", "0.54908454", "0.54704386", "0.54683757", "0.5415648"...
0.77327603
0
I worked on this challenge with Samuel Davis. 2. Pseudocode Input: title, topic, date, thesis_statment, pronoun in array form to the method Output: I need to do several things in this problem. I need to correctly pass all of the arguments into the method and utilize them to make up a nice paragraph. I also need to make...
def essay_writer(title, topic, date, thesis_statement, pronoun) if pronoun == "male" who = "He" whose = "His" whom = "Him" elsif pronoun == "female" who = "She" whose = "Her" whom = "Her" else who = "It" whose = "Its" whom = "Its" end return who + " was an importa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def homework(title, topic, date, thesis_statement, pronoun)\n\tparagraph = \"#{title}/n The #{topic} was an interesting topic. It happened in #{date}. \n\tI feel that #{topic} was a very important part of #{date} because \n\t#{pronoun}. #{thesis_statement}. This is what made #{topic} really \n\tinteresting part of...
[ "0.7736593", "0.7497337", "0.7311717", "0.72876066", "0.7268622", "0.7066334", "0.7039592", "0.69379944", "0.68414545", "0.6837598", "0.68095106", "0.67477864", "0.6588769", "0.6396322", "0.6374306", "0.6370853", "0.63078654", "0.63078654", "0.6248735", "0.6196669", "0.614792...
0.72502905
5
This function returns the min iOS version supported by React Native By using this function, you won't have to manually change your Podfile when we change the minimum version supported by the framework.
def min_ios_version_supported return '13.4' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def os_minimum_version\n return @os_minimum_version\n end", "def os_minimum_version\n return @os_minimum_version\n end", "def ios_version\n ua[/OS (\\d)/, 1]\n end", "def iOSVersion\n\treturn server_version[\"iOS_version\"]\nend", "def min_version...
[ "0.70895416", "0.70895416", "0.6771206", "0.6604689", "0.64484984", "0.62516487", "0.6170318", "0.61294454", "0.61211526", "0.6100863", "0.6100863", "0.6039685", "0.59494144", "0.5926661", "0.59129936", "0.58927226", "0.58835965", "0.58498245", "0.58220875", "0.57973254", "0....
0.7665251
0
This function prepares the project for React Native, before processing all the target exposed by the framework.
def prepare_react_native_project! # Temporary solution to suppress duplicated GUID error. # Can be removed once we move to generate files outside pod install. install! 'cocoapods', :deterministic_uuids => false ReactNativePodsUtils.create_xcode_env_if_missing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def include_react_native!(react_native:, target_platform:, project_root:, flipper_versions:)\n require_relative File.join(project_root, react_native, 'scripts', 'react_native_pods')\n use_flipper!(flipper_versions) if target_platform == :ios && flipper_versions\n use_react_native!(:path => react_native)\nend", ...
[ "0.59261", "0.57835406", "0.56866574", "0.5665999", "0.56415325", "0.5620747", "0.5615956", "0.5567605", "0.55520207", "0.5513744", "0.5485837", "0.5485369", "0.5470677", "0.5455608", "0.54420304", "0.5436604", "0.5385003", "0.5363733", "0.5363733", "0.53465205", "0.53465205"...
0.6808911
0
Getter to retrieve the folly flags in case contributors need to apply them manually. Returns: the folly compiler flags
def folly_flags() return NewArchitectureHelper.folly_compiler_flags end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flags\n @flags\n end", "def flags\n @flags\n end", "def effective_flags\n @effective_flags ||= flag_syntax.flat_map(&:flags)\n end", "def scm_flags\n @flags.join(\" \")\n end", "def report_flags\n self.has_links? ? ret = \"L\" : ret = \"l\"\n self.has_jl...
[ "0.6574399", "0.6574399", "0.6527522", "0.6461143", "0.61460143", "0.60536456", "0.60416275", "0.59874594", "0.598051", "0.59569806", "0.59383374", "0.5932831", "0.592341", "0.5900486", "0.5852101", "0.582911", "0.5810458", "0.5790335", "0.57433474", "0.5724393", "0.572126", ...
0.82123685
0
This function can be used by library developer to prepare their modules for the New Architecture. It passes the Folly Flags to the module, it configures the search path and installs some New Architecture specific dependencies. Parameters: spec: The spec that has to be configured with the New Architecture code new_arch_...
def install_modules_dependencies(spec, new_arch_enabled: ENV['RCT_NEW_ARCH_ENABLED'] == "1") NewArchitectureHelper.install_modules_dependencies(spec, new_arch_enabled, $FOLLY_VERSION) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_installModulesDependencies_whenNewArchEnabledAndNewArchAndNoSearchPathsNorCompilerFlagsArePresent_itInstallDependencies\n # Arrange\n spec = SpecMock.new\n\n # Act\n NewArchitectureHelper.install_modules_dependencies(spec, true, '2021.07.22.00')\n\n # Assert\n as...
[ "0.59281707", "0.5384102", "0.5306092", "0.5189115", "0.5149645", "0.50933206", "0.5093116", "0.50719833", "0.504305", "0.4943292", "0.49249873", "0.48930395", "0.48797446", "0.4868863", "0.48647922", "0.48481584", "0.48425815", "0.48315424", "0.482652", "0.48139942", "0.4812...
0.7368366
0
It returns the default flags.
def get_default_flags() return ReactNativePodsUtils.get_default_flags() end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_flags\n flags.select &:default\n end", "def feature_flags_with_defaults\n flag_names = FeatureFlag.pluck(:name).sort\n FeatureFlag.default_flag_hash.merge(feature_flags_for(*flag_names)).with_indifferent_access\n end", "def default_flags\n cflags = []\n\n # GCC on Solaris 1...
[ "0.91539764", "0.7176073", "0.698295", "0.6909516", "0.68810606", "0.68791634", "0.6685539", "0.6685539", "0.6648338", "0.6625371", "0.6591559", "0.6509272", "0.6471846", "0.64620155", "0.641613", "0.63597935", "0.6331874", "0.63309526", "0.6324775", "0.6303763", "0.629052", ...
0.6876941
6
=== LEGACY METHOD === We need to keep this while we continue to support the old architecture. =====================
def use_react_native_codegen!(spec, options={}) return if ENV['RCT_NEW_ARCH_ENABLED'] == "1" # TODO: Once the new codegen approach is ready for use, we should output a warning here to let folks know to migrate. # The prefix to react-native react_native_path = options[:react_native_path] ||= ".." # Library n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def internal; end", "def implementation; end", "def implementation; end", "def wrapper; end", "def internal?; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def probers; end", "def awaken!\n\t\traise 'Not implemented'\n\tend", "def imp...
[ "0.7495484", "0.6549587", "0.6422882", "0.6422882", "0.6226283", "0.60986227", "0.6055323", "0.6055323", "0.6055323", "0.6055323", "0.59968364", "0.59435993", "0.59264195", "0.59213704", "0.59213704", "0.5905202", "0.589509", "0.58690596", "0.58690596", "0.5811999", "0.581199...
0.0
-1
This provides a post_install workaround for build issues related Xcode 12.5 and Apple Silicon machines. Call this in the app's main Podfile's post_install hook. See for more context. Actual fix was authored by New app template will call this for now until the underlying issue is resolved.
def __apply_Xcode_12_5_M1_post_install_workaround(installer) # NOTE: This fix is still required due to RCT-Folly # creating a function with a better name but keeping the # previous for backward compatibility __fix_double_definition_of_clockid_in_folly() end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_podfile_post_install_hook\n podfile.post_install!(self)\n rescue => e\n raise Informative, 'An error occurred while processing the post-install ' \\\n 'hook of the Podfile.' \\\n \"\\n\\n#{e.message}\\n\\n#{e.backtrace * \"\\n\"}\"\n end", "def grin_wallet_post_install(insta...
[ "0.72844744", "0.70666337", "0.6933922", "0.68369013", "0.68369013", "0.68345845", "0.68345845", "0.67836547", "0.67472976", "0.67046094", "0.6580032", "0.6451583", "0.6401874", "0.63149863", "0.62942016", "0.6238794", "0.6184939", "0.6175305", "0.6169246", "0.6085557", "0.60...
0.7602312
0
GET /districts GET /districts.json
def index @mouzas = @block.mouzas @mouzas = @mouzas.map{|d| {id: d.id, name: d.name[@language]}} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_district_list ( year )\n get_api_resource \"#{@@api_base_url}districts/#{year}\"\n end", "def show\n @districtclass = Districtclass.find(params[:id])\n @districts = @districtclass.districts.all(:order => 'district_name')\n\n respond_to do |format|\n format.html # show.html.erb\n fo...
[ "0.7804373", "0.7537338", "0.71356726", "0.71229523", "0.711125", "0.71006674", "0.7097041", "0.700757", "0.6957552", "0.6886389", "0.6882672", "0.68217546", "0.6722273", "0.66347384", "0.66016793", "0.6533538", "0.64426905", "0.6438084", "0.6401699", "0.63545704", "0.6354570...
0.0
-1
Add Meal Plan Template Add a meal plan template for a user.
def add_meal_plan_template(username, hash, inline_object6, opts = {}) data, _status_code, _headers = add_meal_plan_template_with_http_info(username, hash, inline_object6, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_meal_plan_template(username, hash, add_to_meal_plan_request, opts = {})\n data, _status_code, _headers = add_meal_plan_template_with_http_info(username, hash, add_to_meal_plan_request, opts)\n data\n end", "def add_meal_plan_template_with_http_info(username, hash, add_to_meal_plan_request, o...
[ "0.75599664", "0.6299672", "0.6024542", "0.59027624", "0.5855992", "0.57512504", "0.57512504", "0.57044405", "0.56237113", "0.5607756", "0.55519015", "0.5519516", "0.5452815", "0.53940225", "0.53446436", "0.5338195", "0.5336126", "0.53247166", "0.5311629", "0.52545166", "0.52...
0.71287376
1
Add Meal Plan Template Add a meal plan template for a user.
def add_meal_plan_template_with_http_info(username, hash, inline_object6, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MealPlanningApi.add_meal_plan_template ...' end # verify the required parameter 'username' is set if @api_client.config.clien...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_meal_plan_template(username, hash, add_to_meal_plan_request, opts = {})\n data, _status_code, _headers = add_meal_plan_template_with_http_info(username, hash, add_to_meal_plan_request, opts)\n data\n end", "def add_meal_plan_template(username, hash, inline_object6, opts = {})\n data, _s...
[ "0.75599486", "0.71285385", "0.62990063", "0.60258764", "0.59029245", "0.5749062", "0.5749062", "0.570217", "0.56238776", "0.5606021", "0.5550511", "0.5519001", "0.5452368", "0.5393449", "0.5344165", "0.5338446", "0.53339654", "0.5325719", "0.53098506", "0.52534866", "0.52487...
0.5855063
5
Add to Meal Plan Add an item to the user's meal plan.
def add_to_meal_plan(username, hash, inline_object4, opts = {}) data, _status_code, _headers = add_to_meal_plan_with_http_info(username, hash, inline_object4, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add\n meal_name = @view.ask_name\n meal_price = @view.ask_price.to_i\n new_meal = Meal.new({name: meal_name, price: meal_price})\n @meals_repository.add(new_meal)\n end", "def add_to_meal_plan(username, hash, add_to_meal_plan_request, opts = {})\n data, _status_code, _headers = add_to_meal_...
[ "0.730336", "0.69582987", "0.67719364", "0.6663392", "0.6605699", "0.65768874", "0.64708173", "0.63881075", "0.6360786", "0.63487613", "0.6316132", "0.63130563", "0.6212977", "0.6208517", "0.6171219", "0.61505705", "0.6128557", "0.6095564", "0.6064697", "0.6034046", "0.602352...
0.64514816
7
Add to Meal Plan Add an item to the user&39;s meal plan.
def add_to_meal_plan_with_http_info(username, hash, inline_object4, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MealPlanningApi.add_to_meal_plan ...' end # verify the required parameter 'username' is set if @api_client.config.client_side_valid...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add\n meal_name = @view.ask_name\n meal_price = @view.ask_price.to_i\n new_meal = Meal.new({name: meal_name, price: meal_price})\n @meals_repository.add(new_meal)\n end", "def add_to_meal_plan(username, hash, add_to_meal_plan_request, opts = {})\n data, _status_code, _headers = add_to_meal_...
[ "0.7256542", "0.6885671", "0.66423255", "0.6625168", "0.65972185", "0.65946794", "0.6533232", "0.63610476", "0.6358464", "0.6354782", "0.6311892", "0.6267061", "0.6127208", "0.60759544", "0.60742617", "0.6070927", "0.60606337", "0.60310274", "0.59823537", "0.5945549", "0.5943...
0.0
-1
Add to Shopping List Add an item to the current shopping list of a user.
def add_to_shopping_list(username, hash, inline_object9, opts = {}) data, _status_code, _headers = add_to_shopping_list_with_http_info(username, hash, inline_object9, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_item\n\t\tcurrent_user.saved.items.push(Item.find(params[:item]))\n\t\tredirect_to :back\n\tend", "def add_to_cart\n @shopping_cart = ShoppingCart.find_by_user_id(current_user.id)\n if @shopping_cart.nil?\n @shopping_cart = ShoppingCart.new({:user_id => current_user.id, :item_list => Hash.new....
[ "0.72181857", "0.68920463", "0.67963135", "0.6756057", "0.6697104", "0.6678763", "0.66431177", "0.6616387", "0.6597167", "0.6593975", "0.6593206", "0.652702", "0.65268844", "0.6507308", "0.6476655", "0.64454454", "0.6418821", "0.6380331", "0.637945", "0.6358531", "0.63486314"...
0.61840105
35
Add to Shopping List Add an item to the current shopping list of a user.
def add_to_shopping_list_with_http_info(username, hash, inline_object9, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MealPlanningApi.add_to_shopping_list ...' end # verify the required parameter 'username' is set if @api_client.config.client_si...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_item\n\t\tcurrent_user.saved.items.push(Item.find(params[:item]))\n\t\tredirect_to :back\n\tend", "def add_to_cart\n @shopping_cart = ShoppingCart.find_by_user_id(current_user.id)\n if @shopping_cart.nil?\n @shopping_cart = ShoppingCart.new({:user_id => current_user.id, :item_list => Hash.new....
[ "0.722052", "0.6892351", "0.67960227", "0.6755512", "0.66964287", "0.6680619", "0.66439104", "0.6617948", "0.6597452", "0.6594118", "0.6593326", "0.65263784", "0.65249026", "0.65089905", "0.6477488", "0.64451087", "0.6418391", "0.63804066", "0.6380055", "0.63599443", "0.63500...
0.0
-1
Clear Meal Plan Day Delete all planned items from the user's meal plan for a specific day.
def clear_meal_plan_day(username, date, hash, inline_object3, opts = {}) data, _status_code, _headers = clear_meal_plan_day_with_http_info(username, date, hash, inline_object3, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_meal_plan_day(username, date, hash, clear_meal_plan_day_request, opts = {})\n data, _status_code, _headers = clear_meal_plan_day_with_http_info(username, date, hash, clear_meal_plan_day_request, opts)\n data\n end", "def delete\n @free_day = @free_days.first :date => params[:date]\n ...
[ "0.74763596", "0.5592281", "0.55415285", "0.55289185", "0.5454384", "0.54534334", "0.525217", "0.52081513", "0.5164676", "0.5158542", "0.51318514", "0.51291627", "0.5119845", "0.5068107", "0.50312567", "0.50154775", "0.49979222", "0.49707776", "0.49669835", "0.49631575", "0.4...
0.75715566
0
Clear Meal Plan Day Delete all planned items from the user&39;s meal plan for a specific day.
def clear_meal_plan_day_with_http_info(username, date, hash, inline_object3, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MealPlanningApi.clear_meal_plan_day ...' end # verify the required parameter 'username' is set if @api_client.config.clien...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_meal_plan_day(username, date, hash, inline_object3, opts = {})\n data, _status_code, _headers = clear_meal_plan_day_with_http_info(username, date, hash, inline_object3, opts)\n data\n end", "def clear_meal_plan_day(username, date, hash, clear_meal_plan_day_request, opts = {})\n data, ...
[ "0.763091", "0.7531355", "0.55965877", "0.5582679", "0.5508019", "0.54763967", "0.53966135", "0.5203265", "0.5197962", "0.51540023", "0.5120851", "0.50975096", "0.5090699", "0.508945", "0.5032326", "0.50197715", "0.50107354", "0.49937826", "0.49762735", "0.49688295", "0.49652...
0.5271271
7
Connect User In order to call userspecific endpoints, you need to connect your app's users to spoonacular users.
def connect_user(body, opts = {}) data, _status_code, _headers = connect_user_with_http_info(body, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect\n @user = User.where(:email => params[:user][:email]).first\n # If there is no user, create one\n if @user.nil? then\n @user = User.new(user_params)\n end\n authorize @user\n @user.apartment_id = params[:user][:apartment_id]\n respond_to do |format|\n if @user.save!\n ...
[ "0.68955314", "0.6253904", "0.6220456", "0.6132636", "0.60433465", "0.60329366", "0.60265243", "0.60139537", "0.5971291", "0.59675217", "0.59366626", "0.59366626", "0.59366626", "0.5923651", "0.5902456", "0.59018296", "0.5874774", "0.58263916", "0.5774149", "0.5713593", "0.57...
0.57281494
20
Connect User In order to call userspecific endpoints, you need to connect your app&39;s users to spoonacular users.
def connect_user_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MealPlanningApi.connect_user ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail Argume...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect\n @user = User.where(:email => params[:user][:email]).first\n # If there is no user, create one\n if @user.nil? then\n @user = User.new(user_params)\n end\n authorize @user\n @user.apartment_id = params[:user][:apartment_id]\n respond_to do |format|\n if @user.save!\n ...
[ "0.6941756", "0.62697476", "0.619376", "0.61295855", "0.6095246", "0.60655886", "0.6060893", "0.6046525", "0.6043397", "0.6018668", "0.6004293", "0.59339166", "0.59339166", "0.59339166", "0.59245914", "0.59098035", "0.5875275", "0.58610976", "0.58610976", "0.57727325", "0.575...
0.5425273
54
Delete from Meal Plan Delete an item from the user's meal plan.
def delete_from_meal_plan(username, id, hash, inline_object5, opts = {}) data, _status_code, _headers = delete_from_meal_plan_with_http_info(username, id, hash, inline_object5, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @mealplan = Mealplan.find(params[:id])\n @mealplan.destroy\n respond_to do |format|\n format.html { redirect_to mealplans_url, notice: 'Mealplan was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n\t\t@meal = Meal.find(params[:meal_id...
[ "0.6906345", "0.6766337", "0.6553292", "0.65074176", "0.6498227", "0.6478958", "0.6477542", "0.6470028", "0.64670354", "0.64120585", "0.64115477", "0.64115477", "0.6408205", "0.636688", "0.63570267", "0.6347103", "0.6345586", "0.6337202", "0.63154787", "0.6310655", "0.6301924...
0.670691
2
Delete from Meal Plan Delete an item from the user&39;s meal plan.
def delete_from_meal_plan_with_http_info(username, id, hash, inline_object5, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MealPlanningApi.delete_from_meal_plan ...' end # verify the required parameter 'username' is set if @api_client.config.cli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n\t\t@meal = Meal.find(params[:meal_id])\n\t\t@users_meal = UsersMeal.find(params[:id])\n\t\t@users_meal.destroy\n\t\tredirect_to meals_path\n\tend", "def destroy\n \t@user = User.find(params[:user_id])\n \t@item = @user.items.find(params[:id])\n \t@item.destroy\n \tredirect_to @user\n \...
[ "0.68228954", "0.6734501", "0.6691136", "0.6607854", "0.65799254", "0.6557561", "0.654528", "0.6532303", "0.65099734", "0.65064734", "0.6493723", "0.6492181", "0.64904296", "0.64577395", "0.64452887", "0.6415182", "0.6405803", "0.6405803", "0.639904", "0.63808596", "0.6377685...
0.0
-1
Delete from Shopping List Delete an item from the current shopping list of the user.
def delete_from_shopping_list(username, id, hash, inline_object10, opts = {}) data, _status_code, _headers = delete_from_shopping_list_with_http_info(username, id, hash, inline_object10, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_shopping_list\n user_id = current_user.id\n yummly_id = params[:yummly_id]\n\n shopping_list = ShoppingList.find_by(yummly_id: yummly_id, user_id: user_id)\n shopping_list.destroy\n\n redirect_to recipes_url, notice: \"Removed recipe from your shopping lists\"\n end", "def destroy\n ...
[ "0.7561734", "0.74865174", "0.74289274", "0.73649156", "0.7330701", "0.73169816", "0.7300982", "0.7279684", "0.72557163", "0.721214", "0.72034883", "0.71552265", "0.71517086", "0.71155185", "0.7114409", "0.71134603", "0.7097706", "0.70570713", "0.70496815", "0.7005686", "0.69...
0.655037
88
Delete from Shopping List Delete an item from the current shopping list of the user.
def delete_from_shopping_list_with_http_info(username, id, hash, inline_object10, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MealPlanningApi.delete_from_shopping_list ...' end # verify the required parameter 'username' is set if @api_client.c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_shopping_list\n user_id = current_user.id\n yummly_id = params[:yummly_id]\n\n shopping_list = ShoppingList.find_by(yummly_id: yummly_id, user_id: user_id)\n shopping_list.destroy\n\n redirect_to recipes_url, notice: \"Removed recipe from your shopping lists\"\n end", "def destroy\n ...
[ "0.7561605", "0.74889386", "0.7430469", "0.7365818", "0.73326296", "0.73186654", "0.73011917", "0.7283174", "0.725741", "0.7212349", "0.72079355", "0.7155772", "0.71507215", "0.71191204", "0.7115846", "0.71137464", "0.7098188", "0.70589346", "0.7052891", "0.7009473", "0.69786...
0.0
-1
Delete Meal Plan Template Delete a meal plan template for a user.
def delete_meal_plan_template(username, id, hash, inline_object7, opts = {}) data, _status_code, _headers = delete_meal_plan_template_with_http_info(username, id, hash, inline_object7, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_meal_plan_template(username, id, hash, delete_from_meal_plan_request, opts = {})\n data, _status_code, _headers = delete_meal_plan_template_with_http_info(username, id, hash, delete_from_meal_plan_request, opts)\n data\n end", "def destroy\n template = Template.find(params[:id])\n ...
[ "0.71655095", "0.69218427", "0.6740683", "0.66184187", "0.65981317", "0.6574636", "0.64761704", "0.63668495", "0.6306134", "0.62715244", "0.62426835", "0.6232739", "0.6202199", "0.62005675", "0.61978775", "0.619685", "0.61899793", "0.61784095", "0.6172598", "0.61174697", "0.6...
0.7335693
0
Delete Meal Plan Template Delete a meal plan template for a user.
def delete_meal_plan_template_with_http_info(username, id, hash, inline_object7, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MealPlanningApi.delete_meal_plan_template ...' end # verify the required parameter 'username' is set if @api_client.co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_meal_plan_template(username, id, hash, inline_object7, opts = {})\n data, _status_code, _headers = delete_meal_plan_template_with_http_info(username, id, hash, inline_object7, opts)\n data\n end", "def delete_meal_plan_template(username, id, hash, delete_from_meal_plan_request, opts = {})...
[ "0.7336081", "0.71662307", "0.6918408", "0.6739906", "0.6616743", "0.659606", "0.6573616", "0.64771485", "0.6364692", "0.63060266", "0.6271338", "0.62407094", "0.62297016", "0.6200207", "0.61985856", "0.61969626", "0.6194272", "0.61884713", "0.61767966", "0.61719644", "0.6116...
0.5847143
47
Generate Meal Plan Generate a meal plan with three meals per day (breakfast, lunch, and dinner).
def generate_meal_plan(opts = {}) data, _status_code, _headers = generate_meal_plan_with_http_info(opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def meal_plan(time_of_week, time_of_day)\n if time_of_week == \"weekday\"\n if time_of_day == \"breakfast\"\n \"Cereal\"\n elsif time_of_day == \"lunch\"\n \"Sandwich\"\n elsif time_of_day == \"dinner\"\n \"Chicken nuggets\"\n end \n elsif time_of_week == \"weekend\"\n if time_of_da...
[ "0.6632308", "0.6627788", "0.6174879", "0.6158685", "0.6068231", "0.59985614", "0.59980977", "0.5987387", "0.59760123", "0.59760123", "0.59760123", "0.59555763", "0.59284884", "0.59269124", "0.5912739", "0.5834899", "0.5793534", "0.5710402", "0.56632805", "0.56575495", "0.561...
0.7498136
1
Generate Meal Plan Generate a meal plan with three meals per day (breakfast, lunch, and dinner).
def generate_meal_plan_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MealPlanningApi.generate_meal_plan ...' end # resource path local_var_path = '/mealplanner/generate' # query parameters query_params = opts[:query_p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_meal_plan(opts = {})\n data, _status_code, _headers = generate_meal_plan_with_http_info(opts)\n data\n end", "def generate_meal_plan(opts = {})\n data, _status_code, _headers = generate_meal_plan_with_http_info(opts)\n data\n end", "def meal_plan(time_of_week, time_of_day...
[ "0.74978554", "0.74978554", "0.66329634", "0.6628365", "0.6174255", "0.60678405", "0.59986687", "0.59977055", "0.59871966", "0.5976976", "0.5976976", "0.5976976", "0.5956562", "0.59277177", "0.5926511", "0.5913735", "0.58341175", "0.5793048", "0.5711317", "0.5664094", "0.5657...
0.61582303
5
Generate Shopping List Generate the shopping list for a user from the meal planner in a given time frame.
def generate_shopping_list(username, start_date, end_date, hash, inline_object8, opts = {}) data, _status_code, _headers = generate_shopping_list_with_http_info(username, start_date, end_date, hash, inline_object8, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_shopping_list(username, start_date, end_date, hash, generate_shopping_list_request, opts = {})\n data, _status_code, _headers = generate_shopping_list_with_http_info(username, start_date, end_date, hash, generate_shopping_list_request, opts)\n data\n end", "def generate_shopping_list_wi...
[ "0.6280856", "0.582508", "0.57262665", "0.5635517", "0.5635214", "0.5622052", "0.5560061", "0.5492681", "0.54431516", "0.5404603", "0.5326563", "0.5275251", "0.5267073", "0.52647287", "0.52441466", "0.5184849", "0.51730645", "0.5150148", "0.5148398", "0.5057483", "0.50371796"...
0.59845877
1
Generate Shopping List Generate the shopping list for a user from the meal planner in a given time frame.
def generate_shopping_list_with_http_info(username, start_date, end_date, hash, inline_object8, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MealPlanningApi.generate_shopping_list ...' end # verify the required parameter 'username' is set if @a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_shopping_list(username, start_date, end_date, hash, generate_shopping_list_request, opts = {})\n data, _status_code, _headers = generate_shopping_list_with_http_info(username, start_date, end_date, hash, generate_shopping_list_request, opts)\n data\n end", "def generate_shopping_list(us...
[ "0.62813693", "0.5984963", "0.58250356", "0.57272196", "0.5635297", "0.56350625", "0.56215745", "0.5491996", "0.5444705", "0.54049987", "0.53280216", "0.5276242", "0.5266596", "0.52642876", "0.52458066", "0.5184181", "0.5172845", "0.515045", "0.5147239", "0.5056256", "0.50376...
0.55596566
7
Get Meal Plan Template Get information about a meal plan template.
def get_meal_plan_template(username, id, hash, opts = {}) data, _status_code, _headers = get_meal_plan_template_with_http_info(username, id, hash, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plans_templates_show\n @user = User.find_by_id(session[:user_id])\n \n # If an institutional user, return the template \n if user_role_in?(:dmp_admin)\n @plan = Plan.find_by_id(params[:id])\n \n @plan\n elsif user_role_in?(:institutional_admin, :institutional_reviewer, :resource_e...
[ "0.62583333", "0.62485117", "0.6201302", "0.61629003", "0.6145901", "0.6145901", "0.6089808", "0.5985056", "0.5961096", "0.5889099", "0.5776497", "0.5714218", "0.5701686", "0.56959885", "0.56425464", "0.5639953", "0.5636233", "0.55780625", "0.5574042", "0.55485916", "0.553039...
0.67427105
1
Get Meal Plan Template Get information about a meal plan template.
def get_meal_plan_template_with_http_info(username, id, hash, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MealPlanningApi.get_meal_plan_template ...' end # verify the required parameter 'username' is set if @api_client.config.client_side_valid...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_meal_plan_template(username, id, hash, opts = {})\n data, _status_code, _headers = get_meal_plan_template_with_http_info(username, id, hash, opts)\n data\n end", "def get_meal_plan_template(username, id, hash, opts = {})\n data, _status_code, _headers = get_meal_plan_template_with_http_...
[ "0.6743821", "0.6743821", "0.62591887", "0.625017", "0.62028366", "0.6164499", "0.6147692", "0.6147692", "0.60913223", "0.59862775", "0.59608996", "0.5891272", "0.5778135", "0.5715974", "0.5703564", "0.5697477", "0.5643617", "0.5639961", "0.5638094", "0.5580856", "0.5574953",...
0.5328075
42
Get Meal Plan Templates Get meal plan templates from user or public ones.
def get_meal_plan_templates(username, hash, opts = {}) data, _status_code, _headers = get_meal_plan_templates_with_http_info(username, hash, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plans_templates_show\n @user = User.find_by_id(session[:user_id])\n \n # If an institutional user, return the template \n if user_role_in?(:dmp_admin)\n @plan = Plan.find_by_id(params[:id])\n \n @plan\n elsif user_role_in?(:institutional_admin, :institutional_reviewer, :resource_e...
[ "0.69000614", "0.6601203", "0.5838687", "0.579171", "0.5786224", "0.5696612", "0.5696612", "0.56207424", "0.56050754", "0.559238", "0.5451943", "0.5421925", "0.53721815", "0.5355782", "0.5323864", "0.53043526", "0.5303476", "0.52950335", "0.5268345", "0.5204368", "0.5171017",...
0.65706396
3
Get Meal Plan Templates Get meal plan templates from user or public ones.
def get_meal_plan_templates_with_http_info(username, hash, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MealPlanningApi.get_meal_plan_templates ...' end # verify the required parameter 'username' is set if @api_client.config.client_side_validat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plans_templates_show\n @user = User.find_by_id(session[:user_id])\n \n # If an institutional user, return the template \n if user_role_in?(:dmp_admin)\n @plan = Plan.find_by_id(params[:id])\n \n @plan\n elsif user_role_in?(:institutional_admin, :institutional_reviewer, :resource_e...
[ "0.6900038", "0.66001475", "0.6570507", "0.6570507", "0.5838249", "0.5792489", "0.5784832", "0.5696092", "0.5696092", "0.56204253", "0.5591704", "0.54526263", "0.5421951", "0.53726315", "0.5355722", "0.5324248", "0.5304856", "0.53035367", "0.5294845", "0.5267985", "0.5204308"...
0.5604487
10
Get Meal Plan Week Retrieve a meal planned week for the given user. The username must be a spoonacular user and the hash must the the user's hash that can be found in his/her account.
def get_meal_plan_week(username, start_date, hash, opts = {}) data, _status_code, _headers = get_meal_plan_week_with_http_info(username, start_date, hash, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_meal_plan_week_with_http_info(username, start_date, hash, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: MealPlanningApi.get_meal_plan_week ...'\n end\n # verify the required parameter 'username' is set\n if @api_client.config.client_...
[ "0.6599862", "0.6596249", "0.6140227", "0.60694975", "0.56269026", "0.5607126", "0.5589588", "0.54601043", "0.5423548", "0.5362748", "0.5354592", "0.5343172", "0.52760535", "0.5253986", "0.52360773", "0.52337134", "0.52317286", "0.52136874", "0.51732886", "0.5169574", "0.5152...
0.74698716
1
Get Meal Plan Week Retrieve a meal planned week for the given user. The username must be a spoonacular user and the hash must the the user&39;s hash that can be found in his/her account.
def get_meal_plan_week_with_http_info(username, start_date, hash, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MealPlanningApi.get_meal_plan_week ...' end # verify the required parameter 'username' is set if @api_client.config.client_side_valid...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_meal_plan_week(username, start_date, hash, opts = {})\n data, _status_code, _headers = get_meal_plan_week_with_http_info(username, start_date, hash, opts)\n data\n end", "def get_meal_plan_week(username, start_date, hash, opts = {})\n data, _status_code, _headers = get_meal_plan_week_wi...
[ "0.7428114", "0.7428114", "0.6551081", "0.6122873", "0.6007924", "0.55983347", "0.5586083", "0.5581431", "0.54018193", "0.5385838", "0.53109443", "0.53060985", "0.52678794", "0.524822", "0.5235023", "0.52080625", "0.51904905", "0.5178015", "0.5172844", "0.51517296", "0.513932...
0.65480906
3
Get Shopping List Get the current shopping list for the given user.
def get_shopping_list(username, hash, opts = {}) data, _status_code, _headers = get_shopping_list_with_http_info(username, hash, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @shopping_lists = ShoppingList.where(user_id: current_user.id)\n end", "def get_lists(user)\n get(\"/#{user}/lists.json\")\n end", "def index\n if current_user.role == 'admin'\n\t@shoppinglists = Shoppinglist.all\n else\n\t@shoppinglists = Shoppinglist.select{|l| l.user == current...
[ "0.7350973", "0.6664909", "0.6618392", "0.658024", "0.6506707", "0.623628", "0.62202287", "0.6056524", "0.6037255", "0.603434", "0.6013503", "0.5973997", "0.59655696", "0.5913996", "0.5913996", "0.59139615", "0.5858788", "0.5814744", "0.5811318", "0.5785201", "0.5776877", "...
0.6714352
2
Get Shopping List Get the current shopping list for the given user.
def get_shopping_list_with_http_info(username, hash, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MealPlanningApi.get_shopping_list ...' end # verify the required parameter 'username' is set if @api_client.config.client_side_validation && usern...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @shopping_lists = ShoppingList.where(user_id: current_user.id)\n end", "def get_shopping_list(username, hash, opts = {})\n data, _status_code, _headers = get_shopping_list_with_http_info(username, hash, opts)\n data\n end", "def get_shopping_list(username, hash, opts = {})\n d...
[ "0.7351255", "0.67161465", "0.67161465", "0.6662611", "0.661839", "0.65804905", "0.65052927", "0.62346137", "0.6220975", "0.6054591", "0.6036454", "0.6032663", "0.60143036", "0.5972466", "0.5963346", "0.5916827", "0.5912387", "0.5912387", "0.5859932", "0.5812696", "0.58097094...
0.0
-1
Start listening for new events. This method will continue to listen for new events until a shutdown is requested through the subscription_master provided.
def start catch(:stop) do @poll_waiter.poll do read_events end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start\n subscribe &Proc.new { |message| listener(message) }\n end", "def start_listening\n @continue_listening = true\n while @continue_listening\n listen_for_changes\n end\n end", "def start\n # subscribe is like a callback\n @server_queue.subscribe(block: @block) do |de...
[ "0.67931265", "0.6147137", "0.6140364", "0.60873485", "0.6008915", "0.59843504", "0.59321344", "0.5927396", "0.5876732", "0.5871498", "0.5870719", "0.5864558", "0.5850737", "0.5829304", "0.58021486", "0.57791567", "0.57381535", "0.57299685", "0.5684818", "0.566844", "0.566357...
0.5252778
63
GET /selected_options_of_pcs GET /selected_options_of_pcs.json
def index @selected_options_of_pcs = SelectedOptionsOfPc.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_selected_options_of_pc\n @selected_options_of_pc = SelectedOptionsOfPc.find(params[:id])\n end", "def chosen_options\n Option.find_all_by_id session[:chosen_options]\n end", "def create\n @selected_options_of_pc = SelectedOptionsOfPc.new(selected_options_of_pc_params)\n\n respond_to d...
[ "0.6930441", "0.6448872", "0.64281285", "0.6388491", "0.617212", "0.617212", "0.6162466", "0.6133185", "0.6018197", "0.5848338", "0.5781889", "0.57662624", "0.57471037", "0.55964375", "0.55888206", "0.5564365", "0.5563764", "0.5548685", "0.554298", "0.55308354", "0.55308354",...
0.7776128
0