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
does this board have a winner? check if there is a winning row, then if there is a winning column, then diagonal. returns the winner or nil if the game is not yet won. a winning row/column/diagonal is one which has no nils and whose elements are all the same. the winner is then the element which is the same.
def winner [rows, columns, diagonals].each do |groups| win_groups = groups.select { |g| g.all? && g.uniq.size == 1 } return [@human_player, @computer_player].find { |p| p.to_s == win_groups[0][0] } if !win_groups.empty? end nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def winner\n # shortcut for less typing\n b = @board\n\n # rows\n return b[0] if b[0] == b[1] && b[1] == b[2]\n return b[3] if b[3] == b[4] && b[4] == b[5]\n return b[6] if b[6] == b[7] && b[7] == b[8]\n\n # cols\n return b[0] if b[0] == b[3] && b[3] == b[6]\n return b[1] if b[1] == b[4]...
[ "0.83198833", "0.81764257", "0.81486225", "0.812703", "0.8113961", "0.8099085", "0.8024261", "0.80179167", "0.80140394", "0.7967084", "0.79667944", "0.79516107", "0.7916812", "0.78925055", "0.78748506", "0.78414804", "0.7810489", "0.7754558", "0.7737589", "0.77328277", "0.770...
0.7751713
18
returns list of tuples describing nonmarked cells > [ [r,c] ]
def available_cells cells = [] rows.each_with_index do |row, ri| row.each_with_index do |cell, ci| cells << [ri, ci] if cell.nil? end end cells end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unassigned_cells\n grid.cells.to_a.reject { |cell| cell.value }\n end", "def get_other_block_cells cell\n\t\tblock = get_block cell\n\t\tfirst_cell = cell / 27 * 27\n\t\treturn (first_cell...first_cell + 27).select { |r| block == r / 27 * 3 + r % 9 / 3 }.to_a - [cell]\n\tend", "def neighbors cell\n ...
[ "0.6576118", "0.647619", "0.64418936", "0.63750285", "0.63619417", "0.63587683", "0.627323", "0.6249036", "0.62005013", "0.6170337", "0.6140886", "0.6103744", "0.61019045", "0.609262", "0.60817635", "0.6081043", "0.605226", "0.60493165", "0.6024733", "0.60156953", "0.5987666"...
0.6356224
6
heuristic for a player winning the game given this board
def heuristic_for_player(player) # for each row, col, diag: # +100 for a win, 10 for two (with 1 empty), 1 for single (with 2 empty) # above negated for other player, subtracting 1/10th because it is not their turn (assume it is player's turn) # , summed heuristic_proc = proc do |acc, row| ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_for_win(player)\n\tif ($grid_hash[\"tl\"] == player) && ($grid_hash[\"tc\"] == player) && ($grid_hash[\"tr\"] == player)\n\t\twin(player)\n\telsif ($grid_hash[\"cl\"] == player) && ($grid_hash[\"cc\"] == player) && ($grid_hash[\"cr\"] == player)\n\t\twin(player)\n\telsif ($grid_hash[\"bl\"] == player) &&...
[ "0.73557043", "0.7177711", "0.71628666", "0.71338725", "0.7116268", "0.70942736", "0.7089577", "0.7070855", "0.70603967", "0.7024414", "0.70135534", "0.69724154", "0.6964752", "0.6963684", "0.6960248", "0.6932662", "0.6918179", "0.6912157", "0.69090766", "0.69063103", "0.6905...
0.80389357
0
Overwrite this method to customize how sections are displayed across all pages of the admin dashboard.
def display_resource(section) section.name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @admin_sections = HomeSection.all\n end", "def sections\n account.accessible_sections if account\n end", "def sections\n respond_with @page.sections\n end", "def sections\n respond_with @page.sections\n end", "def default_sections\n [\n Section.new(name: \"summary\",...
[ "0.619118", "0.6131188", "0.6075806", "0.6075806", "0.60735637", "0.6057", "0.6036219", "0.5930749", "0.59189206", "0.5890286", "0.58095133", "0.5768211", "0.5735042", "0.56553924", "0.5652894", "0.56392163", "0.5577042", "0.55610216", "0.5558902", "0.55585676", "0.55521953",...
0.0
-1
same as `load`, but will override existing values in `ENV`
def overload(secret_id) ignoring_nonexistent_secret do env = Environment.new(secret_id) instrument('secrets.overload', env: env) { env.apply! } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load\n Dotenv.load(\n root.join(\".env.local\"),\n root.join(\".env.#{Rails.env}\"),\n root.join(\".env\")\n )\n end", "def load_environment(*args)\n\t\t\tpath = environment_path(*args)\n\t\t\t\n\t\t\tif File.exist?(path)\n\t\t\t\t# Load the YAML environment file:\n\t\t\t\t@...
[ "0.7329151", "0.72662574", "0.72486913", "0.7222773", "0.71603775", "0.7124627", "0.7092681", "0.70685375", "0.68503815", "0.68421245", "0.6829146", "0.68004715", "0.67679393", "0.67175376", "0.6690432", "0.6684529", "0.66574657", "0.6629591", "0.6610921", "0.6596254", "0.657...
0.0
-1
The solr_install_dir argument is expected to be "/app/solr7 or /app/solr6", the directory under which the solr is installed on the compute
def initialize(host, port, solr_admin_user, solr_admin_password, solr_app_user, solr_password, zk_classpath, zk_host, solr_install_dir) @host = host @port = port @solr_admin_user = solr_admin_user @solr_admin_password = solr_admin_password @solr_app_user = solr_app_user @solr_password = solr_pas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solr_home_dir\n File.expand_path(File.join(solr_dist_dir, 'example', 'solr'))\nend", "def solr_dist_dir\n File.expand_path(File.join(File.dirname(__FILE__), '..', 'solr'))\nend", "def install_solr_home\n unless File.exists?(solr_home)\n Sunspot::Installer.execute(\n solr_home,\...
[ "0.8147627", "0.79858583", "0.79800534", "0.75526506", "0.7465792", "0.715425", "0.715425", "0.67773694", "0.6755094", "0.6666977", "0.6512798", "0.6484884", "0.64390177", "0.6188005", "0.61539817", "0.61281294", "0.609086", "0.6069422", "0.6039547", "0.59187484", "0.5912394"...
0.592108
19
This method creates a file which contains the Solr user credentials for the recipes and monitor scripts to use We also store the app user credentials although we do not need it and do not use it for our purposes This could be useful further down the line to migrate to secreteclient OneOps component
def create_secrete_file() payload = { "admin_user" => { "username" => @solr_admin_user, "password" => @solr_admin_password, }, #TODO should the key be "app_user" @solr_app_user => { "username" => @solr_app_user, "password" => @solr_pas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_user_credentials(username, password)\n File.open(credentials_path, 'a') do |users|\n users.write(Psych.dump(\"#{username}\": encrypt_password(password)))\n end\n clean_yaml\nend", "def create_credentials\n FileUtils.mkdir_p(@local_credentials_dir)\n message \"Going to create the cre...
[ "0.59987783", "0.59636617", "0.59626657", "0.58443135", "0.5808454", "0.57968056", "0.57357675", "0.5729722", "0.5712049", "0.56705517", "0.56601936", "0.5577583", "0.54877657", "0.54229605", "0.5419651", "0.5411637", "0.5411637", "0.5381947", "0.5372297", "0.5370964", "0.537...
0.71091247
0
This method uploads the security.json file content to the zookeeper. It just uploads the default template file with no users, roles, permissions added to it
def upload_security_json_with_no_credentials() payload = { "authentication" => { "class" => "solr.BasicAuthPlugin" }, "authorization" => { "class" => "solr.RuleBasedAuthorizationPlugin" } } cmd = "#{@solr_install_dir}/server/scripts/cloud-scripts/zk...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_secrete_file()\n\n payload = {\n \"admin_user\" => {\n \"username\" => @solr_admin_user,\n \"password\" => @solr_admin_password,\n },\n #TODO should the key be \"app_user\"\n @solr_app_user => {\n \"username\" => @solr_app_user,\n ...
[ "0.5791267", "0.57667667", "0.5710712", "0.5689615", "0.564075", "0.550264", "0.5454038", "0.543372", "0.53172344", "0.53170604", "0.52894396", "0.5282607", "0.51955545", "0.51955545", "0.5155096", "0.51351833", "0.5134265", "0.5129723", "0.511404", "0.5108365", "0.51023424",...
0.6727751
0
This method builds the payload for uploading permissions assigned to the to the admin and app roles. The admin role will be assigned to the solr admin user and the app role will be assigned to the solr app user The Solr app user will be able to perform all the admin/regular read operations on the user, he will also be ...
def build_perms_payload() permissions = [ {"name" => "update", "role" => ["admin","app"]}, {"name" => "read", "role" => ["admin","app"]}, {"name" => "schema-read", "role" => ["admin", "app"]}, {"name" => "config-read", "role" =>["admin","app"]}, {"name" => "collection-admin-r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_permissions\n [\"License\", \"Archive\", \"Contract\"].each do |doc|\n klass = doc.constantize\n doc_id = \"#{doc.downcase}_id\".to_sym\n permissions = self.send(\"#{doc.downcase.pluralize.singularize}_permissions\".to_sym)\n klass.find(:all).each { |record|\n permissions.crea...
[ "0.5770808", "0.5586028", "0.547323", "0.5462252", "0.54039717", "0.5340296", "0.5325149", "0.5298874", "0.52615315", "0.5246816", "0.5240375", "0.5230049", "0.52200145", "0.52200145", "0.51953745", "0.51852095", "0.51749897", "0.51381665", "0.51348686", "0.5129264", "0.51143...
0.70029217
0
Snippet for the list_mute_configs call in the SecurityCenter service This is an autogenerated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Clientlist_mute_configs. It may require modification in order to execute successfully.
def list_mute_configs # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest.new # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_kms_configs request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_kms_configs_request request_pb\n query_string_params = if query_string_params.an...
[ "0.60781336", "0.5077458", "0.49592078", "0.49429196", "0.49361446", "0.49273643", "0.48339686", "0.48153472", "0.48004612", "0.47821614", "0.46847573", "0.46818435", "0.46818435", "0.46568942", "0.46550396", "0.46374267", "0.45901334", "0.458083", "0.4455111", "0.44218585", ...
0.8602586
0
Constructs the migrate stub on the fly
def generate_migrate(opts={}) %Q^ load_ws2_32: mov r14, 'ws2_32' push r14 mov rcx, rsp ; pointer to 'ws2_32' sub rsp, #{WSA_SIZE} ; alloc size, plus alignment (used later) mov r13, rsp ; save pointer to this struct sub rsp, 0x28 ; sp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_migrations\n versions = []\n versions << generate_migration(\"create_users\", <<-EOF\nHanami::Model.migration do\n change do\n create_table :users do\n primary_key :id\n column :name, String\n end\n end\nend\nEOF\n)\n\n versions << generate_migration(\"add_age_to...
[ "0.6903996", "0.68267065", "0.67812127", "0.636325", "0.6360586", "0.61708456", "0.6164415", "0.60395527", "0.6034991", "0.60097086", "0.59950036", "0.59916055", "0.59914774", "0.5976202", "0.5968922", "0.5951179", "0.59334534", "0.591808", "0.58762395", "0.5837199", "0.58347...
0.6230338
5
For N = 24, there are 2 digits 2 & 4. Both these digits exactly divide 24. So our answer is 2 Using each_char and then typecasting each char to int.
def find_digits_count_string_operations(input) digits = 0 n = input.to_i input.each_char do |c| c = c.to_i unless c == 0 q, r = n.divmod(c) if r == 0 digits += 1 end end end puts digits end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def digitize(n)\n n.to_s.chars.map(&:to_i)\nend", "def digitize(n)\n n.to_s.chars.map(&:to_i)\nend", "def to_numbers( chars )\r\n chars.unpack(\"C*\").collect {|x| x - 64}\r\n end", "def digitize(n)\n nums = n.to_s.split('')\n nums.map { |num| num.to_i }\nend", "def convert_to_int num_string\n num...
[ "0.7053623", "0.7053623", "0.6989982", "0.674691", "0.673437", "0.67150694", "0.6555716", "0.654214", "0.64726347", "0.6460298", "0.64434004", "0.6428429", "0.6342071", "0.6321419", "0.63112175", "0.630452", "0.6281697", "0.6274735", "0.6240163", "0.6215572", "0.6197247", "...
0.0
-1
You can use a hash to accept optional parameters when you are creating methods. This can be helpful when you want to give your methods some more flexibility and expressivity. More options if you will. Example below:
def greeting(name, options = {}) if options.empty? # use the empty? method to detect if options prameter had anything puts "Hi, my name is #{name}" else puts "Hi, my name is #{name} and I'm #{options[:age]} years old and I live in #{options[:city]}." end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def meth **options\nend", "def meth **options\nend", "def method (a=3, b=4)\r\nend", "def method(param1, options = {})\n\tend", "def method (a=3, b)\r\nend", "def method_missing(meth, *args) = parameters.has_key?(meth) ? parameters[meth] : meth", "def meth(**\n options)\nend", "def ...
[ "0.703845", "0.703845", "0.68307734", "0.67855346", "0.67754495", "0.66976005", "0.6669738", "0.6663254", "0.6627065", "0.6603024", "0.65222806", "0.64534503", "0.64522725", "0.6362726", "0.6339822", "0.6336949", "0.6315946", "0.6297497", "0.6287043", "0.62714237", "0.626511"...
0.0
-1
Get Sending Confirmation Email Id.
def confirmation_email_id @api.get("#{@api.path}/Import/#{@id}/Sending") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_confirm_email\n settings.fetch('send_mail',{}).fetch('confirm_email', true)\n end", "def recipient_id\n @row[\"配送先ID\"].to_s\n end", "def confirm_email(confirmation)\n @confirmation = confirmation\n @account = confirmation.account\n \n mail :to => confirmation.unconfirmed_e...
[ "0.6270298", "0.5946937", "0.5909856", "0.5749004", "0.5722152", "0.5719367", "0.5668651", "0.5668433", "0.56330305", "0.5625534", "0.5608541", "0.55929816", "0.5587517", "0.5558845", "0.5555174", "0.55380076", "0.5525643", "0.5525643", "0.550971", "0.550971", "0.55049103", ...
0.7562067
0
GET /medecins GET /medecins.json
def index @medecins = Medecin.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def meals\n get(\"/user/#{@user_id}/meals.json\")\n end", "def show\n @messege = Messege.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @messege }\n end\n end", "def index\n @memes = Meme.all\n end", "def set_medecin\n ...
[ "0.63440204", "0.6076723", "0.5885143", "0.58006895", "0.579023", "0.579023", "0.579023", "0.5737353", "0.5722377", "0.5700576", "0.56988066", "0.5657621", "0.5642779", "0.56395566", "0.5629906", "0.5628864", "0.56157506", "0.5591745", "0.5568843", "0.5566829", "0.54865295", ...
0.67163396
0
GET /medecins/1 GET /medecins/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @medecins = Medecin.all\n end", "def show\n @messege = Messege.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @messege }\n end\n end", "def show \n @inmate = Inmate.find(params[:id])\n render json: @inmat...
[ "0.6473131", "0.6305703", "0.6203667", "0.6156338", "0.60534054", "0.60121214", "0.6000088", "0.59754276", "0.59337205", "0.5879408", "0.58725506", "0.5856041", "0.58536303", "0.58472914", "0.58385134", "0.58324915", "0.5809072", "0.5785206", "0.5739903", "0.57358086", "0.573...
0.0
-1
POST /medecins POST /medecins.json
def create @medecin = Medecin.new(medecin_params) respond_to do |format| if @medecin.save format.html { redirect_to @medecin, notice: 'Medecin was successfully created.' } format.json { render :show, status: :created, location: @medecin } else format.html { render :new } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_medecin\n @medecin = Medecin.find(params[:id])\n end", "def create\n @messege = Messege.new(params[:messege])\n\n respond_to do |format|\n if @messege.save\n format.html { redirect_to @messege, notice: 'Messege was successfully created.' }\n format.json { render json: @me...
[ "0.5667339", "0.5535352", "0.550221", "0.5454367", "0.5450707", "0.54281354", "0.53758675", "0.53133583", "0.52946585", "0.5225436", "0.5224979", "0.5217572", "0.5214713", "0.521288", "0.5179863", "0.5172216", "0.515975", "0.5101781", "0.5072349", "0.50685745", "0.50327045", ...
0.68035567
0
PATCH/PUT /medecins/1 PATCH/PUT /medecins/1.json
def update respond_to do |format| if @medecin.update(medecin_params) format.html { redirect_to @medecin, notice: 'Medecin was successfully updated.' } format.json { render :show, status: :ok, location: @medecin } else format.html { render :edit } format.json { render json...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def patch!\n request! :patch\n end", "def update\n respond_to do...
[ "0.633141", "0.63071245", "0.61186534", "0.6110296", "0.59793305", "0.59716284", "0.59640163", "0.5931968", "0.59314394", "0.59307003", "0.5921034", "0.5916899", "0.5874112", "0.58535826", "0.58492523", "0.5841196", "0.58391744", "0.5839161", "0.58053637", "0.5801731", "0.580...
0.6572781
0
DELETE /medecins/1 DELETE /medecins/1.json
def destroy @medecin.destroy respond_to do |format| format.html { redirect_to medecins_url, notice: 'Medecin 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(path)\n RestClient.delete request_base+path\n end", "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = l...
[ "0.7084642", "0.68280876", "0.6794383", "0.6774974", "0.6748441", "0.66809237", "0.6584451", "0.65838003", "0.65753657", "0.65666705", "0.6556654", "0.6533802", "0.6501132", "0.64999586", "0.6495905", "0.6492152", "0.6465316", "0.6465316", "0.6463047", "0.6463047", "0.6463047...
0.67274433
5
Use callbacks to share common setup or constraints between actions.
def set_medecin @medecin = Medecin.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def medecin_params params.require(:medecin).permit(:nom, :lieu, :specialite) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
USING YIELD AND A BLOCK TO SORT
def bubble_sort_by(array_to_sort) size = array_to_sort.length puts "array to sort: " p array_to_sort for i in 0..size-1 for index in 0..size-2 left = array_to_sort[index] right = array_to_sort[index + 1] if yield(left, right) > 0 temp_item = array_to_sort[index] a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort!(&block)\n return txactions.sort!(&block)\n end", "def sort_by( & block )\n\n load_parent_state\n \n return super\n\n end", "def sort( & block )\n\n load_parent_state\n \n return super\n \n end", "def merge_sort!(&block)\n become_clone_of merge_sort(&block)\n end", ...
[ "0.70950073", "0.70397514", "0.70249504", "0.70231533", "0.70127213", "0.6961302", "0.68849146", "0.67775786", "0.67736244", "0.67492926", "0.67407036", "0.6718279", "0.67155004", "0.6702239", "0.66780865", "0.6677954", "0.6647473", "0.66168743", "0.6600235", "0.6566004", "0....
0.6036124
53
copy from this.copy(that) copies that into this
def copy(project) project.tickets.each do |ticket| copy_ticket = self.ticket!(:title => ticket.title, :description => ticket.description) ticket.comments.each do |comment| copy_ticket.comment!(:body => comment.body) sleep 1 end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy\n\t\t\treturn self.dup\n\t\tend", "def copy_to(other); end", "def copy\n dup\n end", "def copy\n Marshal.load(Marshal.dump(self))\n end", "def deepcopy\n\t\tMarshal.load(Marshal.dump(self))\n\tend", "def make_copy\n\t\t\tMarshal.load(Marshal.dump(self))\n\t\tend", "def clon...
[ "0.76714295", "0.7615847", "0.75631666", "0.75352615", "0.73786664", "0.7314824", "0.7305736", "0.7305736", "0.71516734", "0.71497935", "0.71256703", "0.7119499", "0.71008164", "0.71008164", "0.70856524", "0.7050348", "0.7034676", "0.7025417", "0.6992398", "0.69746256", "0.69...
0.0
-1
Movie objects are equal if and only if their id, type, name, votes, duration, rating, release_date, genres and plot attributes are the same.
def ==(other) [:id, :type, :name, :votes, :duration, :rating, :release_date, :genres, :plot, :under_development].all? do |m| other.respond_to?(m) && self.public_send(m) == other.public_send(m) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eql?(other)\n return true if equal?(other)\n return false unless self == other\n [:id, :fide_id, :rating, :fide_rating, :title, :gender].each do |m|\n return false if self.send(m) && other.send(m) && self.send(m) != other.send(m)\n end\n true\n end", "def ==(o)\n retur...
[ "0.63438", "0.6166008", "0.6055623", "0.6035411", "0.59687793", "0.5954784", "0.592835", "0.58992124", "0.58874065", "0.5851626", "0.58433586", "0.58295804", "0.5818325", "0.5792605", "0.5791253", "0.5784055", "0.57769924", "0.5752911", "0.5746401", "0.57272226", "0.5713851",...
0.623989
1
REQUIRED Your Facebook API secret key. Default: nil Accepts: String
def facebook_secret_key(value=nil) rw_config(:facebook_secret_key, value, nil) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def facebook_api_key\n raise APIKeyNeededException\n end", "def facebook_api_key\n raise APIKeyNeededException\n end", "def fb_appid_and_secret_key(facebook_appid, facebook_secret)\n if facebook_appid.is_a?(String) && facebook_secret.is_a?(String)\n @facebook_appid_global = facebook...
[ "0.7392266", "0.7392266", "0.67358077", "0.6700456", "0.66836196", "0.6628552", "0.65552646", "0.64304787", "0.63209134", "0.6284181", "0.6282371", "0.6282371", "0.6217353", "0.6212673", "0.6121422", "0.61012185", "0.6090833", "0.6052135", "0.6052135", "0.60490483", "0.604192...
0.692884
4
Which user field should be used for the facebook UID? Default: :facebook_uid Accepts: Symbol
def facebook_uid_field(value=nil) rw_config(:facebook_uid_field, value, :facebook_uid) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def facebook_username_field(value=nil)\n rw_config(:facebook_username_field, value, :facebook_username)\n end", "def facebook_uid\n @json['uid']\n end", "def facebook_id=(uid)\n self.uid = uid\n end", "def facebook_id \n self.facebook_auth_cache.uid\n end", "def user_key...
[ "0.7167493", "0.69711494", "0.6904324", "0.6808077", "0.66940546", "0.64666176", "0.64404964", "0.6380656", "0.6380656", "0.6374098", "0.6320631", "0.6308464", "0.6275855", "0.627123", "0.62686336", "0.62453175", "0.62453175", "0.62402475", "0.62402475", "0.62355006", "0.6228...
0.79186606
2
Which user field should be used for the facebook access token? Default: :facebook_access_token Accepts: Symbol
def facebook_access_token_field(value=nil) rw_config(:facebook_access_token_field, value, :facebook_access_token) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def facebook_access_token(options={})\n if current_user\n manager = self.store.managers.find_by_user_id(current_user)\n if manager.nil?\n unless current_user.admin?\n logger.error \"***** unathorized access by user #{current_user.id}\"\n end\n nil\n else\n man...
[ "0.6983966", "0.64902496", "0.64704925", "0.64703155", "0.64703155", "0.64703155", "0.64703155", "0.64703155", "0.6450198", "0.6446776", "0.6446632", "0.6444763", "0.64301515", "0.642097", "0.642097", "0.642097", "0.63654584", "0.63627523", "0.63531834", "0.63531834", "0.6353...
0.7370769
0
Which user attr_writer should be used for the (full) name for a new user when facebook_auto_register is enabled? Default: :name Accepts: Symbol
def facebook_name_field(value=nil) rw_config(:facebook_name_field, value, :name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_user_name_field(user_name)\n end", "def user_name= (name)\n options = self.class.rauth_options\n name = name.strip.downcase if options[:clean_username]\n self[:user_name] = name\n end", "def user_name_set(name)\n self.username.set name if nil_or_empty?(username[:value])\n end", "de...
[ "0.70301086", "0.68003345", "0.67757875", "0.673986", "0.66430163", "0.6490852", "0.6483667", "0.6478497", "0.64661133", "0.646331", "0.6460242", "0.64155537", "0.63320315", "0.6329227", "0.6315014", "0.63149494", "0.6313426", "0.63072896", "0.6300924", "0.6289259", "0.627791...
0.6131986
36
Which User attr_writer should be used for facebook username (if one exists) for a new user when facebook_auto_register is enabled? Default: :facebook_username Accepts: Symbol
def facebook_username_field(value=nil) rw_config(:facebook_username_field, value, :facebook_username) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_username=(value)\n @new_username = (value.nil? ? value : value.upcase)\n end", "def username=(value)\n write_attribute :username, value.downcase\n end", "def set_user_name_field(user_name)\n end", "def username=(s)\n write_attribute(:username, s.to_s.strip.sub(/^@/, '').downcase)\n end",...
[ "0.6848724", "0.6663277", "0.66238874", "0.65724933", "0.6497794", "0.6497794", "0.6492343", "0.64231443", "0.6371994", "0.6362415", "0.63605034", "0.6344785", "0.6308395", "0.6232002", "0.618202", "0.6174389", "0.616702", "0.6137491", "0.612029", "0.6067793", "0.6067793", ...
0.70202166
0
Should a new user be automatically created if there is no user with given facebook uid? Default: false Accepts: Boolean
def facebook_auto_register(value=nil) rw_config(:facebook_auto_register, value, false) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create?\n @user != nil\n end", "def create?\n\t\t!@user.nil?\n\tend", "def create?\n user.present?\n end", "def create?\n user.present?\n end", "def create?\n user.present?\n end", "def create?\n !@user.nil?\n end", "def create\n #Create user instance\n @user = User.new(pa...
[ "0.72494733", "0.7207045", "0.7083931", "0.7083931", "0.7083931", "0.70563644", "0.7047767", "0.69928604", "0.6984873", "0.6984873", "0.69770277", "0.69500273", "0.69407", "0.6872556", "0.6821319", "0.6799933", "0.66611254", "0.6585686", "0.6561982", "0.65324515", "0.6530622"...
0.0
-1
Which method should be called before the event of a successful authentication via facebook connect? Default: :during_connect Accepts: Symbol
def facebook_connect_callback(value=nil) rw_config(:facebook_connect_callback, value, :before_facebook_connect) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def before_connect(facebook_session)\n self.login = facebook_session.user.name\n self.facebook_name = facebook_session.user.name\n self.password = \"5uttr33_#{self.login}\"\n self.signup_source = 'facebook'\n end", "def facebook\n handle_auth \"facebook\"\n end", "def before_connect(facebook_s...
[ "0.66003996", "0.65749615", "0.6530368", "0.63795835", "0.626102", "0.6228564", "0.62167746", "0.618956", "0.6158801", "0.6150305", "0.61255485", "0.6123525", "0.61230356", "0.6061187", "0.6061187", "0.60608804", "0.601434", "0.601434", "0.6007941", "0.5977156", "0.5973274", ...
0.6172037
8
For printing out meaningful credentials
def credentials if self.authenticating_with_facebook? { :facebook_cookie => self.raw_cookie } else super end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def credentials\n return nil if username.nil? || password.nil?\n \"#{username}:#{password}\"\n end", "def credentials_show\n %x(cat ros/services/iam/tmp/#{Settings.platform.environment.partition_name}/postman/222_222_222-Admin_2.json)\n end", "def inspect\n inspected = super\n...
[ "0.73245674", "0.7155747", "0.6949678", "0.6949678", "0.6879086", "0.67737865", "0.66596544", "0.66596544", "0.66596544", "0.66596544", "0.66596544", "0.6640569", "0.6636422", "0.65998036", "0.65360117", "0.6470783", "0.6372939", "0.6366874", "0.6342539", "0.63272744", "0.630...
0.0
-1
Allow facebook values to be passed in to aid in account creation
def credentials=(value) super values = value.is_a?(Array) ? value : [value] if values.first.is_a?(Hash) hash = values.first.with_indifferent_access self.facebook_name = hash[:facebook_name] self.facebook_username = hash[:facebook_username] hash en...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def facebook_account_params\n params.require(:facebook_account).permit(:user_id, :facebook_account_id, :access_token, :picture_url, :email, :first_name, :last_name)\n end", "def fill_fb_credentials\n\n fill_in FB_EMAIL_OR_ID_FIELD,with:FB_USER_ID\n fill_in FB_PASSWORD_FIELD,with:FB_USER_PASSWORD\n\...
[ "0.7175913", "0.6801719", "0.65642375", "0.6560063", "0.6555339", "0.6555339", "0.6544906", "0.6510489", "0.64237505", "0.64021426", "0.63766265", "0.6333998", "0.6323422", "0.63113743", "0.6286421", "0.6278706", "0.62618685", "0.62532526", "0.6225903", "0.6202121", "0.616307...
0.0
-1
Cookie set by the Facebook JS SDK
def raw_cookie @raw_cookie ||= controller.cookies["fbs_#{self.facebook_api_key}"] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cookie\n self[HttpClient::SET_COOKIE]\n end", "def set_cookie_value\n cookie_value = User.using_client_shard(client: @client).get_cookie_value(@user.id, @user.password, @browser_user_agent)\n success_with_data({cookie_value: cookie_value, user_token_sale_state: @user.get_token_sale_state_pa...
[ "0.7422192", "0.7267396", "0.7201183", "0.70703876", "0.7053477", "0.70526844", "0.6959549", "0.6924431", "0.69183093", "0.68668807", "0.6859629", "0.68525237", "0.68308324", "0.6822469", "0.6822338", "0.6822338", "0.6822338", "0.6822338", "0.6822338", "0.6822338", "0.6822338...
0.67890453
23
Override this if you only want some requests to use facebook
def authenticating_with_facebook? !authenticating_with_unauthorized_record? && self.facebook_api_keys_provided? && self.raw_cookie end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def facebook\n end", "def facebook\n\n end", "def verify_authenticity_token\n super unless request_comes_from_facebook?\n end", "def facebook_request\n redirect_to facebook_authenticate_url\n end", "def facebook\n handle_auth \"facebook\"\n end", "def facebook\n handle_oauth\n end", "...
[ "0.7492562", "0.7469584", "0.715355", "0.7121518", "0.7118632", "0.6937698", "0.6935348", "0.68947065", "0.67705816", "0.67381036", "0.67110145", "0.67040014", "0.6600341", "0.6542265", "0.64666116", "0.63801837", "0.63766825", "0.63627017", "0.6333331", "0.6284893", "0.62311...
0.57855356
66
GET /plantypes/1 GET /plantypes/1.json
def show @plantype = Plantype.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @plantype } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @plantype = Plantype.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @plantype }\n end\n end", "def show\n @plantype_strategy = PlantypeStrategy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format...
[ "0.6901287", "0.66660297", "0.6581495", "0.64921963", "0.6484403", "0.64774877", "0.6429086", "0.6326996", "0.6325407", "0.630531", "0.62998223", "0.6296487", "0.6231509", "0.62080985", "0.6190842", "0.6188732", "0.6184507", "0.6183936", "0.6183171", "0.6153816", "0.610817", ...
0.7730278
0
GET /plantypes/new GET /plantypes/new.json
def new @plantype = Plantype.new respond_to do |format| format.html # new.html.erb format.json { render json: @plantype } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @plantype = Plantype.new(params[:plantype])\n\n respond_to do |format|\n if @plantype.save\n format.html { redirect_to @plantype, notice: 'Plantype was successfully created.' }\n format.json { render json: @plantype, status: :created, location: @plantype }\n else\n ...
[ "0.7372502", "0.7326829", "0.7272325", "0.72034144", "0.72034144", "0.70962554", "0.7012722", "0.70046", "0.6981302", "0.68949616", "0.6889869", "0.6884477", "0.6872197", "0.6870096", "0.6867721", "0.683738", "0.6833416", "0.6822855", "0.68092793", "0.67990726", "0.6766987", ...
0.81285655
0
POST /plantypes POST /plantypes.json
def create @plantype = Plantype.new(params[:plantype]) respond_to do |format| if @plantype.save format.html { redirect_to @plantype, notice: 'Plantype was successfully created.' } format.json { render json: @plantype, status: :created, location: @plantype } else format.html ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @plantype = Plantype.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @plantype }\n end\n end", "def tipo_plan_params\n params.require(:tipo_plan).permit(:tipo, :descripcion, :plan_paciente_id)\n end", "def create # rubocop:disable Met...
[ "0.6431026", "0.63140357", "0.61822444", "0.6180239", "0.61742234", "0.61303836", "0.6044102", "0.60207415", "0.6007684", "0.6006193", "0.6005104", "0.6005104", "0.5923302", "0.589989", "0.5898155", "0.5886066", "0.5869257", "0.5836935", "0.5835317", "0.5825765", "0.5771907",...
0.72943974
0
PUT /plantypes/1 PUT /plantypes/1.json
def update @plantype = Plantype.find(params[:id]) respond_to do |format| if @plantype.update_attributes(params[:plantype]) format.html { redirect_to @plantype, notice: 'Plantype was successfully updated.' } format.json { head :no_content } else format.html { render action: "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @tipo_plan.update(tipo_plan_params)\n format.html { redirect_to @tipo_plan, notice: 'Tipo plan was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_plan }\n else\n format.html { render :edit }\n for...
[ "0.653304", "0.6365857", "0.6267198", "0.62602186", "0.62459475", "0.6202544", "0.6202544", "0.61930364", "0.61930364", "0.61930364", "0.61930364", "0.61930364", "0.61881655", "0.61837155", "0.60982263", "0.6010647", "0.59924895", "0.59627175", "0.5955553", "0.5951102", "0.59...
0.7356503
0
DELETE /plantypes/1 DELETE /plantypes/1.json
def destroy @plantype = Plantype.find(params[:id]) @plantype.destroy respond_to do |format| format.html { redirect_to plantypes_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @plan.destroy\n respond_to do |format|\n format.html { redirect_to plans_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @plan.destroy\n respond_to do |format|\n format.html { redirect_to plans_url }\n format.json { head :no_content }\n e...
[ "0.70994043", "0.70994043", "0.70385826", "0.70385826", "0.70385826", "0.69478935", "0.6918568", "0.68923616", "0.68917394", "0.68809193", "0.685441", "0.68521744", "0.68274593", "0.68195105", "0.68046165", "0.68046165", "0.68046165", "0.68046165", "0.68046165", "0.68046165", ...
0.7972531
0
Initializes the core, but does not bootstrap it.
def initialize # Define instance variables @log = nil @config = nil @robot = nil @socket = nil # Initialize those that should be done now. parse_arguments() setup_logger() # Call the block if necessary. yield(self) if block_given? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bootstrap_init\n end", "def initialize(*args, &block)\n self.__init_core(block, *args)\n end", "def initialize!\n load_passenger\n initialize_ush_api\n initialize_debugging\n undo_bundler\n end", "def bootstrap!\n reset!\n require_relative 'kernel'\n end...
[ "0.7097784", "0.6618115", "0.6612791", "0.6554115", "0.6501738", "0.64016485", "0.63797", "0.63797", "0.63797", "0.63034135", "0.628286", "0.62816787", "0.6265653", "0.6258234", "0.6258234", "0.6258234", "0.6258234", "0.6242305", "0.6233969", "0.62142015", "0.6209959", "0.6...
0.0
-1
Bootstrap the script, getting it all up and running.
def bootstrap establish_connection() load_robot() yield(self) if block_given? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bootstrap!\n @bootstrapped = false\n bootstrap\n end", "def bootstrap_init\n end", "def bootstrap!\n reset!\n require_relative 'kernel'\n end", "def bootup\n Merb.trap(\"TERM\") { shutdown }\n\n Merb.logger.warn! \"Running bootloaders...\" if Merb::Confi...
[ "0.748416", "0.7441998", "0.69170666", "0.6909562", "0.6799857", "0.67365634", "0.67215735", "0.6678331", "0.65941083", "0.6587204", "0.6566199", "0.6548999", "0.6500137", "0.64719236", "0.64584416", "0.644825", "0.6276875", "0.6257646", "0.622772", "0.6222462", "0.6177322", ...
0.58273137
33
Start the primary event loop
def run @socket.write_object({:foo => Time.now}) sleep(2) LOG.info "[EXIT]" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start\n main_loop\n end", "def initiate_event_loop!\n @active = true\n\n @thread = Thread.new do\n while @active\n @session_mutex.synchronize do\n @session.process(@loop_wait)\n end\n Thread.pass\n end\n end\n end", "def initiate...
[ "0.79699636", "0.7594737", "0.755645", "0.755645", "0.7230091", "0.7221877", "0.7150945", "0.7137103", "0.70791864", "0.7031621", "0.6962473", "0.6897413", "0.6872361", "0.68591917", "0.68242085", "0.6813085", "0.67843103", "0.6781627", "0.672159", "0.6714863", "0.670168", ...
0.0
-1
Establishes a connection with the server and stores it where it can be accessed.
def establish_connection LOG.debug self.inspect LOG.debug "establish_connection:" LOG.debug([@config['CONNECTION_HOST'], @config['CONNECTION_PORT']].inspect) @socket = TCPSocket.new(@config['CONNECTION_HOST'], @config['CONNECTION_PORT']) # The port should be an arg. handshake_data_hash = {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect\n @connection.create\n end", "def connect\n @connection.open\n end", "def connect_using conn\n @connection = conn\n end", "def connection\n @connection = create_connection! unless connected?\n @connection\n end", "def connect\n @connecti...
[ "0.7235263", "0.70036846", "0.6994638", "0.6907533", "0.68393415", "0.67632514", "0.6753088", "0.67093706", "0.6702807", "0.66579705", "0.6611322", "0.6611322", "0.64803255", "0.6434773", "0.6429279", "0.6391311", "0.63875735", "0.6382483", "0.63632894", "0.6360342", "0.63291...
0.65546805
12
num The Integer to be checked. Examples is_odd(1337) => true is_odd(420) => false Returns if the number is odd or not.
def is_odd(num) return num % 2 == 1 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_odd(num)\n return ((num % 2) != 0)\nend", "def is_odd?(num)\n num.abs.to_i % 2 != 0 && num.to_i == num\nend", "def is_odd(num)\n if num % 2 == 0\n return false\n else\n return true\n end\nend", "def is_odd(num)\n return true if num % 2 != 0\n return false\nend", "def...
[ "0.80405414", "0.789355", "0.78931224", "0.7890589", "0.78826624", "0.78635436", "0.78612596", "0.78533417", "0.7830883", "0.77971596", "0.77971596", "0.7794067", "0.7794067", "0.7794067", "0.7794067", "0.7794067", "0.77934444", "0.77731603", "0.77723444", "0.77699554", "0.77...
0.79078776
1
Whether any implicit routing parameters are present.
def routing_params? routing_params.any? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def routing_params?\n routing_params.any?\n end", "def any_empty_routing?\n self.empty?(self, \"routings\", false)\n end", "def needed_params_present?(*ar_params)\n ar_params.flatten.all? { |e| params[e].present? }\n end", "def params?\n !(params.input_filters.required_inputs...
[ "0.83231044", "0.7053154", "0.7045139", "0.6813631", "0.67478627", "0.665093", "0.66410327", "0.658831", "0.6584498", "0.6569803", "0.64620733", "0.64588356", "0.6455912", "0.6441002", "0.6441002", "0.6438757", "0.63905203", "0.6388502", "0.63435715", "0.6338592", "0.63203645...
0.84076625
0
The implicit routing parameter names.
def routing_params routing_params_with_patterns.map { |param, _| param } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def routing_params\n routing_params_with_patterns.map { |param, _| param }\n end", "def param_names\n\t\treturn self.constraints.keys.map( &:to_s ).sort\n\tend", "def pnames\n @params.keys\n end", "def routing_params_with_patterns\n bindings.first&.routing_params_with...
[ "0.7574711", "0.71766347", "0.69187015", "0.67899436", "0.67747897", "0.67160463", "0.6659441", "0.6569839", "0.6567332", "0.6413499", "0.6294449", "0.62378097", "0.61766326", "0.6167571", "0.6132692", "0.612767", "0.60931385", "0.60600054", "0.60516065", "0.60426927", "0.601...
0.7595882
0
The implicit routing parameter names and their corresponding paterns, including the `` pattern implied for the named segments without an explicitly specified pattern.
def routing_params_with_patterns bindings.first&.routing_params_with_patterns || [] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def routing_params\n routing_params_with_patterns.map { |param, _| param }\n end", "def routing_params\n routing_params_with_patterns.map { |param, _| param }\n end", "def routing_params_with_patterns\n @routing_params_with_patterns ||= begin\n Gapic:...
[ "0.7281575", "0.727771", "0.70641154", "0.6570279", "0.6129925", "0.60801584", "0.6064101", "0.58562493", "0.57965285", "0.5748055", "0.57406646", "0.56026673", "0.55988514", "0.5569285", "0.55180687", "0.55105835", "0.5503975", "0.54892963", "0.5471826", "0.54603994", "0.545...
0.6881244
3
Whether a http verb is present for this method
def verb? !verb.nil? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def http_verb(params)\n [:post, :put, :delete].detect { |method_name|\n params.key?(method_name)\n } || :get\n end", "def get?\r\nHTTP_METHOD_LOOKUP[request_method] == :get\r\nend", "def http_method_modifies_resource?\n ['PUT','POST','PATCH'].include?(method.to_s.upcase)\n ...
[ "0.75833637", "0.7302763", "0.7274144", "0.7266581", "0.72588897", "0.71536034", "0.7059609", "0.70344836", "0.6997092", "0.69853175", "0.6919115", "0.69138604", "0.6880489", "0.6867206", "0.6844059", "0.67908275", "0.6741622", "0.6705465", "0.66818553", "0.6664769", "0.66581...
0.7069828
6
The http verb for this method
def verb verb_path[0] if verb_path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def http_verb(params)\n [:post, :put, :delete].detect { |method_name|\n params.key?(method_name)\n } || :get\n end", "def http_method\n METHODS[self[:method]]\n end", "def verb\n [\"get\", \"post\"].include?(raw_verb) ? raw_verb : \"post\"\n end", "de...
[ "0.80255795", "0.79532343", "0.78840005", "0.7776328", "0.7662945", "0.75481087", "0.7524558", "0.7515918", "0.74777883", "0.7475457", "0.7410626", "0.7332165", "0.73101026", "0.725867", "0.725867", "0.7236206", "0.7234881", "0.7213815", "0.7209806", "0.71801263", "0.71648645...
0.6510562
52
Whether a method path is present and nonempty
def path? !path.empty? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path?(instance, *method_names)\n !path(instance, *method_names, try: true).nil?\n end", "def empty_path?\n path.empty?\n end", "def method_defined?(p0) end", "def path?\n !!@path\n end", "def path?\n !!@path\n end", "def method_defined?(arg0)\n end", "def empty?\n @path....
[ "0.77671576", "0.73855793", "0.7317064", "0.72605807", "0.72605807", "0.7134597", "0.7093714", "0.7042063", "0.6983502", "0.69811785", "0.69445735", "0.6943291", "0.6930798", "0.6921401", "0.6921401", "0.67961603", "0.67514455", "0.672343", "0.6667143", "0.66473997", "0.66473...
0.73544484
2
A method path or an empty string if not present
def path return "" unless verb_path verb_path[1] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path(*) end", "def path_method\n View.configuration.path_methods.find { |method| value.respond_to?(method) }\n end", "def path\n raise NotImplementedError.new 'This is only a function body for documentation'\n end", "def method_missing(method, *args)\n if method =~ /current_(.*)/\n ...
[ "0.7038314", "0.6997883", "0.6642527", "0.65929085", "0.65901417", "0.65901417", "0.65901417", "0.6568149", "0.6568149", "0.6568149", "0.6466278", "0.64591265", "0.64591265", "0.64591265", "0.64591265", "0.64591265", "0.64591265", "0.64591265", "0.64591265", "0.64591265", "0....
0.62522024
50
Whether any routing params are present
def routing_params? routing_params.any? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def routing_params?\n routing_params.any?\n end", "def any_empty_routing?\n self.empty?(self, \"routings\", false)\n end", "def empty_params?\n params.reject{ |k,_| k.to_sym.eql?(:controller) || k.to_sym.eql?(:action)}.empty?\n end", "def needed_params_present?(*ar_params)\n ar...
[ "0.9036004", "0.78571784", "0.7443052", "0.73993784", "0.7308938", "0.7207467", "0.7188683", "0.7082895", "0.7079854", "0.7043448", "0.70013463", "0.69812226", "0.69679415", "0.6952818", "0.6947983", "0.6936893", "0.6924909", "0.69121695", "0.6910259", "0.69085646", "0.687173...
0.89729047
1
The segment key names and their corresponding paterns, including the `` pattern implied for the named segments without pattern explicitly specified.
def routing_params_with_patterns @routing_params_with_patterns ||= begin Gapic::UriTemplate.parse_arguments(path).map do |name, pattern| [name, pattern.empty? ? "*" : pattern] end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def key_segments\n if !@key_segments.present?\n @key_segments ||= path.split('/').map do |s|\n s if s[0] == ':'\n end.compact\n else\n @key_segments\n end\n end", "def join_keys *segments\n segments.map(&:to_s).select(&:present?).join(\".\")\n end", "def keys_for(key = EMPTY...
[ "0.7284555", "0.6571546", "0.6342488", "0.6342488", "0.62488645", "0.6219218", "0.6181029", "0.60866725", "0.60758483", "0.5919383", "0.5876046", "0.5783368", "0.57100004", "0.56995183", "0.5687657", "0.56691116", "0.5622425", "0.56072176", "0.5570841", "0.5570313", "0.555090...
0.0
-1
The segment key names.
def routing_params routing_params_with_patterns.map { |param, _| param } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def key_segments\n if !@key_segments.present?\n @key_segments ||= path.split('/').map do |s|\n s if s[0] == ':'\n end.compact\n else\n @key_segments\n end\n end", "def key_name_groups\n KEY_NAME_GROUPS.map { |kn| const_get kn }\n end", "def keys\n [ name...
[ "0.72355264", "0.69796073", "0.6958803", "0.69474083", "0.6828452", "0.68261296", "0.6821403", "0.67669874", "0.6744342", "0.67078567", "0.67078567", "0.6695498", "0.66832167", "0.66295815", "0.66270834", "0.6599913", "0.6597511", "0.655746", "0.6554782", "0.6551004", "0.6551...
0.0
-1
Whether method has body specified in proto
def body? !body.empty? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def must_have_body?\n Methods[@method].must_have_body\n end", "def can_have_body?\n Methods[@method].can_have_body\n end", "def body?\n HTTY::Request::METHODS_SENDING_BODY.include? method\n end", "def has_body?\n @body\n end", "def primitive?\n Proc === @body\n end",...
[ "0.8494073", "0.8162826", "0.7619376", "0.7083252", "0.6893048", "0.6673466", "0.6646341", "0.64431536", "0.6419952", "0.6366655", "0.6366655", "0.62133265", "0.60953814", "0.6062233", "0.60407364", "0.60046285", "0.5972472", "0.5964209", "0.59629387", "0.59616256", "0.595628...
0.6825445
5
The body specified for the given method in proto or an empty string if not specified
def body @binding&.body || "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def body\n \"\"\n end", "def body\n \"\"\n end", "def body\n return \"\"\n end", "def body\n ''\n end", "def body\n @body || \"\"\n end", "def body(opts)\n \"\"\n end", "def method_signature\n @parameters.map { |info| info.name == 'body' ? \"body = {}\" : in...
[ "0.6942175", "0.6942175", "0.6822956", "0.67821544", "0.6748257", "0.6699106", "0.6663681", "0.6433867", "0.640234", "0.6397439", "0.6339297", "0.63340133", "0.6315244", "0.6315244", "0.6315244", "0.6315244", "0.6315244", "0.6315244", "0.6315244", "0.6315244", "0.6315244", ...
0.6094909
41
The combination of verb and path found in the http annotation (or Nil if the annotation is Nil).
def verb_path return nil if @binding.nil? { get: @binding.get, post: @binding.post, put: @binding.put, patch: @binding.patch, delete: @binding.delete }.find { |_, value| !value.empty? } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verb\n verb_path[0] if verb_path\n end", "def path\n return \"\" unless verb_path\n verb_path[1]\n end", "def http_verb(params)\n [:post, :put, :delete].detect { |method_name|\n params.key?(method_name)\n } || :get\n end", "de...
[ "0.6577424", "0.6499301", "0.623567", "0.6180076", "0.6031656", "0.5985674", "0.59509826", "0.57627314", "0.57200414", "0.5716211", "0.5658844", "0.5613053", "0.56106544", "0.5559649", "0.54733944", "0.5463653", "0.5426245", "0.54144764", "0.54109657", "0.538546", "0.5332751"...
0.71730083
0
Parses http bindings from the `google.api.http` annotation, preserving order.
def parse_bindings http return [] if http.nil? raw_binds = [http] + http.additional_bindings.to_a raw_binds.map { |raw_bind| HttpBinding.new raw_bind } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_http http_yaml\n http = Google::Api::Http.new\n\n if http_yaml.key? HTTP_RULES_KEY\n http.rules = http_yaml[HTTP_RULES_KEY].map { |rule_yaml| parse_http_rule rule_yaml }\n end\n\n http\n end", "def test_parse_service_yaml_with_api_http\n api1_nam...
[ "0.6452378", "0.5641028", "0.54395413", "0.53634304", "0.5129205", "0.5035941", "0.49165583", "0.490854", "0.48728323", "0.48259574", "0.48155776", "0.47556785", "0.47093236", "0.4592393", "0.4588781", "0.45869166", "0.4556621", "0.4556621", "0.45552963", "0.45306045", "0.450...
0.7609485
0
TODO: this probably could be streamlined a lot
def prefix (prefix, message) yield(prefix, message) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def probers; end", "def schubert; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def offences_by; end", "def formation; end", "def stderrs; end", "def anchored; end", "def identify; end", "def transformations; end", "def suivre; end"...
[ "0.6744652", "0.6207223", "0.5855672", "0.57615083", "0.57615083", "0.57615083", "0.57615083", "0.57443476", "0.57137054", "0.5669704", "0.5613342", "0.5526132", "0.5497977", "0.548586", "0.5461115", "0.54536337", "0.54536337", "0.54190296", "0.54190296", "0.54190296", "0.541...
0.0
-1
______ VERIFICATION DES DROITS _______________
def has_revendeur if(self.entite.droit.has_revendeur == 1) return true else return false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verdi; end", "def details; end", "def info; end", "def info; end", "def informational?; end", "def summary; end", "def summary; end", "def summary; end", "def summary; end", "def verifiable_info\n {}\n end", "def verifiable_info\n {}\n end", "def info()\n #This is a stu...
[ "0.7134763", "0.68114465", "0.6714089", "0.6714089", "0.65391624", "0.648344", "0.648344", "0.648344", "0.648344", "0.6443403", "0.6443403", "0.6437057", "0.64006996", "0.636764", "0.63674337", "0.6318077", "0.6309993", "0.6305617", "0.6305617", "0.62852097", "0.6282491", "...
0.0
-1
____________ RECUPERATION PRODUIT EN VENTE ________
def produit_en_vente my_product_online = ProduitVenteLibre.where('user_id = ? AND deleted = 0', self.id) return my_product_online.count end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Com6 # Recuperation Info\n \n end", "def suivre; end", "def mi_carrera\n\n\tend", "def rescatar\n self.estado_id = 1 #salida si lo creo, entrada/foliado si lo redirijo\n self.estado_id = 3 if self.trazas.count(:conditions => 'movimiento_id in (2,7,8)') > 0\n if self.origen.externo\n RAI...
[ "0.6601553", "0.65744996", "0.6187532", "0.6170465", "0.61410266", "0.61410266", "0.6113256", "0.60286474", "0.60106546", "0.5965245", "0.5965245", "0.5897317", "0.58873147", "0.58729345", "0.5745268", "0.568583", "0.56853914", "0.56764615", "0.56762546", "0.5628399", "0.5600...
0.0
-1
___________ RECUPERATION PANIER EN VENTE ______
def panier_en_vente @paniers_ = Panier.where('revendeur_id = ? AND deleted = 0', self.id) @paniers= [] @paniers_.each do |panier| if panier.has_declinaison @paniers << panier end end return @paniers.count end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def suivre; end", "def Com6 # Recuperation Info\n \n end", "def mi_carrera\n\n\tend", "def verdi; end", "def relatorios\n end", "def recuperationEtape()\n\t\tstring=@techniqueObjet.etape(@etapeEnCours)\n\t\t@texteContenu.set_text(string)\n\tend", "def recuperationEtape()\n\t\tstring=@techniqueObje...
[ "0.66511375", "0.6314501", "0.61893475", "0.6116405", "0.6089723", "0.6073965", "0.6073965", "0.6048281", "0.6025585", "0.59745693", "0.59672725", "0.5954812", "0.5909865", "0.5841671", "0.5840754", "0.5840754", "0.57919973", "0.5759282", "0.5712602", "0.56629384", "0.5659052...
0.0
-1
_____ IMAGE USER ________________________________
def default_image @default_photo = PhotoUser.where('user_id = ? AND first_image = 1 AND image IS NOT NULL',self.id) if @default_photo.count > 0 @mydefault_photo = PhotoUser.find(@default_photo[0].id) return @mydefault_photo else return nil end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_icon()\n photo_name_column(get_person, 65)\n end", "def user_img_URL\n self.user.image_url\n end", "def get_image_name(user_hash)\n image_name = user_hash[\"image\"][:filename]\nend", "def get_author\n @image.user = current_user\n end", "def profile_photo\n\tend", "def get_user_imag...
[ "0.7167784", "0.7166301", "0.7018062", "0.6988343", "0.6951319", "0.69357437", "0.69130677", "0.69085073", "0.68859094", "0.68131673", "0.68131673", "0.67592853", "0.672007", "0.672007", "0.66629046", "0.66413826", "0.6635202", "0.66282666", "0.66253436", "0.65739095", "0.655...
0.0
-1
To display output immediately on windows using git bash
def crunch(string) string.gsub(/(.)\1+/, '\1') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prompt_git_branch\n if !is_git?\n return \"\"\n end\n stat = `git status`\n \"[#{stat.split(\"\\n\")[0].split(\" \")[-1]}]\".yellow\nend", "def stdout; end", "def stdout; end", "def stdout; end", "def stdout; end", "def stdout; end", "def stdout; end", "def prep_screen\n system(\"clear\...
[ "0.6219506", "0.61200327", "0.61200327", "0.61200327", "0.61200327", "0.61200327", "0.61200327", "0.6103044", "0.60350794", "0.59949106", "0.5973232", "0.59097284", "0.58951396", "0.5886012", "0.586864", "0.58550465", "0.582788", "0.5807792", "0.5802978", "0.5773198", "0.5745...
0.0
-1
para la ingresar en la tabla intermedia de muchos a muchos define una propiedad que se puede leer y escribir la llamaremos :category_elements
def save_categories #metodo para registrar en la tabla intermedia muchos a muchos return category_articles.destroy_all if category_elements.nil? || category_elements.empty? category_articles.where.not(category_id: category_elements).destroy_all #si no viene como arreglo----...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def element_subcategory; end", "def has_many_display(all_low_model_elements, model, hash_name, model_id)\n all_low_model_elements_array = []\n all_low_model_elements.each do |each_element|\n each_element = {hash_name.to_sym =>\n {convert_to_sym(\"#{hash_name}_details\"...
[ "0.5335318", "0.51427984", "0.50636464", "0.5001822", "0.4998096", "0.49935436", "0.4988619", "0.4980154", "0.49641484", "0.49400413", "0.4936014", "0.49344784", "0.49252173", "0.48824444", "0.4870173", "0.48532712", "0.48389488", "0.4815928", "0.48153076", "0.48122236", "0.4...
0.6228603
0
def assign_hora_entrega self.hora_entrega = Time.now end
def assign_secure_token self.secure_token = SecureRandom.hex end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_fecha\n self.fecha ||= self.fechahora_atencion if self.fechahora_atencion\n end", "def inizio_giorno\n Time.new(self.year, self.month, self.day)\n end", "def inizio_ora\n Time.new(self.year, self.month, self.day, self.hour)\n end", "def hora_geracao\n Time.current.strftime('%H%...
[ "0.7263866", "0.6965258", "0.68442285", "0.6800099", "0.6800099", "0.66669124", "0.6644802", "0.66325504", "0.6598424", "0.6576433", "0.65302515", "0.65155363", "0.64979327", "0.6481615", "0.64141273", "0.63075936", "0.6305939", "0.62852967", "0.6196106", "0.6191236", "0.6180...
0.0
-1
Initialize the application and set some logging defaults
def initialize(*) super the_shell = (options['no-color'] ? Thor::Shell::Basic.new : shell) @ui = Shell.new(the_shell) @ui.be_quiet! if options['quiet'] @ui.debug! if options['verbose'] debug_header end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_logging\n app_name = ENV[\"APP_NAME\"] || \"calcentral\"\n format = PatternFormatter.new(:pattern => \"[%d] [%l] [CalCentral] %m\")\n\n Rails.logger = Log4r::Logger.new(app_name)\n Rails.logger.level = DEBUG\n Rails.logger.outputters = init_file_loggers(app_name, format)\n\n stdout = Out...
[ "0.74752337", "0.7388764", "0.7317632", "0.72551984", "0.71894044", "0.71397793", "0.71367204", "0.7132672", "0.71126276", "0.69584835", "0.6956969", "0.69353193", "0.6909694", "0.68957067", "0.68759716", "0.68327636", "0.6810044", "0.6788811", "0.6754438", "0.67531633", "0.6...
0.0
-1
Fetch a single secret specified on the commandline
def get(scrt_id) run_action { get! scrt_id } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def secret\n client.get(\"/user/secret\").fetch(\"result\")\n end", "def secret\n @secret ||= begin\n secret = load_secret\n unless secret\n ui.fatal('A secret or secret_file must be specified')\n show_usage\n exit 1\n end\n...
[ "0.7129952", "0.70592237", "0.7017834", "0.69379455", "0.67783123", "0.6758071", "0.67471987", "0.6602777", "0.6594466", "0.65917456", "0.64539146", "0.6451078", "0.64405864", "0.6417522", "0.63721716", "0.6349334", "0.6349334", "0.6251551", "0.61281705", "0.6124436", "0.6090...
0.0
-1
Run the specified action and rescue errors we explicitly send back to format them
def run_action(&_block) yield rescue ::Zanzibar::Error => e @ui.error e abort "Fatal error: #{e.message}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_action(action, params)\n send(action, params)\n \n rescue RenderExit, ActionExit => e1\n # Just stop rendering. \n \n rescue ActionError => e2\n # Client Error family of errors, typically send 4XX\n # status code.\n handle_error(e2, 404)\n error e2.to_s\n \n rescue ...
[ "0.70283866", "0.7003629", "0.68131447", "0.68131447", "0.68131447", "0.68131447", "0.67721075", "0.64510566", "0.6357651", "0.6331432", "0.62867564", "0.62455493", "0.6214181", "0.62081003", "0.61880136", "0.6111092", "0.60949343", "0.6089952", "0.6068404", "0.60583216", "0....
0.6701129
7
Switch user context for signed in user
def switch_current_user_organization( organization ) raise ArgumentError.new(format('wrong type. \'organization\' must be an String, given \'%s\'', organization.class.to_s)) unless( organization.is_a?(String) ) raise ArgumentError.new('missing \'organization\'') if( organization.size.zero? ) org = o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simple_sign_in(user)\n\t\tself.current_user = user\n\tend", "def sign_in (user)\n current_user = user\n end", "def context; { user: current_user } end", "def logged_in_user\n if user_signed_in? then\n \n else\n redirect_to root_path\n end \n \n end", "def swit...
[ "0.71860975", "0.71648294", "0.71354735", "0.6875414", "0.6845422", "0.68272215", "0.681955", "0.6813475", "0.6796018", "0.6779868", "0.67693055", "0.6747518", "0.67328167", "0.6721889", "0.6714388", "0.66534454", "0.66522366", "0.6637721", "0.66243404", "0.66241854", "0.6616...
0.0
-1
Organisations of the actual User
def current_user_oganizations endpoint = '/api/user/orgs' @logger.debug("Getting current user organizations (GET #{endpoint})") if @debug get(endpoint) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_organizations\r\n Organization.organizations_by_user(self)\r\n end", "def orgs\n client.organizations\n end", "def organisers\n org = []\n organiser_ids = self.listings.map {|listing| listing.organiser_id}\n User.all.select do |user|\n if organiser_ids.any?(...
[ "0.74862057", "0.7191986", "0.7150066", "0.7084306", "0.7022553", "0.7004468", "0.69923824", "0.6948108", "0.69381547", "0.6870176", "0.6830689", "0.6786934", "0.67185366", "0.66905594", "0.66180474", "0.65657544", "0.652037", "0.65104777", "0.6438416", "0.6407909", "0.640678...
0.6924791
9
GET /tools GET /tools.json
def index @tools = Tool.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @tools = Tool.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tools }\n end\n end", "def show\n @tool = Tool.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tool }\...
[ "0.7383548", "0.6811416", "0.6811416", "0.67649484", "0.67572916", "0.656256", "0.65350896", "0.6503073", "0.64969736", "0.6345333", "0.6335218", "0.6295492", "0.62290937", "0.6200651", "0.61389726", "0.6137426", "0.61147624", "0.61056083", "0.6074838", "0.59707355", "0.59628...
0.66524005
7
GET /tools/1 GET /tools/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @tools = Tool.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tools }\n end\n end", "def show\n @tool = Tool.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tool }\...
[ "0.72756517", "0.71223795", "0.71223795", "0.6834692", "0.67236257", "0.67236257", "0.67236257", "0.67236257", "0.66627616", "0.66523856", "0.6645168", "0.6619844", "0.65490687", "0.64565176", "0.64206004", "0.63911355", "0.6385339", "0.6322592", "0.6258994", "0.6178192", "0....
0.0
-1
POST /tools POST /tools.json
def create @tool = Tool.new(tool_params) respond_to do |format| if @tool.save format.html { redirect_to @tool, notice: 'Tool was successfully created.' } format.json { render :show, status: :created, location: @tool } else format.html { render :new } format.json { re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @tool = Tool.new(tool_params)\n if @tool.save\n render json: @tool, status: :created\n end\n end", "def tool_params\n params.require(:tool).permit(:name, :language, :json_spec)\n end", "def create\n @tool = Tool.new(params[:tool])\n\n respond_to do |for...
[ "0.68321866", "0.6619857", "0.6526994", "0.6496243", "0.6392198", "0.63159597", "0.62912834", "0.62893647", "0.62255645", "0.6137279", "0.61219615", "0.61205626", "0.607529", "0.603287", "0.58701736", "0.5859166", "0.5825459", "0.57570094", "0.57040054", "0.56979054", "0.5659...
0.6519476
3
PATCH/PUT /tools/1 PATCH/PUT /tools/1.json
def update respond_to do |format| if @tool.update(tool_params) format.html { redirect_to @tool, notice: 'Tool was successfully updated.' } format.json { render :show, status: :ok, location: @tool } else format.html { render :edit } format.json { render json: @tool.errors,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @tool = Tool.find(params[:id])\n\n respond_to do |format|\n if @tool.update_attributes(params[:tool])\n format.html { redirect_to @tool, notice: 'Tool was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n...
[ "0.67133415", "0.65646404", "0.63968515", "0.6318347", "0.62360615", "0.6217166", "0.6028406", "0.60213095", "0.598312", "0.5935947", "0.59353626", "0.59353626", "0.59353626", "0.59353626", "0.59144145", "0.58895427", "0.58887035", "0.5883666", "0.5879926", "0.5852409", "0.57...
0.6419783
3
DELETE /tools/1 DELETE /tools/1.json
def destroy @tool.destroy respond_to do |format| format.html { redirect_to tools_url, notice: 'Tool was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @tool = Tool.find(params[:id])\n @tool.destroy\n\n respond_to do |format|\n format.html { redirect_to tools_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tool = Tool.find(params[:id])\n @job = Jobsite.find(@tool.jobsite_id)\n \n @job.tools...
[ "0.7144733", "0.7039913", "0.6961637", "0.68186086", "0.6736317", "0.66941506", "0.6686321", "0.66800654", "0.6678375", "0.6568023", "0.6566609", "0.6537114", "0.6531894", "0.65015507", "0.6496347", "0.64757234", "0.6419092", "0.6412645", "0.6392184", "0.63493603", "0.6337018...
0.69460154
4
Use callbacks to share common setup or constraints between actions.
def set_tool @tool = Tool.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def tool_params params.require(:tool).permit(:name, :description, :image, :serial, :barcode, :date_purchased, :capability, :reservable, :max_reservation_time, :category_ids=>[]) 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.69802505", "0.6781974", "0.67470175", "0.67430073", "0.67350477", "0.6593221", "0.6504263", "0.64988977", "0.6481794", "0.64800006", "0.64568025", "0.64411247", "0.6379476", "0.63765615", "0.6368045", "0.6320141", "0.6300363", "0.6300057", "0.62952244", "0.6294712", "0.629...
0.0
-1
def new? true end
def create? @user.expert end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new?\n true\n end", "def new?\n true\n end", "def new?\n true\n end", "def new?\n false\n end", "def new?\n raise NotImplementedError\n end", "def new?\n @new\n end", "def new?\n !!@new\n end", "def new?\n !!@new\n end", "def new?\n @ne...
[ "0.9086221", "0.9086221", "0.9086221", "0.88459086", "0.8651886", "0.864735", "0.86128354", "0.86128354", "0.8577255", "0.85633606", "0.8497214", "0.84276015", "0.84276015", "0.8371342", "0.82822907", "0.82822907", "0.82284117", "0.8168017", "0.8068788", "0.801131", "0.801131...
0.0
-1
GET /questions GET /questions.xml
def index @questions = Question.find(:all) respond_to do |format| format.html # index.rhtml format.json { render :text => @questions.to_json } format.xml { render :xml => @questions.to_xml } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def questions\n self.class.get(\"/2.2/questions\", @options)\n end", "def index\n @questions = Question.find(:all)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @questions }\n end\n end", "def index\n @questions = Question.all\n\n respond_t...
[ "0.7794564", "0.73259246", "0.731576", "0.731576", "0.72694147", "0.7214117", "0.7088722", "0.7088722", "0.7073693", "0.7052707", "0.6934596", "0.6934596", "0.69045067", "0.68818015", "0.68818015", "0.68818015", "0.68818015", "0.68818015", "0.68818015", "0.68818015", "0.68689...
0.6905637
12
GET /questions/1 GET /questions/1.xml
def show @question = Question.find(params[:id]) check_forged_path respond_to do |format| format.html # show.rhtml format.json { render :json => @question.to_json } format.xml { render :xml => @question.to_xml(:methods => [:purpose]) } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def questions\n self.class.get(\"/2.2/questions\", @options)\n end", "def show\n @question = Question.find(params[:id])\n\n respond_to do |format|\n format.html\n format.xml {render :xml => @question}\n end\n end", "def show\n @question = Question.find(params[:id])\n\n respond_to ...
[ "0.72167146", "0.7153202", "0.7153202", "0.71331936", "0.71194386", "0.7106134", "0.7106134", "0.709688", "0.7020762", "0.68922824", "0.68922824", "0.68922824", "0.68922824", "0.68922824", "0.68922824", "0.68922824", "0.6871651", "0.6871651", "0.6869192", "0.6869192", "0.6869...
0.66178304
24
POST /questions POST /questions.xml
def create purpose = params[:question].delete(:purpose) @question = Question.new(params[:question]) @question.caption ||= "" @question.page = @page respond_to do |format| if @question.save and @question.update_attribute(:type, params[:question][:type]) if purpose SpecialFiel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def question(data)\n xml = xml_root(\"questions\")\n\n arrayed(data).each do |name|\n xml.root << (XML::Node.new(\"question\") << name)\n end\n\n send_and_process('questions/add', 'questions/question', xml)\n end", "def create\n\t@question = Question.new(params[:question])\n\n\n\tre...
[ "0.6957117", "0.6446711", "0.6372275", "0.63671416", "0.63493896", "0.6318407", "0.6211082", "0.61878395", "0.6170729", "0.6107971", "0.6066939", "0.6058545", "0.60504824", "0.6031851", "0.60101575", "0.6006084", "0.5992974", "0.5992974", "0.5976867", "0.59752655", "0.5962701...
0.0
-1
PUT /questions/1 PUT /questions/1.xml
def update @question = Question.find(params[:id]) check_forged_path respond_to do |format| if @question.update_attributes(params[:question]) if params[:question].has_key?(:purpose) @question.purpose = params[:question][:purpose] end format.html { redirect_to question...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.json { render :json => 'Question updated OK' }\n format.xml { head :ok }\n else\n format.json { render :json => @question.errors }\n ...
[ "0.67647064", "0.66528136", "0.64766777", "0.63554084", "0.63483685", "0.6336809", "0.6309207", "0.6309207", "0.6309207", "0.6309207", "0.6309207", "0.6296827", "0.62933934", "0.62850326", "0.6229838", "0.6168152", "0.6076047", "0.6048553", "0.60477537", "0.6041378", "0.60412...
0.5579678
96
DELETE /questions/1 DELETE /questions/1.xml
def destroy @question = Question.find(params[:id]) check_forged_path @question.destroy respond_to do |format| format.html { redirect_to questions_url(@questionnaire, @page) } format.xml { head :ok } format.json { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @question = Question.find(params[:id])\n\n @question.destroy\n \n respond_to do |format|\n format.html { redirect_to(questions_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n\t@question = Question.find(params[:id])\n\t@question.destroy\n\n\trespond_to do |fo...
[ "0.7203762", "0.71784353", "0.71784353", "0.7176675", "0.7176675", "0.7176675", "0.7176675", "0.7176675", "0.7176675", "0.7176675", "0.713924", "0.7116354", "0.70965713", "0.7082134", "0.7031152", "0.694853", "0.6930825", "0.68844795", "0.6874459", "0.68160295", "0.67582023",...
0.6785743
20
Get worklogs from Tempo plugin
def workLogs(username=@username, dateFrom=nil, dateTo=nil, project=nil) q = {:username => username} q[:dateFrom] = DateTime.parse(dateFrom).to_date.iso8601 unless dateFrom.nil? q[:dateTo] = DateTime.parse(dateTo).to_date.iso8601 unless dateTo.nil? q[:projectKey] = project...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @work_logs = WorkLog.active\n end", "def get_log\n SimpleWorker.service.log(task_id)\n end", "def index\n @workout_loggings = WorkoutLogging.all\n end", "def read_logs\n @@logs\n end", "def read_logs_all()\n logs = Log.find(:all, :order => 'created_at asc')\n end", ...
[ "0.65960455", "0.6236865", "0.60215795", "0.57196313", "0.57015556", "0.5693053", "0.5629589", "0.56075305", "0.55874676", "0.5561599", "0.55531883", "0.5526467", "0.55068356", "0.5466137", "0.5431112", "0.5427378", "0.53831196", "0.5380304", "0.5368014", "0.5364889", "0.5362...
0.5959814
3
Submit a timesheet for approval.
def submitForApproval(period=nil, comment='', name=@username) if period.nil? then # First day of work week cur = currentApprovalStatus(nil, name) period = cur.access 'period.dateFrom' end verbose "Submitting timesheet for #{period}" post('times...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n # Get the draft_timesheet.\n draft_timesheet = DraftTimesheet.find(params[:draft_timesheet_id])\n # Build a submitted_timesheet.\n @submitted_timesheet = draft_timesheet.submit\n # Try to save the submitted_timesheet.\n respond_to do |format|\n if @submitted_timesheet.save\n ...
[ "0.6931621", "0.6562179", "0.6324103", "0.6298028", "0.6298028", "0.6293576", "0.6185386", "0.6150121", "0.61493105", "0.61357516", "0.613143", "0.6111275", "0.607573", "0.60432506", "0.599906", "0.5998307", "0.5964127", "0.5961958", "0.5952719", "0.59437203", "0.5939539", ...
0.7654596
0
Lookup IpRec containing ip. Exception is raised if not found.
def search(ip) ip_value = self.class.ip_to_int(ip) find_rec(ip_value) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cidr_lookup (ip)\n\t\tputs \"Lookup the CIDR name from the known CIDR list for the IP: #{ip}\" if @verbose\n\t\treturn nil if @known_cidr_blks==nil\n\t\tputs \"CIDR Lookup: #{ip} ...\" if @verbose\n\t\t@known_cidr_blks_desc_index.each do |line|\n\t\t\tfirst_octet_ip = ip.split('.').first.to_i\n\t\t\tfirst_octe...
[ "0.68244153", "0.66589266", "0.64237076", "0.6320384", "0.624898", "0.6239285", "0.6194495", "0.615286", "0.6134055", "0.6130584", "0.60852426", "0.60296327", "0.593637", "0.59181243", "0.5839375", "0.5749489", "0.5733077", "0.5722626", "0.57174516", "0.57073605", "0.56900185...
0.73373544
0
Binary search through sorted IP database. The search uses nonrecordaligned byte offsets into the file, but always scans forward for the next parsable record from a given offset. It keeps track of the
def find_rec(ip_value) lower, upper = 0, @db_size - 1 prev_rec = nil loop do ofst = lower + ((upper - lower) / 2) rec = next_rec_from_ofst(ofst) if rec == prev_rec # We have narrowed the search to where we're hitting # the same record each time. Can't get any narrower. # But...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all(ip)\n\t\tself.v4 = ip.length == 4 && self.ip_version == 4\n\t\tipnum = ip.unpack(\"N\")[0] + 0\n\t\tmid = self.count/2\n\t\tcol_length = columns * 4\n\t\tlow = 0\n\t\thigh = count\n\t\treturn self.record = bsearch(low, high, ipnum, self.base_addr, col_length)\n\tend", "def search(ip)\n ip_value = s...
[ "0.6371318", "0.6009012", "0.5734358", "0.5462963", "0.5446285", "0.5412746", "0.54000175", "0.53929466", "0.5368981", "0.5339287", "0.5331705", "0.5317406", "0.5299045", "0.52824235", "0.52766466", "0.5275543", "0.5251956", "0.5244654", "0.5239941", "0.5223484", "0.51991427"...
0.6662962
0
before_action :require_admin, only: [:destroy]
def index @activities = Activity @pens = Pen @new_maintenance = Maintenance.new @users = User @maintenances = Activity.find_by_sql("select x.id, x.user_id, x.pen_id, x.created_at, x.pen_maintenance_check, y.resolved from( select a.id, a.pen_id, a.created_at, a.user_id, a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n authorize @admin\n\n @admin.destroy\n respond_to do |format|\n format.html { redirect_to admins_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin.destroy\n\n head :no_content\n end", "def destroy\n restrict 'allow only admins' or begin\n...
[ "0.7502397", "0.7442663", "0.7399206", "0.7399206", "0.7286795", "0.72795576", "0.7265812", "0.72478664", "0.7232906", "0.71688616", "0.71688616", "0.71414936", "0.70932156", "0.70932156", "0.70932156", "0.70932156", "0.70842195", "0.707978", "0.70774853", "0.7076375", "0.704...
0.0
-1
Collapse the waveform, apply the processing to the data
def to_a res = data return [] unless data res = apply_selects(res, opts[:fast_selects] || []) res = strip_unused(res) unless opts[:includes].blank? res = enrich(res, opts[:includes]) res = strip_unenriched(res, opts[:includes]) end res = apply_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_with_window\r\n @processed_time_data = time_data.take(time_data_size).times self.window.values\r\n self.strategy.data = @processed_time_data\r\n @fft = self.strategy.calculate\r\n @data = @fft\r\n end", "def postprocess_sampled_data(data, desired_samples, drawing_area_w...
[ "0.5654875", "0.54758495", "0.5006701", "0.48229542", "0.4821526", "0.46971744", "0.46766552", "0.46680257", "0.4664573", "0.46589682", "0.4611205", "0.4600081", "0.45674616", "0.45576847", "0.45468265", "0.45409465", "0.4539846", "0.45341748", "0.4532534", "0.45257643", "0.4...
0.0
-1
Apply a list of selects to the list of activities
def apply_selects(activities, selects, grouped = false) return activities if selects.empty? # We use map+reject(blank) so that we can modify the activities in the # groups activities = activities.lazy.map do |act| if act['activities'] # recurse into activity groups ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_activity_multiple(menu)\n activities_selected = []\n TTY::Prompt.new.multi_select(\"Please select your actiities to book in:\", menu, cycle: true, marker: '>', echo: false, per_page: 5).each do |activity|\n \n # pushing a activity object to the activities_selected arr...
[ "0.6442994", "0.60215604", "0.5988974", "0.58915347", "0.5603983", "0.5514797", "0.5381529", "0.5367649", "0.53102094", "0.53046393", "0.5258408", "0.525116", "0.5146421", "0.51230043", "0.5085533", "0.50769484", "0.50742334", "0.5048962", "0.5036012", "0.5015167", "0.5012154...
0.7477379
0
Apply a list of maps to the list of activities
def apply_maps(activities, maps) return activities if maps.empty? activities.map do |act| if act['activities'] # Recurse into activity groups act['activities'] = apply_maps(act['activities'], maps) act else maps.reduce(act) { |acc, elem| elem.call(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wrap(activities)\n activities.map do |act|\n if act['activities']\n # Feed::ActivityGroup automatically converts activites in it\n Feed::ActivityGroup.new(opts[:feed], act)\n else\n Feed::Activity.new(opts[:feed], act)\n end\n end\n ...
[ "0.5656001", "0.5547555", "0.5328254", "0.532371", "0.52096", "0.51946247", "0.51366544", "0.51250106", "0.50508714", "0.504608", "0.50454324", "0.5016802", "0.49841857", "0.49783427", "0.4933669", "0.49009603", "0.48770657", "0.48519412", "0.48496842", "0.48218274", "0.48204...
0.8250302
0
Run it through the StreamRails::Enrich process
def enrich(activities, includes) enricher = StreamRails::Enrich.new(includes) if activities.first&.key?('activities') enricher.enrich_aggregated_activities(activities) else enricher.enrich_activities(activities) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run\n super\n require_enrichment\n end", "def stream!\n before_run\n\n #\n # figure out how we want to call streaming client\n #\n if @handlers[:search]\n method = :filter\n args = streamify_search_options(@handlers[:search].opts)\n else\n ...
[ "0.6624437", "0.63457614", "0.5928375", "0.5771367", "0.5753443", "0.57172763", "0.55510706", "0.55465037", "0.5460874", "0.5366433", "0.53426", "0.53348196", "0.5316116", "0.5290554", "0.5285991", "0.5283383", "0.5260979", "0.5253806", "0.52439165", "0.5237132", "0.52087283"...
0.549789
8
For performance, we drop older activities on groups where we only need one. These groups are identified by verb (comment, post, review, follow)
def strip_unused(activity_groups) activity_groups.each do |group| return activity_groups unless group['activities'] next unless STRIPPED_VERBS.include?(group['verb']) group['activities'] = [group['activities'].first] end activity_groups end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def before_destroy_group\n controller = PublicActivity.get_controller\n\n # Return if seeding or nothing changes\n return if !controller\n\n current_user = PublicActivity.get_controller.current_user\n\n self.create_activity :destroy, owner: current_user,organization_id: self.organization_id, params:...
[ "0.5517673", "0.53434825", "0.53163147", "0.5316249", "0.52869326", "0.5216957", "0.5164789", "0.51290196", "0.51228005", "0.5109612", "0.5089625", "0.5061488", "0.5012653", "0.50090146", "0.49797618", "0.49676567", "0.49643195", "0.4956944", "0.49215516", "0.49009544", "0.48...
0.70495456
0
Strips enrichment failures from the activities TODO: switch to using apply_maps
def strip_unenriched(activities, includes) activities.map do |act| if act['activities'] # Recurse into activity groups act['activities'] = strip_unenriched(act['activities'], includes) else includes.each do |key| # If it's an array (nested enrichment), g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strip_unused(activity_groups)\n activity_groups.each do |group|\n return activity_groups unless group['activities']\n next unless STRIPPED_VERBS.include?(group['verb'])\n group['activities'] = [group['activities'].first]\n end\n activity_groups\n end", "de...
[ "0.5598776", "0.5469256", "0.53143686", "0.5301837", "0.5102687", "0.5044776", "0.49852848", "0.49751726", "0.4971074", "0.49709132", "0.49709132", "0.49709132", "0.49598736", "0.49502075", "0.49274528", "0.4922312", "0.4909984", "0.4887382", "0.48568442", "0.4835167", "0.479...
0.54730546
1
Wrap activities in Feed::Activity and Feed::ActivityGroup instances
def wrap(activities) activities.map do |act| if act['activities'] # Feed::ActivityGroup automatically converts activites in it Feed::ActivityGroup.new(opts[:feed], act) else Feed::Activity.new(opts[:feed], act) end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def activities_for(filter: nil, type: _feed_type)\n Feed::ActivityList.new(self).filter(filter).with_type(type)\n end", "def add_activity\n # if !self.commentable.is_a?(Activity) # don't add comments to the activity feed that are comments on the items in the activity feed.\n content = I18n.t('muck.comm...
[ "0.64066625", "0.61400855", "0.60030764", "0.58423036", "0.58371955", "0.57615834", "0.5704721", "0.5673225", "0.5652701", "0.56504124", "0.5639911", "0.5639911", "0.5620147", "0.56006753", "0.55933064", "0.5582405", "0.5582069", "0.5534369", "0.55126905", "0.54709816", "0.54...
0.8651103
0
Use callbacks to share common setup or constraints between actions.
def set_employee @employee = Employee.employee_by_id(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Only allow a trusted parameter "white list" through.
def employee_params params.require(:employee).permit(:document_type,:document_number,:first_name,:other_name,:last_name,:second_surname,:birthdate,:birthplace,:address,:phones,:email,:contract,:admission_date,:retirement_date,:salary,:transport_aid,:integral_salary,:area_id,:position_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", ...
[ "0.7122899", "0.7054107", "0.69478", "0.6902101", "0.67359334", "0.67178756", "0.66889167", "0.6677724", "0.6661157", "0.6555896", "0.6527207", "0.64584696", "0.64517015", "0.6450208", "0.644749", "0.6435074", "0.6413329", "0.6413329", "0.6391818", "0.6380081", "0.6380081", ...
0.0
-1
def id_present_to_customer 34000 + id end
def calculate_totals subtotal_collector = 0 active_contracts.each do |active_contract| subtotal_collector += active_contract.subtotal end self.subtotal = subtotal_collector self.tax = subtotal * 0.09 self.total = subtotal + tax save end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def id_number; end", "def customer_id\n customer.id\n end", "def valid_id_number; end", "def id\n customer_id\n end", "def id\n '1234567890'\n end", "def local_id; end", "def generate_id \n end", "def minimum_id(...)\n end", "def get_customer_id\n return @customer_id\n end...
[ "0.7439759", "0.7299999", "0.71205014", "0.70917475", "0.70120734", "0.6985847", "0.6923788", "0.6901316", "0.6824923", "0.6807382", "0.67778", "0.67037565", "0.6689649", "0.6680687", "0.6680687", "0.66016203", "0.65766484", "0.6542171", "0.65369105", "0.6534844", "0.6532073"...
0.0
-1