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
GET /selected_options_of_pcs/1 GET /selected_options_of_pcs/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @selected_options_of_pcs = SelectedOptionsOfPc.all\n end", "def set_selected_options_of_pc\n @selected_options_of_pc = SelectedOptionsOfPc.find(params[:id])\n end", "def create\n @selected_options_of_pc = SelectedOptionsOfPc.new(selected_options_of_pc_params)\n\n respond_to do |fo...
[ "0.7435328", "0.6666838", "0.6380703", "0.61800265", "0.6127224", "0.60366005", "0.5995853", "0.5980112", "0.5935203", "0.5926245", "0.5926245", "0.5799928", "0.576795", "0.5760802", "0.5760802", "0.5760802", "0.5760802", "0.5760802", "0.5746505", "0.56961095", "0.5674443", ...
0.0
-1
POST /selected_options_of_pcs POST /selected_options_of_pcs.json
def create @selected_options_of_pc = SelectedOptionsOfPc.new(selected_options_of_pc_params) respond_to do |format| if @selected_options_of_pc.save format.html { redirect_to @selected_options_of_pc, notice: 'Selected options of pc was successfully created.' } format.json { render action: '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_selected_options_of_pc\n @selected_options_of_pc = SelectedOptionsOfPc.find(params[:id])\n end", "def selected_options_of_pc_params\n params.require(:selected_options_of_pc).permit(:user_id, :description_of_pc_id, :price_range_id)\n end", "def index\n @selected_options_of_pcs = Selec...
[ "0.7187813", "0.6963285", "0.69236106", "0.6156858", "0.6103179", "0.59897006", "0.59897006", "0.5870357", "0.5551999", "0.54125583", "0.54087603", "0.53367937", "0.53361595", "0.528452", "0.52767736", "0.5262546", "0.51862943", "0.5155871", "0.51442593", "0.5137381", "0.5135...
0.7242565
0
PATCH/PUT /selected_options_of_pcs/1 PATCH/PUT /selected_options_of_pcs/1.json
def update respond_to do |format| if @selected_options_of_pc.update(selected_options_of_pc_params) format.html { redirect_to @selected_options_of_pc, notice: 'Selected options of pc was successfully updated.' } format.json { head :no_content } else format.html { render action: 'e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_selected_options_of_pc\n @selected_options_of_pc = SelectedOptionsOfPc.find(params[:id])\n end", "def update\n respond_to do |format|\n if @opt10080.update(opt10080_params)\n format.html { redirect_to @opt10080, notice: 'Opt10080 was successfully updated.' }\n format.json { ...
[ "0.64166933", "0.62043345", "0.60639155", "0.6045794", "0.5977183", "0.5977183", "0.5977183", "0.59718025", "0.59718025", "0.59545565", "0.5942974", "0.59381586", "0.5890736", "0.5876156", "0.58616114", "0.5859823", "0.584544", "0.5833602", "0.58146286", "0.5791888", "0.57856...
0.74423486
0
DELETE /selected_options_of_pcs/1 DELETE /selected_options_of_pcs/1.json
def destroy @selected_options_of_pc.destroy respond_to do |format| format.html { redirect_to selected_options_of_pcs_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_option\n option_param = params.permit(:id)\n\n render json: Option.delete_option(option_param)\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @item = option_model.find(params[:id])\n @item.destroy\...
[ "0.6682621", "0.6653192", "0.65735054", "0.65687984", "0.6566418", "0.6566418", "0.65653825", "0.65424633", "0.6510097", "0.6488301", "0.6479617", "0.6479617", "0.6479617", "0.6453159", "0.64488214", "0.6447199", "0.6435001", "0.6340713", "0.6333336", "0.6327563", "0.6326028"...
0.7953374
0
Use callbacks to share common setup or constraints between actions.
def set_selected_options_of_pc @selected_options_of_pc = SelectedOptionsOfPc.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.61642385", "0.60448", "0.5945487", "0.5915654", "0.58890367", "0.58330417", "0.5776098", "0.5703048", "0.5703048", "0.5654613", "0.5620029", "0.5423114", "0.540998", "0.540998", "0.540998", "0.5393666", "0.53783023", "0.53568405", "0.53391176", "0.5339061", "0.53310865", ...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def selected_options_of_pc_params params.require(:selected_options_of_pc).permit(:user_id, :description_of_pc_id, :price_range_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.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
returns a report object from qualys api if a report with the required id exists
def fetch(id) response = api_get('/report/', query: { action: 'fetch', id: id }) # check if report exist return unless response.parsed_response.keys.include?('ASSET_DATA_REPORT') Report.new(response.pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def report(report_id)\n return unless (r = get(\"reports/#{report_id}\")['Reports'])\n Report.new(r.first['Url'], party: self, details: r.first)\n end", "def get_report(id)\n if is_administrator?\n return Reports.first(:id => id)\n else\n report = Reports.first(:id => id)\n if r...
[ "0.7238159", "0.7171137", "0.7160698", "0.71501815", "0.69682217", "0.6932446", "0.6884263", "0.68285114", "0.6787014", "0.6778214", "0.6726005", "0.6685473", "0.656437", "0.65011704", "0.64881885", "0.6487608", "0.64457065", "0.6400218", "0.6400218", "0.63901806", "0.6348554...
0.7341697
0
create a report for the selected ip adress if specified. ips is a array of strings
def launch(ips = []) scan_template = templates.detect { |template| template['TITLE'] == 'Technical Report' } response = api_post('/report/', query: { action: 'launch', report_title: 'Generated_by_Ruby_Qualys_gem', report_type: 'Scan', output_format: 'xml', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ipReport(array)\nips = Hash.new\narray.each do |line|\n\ttoken1 = line.scan(/([[:digit:]]{,3})\\.([[:digit:]]{,3})\\.([[:digit:]]{,3})\\.([[:digit:]]{,3}) /)\n\t#Adds values to the ip address hash\n\tif ips.has_key?(token1)\n\t\tips[token1] += 1\n\telse\n\t\tips[token1] = 1\n\tend\nend\nputs \" \"\n#IP address...
[ "0.61347336", "0.6074393", "0.6012844", "0.60080713", "0.58843297", "0.56091213", "0.55726117", "0.5446036", "0.5413327", "0.5362397", "0.5360475", "0.5354215", "0.53223616", "0.5303424", "0.5270971", "0.5235242", "0.5191163", "0.51664203", "0.5157358", "0.5147502", "0.514519...
0.6327744
0
returns a report object for the hosts associated in a specific scan. If no scan in specified returns global report object. This method can be time consuming and times out after 64 s
def create(ref = nil) scan = Qualys::Scans.all.detect { |s| s.ref == ref } if ref report_id = scan ? launch(scan.hosts) : launch report = fetch(report_id) 10.times do sleep(TIMEOUT / 10) report = fetch(report_id) break unless report.nil? end ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def report_get_host(report_id,host)\r\n\t\tpost= { \"token\" => @token, \"report\" => report_id } \r\n\t\tdocxml=nessus_request('report/hosts', post)\r\n\t\tdocxml.root.elements['contents'].elements['hostList'].each_element('//host') { |host| \r\n\t\t\tif host.elements['hostname'].text == host\r\n\t\t\t\tretval={}...
[ "0.6622076", "0.6191569", "0.6097757", "0.60051566", "0.59476733", "0.5921908", "0.58199346", "0.579915", "0.5790415", "0.5701807", "0.56914157", "0.5604414", "0.54885685", "0.54045314", "0.5356389", "0.5347075", "0.53202844", "0.5306353", "0.52995104", "0.5278245", "0.527148...
0.5768196
9
Returning any kind of identification you want for the model
def name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identifier(model)\n models[model]\n end", "def input_id_from_type(type); end", "def identifier\n best_identifier\n end", "def identification_name(identification_type)\n case identification_type\n when Donor.identification_types['pan_card']\n 'Permanent Account Number'\n when Don...
[ "0.65590584", "0.648132", "0.6455226", "0.6344137", "0.633256", "0.62737584", "0.621614", "0.6179366", "0.61688393", "0.6113753", "0.6113753", "0.6113753", "0.6113753", "0.61099976", "0.6098491", "0.6065589", "0.60568094", "0.60568094", "0.60554343", "0.60554343", "0.6036695"...
0.0
-1
Returning the email address of the model if an email should be sent for this object (Message or Notification). If no mail has to be sent, return nil.
def mailboxer_email(object) #Check if an email should be sent for that object #if true return "define_email@on_your.model" #if false #return nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def email\n result_record = default_email_record\n default_email_record.email if result_record\n end", "def email\n result_record = default_email_record\n default_email_record.email if result_record\n end", "def mailboxer_email(object)\n #Check if an email should be sent for that object\n #...
[ "0.74374723", "0.74374723", "0.74318117", "0.73494667", "0.7340256", "0.7322038", "0.72033614", "0.7086617", "0.70113456", "0.70113456", "0.69797623", "0.68768847", "0.6850695", "0.6792819", "0.67636263", "0.674711", "0.6746941", "0.6715297", "0.6697987", "0.6688117", "0.6645...
0.7328917
5
create method will find existing order or request to aliexpresstracker app
def create Order.find_by!(aliexpress_number: @order.aliexpress_number, tracked: true) rescue ActiveRecord::RecordNotFound post_api_request 'http://aliexpress-tracker.herokuapp.com/orders/track', order_payload(@order) if @order.save end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_order\n @order = Order.create\n end", "def create_order(order)\n # response = post(\n # 'peatio/market/orders',\n # {\n # market: order.market.downcase,\n # side: order.side.to_s,\n # volume: order.amount,\n # price: order.price\n # ...
[ "0.78605485", "0.77152365", "0.7554427", "0.74961656", "0.74532145", "0.7402042", "0.73931044", "0.7363413", "0.7310318", "0.7310318", "0.7301014", "0.7282758", "0.72507536", "0.72446895", "0.7195551", "0.7184171", "0.7183577", "0.71740675", "0.7153716", "0.71455836", "0.7142...
0.7733791
1
Initialize the object with an ::Albacore::AppSpec
def initialize app_spec, output_dir_path = '.' raise ArgumentError, 'missing app_spec parameter' unless app_spec @spec = app_spec @out = output_dir_path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(app); end", "def initialize!(app); end", "def initialize(app)\n @app = app\n end", "def initialize(app)\n @app = app\n end", "def initialize(app)\n @app = app\n end", "def initialize( app )\n\t\t@app = app\n\tend", "def initialize(app)\n @app = app\n end", "...
[ "0.734902", "0.72220206", "0.7159131", "0.7159131", "0.7159131", "0.7145273", "0.712285", "0.712285", "0.712285", "0.7121774", "0.7093", "0.7093", "0.7093", "0.7093", "0.70595396", "0.6728983", "0.66335636", "0.6633054", "0.6623374", "0.6603223", "0.6564666", "0.6539805", ...
0.6951577
15
Generate flags for FPM if you don't want to execute directly with the object you can use this method to generate what you should give to FPM yourself
def generate_flags overrides = {} { '-s' => 'dir', '-t' => 'rpm', '--name' => @spec.title, '--description' => @spec.description, '--url' => @spec.uri, '--category' => @spec.category, '--version' => @spec.version, '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate\n ::Albacore::CrossPlatformCmd.system 'fpm', generate_flags_flat\n end", "def generate_cli_flags\n @flags.map{|pair| pair.join(' ')}.join(' ').gsub(' true','')\n end", "def flag_options\n return @flag_options unless @flag_options.nil?\n @flag_options = ''\n ...
[ "0.7318518", "0.7162264", "0.6505533", "0.6414272", "0.63503134", "0.6118546", "0.60489017", "0.60340303", "0.6030503", "0.6028096", "0.60138744", "0.59819716", "0.5971454", "0.5971454", "0.59226567", "0.5914704", "0.5803778", "0.5793534", "0.5744837", "0.57290065", "0.570355...
0.66720873
2
Generates the flags and flatten them to an array that is possible to feed into the system command
def generate_flags_flat overrides = {} generate_flags(overrides).map { |k, v| [k, v] }.concat(%w|--force .|).flatten end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_argv\n flags = []\n each do |f,v|\n m = f.to_s.size == 1 ? '-' : '--'\n case v\n when Array\n v.each{ |e| flags << \"#{m}#{f}='#{e}'\" }\n when true\n flags << \"#{m}#{f}\"\n when false, nil\n # nothing\n else\n flags << \"#{m}#{f}='#{v}'\"\n ...
[ "0.77865094", "0.7719946", "0.6888274", "0.67909694", "0.6650445", "0.65572405", "0.65572405", "0.65198237", "0.6477129", "0.6362469", "0.6297393", "0.62856275", "0.6279779", "0.6256134", "0.6225778", "0.61714005", "0.61461526", "0.61029255", "0.6046881", "0.60439503", "0.604...
0.6659446
4
gets the filename that the resulting file will have, based on the flags to be passed to fpm
def filename flags = nil flags ||= generate_flags # TODO: handle OS architecture properly by taking from context "#{flags['--name']}-#{flags['--version']}-#{flags['--epoch']}.x86_64.rpm" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_filename\n #if episodeTitle != brandTitle (brandTitle looks to be the name of the program) then use this in the filename\n if @metadata[:episodeTitle] != @metadata[:brandTitle]\n out_file = \"#{@metadata[:title1]}__#{@metadata[:title2]}__#{@metadata[:episodeTitle]}\"\n else #otherwise ju...
[ "0.65031075", "0.64761955", "0.64517343", "0.6408567", "0.6322634", "0.6314093", "0.6311736", "0.6283885", "0.62127495", "0.6169001", "0.6154963", "0.6099139", "0.6079889", "0.60293967", "0.60293967", "0.6009699", "0.599255", "0.59850615", "0.5982002", "0.5932417", "0.5928193...
0.69023687
0
Calls FPM with the flags generated
def generate ::Albacore::CrossPlatformCmd.system 'fpm', generate_flags_flat end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_fpm(pkg_type)\n run_package_command(fpm_command(pkg_type).join(' '))\n end", "def test_setup\n flags = %w(-s -f 500 -u 100 -g 200 -l foo.log) + [\"-p\", @prefix, @default_filename]\n IO.popen([@binary] + flags, \"r+\") {|f| f.close_write; f.close_read}\n assert_equal(0, $?.exitstatus, \"...
[ "0.59537345", "0.5808232", "0.574386", "0.56622064", "0.5574461", "0.5570031", "0.5544452", "0.5544081", "0.5358107", "0.53473556", "0.5340948", "0.53014076", "0.52754885", "0.5211209", "0.52030855", "0.5201769", "0.5193511", "0.5187141", "0.518579", "0.5178864", "0.5178864",...
0.7245089
0
turn off the using of bundler; bundler will be used by default
def no_bundler @bundler = false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_bundle\n # We don't want to run anything here since we have already run a bundle install with our gemset above\nend", "def use_bundler(**opts)\n @bundler = opts\n self\n end", "def use_bundler(**opts)\n @bundler = opts\n self\n end", "def install_bundler\n\t# Wh...
[ "0.6611259", "0.6532698", "0.6532698", "0.6212554", "0.6212554", "0.61918545", "0.6190851", "0.6189979", "0.6189979", "0.61616945", "0.58999276", "0.58987933", "0.5823186", "0.57698816", "0.5757198", "0.5730444", "0.57283634", "0.5684683", "0.5680606", "0.5656701", "0.5626406...
0.80928296
0
set the output path, defaults to '.'
def out= out @out = out end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output_path=(path)\n @output_path = path\n end", "def set_output_dir(x)\n return self if @output_dir\n\n @output_dir = x\n @output_dir_abs = File.is_absolute?(@output_dir)\n if @project_dir\n @output_dir_relPath = File.rel_from_to_project(@project_dir, @output_dir)\...
[ "0.78920853", "0.77829254", "0.7517724", "0.7450877", "0.7331091", "0.7270449", "0.7138308", "0.7113814", "0.70007694", "0.6971531", "0.6944104", "0.686024", "0.684793", "0.6834659", "0.66568863", "0.66527236", "0.6647922", "0.6643437", "0.6624918", "0.6613701", "0.65875226",...
0.0
-1
give the configuration a list of files to match
def files= files @files = files end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_config_files(files); end", "def build_file_list\n puts_and_logs 'Finding files...'\n file_list = []\n config[:source].each do |entry|\n if File.directory?(entry)\n populate_list_of_files_from_directory(file_list, entry) \n next\n end\n if File.file?(entry)\n ...
[ "0.6573412", "0.64961296", "0.64809906", "0.6463924", "0.6389592", "0.63620806", "0.6347032", "0.6309975", "0.628861", "0.628861", "0.6281595", "0.62713856", "0.62518394", "0.62111545", "0.6177447", "0.6156188", "0.61524546", "0.6135526", "0.6119679", "0.61007816", "0.6098884...
0.0
-1
create a new task instance with the given opts
def initialize opts raise ArgumentError, 'opts is nil' if opts.nil? @opts = opts end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(task, options)\n @task = task\n end", "def create_task(options = {})\n task = Task.create({\n title: \"a\"*(Task::TITLE_MIN_LENGTH),\n difficult: Task::PERMITTED_FIBONACCI_VALUES.first,\n description: \"a\"*(Task::DESCRIPTION_MIN_LENGTH)\n }.merge(options))\n\n retu...
[ "0.7367573", "0.7111398", "0.6974995", "0.6955099", "0.683557", "0.66847074", "0.6651632", "0.66382533", "0.66278476", "0.6592085", "0.6576692", "0.6502512", "0.65014195", "0.64863724", "0.64863724", "0.64863724", "0.64863724", "0.64863724", "0.64863724", "0.64863724", "0.648...
0.6206081
41
this runs fpm and does some file copying
def execute warn 'executing fpm app spec task, but there are no input files [fpm_app_spec::task#execute]' if @opts.get(:files).empty? fpm_package @opts.get(:out), @opts.get(:files) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perform_file_copy\n\t\tretrieve_target_dir do |target_dir|\n\t\t\tFileUtils.mkdir_p target_dir\n\t\t\tcopy_depdencies_to target_dir\n\t\tend\t\n\tend", "def copy\n actionlist = actionlist(:copy, copylist)\n\n if actionlist.empty?\n report_nothing_to_generate\n return\n end\n\n ...
[ "0.6695623", "0.65198433", "0.64931417", "0.64906955", "0.619783", "0.61350256", "0.61345637", "0.60707957", "0.59688807", "0.5957884", "0.59354883", "0.5899937", "0.58765215", "0.5874532", "0.5857305", "0.5856705", "0.5795653", "0.5791873", "0.5791873", "0.5781978", "0.57731...
0.53325176
81
GET /users GET /users.xml
def index # index not implemented - only admins may list users raise "This action is not implemented" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_users\n self.class.get('/users')\n end", "def index\n @users = LinkedData::Client::Models::User.all\n respond_to do |format|\n format.html\n format.xml { render xml: @users.to_xml }\n end\n end", "def me\n users(request(\"users/authenticate.xml\", :auth => true))\n en...
[ "0.7657926", "0.76263535", "0.7490723", "0.7470033", "0.74069935", "0.7387062", "0.7248585", "0.72448206", "0.721343", "0.7211573", "0.7210826", "0.71998477", "0.71764135", "0.71337295", "0.71337295", "0.71337295", "0.7132803", "0.7132208", "0.7130947", "0.7115423", "0.709057...
0.0
-1
GET /users/1 GET /users/1.xml
def show # @user = User.find(params[:id]) @user = current_user respond_to do |format| format.html # show.html.erb format.xml { render :xml => @user } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @users = LinkedData::Client::Models::User.all\n respond_to do |format|\n format.html\n format.xml { render xml: @users.to_xml }\n end\n end", "def me\n users(request(\"users/authenticate.xml\", :auth => true))\n end", "def index\n @users = User.all\n render :xml ...
[ "0.7207217", "0.71159333", "0.70538247", "0.70484114", "0.691569", "0.6915292", "0.6914739", "0.68891466", "0.68633795", "0.6862573", "0.6853591", "0.68503916", "0.68503916", "0.68503916", "0.68282413", "0.6827487", "0.6826773", "0.68063277", "0.6800527", "0.6785392", "0.6767...
0.0
-1
GET /users/new GET /users/new.xml
def new # Advanced Rails Recipes, Chapter 13 @user = User.new @user.build_profile @user.identities.build respond_to do |format| format.html # new.html.erb format.xml { render :xml => @user } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n logger.debug(\"Create a new user\")\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.xml { render xml: @user}\n end\n end"...
[ "0.77325314", "0.76981986", "0.76293397", "0.7592596", "0.75904745", "0.75489044", "0.7537867", "0.7530909", "0.7530909", "0.7508572", "0.7508572", "0.7508572", "0.7508572", "0.7508572", "0.7508572", "0.7508572", "0.7508572", "0.7508572", "0.7508572", "0.7508572", "0.7508572"...
0.0
-1
POST /users POST /users.xml
def create @user = User.new(params[:user]) respond_to do |format| if @user.valid? if @user.has_login? @user.register! # will save else @user.register_openid! # will save end flash[:notice] = "Account registered!" format.html do fl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_users(users)\n self.class.post('https://api.yesgraph.com/v0/users', {\n :body => users.to_json,\n :headers => @options,\n })\n end", "def post body=nil, headers={}\n @connection.post \"users.json\", body, headers\n end", "def CreateUser params = {}\n \n ...
[ "0.71678036", "0.6338476", "0.6224363", "0.61548346", "0.6088076", "0.6079892", "0.60536397", "0.60094374", "0.5940851", "0.59352076", "0.59313804", "0.59236705", "0.59006655", "0.58788294", "0.5857175", "0.58492076", "0.58427423", "0.58262956", "0.58248377", "0.5821217", "0....
0.0
-1
PUT /users/1 PUT /users/1.xml
def update # @user = User.find(params[:id]) @user = current_user # makes our views "cleaner" and more consistent params[:user][:existing_identity_attrs] ||= {} unless configatron.user_can_change_login params[:user].delete(:login) @user_login_is_readonly = true end respond_to do ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @user = V1::User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'V1::User was successfully updated.'\n format.html { redirect_to(@user) }\n format.xml { head :ok }\n else\n format.html { render :a...
[ "0.6635185", "0.6546547", "0.6365357", "0.6259716", "0.6222739", "0.62200224", "0.6171894", "0.6131896", "0.61308634", "0.61273426", "0.6110778", "0.6106035", "0.61059886", "0.60566944", "0.603521", "0.603402", "0.6016474", "0.6012614", "0.6003888", "0.5980906", "0.59783655",...
0.0
-1
DELETE /users/1 DELETE /users/1.xml
def destroy # destroy not implemented - only admins may "purge" or "delete" users raise "This action is not implemented" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n @user = User.find(params[:id])\n @user.rvsps.delete_all()\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "def delete_users\n delete(users_path)\n end", "def destroy\n @user = ...
[ "0.7178257", "0.71718895", "0.7062007", "0.70612067", "0.7032304", "0.7003831", "0.6961586", "0.6913032", "0.6913032", "0.6913032", "0.6913032", "0.6913032", "0.6913032", "0.6913032", "0.6913032", "0.6913032", "0.6913032", "0.6913032", "0.6913032", "0.6913032", "0.6913032", ...
0.0
-1
Creates a summary of the tree entries for a commit, within the window of entries defined by the offset and limit parameters. This consists of two return values: An Array of Hashes containing the following keys: file_name: The full path of the tree entry type: One of :blob, :tree, or :submodule commit: The last ::Commit...
def summarize summary = contents .map { |content| build_entry(content) } .tap { |summary| fill_last_commits!(summary) } [summary, commits] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tree_entry(commit)\n pathname = Pathname.new(path)\n tmp_entry = nil\n\n pathname.each_filename do |dir|\n if tmp_entry.nil?\n tmp_entry = commit.tree[dir]\n else\n tmp_entry = rugged.lookup(tmp_entry[:oid])\n return nil unless tmp_entry.type == :tree\n ...
[ "0.6074904", "0.56288874", "0.5553103", "0.5517731", "0.55020654", "0.54454535", "0.5412235", "0.54105717", "0.5349502", "0.53248465", "0.5262856", "0.52549016", "0.5235236", "0.5176798", "0.51726377", "0.5155335", "0.5147237", "0.5086697", "0.50793284", "0.5053767", "0.50507...
0.54646546
5
Does the tree contain more entries after the given offset + limit?
def more? all_contents[next_offset].present? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exceeds_limit?(limit_value)\n !!(limit_value && sliced_nodes.limit(limit_value + 1).count > limit_value)\n end", "def more?\n return @chunks.length > @index\n end", "def more_after_limit?\n more_results == :MORE_RESULTS_AFTER_LIMIT\n end", "def leaf_node?(node_id...
[ "0.66205776", "0.6429795", "0.6238918", "0.6194861", "0.6191092", "0.6108143", "0.5929596", "0.5913379", "0.59071183", "0.5894179", "0.5876855", "0.5850544", "0.5838996", "0.5787018", "0.57779497", "0.5752754", "0.5722568", "0.5711435", "0.56937915", "0.5684877", "0.56815016"...
0.6628022
0
The offset of the next batch of tree entries. If more? returns false, this batch will be empty
def next_offset [all_contents.size + 1, offset + limit].min end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_offset\n next_offset = offset + limit\n return nil if next_offset >= total\n\n next_offset\n end", "def following_entries\n tree.all_data[(index + 1)..-1]\n end", "def next\n last? ? nil : locate + 1\n end", "def get_next_offset(current)\n context.select_value(saniti...
[ "0.6597361", "0.6350568", "0.5967753", "0.59279144", "0.59267044", "0.59191144", "0.58607376", "0.58607376", "0.5856096", "0.58542573", "0.5850306", "0.5784755", "0.5759081", "0.5758523", "0.56826675", "0.56410295", "0.5582707", "0.55815893", "0.55724144", "0.5562288", "0.553...
0.7048851
0
Create one router bgp instance
def create Feature.bgp_enable if platform == :nexus router_bgp wait_for_process_initialized end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(bgp_as, opts = {})\n if opts[:maximum_ecmp_paths] && !opts[:maximum_paths]\n message = 'maximum_paths must be set if maximum_ecmp_paths is set'\n raise ArgumentError, message\n end\n cmds = [\"router bgp #{bgp_as}\"]\n if opts.key?(:enable)\n cmds <...
[ "0.70909566", "0.61089087", "0.6052284", "0.59906083", "0.5976639", "0.59373504", "0.58872163", "0.58532387", "0.57971704", "0.5756841", "0.57231057", "0.571627", "0.57125795", "0.57106537", "0.57064486", "0.5651435", "0.5645474", "0.5645474", "0.56312644", "0.5624215", "0.56...
0.74767274
0
Destroy router bgp instance
def destroy router_bgp('no') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n resources = find_resources_by_tag\n\n destroy_instance(resources)\n destroy_security_group(resources)\n destroy_subnet(resources)\n destroy_route_table(resources)\n\n nil\n end", "def destroy\n @wireless_router.destroy\n respond_to do |format|\n format.ht...
[ "0.70249236", "0.68904495", "0.6621695", "0.6615562", "0.6596487", "0.6584761", "0.652179", "0.64936143", "0.6493586", "0.6411659", "0.63936996", "0.6355316", "0.62887275", "0.6283473", "0.62774026", "0.626346", "0.6257338", "0.62380785", "0.6233089", "0.6202755", "0.6166456"...
0.8771549
0
Enforce First As (Getter/Setter/Default)
def enforce_first_as config_get('bgp', 'enforce_first_as', @get_args) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def safe_by_default; end", "def required_by_default?; end", "def safe_by_default=(_arg0); end", "def first=(val)\n puts \"Setting first='#{val}'\"\n self.old_first=val\n end", "def default?; return !explicit?; end", "def explicit; end", "def method_missing(method, *args)\n # Give OpenStruct...
[ "0.6373625", "0.59522355", "0.5867102", "0.5822998", "0.5771154", "0.57685935", "0.57586575", "0.5687809", "0.5654761", "0.56526476", "0.56518656", "0.5635091", "0.56350106", "0.5611029", "0.55949444", "0.55645", "0.55645", "0.5554357", "0.5547963", "0.55214304", "0.5517343",...
0.0
-1
eventhistory eventhistory cli [ size ] Nvgen as True With optional 'size
def event_history_cli match = config_get('bgp', 'event_history_cli', @get_args) return unless match.is_a?(Array) return 'false' if match[0] == 'no ' return unless match[1] return match[1] if match[1][/\A\d+\z/] 'size_' + match[1] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def event_history_events\n match = config_get('bgp', 'event_history_events', @get_args)\n return unless match.is_a?(Array)\n return 'false' if match[0] == 'no '\n return unless match[1]\n return match[1] if match[1][/\\A\\d+\\z/]\n 'size_' + match[1]\n end", "def event_history_de...
[ "0.66222584", "0.644504", "0.5933487", "0.5881488", "0.5881488", "0.5845439", "0.5761217", "0.56787", "0.5659319", "0.5579752", "0.5579752", "0.55399936", "0.55327976", "0.5454825", "0.5385818", "0.5350661", "0.5350661", "0.5350661", "0.52772814", "0.5270021", "0.52257514", ...
0.70583826
0
eventhistory detail [ size ] Nvgen as True With optional 'size
def event_history_detail match = config_get('bgp', 'event_history_detail', @get_args) return unless match.is_a?(Array) return 'false' if match[0] == 'no ' return 'true' unless match[1] return match[1] if match[1][/\A\d+\z/] 'size_' + match[1] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def event_history_events\n match = config_get('bgp', 'event_history_events', @get_args)\n return unless match.is_a?(Array)\n return 'false' if match[0] == 'no '\n return unless match[1]\n return match[1] if match[1][/\\A\\d+\\z/]\n 'size_' + match[1]\n end", "def event_history_cl...
[ "0.67654467", "0.64063734", "0.624751", "0.616696", "0.58238715", "0.57913554", "0.5761444", "0.5761444", "0.56299484", "0.5595704", "0.5475889", "0.5475889", "0.546903", "0.542816", "0.53952515", "0.53854585", "0.5294861", "0.5289443", "0.52554697", "0.5181327", "0.5145908",...
0.7461295
0
eventhistory errors [ size ] Nvgen as True With optional 'size
def event_history_errors match = config_get('bgp', 'event_history_errors', @get_args) return unless match.is_a?(Array) return 'false' if match[0] == 'no ' return unless match[1] return match[1] if match[1][/\A\d+\z/] 'size_' + match[1] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def event_history_events\n match = config_get('bgp', 'event_history_events', @get_args)\n return unless match.is_a?(Array)\n return 'false' if match[0] == 'no '\n return unless match[1]\n return match[1] if match[1][/\\A\\d+\\z/]\n 'size_' + match[1]\n end", "def max_history=(len...
[ "0.6135388", "0.58863837", "0.58863837", "0.58694726", "0.58574945", "0.5641608", "0.5486608", "0.5418862", "0.5417792", "0.5417792", "0.5417792", "0.5417792", "0.5417792", "0.5417792", "0.5417792", "0.5417792", "0.5417792", "0.5401996", "0.5355514", "0.5355514", "0.534599", ...
0.7317082
0
eventhistory events [ size ] Nvgen as True With optional 'size
def event_history_events match = config_get('bgp', 'event_history_events', @get_args) return unless match.is_a?(Array) return 'false' if match[0] == 'no ' return unless match[1] return match[1] if match[1][/\A\d+\z/] 'size_' + match[1] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def event_history_detail\n match = config_get('bgp', 'event_history_detail', @get_args)\n return unless match.is_a?(Array)\n return 'false' if match[0] == 'no '\n return 'true' unless match[1]\n return match[1] if match[1][/\\A\\d+\\z/]\n 'size_' + match[1]\n end", "def event_his...
[ "0.63120484", "0.61417145", "0.6018403", "0.59438986", "0.5909076", "0.58995533", "0.5722224", "0.56856406", "0.56856406", "0.56439537", "0.56439537", "0.56439537", "0.56439537", "0.56439537", "0.56439537", "0.56439537", "0.56439537", "0.5606022", "0.55917555", "0.55139947", ...
0.6930854
0
eventhistory objstore [ size ] Nvgen as True With optional 'size
def event_history_objstore match = config_get('bgp', 'event_history_objstore', @get_args) return unless match.is_a?(Array) return 'false' if match[0] == 'no ' return 'true' unless match[1] return match[1] if match[1][/\A\d+\z/] 'size_' + match[1] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def event_history_events\n match = config_get('bgp', 'event_history_events', @get_args)\n return unless match.is_a?(Array)\n return 'false' if match[0] == 'no '\n return unless match[1]\n return match[1] if match[1][/\\A\\d+\\z/]\n 'size_' + match[1]\n end", "def event_history_de...
[ "0.6443558", "0.6321584", "0.6112538", "0.609991", "0.609991", "0.60655475", "0.6060734", "0.60490865", "0.59698653", "0.5872606", "0.5872606", "0.5794995", "0.5734503", "0.5684575", "0.5661221", "0.5594651", "0.5587874", "0.5583637", "0.5583637", "0.5583637", "0.5539055", ...
0.7560203
0
eventhistory periodic [ size ] Nvgen as True With optional 'size
def event_history_periodic match = config_get('bgp', 'event_history_periodic', @get_args) return unless match.is_a?(Array) return 'false' if match[0] == 'no ' return unless match[1] return match[1] if match[1][/\A\d+\z/] 'size_' + match[1] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def event_history_events\n match = config_get('bgp', 'event_history_events', @get_args)\n return unless match.is_a?(Array)\n return 'false' if match[0] == 'no '\n return unless match[1]\n return match[1] if match[1][/\\A\\d+\\z/]\n 'size_' + match[1]\n end", "def event_history_de...
[ "0.5931462", "0.56721056", "0.5472015", "0.5345775", "0.53090334", "0.53090334", "0.52530164", "0.5242371", "0.5237251", "0.523171", "0.523171", "0.5216079", "0.51536316", "0.51243114", "0.5004305", "0.49901295", "0.49599344", "0.49343967", "0.49330416", "0.49124599", "0.4887...
0.71807206
0
Fast External fallover (Getter/Setter/Default)
def fast_external_fallover config_get('bgp', 'fast_external_fallover', @get_args) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def awaken!\n\t\traise 'Not implemented'\n\tend", "def raise_deprecations; end", "def safe_by_default; end", "def raise_deprecations=(_arg0); end", "def force_defined!\n @undefined.each { |f| raise f[1] }\n end", "def sharp; accidental; end", "def miss_reason; end", "def auto_recover\n ...
[ "0.6593487", "0.65649974", "0.62717384", "0.62182707", "0.61950225", "0.5961373", "0.5938803", "0.593528", "0.5902992", "0.5902992", "0.5902095", "0.58464545", "0.5843904", "0.58395135", "0.58357525", "0.5835321", "0.57611996", "0.5743952", "0.57274234", "0.56964606", "0.5696...
0.53492117
87
Log Neighbor Changes (Getter/Setter/Default)
def log_neighbor_changes config_get('bgp', 'log_neighbor_changes', @get_args) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_node_change_log2\r\n Model.node_changes_to_log([:evidence])\r\n @mymodel = Model.new(1, \"rubylicious\") \r\n node_list = @mymodel.node_list \r\n\r\n node1 = node_list.add_node('autonum', 'node one', NODE);\r\n perfind2 = node_list.add_node('autonum', 'pi two', PER...
[ "0.5862339", "0.5843397", "0.57668316", "0.57668316", "0.57668316", "0.57668316", "0.57668316", "0.57668316", "0.57668316", "0.57668316", "0.5717996", "0.56786835", "0.56285644", "0.56141794", "0.5592839", "0.5504513", "0.54904616", "0.54880583", "0.546776", "0.5458476", "0.5...
0.7844756
0
Neighbor down fib accelerate (Getter/Setter/Default)
def neighbor_down_fib_accelerate config_get('bgp', 'neighbor_down_fib_accelerate', @get_args) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def naive_fib(number)\n return -1 if number < 0\n return 0 if number == 0# && (@operations += 1)\n return 1 if number == 1# && (@operations += 1)\n naive_fib(number-1) + naive_fib(number-2)\nend", "def fib(n)\n \nend", "def lagfib_step!(state, m)\n state << (state[0] + state[1]) % m\n state.shift\nend...
[ "0.645399", "0.6407212", "0.6397616", "0.6350257", "0.6332207", "0.63200414", "0.6226222", "0.6226222", "0.6214197", "0.6199558", "0.6175552", "0.61740756", "0.6134906", "0.6114336", "0.6092988", "0.60744786", "0.6037376", "0.6034571", "0.60336864", "0.60331506", "0.60056674"...
0.7627824
0
route_distinguisher Note that this property is supported by both bgp and vrf providers.
def route_distinguisher return nil if @vrf.nil? || @vrf == 'default' config_get('bgp', 'route_distinguisher', @get_args) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def route_distinguisher\n config_get('evpn_vni', 'route_distinguisher', @get_args)\n end", "def route\n @route\n end", "def route\n @route ||= Role.available_routes.find {|r| r.conditions[:path_info].to_s == path_info && r.conditions[:request_method].to_s == request_method}\n end", ...
[ "0.7495046", "0.5641604", "0.555869", "0.5539047", "0.55101776", "0.55101776", "0.55059844", "0.5495135", "0.54701674", "0.53558224", "0.52757275", "0.52584285", "0.5221106", "0.52004147", "0.52004147", "0.5183429", "0.51445353", "0.51324314", "0.50995845", "0.5099539", "0.50...
0.833147
0
Supress Fib Pending (Getter/Setter/Default)
def suppress_fib_pending val = config_get('bgp', 'suppress_fib_pending', @get_args) val.nil? ? false : val end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def faint\n self.fainted = true\n end", "def disable_clear_and_finalize; end", "def unfreeze; end", "def unfreeze\n update_attribute :status, STATUS_NORMAL\n end", "def suspend()\n #This is a stub, used for indexing\n end", "def disable_pending_cops=(_arg0); end", "def fallOff...
[ "0.5893379", "0.5710058", "0.5706027", "0.56013906", "0.5559057", "0.5549521", "0.55474997", "0.5546742", "0.55261284", "0.54985714", "0.54985714", "0.5488792", "0.5488792", "0.5461636", "0.54575574", "0.5402929", "0.53924346", "0.53920335", "0.5359646", "0.5314198", "0.53045...
0.5800248
1
The GitHub username used for authenticating with GitHub.
def username @config["username"] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def username\n account = github_accounts.first || slack_accounts.first\n account ? account.username : id\n end", "def get_username()\n username_gitconfig = %x(git config user.name).strip\n username_passwd = Etc.getpwnam(Etc.getlogin).gecos.gsub(/ - SBP.*/,'')\n\n username = username_gitc...
[ "0.7653071", "0.7463905", "0.73055", "0.7097026", "0.7097026", "0.70674443", "0.7023844", "0.7012319", "0.69793814", "0.69456375", "0.6928623", "0.6918584", "0.6913028", "0.69082296", "0.6905444", "0.6901749", "0.69011503", "0.6894123", "0.6893661", "0.6859183", "0.6837697", ...
0.6984999
8
A GitHub Personal Access Token which goes with +username+.
def access_token @config["token"] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def github_access_token\n ENV['GITHUB_ACCESS_TOKEN'].to_s.strip\n end", "def github_access_token\n ENV['GITHUB_ACCESS_TOKEN'].to_s.strip\n end", "def get_token_for(username, password)\n\t\t\t\turl = GITHUB_API_AUTH_LINK \n\t\t\t\tscopes = %w[repo gist]\n\t\t\t\tcontent = generate_scope ...
[ "0.7331639", "0.7331639", "0.72897816", "0.70673585", "0.7045126", "0.68736744", "0.68725514", "0.687193", "0.68462527", "0.68098867", "0.6808267", "0.67325926", "0.67242956", "0.6538153", "0.65049803", "0.64922875", "0.64872795", "0.6455427", "0.6454177", "0.6408871", "0.640...
0.0
-1
A string containing both the GitHub username and access token, used in instances where we use Basic Auth.
def basic_auth "#{username}:#{access_token}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def github_access_token\n ENV['GITHUB_ACCESS_TOKEN'].to_s.strip\n end", "def github_access_token\n ENV['GITHUB_ACCESS_TOKEN'].to_s.strip\n end", "def basic_auth_token\n 'Basic ' + [\"#{username}:#{password}\"].pack('m').delete(\"\\r\\n\")\n end", "def basic_auth_token\n '...
[ "0.73295313", "0.73295313", "0.68746936", "0.6874568", "0.6874568", "0.6874568", "0.6874568", "0.6874568", "0.6874568", "0.6874568", "0.6874568", "0.6874568", "0.6874568", "0.6874568", "0.6874568", "0.6874568", "0.6874568", "0.6735861", "0.6692695", "0.65644556", "0.6522874",...
0.79076695
0
Submit a GraphQL query, and convert it from JSON to a Ruby object.
def graphql(query_string) Okay::GraphQL.query(query_string) .submit!(:github, {bearer_token: access_token}) .or_raise! .from_json end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query(query:)\n path = '/graphql'\n\n if query.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"query\"')\n end\n\n params = {\n query: query,\n }\n \n headers = {\n \"x-sd...
[ "0.6854442", "0.6643557", "0.6216275", "0.6216275", "0.61218536", "0.6036545", "0.58817774", "0.5879768", "0.58143485", "0.57696646", "0.57475054", "0.56428754", "0.5597609", "0.55359894", "0.55167705", "0.54900044", "0.5485848", "0.5428977", "0.5341947", "0.5333956", "0.5288...
0.62467736
2
WARNING From reading most of the tests for various integrations, including the more popular ones (Authorize.net), it seems that the amount field is provided using dollars, not cents like the Gateway classes. The currency for transactions is dictated by the merchant account. Thus, the user will need to determine the cor...
def initialize(order, account, options = {}) requires!(options, :amount, :locale, :secret, :access_code) # The following elements need to be removed from params to not # trigger an error, but can't be added to the object yet since # the @fields Hash has not been set up yet via s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def purchase(money, creditcard, options = {})\n\n body = credentials\n body[:ssl_transaction_type] = :ccsale\n body[:ssl_amount] = '%.2f' % (money / 100.0)\n\n if options[:ssl_token].present?\n body[:ssl_token] = options[:ssl_token]\n else\n body[:ssl_card_numbe...
[ "0.61707103", "0.60558665", "0.60558665", "0.60174155", "0.59964836", "0.5901553", "0.58777016", "0.58763236", "0.5841214", "0.5815874", "0.5797577", "0.577211", "0.57693917", "0.57687247", "0.57687247", "0.5751588", "0.57499295", "0.5731026", "0.5712223", "0.56966794", "0.56...
0.591536
5
A custom handler for credit cards to extract the card type since Migs wants that passed with the data
def credit_card(params = {}) brand = params[:brand].to_sym params.delete(:brand) exp_month = sprintf("%.2i", Integer(params[:expiry_month], 10)) exp_year = sprintf("%.4i", Integer(params[:expiry_year], 10)) params.delete(:expiry_month) params.delete(:expiry_y...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def credit_card_type\n params['CardType']\n end", "def card_type\n card[:type]\n end", "def get_card_type()\n return @RESPONSE_HASH['CARD_TYPE']\n end", "def credit_card_type\n fetch('business.credit_card_types')\n end", "def credit_card_type(credit_card)\n ca...
[ "0.80228376", "0.7814739", "0.7619347", "0.7595993", "0.7583014", "0.7552322", "0.7549982", "0.750639", "0.74601007", "0.7180005", "0.71667683", "0.7024751", "0.697505", "0.6866137", "0.68337786", "0.6787117", "0.6782496", "0.6748637", "0.6689993", "0.6677358", "0.6664655", ...
0.621551
36
Make sure the order id and attempt number are combined into the appropriate fields in the form. The transaction reference is constructed as: orderattempt_number The order info is constructed as: orderattempt_number/description
def order=(value) # Both of these fields include the order id {'vpc_MerchTxnRef' => 40, 'vpc_OrderInfo' => 34}.each do |field, max_length| existing_value = @fields[field] || "" # Inserts the description as (/description) into any existing variation of "order-attempt/descript...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n code = order_params[:order_code].to_i\n shirt_type = @order_codes[code][:type]\n letter = @order_codes[code][:letter]\n count = @order_codes[code][:count]\n size = order_params[:shirt_size]\n if order_params[:letter_3] != 'none'\n letter_3 = order_params[:letter_3]\n else\n ...
[ "0.5517735", "0.54773605", "0.54329824", "0.52715725", "0.52649415", "0.5246806", "0.524358", "0.52368754", "0.5229899", "0.5218856", "0.52153254", "0.52090657", "0.5194525", "0.51561415", "0.51521057", "0.51430035", "0.514186", "0.51276547", "0.5104481", "0.50820136", "0.504...
0.6285805
0
This must be called at the end after all other fields have been added
def add_secure_hash # Per MIGS requirements we must stringify, sort fields alphabetically # minus the 'vpc_' prefix, add back the 'vpc_' prefix after sorting, # then join all fields as a query string separated by '&'. sorted_values = @fields.stringify_keys ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_initialize_fields\n end", "def pre_initialize_fields\n end", "def initialize(*)\n super\n @extra_fields = []\n end", "def call\n add_fields(unrecognised: true)\n end", "def initialize\n @fields = []\n end", "def fields; end", "def fields; end", ...
[ "0.73202366", "0.7011276", "0.67284894", "0.6702872", "0.6316347", "0.63103414", "0.63103414", "0.63103414", "0.6217922", "0.62164426", "0.614454", "0.61374545", "0.6111803", "0.60939866", "0.60817695", "0.602223", "0.6017643", "0.6005824", "0.5996228", "0.5994684", "0.599468...
0.0
-1
Returns true if one of the following is true: address and 9digit zip matches address and 5digit zip matches 5digit zip matches, address not checked
def avs_code_matches? return ['Y', 'X', 'P'].include? avs_code end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_zipcode?(address_or_zipcode)\n\t\t/\\d{5}(-| )\\d{4}$|^\\d{5}$/.match(address_or_zipcode) != nil\n\tend", "def address_matches(spec, address)\n (0..3).all? { |i| spec[i]=='*' || spec[i]==address[i] }\nend", "def address(input)\n\t(/[0-9]{4}(\\s|\\,){1}(.+?)(\\s|\\,){1}(?i)((str)|(street)|(ave)|(avenu...
[ "0.7481677", "0.7336807", "0.7318932", "0.7312613", "0.7011699", "0.70027333", "0.7001133", "0.6907457", "0.6869339", "0.68212247", "0.67572224", "0.6710917", "0.6651651", "0.6610061", "0.65900356", "0.6542491", "0.64860415", "0.6446772", "0.6442346", "0.6406582", "0.64003474...
0.0
-1
Since Attachment is anonymously subclassed when Shrine is subclassed, and then assigned to a constant of the Shrine subclass, make inspect reflect the likely name for the class.
def inspect "#{shrine_class.inspect}::Attachment" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inspect\n \"#{shrine_class.inspect}::Attachment\"\n end", "def inspect\n \"#{shrine_class.inspect}::Attacher\"\n end", "def inspect\n \"#{shrine_class.inspect}::Attacher\"\n end", "def inspect\n \"#<#{self.class.inspect}(#{attachment_name})>\"\n end...
[ "0.7551268", "0.6682885", "0.6663536", "0.6251415", "0.6031942", "0.58509016", "0.58509016", "0.58398634", "0.5811296", "0.5800834", "0.57039165", "0.5679276", "0.56753594", "0.5628159", "0.5606973", "0.56056494", "0.56037235", "0.55727845", "0.55589867", "0.55589867", "0.554...
0.75432384
1
Defines attachment methods for the specified attachment name. These methods will be added to any model that includes this module.
def define_attachment_methods! attachment = self name = attachment_name define_method :"#{name}_attacher" do |**options| if !instance_variable_get(:"@#{name}_attacher") || options.any? instance_variable_set(:"@#{name}_attacher", attachment.build_attacher(self, options)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def define_entity_methods(name)\n super if defined?(super)\n\n attachment = self\n\n # Returns the attached file.\n if shrine_class::Attacher.instance_method(:get).arity == 0\n define_method :\"#{name}\" do\n send(:\"#{name}_attacher\").get\n e...
[ "0.7743607", "0.67257756", "0.65725005", "0.6549751", "0.6460755", "0.63732594", "0.63392466", "0.63187873", "0.6305956", "0.600629", "0.5998269", "0.589278", "0.5870685", "0.5867903", "0.5791964", "0.5641423", "0.56366235", "0.5626269", "0.5550893", "0.5526181", "0.5521115",...
0.81287575
0
Creates an instance of the corresponding Attacher subclass.
def build_attacher(object, options) shrine_class::Attacher.new(object, @name, @options.merge(options)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def included(klass)\n super\n\n attachment = self\n\n klass.send(:define_singleton_method, :\"#{@name}_attacher\") do |**options|\n attachment.send(:class_attacher, **options)\n end\n end", "def attacher(record, **options)\n attacher = class_attacher...
[ "0.6550924", "0.63296527", "0.61693954", "0.60438854", "0.58186984", "0.5589526", "0.554988", "0.55304027", "0.5485372", "0.547928", "0.5246416", "0.5201765", "0.51992434", "0.51897377", "0.5154713", "0.51215756", "0.51003945", "0.50602496", "0.5044455", "0.50385356", "0.5027...
0.6425929
1
Returns name of the attachment this module provides.
def attachment_name @name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name\n attachment.name\n end", "def filename\n find_attachment\n end", "def fullname\n \"#{self.attached_file_identifier}\"\n end", "def getting_attachment_name\n url = self.attachment.url\n \"#{File.basename(url, '.*').truncate(15, :omission => '...')}.#{File.extname(url)}\...
[ "0.84470576", "0.7516561", "0.7290991", "0.7286435", "0.7155182", "0.7026494", "0.6984136", "0.69773275", "0.69674957", "0.6934381", "0.69045174", "0.66672075", "0.6602742", "0.65868706", "0.654189", "0.6524427", "0.65227", "0.6496313", "0.6496313", "0.6470514", "0.6440998", ...
0.85881835
0
Returns options that are to be passed to the Attacher.
def options @options end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def options\n return @options\n end", "def options\n @options\n end", "def options\n @options\n end", "def options\n return @options\n end", "def options\n @options ||= {}\n @options\n end", "def options\n @options ||= {}...
[ "0.72842664", "0.7263428", "0.7263428", "0.7142295", "0.71146137", "0.70751417", "0.70751417", "0.70751417", "0.7074968", "0.7074968", "0.7071631", "0.7071631", "0.70702386", "0.7069756", "0.7059544", "0.7037543", "0.7036143", "0.7036143", "0.7036143", "0.7030352", "0.7030352...
0.7204574
3
Returns class name with attachment name included. Shrine[:image].to_s => ""
def to_s "#<#{self.class.inspect}(#{attachment_name})>" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inspect\n \"#{shrine_class.inspect}::Attachment\"\n end", "def inspect\n \"#{shrine_class.inspect}::Attachment\"\n end", "def attachment_file_name\n \"image\"\n end", "def image_name\n image.try(:name)\n end", "def base_filename; class_to_filename(name.gsub(/.*:/, ''...
[ "0.6779771", "0.67317176", "0.6720636", "0.6668668", "0.658978", "0.6505328", "0.6502912", "0.6430305", "0.64134175", "0.6280397", "0.6262548", "0.62337744", "0.62040013", "0.61950946", "0.61888003", "0.6180783", "0.61447656", "0.6139301", "0.6133535", "0.6133535", "0.6133535...
0.6268808
10
Returns class name with attachment name included. Shrine[:image].inspect => ""
def inspect "#<#{self.class.inspect}(#{attachment_name})>" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inspect\n \"#{shrine_class.inspect}::Attachment\"\n end", "def inspect\n \"#{shrine_class.inspect}::Attachment\"\n end", "def image_name\n image.try(:name)\n end", "def attachment_file_name\n \"image\"\n end", "def name\n attachment.name\n end", "def in...
[ "0.7407733", "0.73614305", "0.657447", "0.65657645", "0.6535655", "0.6423052", "0.6403377", "0.6373654", "0.6325206", "0.6272291", "0.6259141", "0.6256691", "0.6256455", "0.619037", "0.6190117", "0.61333877", "0.609988", "0.6099214", "0.6044048", "0.5982797", "0.5982797", "...
0.6709943
2
Returns the Shrine class that this attachment's class is namespaced under.
def shrine_class self.class.shrine_class end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shrine_class\n self.class.shrine_class\n end", "def shrine_class\n self.class.shrine_class\n end", "def shrine_class\n self.class.shrine_class\n end", "def class_name\n self.class.to_s.split('::').last\n end", "def class_name\n self.class.nam...
[ "0.70945585", "0.70945585", "0.70945585", "0.66969967", "0.65976274", "0.65245587", "0.64823854", "0.64823854", "0.64613146", "0.6449536", "0.6445268", "0.64450777", "0.64410603", "0.64342403", "0.64256", "0.64037925", "0.64024967", "0.63824683", "0.63711995", "0.63421065", "...
0.7244458
1
Reconstructs the line in a readable fashion
def to_s "#{file}:#{number}:in `#{method}'" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def original_line; end", "def decompose(raw_line)\n if raw_line =~ @@irc_line\n c = $~\n line = IRCSupport::Line.new\n\n if c[:tags]\n line.tags = {}\n c[:tags].split(/;/).each do |tag|\n key, value = tag.split(/=/)\n line.tags[key] = value ? valu...
[ "0.6480603", "0.6462179", "0.64511645", "0.64271504", "0.6330025", "0.6316519", "0.63112277", "0.6272024", "0.6233752", "0.6225362", "0.6193274", "0.6135251", "0.60819566", "0.6048594", "0.60471207", "0.6016598", "0.60151625", "0.6010493", "0.6002473", "0.5953855", "0.5948982...
0.0
-1
GET Display new character creation form
def new @user = User.find(params[:user_id]) @character = Character.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @character = Character.new\n @title = \"New Character\"\n @page = 'new_character'\n\n respond_to do |format|\n format.html # new.html.erb\n end\n end", "def new\n @character = Character.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render...
[ "0.77802366", "0.742782", "0.7378711", "0.7378711", "0.7369668", "0.7166943", "0.71434814", "0.7114649", "0.6883806", "0.6855712", "0.673132", "0.67121226", "0.66856855", "0.6646366", "0.664515", "0.6619632", "0.66040134", "0.66040134", "0.6593104", "0.65914226", "0.6511717",...
0.66313785
15
POST Create new character
def create @character = Character.new @character.name = params[:name] @character.atk = params[:attack] @character.def = params[:defense] @character.hp = 80 @character.xp = 0 @character.level = 1 @character.unassigned = params[:unassigned] @character.user_id = @current_user.id ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @character = Character.new(character_params)\n if @character.save\n render json: @character, status: 201\n else\n render json: @character.errors, status: :unprocessable_entity\n end\n end", "def create\n @character = Character.new(character_params)\n\n respond_to do |for...
[ "0.7781876", "0.76452136", "0.76452136", "0.7571872", "0.7562628", "0.7514779", "0.7503511", "0.7435917", "0.74295044", "0.73960704", "0.73733073", "0.7371327", "0.7334991", "0.7314378", "0.73004776", "0.7276128", "0.72613585", "0.7249055", "0.7201774", "0.7199774", "0.714888...
0.73387396
12
GET Display single character
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def single_character_display\n SINGLE_CHARACTER\n end", "def single_character_display\n SINGLE_CHARACTER\n end", "def single_character_display\n SINGLE_CHARACTER\n end", "def single_character_display\n SINGLE_CHARACTER\n end", "def show_char(c)\n chars = %...
[ "0.6734687", "0.6734687", "0.6734687", "0.6734687", "0.6612061", "0.6428388", "0.6387491", "0.6376005", "0.62541056", "0.6226142", "0.62040573", "0.6194521", "0.6160886", "0.6160886", "0.61469704", "0.6116822", "0.61074394", "0.61074394", "0.61074394", "0.61074394", "0.610743...
0.0
-1
GET Display edit character form
def edit end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit\n @characters = current_account.characters.all\n end", "def edit\r\n end", "def edit\r\n \r\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def ...
[ "0.7249866", "0.69881195", "0.6934496", "0.6884357", "0.6884357", "0.6884357", "0.6884357", "0.6884357", "0.6884357", "0.6884357", "0.6884357", "0.6884357", "0.6884357", "0.6884357", "0.6884357", "0.6884357", "0.68423307", "0.68423307", "0.68423307", "0.68423307", "0.68423307...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_lent_record @lent_record = LentRecord.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.6163821", "0.6045432", "0.5945441", "0.5916224", "0.58894575", "0.5834073", "0.57764685", "0.5702474", "0.5702474", "0.5653258", "0.56211996", "0.54235053", "0.5410683", "0.5410683", "0.5410683", "0.53948104", "0.5378064", "0.5356684", "0.53400385", "0.53399503", "0.533122...
0.0
-1
Only allow a trusted parameter "white list" through.
def lent_record_params params.require(lent_required_array) params.permit(lent_required_array + lent_permitted_array) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", ...
[ "0.7123669", "0.7054077", "0.69472784", "0.6902165", "0.6736001", "0.671985", "0.6687218", "0.6676269", "0.66602534", "0.6556639", "0.6527985", "0.645892", "0.645072", "0.64494324", "0.6445436", "0.64350927", "0.6415061", "0.6415061", "0.6393001", "0.6378958", "0.6378958", ...
0.0
-1
validate do errors.add(:user, 'invalid email or password') unless logging_user.present? && logging_user.password == password end
def execute errors.add(:user, 'authentication failed!') unless logging_user.update(access_token: SecureRandom.hex(6)) logging_user end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate\n errors.add_to_base(\"Missing password\") if password.blank?\n end", "def validate_password\n if @user.password.blank?\n @user.errors.add :password, 'can\\'t be blank'\n elsif @user.password_confirmation.blank?\n @user.errors.add(\n :password_confirmation,\n ...
[ "0.7695159", "0.7672034", "0.75676733", "0.7558857", "0.75173664", "0.7503867", "0.75027347", "0.72812194", "0.726919", "0.7267883", "0.724237", "0.71964115", "0.71728706", "0.7120535", "0.71190715", "0.71065426", "0.70919365", "0.70780635", "0.70721745", "0.70721745", "0.707...
0.0
-1
AS::Dependencies doesn't track samefile nested constants, so we need to look out for them on our own. For example having loaded an abc.rb that looks like this: class Abc; class Inner; end; end AS::Dependencies would only add "Abc" constant name to its autoloaded_constants list, completely ignoring Abc::Inner. This in t...
def remove_parent_modules_if_autoloaded(object) unless autoloaded_namespace_object?(object) while (object = object.parent) != Object if autoloaded_namespace_object?(object) remove_constant(object._mod_name) break end end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nested_const_lookup(const_name)\n constants = [ Object ]\n\n unless self == Object\n self.name.split('::').each do |part|\n constants.unshift(constants.first.const_get(part))\n end\n end\n\n parts = const_name.split('::')\n\n # from most to least specific constant, use each as a...
[ "0.71118456", "0.7108511", "0.6965108", "0.6796415", "0.67728806", "0.662708", "0.66162395", "0.655075", "0.655075", "0.6535311", "0.6509124", "0.64429", "0.64206827", "0.6350794", "0.6330508", "0.6312108", "0.6275954", "0.62623155", "0.6234307", "0.6208239", "0.6159421", "...
0.0
-1
POST /descargar/gabarra/001/2006/ABC123/ POST /descargar/gabarra/001/2006/ABC123.html
def gabarra respond_to do |format| begin @gabarra = DescargaBauxita.descargar(params) format.json { render :json => @gabarra } rescue Exceptions::PresenciaValoresExcepcion => errores format.json { render :json => errores.errors, :status => 400 } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle_POST(request)\n\tinitial_and_headers,body = initialandheaders_Body_Split(request)\n\tinitial,headers = initial_Headers_Split(initial_and_headers)\n\tparams = JSON.parse(body) # parse parameters from json file\n\tcontents = File.read \"thanks.html\"\n\tcontents = modify_content(contents, params[\"vikin...
[ "0.6208394", "0.6205214", "0.58232516", "0.5719773", "0.56863785", "0.5674217", "0.5618389", "0.5607149", "0.554716", "0.55224097", "0.5453746", "0.54356575", "0.53317845", "0.53123903", "0.5293198", "0.5287359", "0.5268952", "0.52682185", "0.52519333", "0.52452254", "0.52387...
0.5592957
8
GET /descargar/buque/1/1 GET /descargar/buque/1/1.html
def buque respond_to do |format| begin if params[:tipo_materia_id] == 1 # Es un buque de bauxita @buque = DescargaBauxita.descargar(params) else @buque = DescargaOtro.descargar(params[:id]) end format.json { render :json => @gabarra } rescue Exceptions...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bus_page(id)\n url = URI.parse('http://www.smtuc.pt')\n results = Net::HTTP.start(url.host, url.port) do |http|\n http.get(\"/horario.php?id_linha=#{id}\").body\n end\nend", "def gabarra\n respond_to do |format|\n begin\n @gabarra = DescargaBauxita.descargar(params)\n format.json ...
[ "0.6095113", "0.60519624", "0.6023775", "0.6005408", "0.59020615", "0.5829759", "0.5781034", "0.57306427", "0.56861466", "0.56844425", "0.5653473", "0.5629917", "0.558701", "0.55677617", "0.5554265", "0.5533383", "0.5505034", "0.5493392", "0.54757786", "0.5469796", "0.5457323...
0.6254278
0
GET /administrators GET /administrators.xml
def index @administrators = Administrator.all respond_to do |format| format.html # index.html.erb format.xml { render :xml => @administrators } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @administrators = Administrator.all\n end", "def index\n @administrators = Administrator.all\n end", "def index\n @administrators = Administrator.all\n end", "def index\n @admin_administrators = Admin::Administrator.page(params[:page])\n end", "def admin_xml(path,method=:get,opt...
[ "0.69830877", "0.69830877", "0.69830877", "0.68123746", "0.67981815", "0.672836", "0.6619225", "0.6574371", "0.6561882", "0.65188956", "0.65188956", "0.63390535", "0.6289999", "0.6288449", "0.6240784", "0.6203149", "0.6196037", "0.6184846", "0.6184538", "0.615424", "0.6134009...
0.7444111
0
GET /administrators/1 GET /administrators/1.xml
def show @administrator = Administrator.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @administrator } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @administrators = Administrator.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @administrators }\n end\n end", "def index\n @administrators = Administrator.all\n end", "def index\n @administrators = Administrator.all\n en...
[ "0.721012", "0.6833981", "0.6833981", "0.6833981", "0.6739278", "0.66537786", "0.6567804", "0.6459264", "0.6374228", "0.627579", "0.6223295", "0.6223295", "0.6223295", "0.6220987", "0.6214824", "0.6207115", "0.6207115", "0.61715364", "0.61367387", "0.611473", "0.6114054", "...
0.6348376
10
GET /administrators/new GET /administrators/new.xml
def new @administrator = Administrator.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @administrator } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def newAdmin\n @user = User.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @admin = Admin.new\n build_permissions\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :x...
[ "0.7291994", "0.7133487", "0.7090974", "0.7090974", "0.7090974", "0.6977928", "0.6892359", "0.686389", "0.6859987", "0.6728132", "0.6674985", "0.65307486", "0.6529412", "0.65165955", "0.65115386", "0.64427483", "0.63708574", "0.63626", "0.6361309", "0.63535076", "0.6346956", ...
0.69732374
7
POST /administrators POST /administrators.xml
def create @administrator = Administrator.new(params[:administrator]) respond_to do |format| if @administrator.save flash[:notice] = 'Administrator was successfully created.' format.html { redirect_to(@administrator) } format.xml { render :xml => @administrator, :status => :creat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @administrators = Administrator.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @administrators }\n end\n end", "def create\n \n set_account\n @administrator = @account.administrators.build(administrator_params)\n\n resp...
[ "0.6264656", "0.61206055", "0.6068665", "0.6053249", "0.6053249", "0.6053249", "0.6026591", "0.5931405", "0.5916829", "0.58646876", "0.58502275", "0.58456236", "0.58210355", "0.58152354", "0.5738906", "0.573785", "0.5728547", "0.57148105", "0.56905246", "0.5683194", "0.566644...
0.5783698
14
PUT /administrators/1 PUT /administrators/1.xml
def update @administrator = Administrator.find(params[:id]) respond_to do |format| if @administrator.update_attributes(params[:administrator]) flash[:notice] = 'Administrator was successfully updated.' format.html { redirect_to(@administrator) } format.xml { head :ok } else...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_administrators\n if user_id_changed?\n if (user_id)\n Membership.find_by_user_id_and_network_id(user_id, id).try(:destroy) # delete membership of new owner\n end \n if (user_id_was)\n Membership.create(:user_id => user_id_was, :network_id => id,\n ...
[ "0.6408222", "0.63869613", "0.59732455", "0.59511244", "0.59081405", "0.58949846", "0.58284163", "0.58234566", "0.5812984", "0.5801023", "0.57943225", "0.5776332", "0.5755517", "0.572958", "0.5658809", "0.5650076", "0.56402737", "0.5617328", "0.5609523", "0.5599632", "0.55996...
0.58777195
6
DELETE /administrators/1 DELETE /administrators/1.xml
def destroy @administrator = Administrator.find(params[:id]) @administrator.destroy respond_to do |format| format.html { redirect_to(administrators_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @admin = Admin.find(params[:id])\n @admin.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_admins_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @admin = Admin.find(params[:id])\n @admin.destroy\n\n respond_to do |format|\n fo...
[ "0.6869146", "0.6869146", "0.68572426", "0.68572426", "0.681465", "0.6700788", "0.6628345", "0.6613172", "0.6588993", "0.6570997", "0.6562326", "0.654338", "0.654338", "0.64946306", "0.64714146", "0.6461566", "0.644592", "0.6424186", "0.64225596", "0.64169127", "0.6408739", ...
0.715506
1
Start bitvector helper tests
def test_get_coord_from_bv_should_fail_when_more_than_one_bit_set assert_raises(ArgumentError) {RulesEngine.get_coord_for_bv(0x03)} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_007_indexing()\n TestVals.each do |sVal|\n lVal = sVal.length\n iVal_a_r = sVal.reverse.split(//).map { |bit| bit.to_i }\n bs = BitString.new(sVal)\n #\n # Let's try fetching each bit.\n #\n lVal.times do |i|\n assert_equal(iVal_a_r[i],\n ...
[ "0.5919055", "0.5864348", "0.58362985", "0.572114", "0.5684396", "0.56347215", "0.5562176", "0.55046993", "0.5411993", "0.53866756", "0.5367091", "0.53465444", "0.5309699", "0.5278161", "0.52652955", "0.52523696", "0.523543", "0.52212465", "0.52197564", "0.52197564", "0.52192...
0.5026895
50
End bitvector helper tests Start board helper tests
def test_should_get_white_piece_on_black_square_from_initial_setup square = @board.sq_at(A1) assert_not_nil(square) assert(square.colour.black?) assert_not_nil(square.piece) assert(square.piece.colour.white?) assert_equal(Chess::Piece::ROOK, square.piece.name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_007_indexing()\n TestVals.each do |sVal|\n lVal = sVal.length\n iVal_a_r = sVal.reverse.split(//).map { |bit| bit.to_i }\n bs = BitString.new(sVal)\n #\n # Let's try fetching each bit.\n #\n lVal.times do |i|\n assert_equal(iVal_a_r[i],\n ...
[ "0.60144943", "0.5839444", "0.5796854", "0.5758643", "0.5733885", "0.5720151", "0.5661434", "0.5660592", "0.5623066", "0.5603395", "0.5594922", "0.559087", "0.5580019", "0.55628735", "0.5542055", "0.5527618", "0.5524896", "0.55247927", "0.5520332", "0.5517498", "0.55170864", ...
0.0
-1
End board helper tests Start piece helper tests
def test_move_should_not_change_peice_properties board = RulesEngine.new() src = A2 dest = A3 board.move_piece(src, dest) assert(board.sq_at(src).piece.nil?) assert(!board.sq_at(dest).piece.nil?) assert(board.sq_at(dest).piece.colour.white?) assert(board.sq_at(dest).piece.name == Chess::...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_pieces\n @board = MyTestBoard.new\n \n all_test_pieces = [[[[0, 0], [1, 0], [0, 1], [1, 1]]], # square (only needs one)\n MyPiece.rotations([[0, 0], [-1, 0], [1, 0], [0, -1]]), # T\n [[[0, 0], [-1, 0], [1, 0], [2, 0]], # long (only needs two)\n [[0, 0], ...
[ "0.6557695", "0.652266", "0.650447", "0.64696366", "0.6376593", "0.6285665", "0.6258201", "0.62411946", "0.6213565", "0.61692786", "0.61519516", "0.6150291", "0.6074137", "0.6070781", "0.60543776", "0.60327864", "0.60109574", "0.6003761", "0.59801054", "0.59741044", "0.597410...
0.0
-1
End piece helper tests Start attack calculation testing Pawn
def test_white_pawn_in_centre_should_attack_upwards() b = RulesEngine.new() place_pieces(b, " -------- -------- -------- -B-B---- --p----- -------- -------- -------- ") bv = b.calc_attk_pawn(C4) expected = " -------- -------- -------...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_check_calculate_white_pawn_move\n e = RulesEngine.new\n place_pieces(e, \"\n - - - - - - - - \n - - - - - K - -\n - - - - - - - - \n k - - - - - - - \n - - - - - - - - \n - - - p - - - - \n - - - - - - - - \n - - - - - - - -\n \")\n expected = \"\n ...
[ "0.66529447", "0.6280274", "0.6166548", "0.6112025", "0.6032877", "0.6008419", "0.59664756", "0.5953421", "0.5951233", "0.59288967", "0.591167", "0.5911403", "0.59016657", "0.5894343", "0.58493495", "0.5847462", "0.5846205", "0.5845573", "0.5842838", "0.5840691", "0.58360964"...
0.6647929
1
End attack calculation testing Start potential move calculation testing Pawn
def test_check_calculate_white_pawn_move e = RulesEngine.new place_pieces(e, " - - - - - - - - - - - - - K - - - - - - - - - - k - - - - - - - - - - - - - - - - - - p - - - - - - - - - - - - - - - - - - - - ") expected = " - - - - - - - - ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_battle\n #move1_cd = 0\n #move1 = ((@battle_health_points/3) * 2)\n #move1. = @battle_health_points - @battle_health_points/3\n #move1.. = move1_cd = 3\n #crit_strike = move1 && move1. && move1_cd\n\n\n end", "def moves\n forward_steps + side_attacks\n end", "def legal_move?(new_x,...
[ "0.6728327", "0.6473752", "0.6426345", "0.6392914", "0.6348608", "0.634328", "0.63120717", "0.62818635", "0.6281349", "0.62666047", "0.6265548", "0.6258728", "0.6251734", "0.62500143", "0.62419015", "0.6216829", "0.6206916", "0.6204873", "0.61975217", "0.6193013", "0.6168841"...
0.6898697
0
End potential move calculation testing Start legal move check testing Pawn
def test_chk_mv_pawn e = RulesEngine.new # cannot move a "pawn" from an empty square assert_equal(e.chk_mv(Coord.from_alg('e3'), Coord.from_alg('e4')), false) # can move one square forward assert_equal(e.chk_mv(Coord.from_alg('e2'), Coord.from_alg('e3')), true) # cannot move one square forwar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_check_calculate_white_pawn_move\n e = RulesEngine.new\n place_pieces(e, \"\n - - - - - - - - \n - - - - - K - -\n - - - - - - - - \n k - - - - - - - \n - - - - - - - - \n - - - p - - - - \n - - - - - - - - \n - - - - - - - -\n \")\n expected = \"\n ...
[ "0.74989116", "0.74665153", "0.70204014", "0.69609374", "0.6878362", "0.6822774", "0.6817381", "0.6813665", "0.6806185", "0.6789589", "0.6783128", "0.6716573", "0.6691472", "0.6666389", "0.666469", "0.6657207", "0.6636099", "0.66359746", "0.6633897", "0.65848756", "0.65694904...
0.7062191
2
End legal move check testing Start checkmate detection testing
def test_should_detect_white_kingside_back_rank_mate e = RulesEngine.new place_pieces(e, " K - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - p p p - - - R - - k - ") assert(e.checkmate?(Colour...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_moves\n\n end", "def test_end_fail\r\n \t@test_prospector.move_count = 1\r\n \tassert_equal false, @test_prospector.end?\r\n end", "def viable_finish(color, x, y, start, check)\n\t\treturn false if (0..7).include?(x) == false\n\t\treturn false if (0..7).include?(y) == false\n\t\tif piece_possible...
[ "0.6748906", "0.6686467", "0.6557585", "0.64754355", "0.64182514", "0.63727486", "0.63409317", "0.6307415", "0.62985706", "0.62956583", "0.62494457", "0.6239697", "0.6236804", "0.6228927", "0.6189895", "0.617438", "0.61720127", "0.6151027", "0.6139624", "0.60885024", "0.60875...
0.0
-1
End checkmate detection testing Start draw detection testing
def test_only_two_kings_is_a_draw e = RulesEngine.new place_pieces(e, " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - K - - k - ") assert(e.draw?(Colour::WHITE)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw? \n end", "def draw_completed? ; false ; end", "def step\n # Draw everything\n @image.draw @screen\n end", "def test_gesture\r\n @point_poller.kill\r\n @current_gesture.name = \"match gesture\"\r\n @current_gesture.action = \"none\"\r\n @current_gesture.convert_points_to_gesture\...
[ "0.59686273", "0.58947694", "0.5757852", "0.56426024", "0.56370664", "0.5606601", "0.5588733", "0.55717844", "0.5571626", "0.55647", "0.5486342", "0.5477861", "0.5477861", "0.54734385", "0.5461823", "0.5461823", "0.5461823", "0.5451985", "0.5448895", "0.5434644", "0.5391474",...
0.49421483
97
End draw detection testing Start check detection testing
def test_should_detect_simple_check e = RulesEngine.new place_pieces(e, " - - - - - - - K - - - - - - - - - - - - - - - - - - - R - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - k - - - - ") e.calculate_colour_attack(Colour::BLACK) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw? \n end", "def draw_completed? ; false ; end", "def test_inactive\n [@window, @sprite, @bitmap].each{|container|\n uc = UCGraph.new(container, 300, 300, 50, @elements, nil, 100, -100, Font.normal_font,\n Color.hp_gauge_color1, Color.hp_gauge_color2,\n ...
[ "0.6435882", "0.6373479", "0.58739626", "0.5869329", "0.57875025", "0.5775651", "0.57334566", "0.57054013", "0.5678989", "0.5646201", "0.5636993", "0.5636993", "0.56364036", "0.56358445", "0.56358445", "0.56358445", "0.56143", "0.5535954", "0.55089647", "0.5500973", "0.547619...
0.0
-1
Start check detection testing Start 3 fold repeatition testing
def test_knights_repeat_moving_should_stalemate e = RulesEngine.new place_pieces(e, " K - - N - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - k - - n - - - - ") e.move!(D1, B2); e.move!(D8, B7); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run\n test_using_random_sample\n test_using_first_of\n end", "def start_continuous_testing!\n InfinityTest::ContinuousTesting.new.start!\n end", "def start_continuous_testing!\n InfinityTest::ContinuousTesting.new.start!\n end", "def login_load(count=1)\n \tfor i in 0....
[ "0.5967105", "0.5907354", "0.5907354", "0.567601", "0.56743765", "0.56010467", "0.5589964", "0.5576115", "0.5572902", "0.5570699", "0.55577344", "0.55550766", "0.55537426", "0.5491306", "0.5469283", "0.5469283", "0.5454975", "0.5451293", "0.54402167", "0.54100966", "0.5356146...
0.0
-1
Send an event received from Redis to the EventMachine channel
def dispatch(message, channel) if channel =~ /^slanger:/ # Messages received from the Redis channel slanger:* carry info on # subscriptions. Update our subscribers accordingly. update_subscribers message else push message.to_json end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle_redis_event(event)\n #puts \"REDIS HANDLE #{event.inspect}\"\n case event['t']\n when 'msg'\n if has_channel_id?(event['channel_id'])\n send_message(event['channel_id'], event['msg_t'], event['data'])\n end\n when 'refresh_users'\n refresh_users\n when 'refresh_chann...
[ "0.74292", "0.69373107", "0.64158076", "0.64158076", "0.6299367", "0.621605", "0.6202851", "0.62003934", "0.6128844", "0.60769564", "0.6076467", "0.6062318", "0.6039106", "0.60371006", "0.59567624", "0.59506387", "0.58860743", "0.58822984", "0.5853762", "0.5829491", "0.580843...
0.54187626
54
This is the state of the presence channel across the system. kept in sync with redis pubsub
def subscriptions @subscriptions ||= get_roster || {} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def presence_status\n # Memoize for the life of the instance to help with sorting...\n return @presence_status unless @presence_status.nil?\n redis = Worlize::RedisConnectionPool.get_client(:presence)\n result = redis.get(\"status:#{self.guid}\")\n \n # an 'offline' status is represented by the a...
[ "0.68661153", "0.6191079", "0.5996669", "0.59367394", "0.5916697", "0.59124905", "0.59073", "0.5896783", "0.5895172", "0.58817834", "0.5866661", "0.5860123", "0.58432144", "0.58291245", "0.5826917", "0.58208096", "0.58156145", "0.5807861", "0.57585603", "0.5721214", "0.571008...
0.0
-1
This is used map public subscription ids to em channel subscription ids. em channel subscription ids are incremented integers, so they cannot be used as keys in distributed system because they will not be unique
def internal_subscription_table @internal_subscription_table ||= {} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def channel_keys\n %w[ channel room ]\n end", "def channel_ids_to_add\n @channel_ids_to_add ||= begin\n cids = []\n cids.concat Array(data[\"to_channel_in_group\"]) unless data[\"to_channel_in_group\"].blank?\n Array(data[\"to_channel_out_group\"]).each do |acid|\n cids << acid\n ...
[ "0.59036654", "0.5847305", "0.5800829", "0.57957226", "0.5783717", "0.5707556", "0.5609562", "0.56050247", "0.55951715", "0.5486304", "0.54775244", "0.54416907", "0.5401799", "0.5385916", "0.5385764", "0.53584784", "0.5343896", "0.5325342", "0.5323532", "0.5315581", "0.531223...
0.62425554
0
This is the real meat of the simulation. All known agents get a chance to move, then zombification kicks in.
def step newLocations = Hash.new{|h, k| h[k] = AgentList.new} @@locations.each do |here,agents| zombiesHere = AgentList.new humansHere = AgentList.new # sort into zombies/humans; will need to know in order # to figure out if we should try to make more zombies agents.each do |age...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execute\n if Settings['zombie']['spawn']['chance'] > rand() * 100\n number_of_zombies = rand(1..5)\n puts \"spawning #{number_of_zombies} zombies\" unless Rails.env.test?\n number_of_zombies.times do\n spawn_point = random_spawn_coords(lat: character.lat, lon: character.lon)\n Z...
[ "0.6840584", "0.6733912", "0.65496844", "0.63528824", "0.62073046", "0.6126399", "0.61031777", "0.60761166", "0.606488", "0.60527945", "0.59360194", "0.59331894", "0.59287965", "0.5896534", "0.5878066", "0.5876672", "0.58605206", "0.58122677", "0.5806078", "0.5793891", "0.578...
0.63203526
4
Eager load all dependent RichText models in bulk.
def with_all_rich_text eager_load(rich_text_association_names) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eager_load; end", "def eager_load; end", "def eager_load; end", "def eager_load!; end", "def eager_load!; end", "def eager_load!; end", "def eager_load!; end", "def eager_load_all\n Registry.loaders.each(&:eager_load)\n end", "def eager\n raise Error, \"eager loading disabl...
[ "0.5989371", "0.5989371", "0.5989371", "0.5977592", "0.5977592", "0.5977592", "0.5977592", "0.5930053", "0.58992994", "0.5834039", "0.55647683", "0.5546773", "0.5546773", "0.5543576", "0.54587436", "0.5457433", "0.54550177", "0.54514885", "0.53711313", "0.5339495", "0.5335011...
0.74036646
0
Not tested. Since it's mandatory to provide credit card number it can be a big security vulnerability.
def refund(credit_card, authorization, options = {}) post = {} auth_string_codes = get_authorization_paytype_and_subtranstype(authorization) self.ref = auth_string_codes[:authorization] post[:paytype] = auth_string_codes[:paytype] post[:ccdate] = auth_string_codes[:ccdate] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def credit_card_number; end", "def card_number_secure\n @card.display_number\n end", "def get_credit_card\n end", "def credit_card_number\n Faker::Business.credit_card_number\n end", "def card_number\n s1 = s2 = 0\n cc_number = @record.cc_number.gsub(/\\D/, '') # remove all white...
[ "0.82148314", "0.7728617", "0.7428726", "0.7395598", "0.726602", "0.7158216", "0.71461713", "0.7117157", "0.7117157", "0.70763254", "0.70361114", "0.6940937", "0.69214207", "0.6885287", "0.68734103", "0.6859842", "0.68479586", "0.6823819", "0.68197185", "0.6793748", "0.678020...
0.0
-1
Telemoney requires a unique transaction number and we are generating it within our class than expecting it from outside. However if there's an outside UTRN it'll be used
def unique_transaction_number chars = [('a'..'z'),('A'..'Z')].map{|i| i.to_a}.flatten string = (0...10).map{ chars[rand(chars.length)] }.join + Time.now.to_i.to_s end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_webpay_trx_id\n Digest::MD5.hexdigest(\"#{self.order.number}#{self.order.payments.count}\")\n end", "def transaction_uuid\n @transaction_uuid ||= SecureRandom.uuid\n end", "def set_number\n return set_transaction_id if self.id\n #self.transaction_id = (Time.now.to_i).to_s(CHA...
[ "0.71420646", "0.70999616", "0.69862264", "0.6967474", "0.6796628", "0.67609227", "0.6553006", "0.65099686", "0.64832056", "0.64832056", "0.6419895", "0.6389788", "0.63204664", "0.6213608", "0.619729", "0.61690265", "0.6158877", "0.6158744", "0.607647", "0.6055803", "0.604965...
0.7286203
0
Adds a new record to the database. +fiedls+:: A Hashmap with the fields and values from which to create a new record Returns the ID of the newly created record or nil in case of error.
def create fields fields.delete_if {|key, value| !@validFields.include? key} selection = "" values = "" fields.each do |key, value| selection += "#{key}, " values += "'#{value}', " end selection = selection[0..-3] values = values[0..-3] begin query = "INSERT INTO #{@table}(#{selection}) VALU...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n check_fields\n sql = \"INSERT INTO #{table} VALUES (NULL,#{to_create_record_str})\"\n Database.transaction(sql)\n sql = \"SELECT id FROM #{table} WHERE #{to_find_id_str}\"\n @id = Database.execute(sql).last[0]\n @log.debug \"Record[#{self}] is added to Table[#...
[ "0.6776581", "0.6342509", "0.6179984", "0.6089984", "0.60882854", "0.6039898", "0.60294145", "0.6026296", "0.59932405", "0.5981921", "0.5943647", "0.59427005", "0.57986325", "0.5787586", "0.5735635", "0.57258326", "0.5719946", "0.5654987", "0.5632611", "0.5624449", "0.5593076...
0.0
-1
Read information about a ticket from the database +fields+:: An array with the field values to retrieve +primaryFilter+:: This is the main filter for the query. It expects an array with the first value being a field in the database and the second value being the value to filter for on this field +orFilter+:: A Hashtabl...
def read fields, primaryFilter = nil, orFilter = nil, andFilter = nil, notFilter = nil fields.delete_if {|key, value| !@validFields.include? key} selection = fields.count > 1 ? fields.join(", ") : fields[0] begin query = "SELECT #{selection} FROM #{@table}" if primaryFilter query += " WHERE #{prima...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fields(filter = nil)\n unless filter\n # Since we're returning the FieldMap object, which the caller\n # may mutate, we precautionarily mark dirty -- unless it's frozen\n # immutable.\n @fields.clean = false unless @fields.frozen?\n return @fields\n end\n @fiel...
[ "0.5712022", "0.5401826", "0.5336844", "0.52965635", "0.5211919", "0.5211919", "0.5197587", "0.515592", "0.506209", "0.5055514", "0.5033255", "0.502924", "0.49776626", "0.49774605", "0.49630275", "0.4934295", "0.49180102", "0.49118173", "0.49081984", "0.4907731", "0.4898306",...
0.78828
0
Updates a record in the databas +fields+:: A Hashtable where the keys are the fields in the table and the values are the fields new values +primaryFilter+:: This is the main filter for the query. It expects an array with the first value being a field in the database and the second value being the value to filter for on...
def update fields, primaryFilter = nil, orFilter = nil, andFilter = nil, notFilter = nil fields.delete_if {|key, value| !@validFields.include? key} if fields.count > 0 begin query = "UPDATE #{@table} SET" fields.each {|key, value| query += " #{key}='#{value}',"} timestamp = Time.now query += "up...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_update_filter( *args )\n opts = args.last.is_a?( Hash ) ? args.pop.dup : {}\n\n opts[ :fields ] ||= args.shift #deprecated\n opts[ :on_content ] ||= args.shift\n opts[ :on_ref_update ] ||= args.shift\n opts[ :on_ref_new ] ||= args.shift\n\n ...
[ "0.5844586", "0.5800714", "0.57665855", "0.5764554", "0.5764554", "0.55474436", "0.5546333", "0.5537482", "0.5509199", "0.5509199", "0.55088216", "0.5501243", "0.54534817", "0.54534817", "0.54435074", "0.54277855", "0.5408024", "0.54008615", "0.5400365", "0.53847337", "0.5384...
0.82116634
0
Deletes a record from the database. +field+:: An array with the first value being the field and the second one the value to delete Returns true if there were matching records and they were deleted, false in case there were no matching record and nil in case of mysql error.
def delete field begin ticket = read ['id'], field if ticket.count > 0 @dbh.query "DELETE FROM #{@table} WHERE #{field[0]}='#{field[1]}'" true else false end rescue Mysql::Error => e puts "Error: #{e.error}" nil end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_field(*fields)\n fields.each {|f|\n f = check_field(f)\n raise ArgumentError, \"can not delete reserved field: #{f.inspect}\" if f.start_with?(\"_\") \n @tbl.delete(f)\n @field_list.delete(f)\n }\n nil\n end", "def delete(field)\n redis.hdel @key, field\n end", "def...
[ "0.6578551", "0.6531119", "0.62746423", "0.6041845", "0.59067893", "0.5773582", "0.5758832", "0.56925416", "0.56469166", "0.5644455", "0.5643813", "0.5538985", "0.55212194", "0.5445708", "0.5420702", "0.53666", "0.533268", "0.53289163", "0.5327816", "0.5274953", "0.5274953", ...
0.8023359
0