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 |
|---|---|---|---|---|---|---|
The parent dir of the application directory. | def applications_path
Pathname.new('apps')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def absolute_parent_path\n File.dirname absolute_path\n end",
"def parent_directory\n File.dirname(@full_path).split('/').last\n end",
"def parent_directory\n File.dirname(@full_path).split('/').last\n end",
"def parent_dir path\r\n\t(File.basename File.dirname path).gsub(/\\s+/, ' ').str... | [
"0.8026983",
"0.78328216",
"0.78328216",
"0.7808164",
"0.7569297",
"0.7398004",
"0.7360503",
"0.73574716",
"0.72306895",
"0.71784055",
"0.71624905",
"0.7157146",
"0.7118584",
"0.7118584",
"0.70815283",
"0.70673686",
"0.70673686",
"0.70641273",
"0.70425725",
"0.7010295",
"0.70... | 0.0 | -1 |
Raw Authorization Header token (json web token format) JWT's are stored in the Authorization header using this format: Bearer somerandomstring.encodedpayload.anotherrandomstring | def http_auth_token
request.headers['Authorization']&.split(' ')&.last
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def jwt_auth_header\n { Authorization: \"Bearer #{Quovo::Token.get}\" }\n end",
"def jwt_from_header\n @jwt_from_header ||= request.headers[Config.jwt_header].to_s.sub(TOKEN_REGEX, '')\n end",
"def payload\n auth_header = request.headers['Authorization']\n token = auth_hea... | [
"0.76294076",
"0.7576455",
"0.74506223",
"0.7321445",
"0.71380186",
"0.7110111",
"0.70815706",
"0.7078726",
"0.70770496",
"0.70699674",
"0.70699674",
"0.70699674",
"0.70699674",
"0.70699674",
"0.70699674",
"0.70699674",
"0.70699674",
"0.70682144",
"0.7049258",
"0.7031752",
"0... | 0.6440256 | 71 |
display the automaton using grapheasy, maybe UNIXcentric | def visualize
require 'open3'
Open3.popen3('graph-easy') do |i,o,_|
i.write to_graph_easy
i.close
puts o.read
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def display\n if command\n write_green \"\\t#{hname}\"\n command && write_cyan(\"\\t vite-faits #{command}\")\n end\n # TODO Quand on pourra sortir une version HTML, on pourra mettre\n # un lien vers le mode d'emploi.\n # manuel && puts(\"\\t Anc... | [
"0.63903505",
"0.6293546",
"0.6293546",
"0.60507196",
"0.60325366",
"0.59467506",
"0.59433496",
"0.5854406",
"0.5818689",
"0.57836676",
"0.5775957",
"0.57752645",
"0.57649124",
"0.5757391",
"0.57376564",
"0.5737171",
"0.5736585",
"0.57258064",
"0.571504",
"0.57111245",
"0.570... | 0.5923839 | 7 |
display the automaton by using dot and ImageMagick "display", UNIXcentric | def x_visualize
require 'open3'
Open3.popen3('dot -T svg | display') do |i,o,_|
i.write to_dot
i.close
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def S(args)\n puts \"\\n=>\\n\"\n @image.show\n end",
"def show_image_version\n if @options[\"mode\"] == \"himage\"\n tpl = @himage_tpl\n elsif @options[\"mode\"] == \"vimage\"\n tpl = @vimage_tpl\n else \n raise \"invalid template name\" + @options[\"mode\"]\n ... | [
"0.62349623",
"0.6222115",
"0.619665",
"0.61760336",
"0.6168078",
"0.6124744",
"0.61206865",
"0.61131585",
"0.6106796",
"0.6033776",
"0.6033776",
"0.60085464",
"0.59949666",
"0.59693646",
"0.5935448",
"0.59217054",
"0.58893025",
"0.5878904",
"0.58459735",
"0.5843252",
"0.5820... | 0.6474302 | 0 |
GET /admin/pages GET /admin/pages.xml | def index
@pages = @pages.where(brand_id: website.brand_id).order(Arel.sql("UPPER(title)"))
respond_to do |format|
format.html { render_template } # index.html.erb
format.xml { render xml: @pages }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @pages = current_cms.pages.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pages }\n end\n end",
"def index\n @admin_pages = Admin::Page.all\n end",
"def index\n @pages = @user.pages\n\n respond_to do |format|\n format... | [
"0.72494274",
"0.7114558",
"0.71042514",
"0.7095962",
"0.69118035",
"0.6901082",
"0.6879269",
"0.686222",
"0.6823825",
"0.678781",
"0.678781",
"0.67847884",
"0.67847884",
"0.6765336",
"0.67461354",
"0.6742868",
"0.6728418",
"0.6715543",
"0.6707028",
"0.6706427",
"0.6699062",
... | 0.0 | -1 |
GET /admin/pages/1 GET /admin/pages/1.xml | def show
respond_to do |format|
format.html { render_template } # show.html.erb
format.xml { render xml: @page }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @pages = current_cms.pages.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pages }\n end\n end",
"def index\n @admin_pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end",
"def index\n... | [
"0.7095908",
"0.69276845",
"0.6913335",
"0.6846161",
"0.68016094",
"0.6728632",
"0.671026",
"0.6692609",
"0.66720855",
"0.6671938",
"0.6671938",
"0.6671676",
"0.6671676",
"0.66677547",
"0.6651493",
"0.66511476",
"0.662452",
"0.66110086",
"0.66034734",
"0.65119076",
"0.6511531... | 0.0 | -1 |
GET /admin/pages/new GET /admin/pages/new.xml | def new
respond_to do |format|
format.html { render_template } # new.html.erb
format.xml { render xml: @page }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @page = current_cms.pages.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n @page = Page.new\n @pagelist = @club.all_pages\n \n @page_title = \"New Page\"\n @site_section = \"admin\"\n respon... | [
"0.78354585",
"0.7419854",
"0.73942095",
"0.73942095",
"0.73942095",
"0.73942095",
"0.73942095",
"0.73942095",
"0.73898774",
"0.73880357",
"0.73879457",
"0.7343597",
"0.7338107",
"0.72051036",
"0.71994543",
"0.7171126",
"0.7156653",
"0.7132539",
"0.7129191",
"0.7129191",
"0.7... | 0.7366771 | 11 |
POST /admin/pages POST /admin/pages.xml | def create
@page.brand = website.brand
respond_to do |format|
if @page.save
format.html { redirect_to([:admin, @page], notice: 'Page was successfully created.') }
format.xml { render xml: @page, status: :created, location: @page }
website.add_log(user: current_user, action: "Creat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @page = Page.new(params[:page])\n\n respond_to do |format|\n if @page.save\n flash[:notice] = t(:page_created)\n format.html { redirect_back_or_default(admin_page_path(@page)) }\n format.xml { render :xml => @page, :status => :created, :location => @page }\n else\... | [
"0.66868526",
"0.6643903",
"0.6587547",
"0.6579609",
"0.6546693",
"0.6506215",
"0.64817894",
"0.6454249",
"0.6416713",
"0.63945496",
"0.6376846",
"0.63286895",
"0.63086885",
"0.6308464",
"0.6252604",
"0.62381184",
"0.6225332",
"0.62252176",
"0.61994827",
"0.6197183",
"0.61944... | 0.58258355 | 66 |
PUT /admin/pages/1 PUT /admin/pages/1.xml | def update
respond_to do |format|
if @page.update(page_params)
format.html { redirect_to([:admin, @page], notice: 'Page was successfully updated.') }
format.xml { head :ok }
website.add_log(user: current_user, action: "Updated page: #{@page.title}")
else
format.html { re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |wants|\n if @page.update_attributes(params[:page])\n \n flash[:notice] = 'Страница сохранена.'\n wants.html { redirect_to(admin_pages_url) }\n wants.xml { head :ok }\n else\n wants.html { render :action => \"edit\" }\n wants.xml {... | [
"0.6756916",
"0.657058",
"0.65675324",
"0.65170234",
"0.6457259",
"0.64269245",
"0.6402015",
"0.6318207",
"0.6275303",
"0.6270741",
"0.6260017",
"0.6219958",
"0.62089366",
"0.6204881",
"0.6204881",
"0.6204065",
"0.6203084",
"0.61968106",
"0.6166512",
"0.6165527",
"0.6164243",... | 0.65377307 | 3 |
DELETE /admin/pages/1 DELETE /admin/pages/1.xml | def destroy
@page.destroy
respond_to do |format|
format.html { redirect_to(admin_pages_url) }
format.xml { head :ok }
end
website.add_log(user: current_user, action: "Deleted page: #{@page.title}")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @page.destroy\n\n respond_to do |wants|\n wants.html { redirect_to(admin_pages_url) }\n wants.xml { head :ok }\n end\n end",
"def destroy\n @admin_page = Page.find(params[:id])\n @admin_page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url)... | [
"0.70923305",
"0.7091852",
"0.7056376",
"0.6994631",
"0.6940769",
"0.6936795",
"0.69248426",
"0.68948275",
"0.6761814",
"0.67394954",
"0.67394954",
"0.67394954",
"0.67394954",
"0.67394954",
"0.67394954",
"0.67394954",
"0.67394954",
"0.67026585",
"0.6691693",
"0.6650849",
"0.6... | 0.7288698 | 0 |
=== Synopsis Basic Middleware usage: use Footprint::Middleware Advanced Middleware usage: use Footprint::Middleware do set Logger, STDOUT end Clazz init: Footprint::Middleware.new app => === Args +app+:: Rack application instance. +block+:: Optional block, used to instance_eval (defaults to nil) === Description Initial... | def initialize(app, &block)
@app = app
set Footprint::Log::Basic, STDOUT
@app.class.send(:define_method, :logger,
Proc.new do
@env[:footprint_logger]
end)
self.instance_eval &block if block
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def use(*args, &block)\n @middleware << [args, block].freeze\n @app = nil\n end",
"def use(middleware, *args)\n @app = middleware.new(@app, *args)\n end",
"def use(*args, &block)\n @middleware.insert(@position, [args, block])\n @app.send(:build_rack_app)\n ... | [
"0.68013614",
"0.6453099",
"0.6265575",
"0.62594754",
"0.62332976",
"0.62328386",
"0.62194526",
"0.6097882",
"0.6047174",
"0.6031064",
"0.59565735",
"0.595316",
"0.59503764",
"0.59459513",
"0.5943646",
"0.5902564",
"0.589487",
"0.5886108",
"0.5878953",
"0.5796505",
"0.5773638... | 0.7762456 | 0 |
=== Synopsis Footprint:Middleware.call env => env === Args +env+:: Rack request environment. === Return +env+ returned always. === Description The current instance of the logger is set on env[:footprint_logger] and the app is called further with the enriched env. | def call(env)
env[:footprint_logger] = @logger
@app.call env
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def call(env)\n @middleware.call(env)\n end",
"def call(env)\n middleware_module = lookup_middleware_module\n app_wrapped_with_middleware = middleware_module.new(@app, *@args_for_middleware_new, &@block_for_middleware_new)\n app_wrapped_with_middleware.call(env) \n end",
"def call(env... | [
"0.7251969",
"0.6908903",
"0.67501915",
"0.6553351",
"0.6514195",
"0.6492135",
"0.6469755",
"0.64694256",
"0.6416528",
"0.6320163",
"0.6320163",
"0.6315802",
"0.6315802",
"0.6292118",
"0.62902784",
"0.62782794",
"0.6266529",
"0.6266529",
"0.6227855",
"0.61976236",
"0.61955297... | 0.79847354 | 0 |
=== Synopsis Basic usage: Footprint.Middleware.set Logger, STDOUT => logger === Args +clazz+:: Any Logger class that has the default Logger methods. +args+:: Optional array of arguments passed to the Logger class for initialize (defaults to nil) === Return +logger+ returned always. === Description Initialize the curren... | def set clazz, *args
@logger = clazz.send(:new, *args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def logger!(_output)\n @logger = Logger.new(_output)\n end",
"def logger=(logger)\n self['logger'] = (logger.kind_of?(Class) ? logger.new($stdout) : logger)\n end",
"def setup_logger(logger = nil)\n # If a logger is specified we replace the existing.\n @logger = logger\n\n # Otherwis... | [
"0.6364695",
"0.6280565",
"0.62085307",
"0.619142",
"0.619142",
"0.619142",
"0.619142",
"0.619142",
"0.619142",
"0.619142",
"0.6148438",
"0.6148438",
"0.61321485",
"0.6108803",
"0.60728455",
"0.60728455",
"0.6071512",
"0.6071512",
"0.6071512",
"0.6032253",
"0.6014989",
"0.6... | 0.8185064 | 0 |
GET /guacs GET /guacs.json | def index
@guacs = Guac.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @guys = Guy.all\n respond_to do |format|\n format.json { render json: @guys }\n end\n end",
"def index\n base_url = 'https://www.googleapis.com/books/v1/volumes?q=fiction&maxResults=20'\n and_key = '&key='\n key = ENV['GOOGLE_BOOKS_API_KEY'] \n googleurl = base_url + and_key + key\... | [
"0.6145909",
"0.60811895",
"0.60698766",
"0.5928476",
"0.58966756",
"0.58937097",
"0.586491",
"0.5863019",
"0.58370763",
"0.5799076",
"0.5790835",
"0.5724872",
"0.5721957",
"0.571779",
"0.5704836",
"0.5683135",
"0.56814504",
"0.5659373",
"0.5647515",
"0.5630353",
"0.5629705",... | 0.68044335 | 0 |
GET /guacs/1 GET /guacs/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @guacs = Guac.all\n end",
"def index\n @guys = Guy.all\n respond_to do |format|\n format.json { render json: @guys }\n end\n end",
"def index\n base_url = 'https://www.googleapis.com/books/v1/volumes?q=fiction&maxResults=20'\n and_key = '&key='\n key = ENV['GOOGLE_BOOKS_API_KE... | [
"0.66014916",
"0.61814666",
"0.61203855",
"0.60841095",
"0.6077395",
"0.60492444",
"0.6045555",
"0.6044992",
"0.6036763",
"0.59948474",
"0.59297854",
"0.587255",
"0.58525664",
"0.5831108",
"0.5829877",
"0.58200693",
"0.5807902",
"0.5790839",
"0.57870424",
"0.5783321",
"0.5772... | 0.0 | -1 |
POST /guacs POST /guacs.json | def create
@guac = Guac.new(guac_params)
respond_to do |format|
if @guac.save
format.html { redirect_to @guac, notice: 'Guac was successfully created.' }
format.json { render :show, status: :created, location: @guac }
else
format.html { render :new }
format.json { re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def guac_params\n params.require(:guac).permit(:name, :avacado, :mixins, :time_to_make, :cost, :date_created, :time_put_in)\n end",
"def create\n @glucose = Glucose.new(glucose_params)\n @glucose.user = current_user unless @glucose.user_id\n\n if @glucose.save\n render json: @glucose, statu... | [
"0.5988852",
"0.5848638",
"0.57357734",
"0.57235193",
"0.5714507",
"0.5680971",
"0.55640227",
"0.55479366",
"0.5534199",
"0.5491147",
"0.548721",
"0.54657286",
"0.54356515",
"0.5375847",
"0.5375248",
"0.53710926",
"0.5353402",
"0.5341635",
"0.53408384",
"0.53299195",
"0.53221... | 0.6526528 | 0 |
PATCH/PUT /guacs/1 PATCH/PUT /guacs/1.json | def update
respond_to do |format|
if @guac.update(guac_params)
format.html { redirect_to @guac, notice: 'Guac was successfully updated.' }
format.json { render :show, status: :ok, location: @guac }
else
format.html { render :edit }
format.json { render json: @guac.errors,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"def patch!\n request! :patch\n end",
"def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"def ... | [
"0.64288604",
"0.6379839",
"0.6332819",
"0.6194681",
"0.6127871",
"0.6053299",
"0.6011809",
"0.6005452",
"0.598479",
"0.5975892",
"0.59623736",
"0.59588856",
"0.59353673",
"0.59353673",
"0.5921238",
"0.5902167",
"0.5894064",
"0.58936536",
"0.58901435",
"0.58832186",
"0.587987... | 0.6060467 | 5 |
DELETE /guacs/1 DELETE /guacs/1.json | def destroy
@guac.destroy
respond_to do |format|
format.html { redirect_to guacs_url, notice: 'Guac was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n client.delete(\"/#{id}\")\n end",
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def delete path\n make_request(path, \"d... | [
"0.6834513",
"0.6737195",
"0.67369723",
"0.6731899",
"0.66497743",
"0.6588335",
"0.65759224",
"0.65645105",
"0.65645105",
"0.65645105",
"0.65645105",
"0.65571636",
"0.6550453",
"0.65399384",
"0.65274024",
"0.6522569",
"0.65092754",
"0.6499528",
"0.6462612",
"0.64533836",
"0.6... | 0.6900012 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_guac
@guac = Guac.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.6164095",
"0.6046031",
"0.5945298",
"0.59179014",
"0.58890367",
"0.58341795",
"0.5776118",
"0.5700777",
"0.5700777",
"0.5656277",
"0.56218207",
"0.5423995",
"0.5411516",
"0.5411516",
"0.5411516",
"0.5395004",
"0.53783494",
"0.53593004",
"0.53412604",
"0.534078",
"0.5332865... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def guac_params
params.require(:guac).permit(:name, :avacado, :mixins, :time_to_make, :cost, :date_created, :time_put_in)
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.6981273",
"0.6783789",
"0.67460483",
"0.6742222",
"0.67354137",
"0.65934366",
"0.65028495",
"0.6497783",
"0.64826745",
"0.6479415",
"0.6456823",
"0.6440081",
"0.63800216",
"0.6376521",
"0.636652",
"0.6319898",
"0.6300256",
"0.62994003",
"0.6293621",
"0.6292629",
"0.6291586... | 0.0 | -1 |
needed to call background job lambda | def scrape
slack_response_url = params[:response_url]
image_page_url, desired_image_subject = parse_args(params[:text])
ScrapeAndFilterImagesJob.perform_later(:run, {
desired_image_subject: desired_image_subject,
image_page_url: image_page_url,
slack_response_url: slack_response_url
})... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run_job\n end",
"def queue_job; end",
"def execute_in_background(args); end",
"def invoke_job\n payload_object.perform\n end",
"def execute_cron_job\n lambda do\n |request, jle|\n $db_lock.synchronize {\n jle.run_status = 'Running'\n jle.start_time = Time.now\n ... | [
"0.6719414",
"0.6706212",
"0.64986473",
"0.6427668",
"0.62453866",
"0.6120858",
"0.6115083",
"0.60907614",
"0.60421777",
"0.5937048",
"0.59358495",
"0.5863716",
"0.58582914",
"0.5790955",
"0.5773759",
"0.5758755",
"0.5723984",
"0.57172424",
"0.5660502",
"0.56462216",
"0.56268... | 0.0 | -1 |
frequent integer. These integers might be positive or negative. If no mostfrequent integer exists, return nil. | def find_most_frequent_integer(arr)
empty = {}
max = {}
num = nil
i = 0
while i < arr.length
if empty.has_key?(arr[i]) == true
empty[arr[i]] += 1
else
empty[arr[i]] = 1
end
i+=1
end
empty.each do |key,value|
if value ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_most_frequent_integer(arr)\n counts = Hash.new(0)\n\n arr.each do |int|\n counts[int] += 1\n end\n\n freq = counts.values\n # returns array of frequencies [2,1]\n\n if freq.uniq! == false && freq.uniq.length > 1\n freq.max\n counts.key(freq.max)\n else\n nil\n end\n\n \nend",
"def f... | [
"0.76365495",
"0.75817657",
"0.74882746",
"0.747606",
"0.7322126",
"0.72392774",
"0.7193826",
"0.7154991",
"0.68894386",
"0.6617766",
"0.6280053",
"0.6215728",
"0.6188827",
"0.61881554",
"0.61516285",
"0.6139652",
"0.61248296",
"0.6121235",
"0.60843205",
"0.60548663",
"0.6051... | 0.70096934 | 8 |
Main (high level) logic | def main
puts "Started"
Dir.foreach(@rootdir) {|filename|
if filename =~ /.*[.]pbl/i
this_filename = File.basename(filename.downcase, '.pbl')
unless this_filename == @applpbl.downcase
pathname = (@rootdir + '\\' + filename).downcase
new_dir = @rootdir + '\\' + File.basename(fi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def main\n\n end",
"def main; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def main\n end",
"def run() end",
"def main\n\n\n operations.running.retrieve interactive: false\n s... | [
"0.72094744",
"0.7127813",
"0.7050147",
"0.7050147",
"0.7050147",
"0.7050147",
"0.7050147",
"0.7050147",
"0.7050147",
"0.7050147",
"0.7050147",
"0.70207655",
"0.7015403",
"0.6911874",
"0.6735174",
"0.6715904",
"0.6715904",
"0.6687553",
"0.66633254",
"0.66475147",
"0.6612109",... | 0.0 | -1 |
Helper classes and methods needed by main logic above begin here | def update_lib_path_file
pathname = (@rootdir + '\\' + @libfile).downcase
fw = File.new(pathname + '.new', 'w')
f = File.new(pathname)
f.each {|l|
line = l.chomp.chomp(';')
if File.basename(line.downcase, '.pbl') == @applpbl.downcase
puts l
fw.puts l
else
puts line.gsub(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def main\n\n end",
"def main; end",
"def main\n end",
"def private; end",
"def probers; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def common\n \n end",
"def helpers; end"... | [
"0.6857941",
"0.66636556",
"0.6639595",
"0.6557355",
"0.64919066",
"0.6470408",
"0.6470408",
"0.6470408",
"0.6470408",
"0.6470408",
"0.6470408",
"0.6470408",
"0.6470408",
"0.6470408",
"0.6440127",
"0.641328",
"0.641328",
"0.641328",
"0.62877405",
"0.62764823",
"0.62764823",
... | 0.0 | -1 |
Extract from +data+ one item of +type+ | def process_data(type, data)
case type
when :boolean
MuseekBindings::BinUtils.unpack_boolean(data)
when :uint32
MuseekBindings::BinUtils.unpack_uint32(data)
when :uint64
MuseekBindings::BinUtils.unpack_uint64(data)
when :string
MuseekBindings::BinUtils.unpack_string(data)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pluck_sir_trevor_type(json, type) \n hash = JSON.parse(json)\n if hash.has_key?(\"data\")\n item = hash[\"data\"].select { |item| item[\"type\"] == type }\n item.first\n end\n end",
"def parseData(result, type, data)\n if (type == \"crc\")\n if ... | [
"0.7007442",
"0.64844394",
"0.64736116",
"0.6421314",
"0.6395345",
"0.6280404",
"0.6223519",
"0.61258143",
"0.5999223",
"0.5961834",
"0.5945945",
"0.5924336",
"0.59232855",
"0.58743787",
"0.5870026",
"0.5832398",
"0.5832217",
"0.57929355",
"0.57694393",
"0.57660675",
"0.57336... | 0.6549626 | 1 |
GET /tasks GET /tasks.json | def index
@tasks = Task.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tasks\n uri = URI(BASE_URL + TASKS_ENDPOINT)\n\n make_request(uri)\n end",
"def tasks\n @todos = Todo.all\n render json: @todos\n end",
"def index\n render json: {\n tasks: tasks.map(&:to_hash)\n }\n end",
"def index\n @tasks = Task.all\n\n render json: @tasks\n end",
"... | [
"0.7889543",
"0.7751927",
"0.7619872",
"0.75984913",
"0.75936216",
"0.7505406",
"0.7464987",
"0.74337274",
"0.7383206",
"0.7344766",
"0.7322099",
"0.7322099",
"0.7322099",
"0.7303383",
"0.7263056",
"0.72467685",
"0.72430325",
"0.7233159",
"0.7165631",
"0.7160025",
"0.713756",... | 0.69545823 | 58 |
GET /tasks/1 GET /tasks/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @task = Task.find(params[:id])\n\n render json: @task\n end",
"def task(name)\n get \"#{base_url}/tasks/#{name}\"\n end",
"def show\n render :json => Project.find(params[:project_id]).tasks.find(params[:id])\n end",
"def show\n \n @task = @project.tasks.find(params[:i... | [
"0.7609901",
"0.75564706",
"0.74567986",
"0.744782",
"0.73457336",
"0.7336996",
"0.73326796",
"0.7258408",
"0.7243503",
"0.7228832",
"0.72102755",
"0.72037584",
"0.7203518",
"0.7203518",
"0.7203518",
"0.7203518",
"0.7203518",
"0.7203518",
"0.7203518",
"0.7203518",
"0.7203518"... | 0.0 | -1 |
POST /tasks POST /tasks.json | def create
@task = Task.new(task_params)
respond_to do |format|
if @task.save
format.html { redirect_to @task, notice: 'Task was successfully created.' }
format.json { render :show, status: :created, location: @task }
else
format.html { render :new }
format.json { re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n #@task = Task.new(task_params)\n task = @task_list.tasks.create!(task_params)\n render json: task\n end",
"def create\n @task = Task.new(task_params)\n\n if @task.save\n render json: @task, status: :created\n else\n render json: @task.errors, status: :unprocessable_entit... | [
"0.7530627",
"0.7498286",
"0.7411653",
"0.73900914",
"0.7261698",
"0.725936",
"0.71839535",
"0.7148915",
"0.7112159",
"0.7076881",
"0.70648366",
"0.7058417",
"0.7056579",
"0.70309347",
"0.7016687",
"0.7012077",
"0.7011905",
"0.70109755",
"0.6994814",
"0.6990457",
"0.6988508",... | 0.69134545 | 36 |
END Update methods DELETE /tasks/1 DELETE /tasks/1.json | def destroy
@task.destroy
respond_to do |format|
format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_task id\n request :delete, \"tasks/#{id}\"\n nil\n end",
"def delete()\n\n client.delete(\"/tasks/#{gid}\") && true\n end",
"def delete_task\n @task = Task.find_by(id: params[:id])\n @task.destroy\n render :json => @task.as_json(:only => [:id])\n end",
"def destr... | [
"0.70766395",
"0.7050237",
"0.6787847",
"0.6740185",
"0.67014223",
"0.6685536",
"0.665297",
"0.6652437",
"0.6647265",
"0.6639504",
"0.6635495",
"0.6620743",
"0.66199946",
"0.661843",
"0.66002333",
"0.6597468",
"0.6582276",
"0.6561561",
"0.6561561",
"0.6561561",
"0.6561561",
... | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_task
@task = Task.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.6164095",
"0.6046031",
"0.5945298",
"0.59179014",
"0.58890367",
"0.58341795",
"0.5776118",
"0.5700777",
"0.5700777",
"0.5656277",
"0.56218207",
"0.5423995",
"0.5411516",
"0.5411516",
"0.5411516",
"0.5395004",
"0.53783494",
"0.53593004",
"0.53412604",
"0.534078",
"0.5332865... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def task_params
params.require(:task).permit(:title, :description, :done)
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.6979893",
"0.6781746",
"0.6746611",
"0.6742344",
"0.6735229",
"0.6592651",
"0.65027124",
"0.6498011",
"0.648163",
"0.647716",
"0.64556813",
"0.64386255",
"0.63784456",
"0.63756156",
"0.636574",
"0.6319542",
"0.63004524",
"0.6299559",
"0.62925464",
"0.62923217",
"0.6289894"... | 0.0 | -1 |
Stripe account type checks | def oauth?; stripe_account_type == 'oauth'; end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def managed?; stripe_account_type == 'managed'; end",
"def managed?; stripe_account_type == 'managed'; end",
"def account_type?(type)\n account_types.include?(type.to_s)\n end",
"def managed?\n stripe_account_type == 'managed'\n end",
"def multiple_account_types?\n account_types.size > 1\n ... | [
"0.7569713",
"0.7569713",
"0.6935767",
"0.67185444",
"0.66837823",
"0.6535233",
"0.6526803",
"0.64064574",
"0.6406387",
"0.6391425",
"0.6373315",
"0.6349924",
"0.6277039",
"0.6246741",
"0.62395924",
"0.6239257",
"0.62036866",
"0.62004507",
"0.61910987",
"0.6155055",
"0.614724... | 0.7504393 | 2 |
To display the selected image/picture more details | def show
@pictimeline = PicTimeLine.find(@params['id'])
render :action => :show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def afficher\n @image.display\n end",
"def display id\n get_image(id).display\n end",
"def edit_real_picture\n end",
"def show(name)\n @current_image = @files.detect do |path|\n path.basename.to_s.\n sub(/^\\d+-/, '').\n sub(/\\.(?:png|jpg)$/, '') ==... | [
"0.72961205",
"0.69414127",
"0.68086547",
"0.6745947",
"0.6673065",
"0.6632262",
"0.6594615",
"0.6585398",
"0.65322924",
"0.64785165",
"0.6469426",
"0.64533055",
"0.64330614",
"0.6429768",
"0.64232016",
"0.6407869",
"0.6396276",
"0.63911873",
"0.63681895",
"0.6366234",
"0.635... | 0.0 | -1 |
GET /PicTimeLine/new To render the image/picture upload form, | def new
@pictimeline = PicTimeLine.find(:all).last || PicTimeLine.new
@pictimelines = PicTimeLine.find(:all)
render :action => :new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @pic = Pic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pic }\n end\n end",
"def new\n @picture = Picture.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @picture }\n end\n ... | [
"0.72102433",
"0.71633136",
"0.71380293",
"0.7099667",
"0.7099667",
"0.7099667",
"0.7049106",
"0.6949237",
"0.6949237",
"0.6949237",
"0.6949237",
"0.690354",
"0.68273187",
"0.6795304",
"0.6795304",
"0.67918164",
"0.67714083",
"0.6744237",
"0.6716604",
"0.671448",
"0.6704079",... | 0.77141595 | 0 |
To choose the pictures from the camera control. | def edit
Camera::choose_picture(url_for :action => :camera_callback)
redirect :action => :new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def choose_pic\n $testCaseID = \"VT229-0290\"\n Camera::choose_picture(url_for :action => :camera_callback)\n end",
"def choose_existing\n Camera::choose_picture(url_for(:action => :choose_existing_callback))\n end",
"def choosephoto\n if self.photo.url\n photo.url(:standard)\n else\n ... | [
"0.72184515",
"0.7213984",
"0.6203844",
"0.61887443",
"0.6100077",
"0.6100077",
"0.60555774",
"0.5995451",
"0.5939999",
"0.5934251",
"0.58973145",
"0.588769",
"0.5885211",
"0.58657193",
"0.58165914",
"0.5815841",
"0.5769282",
"0.57687014",
"0.5728242",
"0.5726949",
"0.5719793... | 0.64581805 | 2 |
Callback from mobile camera | def camera_callback
if @params['status'] == 'ok'
#create image record in the DB
image = PicTimeLine.new({'image'=>@params['image_uri']})
image.save
# puts "new Image object: " + image.inspect
end
WebView::refresh
#reply on the callback
render :action => :ok, :layout => false
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def camera\n end",
"def camera\n end",
"def camera_callback\n if @params['status'] == 'ok'\n puts \"ENTER CALLBACK WITH THIS PRODUCT ID!!!!!!!!!!!! #{$placehold}\"\n #puts \"THIS IS THE LOCATION OF THE IMAGE!!!!!! #{@params}\"\n \n #This is taking the picture and encoding it in base64 ... | [
"0.734364",
"0.734364",
"0.7208557",
"0.71692115",
"0.6948737",
"0.65648544",
"0.6364328",
"0.6310504",
"0.627805",
"0.62304467",
"0.62174475",
"0.612676",
"0.61243516",
"0.60904807",
"0.60842913",
"0.60663736",
"0.6023614",
"0.5933529",
"0.5897343",
"0.5889002",
"0.58815885"... | 0.73406696 | 2 |
POST /PicTimeLine/create To create the images/pictures references in the local mobile database. Currently we are not able to receive blob reference in the rhosync server. Now we receive as NIL when we inspect BLOB in the rhosync server. We have already posted this issue for assistance in the RHOMOBILE GOOGLE GROUP. Fol... | def create
@pictimeline = PicTimeLine.new(@params['pictimeline'])
p "@pictimeline #{@pictimeline}"
p "@params #{@params.inspect}"
@pictimeline.save
#SyncEngine::dosync
redirect :action => :index
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def upload_new_image_file(detection_flags, image = {})\n @client.post \"/service_json_ssl.svc/UploadNewImage_File\", {detection_flags:detection_flags,imagefile_data:image[:data],original_filename:image[:original_filename]}\n end",
"def create\n # 将上传的参数转化为ActionDispatch::Http::UploadedFile对象\n\t uplo... | [
"0.5894822",
"0.58453673",
"0.5836505",
"0.5713878",
"0.5658274",
"0.5617189",
"0.5607736",
"0.5600407",
"0.5557618",
"0.54946655",
"0.5485505",
"0.5483335",
"0.54722613",
"0.5437559",
"0.5422837",
"0.5416969",
"0.5414131",
"0.54138863",
"0.5399602",
"0.5390433",
"0.5372388",... | 0.59436274 | 0 |
GET /core/status_desembaracos/1 GET /core/status_desembaracos/1.json | def show
@core_status_desembaraco = Core::StatusDesembaraco.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @core_status_desembaraco }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @core_status_unidade_carga = Core::StatusUnidadeCarga.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @core_status_unidade_carga }\n end\n end",
"def show\n @core_status_processamento = Core::StatusProcessamento.find(params... | [
"0.699707",
"0.68508583",
"0.6815993",
"0.6693431",
"0.6688967",
"0.65902966",
"0.6572386",
"0.6572267",
"0.6554188",
"0.65401846",
"0.65256226",
"0.64969546",
"0.6474233",
"0.64214295",
"0.63128334",
"0.6292521",
"0.62867284",
"0.6230012",
"0.6204808",
"0.6186606",
"0.614254... | 0.74352276 | 0 |
GET /core/status_desembaracos/new GET /core/status_desembaracos/new.json | def new
@core_status_desembaraco = Core::StatusDesembaraco.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @core_status_desembaraco }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @new_status = NewStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_status }\n end\n end",
"def new\n @status_del_tramite_de_beca = StatusDelTramiteDeBeca.new\n\n respond_to do |format|\n format.html # new.html.erb\n ... | [
"0.75938225",
"0.75160146",
"0.7486464",
"0.7461751",
"0.7435385",
"0.73729306",
"0.73676795",
"0.7349392",
"0.73452747",
"0.7262452",
"0.7249219",
"0.7226284",
"0.71578825",
"0.71364653",
"0.7114487",
"0.709478",
"0.69849735",
"0.69714093",
"0.6962618",
"0.6941168",
"0.69287... | 0.7708865 | 0 |
POST /core/status_desembaracos POST /core/status_desembaracos.json | def create
@core_status_desembaraco = Core::StatusDesembaraco.new(params[:core_status_desembaraco])
respond_to do |format|
if @core_status_desembaraco.save
format.html { redirect_to @core_status_desembaraco, notice: 'Status desembaraco was successfully created.' }
format.json { render jso... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @devolucao = Devolucao.new(devolucao_params)\n @reserva.update(status: 'Devolvido')\n @veiculo.update(status: devolucao_params[:status])\n\n respond_to do |format|\n if @devolucao.save\n format.html { redirect_to @devolucao, notice: 'Devolucao was successfully created.' }\n ... | [
"0.6521683",
"0.64130914",
"0.62433666",
"0.6163249",
"0.61118424",
"0.6108895",
"0.6064175",
"0.60526985",
"0.6052222",
"0.6044392",
"0.6042165",
"0.59990245",
"0.5992895",
"0.5952605",
"0.5934653",
"0.59246606",
"0.5848082",
"0.58181673",
"0.5782633",
"0.57717824",
"0.57640... | 0.6910982 | 0 |
PUT /core/status_desembaracos/1 PUT /core/status_desembaracos/1.json | def update
@core_status_desembaraco = Core::StatusDesembaraco.find(params[:id])
respond_to do |format|
if @core_status_desembaraco.update_attributes(params[:core_status_desembaraco])
format.html { redirect_to @core_status_desembaraco, notice: 'Status desembaraco was successfully updated.' }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @cooperativa = Cooperativa.find(params[:id])\n @cooperativa.update_attributes :status => Status.find_by_descricao('Inativo')\n\n respond_to do |format|\n format.html { redirect_to admin_cooperativas_path }\n format.json { head :ok }\n end\n end",
"def destroy\n @oferta = O... | [
"0.6792476",
"0.67190504",
"0.65039355",
"0.63672626",
"0.627659",
"0.6246664",
"0.62390953",
"0.62065804",
"0.6135155",
"0.6118741",
"0.6096038",
"0.60938513",
"0.6077542",
"0.60622567",
"0.60524684",
"0.6027452",
"0.5997297",
"0.5947496",
"0.5944661",
"0.59421843",
"0.59414... | 0.7032822 | 0 |
DELETE /core/status_desembaracos/1 DELETE /core/status_desembaracos/1.json | def destroy
@core_status_desembaraco = Core::StatusDesembaraco.find(params[:id])
@core_status_desembaraco.destroy
respond_to do |format|
format.html { redirect_to core_status_desembaracos_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @core_status_unidade_carga = Core::StatusUnidadeCarga.find(params[:id])\n @core_status_unidade_carga.destroy\n\n respond_to do |format|\n format.html { redirect_to core_status_unidade_cargas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @core_status... | [
"0.7457207",
"0.7267141",
"0.72605103",
"0.7083663",
"0.70529974",
"0.704103",
"0.7030069",
"0.6977209",
"0.6915634",
"0.6913033",
"0.6886155",
"0.6872457",
"0.6863978",
"0.68579346",
"0.68439215",
"0.6827407",
"0.6800151",
"0.67963",
"0.6793888",
"0.67892617",
"0.6781592",
... | 0.79004836 | 0 |
GET /viewers GET /viewers.json | def index
@viewers = Viewer.where(user_id: current_user.id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_most_viewers\n uri = [@@base_uri, 'all', 'getMostViewers'].join('/')\n return get(uri)\n end",
"def viewers(movie_id)\n\t\t@all_movies[movie_id].viewers\n\tend",
"def viewers(m)\n return @movie_list[m].viewers unless @movie_list[m] == nil\n return []\n end",
"def viewers(exact = false)\... | [
"0.7258482",
"0.67591095",
"0.666327",
"0.65993655",
"0.6545543",
"0.64653707",
"0.64454025",
"0.64278966",
"0.6394171",
"0.6336647",
"0.6321903",
"0.622369",
"0.62163883",
"0.61634487",
"0.6123171",
"0.6106644",
"0.60750264",
"0.6027903",
"0.6009127",
"0.6005829",
"0.6003518... | 0.7351946 | 0 |
GET /viewers/1 GET /viewers/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @viewers = Viewer.where(user_id: current_user.id)\n end",
"def get_most_viewers\n uri = [@@base_uri, 'all', 'getMostViewers'].join('/')\n return get(uri)\n end",
"def show\n @reviewer = Reviewer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n ... | [
"0.72698367",
"0.6952045",
"0.6713914",
"0.6458124",
"0.6456319",
"0.6400336",
"0.62945354",
"0.6227609",
"0.62251955",
"0.61777633",
"0.6130271",
"0.61249226",
"0.6116842",
"0.6113409",
"0.61113584",
"0.6111015",
"0.6089949",
"0.6065251",
"0.6045542",
"0.6045542",
"0.6045542... | 0.0 | -1 |
POST /viewers POST /viewers.json | def create
@search_club = User.find(current_user.id).information_personals
@viewer = Viewer.new(viewer_params.merge(user_id: current_user.id, club: @search_club[0].club))
respond_to do |format|
if @viewer.save
format.html { redirect_to viewers_path, notice: t('visor.alert_succesful') }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @viewer = Viewer.new(viewer_params)\n\n respond_to do |format|\n if @viewer.save\n format.html { redirect_to @viewer, notice: 'Viewer was successfully created.' }\n format.json { render action: 'show', status: :created, location: @viewer }\n else\n format.html { re... | [
"0.6498352",
"0.62076104",
"0.61438066",
"0.6072483",
"0.6059417",
"0.5831716",
"0.5761456",
"0.57246304",
"0.5711525",
"0.5696363",
"0.56419456",
"0.56193733",
"0.56193733",
"0.56039256",
"0.5569066",
"0.5563794",
"0.5507198",
"0.54755265",
"0.5426075",
"0.53968614",
"0.5385... | 0.65428394 | 0 |
PATCH/PUT /viewers/1 PATCH/PUT /viewers/1.json | def update
respond_to do |format|
if @viewer.update(viewer_params)
format.html { redirect_to @viewer, notice: t('visor.alert_update') }
format.json { render :show, status: :ok, location: @viewer }
else
format.html { render :edit }
format.json { render json: @viewer.errors... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @viewer.update(viewer_params)\n format.html { redirect_to @viewer, notice: 'Viewer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @viewer.er... | [
"0.68520296",
"0.66767216",
"0.6542532",
"0.6026505",
"0.5905937",
"0.58740616",
"0.5872672",
"0.5822853",
"0.58167964",
"0.5794063",
"0.5789214",
"0.5768784",
"0.571832",
"0.571832",
"0.571832",
"0.5709097",
"0.57004756",
"0.57004756",
"0.5700283",
"0.568689",
"0.56718355",
... | 0.6660485 | 2 |
DELETE /viewers/1 DELETE /viewers/1.json | def destroy
@viewer.destroy
respond_to do |format|
format.html { redirect_to viewers_url, notice: t('visor.alert_delete') }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @viewer.destroy\n respond_to do |format|\n format.html { redirect_to viewers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @viewer = Viewer.find(params[:id])\n @viewer.destroy\n\n respond_to do |format|\n format.html { redirect_to(viewers_ur... | [
"0.77238864",
"0.7632433",
"0.69922054",
"0.6795243",
"0.67910963",
"0.6784904",
"0.6784904",
"0.6784904",
"0.6734532",
"0.67226434",
"0.67086023",
"0.6692088",
"0.6668717",
"0.66124356",
"0.660792",
"0.6606819",
"0.66056776",
"0.66015625",
"0.66015625",
"0.658908",
"0.658054... | 0.7640788 | 1 |
Use callbacks to share common setup or constraints between actions. | def set_viewer
@viewer = Viewer.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.6165152",
"0.60463154",
"0.59467196",
"0.5917112",
"0.5890387",
"0.58345735",
"0.57773316",
"0.56991524",
"0.56991524",
"0.565454",
"0.5622282",
"0.54232633",
"0.54119074",
"0.54119074",
"0.54119074",
"0.53937256",
"0.53801376",
"0.5358599",
"0.53412294",
"0.5340814",
"0.5... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def viewer_params
params.require(:viewer).permit(:name, :last_name, :birth, :telephone, :club)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.6980629",
"0.67819995",
"0.67467666",
"0.67419875",
"0.67347664",
"0.65928614",
"0.6504013",
"0.6498014",
"0.64819515",
"0.64797956",
"0.64562726",
"0.64400834",
"0.6380117",
"0.6377456",
"0.63656694",
"0.6320543",
"0.63002014",
"0.62997127",
"0.629425",
"0.6293866",
"0.62... | 0.0 | -1 |
Show login screen ("new" shows the page for trying to create a session) | def new
if logged_in?
flash[:success] = t('sessions.already_logged_in')
redirect_to root_url
else
use_secure_headers_override(:allow_github_form_action)
store_location_and_locale
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def displayLoginPage()\n\t# User Name: \n\t# Password:\n\t# Forgot Password?\tNew User?\n\treturn\nend",
"def login\n # show LOGIN form\n\n end",
"def new #login page\n end",
"def show\n unless logged_in?\n flash.now[:danger] = 'Você não possui autorização'\n render 'sessions/new'\n end\... | [
"0.77893037",
"0.7585938",
"0.7525073",
"0.7431612",
"0.742546",
"0.742546",
"0.7302459",
"0.7201222",
"0.7179979",
"0.71343493",
"0.70664674",
"0.7040402",
"0.70352876",
"0.7008303",
"0.6959913",
"0.69000757",
"0.688463",
"0.6876067",
"0.6861695",
"0.6810374",
"0.67931956",
... | 0.0 | -1 |
Attempt to create a session. In other words, attempt to log in. rubocop:disable Metrics/AbcSize, Metrics/MethodLength | def create
counter_fixation # Counter session fixation (but save forwarding url)
if Rails.application.config.deny_login
flash.now[:danger] = t('sessions.login_disabled')
render 'new', status: :forbidden
elsif request.env['omniauth.auth'].present?
omniauth_login
elsif params[:session][:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_session\n login, password = get_login_and_password\n create_session_with authenticate_user(login, password, :trace => true)\n end",
"def create_session\n raise NotImplementedError\n end",
"def begin_session\n begin\n true if login\n rescue\n false\n end\n e... | [
"0.7731069",
"0.7270852",
"0.72484636",
"0.7194012",
"0.71648395",
"0.70586544",
"0.7013329",
"0.7006067",
"0.69947225",
"0.69383395",
"0.69239914",
"0.68021107",
"0.677723",
"0.6722179",
"0.6719327",
"0.67094934",
"0.66962147",
"0.66838133",
"0.6682062",
"0.6669103",
"0.6653... | 0.64557934 | 48 |
rubocop:enable Metrics/AbcSize, Metrics/MethodLength Log out | def destroy
log_out if logged_in?
flash[:success] = t('sessions.signed_out')
redirect_to root_url
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def log; end",
"def log; end",
"def log; end",
"def log; end",
"def log; end",
"def log; end",
"def log; end",
"def log; end",
"def private_method\n end",
"def refutal()\n end",
"def logger; end",
"def logger; end",
"def logger; end",
"def logger; end",
"de... | [
"0.7105035",
"0.6171971",
"0.6171971",
"0.6171971",
"0.6171971",
"0.6171971",
"0.6171971",
"0.6171971",
"0.6171971",
"0.60321784",
"0.59835345",
"0.5797794",
"0.5797794",
"0.5797794",
"0.5797794",
"0.5797794",
"0.5797794",
"0.5797794",
"0.5797794",
"0.5797794",
"0.5797794",
... | 0.0 | -1 |
Perform tasks for a user who just successfully logged in. | def successful_login(user)
log_in user
redirect_back_or root_url
# Report last login time (this can help users detect problems)
last_login = user.last_login_at
last_login = t('sessions.no_login_time') if last_login.blank?
flash[:success] = t('sessions.signed_in', last_login_at: last_login)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def authorize\n unless User.find_by(id: session[:user_id])\n redirect_to tasks_index_path, notice: \"Please log in\"\n end\n end",
"def successful_authentication(user)\n set_brute_force_counter(user, 0)\n super\n end",
"def successful_login!\n unthrottle_user\n clear_bad_login_co... | [
"0.64478856",
"0.6442215",
"0.641044",
"0.6244344",
"0.6234756",
"0.6226963",
"0.61691964",
"0.6157918",
"0.6139246",
"0.6115443",
"0.60695696",
"0.6069383",
"0.60606796",
"0.60489",
"0.603457",
"0.6022424",
"0.6016482",
"0.60005414",
"0.59874445",
"0.59841293",
"0.5978139",
... | 0.60206443 | 16 |
We want to save the forwarding url of a session but still need to counter session fixation, this does it | def counter_fixation
ref_url = session[:forwarding_url] # Save forwarding url
I18n.locale = session[:locale]
reset_session # Counter session fixation
session[:forwarding_url] = ref_url # Reload forwarding url
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def store_forwarding_loc\n session[:forwarding_url] = request.original_url if request.get?\n end",
"def store_forwarding_url\n session[:forwarding_url] = request.url if request.get?\n end",
"def store_url\n session[:forwarding_url] = request.original_url if request.get?\n end",
"def store_URL... | [
"0.8126086",
"0.81226635",
"0.809906",
"0.80169517",
"0.7975948",
"0.7961096",
"0.78975517",
"0.7873173",
"0.78619707",
"0.78603137",
"0.782319",
"0.782319",
"0.782319",
"0.782319",
"0.7820884",
"0.7816239",
"0.7811207",
"0.7811207",
"0.7811207",
"0.7811207",
"0.7811207",
"... | 0.0 | -1 |
con este Test me aseguro que 1 Career (carrera) puede tener mas de 1 survey (Encuesta) | def test_carrer_has_many_surveys
# Arrange
career = Career.create(name: 'computación')
# Act
survey = Survey.create(username: '1', career_id: career.id)
survey1 = Survey.create(username: '2', career_id: career.id)
survey2 = Survey.create(username: '3', career_id: career.id)
# Assert
assert_equal(caree... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resultatsTest\n @cadreInfo = CadreInfo.find_by_confirm_token(cookies.encrypted[:oiam_cadre])\n if @cadreInfo.nil?\n redirect_back(fallback_location: root_path)\n else\n unless @cadreInfo.potential_test\n flash[:notice] = \"En attente du résultat de votre test potential.\"\n @ca... | [
"0.6254734",
"0.6154715",
"0.59913236",
"0.59260017",
"0.5655091",
"0.56523055",
"0.563325",
"0.56239665",
"0.55970603",
"0.55675757",
"0.5528321",
"0.54146415",
"0.5407834",
"0.53754073",
"0.5367326",
"0.5354409",
"0.53458494",
"0.5322369",
"0.531064",
"0.5300088",
"0.529465... | 0.5981825 | 3 |
Con este test me aseguro que 1 carrera puede estar asociada a mas de una resultado (Outcome) | def test_career_has_many_outcomes
# Arrange
career = Career.create(name:'Fisica')
question = Question.create(name:'Me trasladaría a una zona ganadera para ejercer mi profesión.', number:1, type:'radio', description:'1')
choice = Choice.create(text:'SI',question_id: question.id)
choice2 = Choice.create(text:'N... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_results_sad_one\r\n assert_output(\"Going home sad.\\n\") { @g.results(1) }\r\n end",
"def outcome\n status.first\n end",
"def coverage\n empty? ? 1 : Rational(successful, total)\n end",
"def test_player1_should_win\n\t\tresult = Rule.new.determine_outcome_from_tosses(\"r\", \"s\... | [
"0.6616488",
"0.64546025",
"0.6395372",
"0.6323563",
"0.63033223",
"0.62802",
"0.6256774",
"0.62416726",
"0.62307465",
"0.6129769",
"0.6092213",
"0.6091797",
"0.60839045",
"0.6078154",
"0.6069618",
"0.6044348",
"0.60414547",
"0.6039932",
"0.6032275",
"0.60290307",
"0.6028668"... | 0.0 | -1 |
con este test me asuguro que el nombre de una carrera nunca sea la cadena vacia | def test_career_has_name_validator
# Arrange
career = Career.new
# Act
career.name = ''
# Assert
assert_equal career.valid?, false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def recolectar_una\n\t\test = \"\"\n\t\tif @estado == ESTADO::MUERTE\n\t\t\test = \"El árbol está muerto\"\n\t\telse\n\t\t\tif @contador == 0\n\t\t\t\test = \"No hay más naranjas\"\n\t\t\telse\n\t\t\t\test = \"La naranja estaba deliciosa\"\n\t\t\t\t@contador -= 1\n\t\t\tend\n\t\tend\n\t\test\n\tend",
"def test_c... | [
"0.67867446",
"0.6077387",
"0.6057983",
"0.59419215",
"0.5853635",
"0.5838218",
"0.5735063",
"0.571878",
"0.570659",
"0.5704452",
"0.5687555",
"0.5678519",
"0.5650177",
"0.56240875",
"0.5598835",
"0.5561089",
"0.5541637",
"0.5538739",
"0.5530373",
"0.5522392",
"0.55209434",
... | 0.52921826 | 55 |
Skip the filter if the current user is permitted to take workflow actions on the work corresponding to the SolrDocument with id = `blacklight_params[:id]` | def only_active_works(solr_parameters)
return if user_has_active_workflow_role? || depositor?
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def apply_permissive_visibility_filter(solr_params)\n return unless current_exhibit\n return if scope.respond_to?(:can?) && scope.can?(:curate, current_exhibit) && !blacklight_params[:public]\n\n solr_params.append_filter_query \"-#{blacklight_config.document_model.visibility_field(curre... | [
"0.6377034",
"0.6376208",
"0.62127596",
"0.5927626",
"0.5729245",
"0.5707358",
"0.57063735",
"0.57050616",
"0.568517",
"0.5653336",
"0.56352174",
"0.5614839",
"0.5612106",
"0.5610317",
"0.5599417",
"0.5597883",
"0.559302",
"0.5569699",
"0.5549635",
"0.55487156",
"0.55361634",... | 0.64458567 | 0 |
rewrite so method isn't called everytime | def symbol
@color == "white" ? @symbol = "\u{2658}" : @symbol = "\u{265e}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def custom; end",
"def custom; end",
"def suivre; end",
"def schubert; end",
"def refutal()\n end",
"def probers; end",
"def weber; end",
"def ignores; end",
"def private_method\n end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",... | [
"0.71767884",
"0.6635388",
"0.6635388",
"0.66099685",
"0.65051186",
"0.6466212",
"0.6450055",
"0.63380957",
"0.63362867",
"0.631858",
"0.6309661",
"0.6309661",
"0.6309661",
"0.6309661",
"0.6309661",
"0.6309661",
"0.6309661",
"0.6309661",
"0.6309661",
"0.6309661",
"0.6309661",... | 0.0 | -1 |
this should return an array user[address][street] should return ['user', 'address', 'street'] | def parse_key(key)
if key.include?("]")
key = key.split(/\]\[|\]|\[/)
else
key
end
key
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_user_data(users, username)\n user_array = []\n users.each do |user|\n if user['username'] == username\n user_array << user['name']\n user_array << user['username']\n user_array << user['password']\n user_array << user['admin']\n end\n end\n... | [
"0.6055959",
"0.5764927",
"0.5722177",
"0.5628169",
"0.5587344",
"0.5446983",
"0.5435955",
"0.54099435",
"0.532686",
"0.52022105",
"0.51554376",
"0.5146713",
"0.50950265",
"0.5085367",
"0.5082606",
"0.5077742",
"0.5076503",
"0.50690293",
"0.5065621",
"0.5060002",
"0.50588095"... | 0.0 | -1 |
Newton's law: F = M A | def apply_force(force:)
f = force / @mass
@acceleration += f
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mle_via_newton(logLikelihood,initial_parameter_value,tolerance=0.001)\n # Your code goes here.\nend",
"def infla(y=40,f=2)\n self.to_f*(f.to_q**y)\n end",
"def fvan(i, n, pmt)\n return pmt * (((1 + i) ** n) - 1) / i \n end",
"def newton_raphson(f, f_deriv, start, precision = 5)\n k_pl... | [
"0.6434453",
"0.63895535",
"0.6351636",
"0.63141024",
"0.62471956",
"0.6205527",
"0.6186332",
"0.58130485",
"0.57797986",
"0.5770847",
"0.5750254",
"0.5693469",
"0.56893224",
"0.56159997",
"0.5580299",
"0.55728865",
"0.5535543",
"0.5529504",
"0.5478523",
"0.5474871",
"0.54576... | 0.0 | -1 |
This checks to see if we clicked on the mover | def clicked(mx, my)
d = dist(mx, my, @location.x, @location.y)
if d < @mass
@dragging = true
@drag_offset.x = @location.x - mx
@drag_offset.y = @location.y - my
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def target_clicked?\n inputs.mouse.down && inputs.mouse.point.inside_rect?(scale_up(grid.target))\n end",
"def mouse_over_target?\n inputs.mouse.point.inside_rect?(scale_up(state.target))\n end",
"def mouse_over_target2?\n inputs.mouse.point.inside_rect?(move_and_scale_up(state.target))\n end",
"... | [
"0.68398595",
"0.66687727",
"0.6602158",
"0.63589686",
"0.6302374",
"0.62805283",
"0.6244685",
"0.6189114",
"0.6187365",
"0.61655116",
"0.6163852",
"0.60727346",
"0.6019564",
"0.60020655",
"0.60011035",
"0.60008186",
"0.5927249",
"0.5921224",
"0.58553344",
"0.5809566",
"0.579... | 0.5471387 | 54 |
Constrain the distance between bob and anchor between min and max | def constrain_length(bob, minlen, maxlen)
dir = bob.location - @anchor
d = dir.mag
# Is it too short?
if d < minlen
dir.normalize!
dir *= minlen
# Reset location and stop from moving (not realistic physics)
bob.location = @anchor + dir
bob.velocity *= 0
elsif d > maxlen... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bound(min, max)\n self < min ? min : (self > max ? max : self)\n end",
"def min_max_distance(min, max)\n FMOD.invoke(:ChannelGroup_Set3DMinMaxDistance, self, min, max)\n end",
"def constrain(size)\n if size < @floor\n @floor\n else\n @ceiling && size > @ceiling ? @ceiling : size... | [
"0.62014306",
"0.5931854",
"0.5916945",
"0.5745214",
"0.5703719",
"0.56959313",
"0.56095433",
"0.555675",
"0.548148",
"0.54783964",
"0.54746866",
"0.54471993",
"0.54331446",
"0.5430032",
"0.54266524",
"0.5413431",
"0.54129595",
"0.53612065",
"0.53333217",
"0.5330895",
"0.5271... | 0.6826792 | 0 |
Sorting tasks by docket number within each category of appeal: case type, aod, docket number Used by ScheduleHearingTaskPager and WarmBgsCachedJob to sort ScheduleHearingTasks | def order_by_cached_appeal_priority_clause
Arel.sql(<<-SQL)
(CASE
WHEN cached_appeal_attributes.case_type = 'Court Remand' THEN 1
ELSE 0
END) DESC,
cached_appeal_attributes.is_aod DESC,
cached_appeal_attributes.docket_number ASC
SQL
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sort_tasks(tasks)\n sort_by = session[:sort].to_i\n res = tasks\n \n if sort_by == 0 # default sorting\n res = current_user.company.sort(tasks)\n elsif sort_by == 1\n res = tasks.sort_by{|t| [-t.completed_at.to_i, (t.due_date || 9999999999).to_i, - t.sort_rank, -t.task_num] }\n ... | [
"0.6193395",
"0.6193395",
"0.6154325",
"0.5958106",
"0.59067214",
"0.5891812",
"0.58752227",
"0.58580565",
"0.5799177",
"0.57829547",
"0.57169145",
"0.5700257",
"0.56884927",
"0.5687064",
"0.5683526",
"0.5658725",
"0.5626054",
"0.5547992",
"0.5534969",
"0.5518659",
"0.5489880... | 0.51365507 | 48 |
instance methods rubocop:disable Metrics/MethodLength rubocop:disable Metrics/AbcSize | def available_actions(user)
return [] unless user
if assigned_to == user
return [
Constants.TASK_ACTIONS.ASSIGN_TO_TEAM.to_h,
Constants.TASK_ACTIONS.REASSIGN_TO_PERSON.to_h,
Constants.TASK_ACTIONS.TOGGLE_TIMED_HOLD.to_h,
Constants.TASK_ACTIONS.MARK_COMPLETE.to_h,
C... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def initialize\n \n end",
"def implementation; end",
"def implementation; end",
"def instance; end",
"def instance; end",
"def instance; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"de... | [
"0.77593356",
"0.6686184",
"0.65807784",
"0.65807784",
"0.6375412",
"0.6375412",
"0.6375412",
"0.6342203",
"0.6342203",
"0.6342203",
"0.6342203",
"0.6342203",
"0.6342203",
"0.6342203",
"0.6342203",
"0.6342203",
"0.6342203",
"0.6342203",
"0.63383645",
"0.6325221",
"0.6321757",... | 0.0 | -1 |
rubocop:enable Metrics/AbcSize rubocop:enable Metrics/MethodLength Use the existence of an organizationlevel task to prevent duplicates since there should only ever be one orglevel task active at a time for a single appeal. | def verify_org_task_unique
# do not verify for split appeal process
return if appeal.appeal_split_process == true
return if !open?
if appeal.tasks.open.where(
type: type,
assigned_to: assigned_to,
parent: parent
).any? && assigned_to.is_a?(Organization)
fail(
Caseflo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_org_task_unique\n true\n end",
"def task_is_assigned_to_organization?(org)\n assigned_to.is_a?(Organization) && assigned_to == org\n end",
"def has_task?(task)\n self.project_tasks.each do |project_task|\n return true if project_task.task == task\n end\n false\n end",
"def t... | [
"0.69324464",
"0.6743179",
"0.64948785",
"0.6365957",
"0.6349925",
"0.6338112",
"0.6322098",
"0.63053435",
"0.595913",
"0.5895532",
"0.5861909",
"0.58074653",
"0.57672274",
"0.5752792",
"0.5707522",
"0.56998706",
"0.5653886",
"0.5649351",
"0.5636071",
"0.5636071",
"0.5613674"... | 0.7855293 | 0 |
When a status is "active" we expect properties of the task to change When a task is not "active" we expect that properties of the task will not change on_hold is not included | def active?
self.class.active_statuses.include?(status)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ignore_inactive?(_task)\n !active?\n end",
"def active?; status == :active; end",
"def task_schedule_status(task)\n\t\tstatus = []\n\tend",
"def on_hold?\n status == :inactive\n end",
"def advancing_status\n if Task.statuses[status_was] > Task.statuses[status]\n errors.add(:status, ... | [
"0.659845",
"0.6370153",
"0.63220847",
"0.62685305",
"0.6214672",
"0.61695766",
"0.61616987",
"0.6147871",
"0.61133605",
"0.61133605",
"0.6068515",
"0.60675156",
"0.6067469",
"0.60520273",
"0.60210174",
"0.60093004",
"0.59976345",
"0.5988915",
"0.5981278",
"0.5937332",
"0.591... | 0.0 | -1 |
A wrapper around actions_allowable that also disallows doing actions to on_hold tasks. | def actions_available?(user)
return false if status == Constants.TASK_STATUSES.on_hold && !on_timed_hold?
actions_allowable?(user)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def available_actions\n fail NotImplementedError\n end",
"def _can_do_action_without_object?(action, action_id)\n if _actions[action].nil?\n _invalid_general_action!(action)\n elsif unrestricted?\n true\n else\n accessly_query.can?(action_id, namespace)\n ... | [
"0.63317287",
"0.6313603",
"0.6307411",
"0.6246241",
"0.61280656",
"0.60930145",
"0.605091",
"0.5954059",
"0.5870202",
"0.58555526",
"0.5849183",
"0.5825354",
"0.5814529",
"0.58131707",
"0.5804084",
"0.577112",
"0.57277",
"0.5718931",
"0.5714388",
"0.56592476",
"0.56536824",
... | 0.6221819 | 4 |
N.B. that this does not check permissions, only assignee Use task_is_assigned_to_users_organization? if that is needed. | def task_is_assigned_to_organization?(org)
assigned_to.is_a?(Organization) && assigned_to == org
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def potential_task_assignees(task)\n if task.assigned_to.is_a?(Organization)\n task.assigned_to.users.active\n elsif task.parent&.assigned_to.is_a?(Organization)\n task.parent.assigned_to.users.active.reject { |check_user| check_user == task.assigned_to }\n else\n []\n end\... | [
"0.75617266",
"0.7214577",
"0.7180719",
"0.6778415",
"0.6713634",
"0.66794693",
"0.65109456",
"0.6496086",
"0.64614105",
"0.64243805",
"0.6401886",
"0.6390011",
"0.63729215",
"0.6366977",
"0.635245",
"0.6351618",
"0.6341696",
"0.6341561",
"0.6322563",
"0.63041973",
"0.626495"... | 0.81981754 | 0 |
This method is for copying a task and its ancestors to a new appeal stream | def copy_with_ancestors_to_stream(new_appeal_stream, extra_excluded_attributes: [], new_attributes: {})
return unless parent
new_task_attributes = attributes
.except(*ATTRIBUTES_EXCLUDED_FROM_TASK_COPY, *extra_excluded_attributes)
.merge(new_attributes)
new_task_attributes["appeal_id"] = new_ap... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def copy_ds_tasks_to_new_stream\n new_completed_task = DocketSwitchGrantedTask.assigned_to_any_user.find_by(appeal: old_docket_stream).dup\n new_completed_task.assign_attributes(\n appeal_id: new_docket_stream.id,\n parent_id: new_docket_stream.root_task.id,\n status: Constants.TASK_STATUSES.c... | [
"0.69747233",
"0.63998705",
"0.61920875",
"0.5790213",
"0.5656052",
"0.5540456",
"0.5536394",
"0.53894454",
"0.5386976",
"0.5346655",
"0.5281508",
"0.52788526",
"0.52740157",
"0.5268663",
"0.52039",
"0.5080015",
"0.5072169",
"0.5044854",
"0.50306255",
"0.50082684",
"0.5003298... | 0.7698728 | 0 |
currently only defined by ScheduleHearingTask and AssignHearingDispositionTask for virtual hearing related updates | def alerts
@alerts ||= []
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_hearing\n super_return_value = super\n if hearing_updates[:disposition] == Constants.HEARING_DISPOSITION_TYPES.postponed\n AppellantNotification.notify_appellant(hearing.appeal, @@template_name)\n end\n super_return_value\n end",
"def update_hearing(hearing_hash)\n super_return_va... | [
"0.6721271",
"0.6577403",
"0.6193991",
"0.6138936",
"0.6014856",
"0.5869605",
"0.5610088",
"0.5577987",
"0.55727845",
"0.5516967",
"0.54753613",
"0.54550487",
"0.54480094",
"0.5422209",
"0.5382628",
"0.528311",
"0.52754974",
"0.5267612",
"0.52598286",
"0.52589244",
"0.5222018... | 0.0 | -1 |
Purpose: This method is triggered by callback 'after_update'. This method calls a variety of abstract private methods that are prepended in app/models/prepend/va_notifiy. These private methods will update an appeal's state within the 'Appeal State' table when certain tracked task types have their statuses updated to ei... | def update_appeal_state_on_status_change
update_appeal_state_when_ihp_cancelled
update_appeal_state_when_ihp_completed
update_appeal_state_when_privacy_act_cancelled
update_appeal_state_when_privacy_act_complete
update_appeal_state_when_appeal_cancelled
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_appeal_state_when_ihp_completed\n if IHP_TYPE_TASKS.include?(type) &&\n !IHP_TYPE_TASKS.include?(parent&.type) &&\n status == Constants.TASK_STATUSES.completed\n MetricsService.record(\"Updating VSO_IHP_COMPLETED column to TRUE & VSO_IHP_PENDING column to FALSE in Appeal\"\\\n ... | [
"0.7353445",
"0.660373",
"0.64483154",
"0.64393353",
"0.63881433",
"0.6225759",
"0.6223921",
"0.60612816",
"0.6054933",
"0.60535944",
"0.6053585",
"0.6050075",
"0.60156363",
"0.60059893",
"0.59960264",
"0.5938991",
"0.59048647",
"0.5895266",
"0.58741415",
"0.5846082",
"0.5844... | 0.7655185 | 0 |
Purpose: This method is triggered by callback 'after_create'. This method calls a variety of abstract private methods that are prepended in app/models/prepend/va_notifiy. These private methods will update an appeal's state within the 'Appeal State' table when certain tracked tasks are created. Params: NONE Response: Th... | def update_appeal_state_on_task_creation
update_appeal_state_when_privacy_act_created
update_appeal_state_when_appeal_docketed
update_appeal_state_when_ihp_created
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def after_create\n\t\tsuper\n\t\t# associate an enrollment queue\n\t\teq = EnrollmentQueue.create(user_id: self.id)\n\t\tself.enrollment_queue = eq\n\t\teq.user = self\n\t\t# associate a state table\n\t\tst = StateTable.create(user_id: self.id)\n\t\tself.state_table = st\n\t\tst.user = self\n\n\n if not ['app',... | [
"0.64730495",
"0.619465",
"0.618221",
"0.6109744",
"0.6011343",
"0.5971021",
"0.5879227",
"0.5874638",
"0.58665353",
"0.5830062",
"0.5812954",
"0.5811983",
"0.573074",
"0.57293963",
"0.5727324",
"0.56839716",
"0.5682337",
"0.5675137",
"0.5674143",
"0.5673656",
"0.5671177",
... | 0.78098583 | 0 |
If an Education predocket RPO task is completed and sent to BVA Intake then the parent Education EMO task should also be completed. | def update_task_if_children_tasks_are_completed
if type == EducationDocumentSearchTask.name && children.last.completed?
update!(status: Constants.TASK_STATUSES.completed)
else
update!(status: Constants.TASK_STATUSES.assigned)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def perform_ending_tasks(element)\n if @config.include? element\n process_data(@attributes)\n @current_parent_element = []\n @attributes = []\n end\n if element == \"DataValue\"\n @data_value_identifier = false\n end\n if element == \"RemarkCode\"\n @remark_code_identifier =... | [
"0.59571224",
"0.5933489",
"0.59301656",
"0.58837897",
"0.5760917",
"0.5693068",
"0.5677866",
"0.5513511",
"0.5487801",
"0.5461607",
"0.54486483",
"0.5431905",
"0.54228264",
"0.5414183",
"0.54123384",
"0.53983945",
"0.5397785",
"0.53936976",
"0.53881186",
"0.535485",
"0.53338... | 0.6070541 | 0 |
Processes an incoming counter measurement Normalize for sample rate provided Adds the value to any existing values by the same | def handle(key, value, sample_rate)
if sample_rate
value = value.to_f / sample_rate.gsub("@", "").to_f
end
key = "counters:#{key}"
@active_counters[key] = @active_counters[key].to_i + value.to_i
@counters[key] = nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def handle(key, value, sample_rate)\n if sample_rate\n value = value.to_f / sample_rate.gsub(\"@\", \"\").to_f\n end\n key = \"counters:#{key}\"\n value = value.to_i\n hash = key.hash\n @retentions.size.times do |i|\n slot = @key_slot_map[key] ||= hash % @slots[i]\n ... | [
"0.69944906",
"0.66381174",
"0.60823226",
"0.6051649",
"0.6051649",
"0.5967336",
"0.5967336",
"0.5643292",
"0.56392646",
"0.5500222",
"0.54866797",
"0.54704136",
"0.54664713",
"0.54664713",
"0.5460939",
"0.5435955",
"0.53956735",
"0.5393643",
"0.5393304",
"0.5391074",
"0.5370... | 0.7410388 | 0 |
Flushes the accumulated counters that are pending in | def flush
puts "Current threadpool queue for counters: #{@threadpool.size}" if ENV["VVERBOSE"]
# Flushing is usually very fast, but always fix it so that the
# entire thing is based on a constant start time
# Saves on time syscalls too
flush_start = Time.now.to_i
n = @active_counter... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def flush\n\n # Flushing is usually very fast, but always fix it so that the\n # entire thing is based on a constant start time\n # Saves on time syscalls too\n flush_start = Time.now.to_i\n \n @retentions.each_with_index do |retention, index|\n @current_slots[index] += 1 \n ... | [
"0.7175983",
"0.6682989",
"0.658112",
"0.6394234",
"0.636183",
"0.63003576",
"0.6279985",
"0.6232034",
"0.6179479",
"0.6152561",
"0.6114166",
"0.60625845",
"0.6037926",
"0.60351807",
"0.59914976",
"0.59482455",
"0.5935498",
"0.59306556",
"0.5859414",
"0.5859308",
"0.5854619",... | 0.7020614 | 1 |
To calculate the area from Parent Class | def getArea
return "Area from Parent class is #{@width * @height}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getArea\n\n return \"Area from parent class is #{@width*@height}\"\n\n end",
"def total_area\n\t\tarea = 0\n\t\tshapes.each do |shape|\n\t\t\tarea = area + shape.area\n\t\tend\n\t\treturn area\n\tend",
"def calculate_area\n\n \tarea = 3.14*@radius*@radius\n\n end",
"def floor_area\n # what d... | [
"0.8181434",
"0.72677296",
"0.7247519",
"0.7158294",
"0.7111067",
"0.7088401",
"0.70838827",
"0.7083882",
"0.70548445",
"0.6969139",
"0.6954571",
"0.6902399",
"0.68993616",
"0.6889538",
"0.6883209",
"0.6879139",
"0.685388",
"0.685388",
"0.6833906",
"0.67903847",
"0.67460984",... | 0.82894444 | 0 |
Metodo creado para el filtro | def buscar
get_fichas
render 'index'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filter\n end",
"def Filter=(arg0)",
"def filter; end",
"def filter; end",
"def filter; end",
"def filtro_particular(conscaso, params_filtro)\n return conscaso\n end",
"def apply_filter\n end",
"def filters; end",
"def filters; end",
"def filters=(_arg0); end",
"def... | [
"0.8104119",
"0.798233",
"0.79726374",
"0.79726374",
"0.79726374",
"0.78262794",
"0.78153265",
"0.7803028",
"0.7803028",
"0.7698892",
"0.7698892",
"0.76606184",
"0.7440017",
"0.7438786",
"0.7438786",
"0.743408",
"0.7374463",
"0.732261",
"0.7137341",
"0.7137341",
"0.7077248",
... | 0.0 | -1 |
remove double "" and remove all quotes if ANY are unclosed | def sanitize_quotes(query)
query.gsub!('""', '"')
query.delete!('"') if query.count('"').odd?
query = "" if query.blank?
query
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_open_quotes(str)\n return if str.nil?\n # If the string is a URL and it ends with two single quotes, remove them\n str = (/^http(s)?:\\/\\// === str && /''$/ === str) ? str.gsub(/''$/, '') : str\n # If there are an odd number of single quotes, strip a trailing ones\n #... | [
"0.7166775",
"0.6823527",
"0.6766071",
"0.6725017",
"0.67108387",
"0.66366476",
"0.6630237",
"0.65795463",
"0.6579521",
"0.6528119",
"0.65272117",
"0.6506078",
"0.64988613",
"0.6480681",
"0.6443547",
"0.6420544",
"0.6391701",
"0.63673896",
"0.63527375",
"0.62958634",
"0.62870... | 0.63202834 | 19 |
POST /abouts POST /abouts.json | def create
@about = current_user.abouts.build(about_params)
respond_to do |format|
if @about.save
format.html { redirect_to abouts_url, notice: 'about was successfully created.' }
format.json { render :show, status: :created, location: @about }
else
format.html { render :new }
forma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @about = About.new(about_params)\n\n respond_to do |format|\n if @about.save\n format.html { redirect_to url_for(action: 'show', id: @about), notice: f(@about) }\n format.json { render :show, status: :created, location: url_for(action: 'show', id: @about) }\n else\n ... | [
"0.67502224",
"0.6541178",
"0.6515387",
"0.63748264",
"0.6361328",
"0.63532275",
"0.63159287",
"0.62620974",
"0.6253559",
"0.6186931",
"0.614552",
"0.6118129",
"0.6118129",
"0.6022479",
"0.59971225",
"0.5948106",
"0.5891161",
"0.5887512",
"0.58864087",
"0.5802836",
"0.5777754... | 0.67293125 | 1 |
PATCH/PUT /abouts/1 PATCH/PUT /abouts/1.json | def update
respond_to do |format|
if @about.update(about_params)
format.html { redirect_to admin_abouts_path, notice: 'about was successfully updated.' }
format.json { render :show, status: :ok, location: @about }
else
format.html { render :edit }
format.json { render json: @about.erro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @about.update(about_params)\n format.html { redirect_to url_for(action: 'show', id: @about), notice: f(@about) }\n format.json { render :show, status: :ok, location: url_for(action: 'show', id: @about) }\n else\n format.html { render :edit ... | [
"0.6746364",
"0.6440377",
"0.62673795",
"0.6255412",
"0.6227273",
"0.6214823",
"0.6126591",
"0.6111614",
"0.6062029",
"0.6037248",
"0.5977018",
"0.58865654",
"0.58752036",
"0.58057815",
"0.5796954",
"0.57960325",
"0.57891744",
"0.5787195",
"0.5761572",
"0.5726593",
"0.5710296... | 0.67112947 | 1 |
DELETE /abouts/1 DELETE /abouts/1.json | def destroy
@about.destroy
respond_to do |format|
format.html { redirect_to abouts_url, notice: 'about was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @about.destroy\n respond_to do |format|\n format.html { redirect_to url_for(action: 'index'), notice: f(@about) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @about_page = AboutPage.find(params[:id])\n @about_page.destroy\n\n respond_to do |format|\n... | [
"0.75123847",
"0.74624133",
"0.74559045",
"0.74016553",
"0.73980755",
"0.7252868",
"0.71780443",
"0.7147966",
"0.71185297",
"0.701188",
"0.69506323",
"0.6871783",
"0.6838624",
"0.68271446",
"0.6823178",
"0.673006",
"0.6726594",
"0.6718924",
"0.67175394",
"0.66960686",
"0.6666... | 0.7624159 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_about
@about = about.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.6164095",
"0.6046031",
"0.5945298",
"0.59179014",
"0.58890367",
"0.58341795",
"0.5776118",
"0.5700777",
"0.5700777",
"0.5656277",
"0.56218207",
"0.5423995",
"0.5411516",
"0.5411516",
"0.5411516",
"0.5395004",
"0.53783494",
"0.53593004",
"0.53412604",
"0.534078",
"0.5332865... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def about_params
params.require(:about).permit(:name, :bio, :position, :avatar)
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.6981273",
"0.6783789",
"0.67460483",
"0.6742222",
"0.67354137",
"0.65934366",
"0.65028495",
"0.6497783",
"0.64826745",
"0.6479415",
"0.6456823",
"0.6440081",
"0.63800216",
"0.6376521",
"0.636652",
"0.6319898",
"0.6300256",
"0.62994003",
"0.6293621",
"0.6292629",
"0.6291586... | 0.0 | -1 |
GET /archivos GET /archivos.json | def index
@archivos = Archivo.all
@archivos = Archivo.search(params[:search]).order(sort_column + " " + sort_direction).paginate(:per_page => 5, :page => params[:page])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n #@complaintfiles = Complaintfile.all\n @complaintfilesqueja = Complaintfile.where([\"complaint_user_id = ?\", params[:idqueja]]).order(\"created_at ASC\")\n @idqueja = params[:idqueja]\n render json: {archivos: @complaintfilesqueja}, status: :ok\n end",
"def show\n ... | [
"0.69814295",
"0.6967388",
"0.68722355",
"0.68575966",
"0.6735147",
"0.6635512",
"0.6585182",
"0.65516394",
"0.65130675",
"0.6477108",
"0.64563334",
"0.6382606",
"0.63356197",
"0.62464476",
"0.62238175",
"0.6221139",
"0.6156157",
"0.6151628",
"0.6149812",
"0.6124202",
"0.6116... | 0.0 | -1 |
GET /archivos/1 GET /archivos/1.json | def show
@archivo = Archivo.find(params[:id])
@var = @archivo.uploaded_file.path
@var2 = @var.gsub(@archivo.uploaded_file_file_name, '');
if @archivo.uploaded_file_content_type == 'application/pdf'
send_file Rails.root.join(@var2, @archivo.uploaded_file_file_name), :type=>"application/pdf", :x... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @archivo = Archivo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @archivo }\n end\n end",
"def show\n @arquivo = Arquivo.find(params[:id])\n @comentarios = Comentario.where(:comentavel_id => @arquivo.id, :comentavel_ty... | [
"0.71886754",
"0.70853823",
"0.6944185",
"0.693697",
"0.6784495",
"0.6755433",
"0.66085494",
"0.65730226",
"0.65394026",
"0.6538225",
"0.65122765",
"0.65099144",
"0.64869636",
"0.64631426",
"0.64155704",
"0.63670987",
"0.63292676",
"0.63071954",
"0.629207",
"0.62763155",
"0.6... | 0.0 | -1 |
POST /archivos POST /archivos.json | def create
@archivo = Archivo.new(archivo_params)
@archivo.uploaded_file = params[:archivo][:uploaded_file]
@archivo.save
redirect_to '/archivos'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @archivo = current_usuario.archivos.new(archivo_params)\n\n respond_to do |format|\n if @archivo.save\n format.html { redirect_to @archivo, notice: 'El archivo fue creado exitosamente.' }\n format.json { render :show, status: :created, location: @archivo }\n else\n ... | [
"0.678319",
"0.6379387",
"0.6353483",
"0.6018607",
"0.60157603",
"0.5977016",
"0.5974857",
"0.59050184",
"0.59001327",
"0.5882037",
"0.587775",
"0.58536917",
"0.5848303",
"0.5818882",
"0.58181673",
"0.5807139",
"0.57922435",
"0.5775309",
"0.5745292",
"0.5737311",
"0.57254225"... | 0.61345816 | 3 |
PATCH/PUT /archivos/1 PATCH/PUT /archivos/1.json | def update
respond_to do |format|
if @archivo.update(archivo_params)
format.html { redirect_to @archivo, notice: 'Archivo was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { render json: @archivo.errors, s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @archivo = Archivo.find(params[:id])\n\n respond_to do |format|\n if @archivo.update_attributes(params[:archivo])\n format.html { redirect_to @archivo, notice: 'File was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edi... | [
"0.67965055",
"0.6563878",
"0.64017946",
"0.6400964",
"0.63918453",
"0.63352126",
"0.6329062",
"0.6327892",
"0.6317999",
"0.63159823",
"0.62918615",
"0.628527",
"0.6272467",
"0.62658507",
"0.6251823",
"0.6238062",
"0.6238062",
"0.62333655",
"0.6224141",
"0.62155086",
"0.61858... | 0.66175604 | 1 |
DELETE /archivos/1 DELETE /archivos/1.json | def destroy
@archivo.destroy
respond_to do |format|
format.html { redirect_to archivos_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @archivo = Archivo.find(params[:id])\n @archivo.destroy\n\n respond_to do |format|\n format.html { redirect_to archivos_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @archivo.destroy\n respond_to do |format|\n format.html { redirect_to archivos_url,... | [
"0.7490742",
"0.7367104",
"0.73626137",
"0.73059446",
"0.7067993",
"0.7064913",
"0.70547724",
"0.7053562",
"0.700739",
"0.70038414",
"0.6993546",
"0.6946628",
"0.69179684",
"0.6900882",
"0.68998986",
"0.6886765",
"0.68706214",
"0.68553185",
"0.68548566",
"0.68486094",
"0.6818... | 0.7449365 | 1 |
Use callbacks to share common setup or constraints between actions. | def set_archivo
@archivo = Archivo.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.6164095",
"0.6046031",
"0.5945298",
"0.59179014",
"0.58890367",
"0.58341795",
"0.5776118",
"0.5700777",
"0.5700777",
"0.5656277",
"0.56218207",
"0.5423995",
"0.5411516",
"0.5411516",
"0.5411516",
"0.5395004",
"0.53783494",
"0.53593004",
"0.53412604",
"0.534078",
"0.5332865... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def archivo_params
params.require(:archivo).permit(:nombre, :autor, :uploaded_file)
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.6979893",
"0.6781746",
"0.6746611",
"0.6742344",
"0.6735229",
"0.6592651",
"0.65027124",
"0.6498011",
"0.648163",
"0.647716",
"0.64556813",
"0.64386255",
"0.63784456",
"0.63756156",
"0.636574",
"0.6319542",
"0.63004524",
"0.6299559",
"0.62925464",
"0.62923217",
"0.6289894"... | 0.0 | -1 |
GET /dis_dispensable_generics GET /dis_dispensable_generics.json | def index
# @cd = DisDispensableGeneric.all
a = DisDispensableGeneric.paginate(:page => params[:page], :per_page => 3).order(:id)
@m = array = []
a.each do |m|
# user = User.where(id: m.user_two).last
h = {}
h["id"] = m.id
h["routed_doseform_generic"] = m.routed_doseform_generic_id
# S... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @dis_routed_generics = DisRoutedGeneric.all\n end",
"def index\n @generics = Generic.all\n end",
"def set_dis_dispensable_generic\n @dis_dispensable_generic = DisDispensableGeneric.find(params[:id])\n end",
"def unpaged\n authorize! :show, PointsEntryType\n load_active_point... | [
"0.71119773",
"0.60671246",
"0.6028175",
"0.5778998",
"0.57667917",
"0.55488944",
"0.5423161",
"0.5394792",
"0.53919923",
"0.5379791",
"0.52328295",
"0.5207718",
"0.518446",
"0.5166953",
"0.5085375",
"0.50114805",
"0.50055736",
"0.4999227",
"0.497802",
"0.4957632",
"0.4929898... | 0.0 | -1 |
GET /dis_dispensable_generics/1 GET /dis_dispensable_generics/1.json | def show
respond_with DisDispensableGeneric.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @dis_routed_generics = DisRoutedGeneric.all\n end",
"def index\n @generics = Generic.all\n end",
"def set_dis_dispensable_generic\n @dis_dispensable_generic = DisDispensableGeneric.find(params[:id])\n end",
"def show\n respond_with DisRoutedGeneric.find(params[:id])\n end",
... | [
"0.7058246",
"0.61687654",
"0.61621374",
"0.5730163",
"0.5687395",
"0.55074424",
"0.550635",
"0.5370874",
"0.53546226",
"0.5266739",
"0.5210539",
"0.51713175",
"0.51590836",
"0.51341885",
"0.51152325",
"0.51117575",
"0.5090365",
"0.50648004",
"0.5057794",
"0.5055397",
"0.5044... | 0.6097524 | 3 |
POST /dis_dispensable_generics POST /dis_dispensable_generics.json | def create
@dis_dispensable_generic = DisDispensableGeneric.new(dis_dispensable_generic_params)
if @dis_dispensable_generic.save
flash[:notice] = "Task was successfully created."
respond_with(@dis_dispensable_generic)
else
flash[:notice] = "Task was not created."
end
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @dis_routed_generics = DisRoutedGeneric.all\n end",
"def set_dis_dispensable_generic\n @dis_dispensable_generic = DisDispensableGeneric.find(params[:id])\n end",
"def remove_generic_traps\n super\n end",
"def dis_dispensable_generic_params\n params.require(:dis_dispensabl... | [
"0.6508604",
"0.58634955",
"0.56403697",
"0.557034",
"0.5495221",
"0.54489917",
"0.5325512",
"0.51529974",
"0.51529974",
"0.50528497",
"0.5039441",
"0.5038918",
"0.49900332",
"0.4987647",
"0.49871966",
"0.49826488",
"0.49812773",
"0.49812773",
"0.4917561",
"0.48779085",
"0.48... | 0.52505666 | 7 |
PATCH/PUT /dis_dispensable_generics/1 PATCH/PUT /dis_dispensable_generics/1.json | def update
respond_to do |format|
if @dis_dispensable_generic.update(dis_dispensable_generic_params)
format.html { redirect_to @dis_dispensable_generic, notice: 'Combination dose was successfully updated.' }
format.json { render :show, status: :ok, location: @dis_dispensable_generic }
el... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_dis_dispensable_generic\n @dis_dispensable_generic = DisDispensableGeneric.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @dis_routed_generic.update(dis_routed_generic_params)\n format.html { redirect_to @dis_routed_generic, notice: 'Dis routed generic was succ... | [
"0.6018558",
"0.5581575",
"0.5494589",
"0.53936696",
"0.5285275",
"0.52224886",
"0.514407",
"0.5074925",
"0.5071004",
"0.5069527",
"0.5058817",
"0.5002754",
"0.49446884",
"0.49419922",
"0.49377882",
"0.49286452",
"0.49251628",
"0.48952925",
"0.48832682",
"0.48780897",
"0.4875... | 0.560192 | 1 |
DELETE /dis_dispensable_generics/1 DELETE /dis_dispensable_generics/1.json | def destroy
@dis_dispensable_generic.destroy
respond_to do |format|
format.html { redirect_to dis_dispensable_generics_url, notice: 'Combination dose was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @dis_routed_generic.destroy\n respond_to do |format|\n format.html { redirect_to dis_routed_generics_url, notice: 'Dis routed generic was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @generic.destroy\n respond_to do |format|\n ... | [
"0.7055482",
"0.6721518",
"0.65022486",
"0.63293207",
"0.6308636",
"0.62543446",
"0.618761",
"0.61021465",
"0.60687274",
"0.60277474",
"0.6016628",
"0.59881175",
"0.59762454",
"0.5974479",
"0.5950083",
"0.5949536",
"0.59323806",
"0.59244823",
"0.59196746",
"0.59142697",
"0.59... | 0.68558043 | 1 |
Use callbacks to share common setup or constraints between actions. | def set_dis_dispensable_generic
@dis_dispensable_generic = DisDispensableGeneric.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.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 dis_dispensable_generic_params
params.require(:dis_dispensable_generic).permit(:routed_doseform_generic_id, :strength, :strength_doseunit_id, :per_strength, :per_doseunit_id, :name, :release_status_id, :status_id, :datasource_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.6979893",
"0.6781746",
"0.6746611",
"0.6742344",
"0.6735229",
"0.6592651",
"0.65027124",
"0.6498011",
"0.648163",
"0.647716",
"0.64556813",
"0.64386255",
"0.63784456",
"0.63756156",
"0.636574",
"0.6319542",
"0.63004524",
"0.6299559",
"0.62925464",
"0.62923217",
"0.6289894"... | 0.0 | -1 |
GET /parking_spots/1 GET /parking_spots/1.json | def show
@parking_spot = ParkingSpot.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @parking_spot }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @spots = Spot.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @spots }\n end\n end",
"def index\n @spots = Spot.visible.order('id desc').page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n forma... | [
"0.7355885",
"0.725255",
"0.7208035",
"0.71272045",
"0.71053034",
"0.7102921",
"0.70735836",
"0.69180685",
"0.68802136",
"0.68470055",
"0.67362547",
"0.66820896",
"0.6624951",
"0.6617278",
"0.6617278",
"0.6608523",
"0.65593976",
"0.6555925",
"0.65553045",
"0.6549036",
"0.6549... | 0.7814348 | 0 |
GET /parking_spots/new GET /parking_spots/new.json | def new
@parking_spot = ParkingSpot.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @parking_spot }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @spot = Spot.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @spot }\n end\n end",
"def new\n @spot = Spot.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @spot }\n end\n end",
"d... | [
"0.79371774",
"0.79371774",
"0.77531326",
"0.76152456",
"0.75859755",
"0.7436449",
"0.7305505",
"0.72988915",
"0.71141857",
"0.6973971",
"0.6969778",
"0.6938843",
"0.69371927",
"0.6897539",
"0.6868245",
"0.6868025",
"0.68359196",
"0.6806741",
"0.6786358",
"0.6781353",
"0.6776... | 0.81652147 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.