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
Transforms a primary request object to a request XML.
def call(initial_request) request_xml = yield convert_to_xml(initial_request) _validation_result = yield validate_xml(request_xml) Success(request_xml) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_xml\n request.clone.to_xml\n end", "def make_xml_request_object( opts={} )\n\t\tdata = make_xml_request( opts )\n\t\treturn Mongrel2::Request.parse( data )\n\tend", "def to_xml\r\n @request_set.ToXMLString\r\n end", "def to_request_object\n result = {}\n request_o...
[ "0.7381064", "0.65435153", "0.6514597", "0.59768516", "0.5893061", "0.5881688", "0.58555317", "0.5792791", "0.5785866", "0.5769282", "0.5767786", "0.57444286", "0.5704083", "0.56836325", "0.5659368", "0.5594321", "0.55878526", "0.5586311", "0.5569818", "0.5554141", "0.5528774...
0.5274634
44
for sign_in with username or email
def find_resource(_field, value) query = <<-SQL.squish LOWER(username) = :value OR LOWER(email) = :value SQL @resource = resource_class.where(query, value: value).first end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sign_in identifier\n User.find_by(login: identifier) || User.find_by(email: identifier)\n end", "def sign_in\n end", "def sign_in_as(name)\n post login_url, params: { email: name, password: 'testpassword' }\n end", "def authenticate_user_with_user_name\n username = \"StripPals!_Sales\"\n ...
[ "0.7901403", "0.7226422", "0.72112894", "0.7210358", "0.71981525", "0.71521443", "0.7115309", "0.71111614", "0.70959806", "0.7076012", "0.7036996", "0.70059735", "0.69778866", "0.69642615", "0.6925935", "0.6896746", "0.68960613", "0.6864172", "0.68595594", "0.68575275", "0.68...
0.0
-1
so projects can be added to a Backer's list and so that the backer can report on the projects they back.
def initialize(name) @backed_projects = [] @name = name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def back_project(project)\n # When a backer has added a project to its list of backed projects,\n @backed_projects << project\n # that project instance should also add the backer to its list of backers.\n project.backers << self\n\n end", "def back_project(project)\n @backed_projects << project\n...
[ "0.8035805", "0.7987305", "0.7802972", "0.7802972", "0.7736295", "0.77063483", "0.7699961", "0.7655655", "0.76253587", "0.74047005", "0.735861", "0.73201174", "0.72700864", "0.72125274", "0.70199394", "0.70128995", "0.6994276", "0.6964849", "0.69544613", "0.6937333", "0.69373...
0.62982374
46
when backer added a project to its list of backed projects, that project also adds the backer to its list of backers
def back_project(project) @backed_projects << project # backer = self.new(name) #logan = Backer.new("Logan") # project_name = backer #hoverboard = Project.new("Awesome Hoverboard") # backer.back_project #logan.back_project(hoverboard) project.backers << self #(backer) # expect(hoverboard.bac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def back_project(project)\n # When a backer has added a project to its list of backed projects,\n @backed_projects << project\n # that project instance should also add the backer to its list of backers.\n project.backers << self\n\n end", "def add_backer(backer)\n @backers << backer\n#also adds t...
[ "0.88996357", "0.87468743", "0.87468743", "0.8688718", "0.8598892", "0.84996724", "0.8447301", "0.8230303", "0.759409", "0.7580413", "0.7544902", "0.7338922", "0.7261837", "0.7261837", "0.7258019", "0.72439593", "0.7240639", "0.72311383", "0.7223524", "0.72108126", "0.7210423...
0.83444035
7
Returns a hash of parameters with all sensitive data replaced.
def filtered_parameters @filtered_parameters ||= parameter_filter.filter(parameters) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def params_digest\n # return Digest::SHA1.hexdigest(params.sort.flatten.join(\"_\"))\n Digest::SHA1.hexdigest(params.to_s)\n end", "def params_digest\n return Digest::SHA1.hexdigest(params.sort.flatten.join(\"_\"))\n end", "def encrypted_params\n params_with(:encrypted)\n end", "def sensit...
[ "0.6416724", "0.6400118", "0.6396316", "0.629791", "0.62515277", "0.6230881", "0.61840457", "0.6181986", "0.6144136", "0.6144136", "0.6105907", "0.60313547", "0.5978282", "0.5904712", "0.58855456", "0.588436", "0.58532673", "0.58415914", "0.58415914", "0.58259416", "0.5819361...
0.0
-1
Returns a hash of request.env with all sensitive data replaced.
def filtered_env @filtered_env ||= env_filter.filter(@env) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def env_hash\n hash = {}\n request.env.each do |key, value|\n hash[key] = value if key =~ /^(HTTP|REQUEST|REMOTE).*/\n end\n puts hash.to_s\n hash\n end", "def env\r\n original_env.merge(hacked_env)\r\n end", "def sanitized_environment\n env = environment\n return if ...
[ "0.75374246", "0.70462286", "0.6871512", "0.6659057", "0.6481175", "0.6338055", "0.63064647", "0.62490094", "0.623839", "0.6232714", "0.62089574", "0.61969405", "0.61685765", "0.60753495", "0.60663974", "0.6064303", "0.60540295", "0.60410035", "0.6026696", "0.601743", "0.6005...
0.5488933
48
Reconstructs a path with all sensitive GET parameters replaced.
def filtered_path @filtered_path ||= query_string.empty? ? path : "#{path}?#{filtered_query_string}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reassemble\n tmps = params[:path].join(\"/\")\n started, qs = false, String.new\n params.each_key do |k|\n if k != \"controller\" && k != \"action\" && k != \"path\"\n started ? qs << \"&#{k}=#{params[k]}\" : qs << \"?#{k}=#{params[k]}\"\n started = true\n end\n end\n tmp...
[ "0.69456583", "0.6351216", "0.62982935", "0.615735", "0.6142763", "0.6134038", "0.6111434", "0.60994315", "0.60436827", "0.6017764", "0.5925087", "0.592103", "0.5901511", "0.58767694", "0.58674794", "0.5856745", "0.5827719", "0.581019", "0.5804998", "0.57741624", "0.5767771",...
0.6250923
3
validates :descricao, presence: true, uniqueness: true
def nome_perfil self.descricao end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valida_titulo\n errors.add_to_base 'avisotitulo' if tituloes.blank? and titulofr.blank? \nend", "def validate()\n errors.add(:nombre, \"debe ser positivo\") if nombre.nil?\n end", "def numero_fattura_must_be_unique_in_anno_and_data_fattura\n #return if field.blank?\n not_uniq = self.class.count(...
[ "0.6808727", "0.64940304", "0.6466939", "0.6430778", "0.6338287", "0.6151169", "0.6116703", "0.60526395", "0.59187305", "0.5912207", "0.5803415", "0.57851654", "0.5757452", "0.5757145", "0.5729736", "0.57081604", "0.5685319", "0.5642017", "0.56409055", "0.56409055", "0.563422...
0.0
-1
Update the arrow animation
def update if @counter == 30 self.x -= 1 elsif @counter == 60 self.x += 1 @counter = 0 end @counter += 1 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_arrow\n return unless @arrow&.visible\n return if Graphics.frame_count % 15 != 0\n @arrow.x += @arrow_direction\n @arrow_direction = 1 if @arrow.x <= 127\n @arrow_direction = -1 if @arrow.x >= 129\n end", "def update\n update_animation\n end", "def update_arrows(i...
[ "0.8021302", "0.69344395", "0.65807027", "0.64709675", "0.64297456", "0.63944674", "0.63451976", "0.6328193", "0.6276746", "0.61526734", "0.61381865", "0.61341953", "0.60881805", "0.6049604", "0.6010312", "0.59982973", "0.5981107", "0.59536713", "0.59152544", "0.5884061", "0....
0.0
-1
Return the coordinate of the sprite
def coordinates return 166, 72 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spritesheet_coordinates\n return -184, 20\n end", "def spritesheet_coordinates\n return 320, 200\n end", "def initial_pos_sprites\n return SPRITE_X_RIGHT, SPRITE_Y\n end", "def coord(x); (x*@game.height).to_i; end", "def pos\r\n { x: @tile.x,\r\n y: @...
[ "0.78999007", "0.7715809", "0.74721783", "0.71861947", "0.7024805", "0.6944623", "0.6886591", "0.68372566", "0.68365216", "0.68365216", "0.6832655", "0.68084055", "0.67987823", "0.6798477", "0.6711129", "0.6695904", "0.6690661", "0.66875863", "0.6687268", "0.66379565", "0.662...
0.63050824
54
Return the name of the sprite
def image_name 'bag/arrow' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name\n extension = rails? ? rails_extension : format\n \"#{sprite_name}.#{extension}\"\n end", "def name\n @page = @item/6\n # clean bitmap\n bmp = pbBitmap(@path + @nameImg)\n bitmap = @sprites[\"name\"].bitmap\n bitmap.clear\n bitmap.blt(0, 0, bmp, Rect.new(0,0,320,44))\n ...
[ "0.768204", "0.7097144", "0.68442535", "0.6715522", "0.6683871", "0.6599536", "0.64823294", "0.6410973", "0.64085984", "0.6385754", "0.6382059", "0.6340275", "0.63053906", "0.6269535", "0.6268408", "0.6219109", "0.6170578", "0.616495", "0.61049217", "0.60763764", "0.6059432",...
0.0
-1
return all the even numbers less than the given number
def even_numbers_less_than num array=[] i = 0 begin if (i % 2 == 0) array.push (i) end i+=1 end while ( i < num) array end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def even_numbers_less_than num\n\t(0...num).select do |number|\n\t\tnumber.even?\n\tend\nend", "def even_numbers_less_than(num)\n array = (0...num).to_a\n array.select { |x| x if x.even? }\nend", "def even_numbers_less_than num\n\t# array_of_nums = []\n\t# i = 0\n\t# while i < num\n\t# \tarray_of_nums.push(i...
[ "0.8450864", "0.83011174", "0.81573725", "0.8114551", "0.80375135", "0.8017493", "0.7920987", "0.7872592", "0.7814799", "0.7613568", "0.7485754", "0.7352522", "0.7340131", "0.72514385", "0.6905482", "0.68842643", "0.6874183", "0.68516356", "0.6791848", "0.6773933", "0.6753226...
0.7574463
10
return the average of all numbers in an array
def average numbers numbers.reduce(0,:+)/ numbers.length.to_f end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def array_average arr\n arr_sum = 0.0\n\n arr.each do |num|\n arr_sum += num\n end\n\n arr_avg = arr_sum / arr.size\nend", "def find_average \n result = array.sum(0.0)/array.size\n return result\n end", "def average(array)\n array.inject(&:+) / array.length\n end", "def average\n...
[ "0.8718848", "0.870823", "0.8697377", "0.86769056", "0.862246", "0.86159426", "0.8614965", "0.86027586", "0.8563019", "0.8558201", "0.8557012", "0.8541557", "0.8539286", "0.85190904", "0.85146844", "0.8511508", "0.8496857", "0.84942436", "0.84827644", "0.8465785", "0.8460922"...
0.0
-1
Try to focus on using correct technical vocabulary. Use the to create a new comment Build a Bear declaring a method "build_a_bear" that has 5 arguments
def build_a_bear(name, age, fur, clothes, special_power) #assigning a variable "greeting" to a string message with # the name argument interpolated inside the string greeting = "Hey partner! My name is #{name} - will you be my friend?!" #assigning a variable "demographics" to an array containing #arguments "name" a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_a_bear(name, age, fur, clothes, special_power)\n# Interpulate the parameter name into a string for the variable greeting.\n greeting = \"Hey partner! My name is #{name} - will you be my friend?!\"\n# Assign an array of name and age for the demographics variable.\n demographics = [name, age]\n# Interpul...
[ "0.6667898", "0.6571872", "0.6447754", "0.6437803", "0.6413305", "0.6341577", "0.6327158", "0.63137776", "0.63073343", "0.62977403", "0.6276664", "0.62731236", "0.6269104", "0.6262746", "0.6261817", "0.6260149", "0.6256697", "0.6213702", "0.618464", "0.6152235", "0.6144082", ...
0.6186441
18
FizzBuzz defining a method called fizzbuzz with 3 arguments
def fizzbuzz(num_1, num_2, range) #create a loop that iterates from 1 up to the value of the argument range # variable i gets assigned another value after each loop (1..range).each do |i| # in each iteration, if i is divided by num_1 and has 0 remainder (modulo) # AND if i is divided by num_2 and has 0 remainders, 'f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fizz_buzz number\nend", "def fizz_buzz number\nend", "def fizz_buzz number \nend", "def fizzbuzz\nend", "def fizz_buzz_hard(*args)\n number = args.size == 0 ? 0 : args[0].to_i\n if number > 0\n (number%5 == 0 || number%10 == 5 || number/10 == 5) ? \n (number%3 == 0 || number%10 ...
[ "0.7957895", "0.7957895", "0.7895533", "0.7871781", "0.7543963", "0.74531", "0.7439024", "0.7407641", "0.7373796", "0.7372697", "0.73606277", "0.73567754", "0.73377216", "0.7334629", "0.7329067", "0.7327724", "0.7309295", "0.73090714", "0.7307092", "0.73022574", "0.7291981", ...
0.0
-1
filter method if user not signed
def user_have unless current_user redirect_to root_path, :alert => "Зарегистрируйтесь или войдите" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def signed_in_user_filter\n if signed_in?\n redirect_to root_path, notice: \"Already logged in\"\n end\n end", "def before_filter\n if current_user\n true\n end\n end", "def users_only\n deny_access(\"Necesitas crear una cuenta para entrar a esta sección\") unless signed_in?\n...
[ "0.7033993", "0.6939261", "0.67054665", "0.6604253", "0.64632803", "0.64406115", "0.6439789", "0.63984644", "0.6341725", "0.62748593", "0.6264162", "0.62634325", "0.62617326", "0.6249142", "0.62483907", "0.624137", "0.6239467", "0.6228413", "0.62044483", "0.6179961", "0.61420...
0.0
-1
read the github file and spit out a slightly formatted list of patterns and their owners Empty/invalid/commented lines are still included in order to preserve line numbering
def pattern_owners codeowner_path = search_codeowners_file patterns = [] File.read(codeowner_path).split("\n").each_with_index { |line, i| path_owner = line.split(/\s+@/, 2) if line.match(/^\s*(?:#.*)?$/) patterns.push ['', ''] # Comment/empty line elsif path_owner.le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pattern_owners(codeowner_data, opts = {})\n patterns = []\n codeowner_data.split(\"\\n\").each_with_index do |line, i|\n stripped_line = line.strip\n if stripped_line == \"\" || stripped_line.start_with?(\"#\")\n patterns << ['', ''] # Comment / empty line\n\n elsif stri...
[ "0.73478025", "0.6592882", "0.6382302", "0.6374665", "0.59668297", "0.5911194", "0.59090924", "0.58752257", "0.57857543", "0.5764521", "0.56709325", "0.56526154", "0.56147194", "0.5571131", "0.55668277", "0.555567", "0.55516726", "0.55204105", "0.5459885", "0.5453769", "0.545...
0.70223397
1
expects an array of gitignore compliant patterns generates a checkignore formatted string for each file in the repo
def raw_git_owner_info(patterns) Tempfile.open('codeowner_patterns') do |file| file.write(patterns.join("\n")) file.rewind `cd #{current_repo_path} && git ls-files | xargs -- git -c \"core.excludesfile=#{file.path}\" check-ignore --no-index -v -n` end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ignored\n [\n '.agignore',\n '.cvsignore',\n '.gitignore',\n '.hgignore',\n ].map do |file_with_ignore_patterns|\n if File.exist? file_with_ignore_patterns\n patterns = File.read(file_with_ignore_patterns).split(\"\\n\")\n patterns.map do |pattern|\n next if pattern =~ /^#/\n ...
[ "0.70528287", "0.66920716", "0.6122522", "0.6116727", "0.60225123", "0.5963941", "0.5869704", "0.5775065", "0.57632524", "0.56951827", "0.5691817", "0.56324106", "0.55900973", "0.5578685", "0.55657834", "0.55657834", "0.5540743", "0.5520054", "0.5463341", "0.54608893", "0.543...
0.6090144
4
A connection instance with Program Applications' relative_path
def connection @connection ||= Connection.new(RESOURCE_PATH) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def relative_path\n @relative_path ||= absolute_path.sub(/^#{Bookshelf::remote_folder}\\/?/,'')\n end", "def relative_path\n @local_path.relative_path_from(@platform.local_path)\n end", "def executable_path; end", "def relative_path; end", "def relative_path; end", "def relative_path; end...
[ "0.63925683", "0.6237701", "0.61455065", "0.6002375", "0.6002375", "0.6002375", "0.6002375", "0.6002375", "0.5980408", "0.596722", "0.5923988", "0.58401144", "0.5799178", "0.57947826", "0.57933307", "0.5780751", "0.57209986", "0.57195514", "0.5717669", "0.56961495", "0.564681...
0.0
-1
def create This creates a new article but the inbuilt security throws an error because we have no told our app if the data is allowed or not
def create @article = Article.new(article_params) # Notice that inside the create action we use render instead of redirect_to when save returns false. # The render method is used so that the @article object is passed back to the new template when it is rendered. # This rendering is done within th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n #@article = Article.new(article_params)\n @article = current_user.articles.build(article_params)\n authorize! :create, @article\n\n respond_to do |format|\n if @article.save\n format.html { redirect_to @article, notice: 'Article was successfully created.' }\n format.json...
[ "0.800511", "0.7866302", "0.7806382", "0.7803542", "0.78024364", "0.7717904", "0.7717878", "0.76614946", "0.76410705", "0.76402676", "0.76305026", "0.7630321", "0.7625732", "0.762198", "0.76114017", "0.76061815", "0.759608", "0.7582636", "0.75659335", "0.7504383", "0.75041664...
0.0
-1
GET /frbr_manifestations GET /frbr_manifestations.json
def index screen_name("Admin-Indice-Manifestaciones-FRBR") @frbr_manifestations = FrbrManifestation.all respond_to do |format| format.html # index.html.erb format.json { render json: @frbr_manifestations } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def manifests\n api.get('manifests')\n end", "def show\n screen_name(\"Admin-Mostrar-Manifestacion-FRBR\")\n @frbr_manifestation = FrbrManifestation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @frbr_manifestation }\n end\n ...
[ "0.73105526", "0.69315076", "0.68411446", "0.6660749", "0.6628658", "0.6614106", "0.65875655", "0.65394795", "0.64750195", "0.6340712", "0.6337629", "0.63326097", "0.6302188", "0.62515575", "0.62438476", "0.62094635", "0.61976135", "0.6193779", "0.6140518", "0.611139", "0.607...
0.7433873
0
GET /frbr_manifestations/1 GET /frbr_manifestations/1.json
def show screen_name("Admin-Mostrar-Manifestacion-FRBR") @frbr_manifestation = FrbrManifestation.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @frbr_manifestation } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n screen_name(\"Admin-Indice-Manifestaciones-FRBR\")\n @frbr_manifestations = FrbrManifestation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @frbr_manifestations }\n end\n end", "def show\n @manifestation = Manifestation.find(param...
[ "0.7369093", "0.6904335", "0.6869291", "0.6867344", "0.6835418", "0.67435795", "0.66481143", "0.65771824", "0.6569556", "0.65679777", "0.6551546", "0.65320843", "0.6448151", "0.6434104", "0.63990676", "0.6390202", "0.63332826", "0.6320534", "0.62428546", "0.62236506", "0.6213...
0.7284096
1
GET /frbr_manifestations/new GET /frbr_manifestations/new.json
def new screen_name("Admin-Nuevo-Manifestacion-FRBR") @frbr_manifestation = FrbrManifestation.new respond_to do |format| format.html # new.html.erb format.json { render json: @frbr_manifestation } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @manifestation_type = ManifestationType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @manifestation_type }\n end\n end", "def create\n @frbr_manifestation = FrbrManifestation.new(params[:frbr_manifestation])\n\n respond_to do |format...
[ "0.7560904", "0.74785376", "0.74669665", "0.74357486", "0.72625273", "0.7156754", "0.7049011", "0.69194317", "0.6792561", "0.6778978", "0.6724368", "0.66825235", "0.6653544", "0.659504", "0.6580602", "0.6580417", "0.657591", "0.65135175", "0.65135175", "0.64975524", "0.647328...
0.80612236
0
POST /frbr_manifestations POST /frbr_manifestations.json
def create @frbr_manifestation = FrbrManifestation.new(params[:frbr_manifestation]) respond_to do |format| if @frbr_manifestation.save format.html { redirect_to @frbr_manifestation, notice: 'Frbr manifestation was successfully created.' } format.json { render json: @frbr_manifestation, st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @manifestation = Manifestation.new(manifestation_params)\n\n respond_to do |format|\n if @manifestation.save\n format.html { redirect_to @manifestation, notice: 'Manifestation was successfully created.' }\n format.json { render :show, status: :created, location: @manifestation...
[ "0.6595336", "0.64922667", "0.646694", "0.63937646", "0.6276041", "0.6262815", "0.61154926", "0.6092214", "0.60084915", "0.6002924", "0.59985197", "0.5971106", "0.59523374", "0.5943622", "0.59322864", "0.5916831", "0.58972615", "0.5868656", "0.58556044", "0.5831825", "0.57993...
0.7282091
0
PUT /frbr_manifestations/1 PUT /frbr_manifestations/1.json
def update @frbr_manifestation = FrbrManifestation.find(params[:id]) respond_to do |format| if @frbr_manifestation.update_attributes(params[:frbr_manifestation]) format.html { redirect_to @frbr_manifestation, notice: 'Frbr manifestation was successfully updated.' } format.json { head :ok ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @manifest.update(manifest_params)\n format.html { redirect_to @manifest, notice: 'Manifest was successfully updated.' }\n format.json { render :show, status: :ok, location: @manifest }\n else\n format.html { render :edit }\n format.j...
[ "0.7080452", "0.6779384", "0.67695427", "0.6683097", "0.6675151", "0.6671835", "0.6671835", "0.6572479", "0.64741814", "0.6364908", "0.63343", "0.63343", "0.6230438", "0.6195054", "0.617984", "0.6163296", "0.61506337", "0.61273974", "0.60814583", "0.6051201", "0.60355973", ...
0.74402773
0
DELETE /frbr_manifestations/1 DELETE /frbr_manifestations/1.json
def destroy @frbr_manifestation = FrbrManifestation.find(params[:id]) @frbr_manifestation.destroy respond_to do |format| format.html { redirect_to frbr_manifestations_url } format.json { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @manifest.destroy\n respond_to do |format|\n format.html { redirect_to manifests_url, notice: 'Manifest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @manifest.destroy\n respond_to do |format|\n format.html { redirect_t...
[ "0.6962001", "0.6962001", "0.6786306", "0.6786306", "0.6779545", "0.6761153", "0.67149293", "0.6710096", "0.6675375", "0.6607064", "0.6450436", "0.6379612", "0.63682777", "0.6353758", "0.63178396", "0.6317414", "0.627128", "0.6254749", "0.6234628", "0.62146616", "0.6158258", ...
0.7484914
0
GET /renting_phases GET /renting_phases.json
def index @renting_phases = RentingPhase.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @phases = Phase.all\n end", "def phases\n Phase.where(edition_id: id)\n end", "def index\n @phases = Phase.where(project_id: params[:project_id])\n end", "def phases(wod)\n options = {\n wod: wod,\n response: api_connection.connection.get(\"phases/\"),\n ...
[ "0.67171186", "0.6460013", "0.6306094", "0.6302307", "0.6187947", "0.6175358", "0.6175024", "0.6116364", "0.6028079", "0.60269654", "0.5958619", "0.58318406", "0.5818769", "0.5772017", "0.5755634", "0.5675129", "0.56157917", "0.5602818", "0.55920136", "0.5560184", "0.5537549"...
0.75208664
0
GET /renting_phases/1 GET /renting_phases/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @renting_phases = RentingPhase.all\n end", "def index\n @phases = Phase.all\n end", "def set_renting_phase\n @renting_phase = RentingPhase.find(params[:id])\n end", "def show\n @phase = Phase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n ...
[ "0.742633", "0.66774684", "0.64998156", "0.6495441", "0.63767827", "0.6372899", "0.6132384", "0.60924226", "0.60829365", "0.60127985", "0.5974184", "0.59443414", "0.5929241", "0.5834167", "0.5752273", "0.5703004", "0.56892335", "0.56669486", "0.5645755", "0.5630333", "0.55789...
0.0
-1
POST /renting_phases POST /renting_phases.json
def create @renting_phase = RentingPhase.new(renting_phase_params) respond_to do |format| if @renting_phase.save format.html { redirect_to @renting_phase, notice: 'Renting phase was successfully created.' } format.json { render :show, status: :created, location: @renting_phase } els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @phase = Phase.new(phase_params)\n\n respond_to do |format|\n if @phase.save\n format.html { redirect_to @phase, notice: \"Phase was successfully created.\" }\n format.json { render :show, status: :created, location: @phase }\n else\n format.html { render :new, sta...
[ "0.63548666", "0.6347811", "0.62863284", "0.61631143", "0.6152797", "0.6037107", "0.60012937", "0.59845775", "0.59291977", "0.5907032", "0.5822179", "0.5785722", "0.5783046", "0.5702787", "0.5701975", "0.5657485", "0.56268173", "0.5610736", "0.560516", "0.5591992", "0.5560814...
0.71898866
0
PATCH/PUT /renting_phases/1 PATCH/PUT /renting_phases/1.json
def update respond_to do |format| if @renting_phase.update(renting_phase_params) format.html { redirect_to @renting_phase, notice: 'Renting phase was successfully updated.' } format.json { render :show, status: :ok, location: @renting_phase } else format.html { render :edit } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @phase.update(phase_params)\n format.html\n format.json { render :nothing => true }\n else\n format.html { render :edit }\n format.json { render json: @phase.errors, status: :unprocessable_entity }\n end\n end\n end", "def...
[ "0.67928624", "0.65495706", "0.64688796", "0.6310743", "0.62172663", "0.61977947", "0.61108416", "0.6073581", "0.6073403", "0.60475945", "0.60046023", "0.5982589", "0.59630466", "0.5922458", "0.589699", "0.58905995", "0.5872368", "0.5870667", "0.5854377", "0.58468807", "0.581...
0.71224856
0
DELETE /renting_phases/1 DELETE /renting_phases/1.json
def destroy @renting_phase.destroy respond_to do |format| format.html { redirect_to renting_phases_url, notice: 'Renting phase was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @phase = Phase.find(params[:id])\n @phase.destroy\n\n respond_to do |format|\n format.html { render :layout => false }\n format.json { head :no_content }\n end\n end", "def destroy\n @phase.destroy\n respond_to do |format|\n format.html { redirect_to project_phases...
[ "0.70608723", "0.7043092", "0.7004727", "0.69672513", "0.69542074", "0.6867823", "0.67691624", "0.6665399", "0.6645594", "0.6626873", "0.6625287", "0.66203606", "0.66164786", "0.6613313", "0.65837884", "0.65829945", "0.6565821", "0.65657103", "0.6540862", "0.65347445", "0.653...
0.75506866
0
Use callbacks to share common setup or constraints between actions.
def set_renting_phase @renting_phase = RentingPhase.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def renting_phase_params params.require(:renting_phase).permit(:start_date, :end_date, :price, :cycles, :contract_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.6981269", "0.6783559", "0.6746007", "0.67423046", "0.6735905", "0.6593568", "0.6504213", "0.649792", "0.6482664", "0.6478558", "0.64566684", "0.64392304", "0.6380194", "0.6376366", "0.636562", "0.63208145", "0.63006365", "0.63001287", "0.6292953", "0.62927175", "0.62911004...
0.0
-1
Convert row, column indices to the corresponding alphanumumeric coordinate
def rc_to_alphanum(row:, column:) index_to_letter(row) + (column + 1).to_s end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def indices2coords(i,j)\n row = i2row(i)\n col = j2col(j)\n \"#{row}#{col}\"\n end", "def convert_coordinates_to_location(coordinates)\n index_to_letter(coordinates[0]) + coordinates[1].to_s\n end", "def convert_to_piece_position(coordinates)\n alpha = ('a'..'h').to_a\n\n row_index,...
[ "0.7435906", "0.6788608", "0.6703798", "0.6542608", "0.65331745", "0.64887875", "0.6458872", "0.6447616", "0.6437085", "0.64178926", "0.641581", "0.6404546", "0.63950986", "0.6382127", "0.63391215", "0.6273251", "0.62661356", "0.6261356", "0.6217223", "0.6172564", "0.61697346...
0.68125135
1
Convert a letter to the corresponding array index
def letter_to_index(letter) alphabet_array.index(letter.upcase) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def letter_to_index(letter)\n ALPHA26.index(letter.upcase)\n end", "def index_to_letter(index)\n alphabet_array[index]\n end", "def index_to_letter(index)\n ALPHA26[index]\n end", "def letter_index(letter)\n @places = []\n @split_word.each_with_index do |char, index|\n if char == lette...
[ "0.80462134", "0.7861105", "0.74475515", "0.73414", "0.72351694", "0.70457333", "0.7040291", "0.7030379", "0.7015871", "0.6986193", "0.6933905", "0.6840173", "0.6836961", "0.6812972", "0.6707106", "0.66830045", "0.66431576", "0.66109836", "0.6584092", "0.6522223", "0.65208507...
0.84795
0
Convert an array index to the corresponding letter of the alphabet
def index_to_letter(index) alphabet_array[index] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index_to_letter(index)\n ALPHA26[index]\n end", "def index_to_letter(idx)\n letter = \"\"\n while true\n idx -= 1\n r = idx % 26\n idx /= 26\n letter = (r + 97).chr + letter\n break if idx <= 0\n end\n letter\n end", "def letter_to_index(letter)\n alphabet_array...
[ "0.85447747", "0.8049885", "0.75753367", "0.717383", "0.7087908", "0.6947372", "0.6845467", "0.68077564", "0.67702085", "0.6752533", "0.6740123", "0.66804326", "0.66629374", "0.6640071", "0.6623495", "0.6621155", "0.66014373", "0.65782374", "0.65688246", "0.65637594", "0.6550...
0.90681833
0
Array of all letters of the alphablet in uppercase
def alphabet_array ('A'..'Z').to_a end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def letter_array (name)\n\tname.chars\nend", "def letters\n the_letters = []\n letter_regex = /[a-z]/i\n chars.each do |character|\n the_letters << character if character.match(letter_regex)\n end\n the_letters.join\n end", "def uppercaser array\n array.map do |value|\n value.upcase\n ...
[ "0.7383897", "0.71002305", "0.6969165", "0.6892359", "0.6856865", "0.6827201", "0.6827201", "0.6798344", "0.6743409", "0.6739401", "0.66683364", "0.66442424", "0.6642007", "0.6636543", "0.66286826", "0.6620772", "0.6585267", "0.6494028", "0.64731896", "0.6446639", "0.64368737...
0.7776594
0
Get the alpha component of an alphanumumeric coordinate
def alpha_component(alphanum) mtch = alphanum.match(/[[:alpha:]]+/) return mtch[0] if mtch end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def alpha\n return @alpha\n end", "def alpha\n @attrs[:alpha].to_f\n end", "def get_alpha(num)\n alpha26 = ('A'...'AA').to_a\n return \"\" if num < 1\n string = \"\"\n loop do\n num, r = (num-1).divmod(26)\n ...
[ "0.6966194", "0.6835891", "0.66791356", "0.66376185", "0.6592302", "0.6573717", "0.65500486", "0.65065515", "0.6412079", "0.6344384", "0.6339349", "0.6339349", "0.6270901", "0.6258887", "0.6255596", "0.6225679", "0.62042296", "0.6181143", "0.60956264", "0.6090273", "0.6074189...
0.70867044
0
Get the numeric component of an alphanumumeric coordinate
def numeric_component(alphanum) mtch = alphanum.match(/\d+/) return mtch[0].to_i if mtch end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def an_numeric_component\n @record.eds_accession_number.split('.').last\n end", "def convert_coord(strcoord)\n strcoord[0] = \"0\" if strcoord[0] == \"A\"\n strcoord[0] = \"1\" if strcoord[0] == \"B\"\n strcoord[0] = \"2\" if strcoord[0] == \"C\"\n strcoord[0] = \"3\" if strcoord[0] == \"D\"\n ...
[ "0.7032389", "0.67309624", "0.6687585", "0.6612308", "0.65751904", "0.6516635", "0.64976645", "0.6288706", "0.62600636", "0.620648", "0.61851007", "0.6174466", "0.61283195", "0.6125467", "0.6085516", "0.6052177", "0.60251087", "0.6018936", "0.5959122", "0.59518844", "0.589772...
0.735588
0
Associates the provided data to the next `PlateLayoutGenerator` index that does not point to a `Part` that already has a `DataAssociation` for `key` and returns the index
def associate_next_empty(key:, data:, column: nil) nxt = next_empty(key: key, column: column) associate(index: nxt, key: key, data: data) nxt end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def associate_to_all(plate:, data:, key:)\n data_map = []\n parts.each do |part|\n loc = plate.find(part)\n loc[2] = data\n loc[3] = key\n data_map.push(loc)\n end\n associate_value_key_to_parts(plate: plate, data_map: data_map)\n end", "def associate(index:, key:, data:)\n pa...
[ "0.6146591", "0.5997446", "0.5666801", "0.5499004", "0.54421055", "0.5436851", "0.5400311", "0.52973855", "0.5280234", "0.52192134", "0.5167734", "0.50930256", "0.5080474", "0.50474054", "0.504599", "0.49649665", "0.49617732", "0.49085268", "0.48933148", "0.4845994", "0.48171...
0.54846644
4
Associates the provided data to the next `PlateLayoutGenerator` group that does not point to any `Part` that already has a `DataAssociation` for `key` and returns the group
def associate_next_empty_group(key:, data:, column: nil) nxt_grp = next_empty_group(key: key, column: column) associate_group(group: nxt_grp, key: key, data: data) nxt_grp end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def associate_provenance_next_empty_group(key:, data:, column: nil)\n nxt_grp = next_empty_group(key: key, column: column)\n associate_provenance_group(group: nxt_grp, key: key, data: data)\n nxt_grp\n end", "def next_empty_group(key:, column: nil)\n nxt_grp = nil\n loop do\n present = false...
[ "0.68172914", "0.64991117", "0.62917745", "0.5929225", "0.5854996", "0.5513255", "0.55100936", "0.54567105", "0.53013134", "0.5137092", "0.50440884", "0.49413303", "0.49269366", "0.49134558", "0.48350185", "0.4807618", "0.47779113", "0.4775579", "0.47449952", "0.4740155", "0....
0.6678437
1
Uses `PartProvenance` to associate the the provided provenance data to the next `PlateLayoutGenerator` index that does not point to a `Part` that already has a `DataAssociation` for `key` and returns the index
def associate_provenance_next_empty(key:, data:, column: nil) nxt = next_empty(key: key, column: column) associate_provenance(index: nxt, key: key, data: data) nxt end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def associate_provenance(index:, key:, data:)\n to_item = @collection.part(index[0], index[1])\n data.each do |datum|\n # Make sure you aren't modifying a shared data structure\n datum = datum.dup\n from_item = datum.delete(:item)\n next unless from_item\n\n add_one_to_one_provenance...
[ "0.6477951", "0.57901627", "0.5700883", "0.5564048", "0.55368006", "0.55280006", "0.51626694", "0.51211256", "0.5000737", "0.49885127", "0.46931034", "0.46424264", "0.46068454", "0.45953923", "0.44776878", "0.44267336", "0.4424584", "0.44055173", "0.43836135", "0.43748093", "...
0.58596385
1
Uses `PartProvenance` to associate the the provided provenance data to the next `PlateLayoutGenerator` group that does not point to any `Part` that already has a `DataAssociation` for `key` and returns the group
def associate_provenance_next_empty_group(key:, data:, column: nil) nxt_grp = next_empty_group(key: key, column: column) associate_provenance_group(group: nxt_grp, key: key, data: data) nxt_grp end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def associate_provenance_group(group:, key:, data:)\n group.each { |i| associate_provenance(index: i, key: key, data: data) }\n end", "def next_empty_group(key:, column: nil)\n nxt_grp = nil\n loop do\n present = false\n nxt_grp = @plate_layout_generator.next_group(column: column)\n nxt_...
[ "0.6793912", "0.62740415", "0.5797099", "0.5607999", "0.5503381", "0.5475673", "0.5182183", "0.5133383", "0.5096274", "0.50681597", "0.50385255", "0.49454376", "0.4882611", "0.47630045", "0.45781156", "0.4560484", "0.45411274", "0.45408794", "0.45351267", "0.45093793", "0.450...
0.7042014
0
Returns the next `PlateLayoutGenerator` index that does not point to a `Part` that already has a `DataAssociation` for `key`
def next_empty(key:, column: nil) nxt = nil loop do nxt = @plate_layout_generator.next(column: column) prt = @collection.part(nxt[0], nxt[1]) break unless prt.associations[key].present? end nxt end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_empty_group(key:, column: nil)\n nxt_grp = nil\n loop do\n present = false\n nxt_grp = @plate_layout_generator.next_group(column: column)\n nxt_grp.each do |nxt|\n prt = @collection.part(nxt[0], nxt[1])\n present = true if prt.associations[key].present?\n end\n ...
[ "0.65405226", "0.5942211", "0.55619794", "0.528716", "0.5225162", "0.5174815", "0.5139472", "0.50216407", "0.50196564", "0.50154644", "0.4963151", "0.49415654", "0.49338326", "0.4933023", "0.49326915", "0.49116734", "0.48869812", "0.48525", "0.48327938", "0.48089117", "0.4803...
0.69774055
0
Returns the next `PlateLayoutGenerator` group that does not point to any `Part` that already has a `DataAssociation` for `key`
def next_empty_group(key:, column: nil) nxt_grp = nil loop do present = false nxt_grp = @plate_layout_generator.next_group(column: column) nxt_grp.each do |nxt| prt = @collection.part(nxt[0], nxt[1]) present = true if prt.associations[key].present? end break unless ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_empty(key:, column: nil)\n nxt = nil\n loop do\n nxt = @plate_layout_generator.next(column: column)\n prt = @collection.part(nxt[0], nxt[1])\n break unless prt.associations[key].present?\n end\n nxt\n end", "def associate_provenance_next_empty_group(key:, data:, column: nil)\...
[ "0.69524837", "0.6101086", "0.59361655", "0.52430576", "0.4912924", "0.4870432", "0.4819509", "0.48089927", "0.47360072", "0.46827853", "0.46204066", "0.45795316", "0.45367178", "0.45304123", "0.44909653", "0.4483823", "0.44794866", "0.4472543", "0.44326454", "0.44163713", "0...
0.75623596
0
Associates the provided data to indices of the provided group
def associate_group(group:, key:, data:) group.each { |i| associate(index: i, key: key, data: data) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def associate_provenance_group(group:, key:, data:)\n group.each { |i| associate_provenance(index: i, key: key, data: data) }\n end", "def new_group(group_data)\n [:id, :name].each { |attr| raise(ArgumentError, \"Missing or Invalid Parameter(s)\") unless group_data.key?(attr) }\n set_values gro...
[ "0.67416966", "0.6142882", "0.6104321", "0.61020595", "0.6061986", "0.5891735", "0.58278316", "0.58257324", "0.57982236", "0.57477415", "0.5733891", "0.5626454", "0.5613145", "0.56051487", "0.5566776", "0.5530035", "0.54974705", "0.54666185", "0.54622287", "0.5443777", "0.542...
0.8008931
0
Uses `PartProvenance` to associate the provided provenance data to indices of the provided group
def associate_provenance_group(group:, key:, data:) group.each { |i| associate_provenance(index: i, key: key, data: data) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def associate_provenance(index:, key:, data:)\n to_item = @collection.part(index[0], index[1])\n data.each do |datum|\n # Make sure you aren't modifying a shared data structure\n datum = datum.dup\n from_item = datum.delete(:item)\n next unless from_item\n\n add_one_to_one_provenance...
[ "0.67136157", "0.6235457", "0.5779076", "0.54131764", "0.5331567", "0.5078494", "0.503049", "0.49707994", "0.49241692", "0.48848897", "0.48748967", "0.4873282", "0.48729163", "0.483511", "0.48283678", "0.48247018", "0.4814462", "0.48094878", "0.47611693", "0.47283557", "0.472...
0.8096723
0
Make a simple data association on a part
def associate(index:, key:, data:) part = @collection.part(index[0], index[1]) part.associate(key, data) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data_from_part(part, key)\n collection = Collection.find(part.containing_collection.id)\n assoc_map = AssociationMap.new(collection)\n row, column = collection.find(part).first\n assoc_map.getrc(row, column, key)\n end", "def associate_to_all(plate:, data:, key:)\n data_map = []\n part...
[ "0.6510663", "0.61354685", "0.5880508", "0.57716817", "0.5682008", "0.5647002", "0.55717236", "0.5539827", "0.5458112", "0.54136497", "0.53891444", "0.536369", "0.53148746", "0.5314481", "0.53099394", "0.5298437", "0.5252895", "0.52178603", "0.52098364", "0.51729363", "0.5133...
0.57628614
4
Uses `PartProvenance` to associate the provided provenance data to a part
def associate_provenance(index:, key:, data:) to_item = @collection.part(index[0], index[1]) data.each do |datum| # Make sure you aren't modifying a shared data structure datum = datum.dup from_item = datum.delete(:item) next unless from_item add_one_to_one_provenance( fro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_provenance(microtiter_plate:, pooling_groups:)\n pooling_groups.each do |pooling_group|\n microtiter_plate.associate_provenance_next_empty(\n key: :specimens,\n data: pooling_group.map { |item| hash_data(item) }\n )\n end\n microtiter_plate\n end", "def add_provenance(op...
[ "0.65157765", "0.63148683", "0.606592", "0.601527", "0.59647053", "0.5796112", "0.55413646", "0.55247736", "0.551125", "0.550243", "0.5501274", "0.5499958", "0.54989845", "0.5434715", "0.5402391", "0.5392849", "0.53836334", "0.5333054", "0.53026307", "0.5286446", "0.5285564",...
0.677699
0
Add provenance data to a sourcedestination pair of items
def add_one_to_one_provenance(from_item:, to_item:, additional_relation_data: nil) from_map = AssociationMap.new(from_item) to_map = AssociationMap.new(to_item) add_provenance( from: from_item, from_map: from_map, to: to_item, to_map: to_map, additional_rel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_provenance(opts = {})\n if opts[:from] == opts[:to] # special case: provenance between two parts on the same collection\n opts[:from_map] = opts[:to_map] # ensure from map and to map are the same object for this case\n end\n\n # creating information hashes to represent `from` and `to` relatio...
[ "0.6380065", "0.6141836", "0.6075465", "0.5900346", "0.57792103", "0.5444521", "0.53811145", "0.5372007", "0.536701", "0.5344161", "0.5334893", "0.5241568", "0.5235903", "0.52335835", "0.51819474", "0.51819474", "0.51598114", "0.51585704", "0.5145626", "0.51050013", "0.509929...
0.6567843
0
Exits if exec returns with nonzero
def exec_container(container) if shell? cmd = ['sh', '-c', cmd_list.join(' ')] else cmd = cmd_list end stdout = stderr = exit_status = nil if !silent? && (verbose? || all?) spinner "Executing command on #{container['name']}" do stdout, stderr, exit_statu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exit(res=0) end", "def exitstatus\n subexec.try(:exitstatus)\n end", "def exit!(res=0) end", "def exec?(cmd, options={})\n exit_status, stdout, stderr, cmd = exec(cmd, options)\n return (exit_status == 0)\n end", "def nonzero_exit?\n exit_code != 0\n end", "def ...
[ "0.70218587", "0.6982377", "0.68965137", "0.68484914", "0.67278475", "0.66783124", "0.6678243", "0.6665192", "0.6640637", "0.6625599", "0.6609808", "0.6602149", "0.65500224", "0.6476695", "0.6452898", "0.64461637", "0.6443826", "0.64292234", "0.6406234", "0.6405203", "0.63987...
0.0
-1
The answer value for a provided question. Use the user answer when available, otherwise return the default
def answer_for(options, q, default = nil) options[:answers][q] ? options[:answers][q] : default end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def questionAnswer(question)\n answer = questionAnswerRaw(question)\n \n answer = \"No Answer\" if answer == nil\n return answer\nend", "def answer_or_default( answer_string )\n if answer_string.length == 0 and not @default.nil?\n @default\n else\n answer_string\n end\n end", ...
[ "0.80405974", "0.776391", "0.7739546", "0.72546256", "0.71625596", "0.71526057", "0.71429825", "0.7065572", "0.70414495", "0.7036161", "0.7024638", "0.6998783", "0.6932393", "0.6882823", "0.68273336", "0.6776373", "0.67612636", "0.67491424", "0.6743428", "0.6743428", "0.67427...
0.79235953
1
When given a Puppet Enterprise version, a list of hosts and other qualifying data this method will return a hash (keyed from the hosts) of default Puppet Enterprise answer file data hashes.
def initialize(version, hosts, options) @version = version @hosts = hosts @options = options end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash\n [host_list, total_matching, total_returned].hash\n end", "def generate_answers\n masterless = @options[:masterless]\n return super if masterless\n\n dashboard = only_host_with_role(@hosts, 'dashboard')\n database = only_host_with_role(@hosts, 'database')\n master = onl...
[ "0.5951777", "0.5776697", "0.5720629", "0.5681756", "0.5564439", "0.5564439", "0.54411304", "0.5383849", "0.52861124", "0.5270958", "0.5265628", "0.52578545", "0.52279186", "0.5206134", "0.5143405", "0.5124085", "0.51171094", "0.51171094", "0.51079434", "0.50918365", "0.50888...
0.0
-1
Generate the answers hash based upon version, host and option information
def generate_answers raise "This should be handled by subclasses!" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def relevant_options_digest(options); end", "def hash\n Digest::SHA256.hexdigest( \"#{nonce}#{time}#{difficulty}#{prev}#{data}\" )\n end", "def optionsHash(length = 12)\n # Don't want to always need this as this may be difficult to compile\n require 'sha3'\n\n # Get only hash relevant options\n ...
[ "0.6459294", "0.6100906", "0.60921365", "0.5942519", "0.5844299", "0.5753256", "0.5717263", "0.56770957", "0.56613183", "0.56613183", "0.56613183", "0.56613183", "0.56613183", "0.56613183", "0.56613183", "0.56526387", "0.56146187", "0.5611874", "0.55981845", "0.5560235", "0.5...
0.0
-1
Access the answers hash for this version, host and option information. If the answers have not yet been calculated, generate them.
def answers @answers ||= generate_answers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_answers\n masterless = @options[:masterless]\n return super if masterless\n\n dashboard = only_host_with_role(@hosts, 'dashboard')\n database = only_host_with_role(@hosts, 'database')\n master = only_host_with_role(@hosts, 'master')\n\n the_answers = super\n if dashb...
[ "0.6382298", "0.5857721", "0.582952", "0.56384474", "0.5581891", "0.55714846", "0.5555667", "0.55388546", "0.53903055", "0.5387173", "0.53773034", "0.53362554", "0.5307407", "0.5247209", "0.5239797", "0.5239797", "0.52261156", "0.52082896", "0.5193107", "0.51836056", "0.51669...
0.57995737
3
This converts a data hash provided by answers, and returns a Puppet Enterprise compatible answer file ready for use.
def answer_string(host) answers[host.name].map { |k,v| "#{k}=#{v}" }.join("\n") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize\n File.open( FILENAME, 'wb' ){ |f| f << Marshal.dump( @all_answers ) }\n end", "def answer question\n\n # find the value that should be entered\n data = request[question[:reference_identifier]]\n\n response_set.responses.where(question_id: question).delete_all\n\n case quest...
[ "0.5846303", "0.54047763", "0.54047763", "0.5387925", "0.53844535", "0.53581506", "0.53395844", "0.5321591", "0.5320568", "0.52435416", "0.5227942", "0.5195245", "0.51787895", "0.5161282", "0.5131187", "0.5127659", "0.51257336", "0.5104417", "0.509635", "0.5068227", "0.504833...
0.5117595
17
Returns the javascript include tag for the specified javascript from the Google Libraries API. Javascript filenames have the format ., for instance: chromeframe.1.0.2 jquery.1.6.2
def google_javascript(input) return nil if input.blank? type,version = input.split('.', 2) filename = TYPE_FILENAME_MAPPING[type] return nil if filename.blank? # We weren't able to identify the type uri = "https://ajax.googleapis.com/ajax/libs/#{type}/#{version}/#{filename}" "<script type=\"t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def javascript_include_tag(*sources)\n html = []\n sources.each do |javascript|\n if is_uri?(javascript)\n path = javascript\n else\n path = url(\"/js/#{javascript}.js\")\n end\n html << \"<script type=\\\"text/javascript\\\" src=\\\"#{path}\\...
[ "0.71764576", "0.6773106", "0.6768482", "0.67271215", "0.66546947", "0.6640984", "0.65833473", "0.65833473", "0.65833473", "0.652887", "0.65142196", "0.65091693", "0.6486785", "0.6312885", "0.63054", "0.6282119", "0.6210019", "0.6180075", "0.6174339", "0.6167664", "0.61655176...
0.7116674
1
Asserts that _data_value_ is of valid type. Will yield to obtain origin of value in case an error is produced
def validate_data_value(value, &block) # The DataProvider.value_type is self recursive so further recursive check of collections is needed here unless value_is_validated? || DataProvider.value_type.instance?(value) actual_type = Types::TypeCalculator.singleton.infer(value) raise Types::TypeAssertion...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate(data_value, data_type=nil)\n #TODO: port from python runtime\n end", "def validate(data_value, data_type=nil)\n #TODO: port from python runtime\n end", "def check_value!(value)\n # Allow nil and Strings to fall back on the validations for typecasting\n ...
[ "0.7031982", "0.7031982", "0.69214916", "0.6744091", "0.6163328", "0.61336666", "0.60460234", "0.5982944", "0.5849593", "0.58429617", "0.58247435", "0.5820796", "0.57962906", "0.57953364", "0.57953364", "0.5757162", "0.5754922", "0.5723182", "0.57230645", "0.57123137", "0.570...
0.8077421
0
Create an empty file and the enclosing directory, if needed
def cf(file) FileUtils.mkdir_p(Pathname.new(file).dirname) File.open(file, "w+").close end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write\n make_parent_directory\n generate_file\n end", "def safe_make_empty_file(path)\n if File.exist? path\n File.open(path, 'r') do |f|\n if !f.read.empty?\n raise Error, Error::MSG_EMPTY_FILE_NOT_EMPTY% path\n...
[ "0.7246616", "0.669573", "0.6686611", "0.6661475", "0.66298187", "0.6609583", "0.6568293", "0.6544936", "0.65254426", "0.65131265", "0.64980865", "0.64920473", "0.6479002", "0.6479002", "0.64680946", "0.64642", "0.6425261", "0.6416362", "0.6404923", "0.63588864", "0.6353948",...
0.7109676
1
Adds JSON serialization to Ruby Date.
def to_json(*args) { 'json_class' => self.class.name, 'data' => to_s }.to_json(*args) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_date date\n \"Date.UTC(#{date.year}, #{date.month - 1}, #{date.day})\".to_json\n end", "def json_date\n start_time.to_i\n end", "def to_json\n super.merge(\n date: formatted_date(Time.current),\n taxOverride: tax_override\n )\n end", "def as_json...
[ "0.69536597", "0.68982327", "0.68658125", "0.66092074", "0.6497872", "0.64067763", "0.6311304", "0.62379843", "0.6214848", "0.6213776", "0.6046377", "0.59959406", "0.59781134", "0.58176744", "0.57937896", "0.5726447", "0.5704704", "0.5693765", "0.5690921", "0.56873995", "0.55...
0.53156567
64
HTTP is a stateless protocol, which means that each request is independent of others. In other words, each request knows nothing about the previous or next re quest. One way to overcome this and keep track of one request to the next is to use sessions
def current_user @current_user ||= User.find(session[:id]) if session[:id] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def session() request.session end", "def session ; request.session ; end", "def handle_request( req )\n\t\tres = req.response\n\t\tres.content_type = 'text/plain'\n\t\tres.status = HTTP::OK\n\n\t\t@runcount += 1\n\t\treq.session.counter ||= 0\n\t\treq.session.counter += 1\n\n\t\tself.log.debug \"Request sessio...
[ "0.675897", "0.64800274", "0.6225404", "0.6201703", "0.61126715", "0.60860944", "0.60860944", "0.60860944", "0.6070644", "0.6047108", "0.60408664", "0.60029703", "0.5992441", "0.5992441", "0.5992441", "0.5992441", "0.5992441", "0.5938033", "0.5938033", "0.59103566", "0.590300...
0.0
-1
This method determines whether a user is logged in or logged out. It does this by checking whether there's a user in the database with a given session id.
def require_user redirect(to('/')) unless current_user end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logged_in?\n return false unless session[:user_id]\n\n User.find_by_id(session[:user_id]).present?\n end", "def logged_in?\n if session[:user_id]\n @current_user = User.find( session[:user_id] )\n else\n @current_user = nil\n end\n end", "def logged_in?\n #If there i...
[ "0.83279115", "0.8221022", "0.79620844", "0.79563826", "0.79050606", "0.7879449", "0.78608173", "0.7845405", "0.7829342", "0.7828876", "0.78061265", "0.7792545", "0.77897966", "0.7747015", "0.77448344", "0.77360344", "0.7725032", "0.7725032", "0.7725032", "0.77195895", "0.771...
0.0
-1
Other is a symbol?
def ==(other) name == other end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def symbol; end", "def symbol; end", "def symbol; end", "def symbol; end", "def symbol; end", "def symbol; end", "def ==(other)\n self.symbol == other.symbol \n end", "def ==(other)\n other.is_a?(Symbol) && to_s == other.to_s\n end", "def symbol\n @symbol\n end", "def symbol\n...
[ "0.6987032", "0.6987032", "0.6987032", "0.6987032", "0.6987032", "0.6987032", "0.6866642", "0.6821684", "0.6711705", "0.668881", "0.65771985", "0.650439", "0.64355946", "0.63778", "0.63588166", "0.623209", "0.622912", "0.61434686", "0.6136974", "0.61349934", "0.6118233", "0...
0.0
-1
This method supports the show user page
def show require_login @user = User.find(params[:id]) @socials = Social::Social_type end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n show_user\n end", "def show\n set_user\n end", "def show\n set_user\n end", "def show\n require_user()\n end", "def show\n verifica_user\n end", "def show\n render_show @user\n end", "def show\n check_user\n end", "def show\n\n @user = User.get(params[:id...
[ "0.81832165", "0.81814516", "0.8038806", "0.80073977", "0.7891058", "0.78529", "0.7841985", "0.77080697", "0.7646778", "0.7624986", "0.76051277", "0.75910324", "0.75839406", "0.7577544", "0.75329024", "0.75138634", "0.75100213", "0.74970347", "0.74939805", "0.7484787", "0.747...
0.0
-1
This method is used to create a new user when it performs the login
def create email_hash = params.slice(:user)['user']['email'] params[:user].delete('email') incomplete_user = IncompleteUser.find(session[:tmp_checked]) incomplete_user_email = incomplete_user.email incomplete_user_psw = incomplete_user.password @user = User.new(user_params) unless email_hash == incomple...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n\t\t@user = User.create(user_params)\n\t\tlogin(@user)\n\t\tredirect_to root_path\n\tend", "def create\n # Note this is different to the usual situation where anybody can create\n # an account. Here, only administrators can create accounts for others;\n # and doing so does not log them out....
[ "0.7888874", "0.77276284", "0.7720797", "0.76549214", "0.76329666", "0.7625781", "0.7615701", "0.76117826", "0.7611749", "0.7603057", "0.7587926", "0.7586969", "0.75854737", "0.75840837", "0.7572125", "0.7567047", "0.7560029", "0.75557446", "0.755208", "0.7549381", "0.7545115...
0.0
-1
This method supports the new user page
def new @unregistered_user = IncompleteUser.find(session[:tmp_checked]) @user = User.new @user.preference_list = '0123' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_user\n \n end", "def add_new_user()\n new_user_link.click\n end", "def new_user\n \trender action: 'new_user'\n end", "def newUser\n end", "def new_user_handler\n nil\n end", "def new\n\t\t#super\n\t\t# Overwriting /signup method to redirect to users/new \n\t\t respond_to d...
[ "0.7594027", "0.7481601", "0.7385409", "0.7335356", "0.7283917", "0.7228225", "0.6977203", "0.6935315", "0.6922774", "0.6913505", "0.688151", "0.688086", "0.6809913", "0.6755543", "0.6748023", "0.67198426", "0.671846", "0.6714194", "0.66703516", "0.66562694", "0.6637267", "...
0.0
-1
This method is used for the autocomplete of user search input field
def index respond_to do |format| format.html {html_index} format.json {json_index} end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def autocomplete; end", "def search_list_field_enter(value)\n value_arr = value.chomp.split(':')\n text_field = ''\n s_filter = ''\n\n if value_arr.size > 0 # type in the field if filter is provided\n s_filter = value_arr.first\n text_field = @field.all(:css, 'input[type=\"text\...
[ "0.7731659", "0.74186677", "0.71923375", "0.70598143", "0.705232", "0.6976375", "0.6976375", "0.6976375", "0.6976375", "0.6976375", "0.6976375", "0.6976375", "0.6946762", "0.69445634", "0.6859632", "0.68354887", "0.6817868", "0.6807839", "0.6743563", "0.6741834", "0.67138433"...
0.0
-1
This method supports the edit user page
def edit @user = current_user primary_mail_id = @user.primary_email_id @emails = @user.emails.where.not(id: primary_mail_id) @email = Email.new @datafile = Email.new @socials = Social::Social_type end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit\n set_user\n end", "def edit\n # @user = User.find(params[:id]) -- not needed bc of correct_user\n end", "def edit\n # @user = User.find(params[:id])\n # already in correct_user\n end", "def edit_current_user\n end", "def edit\n get_user_for_edit\n end", "def edit\r\n \t@use...
[ "0.82427204", "0.804099", "0.80140376", "0.7984973", "0.7958188", "0.7932055", "0.79281807", "0.78901464", "0.7883613", "0.78581274", "0.7838442", "0.7837456", "0.783428", "0.78312474", "0.78224146", "0.78171873", "0.7792231", "0.77746737", "0.7753694", "0.77368456", "0.77334...
0.0
-1
This method manages the actions performed by an user in the edit page
def post_edit @user = current_user @emails = @user.emails.where.not(id: @user.primary_email_id) @email = Email.new case params[:commit] when "Create Email" #button clicked = Create Email email_params = {} email_params[:email] = params[:email][:email] email_params[:user_id] = @user.id e = Emai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit\n # Listing 9.14: Finding the correct user is now handled by the correct_user before_action.\n end", "def edit\n set_user\n end", "def edit\r\n \t@user = current_user\r\n end", "def edit\n \n end", "def edit\n\t\tadd_breadcrumb \"Editar\"\n\t\tif @request.user_id != current_user....
[ "0.7338469", "0.7250397", "0.724259", "0.72365415", "0.72141397", "0.71863174", "0.71863174", "0.71863174", "0.71863174", "0.71863174", "0.71863174", "0.71863174", "0.71863174", "0.71863174", "0.71863174", "0.71863174", "0.71863174", "0.71863174", "0.71863174", "0.71863174", ...
0.0
-1
This method is used to delete an email from the edit page
def delete_email check_delete_email_params Email.delete(params[:email_id]) redirect_to user_path(id: params[:user_id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n set_email.destroy\n flash[:notice] = \"Email Deleted!\"\n redirect_to user_emails_path(current_user.id)\n end", "def delete()\n\n Email.destroy(self.id)\n end", "def destroy\n @email = Email.find(params[:id])\n @email.destroy\n head :no_content\n end", "def destroy\n ...
[ "0.77885735", "0.766366", "0.76229596", "0.7616743", "0.7511517", "0.73967296", "0.7375267", "0.73481035", "0.73123914", "0.7312059", "0.72894984", "0.7249131", "0.7158159", "0.7140518", "0.71270204", "0.7123102", "0.7112408", "0.71078086", "0.7090759", "0.7076698", "0.703112...
0.7875284
0
This method supports the show contacts page
def contacts @user = current_user check_if_myself @contacts = @user.contacts end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_contacts\n\n # HINT: Make use of this method in the display_all_contacts and search_by_attribute methods to keep your code DRY\n end", "def display_contacts\n\n # HINT: Make use of this method in the display_all_contacts and search_by_attribute methods to keep your code DRY\n end", "def con...
[ "0.793493", "0.793493", "0.7888337", "0.7694679", "0.7656651", "0.75794786", "0.74390715", "0.74332875", "0.73690593", "0.7288707", "0.7282513", "0.72563475", "0.72541296", "0.72435164", "0.7202408", "0.71255404", "0.7113978", "0.70917654", "0.70726424", "0.707257", "0.707170...
0.6928226
44
This method is used to delete a contact from user's contacts
def delete_contact contact_delate_check(params[:user_id], params[:to_delete_id]) Contact.delete(Contact.where(from_user: params[:user_id], to_user: params[:to_delete_id])) redirect_to contacts_page_path(id: params[:user_id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_contact(contact_to_delete)\n @contacts.delete(contact_to_delete)\n end", "def delete(user)\n @@contact_list.delete(user)\n end", "def delete_which_contact\n\t\tputs \"What is the ID of the contact you want to delete?\"\n\t\tuser_id = gets.chomp.to_i\n\t\t@rolodex.delete_contact(user_id)\n\te...
[ "0.82244575", "0.8098966", "0.7891923", "0.7888279", "0.78874105", "0.7862307", "0.7846657", "0.7787941", "0.7752852", "0.7679015", "0.76473755", "0.7616056", "0.7535477", "0.75324464", "0.7522995", "0.75198907", "0.7469151", "0.7469151", "0.7349159", "0.73319376", "0.728935"...
0.8382306
0
This method adds a user as contact
def add_contact check_if_myself(params[:user_id]) user = User.find(params[:user_id]) to_add = User.find(params[:to_add_id]) if to_add && user != to_add && !Contact.where(from_user: user.id).map {|c| c.to_user.id}.include?(to_add.id) user.contacts.push(to_add) user.save redirect_to contacts_page_path(id...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_contact(ownnick, person)\n return ret_fail('can not add yourself') if person == ownnick #you cant add yourself !\n\n usr = User.first(:nickname=>person)\n return ret_fail('no such user') if usr == nil #user does not exist !\n\n ownusr = User.first(:nickname => ownnick) #get own record to ge...
[ "0.74213684", "0.71632856", "0.69989425", "0.68836844", "0.6841344", "0.67575413", "0.6682459", "0.6676431", "0.6672822", "0.6659771", "0.6636898", "0.65755504", "0.6556447", "0.65374225", "0.65073997", "0.64839387", "0.6469941", "0.64309514", "0.6389939", "0.63803345", "0.63...
0.8101707
0
This method is used from the autocomplete to retrieve users depending on the params passed by the current user (to add new users to contacts)
def search if params[:term] to_match = '%' + params[:term] + '%' @users = User.where("(name ILIKE :search OR surname ILIKE :search OR nickname ILIKE :search) AND id != :current_id", search: to_match, current_id: current_user.id) else @users = User.all end respond_to do |format| format.html # new.ht...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_collaborator\n # Search for email or name of collaborator\n projects = current_user.projects\n @users = Array.new\n projects.each do |project|\n project.users.each do |user|\n unless @users.include? user\n @users.push user\n end\n end\n end\n\n # Get al...
[ "0.69594246", "0.69464654", "0.6794147", "0.67490774", "0.67427784", "0.67258257", "0.66410637", "0.6637473", "0.6518822", "0.64790624", "0.643617", "0.6421465", "0.63957727", "0.63885045", "0.63500607", "0.6341176", "0.6338563", "0.6330349", "0.6313", "0.63112354", "0.631109...
0.633299
17
This method is used by the autocomplete process made only between user contacts (to invite them in a meeting)
def search_contacts if params[:term] to_match = '%' + params[:term] + '%' user = current_user users_not_to_find = user.contacts.all.ids users_not_to_find.push current_user.id @users = User.where("(name ILIKE :search OR surname ILIKE :search OR nickname ILIKE :search) AND id NOT IN (:ids)", search:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def auto_complete_for_message_to\n query = params[:message][:to]\n @people = Person.all(:order => \"last_name ASC\", :conditions => ['first_name LIKE ? or last_name LIKE ?', \"#{query}%\", \"#{query}%\"])\n render :partial=>\"auto_complete_for_message_to\"\n end", "def autoname\n# auto completed to get...
[ "0.65520525", "0.6282739", "0.61915505", "0.6113659", "0.60960805", "0.6054149", "0.60347867", "0.6007982", "0.5997467", "0.59742904", "0.5964227", "0.59366834", "0.5786866", "0.5778824", "0.5766424", "0.57434607", "0.5733368", "0.570088", "0.5678389", "0.5672674", "0.5636475...
0.51824933
65
This method supports the settings page
def settings check_if_myself @user = current_user end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def settings\n end", "def settings; end", "def settings; end", "def setting; end", "def settings\n\t\traise NotImplementedError\n\tend", "def settings\n @settings\n end", "def update_settings\n end", "def settings\n # TODO\n {}\n end", "def set_setting\n end...
[ "0.8385584", "0.8242885", "0.8242885", "0.81272787", "0.7985693", "0.75862", "0.7510948", "0.74442345", "0.7364441", "0.7319792", "0.7319792", "0.7137167", "0.7137167", "0.7134739", "0.7119315", "0.7098491", "0.70706505", "0.70471", "0.70069313", "0.70069313", "0.6990147", ...
0.7005464
20
This method is used to change the preference list of a user
def change_preference_list check_if_myself user = current_user new_preference_list = user_pref_list_params[:preference_list] if new_preference_list != user.preference_list user.update_attributes(user_pref_list_params) user.save RecomputeMeetingParticipationsJob.perform_later (0..6).to_a, user end r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_user_preferences\n @user_preferences = UserPreferences.find_or_create_by!(:user => current_user)\n end", "def update_prefs\n current_user.preferences = params[:preferences]\n render plain: \"1\"\n end", "def set_user_preference\n @user_preference = UserPreference.find(params[:id])\n...
[ "0.66547686", "0.6558003", "0.6524729", "0.64476854", "0.64293635", "0.6358194", "0.6345486", "0.626752", "0.61688876", "0.61386234", "0.6024854", "0.59728", "0.5967829", "0.59044576", "0.58895546", "0.588545", "0.5869184", "0.5840277", "0.5797096", "0.5790983", "0.5779872", ...
0.81347543
0
This method is used to delete a constraint
def delate_constraint delete_constraint_check(params[:user_id], params[:constraint_id]) Constraint.delete(params[:constraint_id]) redirect_to settings_page_path(id: params[:user_id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @constraint = Constraint.find(params[:id])\n @constraint.destroy\n\n respond_to do |format|\n format.html { redirect_to constraints_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @constraint.destroy\n respond_to do |format|\n format.html { re...
[ "0.72684", "0.72151077", "0.7175142", "0.6984992", "0.69482756", "0.688285", "0.65901315", "0.64825857", "0.6386152", "0.62334013", "0.62230605", "0.61510545", "0.6134497", "0.6129205", "0.60424924", "0.6033469", "0.5948109", "0.5938453", "0.5887634", "0.5879771", "0.5866563"...
0.6739322
6
This method supports the create constraint page
def add_constraint @back_path = request.referer @constraint = Constraint.new @operators = Operator.all @values = Value.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_constraint\n\t\ttravel_mean = params[:constraint][:travel_mean]\n\t\tsubject = Subject.find(params[:constraint][:subject].to_i)\n\t\toperator = Operator.find_by(description: params[:constraint][:operator], subject_id: subject.id)\n\t\tvalue = Value.find_by(value: params[:constraint][:value], subject_id:...
[ "0.7765343", "0.7436538", "0.7393957", "0.7306022", "0.72404075", "0.72404075", "0.72404075", "0.6804299", "0.66518956", "0.6639402", "0.6596902", "0.65670204", "0.6548838", "0.6451843", "0.63182855", "0.62349725", "0.6227016", "0.61399114", "0.61296815", "0.6044569", "0.6040...
0.6525886
13
This method is used to create a new constraint and add it to the user's ones
def create_constraint travel_mean = params[:constraint][:travel_mean] subject = Subject.find(params[:constraint][:subject].to_i) operator = Operator.find_by(description: params[:constraint][:operator], subject_id: subject.id) value = Value.find_by(value: params[:constraint][:value], subject_id: subject.id) c ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_constraint(constraint_def)\n @constraints << Constraint.new(constraint_def)\n end", "def add_constraint\n\t\t@back_path = request.referer\n\t\t@constraint = Constraint.new\n\t\t@operators = Operator.all\n\t\t@values = Value.all\n\tend", "def constraint_register(constraint)\n @registered_cons...
[ "0.7295912", "0.71040016", "0.6784608", "0.6632648", "0.65428877", "0.6458724", "0.6425911", "0.6407687", "0.63411057", "0.6326463", "0.63182354", "0.63064605", "0.6288292", "0.6274782", "0.62393004", "0.62393004", "0.62393004", "0.6223157", "0.62176603", "0.6214048", "0.6161...
0.71362704
1
This method is used to delete a social form the user page
def delete_social check_if_myself(params[:user_id]) SocialUser.find(params[:social_user_id]).delete redirect_to current_user end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n profile = 'adm'\n @rede_social.destroy\n exist_redesocial_to_user\n respond_to do |format|\n format.js { render :index }\n end\n end", "def delete_user\n end", "def delete\n\n unless params[:id]\n render json: {message: \" اطلاعات را به صورت کامل بفرستید \"}, statu...
[ "0.7024748", "0.69805187", "0.67530185", "0.67516994", "0.67392254", "0.66954327", "0.66783863", "0.66306365", "0.6596224", "0.65956265", "0.6583942", "0.6580585", "0.65700847", "0.6566479", "0.6561696", "0.65545684", "0.65500873", "0.6541863", "0.65408707", "0.6539933", "0.6...
0.79286325
0
This method returns all the user to be managed by an html format page
def html_index @users = User.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def users\n searchUrl = \"#{url}?page=userResults\"\n response = getHtml(searchUrl)\n if response.status == 200\n userCollection = response.body.scan /UserMatchFrame\\\">([^<]*)/\n c = userCollection.collect {|u| u[0]}\n return c\n else\n logInfoMsg(\"WARNING: userDomainAux.users ...
[ "0.668877", "0.64015085", "0.63568956", "0.6347309", "0.62336427", "0.6229221", "0.6189079", "0.61814284", "0.61720973", "0.6170663", "0.6163044", "0.6141525", "0.6141161", "0.61293447", "0.61179596", "0.6080596", "0.60786325", "0.6077988", "0.6076655", "0.60558784", "0.60132...
0.70064926
0
This method returns all the user retrieved by a query to be managed by a json format page
def json_index query = begin params.permit(:query).fetch(:query) rescue '' end users = User.where('LOWER(nickname) LIKE LOWER(:query)', query: "%#{query}%") render json: users.map(&:name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_users()\n @endpoint = \"/users.json?limit=100\"\n setup_get\n res = @http.request(@req)\n return JSON.load(res.body)[\"users\"].sort_by { |user| user[\"lastname\"] }\n end", "def users\n self.class.get(\"/user\", @options).parsed_response[\"items\"]\n end", "def get_users\r\n # Pr...
[ "0.75103045", "0.7466789", "0.7268593", "0.7268048", "0.7242129", "0.72122365", "0.71998936", "0.7182645", "0.7181612", "0.7174142", "0.71696514", "0.71305454", "0.712878", "0.71261305", "0.7116934", "0.70814437", "0.70756966", "0.70644176", "0.7050985", "0.70508564", "0.7043...
0.0
-1
This method checks if all the params used to create a new user are present
def user_params params.require(:user).permit(:name, :surname, :password, :nickname, :preference_list, :brief) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty_params\n\t\tif user_params[:email].blank? || user_params[:password].blank?\n\t\t\treturn error_log errors:{unauthenticated:[\"Please Provide Proper Parameters\"]}\n\t\tend\n\tend", "def user_params_exists\n return unless params[:user].blank?\n json_response({ success: false, message: \"Missing...
[ "0.7164698", "0.7155275", "0.7024128", "0.70238", "0.7014567", "0.7012934", "0.69700277", "0.6893588", "0.6893588", "0.6893588", "0.68783414", "0.6869238", "0.6866713", "0.68165076", "0.6792335", "0.6718533", "0.67162466", "0.6700342", "0.6692907", "0.6663469", "0.6661559", ...
0.0
-1
This method checks if all the params used to edit a user are present
def user_edit_params params.require(:user).permit(:name, :surname, :nickname, :phone_number, :website, :company, :brief) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_profile_edit_post(params)\n params[\"username\"] and params[\"password\"] and params[\"id\"]\n end", "def no_other_update_params?\n !@name && !@author && !@rank && @deprecated.nil? &&\n !@synonymize_with && !@clear_synonyms && !@correct_spelling\n end", "def valid?\n\t\tpa...
[ "0.72509986", "0.6842155", "0.68328494", "0.68028706", "0.67679745", "0.67337775", "0.671123", "0.66499025", "0.6603758", "0.657619", "0.65701115", "0.6555085", "0.65491855", "0.65149283", "0.6508507", "0.6488526", "0.64821845", "0.64816505", "0.6444176", "0.6438462", "0.6426...
0.0
-1
This method checks if the user that perform the action is really myself
def check_if_myself(id = params[:id].to_i) unless current_user.id == id.to_i raise ActionController::RoutingError, 'Not Found' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def action_allowed?(action_name, user)\n return false\n end", "def applies_to?(user); false end", "def check_if_user_can_perform_action_on_user\n is_current_user = (admin_user == @item)\n current_user_is_root = admin_user.is_root? && is_current_user\n\n case params[:action]\n ...
[ "0.7320912", "0.72577083", "0.70833087", "0.70642513", "0.703844", "0.6993344", "0.6961223", "0.69333106", "0.69281316", "0.68918836", "0.6829124", "0.68280137", "0.6810762", "0.68024427", "0.6775036", "0.6775036", "0.67569375", "0.67344534", "0.67319393", "0.6700319", "0.668...
0.0
-1
This method checks if the contact that the user want to delete is available in the user's contacts
def contact_delate_check(user, action_user) unless (current_user.id == user.to_i) && (current_user.contacts.where(id: action_user).count > 0) raise ActionController::RoutingError, 'Not Found' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy?\n @current_user.permission('FdpContact', :clerk)\n end", "def contact_add_check(user, action_user)\n\t\tunless (current_user.id == user.to_i) && (current_user.contacts.where(id: action_user).count == 0)\n\t\t\traise ActionController::RoutingError, 'Not Found'\n\t\tend\n\tend", "def delete_...
[ "0.69325614", "0.6664119", "0.6424727", "0.6381935", "0.6378756", "0.6367573", "0.6354562", "0.62632734", "0.62546265", "0.62256384", "0.62151504", "0.6156015", "0.6122976", "0.60634696", "0.60627395", "0.605331", "0.60482126", "0.60194314", "0.60102147", "0.5986006", "0.5983...
0.7293365
0
This method checks if the contact that the user want to add is not yet present in the user's contacts
def contact_add_check(user, action_user) unless (current_user.id == user.to_i) && (current_user.contacts.where(id: action_user).count == 0) raise ActionController::RoutingError, 'Not Found' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_contact?\n if self.contact_id == nil\n true\n else\n false\n end\n end", "def contact_delate_check(user, action_user)\n\t\tunless (current_user.id == user.to_i) && (current_user.contacts.where(id: action_user).count > 0)\n\t\t\traise ActionController::RoutingError, 'Not Found'\n\t\ten...
[ "0.6740203", "0.6734885", "0.65561813", "0.63857836", "0.632578", "0.63205135", "0.6312498", "0.63016814", "0.62649614", "0.6220879", "0.6216775", "0.6216525", "0.61199665", "0.6071551", "0.60549104", "0.60480505", "0.6033273", "0.6031844", "0.6022502", "0.5995543", "0.599293...
0.75268215
0
This method is used to check the consistency of params used in constraint delate options
def delete_constraint_check(user, constraint) unless (current_user.id == user.to_i) && (current_user.constraints.where(id: constraint).count > 0) raise ActionController::RoutingError, 'Not Found' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_parameter_constraints\n check_constraints_for_a if (@repository.parameters[:all])\n check_constraints_for_c if (@repository.parameters[:coord])\n check_constraints_for_d if (@repository.parameters[:delta])\n check_constraints_for_r if (@repository.parameters[:range])\n\n ...
[ "0.7012932", "0.6843744", "0.669429", "0.6453534", "0.64188826", "0.63767153", "0.6339371", "0.6224963", "0.62217563", "0.6213398", "0.6201554", "0.61923176", "0.6185578", "0.61494434", "0.61264133", "0.6110915", "0.6101735", "0.60905296", "0.6089386", "0.60627013", "0.603593...
0.0
-1
This method is used to check the consistency of params used in constraint add options
def check_constraint_params params.require(:constraint).permit(:travel_mean, :subject, :operator, :value) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_parameter_constraints\n check_constraints_for_a if (@repository.parameters[:all])\n check_constraints_for_c if (@repository.parameters[:coord])\n check_constraints_for_d if (@repository.parameters[:delta])\n check_constraints_for_r if (@repository.parameters[:range])\n\n ...
[ "0.70561177", "0.6788406", "0.6510865", "0.6421453", "0.64103496", "0.64101505", "0.6336813", "0.6325876", "0.6315899", "0.6314397", "0.62908876", "0.62855273", "0.6278673", "0.6265985", "0.62588847", "0.6219079", "0.6213065", "0.62078804", "0.6187731", "0.6178065", "0.617084...
0.71403736
0
This method is used to check the consistency of params used in deleting an email
def check_delete_email_params params.permit(:user_id, :email_id) unless (current_user.id == params[:user_id].to_i) && (current_user.emails.where(id: params[:email_id]).count > 0) raise ActionController::RoutingError, 'Not Found' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_email_change\n if changed.include?('email')\n answers.destroy_all\n # Every time the email address changes, generate a new access_key\n generate_access_key\n self.email_sent_at = nil\n self.status = 'created'\n end\n end", "def test_ut_t5_sef_con_004\n ...
[ "0.61033165", "0.60805154", "0.5874077", "0.58412164", "0.58395064", "0.5728386", "0.5704216", "0.5610562", "0.560995", "0.55764216", "0.5575436", "0.55574024", "0.55481106", "0.5546303", "0.5545942", "0.5527912", "0.5527912", "0.5527912", "0.5527912", "0.5527912", "0.5527912...
0.70867765
0
This method is used to check if the params are right in order to edit the preference list
def user_pref_list_params params.require(:user).permit(:preference_list) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_params; true; end", "def editing_contact_preferences?\n\t\t(params[:controller] == 'users' && params[:action] == 'edit_subscriptions') ||\n\t\t\t(params[:controller] == 'users/registrations' && params[:action] == 'edit' && (params[:contact_preferences].present? || params[:subscription_preferences].pres...
[ "0.63272226", "0.6268622", "0.6149336", "0.6103983", "0.6083712", "0.5957697", "0.5941346", "0.5892783", "0.58620614", "0.5841127", "0.5840292", "0.581279", "0.5786255", "0.57854295", "0.576313", "0.5760935", "0.5752153", "0.57331264", "0.57199126", "0.5716216", "0.5691038", ...
0.56220245
28
TODO add json response code
def new respond_to do |format| format.html format.json {render json: 'login'} end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def response_code; end", "def response_code; end", "def response_code; end", "def response_code; end", "def response_body; end", "def response_body; end", "def response; end", "def response; end", "def response; end", "def response; end", "def response; end", "def response; end", "def respo...
[ "0.7275478", "0.7275478", "0.7275478", "0.7275478", "0.69739354", "0.69739354", "0.6819909", "0.6819909", "0.6819909", "0.6819909", "0.6819909", "0.6819909", "0.6819909", "0.6819909", "0.6819909", "0.6819909", "0.6819909", "0.6819909", "0.6819909", "0.68043905", "0.661916", ...
0.0
-1
Some information to store in the node. Defaults to the basename of the file/directory
def value @value ||= basename end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filename\n @data[:name]\n end", "def file_name\n @file_name ||= File.basename tree\n end", "def file name\n \n end", "def path\n @filename\n end", "def dir\n @data['info']['name']\n end", "def filename\n @properties[:filename]\n end", "def name() @fil...
[ "0.6821772", "0.6574911", "0.6529054", "0.65166616", "0.6439335", "0.64312196", "0.6413315", "0.6413256", "0.63698477", "0.63696915", "0.6359682", "0.63356346", "0.63001007", "0.6297597", "0.6297597", "0.6297597", "0.6297597", "0.62961715", "0.6282888", "0.6282888", "0.627746...
0.66321915
1
To finish and polish + implement
def popularity(id, item) if item == "course" tweets = Tweet.find_all_by_course_id(id).count if UrlData.find_by_course_id(id).nil? links = 0 else links = UrlData.find_by_course_id(id).moz_backlinks.to_f + UrlData.find_by_course_id(id).google_backlinks.to_f end elsif item == "tutor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def suivre; end", "def probers; end", "def schubert; end", "def anchored; end", "def private; end", "def formation; end", "def schumann; end", "def romeo_and_juliet; end", "def villian; end", "def terpene; end", "def transact; end", "def who_we_are\r\n end", "def celebration; end", "def ...
[ "0.69811827", "0.65587014", "0.65293616", "0.6307673", "0.6291265", "0.61590517", "0.6075", "0.60638213", "0.6057485", "0.60451466", "0.60386646", "0.60002494", "0.59686726", "0.5963682", "0.5963682", "0.59566295", "0.5929118", "0.58973604", "0.5889566", "0.58837074", "0.5881...
0.0
-1
all_backlinks method (below) is currently not used. Integrate this when I want to have weighted averages based on URL backlinks.
def all_backlinks @data = UrlData.all @backlinks = Array.new @data.each do |details| @backlinks.push details.google_backlinks @backlinks.push details.moz_backlinks end @backlinks = @backlinks.compact.reject { |s| s.blank? } @backlinks = @backlinks.inject(:+) return @backlinks end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_backlinks\n @backlinks = []\n end", "def backlinks(title, filter = \"all\")\n titles = []\n blcontinue = nil\n begin\n form_data =\n {'action' => 'query',\n 'list' => 'backlinks',\n 'bltitle' => title,\n 'blfilterredir' => filter,\n ...
[ "0.663893", "0.66040057", "0.6275093", "0.59426093", "0.57969403", "0.57712054", "0.57585806", "0.5751714", "0.5725287", "0.57196546", "0.57118744", "0.56679374", "0.56400716", "0.5589269", "0.5566351", "0.5539242", "0.54948324", "0.54794735", "0.547814", "0.5471509", "0.5450...
0.79514956
0
GET /articles GET /articles.json
def index @q = Article.search(params[:q]) @articles = Article.search(params[:q]).result.page(params[:page]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def articles\n @articles = Article.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @administration }\n end\n end", "def index\n @articles = Article.all\n\n respond_to do |format|\n format.json { render json: @articles }\n end\n end", ...
[ "0.7823242", "0.7757662", "0.77491444", "0.7650022", "0.7650022", "0.7650022", "0.7650022", "0.7650022", "0.7650022", "0.7612499", "0.75499934", "0.744125", "0.73619306", "0.7355765", "0.7355765", "0.7355765", "0.7355765", "0.7355765", "0.7355765", "0.7355765", "0.7355765", ...
0.0
-1
GET /articles/1 GET /articles/1.json
def show @comments = @article.comments.order(created_at: :asc).page params[:page] @comment = @article.comments.build end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @article = Article.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @articles }\n end\n end", "def show\n @article = Article.where(id: params[:id]).last\n\n respond_to do |format|\n format.html # show.html.er...
[ "0.7745946", "0.75169533", "0.7514653", "0.7483779", "0.74794465", "0.74741095", "0.74741095", "0.74741095", "0.74741095", "0.74741095", "0.74741095", "0.74741095", "0.74741095", "0.74741095", "0.74741095", "0.74741095", "0.74741095", "0.74741095", "0.74741095", "0.7427753", ...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_article @article = params[:id] ? Article.find(params[:id]) : Article.new(article_params) 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.6163754", "0.6045816", "0.5944853", "0.59169096", "0.58892167", "0.58342934", "0.5776148", "0.57057375", "0.57057375", "0.56534296", "0.56209534", "0.54244673", "0.54101455", "0.54101455", "0.54101455", "0.53951085", "0.5378493", "0.53563684", "0.53399915", "0.5338049", "0...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def article_params params.require(:article).permit(:user_id, :source_url, :comment_authors) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1