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 |
|---|---|---|---|---|---|---|
Public: Provide the names for all the forked projects. Example: user.repositories => ['r/r', 's/s'] user.project_names => ['r', 's'] Returns an Array. | def project_names
repositories.map { |s| s.match(/[^\/]*$/)[0] }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def projects\n result = []\n load_attributes\n @attributes['projects'].each do |project|\n result << project['name']\n end\n puts \"Workspace projects #{result}\"\n result\n end",
"def projects\n if is_deploy_key\n [project]\n else\n user.projects\n end\... | [
"0.69884545",
"0.6530935",
"0.6469232",
"0.6429145",
"0.6419498",
"0.63382554",
"0.62469554",
"0.6094857",
"0.60867494",
"0.60793966",
"0.60176355",
"0.60164016",
"0.6010478",
"0.60102546",
"0.60057604",
"0.60046333",
"0.59883845",
"0.5981324",
"0.5974089",
"0.5969996",
"0.59... | 0.7543094 | 0 |
Public: Remove a repository (or array of repositories). repos a 'username/repository' String or Array of such strings. Returns the updated array of repositories. | def remove(repos)
@repositories.remove(repos)
repositories
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove(repos)\n @list.delete_if { |e| [repos].flatten.include? e }\n self\n end",
"def delete_all repos\n unless repos\n raise \"required repository name\"\n end\n repos = @login + '/' + repos unless repos.include? '/'\n list_files(repos).each { |obj|\n ... | [
"0.7086861",
"0.6516591",
"0.6000556",
"0.6000556",
"0.59906125",
"0.5761622",
"0.57583433",
"0.5753425",
"0.57049257",
"0.56219965",
"0.5522421",
"0.54726523",
"0.5439465",
"0.5344525",
"0.5328814",
"0.5325128",
"0.5306773",
"0.52647173",
"0.526317",
"0.5262752",
"0.5254818"... | 0.7984868 | 0 |
Internal: Generate an array of forked repositories for the user. | def setup_repositories(opts)
@repositories = RepositoryList.new(GithubAPI.forks(@username))
update(opts)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_forks(user, repo_name)\n @connection.get(\"/repos/#{user}/#{repo_name}/forks\").map do |repo_data|\n GitHubApi::Repo.new(self, repo_data)\n end\n end",
"def get_all_user_repos\n user = User.find_by(uuid: params[:uuid])\n\n client = Octokit::Client.new(:access_token => user.pass... | [
"0.715048",
"0.66685826",
"0.661189",
"0.65035194",
"0.6477523",
"0.63725597",
"0.63243777",
"0.63194954",
"0.6140671",
"0.6136527",
"0.60983175",
"0.60775685",
"0.60752374",
"0.6016021",
"0.60127",
"0.59781814",
"0.5941655",
"0.5916761",
"0.58796823",
"0.5875155",
"0.5868138... | 0.6094185 | 11 |
Internal: Get the user's contributions to the repository. Returns a Hash. | def get_contributions(repository)
Git.contributions GithubAPI.name(@username), repository
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def contributions_as_hash\n load_contributions unless @contributions\n @contributions\n end",
"def index\n user = User.find_by(id: params[:user_id])\n return respond_with contributions: [], status: :not_found if user.nil?\n contributions = user.contributions\n respond_with contributions:... | [
"0.73520195",
"0.6510876",
"0.59385073",
"0.58852726",
"0.5878677",
"0.5875991",
"0.56802106",
"0.56771165",
"0.5649876",
"0.56327266",
"0.5628075",
"0.5609531",
"0.55466425",
"0.5533599",
"0.55333036",
"0.5496592",
"0.544362",
"0.5423777",
"0.5413425",
"0.53603417",
"0.52926... | 0.66975206 | 1 |
Internal: Combine the user's explicit preferences with an array of forks. Returns an Array. | def update(opts)
opts.each_pair do |k,v|
@repositories.send(k.to_sym, v)
end
repositories
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forks(options = {})\n get_path(\n path_to_forks,\n options,\n get_parser(:collection, Tinybucket::Model::Repository)\n )\n end",
"def get_multi(*ks)\n handle_fork\n _get_multi ks\n end",
"def ssh_array\n [\"-o StrictHostKeyChecking=no\", \"-l '#{B... | [
"0.5750378",
"0.5265974",
"0.5097508",
"0.50212187",
"0.50120336",
"0.49988148",
"0.49217254",
"0.49125677",
"0.49058688",
"0.4854556",
"0.48325217",
"0.48300803",
"0.48288664",
"0.4776683",
"0.47761312",
"0.47495738",
"0.47356695",
"0.4719196",
"0.4717767",
"0.47078738",
"0.... | 0.0 | -1 |
GET /tipos_pagamentos GET /tipos_pagamentos.xml | def index
@tipos_pagamentos = TiposPagamento.find(:all, :order => "nome")
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @tipos_pagamentos }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @pagos = Pago.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pagos }\n end\n end",
"def index\n @pagos = Pago.find(:all)\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pag... | [
"0.7134947",
"0.70879877",
"0.68998677",
"0.67768586",
"0.6674883",
"0.6645809",
"0.6555656",
"0.6499905",
"0.64963466",
"0.6468144",
"0.6465218",
"0.63933975",
"0.6371969",
"0.63632095",
"0.6337913",
"0.63311654",
"0.63288486",
"0.63135546",
"0.630379",
"0.6300078",
"0.62943... | 0.7284531 | 0 |
GET /tipos_pagamentos/1 GET /tipos_pagamentos/1.xml | def show
@tipos_pagamento = TiposPagamento.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @tipos_pagamento }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @tipos_pagamentos = TiposPagamento.find(:all, :order => \"nome\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tipos_pagamentos }\n end\n end",
"def index\n @pagos = Pago.all\n\n respond_to do |format|\n format.html # index.h... | [
"0.7223434",
"0.7023754",
"0.69870776",
"0.67756826",
"0.66824377",
"0.6668193",
"0.65990514",
"0.65770465",
"0.65763205",
"0.6480204",
"0.6453977",
"0.6380664",
"0.6378697",
"0.6360417",
"0.6327856",
"0.6319287",
"0.6315206",
"0.6306645",
"0.6294207",
"0.6293869",
"0.6293213... | 0.70428634 | 1 |
GET /tipos_pagamentos/new GET /tipos_pagamentos/new.xml | def new
@tipos_pagamento = TiposPagamento.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @tipos_pagamento }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @tpago = Tpago.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tpago }\n end\n end",
"def new\n @tipo_pago = TipoPago.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_pago }\n... | [
"0.7508977",
"0.74458903",
"0.7296653",
"0.72867215",
"0.7277938",
"0.7258757",
"0.7229233",
"0.72123224",
"0.7196165",
"0.7189261",
"0.71683115",
"0.70490956",
"0.7026474",
"0.69940513",
"0.69871557",
"0.6976102",
"0.6961502",
"0.6942629",
"0.6902176",
"0.6896386",
"0.688767... | 0.7769102 | 0 |
POST /tipos_pagamentos POST /tipos_pagamentos.xml | def create
@tipos_pagamento = TiposPagamento.new(params[:tipos_pagamento])
respond_to do |format|
if @tipos_pagamento.save
flash[:notice] = 'TiposPagamento was successfully created.'
format.html { redirect_to(@tipos_pagamento) }
format.xml { render :xml => @tipos_pagamento, :status => :created, :location => @tipos_pagamento }
else
format.html { render :action => "new" }
format.xml { render :xml => @tipos_pagamento.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @tipo_pago = TipoPago.new(params[:tipo_pago])\n\n respond_to do |format|\n if @tipo_pago.save\n format.html { redirect_to(@tipo_pago, :notice => 'TipoPago was successfully created.') }\n format.xml { render :xml => @tipo_pago, :status => :created, :location => @tipo_pago }\n ... | [
"0.63677776",
"0.62511945",
"0.61904025",
"0.61703104",
"0.6035547",
"0.6004836",
"0.6000738",
"0.59914064",
"0.5982448",
"0.5926521",
"0.5921083",
"0.58981156",
"0.58840406",
"0.58784616",
"0.5859484",
"0.5809157",
"0.58088523",
"0.5805666",
"0.5792946",
"0.57845414",
"0.578... | 0.6883413 | 0 |
PUT /tipos_pagamentos/1 PUT /tipos_pagamentos/1.xml | def update
@tipos_pagamento = TiposPagamento.find(params[:id])
respond_to do |format|
if @tipos_pagamento.update_attributes(params[:tipos_pagamento])
flash[:notice] = 'TiposPagamento was successfully updated.'
format.html { redirect_to(@tipos_pagamento) }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @tipos_pagamento.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @tipo_pago = TipoPago.find(params[:id])\n\n respond_to do |format|\n if @tipo_pago.update_attributes(params[:tipo_pago])\n format.html { redirect_to(@tipo_pago, :notice => 'TipoPago was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { ren... | [
"0.6348832",
"0.62224597",
"0.6212502",
"0.5963131",
"0.5920181",
"0.5886512",
"0.58119",
"0.5777207",
"0.57417136",
"0.5730909",
"0.56978416",
"0.56561375",
"0.5641518",
"0.56386644",
"0.56036353",
"0.56005603",
"0.5599574",
"0.5597315",
"0.5578742",
"0.5578742",
"0.5576335"... | 0.6738425 | 0 |
DELETE /tipos_pagamentos/1 DELETE /tipos_pagamentos/1.xml | def destroy
@tipos_pagamento = TiposPagamento.find(params[:id])
@tipos_pagamento.destroy
respond_to do |format|
format.html { redirect_to(tipos_pagamentos_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @tipo_pago = TipoPago.find(params[:id])\n @tipo_pago.destroy\n\n respond_to do |format|\n format.html { redirect_to(tipo_pagos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @pago = Pago.find(params[:id])\n @pago.destroy\n \n respond_to do |format|... | [
"0.73212445",
"0.7213561",
"0.71562004",
"0.711909",
"0.7095023",
"0.70883274",
"0.7078407",
"0.7064215",
"0.7045",
"0.69791657",
"0.6914195",
"0.6879934",
"0.686848",
"0.6853895",
"0.68522644",
"0.6839798",
"0.68369895",
"0.68369895",
"0.68346685",
"0.6815959",
"0.68130696",... | 0.7579894 | 0 |
Cookbook Name:: l3swchefcookbook Recipe:: default Copyright (c) 2013, Internet Initiative Japan Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | def strfy(str)
return '"' + str + '"'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run\n\n # Grab all the config params from command line, knife.rb etc\n self.config = Chef::Config.merge!(config)\n\n # Check if we have a knife.rb\n puts \"Check location of knife.rb\"\n checkfiles(:config_file,\"The config file (knife.rb) should be stored in a .chef folder... | [
"0.6777737",
"0.6636581",
"0.648665",
"0.6459829",
"0.64066803",
"0.6332153",
"0.63298655",
"0.63006544",
"0.6283425",
"0.62758636",
"0.62190497",
"0.6189308",
"0.6132786",
"0.6122918",
"0.6114489",
"0.6096192",
"0.60673106",
"0.6054849",
"0.6054849",
"0.6053525",
"0.6049731"... | 0.0 | -1 |
Just like model.all. Returns all the instances of that model. | def all( model )
model( model ).all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def all\n self.class.all\n end",
"def get_all_from_database\n model.all\n end",
"def all\n @collection ||= Collection.new model_name\n end",
"def all\n self.all\n end",
"def all\n repository.all(self)\n end",
"def all\n where\n end",
"def all(model)\n... | [
"0.80532736",
"0.77104735",
"0.7612803",
"0.74300283",
"0.7383703",
"0.72642356",
"0.7190565",
"0.71625006",
"0.7088194",
"0.7068752",
"0.706583",
"0.7056846",
"0.698789",
"0.6982826",
"0.69816977",
"0.69562525",
"0.69539297",
"0.6951597",
"0.6936397",
"0.6919123",
"0.6893399... | 0.85239077 | 0 |
Finds a specific instance using the name field | def find( model, name )
model( model )[name ] rescue nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find(name)\n instances.find { |instance| instance.name == (name) }\n end",
"def find_obj_for_name(name)\n idx = @field_names.index(name)\n if idx\n instantiate_obj(idx)\n @field_objs[idx].obj\n else\n nil\n end\n end",
"def find_by_name(name)\n find_by... | [
"0.82619643",
"0.7726176",
"0.7639233",
"0.7622286",
"0.7597957",
"0.75134015",
"0.7458307",
"0.7343792",
"0.7309795",
"0.7263694",
"0.70618355",
"0.70111775",
"0.70111775",
"0.6997294",
"0.6955809",
"0.6938328",
"0.693635",
"0.68975616",
"0.6876927",
"0.68671",
"0.6862781",
... | 0.6602838 | 25 |
Provides statistics about running jobs etc using the dispatcher | def dispatcher_stats
dispatchers.stats
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_reocurring_status(interval=10)\n @stats_thread = Thread.fork(0) { |tcount|\n Thread.current[:name] = 'stats'\n loop do\n sleep(interval)\n begin\n total_defers = 0\n lines = []\n sent_to = Message.to_task_count.dup\n consume... | [
"0.6706595",
"0.66628313",
"0.65545255",
"0.6492366",
"0.6435972",
"0.6245038",
"0.6201453",
"0.6171459",
"0.5993489",
"0.59419125",
"0.5912127",
"0.58797365",
"0.58691305",
"0.5866685",
"0.58610904",
"0.585782",
"0.58231956",
"0.5822015",
"0.57625836",
"0.5762023",
"0.576202... | 0.74423504 | 0 |
Similar to String.to_i but it returns the original object if String is not a number | def to_i( str )
return str if !str.is_a?( String )
if str.match( /\d+/ ).to_s.size == str.size
return str.to_i
else
return str
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def string_to_number(s)\n s.to_i\nend",
"def string_to_number(s)\n s.to_i\nend",
"def to_number(string)\n Integer(string || '')\n rescue ArgumentError\n 0\n end",
"def string_to_number(string)\n string.to_i\nend",
"def convert_to_integer(string)\n unless /^-?\\d+$/ =~ string\n ra... | [
"0.77371395",
"0.77371395",
"0.76844347",
"0.76393914",
"0.7622128",
"0.7524045",
"0.7508762",
"0.74754196",
"0.7449896",
"0.7401488",
"0.73660713",
"0.73361367",
"0.73347527",
"0.73333347",
"0.73327994",
"0.7251696",
"0.72466725",
"0.7173292",
"0.7135785",
"0.7129854",
"0.70... | 0.7683439 | 3 |
Prepares form params to be used as options for RPC transmission | def prep_opts( params )
need_to_split = %w(exclude_cookies exclude_vectors exclude include)
cparams = {}
params.each_pair {
|name, value|
next if %w(_csrf modules plugins).include?( name ) || ( value.is_a?( String ) && value.empty?)
value = true if value == 'on'
if name == 'cookiejar' && value[:tempfile]
cparams['cookies'] = {}
cparams['cookie_string'] = ''
Arachni::Element::Cookie.from_file( '', value[:tempfile] ).each do |c|
cparams['cookies'][c.name] = c.value
cparams['cookie_string'] += c.to_s + ';'
end
elsif name == 'extend_paths' && !value.is_a?( Array ) && value[:tempfile]
cparams['extend_paths'] = Arachni::Options.instance.paths_from_file( value[:tempfile] )
elsif name == 'restrict_paths' && !value.is_a?( Array ) && value[:tempfile]
cparams['restrict_paths'] = Arachni::Options.instance.paths_from_file( value[:tempfile] )
elsif need_to_split.include?( name ) && value.is_a?( String )
cparams[name] = value.split( "\r\n" )
elsif name == 'redundant' && value.is_a?( String )
cparams[name] = {}
value.split( "\r\n" ).each {
|rule|
regexp, counter = rule.split( ':', 2 )
cparams[name][regexp] = counter
}
elsif name == 'custom_headers' && value.is_a?( String )
cparams[name] = {}
value.split( "\r\n" ).each {
|line|
header, val = line.to_s.split( /=/, 2 )
cparams[name][header] = val
}
else
cparams[name] = to_i( value )
end
}
if !cparams['audit_links'] && !cparams['audit_forms'] &&
!cparams['audit_cookies'] && !cparams['audit_headers']
cparams['audit_links'] = true
cparams['audit_forms'] = true
cparams['audit_cookies'] = true
end
return cparams
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prepare_request_params(options)\n params = detect_request_input options.delete(:input)\n\n options.inject(params) do |params, kv|\n key, value = kv\n params.merge!(\"#{key.to_s.downcase.gsub(/_+/,'')}\" => value) \n end\n end",
"def prepare_params(options)\n params = op... | [
"0.6865272",
"0.6420553",
"0.63489926",
"0.6205868",
"0.619011",
"0.6179631",
"0.6161017",
"0.6110328",
"0.6095029",
"0.60672253",
"0.60486054",
"0.6047926",
"0.60067624",
"0.5990663",
"0.5937675",
"0.59374076",
"0.59324694",
"0.5926231",
"0.5903433",
"0.5883822",
"0.5881872"... | 0.64347833 | 1 |
Makes sure that all systems are go and populates the session with default values | def prep_session( skip_dispatcher = false )
session[:flash] ||= {}
ensure_dispatcher if !skip_dispatcher
session['opts'] ||= {}
session['opts']['settings'] ||= {
'audit_links' => true,
'audit_forms' => true,
'audit_cookies' => true,
'http_req_limit' => 20,
'user_agent' => 'Arachni/' + Arachni::VERSION
}
session['opts']['modules'] ||= [ '*' ]
require Arachni::Options.instance.dir['lib'] + 'framework'
framework = Arachni::Framework.new( Arachni::Options.instance )
plugins = Arachni::Plugin::Manager.new( framework )
default_plugins = {}
plugins.parse( Arachni::Plugin::Manager::DEFAULT ).each {
|mod|
default_plugins[mod] = {}
}
session['opts']['plugins'] ||= YAML::dump( default_plugins )
#
# Garbage collector, zombie killer. Reaps idle processes every 60 seconds.
#
@@zombie_reaper ||=
::EM.add_periodic_timer( 60 ){ ::EM.defer { shutdown_zombies } }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup_config_defaults!(cfg)\n cfg.session_type ||= default_session_type\n cfg.session_path ||= default_session_path\n cfg.session_options ||= {}\n cfg.sessions ||= []\n end",
"def init_variables_from_sessions\n session[:room_type_channel_mapping_params].deep_merge!(params[... | [
"0.62771183",
"0.6274168",
"0.611344",
"0.6107443",
"0.610286",
"0.6100398",
"0.60836124",
"0.59513116",
"0.5943756",
"0.5931998",
"0.592359",
"0.58782184",
"0.5878027",
"0.58727634",
"0.5855165",
"0.58458215",
"0.58174264",
"0.57621604",
"0.57450956",
"0.5738057",
"0.5731855... | 0.0 | -1 |
Makes sure that we have a dispatcher, if not it redirects the user to an appropriate error page. | def ensure_dispatcher
if dispatchers.all.empty?
async_redirect '/dispatchers/edit'
else
dispatchers.first_alive {
|dispatcher|
async_redirect '/dispatchers/edit' if !dispatcher
}
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dispatch_default_exception(klass, request, response, e)\n controller = klass.build(request, response, e.class::STATUS)\n if e.is_a? ControllerExceptions::Redirection\n controller.headers.merge!('Location' => e.message)\n controller.instance_variable_set(\"@_body\", %{ }) #fix\n ... | [
"0.6120797",
"0.5988972",
"0.5984426",
"0.5933068",
"0.58561504",
"0.58561504",
"0.5685518",
"0.5671331",
"0.561356",
"0.5580131",
"0.5552504",
"0.55358756",
"0.5510891",
"0.5510891",
"0.55094874",
"0.55068207",
"0.550121",
"0.5495665",
"0.5489915",
"0.548516",
"0.5473028",
... | 0.7191428 | 0 |
Saves the report and shuts down the instance | def save_and_shutdown( url, &block )
instance = instances.connect( url, session )
instance.framework.clean_up{
|res|
if !res.rpc_connection_error?
instance.framework.auditstore {
|auditstore|
if !auditstore.rpc_connection_error?
log.webui_save_and_shutdown_auditstore_success( env, url )
report_path = reports.save( auditstore )
instance.service.shutdown!{ block.call( report_path ) }
else
log.webui_save_and_shutdown_auditstore_failed( env, url )
block.call( auditstore )
end
}
else
log.webui_save_and_shutdown_clean_up_failed( env, url )
block.call( res )
end
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def teardown\n @report.close\n end",
"def save_report\n Report.transaction do\n report = Report.create(name: @name,\n start_date: @start_date,\n end_date: @end_date,\n type: @type,\n ... | [
"0.686191",
"0.670177",
"0.660425",
"0.63947195",
"0.62846786",
"0.6274183",
"0.6226424",
"0.62250245",
"0.62250245",
"0.601511",
"0.601511",
"0.59947836",
"0.5933632",
"0.5888263",
"0.5873162",
"0.5856412",
"0.58363044",
"0.5766031",
"0.57387847",
"0.5733397",
"0.5719151",
... | 0.64452106 | 3 |
Kills all running instances | def shutdown_all( url, &block )
dispatchers.connect( url ).stats {
|stats|
log.dispatcher_global_shutdown( env, url )
stats['running_jobs'].each {
|instance|
next if instance['helpers']['rank'] == 'slave'
save_and_shutdown( instance['url'] ){
log.instance_shutdown( env, instance['url'] )
}
}
block.call
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop_instances\n @task.unsafe(\"Stopping #{@name} processes\") do\n autoscaling_group.suspend_all_processes\n end\n autoscaling_instances.each do |instance|\n @task.unsafe(\"Stopping instance #{instance.instance_id}\") do\n load_balancers.each do |elb|\n elb.instances.deregis... | [
"0.77755713",
"0.7696299",
"0.7677907",
"0.7642613",
"0.7642613",
"0.724169",
"0.7207087",
"0.7003597",
"0.6944833",
"0.69056904",
"0.69023645",
"0.6891278",
"0.68600595",
"0.68552566",
"0.68505615",
"0.6845131",
"0.68109107",
"0.6800633",
"0.6784938",
"0.6766502",
"0.6748944... | 0.0 | -1 |
Kills all idle instances | def shutdown_zombies
dispatchers.jobs {
|jobs|
jobs.each {
|job|
next if job['helpers']['rank'] == 'slave' ||
job['owner'] == HELPER_OWNER
instances.connect( job['url'], session ).framework.busy? {
|busy|
if !busy.rpc_exception? && !busy
save_and_shutdown( job['url'] ){
log.webui_zombie_cleanup( env, job['url'] )
}
end
}
}
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def kill() end",
"def kill\n shutdown\n end",
"def kill\n\t\tframework.sessions.deregister(self)\n\tend",
"def kill\n\t\tframework.sessions.deregister(self)\n\tend",
"def kill!() end",
"def kill\n @alive = false\n end",
"def kill\n send(:kill)\n end",
"def kill_all!\n @mo... | [
"0.7323869",
"0.7272805",
"0.7269617",
"0.7269111",
"0.7118163",
"0.7091026",
"0.70828015",
"0.7064038",
"0.6951698",
"0.6880253",
"0.6847755",
"0.6831605",
"0.6830206",
"0.68167394",
"0.68167394",
"0.67973197",
"0.67960465",
"0.6741599",
"0.6711622",
"0.67070335",
"0.6687255... | 0.0 | -1 |
Signs out resource via UI | def sign_out
click_link 'Sign out'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sign_out(resource_or_scope); end",
"def sign_out(resource_or_scope); end",
"def new\n sign_out(resource)\n super\n end",
"def sign_out\n @logout = true\n authenticate_api_user\n @logout = false\n revoke_access if @current_user\n head :no_content\n end",
"def sign_out\n @re... | [
"0.8179401",
"0.8179401",
"0.78424495",
"0.7677066",
"0.76586235",
"0.7633958",
"0.7630089",
"0.76144266",
"0.7613495",
"0.7574671",
"0.75673693",
"0.7555145",
"0.75455445",
"0.75303423",
"0.7528939",
"0.75232565",
"0.74982977",
"0.74154896",
"0.7354977",
"0.7337645",
"0.7327... | 0.7438674 | 17 |
Logs in resource via Warden library bypassing UI | def login(resource)
login_as resource.user, scope: :user
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def login\n make_login_call\n end",
"def login\n @browser.login\n end",
"def login\n self.login\n end",
"def run()\n login()\n end",
"def log_in\n end",
"def login; end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def lo... | [
"0.69995755",
"0.69612664",
"0.69265795",
"0.69056374",
"0.6887909",
"0.6841049",
"0.6839824",
"0.6839824",
"0.6839824",
"0.6839824",
"0.6839824",
"0.6839824",
"0.6839824",
"0.6839824",
"0.6839824",
"0.68184257",
"0.6811903",
"0.67497987",
"0.67389405",
"0.67389405",
"0.67292... | 0.69110274 | 3 |
NOTE: query for two or more entries so that the socket must be read multiple times. See The Problem: | def test_nested_search_without_open
entries = []
nested_entry = nil
@ldap.search(filter: "(|(uid=user1)(uid=user2))", base: "ou=People,dc=rubyldap,dc=com") do |entry|
entries << entry.uid.first
nested_entry ||= @ldap.search(filter: "uid=user3", base: "ou=People,dc=rubyldap,dc=com").first
end
assert_equal "user3", nested_entry.uid.first
assert_equal %w(user1 user2), entries
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def query(q)\n Timeout::timeout(1) {\n @queries += 1\n if @queries >= 999\n disconnect\n \t @sock = TCPSocket.new(@host, @port)\n \t @queries = 0\n end\n #puts \"querying...\"\n @sock.puts(\"query #{q} return all\")\n #puts \"getting response...\"\n... | [
"0.6236793",
"0.59394455",
"0.56696177",
"0.5662894",
"0.5621912",
"0.561506",
"0.5603598",
"0.54350173",
"0.5431819",
"0.54190856",
"0.5413852",
"0.5413852",
"0.54030615",
"0.5395517",
"0.53849936",
"0.53755933",
"0.5368909",
"0.53621495",
"0.5344719",
"0.53335935",
"0.53081... | 0.0 | -1 |
Some switching logic between variable and param below | def determine_requested
# param is usually set from the convention. when set from convention stack name takes higher precedence
config_key = @config.singularize.to_sym # param or variable
@options[config_key] || @options[:config] || @options[:stack]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def PRF02=(arg)",
"def param; end",
"def param; end",
"def SE02=(arg)",
"def PRF04=(arg)",
"def PRF01=(arg)",
"def SE01=(arg)",
"def parameterize(value); end",
"def PO114=(arg)",
"def PO101=(arg)",
"def PO113=(arg)",
"def PO115=(arg)",
"def PO111=(arg)",
"def profile_parameter=(_arg0); en... | [
"0.6570121",
"0.6528021",
"0.6528021",
"0.64930826",
"0.6420548",
"0.63397986",
"0.63204056",
"0.6309153",
"0.6237536",
"0.622497",
"0.6192866",
"0.618463",
"0.6179855",
"0.6143829",
"0.61395717",
"0.6139035",
"0.6133019",
"0.611815",
"0.6088499",
"0.60747546",
"0.60713065",
... | 0.0 | -1 |
can be between 1 and 100 el each elem between 1 and 5 d between 1 and 31, m between 1 and 12 s = has chocolate bars d Ron's birth day m Ron's birth month 1 2 1 3 2 3 2 Output: how many ways can the chocolate bars be divided (depending on m) to match d | def birthday(s, d, m)
size = s.size
return 1 if m >= size && s.inject(:+) == m
return s.select { |n| n == d }.count if m == 1
times = 0
s.each_index do |idx|
times += 1 if s[idx..idx + m - 1].inject(:+) == d
break if idx + m == size
end
times
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def birthday(s, d, m)\n # s is array [1,2,3]\n # d is day (total)\n # m is month (number of squares)\n len = s.length - (m - 1)\n count = 0\n\n for i in 0..len do\n if s[i,m].sum == d\n count += 1\n end\n end\n\n return count\nend",
"def solve(n, s, d, m)\n # Com... | [
"0.7063282",
"0.64336336",
"0.6428568",
"0.6282926",
"0.62356603",
"0.6200585",
"0.6052635",
"0.59586173",
"0.58983874",
"0.5879681",
"0.58772457",
"0.5835173",
"0.57986724",
"0.57427305",
"0.57143027",
"0.5701079",
"0.56885767",
"0.56351787",
"0.5630953",
"0.5604431",
"0.558... | 0.7168912 | 0 |
main menue here the user is asked to imput name if exist the user will diplay next method mainscreen else ... | def menu
puts "________________"
puts "insert the user name to continue"
@user_name = gets.chomp
response = User.find_by(user_name: @user_name)
puts "________________"
if response
mainscreen
else
puts "try again"
menu
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def main_menu\n name_selector\n puts \"Okay #{@name}, what would you like to do?\"\n loop do\n case menu_arrows\n when '1'\n @recommendation.recommendation_menu\n when '2'\n puts 'you have the following number of games in your library: '\n @game_library.game_instances\n... | [
"0.69811237",
"0.6961884",
"0.6774767",
"0.67525864",
"0.6745335",
"0.67280495",
"0.6710562",
"0.66896844",
"0.66845226",
"0.66731113",
"0.6656959",
"0.6649355",
"0.6628634",
"0.66179824",
"0.6598789",
"0.65860045",
"0.6580537",
"0.65720713",
"0.6558027",
"0.65552473",
"0.655... | 0.7231797 | 0 |
Method to initialize object for our attribute | def create_objects
# Create a new "Mash" object and assign it to "awesome"
awesome Mash.new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(data) # will accept the attribute data. \r\n\r\n @data = data # store the attribute data, and allows it to be used each time. \r\n\r\n end",
"def initialize attr={}\n super\n self.attributes = attr\n end",
"def initialize(attr={})\n super\n end",
"def initializ... | [
"0.77306193",
"0.770294",
"0.7513096",
"0.7341954",
"0.73399854",
"0.731252",
"0.72761244",
"0.7251209",
"0.72394633",
"0.7219543",
"0.71970063",
"0.71811897",
"0.71571463",
"0.7153684",
"0.7153684",
"0.71493566",
"0.7143595",
"0.7129489",
"0.7118207",
"0.7106631",
"0.7104174... | 0.0 | -1 |
You may assume that words in the string are separated by exactly one space, and that any substring of nonspace characters is a word. Examples =begin Input: string Output: array of strings containing word and its size in a string Rules: Problem: break up the string to be able to count the length of each word and return both the word and length together in their own strings inside of an array DS: Algo: break up the string counting the length of each string and adding that number to the end of the string separated by a space (map) (string interpolation convert int to a str =end | def word_lengths(str)
ary = str.split(' ')
ary.map {|word| word + " #{word.size.to_s}"}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def word_lengths(string)\nstring.split.map{|e| e + ' ' + e.size.to_s}\nend",
"def word_lengths(string)\n string.split(' ').map do |word|\n word << ' ' + word.size.to_s\n end\nend",
"def word_lengths(string)\n string.split(\" \").map do |word|\n size = word.length \n word + \" #{size}\"\n end \nend... | [
"0.7808052",
"0.77830404",
"0.777005",
"0.7767165",
"0.7759903",
"0.7727513",
"0.77232224",
"0.77128315",
"0.76373136",
"0.7631604",
"0.76285094",
"0.76285094",
"0.7609661",
"0.7592709",
"0.7588125",
"0.7523938",
"0.7438199",
"0.74368554",
"0.7431764",
"0.7416317",
"0.7412672... | 0.77259314 | 6 |
Preview this email at | def new_comment_update
UpdateMailer.new_comment_update
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def preview\n @email = Email.find(params[:id])\n render :text => @email.body\n end",
"def preview\n @email = DirectEmail.find(params[:id])\n render :text => @email.body\n end",
"def preview\n @email = EventEmail.find(params[:id])\n render :text => @email.body\n end",
"def preview_email\r... | [
"0.7148543",
"0.7119171",
"0.70560735",
"0.69852483",
"0.68484807",
"0.68484807",
"0.68335557",
"0.666423",
"0.6432723",
"0.6316131",
"0.63039446",
"0.6182414",
"0.6167663",
"0.61334646",
"0.61317104",
"0.6113868",
"0.6112678",
"0.6112678",
"0.60867035",
"0.60150355",
"0.5985... | 0.0 | -1 |
Preview this email at | def new_to_do_update
UpdateMailer.new_to_do_update
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def preview\n @email = Email.find(params[:id])\n render :text => @email.body\n end",
"def preview\n @email = DirectEmail.find(params[:id])\n render :text => @email.body\n end",
"def preview\n @email = EventEmail.find(params[:id])\n render :text => @email.body\n end",
"def preview_email\r... | [
"0.71475905",
"0.71186084",
"0.70552814",
"0.6985626",
"0.6848472",
"0.6848472",
"0.6832406",
"0.6663229",
"0.64324814",
"0.631654",
"0.6304366",
"0.6181875",
"0.6167911",
"0.61338973",
"0.61305445",
"0.6115152",
"0.61100966",
"0.61100966",
"0.60882556",
"0.60132533",
"0.5982... | 0.0 | -1 |
Preview this email at | def goal_complete_update
UpdateMailer.goal_complete_update
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def preview\n @email = Email.find(params[:id])\n render :text => @email.body\n end",
"def preview\n @email = DirectEmail.find(params[:id])\n render :text => @email.body\n end",
"def preview\n @email = EventEmail.find(params[:id])\n render :text => @email.body\n end",
"def preview_email\r... | [
"0.71475905",
"0.71186084",
"0.70552814",
"0.6985626",
"0.6848472",
"0.6848472",
"0.6832406",
"0.6663229",
"0.64324814",
"0.631654",
"0.6304366",
"0.6181875",
"0.6167911",
"0.61338973",
"0.61305445",
"0.6115152",
"0.61100966",
"0.61100966",
"0.60882556",
"0.60132533",
"0.5982... | 0.0 | -1 |
Preview this email at | def partner_joined_update
UpdateMailer.partner_joined_update
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def preview\n @email = Email.find(params[:id])\n render :text => @email.body\n end",
"def preview\n @email = DirectEmail.find(params[:id])\n render :text => @email.body\n end",
"def preview\n @email = EventEmail.find(params[:id])\n render :text => @email.body\n end",
"def preview_email\r... | [
"0.71475905",
"0.71186084",
"0.70552814",
"0.6985626",
"0.6848472",
"0.6848472",
"0.6832406",
"0.6663229",
"0.64324814",
"0.631654",
"0.6304366",
"0.6181875",
"0.6167911",
"0.61338973",
"0.61305445",
"0.6115152",
"0.61100966",
"0.61100966",
"0.60882556",
"0.60132533",
"0.5982... | 0.0 | -1 |
'ensure' property is not necessary, because it is not used. newproperty(:ensure) do desc "Whether the resource is in sync or not." defaultto :insync def retrieve Returns always notrun to permit reinstallations if something was changed or updated in the source folder. :insync end newvalue :outofsync newvalue :insync do Do nothing only execute install when refreshed end end Define method 'refresh' to respond to a refresh events for this resource | def refresh
# Debug messages displayed on the screen during the synchronization Puppet Agent <-> Puppet Master
debug("Shibboleth_install[name] = " + @parameters[:name].value + ".")
debug("Shibboleth_install[cwd] = " + @parameters[:cwd].value + ".")
debug("Shibboleth_install[command] = " + @parameters[:command].value + ".")
# Open, or creates a new one, the file '/tmp/path_into_parameter_name' into write mode
# and writes the content of the ':command' parameter on it.
# Then executes the entire bash script with the '/bin/bash' command calling the system call 'system'
# Finally deletes the new file created.
filename = "/tmp/" + @parameters[:name].value + ".sh"
File.open(filename, "w") do |saved_file|
saved_file.write(@parameters[:command].value)
end
debug("Executing the bash script.")
system("/bin/bash " + filename) # This System Call execute the "/bin/bash" command on the file 'filename'
debug("Deleting file " + filename + ".")
File.delete(filename) # This instruction delete the file 'filename'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n self.uninstall if (@property_hash[:ensure] || info2hash()[:ensure]) != :absent\n self.install\n end",
"def insync?\n unless properties[:ensure] == :absent\n properties.each do |k, v|\n if resource[k].to_s != v\n resource[:ensure] = :modified\n break false\n ... | [
"0.709258",
"0.6435594",
"0.63227946",
"0.6182759",
"0.6024036",
"0.59589726",
"0.5916678",
"0.58939296",
"0.579362",
"0.57711273",
"0.57685995",
"0.5751461",
"0.57192343",
"0.56839734",
"0.56695145",
"0.5653459",
"0.5628018",
"0.5599562",
"0.55689144",
"0.55288285",
"0.55259... | 0.0 | -1 |
get this use has which product_cates, see ApplicationHelper::PRODUCT_CATES [0, 1, 3] | def active_cate_ids
self.products.group_by(&:cate_id).keys.sort
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def catalogue\n @catalogue ||= [\n Product.new( \"001\", \"Lavender heart\", 9.25 ),\n Product.new( \"002\", \"Personalised cufflinks\", 45.00 ),\n Product.new( \"003\", \"Kids T-shirt\", 19.95 )\n ]\n end",
"def catalogue\n @catalogue ||= [\n Product.new( \"001\", \"Lavender heart\... | [
"0.6035302",
"0.6035302",
"0.6009794",
"0.5711208",
"0.56176215",
"0.5594125",
"0.55859333",
"0.5548291",
"0.5528958",
"0.55035585",
"0.5498532",
"0.54920506",
"0.54872996",
"0.54817593",
"0.5473803",
"0.5449347",
"0.54245883",
"0.54179424",
"0.5388395",
"0.5361126",
"0.53605... | 0.6200365 | 0 |
GET /ideas GET /ideas.xml | def index
idea_type
params[:type_id]||=0
params[:order] ||="recent"
@ideas=Idea.find_categories(params[:type_id],params[:page],params[:order])
@idea = Idea.new(:type_id => params[:type_id].to_i)
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @ideas }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @ideas = current_user.ideas\n #@user.ideas\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ideas }\n end\n end",
"def index\n puts current_user.nil?\n if !signed_in?\n redirect_to root_path\n end\n \n @ideas = User.f... | [
"0.6992918",
"0.65643215",
"0.6509236",
"0.63239634",
"0.6304793",
"0.63017297",
"0.63004375",
"0.6299573",
"0.62859917",
"0.62859917",
"0.62859917",
"0.62759554",
"0.6268526",
"0.61649084",
"0.61344224",
"0.6130547",
"0.6130547",
"0.6130547",
"0.61268693",
"0.6119865",
"0.61... | 0.0 | -1 |
GET /ideas/1 GET /ideas/1.xml | def show
idea_type
@idea_id=params[:id]
@idea = Idea.find_idea(params[:id])
@idea_comments=IdeaComment.paginate query(:page=>params[:page])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @idea }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @ideas = current_user.ideas\n #@user.ideas\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ideas }\n end\n end",
"def index\n @guides = Guide.all\n #@guide = Guide.find(params[:guide]) rescue nil\n\n respond_to do |format|\n ... | [
"0.66761804",
"0.6527975",
"0.6519152",
"0.64200926",
"0.63564056",
"0.62541",
"0.6230345",
"0.62210166",
"0.6111995",
"0.6051787",
"0.60202956",
"0.601807",
"0.601807",
"0.60073483",
"0.59907436",
"0.5987403",
"0.59789574",
"0.59769523",
"0.59622526",
"0.5955148",
"0.5953385... | 0.0 | -1 |
GET /ideas/new GET /ideas/new.xml | def new
@idea = Idea.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @idea }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @idea = @current_user.ideas.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @idea }\n end\n end",
"def new\n @howto = Howto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @howto }\... | [
"0.73268026",
"0.72889334",
"0.728502",
"0.71971244",
"0.7075393",
"0.7050038",
"0.70473367",
"0.6950649",
"0.6852465",
"0.6774649",
"0.6774649",
"0.6774649",
"0.6774649",
"0.6774649",
"0.67698324",
"0.67697746",
"0.67532897",
"0.6750642",
"0.6750247",
"0.67244124",
"0.672441... | 0.7271287 | 3 |
POST /ideas POST /ideas.xml | def create
@idea=Idea.new(params[:idea])
@idea.user_id=current_user.id
if @idea.save
IdeaVote.save_vote(@idea.id,"",0)
flash[:notice] = "反馈成功"
redirect_to :back
else
flash[:error]="标题或内容不能为空"
redirect_to :back
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n params[:idea][:tags] = params[:idea][:tags].collect { |tag| Tag.find(tag) }\n\n @idea = @current_user.ideas.create(params[:idea])\n\n respond_to do |format|\n if @idea.save\n format.html { redirect_to(@idea, :notice => 'Idea was successfully created.') }\n format.xml { ren... | [
"0.5866396",
"0.58346725",
"0.5779855",
"0.5727013",
"0.5716708",
"0.5675377",
"0.5629421",
"0.5541107",
"0.5531107",
"0.5506348",
"0.546556",
"0.5455235",
"0.54128045",
"0.53906393",
"0.5347489",
"0.53338635",
"0.53291565",
"0.53288764",
"0.53122467",
"0.5266023",
"0.5242675... | 0.0 | -1 |
PUT /ideas/1 PUT /ideas/1.xml | def update
@idea = Idea.find(params[:idea][:id])
if @idea.update_attributes(params[:idea])
redirect_to :action=>:index
else
flash[:error]="修改后标题或内容不能为空"
redirect_to :action => "edit", :id => @idea.id
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"def update\n @idea = Idea.find(params[:id])\n\n\t\t\n\t\trespond_to do |format|\n if @idea.update_attributes(params[:idea])\n fl... | [
"0.61640143",
"0.60845983",
"0.6080045",
"0.6061628",
"0.6061628",
"0.6061628",
"0.6061628",
"0.5936405",
"0.5882333",
"0.5853111",
"0.57398766",
"0.57398766",
"0.5717608",
"0.5702627",
"0.5652912",
"0.5597328",
"0.5594456",
"0.5587303",
"0.558614",
"0.55669856",
"0.55581534"... | 0.0 | -1 |
GET /page_contents/1 GET /page_contents/1.json | def show
authorize @page_content.page, :show?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_page_contents()\n JSON.parse( \n @client.api.get(\"#{@client.base_uri.path}/api.php?#{URI.encode_www_form({\n :action => 'query',\n :prop => 'info|revisions',\n :titles => BAN_PAGE,\n :rvprop => 'content',\n :intoken => 'edit',\n :indexpageids => 1,\n ... | [
"0.7691245",
"0.7181968",
"0.7050136",
"0.6760123",
"0.6707732",
"0.66290796",
"0.6563016",
"0.65350634",
"0.6529072",
"0.65053445",
"0.6479487",
"0.6473935",
"0.6450636",
"0.6436331",
"0.64005953",
"0.6395597",
"0.6340494",
"0.6315501",
"0.6234461",
"0.6213879",
"0.6197765",... | 0.0 | -1 |
PATCH/PUT /page_contents/1 PATCH/PUT /page_contents/1.json | def update
authorize @page_content.page, :update?
respond_to do |format|
if @page_content.update(page_content_params)
format.json { render :show, status: :ok, location: @page_content }
else
format.json { render json: @page_content.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @pagecontent = @page.pagecontents.find(params[:id])\n\n respond_to do |format|\n if @pagecontent.update_attributes(params[:pagecontent])\n flash[:notice] = 'Pagecontent was successfully updated.'\n format.html {redirect_to(page_pagecontents_path(@page)) }\n format.xml ... | [
"0.7089644",
"0.69739765",
"0.69386905",
"0.6854967",
"0.68044883",
"0.6769694",
"0.6668855",
"0.6603178",
"0.6598603",
"0.65904576",
"0.65780294",
"0.65780294",
"0.6573663",
"0.6571512",
"0.65556115",
"0.6554618",
"0.6552674",
"0.65408134",
"0.653647",
"0.6521742",
"0.652174... | 0.73075324 | 0 |
Never trust parameters from the scary internet, only allow the white list through. | def page_content_params
params.require(:page_content).permit(:contents).to_h
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 |
The response_block is a hash and can have one of several values: the follwing values are always present after a transaction and can be queried to gain further details of the transaction: result_code: 0 for failure, check error_code for further details 1 transaction was succesful 2 transaction was denied transaction_reference transactionverifier transaction_time auth_code amount the order reference | def response_block
create_response_block
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_response\n\n unless @block_data_response.success?\n notify_dev(@block_data_response.data.merge(msg: \"Error while fetching block\"))\n return error_with_data(\n 'c_rbe_2',\n 'error while fetching block',\n 'error while fetching block',\n GlobalCon... | [
"0.7046972",
"0.675251",
"0.64231914",
"0.6311692",
"0.5971568",
"0.59376854",
"0.59183323",
"0.59176564",
"0.58683324",
"0.5857699",
"0.58314985",
"0.5597922",
"0.55929166",
"0.5587881",
"0.5569621",
"0.55628926",
"0.5554924",
"0.55413806",
"0.553209",
"0.55310285",
"0.55160... | 0.62087333 | 5 |
Write the xml document needed for processing, fill in elements need and delete unused ones from the root_xml raises an error if any necessary elements are missing | def create_request
raise AttributeMissing.new "(2500) TransactionReference or OrderReference need to be present." if (transaction_reference.nil? && order_reference.nil?)
raise AttributeMissing.new "(2500) SiteReference must be present." if (site_reference.nil? && (REXML::XPath.first(@request_xml, "//SiteReference").text.blank? rescue true))
REXML::XPath.first(@request_xml, "//Request").attributes["Type"] = "TRANSACTIONQUERY"
ops = REXML::XPath.first(@request_xml, "//Operation")
["TermUrl", "MerchantName", "Currency", "SettlementDay"].each { |e| ops.delete_element e }
(ops.elements["SiteReference"] || ops.add_element("SiteReference")).text = self.site_reference if self.site_reference
(ops.elements["TransactionReference"] || ops.add_element("TransactionReference")).text = self.transaction_reference if self.transaction_reference
order = REXML::XPath.first(@request_xml, "//Operation")
(order.elements["OrderReference"] || order.add_element("OrderReference")).text = self.order_reference if self.order_reference
root = @request_xml.root
(root.elements["Certificate"] || root.add_element("Certificate")).text = self.site_alias if self.site_alias
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prepare_final_xml\n @base_xml.elements[\"#{@ns}:OccupancyLevels/#{@ns}:OccupancyLevel/#{@ns}:OccupantQuantity\"].text = @occupant_quantity if !@occupant_quantity.nil?\n @base_xml.elements[\"#{@ns}:SpatialUnits/#{@ns}:SpatialUnit/#{@ns}:NumberOfUnits\"].text = @number_of_units if !@number_of_units.nil... | [
"0.63568056",
"0.5923454",
"0.57891434",
"0.56587297",
"0.56568813",
"0.5652719",
"0.56244916",
"0.55793935",
"0.5575787",
"0.5458421",
"0.54031926",
"0.53969085",
"0.53235525",
"0.5313393",
"0.53129566",
"0.5298428",
"0.5267283",
"0.5256587",
"0.5234751",
"0.5217267",
"0.520... | 0.0 | -1 |
Baseline implementation for the create_key REST call | def create_key request_pb, options = nil
raise ::ArgumentError, "request must be provided" if request_pb.nil?
verb, uri, query_string_params, body = ServiceStub.transcode_create_key_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
response = @client_stub.make_http_request(
verb,
uri: uri,
body: body || "",
params: query_string_params,
options: options
)
operation = ::Gapic::Rest::TransportOperation.new response
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
yield result, operation if block_given?
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @key = Key.new(key_params)\n\n if @key.save\n render json: @key, status: :created, location: api_key_url(@key)\n else\n render json: @key.errors, status: :unprocessable_entity\n end\n end",
"def create_key(key_name, create_opts={})\n create_resource :key, create_opts.me... | [
"0.7508264",
"0.7287141",
"0.71433794",
"0.6971282",
"0.6965376",
"0.69409055",
"0.68589455",
"0.68585473",
"0.6853549",
"0.67256576",
"0.66128445",
"0.647987",
"0.64696354",
"0.64560837",
"0.64488333",
"0.642326",
"0.63854057",
"0.63541436",
"0.6352907",
"0.63205016",
"0.630... | 0.6868965 | 6 |
Baseline implementation for the list_keys REST call | def list_keys request_pb, options = nil
raise ::ArgumentError, "request must be provided" if request_pb.nil?
verb, uri, query_string_params, body = ServiceStub.transcode_list_keys_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
response = @client_stub.make_http_request(
verb,
uri: uri,
body: body || "",
params: query_string_params,
options: options
)
operation = ::Gapic::Rest::TransportOperation.new response
result = ::Google::Cloud::ApiKeys::V2::ListKeysResponse.decode_json response.body, ignore_unknown_fields: true
yield result, operation if block_given?
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_keys()\n # TODO\n end",
"def keys\n IbmCloudRest.get \"#{@uri}/keys\"\n end",
"def list_api_keys(opts = {})\n @transporter.read(:GET, '/1/keys', {}, opts)\n end",
"def get_keys\t\t\n\t\t\tbegin\t\t\t\t\t\t\t\n\t\t\t\tgetkeys = Datastore.new\t\t\t\n\t\t\t\trender :status =... | [
"0.75384957",
"0.7211509",
"0.7127136",
"0.6922505",
"0.6920484",
"0.6856766",
"0.6809757",
"0.6809757",
"0.6777623",
"0.6762577",
"0.67291635",
"0.6727553",
"0.6724397",
"0.67172295",
"0.6704823",
"0.66930056",
"0.66930056",
"0.66194296",
"0.6594216",
"0.6565294",
"0.6562023... | 0.6807357 | 8 |
Baseline implementation for the get_key REST call | def get_key request_pb, options = nil
raise ::ArgumentError, "request must be provided" if request_pb.nil?
verb, uri, query_string_params, body = ServiceStub.transcode_get_key_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
response = @client_stub.make_http_request(
verb,
uri: uri,
body: body || "",
params: query_string_params,
options: options
)
operation = ::Gapic::Rest::TransportOperation.new response
result = ::Google::Cloud::ApiKeys::V2::Key.decode_json response.body, ignore_unknown_fields: true
yield result, operation if block_given?
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get key\n deserialize backend.get key.to_s rescue nil\n end",
"def get key; call key; end",
"def read_key; end",
"def key\n Net::HTTP.get(@uri.host, \"#{@uri.request_uri}key\", @uri.port)\n end",
"def get(key); end",
"def get(key); end",
"def get(key); end",
"def get(key); end",
... | [
"0.72572994",
"0.722882",
"0.72198397",
"0.7179484",
"0.6996008",
"0.6996008",
"0.6996008",
"0.6996008",
"0.69838244",
"0.6962868",
"0.69557136",
"0.6792893",
"0.6722649",
"0.6722649",
"0.67055225",
"0.6634348",
"0.66155684",
"0.66025186",
"0.65892464",
"0.65892464",
"0.65613... | 0.6566435 | 20 |
Baseline implementation for the get_key_string REST call | def get_key_string request_pb, options = nil
raise ::ArgumentError, "request must be provided" if request_pb.nil?
verb, uri, query_string_params, body = ServiceStub.transcode_get_key_string_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
response = @client_stub.make_http_request(
verb,
uri: uri,
body: body || "",
params: query_string_params,
options: options
)
operation = ::Gapic::Rest::TransportOperation.new response
result = ::Google::Cloud::ApiKeys::V2::GetKeyStringResponse.decode_json response.body, ignore_unknown_fields: true
yield result, operation if block_given?
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_key; end",
"def get key\n deserialize backend.get key.to_s rescue nil\n end",
"def get_key\n @key = Base64.decode64('MzRlZTc5ODMtNWVlNi00MTQ3LWFhODYtNDQzZWEwNjJhYmY3NzQ0OTNkNmEtMmExNS00M2ZlLWFhY2UtZTc4NTY2OTI3NTg1Cg==')\n end",
"def get_string(key)\n get(key, \"Z\")\n end... | [
"0.7093624",
"0.7082691",
"0.6769653",
"0.6748592",
"0.6727894",
"0.66023505",
"0.6530545",
"0.6530545",
"0.6530545",
"0.6530545",
"0.64998245",
"0.64623576",
"0.64623576",
"0.64169073",
"0.6408617",
"0.6402467",
"0.63913095",
"0.6340987",
"0.6324807",
"0.61858845",
"0.618588... | 0.7039255 | 2 |
Baseline implementation for the update_key REST call | def update_key request_pb, options = nil
raise ::ArgumentError, "request must be provided" if request_pb.nil?
verb, uri, query_string_params, body = ServiceStub.transcode_update_key_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
response = @client_stub.make_http_request(
verb,
uri: uri,
body: body || "",
params: query_string_params,
options: options
)
operation = ::Gapic::Rest::TransportOperation.new response
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
yield result, operation if block_given?
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n if @key.update(key_params)\n render json: @key\n else\n render json: @key.errors, status: :unprocessable_entity\n end\n end",
"def updateKey; @key = getKey; self end",
"def update_api_key(key, object, validity = 0, max_queries_per_IP_per_hour = 0, max_hits_per_query = 0, reques... | [
"0.76675504",
"0.71778816",
"0.7003309",
"0.6969527",
"0.6969527",
"0.68130964",
"0.68130964",
"0.6795549",
"0.6794577",
"0.6681087",
"0.6674505",
"0.66045064",
"0.6604101",
"0.65967727",
"0.6537719",
"0.6537719",
"0.6534261",
"0.65107834",
"0.64263153",
"0.64200014",
"0.6416... | 0.66784555 | 10 |
Baseline implementation for the delete_key REST call | def delete_key request_pb, options = nil
raise ::ArgumentError, "request must be provided" if request_pb.nil?
verb, uri, query_string_params, body = ServiceStub.transcode_delete_key_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
response = @client_stub.make_http_request(
verb,
uri: uri,
body: body || "",
params: query_string_params,
options: options
)
operation = ::Gapic::Rest::TransportOperation.new response
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
yield result, operation if block_given?
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete(key)\n\n end",
"def delete(key); end",
"def delete(key); end",
"def delete(key); end",
"def delete(key); end",
"def delete(key); end",
"def delete(key)\n\n # FIXME: insert code that connects to the backend and affects the delete\n # operation\n #\n # - This delete should be do... | [
"0.8014617",
"0.7988768",
"0.7988768",
"0.7988768",
"0.7988768",
"0.7988768",
"0.7962858",
"0.7869068",
"0.7737101",
"0.7631669",
"0.75352776",
"0.7505428",
"0.7446105",
"0.7427333",
"0.7386164",
"0.7344475",
"0.73205966",
"0.73176503",
"0.73176503",
"0.7220733",
"0.7158567",... | 0.7176991 | 20 |
Baseline implementation for the undelete_key REST call | def undelete_key request_pb, options = nil
raise ::ArgumentError, "request must be provided" if request_pb.nil?
verb, uri, query_string_params, body = ServiceStub.transcode_undelete_key_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
response = @client_stub.make_http_request(
verb,
uri: uri,
body: body || "",
params: query_string_params,
options: options
)
operation = ::Gapic::Rest::TransportOperation.new response
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
yield result, operation if block_given?
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete(key); end",
"def delete(key); end",
"def delete(key); end",
"def delete(key); end",
"def delete(key); end",
"def delete(key)\n\n end",
"def delete_key(key)\n end",
"def delete(key)\n\n # FIXME: insert code that connects to the backend and affects the delete\n # operation\n #... | [
"0.77967966",
"0.77967966",
"0.77967966",
"0.77967966",
"0.77967966",
"0.7627837",
"0.7572723",
"0.7348627",
"0.7312151",
"0.7312151",
"0.7181863",
"0.71785414",
"0.70550466",
"0.701108",
"0.7002518",
"0.6995907",
"0.69826263",
"0.69750285",
"0.69728637",
"0.6946595",
"0.6923... | 0.71861434 | 10 |
Baseline implementation for the lookup_key REST call | def lookup_key request_pb, options = nil
raise ::ArgumentError, "request must be provided" if request_pb.nil?
verb, uri, query_string_params, body = ServiceStub.transcode_lookup_key_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
response = @client_stub.make_http_request(
verb,
uri: uri,
body: body || "",
params: query_string_params,
options: options
)
operation = ::Gapic::Rest::TransportOperation.new response
result = ::Google::Cloud::ApiKeys::V2::LookupKeyResponse.decode_json response.body, ignore_unknown_fields: true
yield result, operation if block_given?
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get key; call key; end",
"def lookup(key, default = nil, scope = self.scope, *rest)\n super(key.to_s, default, scope, *rest)\n end",
"def call(*lookup)\n\t\treturn KeyDialler.new(self, *lookup).call\n\tend",
"def read_key; end",
"def fetch(key); end",
"def get(key); end",
"def ge... | [
"0.6546326",
"0.6472137",
"0.6396615",
"0.63936687",
"0.63746697",
"0.6352024",
"0.6352024",
"0.6352024",
"0.6352024",
"0.6268048",
"0.624711",
"0.62316066",
"0.6192676",
"0.6159614",
"0.60935336",
"0.60515475",
"0.60190237",
"0.60181105",
"0.6000183",
"0.6000183",
"0.5991577... | 0.6703524 | 0 |
TODO: community likely broken/intercept somewhere attr_accessor :project_id | def initialize(query_params)
super
@identifier = params[:identifier]
@identifier_id = params[:identifier_id]
@identifier_object_id = params[:identifier_object_id]
@identifier_object_type = params[:identifier_object_type]
@namespace_id = params[:namespace_id]
@namespace_name = params[:namespace_name]
@namespace_short_name = params[:namespace_short_name]
@query_string = params[:query_string]
@type = params[:type]
set_polymorphic_params(params)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def project_id\n return self.project_id\n end",
"def project_id\n return @project_id\n end",
"def project_id\n @attributes[:project_id]\n end",
"def project_id\n data[:project_id]\n end",
"def project_id=(value)\n @project_id = value\n ... | [
"0.8056241",
"0.77229357",
"0.76425046",
"0.76093507",
"0.7459484",
"0.7350209",
"0.73492146",
"0.73005956",
"0.73005956",
"0.73005956",
"0.713561",
"0.705246",
"0.6976593",
"0.6975602",
"0.6919201",
"0.68749994",
"0.68749994",
"0.68688536",
"0.6867173",
"0.68626094",
"0.6862... | 0.0 | -1 |
Ommits non community klasses of identifiers | def community_project_id_facet
return nil if project_id.nil?
if !ignores_project?
# Not a community class
return table[:project_id].eq_any(project_id)
else
# Is a community class
# Identifiers that are not local only
return table[:type].matches('Identifier::Global%').or(table[:project_id].eq_any(project_id))
end
nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_not_avid!\n namespace.__avid_instances__.delete_if { |i| i.object_id == object_id }\n end",
"def may_oids( *additional_object_classes )\n\t\treturn self.object_classes( *additional_object_classes ).\n\t\t\tcollect {|oc| oc.may_oids }.flatten.uniq\n\tend",
"def known_identities; end",
"def ignore... | [
"0.5775109",
"0.57277936",
"0.5709027",
"0.5580644",
"0.5548519",
"0.5389191",
"0.5312951",
"0.52845967",
"0.52838075",
"0.52640694",
"0.5251001",
"0.5247814",
"0.5226076",
"0.51938736",
"0.51853824",
"0.5144595",
"0.51298666",
"0.51028633",
"0.5095873",
"0.5052084",
"0.50516... | 0.0 | -1 |
GET /pay_sheets/1 GET /pay_sheets/1.json | def show
@pay_sheet = PaySheet.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @pay_sheet }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @sheets = Sheet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sheets }\n end\n end",
"def index\n @sheets = Sheet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @s... | [
"0.7063383",
"0.6895002",
"0.6657758",
"0.6612493",
"0.6533759",
"0.6449417",
"0.64355266",
"0.63641506",
"0.63545895",
"0.6239959",
"0.6230824",
"0.62074864",
"0.62050134",
"0.61531496",
"0.6152464",
"0.6143228",
"0.60718477",
"0.6029846",
"0.6024194",
"0.5983621",
"0.597553... | 0.7328948 | 0 |
GET /pay_sheets/new GET /pay_sheets/new.json | def new
@pay_sheet = PaySheet.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @pay_sheet }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @sheet = Sheet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sheet }\n end\n end",
"def create\n @pay_sheet = PaySheet.new(params[:pay_sheet])\n\n respond_to do |format|\n if @pay_sheet.save\n format.html { redirect_to @p... | [
"0.7353917",
"0.7342184",
"0.72698474",
"0.71953523",
"0.7147237",
"0.71159446",
"0.6765168",
"0.67176473",
"0.6708214",
"0.65734726",
"0.64667475",
"0.6464562",
"0.6417413",
"0.63485193",
"0.63483185",
"0.634003",
"0.63247013",
"0.6320562",
"0.6307085",
"0.6303779",
"0.62888... | 0.7747668 | 0 |
POST /pay_sheets POST /pay_sheets.json | def create
@pay_sheet = PaySheet.new(params[:pay_sheet])
respond_to do |format|
if @pay_sheet.save
format.html { redirect_to @pay_sheet, notice: 'Pay sheet was successfully created.' }
format.json { render json: @pay_sheet, status: :created, location: @pay_sheet }
else
format.html { render action: "new" }
format.json { render json: @pay_sheet.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n puts \"within create method of wells_fargo_srp_sheets with params: #{wells_fargo_srp_sheet_params.inspect}\"\n @wells_fargo_srp_sheet = WellsFargoSrpSheet.new(wells_fargo_srp_sheet_params)\n\n respond_to do |format|\n puts \"the format is:#{format}\"\n puts 'about to save'\n be... | [
"0.6509839",
"0.6301213",
"0.6285071",
"0.6153764",
"0.6076214",
"0.60703444",
"0.6037325",
"0.59957623",
"0.5994401",
"0.5979115",
"0.59473366",
"0.5926526",
"0.5912474",
"0.58979225",
"0.58831495",
"0.58449405",
"0.58421516",
"0.5841846",
"0.5831185",
"0.58113205",
"0.58087... | 0.72675204 | 0 |
PUT /pay_sheets/1 PUT /pay_sheets/1.json | def update
@pay_sheet = PaySheet.find(params[:id])
respond_to do |format|
if @pay_sheet.update_attributes(params[:pay_sheet])
format.html { redirect_to @pay_sheet, notice: 'Pay sheet was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @pay_sheet.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @sheets = Sheet.find(params[:id])\n\n respond_to do |format|\n if @sheets.update_attributes(params[:sheet])\n format.html { redirect_to @sheets, notice: 'Sheet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"e... | [
"0.6856237",
"0.6567858",
"0.6399883",
"0.63913393",
"0.6369669",
"0.62662077",
"0.6183922",
"0.6179916",
"0.6179028",
"0.6153955",
"0.61170065",
"0.60958517",
"0.6075929",
"0.60519844",
"0.60519844",
"0.60013366",
"0.59961617",
"0.5979133",
"0.59645545",
"0.5952935",
"0.5929... | 0.7040261 | 0 |
DELETE /pay_sheets/1 DELETE /pay_sheets/1.json | def destroy
@pay_sheet = PaySheet.find(params[:id])
@pay_sheet.destroy
respond_to do |format|
format.html { redirect_to pay_sheets_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @sheets = Sheet.find(params[:id])\n @sheets.destroy\n\n respond_to do |format|\n format.html { redirect_to sheets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sheet = Sheet.find(params[:id])\n @sheet.destroy\n\n respond_to do |format|\n ... | [
"0.7377137",
"0.71878284",
"0.71878284",
"0.7148257",
"0.7125061",
"0.6988436",
"0.6948734",
"0.69186276",
"0.68906724",
"0.6805282",
"0.6790551",
"0.67880386",
"0.67657673",
"0.6751272",
"0.6748502",
"0.67371655",
"0.67316645",
"0.67291456",
"0.6716268",
"0.6701326",
"0.6680... | 0.78202534 | 0 |
GET /frameworks GET /frameworks.json | def index
@frameworks = Framework.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_frameworks\n response = @conn.get do |req|\n req.url \"/api/v1/frameworks\"\n req.headers = rest_headers\n end\n\n @frameworks = json(response.body)[:frameworks]\n end",
"def list\n\t\t\t# Fetch frameworks\n\t\t\tframeworks = DB[:framework].select(:id, :name).all\n\t\t\tf... | [
"0.83397406",
"0.67504704",
"0.61146414",
"0.5809448",
"0.57699674",
"0.57699674",
"0.57699674",
"0.57638556",
"0.5626536",
"0.56222326",
"0.5581115",
"0.5578572",
"0.55593866",
"0.54728407",
"0.5458752",
"0.5438419",
"0.53514034",
"0.534677",
"0.5342933",
"0.53349936",
"0.52... | 0.7163854 | 1 |
GET /frameworks/1 GET /frameworks/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_frameworks\n response = @conn.get do |req|\n req.url \"/api/v1/frameworks\"\n req.headers = rest_headers\n end\n\n @frameworks = json(response.body)[:frameworks]\n end",
"def index\n @frameworks = Framework.all\n end",
"def list\n\t\t\t# Fetch frameworks\n\t\t\tfram... | [
"0.78727216",
"0.6939893",
"0.63226026",
"0.5864715",
"0.5667227",
"0.5656091",
"0.5656091",
"0.5656091",
"0.5647983",
"0.56063104",
"0.55273134",
"0.54900426",
"0.54827857",
"0.5427317",
"0.5414275",
"0.5414275",
"0.540317",
"0.53783494",
"0.53168666",
"0.5311845",
"0.530379... | 0.0 | -1 |
POST /frameworks POST /frameworks.json | def create
@framework = Framework.new(framework_params)
respond_to do |format|
if @framework.save
format.html { redirect_to @framework, notice: 'Framework was successfully created.' }
format.json { render action: 'show', status: :created, location: @framework }
else
format.html { render action: 'new' }
format.json { render json: @framework.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_frameworks\n response = @conn.get do |req|\n req.url \"/api/v1/frameworks\"\n req.headers = rest_headers\n end\n\n @frameworks = json(response.body)[:frameworks]\n end",
"def add_frameworks_bundles\n UI.message '- Adding frameworks' do\n add_file_a... | [
"0.70571333",
"0.58896685",
"0.5734016",
"0.5684084",
"0.56002593",
"0.5572412",
"0.5571628",
"0.54351795",
"0.532633",
"0.5269566",
"0.5230842",
"0.52141887",
"0.5166501",
"0.5151251",
"0.5139352",
"0.5139222",
"0.51146764",
"0.5074005",
"0.50492144",
"0.5045919",
"0.5038973... | 0.66559833 | 1 |
PATCH/PUT /frameworks/1 PATCH/PUT /frameworks/1.json | def update
respond_to do |format|
if @framework.update(framework_params)
format.html { redirect_to @framework, notice: 'Framework was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { render json: @framework.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"def patch!\n request! :patch\n end",
"def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\... | [
"0.6365352",
"0.6268525",
"0.6197378",
"0.61259145",
"0.60005903",
"0.5999445",
"0.5917484",
"0.59137917",
"0.5912796",
"0.5912176",
"0.5902896",
"0.5902896",
"0.5890259",
"0.58786154",
"0.58150613",
"0.5797413",
"0.57615834",
"0.5729055",
"0.572329",
"0.571471",
"0.57141227"... | 0.64122117 | 0 |
DELETE /frameworks/1 DELETE /frameworks/1.json | def destroy
@framework.destroy
respond_to do |format|
format.html { redirect_to frameworks_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n ... | [
"0.6656376",
"0.6572454",
"0.6572454",
"0.6572454",
"0.6572454",
"0.6535321",
"0.64654803",
"0.6452158",
"0.64482194",
"0.6399862",
"0.6362757",
"0.6308856",
"0.6292127",
"0.6290505",
"0.62798315",
"0.6265432",
"0.6257931",
"0.62365925",
"0.6230247",
"0.62238646",
"0.6222791"... | 0.75233215 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_framework
@framework = Framework.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.6165094",
"0.60450804",
"0.5944413",
"0.5915806",
"0.58885634",
"0.5835225",
"0.5775847",
"0.5700531",
"0.5700531",
"0.56543404",
"0.56209993",
"0.54238355",
"0.5410386",
"0.5410386",
"0.5410386",
"0.5394892",
"0.5377769",
"0.53559244",
"0.5339896",
"0.53388095",
"0.533008... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def framework_params
params.require(:framework).permit(:name, :logo, :url)
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 |
Instantiates a new workbookChartDataLabels and sets the default values. | def initialize()
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def labels=(v) DataTypeValidator.validate \"Series.labels\", [AxDataSource], v; @labels = v; end",
"def labels=(v) DataTypeValidator.validate \"Series.labels\", [AxDataSource], v; @labels = v; end",
"def data_labels=(value)\n @data_labels = value\n end",
"def initialize(chart, optio... | [
"0.6460214",
"0.6460214",
"0.61246526",
"0.6076595",
"0.5973059",
"0.59460026",
"0.58411115",
"0.5833759",
"0.5806798",
"0.5673398",
"0.5563956",
"0.55588263",
"0.5408022",
"0.53693116",
"0.535008",
"0.53291667",
"0.53291667",
"0.52816886",
"0.5230897",
"0.52293545",
"0.52241... | 0.0 | -1 |
Gets the format property value. Represents the format of chart data labels, which includes fill and font formatting. Readonly. | def format
return @format
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def format\n lookup_val = Integer(@rf['format'])\n @_format ||= format_proxy.lookup_format_name(lookup_val)\n rescue\n @rf['format']\n end",
"def format\n @format ||= self._format_default\n end",
"def display_format\n value = self.format_str ||\n I18n.t(self.f... | [
"0.65302616",
"0.6486068",
"0.64559644",
"0.6245331",
"0.6245331",
"0.6245331",
"0.619998",
"0.6100606",
"0.60893065",
"0.6045753",
"0.60360676",
"0.6021869",
"0.602003",
"0.6006919",
"0.5985614",
"0.5878893",
"0.5869609",
"0.58558077",
"0.5855078",
"0.57945347",
"0.57338554"... | 0.652947 | 3 |
Sets the format property value. Represents the format of chart data labels, which includes fill and font formatting. Readonly. | def format=(value)
@format = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def format=(value)\n\t\t\t@format = value\n\t\tend",
"def dataFormat=(format)\n @dataFormat = format\n\n setOption('dataFormat', @dataFormat)\n end",
"def format=(format)\n use_format(format)\n end",
"def format=(format)\n format = format.to_sym\n raise _(\"unsupp... | [
"0.69108236",
"0.68507075",
"0.6805783",
"0.6642227",
"0.663438",
"0.663438",
"0.6496778",
"0.63150644",
"0.6160129",
"0.6148418",
"0.60949695",
"0.59655726",
"0.5961827",
"0.58785886",
"0.58717775",
"0.5861698",
"0.5771625",
"0.5770939",
"0.575313",
"0.5714048",
"0.56655216"... | 0.70241416 | 2 |
The deserialization information for the current model | def get_field_deserializers()
return super.merge({
"format" => lambda {|n| @format = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::WorkbookChartDataLabelFormat.create_from_discriminator_value(pn) }) },
"position" => lambda {|n| @position = n.get_string_value() },
"separator" => lambda {|n| @separator = n.get_string_value() },
"showBubbleSize" => lambda {|n| @show_bubble_size = n.get_boolean_value() },
"showCategoryName" => lambda {|n| @show_category_name = n.get_boolean_value() },
"showLegendKey" => lambda {|n| @show_legend_key = n.get_boolean_value() },
"showPercentage" => lambda {|n| @show_percentage = n.get_boolean_value() },
"showSeriesName" => lambda {|n| @show_series_name = n.get_boolean_value() },
"showValue" => lambda {|n| @show_value = n.get_boolean_value() },
})
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deserialized\n @deserialized ||= @serializer.deserialize @serialized_object\n end",
"def get_field_deserializers()\n return super.merge({\n \"detectionStatus\" => lambda {|n| @detection_status = n.get_enum_value(MicrosoftGraph::Models::SecurityDetectionStatus) },... | [
"0.6510734",
"0.63224316",
"0.6322254",
"0.63094735",
"0.62954384",
"0.6238735",
"0.6232461",
"0.62155676",
"0.6200175",
"0.6199403",
"0.6173917",
"0.61733985",
"0.61705345",
"0.61631054",
"0.61620396",
"0.6158031",
"0.6156071",
"0.6142402",
"0.613998",
"0.6138061",
"0.612005... | 0.60210633 | 39 |
Gets the position property value. DataLabelPosition value that represents the position of the data label. The possible values are: None, Center, InsideEnd, InsideBase, OutsideEnd, Left, Right, Top, Bottom, BestFit, Callout. | def position
return @position
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def d_position\n Vedeu::Point.coerce(value: position, min: bd, max: bdn).value\n end",
"def position\n attributes.fetch(:position)\n end",
"def position_label\n $log.debug \"XXX: LABEL row #{@label.row}, #{@label.col} \"\n @label.row @row unless @label.row #if @label.row ... | [
"0.67044395",
"0.6304619",
"0.621281",
"0.61790746",
"0.60881335",
"0.6033884",
"0.6033884",
"0.6030801",
"0.6016871",
"0.5979211",
"0.5979211",
"0.59591085",
"0.5946832",
"0.592884",
"0.5776855",
"0.5752416",
"0.5692062",
"0.5675366",
"0.5615181",
"0.55615616",
"0.55265653",... | 0.6297578 | 3 |
Sets the position property value. DataLabelPosition value that represents the position of the data label. The possible values are: None, Center, InsideEnd, InsideBase, OutsideEnd, Left, Right, Top, Bottom, BestFit, Callout. | def position=(value)
@position = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def position=(value)\n @position = @attributes[:position] = Vedeu::Geometry::Position\n .coerce(value)\n end",
"def position=(value)\n @position = @attributes[:position] = Vedeu::Geometry::Position\n .coerc... | [
"0.65359616",
"0.65359616",
"0.6242202",
"0.6093999",
"0.6003436",
"0.5855577",
"0.57968014",
"0.5781105",
"0.573847",
"0.5709093",
"0.567621",
"0.56722766",
"0.5666978",
"0.56274396",
"0.555697",
"0.5535295",
"0.5528727",
"0.54217255",
"0.54043865",
"0.53604156",
"0.5328046"... | 0.64869493 | 3 |
Gets the separator property value. String representing the separator used for the data labels on a chart. | def separator
return @separator
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def separator=(value)\n @separator = value\n end",
"def separator\n \":\"\n end",
"def separator\n ','\n end",
"def separator\n nil\n end",
"def default_separator; end",
"def extract_separator\n if meta_tags[:separator] == false\n # Special case: ... | [
"0.752343",
"0.7200015",
"0.7160168",
"0.6726927",
"0.6696178",
"0.66665965",
"0.6567691",
"0.6542692",
"0.6488182",
"0.64860255",
"0.6466084",
"0.6466084",
"0.64606494",
"0.6448342",
"0.6448342",
"0.64333373",
"0.642013",
"0.6411723",
"0.63399047",
"0.6332667",
"0.6316795",
... | 0.79012936 | 0 |
Sets the separator property value. String representing the separator used for the data labels on a chart. | def separator=(value)
@separator = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def default_separator=(separator); end",
"def path_sep=(val)\n Vitals::Utils.path_sep = val\n end",
"def separator\n return @separator\n end",
"def separator\n \":\"\n end",
"def separator\n @parts.push(separator: true)\n end",
"def separator\n ','\n... | [
"0.72532237",
"0.68591356",
"0.68522865",
"0.67342037",
"0.6499096",
"0.64925337",
"0.63295436",
"0.6106739",
"0.6104424",
"0.60271245",
"0.601333",
"0.59630024",
"0.5947344",
"0.59097993",
"0.58913636",
"0.58337945",
"0.5819043",
"0.5795404",
"0.5791751",
"0.5791748",
"0.578... | 0.8452732 | 0 |
Serializes information the current object | def serialize(writer)
raise StandardError, 'writer cannot be null' if writer.nil?
super
writer.write_object_value("format", @format)
writer.write_string_value("position", @position)
writer.write_string_value("separator", @separator)
writer.write_boolean_value("showBubbleSize", @show_bubble_size)
writer.write_boolean_value("showCategoryName", @show_category_name)
writer.write_boolean_value("showLegendKey", @show_legend_key)
writer.write_boolean_value("showPercentage", @show_percentage)
writer.write_boolean_value("showSeriesName", @show_series_name)
writer.write_boolean_value("showValue", @show_value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def serialize\n end",
"def serialize(object) end",
"def serialize; end",
"def serialize; end",
"def serialize\n \n end",
"def serialize\n raise NotImplementedError\n end",
"def serialize\n raise NotImplementedError\n end",
"def dump\r\n super + to_s\r\n end",
... | [
"0.7951372",
"0.7645999",
"0.7579812",
"0.7579812",
"0.7440032",
"0.720861",
"0.720861",
"0.7207583",
"0.7016516",
"0.70007193",
"0.6992252",
"0.69838214",
"0.69723576",
"0.69666415",
"0.69666415",
"0.6942002",
"0.69417155",
"0.6933786",
"0.6913977",
"0.6891677",
"0.68810964"... | 0.0 | -1 |
Gets the showBubbleSize property value. Boolean value representing if the data label bubble size is visible or not. | def show_bubble_size
return @show_bubble_size
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_bubble_size=(value)\n @show_bubble_size = value\n end",
"def summarizable?\n size < MAX_SIZE\n end",
"def bubbles?\n false\n end",
"def plot_summary_size?\n make_plot = false\n @groups.each do |g|\n if g.has_overall_sample_size?\n m... | [
"0.75986904",
"0.53810304",
"0.52914464",
"0.5270062",
"0.5255781",
"0.50073296",
"0.4905998",
"0.4902146",
"0.4902146",
"0.4858836",
"0.48177236",
"0.47245052",
"0.4707294",
"0.4695483",
"0.46853372",
"0.46659616",
"0.4663918",
"0.4663918",
"0.4624812",
"0.46209398",
"0.4618... | 0.7968096 | 0 |
Sets the showBubbleSize property value. Boolean value representing if the data label bubble size is visible or not. | def show_bubble_size=(value)
@show_bubble_size = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_bubble_size\n return @show_bubble_size\n end",
"def bubble_size_representation=(bubble_size_representation)\n validator = EnumAttributeValidator.new('String', ['Area', 'Width'])\n unless validator.valid?(bubble_size_representation)\n fail ArgumentError, 'invali... | [
"0.70414984",
"0.542406",
"0.52449375",
"0.49857947",
"0.49831918",
"0.4830306",
"0.4777298",
"0.4749903",
"0.47415152",
"0.47415152",
"0.47203395",
"0.46066663",
"0.4586004",
"0.4586004",
"0.45817074",
"0.4565911",
"0.45553422",
"0.45384705",
"0.45214403",
"0.4517027",
"0.45... | 0.8043671 | 0 |
Gets the showCategoryName property value. Boolean value representing if the data label category name is visible or not. | def show_category_name
return @show_category_name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_category_name=(value)\n @show_category_name = value\n end",
"def categoryname\n\t\t\tcategory.category_name\n\t\tend",
"def category_name\n category.name\n end",
"def category_name \n self.category ? self.category.name : nil\n end",
"def category_nam... | [
"0.72835624",
"0.624566",
"0.6225877",
"0.6058585",
"0.58677024",
"0.57922345",
"0.5786205",
"0.57728416",
"0.5731866",
"0.5598026",
"0.5534175",
"0.55014664",
"0.5486977",
"0.5486752",
"0.5456758",
"0.5452826",
"0.53423053",
"0.53249025",
"0.5301605",
"0.5268666",
"0.5263791... | 0.7269324 | 1 |
Sets the showCategoryName property value. Boolean value representing if the data label category name is visible or not. | def show_category_name=(value)
@show_category_name = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def category_name=(n)\n self.category = self.vendor.categories.visible.find_by_name(n)\n end",
"def show_series_name=(value)\n @show_series_name = value\n end",
"def show_category_name\n return @show_category_name\n end",
"def category_name=(name)\n ... | [
"0.5921667",
"0.5606586",
"0.5564095",
"0.54675657",
"0.54051995",
"0.5270686",
"0.5177791",
"0.50061935",
"0.4975329",
"0.4975329",
"0.4975329",
"0.4975329",
"0.4975329",
"0.4975329",
"0.4975329",
"0.4975329",
"0.4975329",
"0.4975329",
"0.4975329",
"0.4975329",
"0.4975329",
... | 0.7658091 | 0 |
Gets the showLegendKey property value. Boolean value representing if the data label legend key is visible or not. | def show_legend_key
return @show_legend_key
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_legend_key=(value)\n @show_legend_key = value\n end",
"def show_legend=(v) Axlsx::validate_boolean(v); @show_legend = v; end",
"def show_legend=(v) Axlsx.validate_boolean(v); @show_legend = v; end",
"def legend\n return @legend\n end",
"def get_l... | [
"0.77908957",
"0.60416293",
"0.5773607",
"0.5454945",
"0.53908294",
"0.5296538",
"0.52231425",
"0.5186959",
"0.5151919",
"0.50253546",
"0.5011315",
"0.49909458",
"0.49897897",
"0.49804315",
"0.49423274",
"0.49189544",
"0.4910908",
"0.48542005",
"0.48098913",
"0.4798479",
"0.4... | 0.83740395 | 0 |
Sets the showLegendKey property value. Boolean value representing if the data label legend key is visible or not. | def show_legend_key=(value)
@show_legend_key = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_legend_key\n return @show_legend_key\n end",
"def show_legend=(v) Axlsx::validate_boolean(v); @show_legend = v; end",
"def show_legend=(v) Axlsx.validate_boolean(v); @show_legend = v; end",
"def legend=(value)\n @legend = value\n end",
"def draw_... | [
"0.76392955",
"0.63853323",
"0.5996325",
"0.5340178",
"0.53129244",
"0.4981195",
"0.47600526",
"0.4694935",
"0.46700335",
"0.4653422",
"0.46205464",
"0.46011838",
"0.45732245",
"0.4530997",
"0.45156354",
"0.45149136",
"0.44846877",
"0.44623527",
"0.44491997",
"0.44084188",
"0... | 0.8171461 | 0 |
Gets the showPercentage property value. Boolean value representing if the data label percentage is visible or not. | def show_percentage
return @show_percentage
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_percentage=(value)\n @show_percentage = value\n end",
"def show_perc?\n @perc\n end",
"def visible\n return @bar.visible\n end",
"def show_value\n return @show_value\n end",
"def meter_text_is_visible?(value_text, percent)\n unless... | [
"0.72049344",
"0.6944237",
"0.5560396",
"0.54805744",
"0.5336479",
"0.5171991",
"0.5095745",
"0.5087132",
"0.50854",
"0.50854",
"0.5071439",
"0.50432765",
"0.5003592",
"0.49847364",
"0.49844158",
"0.49774486",
"0.49744076",
"0.49534866",
"0.49308968",
"0.49308968",
"0.4904561... | 0.76301044 | 0 |
Sets the showPercentage property value. Boolean value representing if the data label percentage is visible or not. | def show_percentage=(value)
@show_percentage = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_percentage\n return @show_percentage\n end",
"def visible=(visible)\n @visible = visible\n @cLabel.visible = visible\n @cValue.visible = visible\n end",
"def visible=(visible)\n @visible = visible\n @cLabelNumber.visible = visible\n end",
"def show_perc?\n ... | [
"0.6265136",
"0.550456",
"0.54371405",
"0.54080516",
"0.531407",
"0.5277591",
"0.52532005",
"0.5252286",
"0.52503854",
"0.507887",
"0.4948544",
"0.49469608",
"0.49159333",
"0.48933813",
"0.48822427",
"0.48421496",
"0.48214033",
"0.48059076",
"0.4691809",
"0.46826842",
"0.4670... | 0.75889695 | 0 |
Gets the showSeriesName property value. Boolean value representing if the data label series name is visible or not. | def show_series_name
return @show_series_name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_series_name=(value)\n @show_series_name = value\n end",
"def series_name\n series ? series.name : \"\"\n end",
"def has_series?(series_name)\n @series[series_name.to_sym] != nil rescue false\n end",
"def hidden_name?\n @hidden_name\n end",
"def dis... | [
"0.75677544",
"0.6502115",
"0.57209706",
"0.5627077",
"0.5598897",
"0.55875194",
"0.5491283",
"0.53626627",
"0.5352527",
"0.53165644",
"0.5227299",
"0.52224404",
"0.521777",
"0.51691514",
"0.5141172",
"0.5032281",
"0.5017217",
"0.5017217",
"0.5017217",
"0.5017217",
"0.5017217... | 0.76030177 | 0 |
Sets the showSeriesName property value. Boolean value representing if the data label series name is visible or not. | def show_series_name=(value)
@show_series_name = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_series_name\n return @show_series_name\n end",
"def show_category_name=(value)\n @show_category_name = value\n end",
"def series_name\n series ? series.name : \"\"\n end",
"def series_with_name(series_name)\n @series[series_name.to_sym] if... | [
"0.64381903",
"0.5583942",
"0.535048",
"0.5242238",
"0.51655483",
"0.51655483",
"0.51655483",
"0.51655483",
"0.51655483",
"0.51655483",
"0.51655483",
"0.51655483",
"0.51655483",
"0.51655483",
"0.51655483",
"0.51655483",
"0.51655483",
"0.51655483",
"0.51655483",
"0.51655483",
... | 0.7986476 | 0 |
Gets the showValue property value. Boolean value representing if the data label value is visible or not. | def show_value
return @show_value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_value=(value)\n @show_value = value\n end",
"def hidden_value?\n @hidden_value\n end",
"def visible(value = true)\n model.visible = Vedeu::Boolean.coerce(value)\n end",
"def visible?\n !value.nil?\n end",
"def show_value_label_method\n ... | [
"0.72154427",
"0.6685723",
"0.6557192",
"0.6513308",
"0.6354617",
"0.62340575",
"0.6187715",
"0.61440355",
"0.61259836",
"0.6064201",
"0.6013301",
"0.59490484",
"0.59198934",
"0.576382",
"0.57422364",
"0.57422364",
"0.574177",
"0.5688096",
"0.5687772",
"0.5597607",
"0.5594733... | 0.7647634 | 0 |
Sets the showValue property value. Boolean value representing if the data label value is visible or not. | def show_value=(value)
@show_value = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def visible(value = true)\n model.visible = Vedeu::Boolean.coerce(value)\n end",
"def set_show(val)\n self.show = val\n self\n end",
"def visible(value = true)\n boolean = value ? true : false\n\n model.visible = boolean\n end",
"def visible=(visible)\n @visible... | [
"0.67842686",
"0.6680315",
"0.6581951",
"0.6451919",
"0.62933546",
"0.6282092",
"0.6235323",
"0.6235323",
"0.6143881",
"0.59505683",
"0.5930278",
"0.5916584",
"0.5865901",
"0.57723117",
"0.5766938",
"0.5762578",
"0.57205606",
"0.5698666",
"0.56918675",
"0.56462777",
"0.564627... | 0.78776187 | 0 |
def authenticated?(remember_token) retrun false if remember_digest.nil? BCrypt::Password.new(remember_digest).is_password?(remember_token) end | def authenticated?(attribute, token)
digest = send("#{attribute}_digest")
return false if digest.nil?
BCrypt::Password.new(digest).is_password?(token)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def authenticated?(remember_token)\n if remember_digest.nil?\n false\n else\n BCrypt::Password.new(remember_digest).is_password?(remember_token)\n end\n end",
"def authenticated?(remember_token)\n \treturn false if remember_digest.nil?\n BCrypt::Password.new(rememb... | [
"0.982208",
"0.9785212",
"0.9755769",
"0.97380525",
"0.97380525",
"0.97380525",
"0.97380525",
"0.9732875",
"0.9725774",
"0.97178334",
"0.9691171",
"0.967085",
"0.96579415",
"0.96579415",
"0.96579415",
"0.96579415",
"0.96579415",
"0.96579415",
"0.96579415",
"0.96579415",
"0.96... | 0.0 | -1 |
Initiates a task in the background to deploy AppScale on a virtualized cluster. Returns a 3element array as the result of the operation. The first element of the array is a boolean value indicating success or failure. In case of success, the second value will be the timestamp on which the task was launched. The third value will be the process ID of the newly launched task. In case of failure the second and third values will provide detailed error information. | def deploy_on_virtual_cluster(params, add_key_options, run_instances_options)
if lock
begin
timestamp = Time.now.to_i
pid = fork do
begin
redirect_standard_io(timestamp) do
key_file = File.expand_path("~/.appscale/#{params[:virtual_keyname]}")
if File.exists?(key_file)
puts "AppScale key '#{params[:virtual_keyname]}' found on the disk. Reusing..."
else
puts "AppScale key '#{params[:virtual_keyname]}' not found on the disk. Generating..."
AppScaleTools.add_keypair(add_key_options)
end
AppScaleTools.run_instances(run_instances_options)
end
ensure
# If the fork was successful, the sub-process should release the lock
unlock
end
end
Process.detach(pid)
return [true, timestamp, pid]
rescue Exception => e
# If something went wrong with the fork, release the lock immediately and return
unlock
return [false, "Unexpected Runtime Error", "Runtime error while executing" +
" appscale tools: #{e.message}"]
end
else
return [false, "Server Busy", "AppsCake is currently busy deploying a cloud." +
" Please try again later."]
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run\n ready_nodes = each_ready_task.to_a.join ', '\n info \"Starting the deployment process. Starting tasks: #{ready_nodes}\"\n hook 'internal_pre_run'\n hook 'pre_run'\n topology_sort\n result = loop do\n if all_nodes_are_successful?\n status = 'All nodes are depl... | [
"0.61884016",
"0.6096266",
"0.587826",
"0.5643394",
"0.5627717",
"0.5622643",
"0.5609771",
"0.5573505",
"0.5549728",
"0.5460113",
"0.5453355",
"0.54149723",
"0.5407608",
"0.5407608",
"0.5407608",
"0.53295535",
"0.5285565",
"0.52401394",
"0.523633",
"0.5153705",
"0.51205885",
... | 0.5309386 | 16 |
options [Hash] :repeated => [Integer] specify to create repeated cell :style_name => [String] specify to set style | def new_empty_x doc, options={}
if options.empty?
doc.ns_create_node 'table:table-cell'
else
attr_hash = {}
if style = options[:style_name]
attr_hash['table:style-name'] = style
end
if num = options[:repeated]
attr_hash['table:number-columns-repeated'] = num
end
doc.ns_create_node 'table:table-cell', nil, attr_hash
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cell_style(models, options={})\n [models].flatten.compact.each do |m|\n m.apply_styles(options)\n end \n end",
"def style=(style)\n cells.each_with_index do | cell, index |\n s = style.is_a?(Array) ? style[index] : style\n cell.style = s\n end\n ... | [
"0.6422558",
"0.62765557",
"0.61836743",
"0.60821956",
"0.60525686",
"0.5994792",
"0.58673203",
"0.5816666",
"0.5793524",
"0.57817996",
"0.57060796",
"0.56867105",
"0.56557477",
"0.56185234",
"0.5609461",
"0.5609301",
"0.5573724",
"0.557229",
"0.55709153",
"0.55649656",
"0.55... | 0.54658204 | 29 |
TODO: maybe, remove only valuetype and value removes all current attributes (except stylename) and content | def set_data data
@x_cell.each_attr do |a|
a.remove! unless a.name == 'style-name' # TODO: ns equality check
end
@x_cell.each &:remove!
@x_cell.ns_set_attr 'office:value-type', 'string'
@x_cell << @x_cell.doc.ns_create_node('text:p', data)
data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scrub_attributes(node)\n node.attribute_nodes.each do |attr_node|\n attr_name = if attr_node.namespace\n \"#{attr_node.namespace.prefix}:#{attr_node.node_name}\"\n else\n attr_node.node_name\n end\n\n if DATA_ATTRIBUTE_NAME.match?(a... | [
"0.6623001",
"0.6422552",
"0.624109",
"0.6114895",
"0.6100502",
"0.60715276",
"0.6057615",
"0.6034723",
"0.6034723",
"0.5967748",
"0.5967748",
"0.5967748",
"0.59321696",
"0.5897908",
"0.58820796",
"0.58795524",
"0.58305794",
"0.58305794",
"0.58305794",
"0.58305794",
"0.577316... | 0.5753264 | 24 |
cell must be 'repeated?' | def insert_split left_repeated, data
if left = try_create_empty_x(left_repeated)
@x_cell.prev = left
end
if right = try_create_empty_x(repeated? - left_repeated - 1)
@x_cell.next = right
end
set_data data # mutator
{
:left => self.class.new(@row, left),
:mid => self,
:right => self.class.new(@row, right)
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def only_one?\n counter = 0\n each_cell do |cell|\n counter += 1 if cell\n return false if counter >= 2\n end\n counter == 1\n end",
"def next_cell(row, col)\n col += 1\n if col > 8\n row += 1\n col = 0\n end\n\n if row > 8\n raise Inv... | [
"0.6221311",
"0.6219105",
"0.61424834",
"0.60743123",
"0.6068066",
"0.6041342",
"0.60409576",
"0.60409576",
"0.60409576",
"0.603894",
"0.60349166",
"0.6018302",
"0.6012331",
"0.5965725",
"0.58299863",
"0.5782835",
"0.57786435",
"0.5759221",
"0.575023",
"0.5745444",
"0.5736452... | 0.0 | -1 |
sha = Payload.generate_sha(params.values.join) payload = params['payload'] parser = ParamsParser.new(payload, sha) parser.parse | def payload(temp)
num = temp.values[0]
{
:url => "http://jumpstartlab.com/blog#{num}",
:requestedAt => "#{Time.new}",
:respondedIn => 37,
:referredBy => "http://jumpstartlab.com",
:requestType => "GET",
:eventName => "socialLogin",
:userAgent => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2)"\
"AppleWebKit/537.17 (KHTML, like Gecko)"\
"Chrome/24.0.1309.0 Safari/537.17",
:resolutionWidth => "1920",
:resolutionHeight => "1280",
:ip => "63.29.38.211"
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_signed_payload\n signed_payload = params[:signed_payload]\n message_parts = signed_payload.split('.')\n\n encoded_json_payload = message_parts[0]\n encoded_hmac_signature = message_parts[1]\n\n payload = Base64.decode64(encoded_json_payload)\n provided_signature = Base64.decode64(encoded_hmac_signa... | [
"0.62642086",
"0.6256669",
"0.6238185",
"0.618138",
"0.6165774",
"0.6122532",
"0.6022381",
"0.5985751",
"0.59602934",
"0.59516287",
"0.5892186",
"0.58888817",
"0.5887969",
"0.5887969",
"0.58760214",
"0.585217",
"0.5845889",
"0.58340186",
"0.5812414",
"0.5788968",
"0.57791615"... | 0.0 | -1 |
Public: Validates the columns and adds an :inclusion error if a column is not available. Returns the available columns as a Hash. | def validate_columns
columns.each do |name|
if !column_available?(name)
errors.add column_label_for(name), :inclusion
end
end if columns.present?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_columns!\n if columns.nil? || columns.empty?\n raise Error, 'cannot literalize HashRow without columns'\n end\n end",
"def required_columns\n (select + group_by + @required_columns).inject([]) do |columns, column|\n columns << required_columns_for(column)\n ... | [
"0.6310803",
"0.6285338",
"0.60684687",
"0.6039983",
"0.5904316",
"0.5831862",
"0.5819242",
"0.5796254",
"0.57598376",
"0.5707877",
"0.5700258",
"0.5687845",
"0.5679187",
"0.55991244",
"0.55705637",
"0.55579203",
"0.5540361",
"0.5538072",
"0.5502458",
"0.5488895",
"0.5482138"... | 0.78515434 | 0 |
Public: Validates the group_by attribute and adds an :inclusion error if the group_by column is not available. An :invalid error is added if the group_by column is not groupable per the column definition. Returns the available columns as a Hash. | def validate_group_by
if group_by.present?
if !column_available?(group_by)
errors.add column_label_for(group_by), :inclusion
elsif !groupable_for(group_by)
errors.add column_label_for(group_by), :invalid
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def groupable_columns\n available_columns.select {|c| c.groupable}\n end",
"def groupable_columns\n available_columns.select {|c| c.groupable}\n end",
"def group_by *groupings\n @dimensions.merge! paramerize(groupings, VALID_DIMENSIONS, 'Invalid dimension group')\n self\n end",
"def vali... | [
"0.6421324",
"0.6421324",
"0.5763545",
"0.5748526",
"0.5699918",
"0.56997764",
"0.5674117",
"0.557659",
"0.55715424",
"0.5509814",
"0.549188",
"0.54874563",
"0.54874563",
"0.51850235",
"0.51659167",
"0.51296663",
"0.50398934",
"0.5036295",
"0.49793312",
"0.49507445",
"0.49302... | 0.8330512 | 0 |
Public: Determines if a filter's values are blank. name The filter name as a Symbol. values Values to check for blankness or nil for current filter values. Returns a boolean indicating whether the filter's values are blank. | def values_blank?(name, values=nil)
values ||= values_for(name)
values.blank? || values.first.blank?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def blank?\n @values.blank?\n end",
"def blank?(value)\n value.nil? == false && value.empty? == false\n end",
"def empty?\n @values.values.all?(&:nil?)\n end",
"def blank?\n attributes.values.all?(&:blank?)\n end",
"def blank?\n attributes.values.a... | [
"0.6741816",
"0.65943766",
"0.6386172",
"0.63514876",
"0.63514876",
"0.63514876",
"0.63514876",
"0.630837",
"0.6297039",
"0.6283382",
"0.627015",
"0.62248284",
"0.62236834",
"0.62017465",
"0.614506",
"0.6086812",
"0.6067619",
"0.6059458",
"0.601907",
"0.6013158",
"0.60119843"... | 0.7664804 | 0 |
Public: Determines if a filter's values are allowed to be blank. name The filter name as a Symbol. Returns a boolean indicating whether blank filter values are allowed. | def blank_allowed?(name)
["!*", "*", "t", "w"].include? operator_for(name)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def values_blank?(name, values=nil)\n values ||= values_for(name)\n values.blank? || values.first.blank?\n end",
"def empty?\n name.blank?\n end",
"def blank?(value)\n value.nil? == false && value.empty? == false\n end",
"def empty_filter?(options)\n if options.include... | [
"0.6609911",
"0.6170212",
"0.61612636",
"0.6154209",
"0.5984233",
"0.5904682",
"0.5859385",
"0.5859385",
"0.5859385",
"0.5859385",
"0.58306885",
"0.5830198",
"0.58204836",
"0.58187705",
"0.57971615",
"0.57348734",
"0.5716873",
"0.5714374",
"0.5667887",
"0.5667887",
"0.5647718... | 0.73266405 | 0 |
Converts the instance to a quoted form if necessary See Xqsr3::StringUtilities::QuoteIf::quite_if() for options | def quote_if **options
QuoteIf_Helper_.string_quote_if_array_ self, options
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def quote(value)\n case value\n when NilClass then\n \"NULL\"\n when TrueClass then\n \"TRUE\"\n when FalseClass then\n \"FALSE\"\n when Float, Fixnum, Bignum then\n value.to_s\n # BigDecimals need to be output in a non-normalized form and quoted.\n when... | [
"0.6533191",
"0.64176506",
"0.6368806",
"0.63547444",
"0.6242206",
"0.6191384",
"0.6176007",
"0.6113138",
"0.6071006",
"0.6057657",
"0.60182685",
"0.6012227",
"0.5984089",
"0.5920792",
"0.58727926",
"0.5855059",
"0.5833598",
"0.5830784",
"0.5829718",
"0.5802963",
"0.5787715",... | 0.63328683 | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.