query
stringlengths
7
6.41k
document
stringlengths
12
28.8k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Create an inbox ruleset Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving
def create_new_inbox_ruleset(create_inbox_ruleset_options, opts = {}) data, _status_code, _headers = create_new_inbox_ruleset_with_http_info(create_inbox_ruleset_options, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_inbox_ruleset(inbox_id, create_inbox_ruleset_options, opts = {})\n data, _status_code, _headers = create_inbox_ruleset_with_http_info(inbox_id, create_inbox_ruleset_options, opts)\n data\n end", "def test_new_inbox_ruleset(test_new_inbox_ruleset_options, opts = {})\n data, _status_co...
[ "0.61950773", "0.5751447", "0.5678452", "0.5643247", "0.54154164", "0.53206235", "0.52772284", "0.52740157", "0.52516335", "0.525135", "0.5231989", "0.5219381", "0.5214958", "0.51981", "0.51866287", "0.514604", "0.5103869", "0.50939095", "0.50881296", "0.50880677", "0.5080491...
0.6304485
0
Delete an inbox ruleset Delete inbox ruleset
def delete_inbox_ruleset(id, opts = {}) delete_inbox_ruleset_with_http_info(id, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_inbox_rulesets(opts = {})\n delete_inbox_rulesets_with_http_info(opts)\n nil\n end", "def destroy\n @rule_set = RuleSet.find(params[:id])\n @rule_set.destroy\n\n respond_to do |format|\n format.html { redirect_to rule_sets_url }\n format.json { head :ok }\n end\n en...
[ "0.7691972", "0.66032934", "0.65967035", "0.63888776", "0.6176017", "0.61702317", "0.59798986", "0.59178627", "0.5816386", "0.57613325", "0.57417184", "0.5738284", "0.5737985", "0.57039267", "0.56656593", "0.56450397", "0.5606443", "0.5570346", "0.55576843", "0.55542505", "0....
0.6839362
1
Delete inbox rulesets Delete inbox rulesets. Accepts optional inboxId filter.
def delete_inbox_rulesets(opts = {}) delete_inbox_rulesets_with_http_info(opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_inbox_ruleset(id, opts = {})\n delete_inbox_ruleset_with_http_info(id, opts)\n nil\n end", "def delete_inbox_rulesets_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: InboxRulesetControllerApi.delete_inbox_rulesets ......
[ "0.7091587", "0.68988985", "0.6226191", "0.59654415", "0.5943421", "0.5937195", "0.56038946", "0.54905397", "0.54545236", "0.54135305", "0.5299187", "0.5285349", "0.5271623", "0.5268008", "0.5263276", "0.52274543", "0.51354396", "0.51113975", "0.51058125", "0.50943893", "0.50...
0.8147999
0
List inbox rulesets List all rulesets attached to an inbox
def get_inbox_rulesets(opts = {}) data, _status_code, _headers = get_inbox_rulesets_with_http_info(opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_inbox_rulesets(inbox_id, opts = {})\n data, _status_code, _headers = list_inbox_rulesets_with_http_info(inbox_id, opts)\n data\n end", "def ruleset_rules\n @rulesets.collect do |r|\n [\"# Begin [#{r.name}]\",\n r.firewall_rules,\n \"# End [#{r.name}]\",\n \"\"]\n ...
[ "0.76426435", "0.7247974", "0.6769916", "0.64807636", "0.61858845", "0.6144545", "0.612242", "0.60838485", "0.60390484", "0.60120493", "0.59073216", "0.58550584", "0.57910347", "0.57639754", "0.5679666", "0.5676389", "0.5623009", "0.55354303", "0.55354303", "0.5493309", "0.54...
0.7625467
1
Test an inbox ruleset Test an inbox ruleset
def test_inbox_ruleset(id, inbox_ruleset_test_options, opts = {}) data, _status_code, _headers = test_inbox_ruleset_with_http_info(id, inbox_ruleset_test_options, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_inbox_rulesets_for_inbox(inbox_id, inbox_ruleset_test_options, opts = {})\n data, _status_code, _headers = test_inbox_rulesets_for_inbox_with_http_info(inbox_id, inbox_ruleset_test_options, opts)\n data\n end", "def test_inbox_rulesets_for_inbox_with_http_info(inbox_id, inbox_ruleset_test_o...
[ "0.68785197", "0.6313421", "0.59523785", "0.58934397", "0.5879393", "0.56199455", "0.55669504", "0.5560386", "0.5536923", "0.55095834", "0.5430169", "0.5301235", "0.5293016", "0.52534896", "0.52376497", "0.5207789", "0.51600164", "0.51548076", "0.51447135", "0.5132889", "0.51...
0.6450755
1
Test inbox rulesets for inbox Test inbox rulesets for inbox
def test_inbox_rulesets_for_inbox(inbox_id, inbox_ruleset_test_options, opts = {}) data, _status_code, _headers = test_inbox_rulesets_for_inbox_with_http_info(inbox_id, inbox_ruleset_test_options, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_inbox_rulesets_for_inbox_with_http_info(inbox_id, inbox_ruleset_test_options, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: InboxRulesetControllerApi.test_inbox_rulesets_for_inbox ...'\n end\n # verify the required parameter 'inbox_id' i...
[ "0.6427489", "0.6315927", "0.60893935", "0.58721715", "0.5780896", "0.5497661", "0.5484492", "0.5480035", "0.5434681", "0.54239094", "0.53774464", "0.53744745", "0.5336081", "0.51936847", "0.51283765", "0.51251245", "0.5080757", "0.50705403", "0.5008124", "0.49881157", "0.498...
0.72629654
0
Test inbox rulesets for inbox Test inbox rulesets for inbox
def test_inbox_rulesets_for_inbox_with_http_info(inbox_id, inbox_ruleset_test_options, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxRulesetControllerApi.test_inbox_rulesets_for_inbox ...' end # verify the required parameter 'inbox_id' is set ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_inbox_rulesets_for_inbox(inbox_id, inbox_ruleset_test_options, opts = {})\n data, _status_code, _headers = test_inbox_rulesets_for_inbox_with_http_info(inbox_id, inbox_ruleset_test_options, opts)\n data\n end", "def test_inbox_ruleset(id, inbox_ruleset_test_options, opts = {})\n data, ...
[ "0.72629654", "0.6315927", "0.60893935", "0.58721715", "0.5780896", "0.5497661", "0.5484492", "0.5480035", "0.5434681", "0.54239094", "0.53774464", "0.53744745", "0.5336081", "0.51936847", "0.51283765", "0.51251245", "0.5080757", "0.50705403", "0.5008124", "0.49881157", "0.49...
0.6427489
1
Test new inbox ruleset Test new inbox ruleset
def test_new_inbox_ruleset(test_new_inbox_ruleset_options, opts = {}) data, _status_code, _headers = test_new_inbox_ruleset_with_http_info(test_new_inbox_ruleset_options, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_inbox_rulesets_for_inbox(inbox_id, inbox_ruleset_test_options, opts = {})\n data, _status_code, _headers = test_inbox_rulesets_for_inbox_with_http_info(inbox_id, inbox_ruleset_test_options, opts)\n data\n end", "def test_inbox_rulesets_for_inbox_with_http_info(inbox_id, inbox_ruleset_test_o...
[ "0.64125824", "0.60827935", "0.5998476", "0.5913734", "0.56242436", "0.5592575", "0.55215394", "0.5515756", "0.5394641", "0.53827137", "0.5276402", "0.5274095", "0.5244903", "0.52198315", "0.52137554", "0.51923436", "0.5175251", "0.5127945", "0.5124497", "0.5117424", "0.50990...
0.6669657
0
merge pr_branch into upstream targeted branch
def merge_pr_totarget(upstream, pr_branch, repo) goto_prj_dir(repo) # check that we are in a git dir check_git_dir `git checkout #{upstream}` `git remote update` `git fetch` `git pull origin #{upstream}` `git checkout -b PR-#{pr_branch} origin/#{pr_branch}` puts `git branch` end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge_pr_totarget(upstream, pr_branch)\n goto_prj_dir\n check_git_dir\n `git checkout #{upstream}`\n check_duplicata_pr_branch(\"#{pr_fix}#{pr_branch}\")\n `git remote update`\n `git fetch`\n `git pull origin #{upstream}`\n `git checkout -b #{pr_fix}#{pr_branch} origin/#{pr_branch}`\n ...
[ "0.8051848", "0.6836924", "0.6743151", "0.6703898", "0.6445372", "0.63865745", "0.6333562", "0.6296837", "0.6247566", "0.6168456", "0.61101", "0.6103195", "0.60160255", "0.6002186", "0.6000863", "0.59704703", "0.59190494", "0.587834", "0.5839706", "0.5823195", "0.582193", "...
0.8003641
1
cleanup the pr_branch(delete it)
def del_pr_branch(upstream, pr) `git checkout #{upstream}` `git branch -D PR-#{pr}` end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def del_pr_branch(upstream, pr)\n `git checkout #{upstream}`\n `git branch -D #{pr_fix}#{pr}`\n end", "def clean_tree(branch)\n\n branch.children = branch.children.inject(Children.new(branch)) do |r, c|\n cc = if c.name == 'sequence' and c.children.size == 1\n c.children.first\n ...
[ "0.7179789", "0.6870446", "0.678229", "0.678229", "0.6617888", "0.6564336", "0.6564336", "0.6541621", "0.6541621", "0.6541621", "0.6541621", "0.651397", "0.651397", "0.651397", "0.6484305", "0.6484305", "0.6484305", "0.6484305", "0.647548", "0.647548", "0.6420382", "0.64040...
0.711742
1
Start a pryremoteem server
def run(obj, host = DEFHOST, port = DEFPORT, opts = {:tls => false}) tries = :auto == port ? 100.tap{ port = DEFPORT } : 1 # TODO raise a useful exception not RuntimeError raise "root permission required for port below 1024 (#{port})" if port < 1024 && Process.euid != 0 begin E...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_server\n erl = CliRunner.open 'skirmish_server', 'erl', /\\d>/, /Eshell/\n erl << \"code:add_path(\\\"#{server_dir}/ebin\\\").\" >> /true/\n erl << \"application:start(skirmish_server).\" >> /ok/\n @automation_server = erl\n log.info(\"Automation#start_server\") { \"server star...
[ "0.63203704", "0.61644065", "0.61449873", "0.60924476", "0.6028563", "0.6018178", "0.58099306", "0.57852554", "0.5699426", "0.5672735", "0.56571615", "0.56401294", "0.563884", "0.5634684", "0.56253934", "0.56201166", "0.556598", "0.5563213", "0.55624896", "0.55548394", "0.554...
0.6956129
0
auth_attempt(args, &blk) Registers a block to call when authentication fails.
def auth_fail(*args, &blk) block_given? ? @auth_fail_cbs << blk : @auth_fails.push(args) while (fail_data = @auth_fails.shift) @auth_fail_cbs.each { |cb| cb.call(*fail_data) } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def auth_attempt(*args, &blk)\n block_given? ? @auth_attempt_cbs << blk : @auth_attempts.push(args)\n while (auth_data = @auth_attempts.shift)\n @auth_attempt_cbs.each { |cb| cb.call(*auth_data) }\n end\n end", "def token_auth(*args, &block); end", "def auth_ok(*args, &blk)\n bloc...
[ "0.79108554", "0.58806264", "0.5812654", "0.5794389", "0.57523674", "0.56922996", "0.5638406", "0.55901074", "0.5588444", "0.5564731", "0.55596066", "0.55021936", "0.5465623", "0.5437874", "0.5423029", "0.5395928", "0.5385815", "0.538531", "0.5371494", "0.53482777", "0.529639...
0.66621166
1
Determine the list(with properties) of the running instances in the given autoscaling group if asg_name is nil it returns nil
def running_hosts_in_asg(asg_name) return nil unless asg_name asg = @auto_scaling.groups[asg_name] return nil unless asg # return a lost of maps having the list of running instances asg.auto_scaling_instances.collect { |i| if i.health_status != 'Healthly' ec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def autoscaling_instances\n autoscaling_group.auto_scaling_instances\n end", "def autoscaling_instances\n autoscaling_group.auto_scaling_instances\n end", "def list_asgs\n # collect the list of running instances in this zone\n ec2 = AWS::EC2.new\n region = ec2.regions[AMI_REGION]\n instanc...
[ "0.7375907", "0.7375907", "0.70902634", "0.6642567", "0.64987755", "0.6257543", "0.61650634", "0.60263926", "0.596555", "0.5959928", "0.5895302", "0.58703625", "0.58542144", "0.5844213", "0.5843603", "0.5732009", "0.5724304", "0.5686478", "0.5668869", "0.55124885", "0.5493279...
0.77462995
0
If the Elastic IP is unhealthy/unreachable, we will try to assign the Elastic IP to this instance
def try_steal_eip unless eip_healthy? # try to steal the eip eip_instance = @ec2.elastic_ips[@eip] raise "cannot find #{@eip} in list of elastic IPs" unless eip_instance instance = @ec2.instances[my_instance_id] instance.associate_elastic_ip(eip_instance) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def aws_instance_elastic_ip_create(instance)\n log \"AWS: creating ElasticIP for Instance '#{instance.id}'\"\n # get elastic ip object\n elastic_ip = aws_call('aws_elastic_ip_create')\n log \"AWS: created ElasticIP '#{elastic_ip.public_ip}'\"\n\n # this is interesting, perhaps elastic ips dont have ...
[ "0.73278844", "0.6686053", "0.6594199", "0.6590179", "0.6534397", "0.6395143", "0.6360093", "0.63496107", "0.6334051", "0.6249226", "0.6174922", "0.61516446", "0.6123249", "0.60844904", "0.60332716", "0.601612", "0.5988108", "0.59795195", "0.5958159", "0.5946782", "0.5938979"...
0.73130995
1
Fetches the instance id for the current machine
def my_instance_id Net::HTTP.get(URI('http://169.254.169.254/1.0/meta-data/instance-id')) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lookup_instance_id\n metadata_endpoint = 'http://169.254.169.254/latest/meta-data/'\n instance_id = Net::HTTP.get( URI.parse( metadata_endpoint + 'instance-id' ) )\n end", "def instance_id\n data[:instance_id]\n end", "def instance_id\n `curl --connect-timeout 1 #{aws_url} 2>&1`...
[ "0.7857428", "0.7545339", "0.7476348", "0.7406198", "0.73788303", "0.73788303", "0.73735946", "0.72641224", "0.726", "0.7204595", "0.7121513", "0.6947031", "0.6941511", "0.6844466", "0.6708967", "0.6573709", "0.6555427", "0.6555427", "0.6555427", "0.6555427", "0.6555427", "...
0.80713713
0
reload/restart nginx, uses /etc/init.d/nginx
def reload_nginx if nginx_running? `/etc/init.d/nginx reload` else `/etc/init.d/nginx restart` end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reload_proxy\n\t\t$LOGGER.info 'Reloading nginx'\n\t\tcmd = 'service nginx reload'\n\t\tsystem(cmd)\n\tend", "def reload_nginx(server, container_id)\n Net::SSH.start( server.host, server.user, :password => server.password) do|ssh|\n ssh.exec!(\"docker exec #{container_id} service nginx reload\"...
[ "0.79236126", "0.7102322", "0.67666537", "0.6441044", "0.6416849", "0.6408178", "0.6153345", "0.61178225", "0.60874027", "0.6076844", "0.60494095", "0.5964963", "0.59200037", "0.5871789", "0.5871153", "0.58465207", "0.5839313", "0.5826008", "0.5826008", "0.5814474", "0.580462...
0.88950115
0
Determine if nginx is running by looking at the pidfile
def nginx_running? if File.exists?('/var/run/nginx.pid') pid = File.open('/var/run/nginx.pid', 'r').readline begin Process.getpgid(pid) true rescue Errno::ESRCH false end else false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_running?\n result = \"\"\n result = `ps -p #{pid} -o cmd=`.gsub(\"\\n\", \"\") unless pid.empty?\n\n result.split.first == \"unicorn\" ? true : false\n end", "def server_running?\n if File.exist? pid_path\n pid = read_pid\n begin\n Process.kill(0, pid)\n rescue E...
[ "0.6798805", "0.66890997", "0.66890997", "0.6441783", "0.6401759", "0.63586205", "0.6339175", "0.62783784", "0.62556356", "0.6184505", "0.61761665", "0.6166316", "0.6106308", "0.6073686", "0.6073686", "0.60048926", "0.5990481", "0.5972232", "0.59679294", "0.5958081", "0.59446...
0.87879604
0
application_id is duplicated across supported_permissions and user_application_permissions to efficiently address common queries for a user's permissions for a particular application
def assign_application_id self.application_id = supported_permission.application_id if supported_permission.present? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def application_id=(value)\n @application_id = value\n end", "def application_id\n return @application_id\n end", "def set_application\n @application = current_user.oauth_applications.find(params[:id])\n end", "def current_application\n fail 'A...
[ "0.6681327", "0.6640151", "0.6611282", "0.6348934", "0.6262077", "0.62194884", "0.6131442", "0.6131442", "0.6131442", "0.612916", "0.6129045", "0.6113676", "0.6101291", "0.6096036", "0.6041295", "0.6041295", "0.6041295", "0.60290617", "0.6013088", "0.59781474", "0.59571505", ...
0.7259442
0
Sections Creates OpenNebula section if not exists and returns its section_id. Returns its section_id if OpenNebula section already exists
def init_section one_section = section_by_name(NSXConstants::ONE_SECTION_NAME) one_section ||= create_section(NSXConstants::ONE_SECTION_NAME) return one_section['id'] if one_section end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_section(section_name)\n section_spec = %(\n {\n \"display_name\": \"#{section_name}\",\n \"section_type\": \"LAYER3\",\n \"stateful\": true\n }\n )\n section_id = @nsx_client.post(@url_sections,...
[ "0.6829747", "0.66241634", "0.6505443", "0.64422566", "0.6417074", "0.6398628", "0.6339004", "0.6321444", "0.62967265", "0.6289301", "0.62361777", "0.6213183", "0.6184537", "0.61252946", "0.60952663", "0.6063346", "0.6035641", "0.60046005", "0.595171", "0.59381676", "0.593314...
0.66754615
1
Rules Get all rules of a Section, OpenNebula section if it's not defined Return: [Array]
def rules(section_id = @one_section_id) url = @url_sections + '/' + section_id + '/rules' @nsx_client.get(url) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rules\n @rules ||= []\n end", "def rules\n @rules ||= []\n end", "def rules\n @rules=get_endpoint('rule').keys\n end", "def rules_by_name(rule_name, section_id = @one_section_id)\n rules = []\n return rules unless section_id\n\n all_rules =...
[ "0.7178252", "0.7178252", "0.6827643", "0.6758144", "0.67529285", "0.67529285", "0.67529285", "0.6748341", "0.6725025", "0.66927266", "0.6680149", "0.664293", "0.66340744", "0.6482018", "0.6482018", "0.639741", "0.63935256", "0.63638026", "0.63638026", "0.63638026", "0.636380...
0.7895761
0
Get rules by name Return: Array with rules or an empty array
def rules_by_name(rule_name, section_id = @one_section_id) rules = [] return rules unless section_id all_rules = rules(section_id) return rules unless all_rules all_rules['results'].each do |rule| rules << rule if rule['display_name'] == rule...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rules_by_name; end", "def rules\n @rules ||= []\n end", "def rules\n @rules ||= []\n end", "def rules\n return [] if @rules.empty?\n @rules.sort_by { |k| k['priority'] }.map { |h| h['rule_name'] }\n end", "def rules\n @rules.map{|r| [r.name, r.r...
[ "0.79867315", "0.74063736", "0.74063736", "0.73643637", "0.71903485", "0.7157202", "0.7052736", "0.70458055", "0.6990094", "0.6828639", "0.68274844", "0.68274844", "0.68274844", "0.6779544", "0.6777009", "0.6730316", "0.6652361", "0.6652361", "0.65962505", "0.6592785", "0.656...
0.7983357
1
Get rule by regex Return: Array with rules or an empty array
def rules_by_regex(regex, section_id = @one_section_id) rules = [] return rules unless section_id all_rules = rules(section_id) return rules unless all_rules all_rules['results'].each do |rule| rules << rule if rule['display_name'].match(rege...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patterns\n #@rules.every.pattern\n @rules.map {|r| r.pattern }\n end", "def rules\n @rules ||= []\n end", "def rules\n @rules ||= []\n end", "def rules_for(path)\n @rules.reverse.select do |rule| path.match(rule.pattern) end\n end", "def rules\n @rules.ma...
[ "0.6460382", "0.63995034", "0.63995034", "0.630223", "0.62057614", "0.6033021", "0.6027661", "0.60276264", "0.6020229", "0.5895967", "0.5850633", "0.57945204", "0.5789702", "0.57661474", "0.57350147", "0.57350147", "0.57350147", "0.57267535", "0.57172036", "0.5707666", "0.568...
0.7893675
0
POST /personas_nota_seguimiento POST /personas_nota_seguimiento.json
def create @persona = Persona.find(params[:persona_id]) @persona_nota_seguimiento = PersonaNotaSeguimiento.new(persona_nota_seguimiento_params) @persona_nota_seguimiento.persona = @persona @persona_nota_seguimiento.usuario = current_usuario if @persona_nota_seguimiento.save redirect_to @person...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def persona_nota_seguimiento_params\n params.require(:persona_nota_seguimiento).permit(:fecha, :notas)\n end", "def set_persona_nota_seguimiento\n @persona_nota_seguimiento = PersonaNotaSeguimiento.find(params[:id])\n @persona = @persona_nota_seguimiento.persona\n end", "def create\n @n...
[ "0.7370511", "0.6545128", "0.6458106", "0.64423764", "0.6388305", "0.63723826", "0.62660915", "0.6233119", "0.6227858", "0.62270534", "0.62227035", "0.6217265", "0.6158079", "0.6150249", "0.61256623", "0.6123591", "0.6121697", "0.6101684", "0.6089453", "0.6079128", "0.6058509...
0.67692447
1
PATCH/PUT /personas_nota_seguimiento/1 PATCH/PUT /personas_nota_seguimiento/1.json
def update if @persona_nota_seguimiento.update(persona_nota_seguimiento_params) redirect_to @persona, notice: 'Actualizado Correctamente.' else render :edit end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @persona = Persona.find(params[:id])\n \n respond_to do |format|\n if @persona.update_attributes(params[:persona])\n format.json { head :ok }\n else\n format.json { render :json => @persona.errors,\n :status => :unprocessable_entity }\n end\n end\n end"...
[ "0.6841325", "0.6619079", "0.65937996", "0.6589062", "0.65454906", "0.6499792", "0.6499037", "0.64868534", "0.64754456", "0.64686185", "0.64641", "0.6438015", "0.6416083", "0.640001", "0.6390569", "0.63641244", "0.6339741", "0.6337494", "0.63334876", "0.6330799", "0.6292913",...
0.662769
1
This will remove employee from repair order.
def repair_order_employees_delete @repair_order_employee = current_business_user.employee_users_repair_orders.find(params[:id]) @repair_order_employee.destroy if @repair_order_employee render json: { repair_order_employees: @repair_order_employee.as_json }, status: :ok else render jso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_staff(employee)\n employee = Employee.find(employee.id)\n employee.delete!\n end", "def fire_employee(employee)\n @employees.reject! {|employ| employ.employee_id == employee.employee_id}\n\n end", "def remove_employee\n @leave_group = LeaveGroup.find(params[:id], :include => :leave_gro...
[ "0.6307913", "0.58369", "0.57848895", "0.5764783", "0.5715977", "0.5702808", "0.5700814", "0.56936324", "0.5478375", "0.54597366", "0.54225135", "0.53794736", "0.53688735", "0.53660476", "0.53537995", "0.53265333", "0.53108823", "0.5268773", "0.526638", "0.52505535", "0.52394...
0.66330475
0
Confirms if the user is dungeon user.
def is_dungeon_master_user game = Game.find_by id: params[:game_id] if game.nil? or !dungeon_master?(game.dungeon_master) redirect_to(root_url) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_dungeon_master_user\n\t game = Game.find_by id: params[:id]\n\t if game.nil? or !dungeon_master?(game.dungeon_master)\n\t \tredirect_to(root_url) \n\t end\n\t end", "def mine?\n user && user.username == Codeplane.username\n end", "def dorm \n dorm_selection == 'd' || dorm_sele...
[ "0.6704577", "0.597449", "0.5938529", "0.58971345", "0.5706273", "0.5698041", "0.56844586", "0.5679694", "0.5609855", "0.5595255", "0.5530404", "0.55226296", "0.5505578", "0.54713666", "0.5470359", "0.544884", "0.5438849", "0.54307294", "0.5424523", "0.5394532", "0.5391846", ...
0.6637271
1
POST /ujumbes POST /ujumbes.json
def create @ujumbe = current_user.ujumbes.build(ujumbe_params) @user = current_user respond_to do |format| if @ujumbe.save format.html { redirect_to edit_ujumbe_path(@ujumbe), notice: 'Ujumbe was successfully created. You can now complete it' } format.json { render action: 'show', sta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @uen = Uen.new(uen_params)\n\n respond_to do |format|\n if @uen.save\n format.html { redirect_to @uen, notice: 'Uen was successfully created.' }\n format.json { render :show, status: :created, location: @uen }\n else\n format.html { render :new }\n format.js...
[ "0.5899258", "0.5831015", "0.58132327", "0.5761867", "0.57289183", "0.5721775", "0.5714176", "0.5666874", "0.563716", "0.56321365", "0.56295097", "0.5614453", "0.56131285", "0.55882555", "0.55615354", "0.5559517", "0.5544938", "0.55387336", "0.5536661", "0.5529917", "0.552656...
0.632247
0
DELETE /ujumbes/1 DELETE /ujumbes/1.json
def destroy @ujumbe.destroy respond_to do |format| format.html { redirect_to ujumbes_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @uchronia = Uchronia.find(params[:id])\n @uchronia.destroy\n\n respond_to do |format|\n format.html { redirect_to uchronias_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Alien.del...
[ "0.7217802", "0.7060332", "0.6929222", "0.68824005", "0.68503314", "0.6815148", "0.68062234", "0.6800676", "0.67934513", "0.67811805", "0.6777375", "0.67736965", "0.67726445", "0.67614836", "0.6754899", "0.6754666", "0.6753272", "0.674698", "0.67368186", "0.67328006", "0.6728...
0.74149317
0
outputs help for this command argv = commandline arguments
def cmd_help argv help end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cmd_cli_help argv\n setup argv\n msg run_cmd(\"help\")\n end", "def cmd_help(*args)\n\t\tprint(shell.help_to_s)\n\tend", "def help(argm)\n\tif(argm)\n\t\tputs \"Commands:\"\n\t\tprintf \"%-15s %-6s %-10s # Shows the list of commands available\\n\", \n\t\tFile.basename(__FILE__), \"help\", \"\"\n\t\t...
[ "0.8152553", "0.7914385", "0.783073", "0.77173984", "0.77124316", "0.7677662", "0.7677662", "0.7625775", "0.76130044", "0.7587042", "0.75445396", "0.74787354", "0.74484926", "0.7411687", "0.73862004", "0.73381305", "0.7279913", "0.7276883", "0.72541434", "0.72463256", "0.7206...
0.83340836
1
restarts the Mu system services (this does not reboot the appliance) argv = commandline arguments
def cmd_restart argv setup argv response = @api.restart msg response return response end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def restart(*services) = execute(services: services)", "def restart\n invoke :stop, :all => input[:all], :apps => input[:apps]\n\n line unless quiet?\n\n input[:apps].each do |app|\n unless input[:command].nil?\n app.command = input[:command]\n end\n app.update!\n ...
[ "0.7045368", "0.70075876", "0.6826488", "0.66758096", "0.6567114", "0.6566282", "0.6541809", "0.6541809", "0.6541809", "0.65368176", "0.64778584", "0.64727294", "0.64488095", "0.64143676", "0.63433516", "0.63240683", "0.62660694", "0.62453246", "0.6210048", "0.6174986", "0.61...
0.7552381
0
gets the complete System status page argv = commandline arguments
def cmd_status argv setup argv response = @api.status msg response return response end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def command_line_info\n puts \"\\nCommand line arguments:\\n\\n\"\n puts \"This program will accept a single command line argument on launch. Arguments can be passed to draughts_app.rb directly or to draughts.sh\\n\"\n puts \"Example: draughts.sh --help\\n\\n\"\n puts \"-h or --help Display all co...
[ "0.6488304", "0.6299749", "0.61792845", "0.6164793", "0.61597157", "0.61445755", "0.61108774", "0.6023222", "0.6021952", "0.5862398", "0.5859729", "0.5814775", "0.5780555", "0.57691836", "0.5760154", "0.5750055", "0.569719", "0.567924", "0.5660239", "0.5642321", "0.56366444",...
0.6677714
0
validate and save captured data for a given page PUT /answer_sheets/1/pages/1
def update @page = Page.find(params[:id]) questions = @presenter.all_questions_for_page(params[:id]) questions.post(params[:answers], @answer_sheet) questions.save @elements = questions.elements # Save references if params[:reference].present? param...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pages=(v) Axlsx.validate_int v; @pages = v; end", "def copy_to_page(page)\n #start matrix hash\n mq_qc_attribs = self.question_content.attributes\n .except(\"id\", \"created_at\", \"updated_at\", \"questionable_id\")\n\n cloneable_attributes = self.attributes\n .except(\"id\", \"created_at...
[ "0.59559906", "0.58840895", "0.56942695", "0.56148875", "0.5570189", "0.5558975", "0.54998183", "0.5483603", "0.5472866", "0.54584724", "0.5449766", "0.5444113", "0.54349697", "0.54214185", "0.5415297", "0.5396647", "0.5355351", "0.5349202", "0.5349202", "0.53480774", "0.5345...
0.634422
0
GET /organizations/1/sites GET /organizations/1/sites.json
def index @sites = @organization.sites.order(id: :desc).all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n end", "def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n...
[ "0.7147471", "0.7147471", "0.71254146", "0.69968307", "0.6986142", "0.68470156", "0.68342304", "0.6768329", "0.6639676", "0.6638731", "0.6638731", "0.6623737", "0.6592505", "0.6574429", "0.6573962", "0.6565332", "0.6518944", "0.6480263", "0.64783025", "0.64783025", "0.6478302...
0.7183256
0
POST /organizations/1/sites POST /organizations/1/sites.json
def create @site = @organization.sites.new(site_params) respond_to do |format| if @site.save format.html { redirect_to after_create_path, notice: 'Site was successfully created.' } format.json { render :show, status: :created, location: @site } else format.html...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n respond_to do |format|\n if @site = Site.find(entity_id_from_params(:site))\n current_user.account.sites << @site\n format.html { redirect_to root_path, notice: \"The site #{@site.name} @ #{@site.companies.last.name} was successfully added.\" }\n format.json { render json:...
[ "0.7058945", "0.6943568", "0.6846377", "0.6666819", "0.6637744", "0.6290428", "0.6283639", "0.6283639", "0.6283639", "0.6260006", "0.622562", "0.6222387", "0.6181914", "0.61598366", "0.6146918", "0.6116231", "0.6090384", "0.6071778", "0.60521716", "0.60495603", "0.604685", ...
0.7116671
0
create a wrapper object for file upload testing.
def file_for_upload(path) return Mack::Testing::FileWrapper.new(path) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def my_file_upload(filename)\n ActionDispatch::Http::UploadedFile.new({\n filename: filename,\n content_type: 'application/octet-stream',\n tempfile: File.new(\"#{Rails.root}/test/...
[ "0.68456006", "0.6708279", "0.6616751", "0.6452521", "0.6378263", "0.63666016", "0.628917", "0.6283744", "0.62710756", "0.6263768", "0.6251646", "0.6228888", "0.6228575", "0.6222221", "0.6219284", "0.62192285", "0.62175095", "0.6174826", "0.6174584", "0.61704797", "0.61675054...
0.77494377
0
Returns a Rack::MockRequest. If there isn't one, a new one is created.
def request @request ||= Rack::MockRequest.new(mack_app) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mock_req\n Waxx::Req.new(ENV, {}, 'GET', \"/test/test/1\", {}, {}, {}, Time.new).freeze\n end", "def request\n @request ||= Rack::Request.new(@env)\n end", "def request\n @request ||= Rack::Request.new(@env)\n end", "def request(action = :echo)\n @request = Rack::MockReques...
[ "0.7302751", "0.6721054", "0.6721054", "0.6708992", "0.6705215", "0.65880847", "0.64892596", "0.6407008", "0.64007825", "0.6233579", "0.6158257", "0.6046235", "0.6020485", "0.6013836", "0.58620274", "0.5838313", "0.57673687", "0.57213414", "0.5719344", "0.5691426", "0.5667746...
0.76678216
0
Returns all the Rack::MockResponse objects that get generated by a call.
def responses @responses end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stub_responses\n Creditsafe::Api::DummyResponse.new\n end", "def flexmock_calls\n @mock.flexmock_calls\n end", "def responses\n @responses ||= api::BatchResponse.new(responses: responses_by_request.values.uniq)\n end", "def call\n @called = true\n handleResponse @stu...
[ "0.67965686", "0.62189996", "0.6166518", "0.6095895", "0.5956443", "0.59077376", "0.5835776", "0.58202946", "0.5793826", "0.5793826", "0.57685274", "0.572455", "0.5695078", "0.56721073", "0.5668164", "0.56027293", "0.56006056", "0.5578861", "0.5571897", "0.55678666", "0.55567...
0.6235408
1
Clears all the sessions.
def clear_session Mack::SessionStore.expire_all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_sessions \n sessions.each do |key, session|\n logger.info \"Closing: #{key}\"\n session.close\n end \n sessions.clear \n reset_password\n end", "def clear_sessions\n session.keys.each do |key|\n session.delete(key) if key =~ /ranme...
[ "0.8452414", "0.79263383", "0.7830362", "0.7818957", "0.7619269", "0.75342524", "0.7523698", "0.74714786", "0.7399382", "0.7399382", "0.7334237", "0.7311104", "0.72493696", "0.7209435", "0.7172796", "0.7132628", "0.71249425", "0.7069022", "0.7029094", "0.6985302", "0.69773436...
0.8288334
1
3 7 4 2 4 6 8 5 9 3 That is, 3 + 7 + 4 + 9 = 23. Find the maximum total from top to bottom of the triangle below:
def max_sum_triangle number = "75 95 64 17 47 82 18 35 87 10 20 04 82 47 65 19 01 23 75 03 34 88 02 77 73 07 63 67 99 65 04 28 06 16 70 92 41 41 26 56 83 " number += "40 80 70 33 41 48 72 33 47 32 37 16 94 29 53 71 44 65 25 43 91 52 97 51 14 70 11 33 28 77 73 17 78 39 68 17 57 91 71 52 " number += "38 17 14 91 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_sum(triangle)\n # creating array from data input\n arr = triangle.each_line.map { |line| line.split.map(&:to_i) }\n arr.inject([]) { |res, x|\n maxes = [0, *res, 0].each_cons(2).map(&:max)\n x.zip(maxes).map{ |a, b| a + b }\n }.max\nend", "def compute\n # the position of the largest integer ...
[ "0.78049827", "0.7743565", "0.74132496", "0.7371364", "0.7051928", "0.69517654", "0.6834016", "0.6772471", "0.66732824", "0.6659748", "0.6641187", "0.6624022", "0.66204375", "0.6611804", "0.6606299", "0.65959936", "0.6594553", "0.65886986", "0.6586475", "0.6581508", "0.657751...
0.8145354
0
GET /testimonios GET /testimonios.json
def index @testimonios = Testimonio.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n\t@instruction = Instruction.find( params[ :instruction_id ] )\n @testimonies = @instruction.testimonies.page( params[ :page ] ).per(20)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @testimonies }\n end\n end", "def index\n @testmoni...
[ "0.6846062", "0.6368691", "0.63255244", "0.63231325", "0.63231325", "0.608658", "0.606554", "0.5920407", "0.5920306", "0.58811176", "0.5878454", "0.5876871", "0.58477205", "0.58137375", "0.5809874", "0.5787835", "0.57025766", "0.56837815", "0.56659925", "0.5658202", "0.562114...
0.73134476
0
POST /testimonios POST /testimonios.json
def create @testimonio = Testimonio.new(testimonio_params) respond_to do |format| if @testimonio.save format.html { redirect_to @testimonio, notice: 'Testimonio was successfully created.' } format.json { render :show, status: :created, location: @testimonio } else format.htm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_post_sample_traces\n header 'Content-Type', 'application/json'\n\n (0..4).each do |i|\n data = File.read \"sample-traces/#{i}.json\"\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n assert last_response.ok?\n end\n end", "def create\n @testmonial = Testmonial.new...
[ "0.6212472", "0.6196917", "0.6123075", "0.6037751", "0.59311587", "0.5880182", "0.58394265", "0.5687795", "0.5608448", "0.55609363", "0.5557644", "0.5522704", "0.547439", "0.54323614", "0.54271746", "0.54259235", "0.5421392", "0.53978586", "0.538322", "0.5375342", "0.53318685...
0.7398844
0
PATCH/PUT /testimonios/1 PATCH/PUT /testimonios/1.json
def update respond_to do |format| if @testimonio.update(testimonio_params) format.html { redirect_to @testimonio, notice: 'Testimonio was successfully updated.' } format.json { render :show, status: :ok, location: @testimonio } else format.html { render :edit } format.jso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @testmonial = Testmonial.find(params[:id])\n\n if @testmonial.update(testmonial_params)\n head :no_content\n else\n render json: @testmonial.errors, status: :unprocessable_entity\n end\n end", "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \...
[ "0.6371609", "0.6225694", "0.62197536", "0.61011976", "0.60881066", "0.60381603", "0.5989692", "0.59261614", "0.59036803", "0.58820486", "0.58652455", "0.58554685", "0.58460706", "0.5844932", "0.5835631", "0.5827716", "0.58217865", "0.57958645", "0.57856554", "0.5783353", "0....
0.6779583
0
DELETE /testimonios/1 DELETE /testimonios/1.json
def destroy @testimonio.destroy respond_to do |format| format.html { redirect_to testimonios_url, notice: 'Testimonio was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n client.delete(\"/#{id}\")\n end", "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_respons...
[ "0.7171525", "0.7043059", "0.67855144", "0.67855144", "0.67855144", "0.67855144", "0.67782396", "0.67540795", "0.67471486", "0.6695716", "0.66632545", "0.6656628", "0.66558033", "0.66544634", "0.6642121", "0.66078633", "0.6572492", "0.65703607", "0.65622187", "0.65308535", "0...
0.7340553
0
Configuration pointing to the SPEC tests and PIN tool to be used.
def load_configuration # Default configuration. config = File.open('pin_spec.yml', 'r') { |f| YAML.load f } if ARGV[0] # If the first argument is a Yaml configuration file, use that to override # the default configuration. if ARGV[0][-4, 4] == '.yml' config.merge! File.open(ARGV[0], 'r') { |f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def define_config(tool, options={}, &block)\n tool = tool.to_s\n\n @setup ||= {}\n\n if block\n @setup[tool] = Setup.new(tool, options, &block)\n\n # REMOVED: Doing this automatically made it impossible for tools to set the profile.\n #if tool == current_tool\n # configu...
[ "0.6666171", "0.63427824", "0.63379824", "0.6295932", "0.6278882", "0.6180843", "0.61198395", "0.60151243", "0.5979334", "0.5968036", "0.59003645", "0.58436185", "0.5811028", "0.57996154", "0.579483", "0.57865864", "0.57649136", "0.576078", "0.57389414", "0.57224333", "0.5710...
0.7144003
0
Runs the SPEC test suite. Args:: config:: the configuration read by load_configuration
def run_suite(config) # Build the sandbox. FileUtils.rm_rf config[:output_dir] if File.exist? config[:output_dir] FileUtils.mkdir_p config[:output_dir] File.chmod 0777, config[:output_dir] temp_dir = File.join config[:output_dir], '__temp_' + "#{Time.now.strftime("%Y%m%d%H%M%S")}_#{$PID}_#{rand(1 << 20)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_setup(config)\n config_dir = File.join(Dir.pwd, 'test', 'specs', 'config')\n path = Dir.glob(File.join(config_dir, \"#{config}*\")).first\n\n msg = \"No file matching #{config} found in #{config_dir}\"\n raise msg unless path\n\n Thread.abort_on_exception = true\n runner = Thread.new do\n Jackal::...
[ "0.671999", "0.6521156", "0.6399976", "0.62786806", "0.60279274", "0.59057564", "0.5890867", "0.58558154", "0.5836383", "0.5824763", "0.5735378", "0.5709023", "0.56896734", "0.5681503", "0.56168157", "0.5600708", "0.55904984", "0.5569201", "0.55658704", "0.5545642", "0.554267...
0.6525058
1
Amalgalite is just the SQLite database without a separate SQLite installation.
def database_type :sqlite end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_db\n SQLite3::Database.new \"flatiron.db\"\nend", "def default_adapter; :sqlite3 end", "def db\n @db ||= (create_directory cache_path; SQLite3::Database.new cache_path)\n end", "def connect_non_hash\r\n db=SQLite3::Database.new(\"db/slutpro.db\")\r\n return db\r\n ...
[ "0.64350206", "0.61068255", "0.6103155", "0.60929257", "0.6028462", "0.601257", "0.6006739", "0.59370416", "0.59343433", "0.5915107", "0.58316845", "0.58198816", "0.58198816", "0.57879275", "0.5786545", "0.5778258", "0.5775086", "0.57092655", "0.5705476", "0.5705361", "0.5704...
0.63700455
1
Run the given SQL with the given arguments and return the last inserted row id.
def execute_insert(sql, opts=OPTS) _execute(sql, opts){|conn| log_connection_yield(sql, conn){conn.execute_batch(sql)}; conn.last_insert_rowid} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert_sql(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil) #:nodoc:\r\n execute(sql, name)\r\n identity = last_inserted_id(nil)\r\n retval = id_value if retval == 0\r\n return retval\r\n end", "def insert(arel, name = nil, pk = nil, id_value = nil, sequence_na...
[ "0.7050797", "0.6902247", "0.6831938", "0.67946815", "0.6682866", "0.666634", "0.666561", "0.66645235", "0.66423583", "0.6619891", "0.66145515", "0.6551884", "0.65190595", "0.65190595", "0.6498258", "0.64939034", "0.6453291", "0.6448851", "0.64439315", "0.64439315", "0.644156...
0.7131899
0
Mixes in test interface into the configurable module
def enable_test_interface extend Dry::Configurable::TestInterface end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_setup\r\n \r\n end", "def default_test\n end", "def default_test\n end", "def default_test; end", "def test_defaults\n end", "def default_test\r\n end", "def tests; end", "def tests; end", "def testing\n # ...\n end", "def test_frameworks; end", "def defau...
[ "0.6991464", "0.66655016", "0.6605851", "0.65801233", "0.6562955", "0.6542284", "0.6536445", "0.6536445", "0.649413", "0.6437119", "0.6367477", "0.6367477", "0.6339698", "0.6339698", "0.63125294", "0.6263373", "0.6263373", "0.6234911", "0.6210463", "0.62079734", "0.61582726",...
0.7669683
0
to achieve the desired result. You should be able to run this file from your terminal with the command `ruby day_4/exercises/methods.rb` example: Write a method below that, when called will print your name
def print_name puts "Will Meighan" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_name(name)\nputs \"Name: #{name}\"\nend", "def print_name\n p \"Alexander Mathieu\"\nend", "def print_name(name)\n p \"Hello #{name}.\"# YOUR CODE HERE\nend", "def print_name\r\nputs \"Person called #{@name}\"\r\nend", "def print_name(name)\n puts name# YOUR CODE HERE\nend", "def print_name\...
[ "0.78771806", "0.7843837", "0.78232926", "0.7800404", "0.7784476", "0.7767753", "0.77617157", "0.7752038", "0.7751821", "0.7751821", "0.7747604", "0.7747398", "0.7746", "0.77340114", "0.77244216", "0.77244216", "0.77244216", "0.77132976", "0.77130747", "0.77130747", "0.771307...
0.78658485
1
GET /tcpdump_logs GET /tcpdump_logs.json
def index @tcpdump_logs = TcpdumpLog.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_logs(opts = {})\n @transporter.read(:GET, '/1/logs', {}, opts)\n end", "def log\n @client.get(\"#{path}/log\")\n end", "def index\n @server_monitor_logs = ServerMonitorLog.fetch_log(params) \n end", "def retrieve_logs_for_download\n parse_files_for_download\n\n outpu...
[ "0.61444736", "0.5999891", "0.59523606", "0.5877743", "0.58684826", "0.5816977", "0.58129483", "0.5808105", "0.57251155", "0.56888396", "0.56809837", "0.56621057", "0.5640947", "0.55683887", "0.5550424", "0.55443877", "0.55137545", "0.55060226", "0.5446526", "0.54307395", "0....
0.73731434
0
POST /tcpdump_logs POST /tcpdump_logs.json
def create @tcpdump_log = TcpdumpLog.new(tcpdump_log_params) respond_to do |format| if @tcpdump_log.save format.html { redirect_to @tcpdump_log, notice: 'Tcpdump log was successfully created.' } format.json { render :show, status: :created, location: @tcpdump_log } else form...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @tcpdump_logs = TcpdumpLog.all\n end", "def tcpdump_log_params\n params.require(:tcpdump_log).permit(:user_id, :user_data)\n end", "def set_tcpdump_log\n @tcpdump_log = TcpdumpLog.find(params[:id])\n end", "def post_create_clone\n response = self.class.post(\"/service/#{$se...
[ "0.6375744", "0.5935233", "0.59238964", "0.5730587", "0.5652033", "0.5611735", "0.55410427", "0.5426721", "0.53939605", "0.5330068", "0.5319523", "0.52957505", "0.5282459", "0.52764916", "0.52598834", "0.52533084", "0.50917816", "0.505298", "0.5037162", "0.50034153", "0.49326...
0.6979693
0
PATCH/PUT /tcpdump_logs/1 PATCH/PUT /tcpdump_logs/1.json
def update respond_to do |format| if @tcpdump_log.update(tcpdump_log_params) format.html { redirect_to @tcpdump_log, notice: 'Tcpdump log was successfully updated.' } format.json { render :show, status: :ok, location: @tcpdump_log } else format.html { render :edit } forma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def s3LogJsonUpdate(kafka_log_dir)\n println \"kafka log dir : #{kafka_log_dir}\"\n logs_json_path = \"/etc/instance-controller/logs.json\"\n println \"Updating #{logs_json_path}\"\n json_obj=JSON.parse(File.read(\"#{logs_json_path}\"));\n sections = json_obj[\"logFileTypes\"]\n sections.each { |section|\n ...
[ "0.5817983", "0.56800187", "0.5651337", "0.5624282", "0.56066096", "0.55394477", "0.5417865", "0.5318335", "0.52756274", "0.52443546", "0.52240497", "0.5183746", "0.5169122", "0.5164319", "0.50853044", "0.5067027", "0.50628006", "0.50576913", "0.5041863", "0.4991049", "0.4967...
0.6808326
0
DELETE /tcpdump_logs/1 DELETE /tcpdump_logs/1.json
def destroy @tcpdump_log.destroy respond_to do |format| format.html { redirect_to tcpdump_logs_url, notice: 'Tcpdump log was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @logstash = Logstash.find(params[:id])\n @logstash.destroy\n\n respond_to do |format|\n format.html { redirect_to logstashes_url }\n format.json { head :no_content }\n end\n end", "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-tra...
[ "0.65134597", "0.63074255", "0.6267674", "0.6016508", "0.5971034", "0.5964369", "0.5955268", "0.5905765", "0.58796513", "0.58387285", "0.5835509", "0.5817114", "0.57980984", "0.5797562", "0.57947713", "0.5781482", "0.5780291", "0.5770592", "0.57682425", "0.5756064", "0.575344...
0.7358373
0
This is the depth first method It uses recursion to dive deep as possible. When there are no more children, it checks if the payload matches the target before backing downwards. It eventually gives up when the first_node has no more children and doesn't match the payload.
def depth_first(node, target) if node.children node.children.each do |child| depth_first(child, target) end end return 'Found your target' if node.payload == target 'No luck' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def breadth_first(node, target)\n # Setup\n queue = Queue.new\n queue.enqueue(node)\n # While queue exists\n while queue.elements?\n # Pop bottom off\n current_node = queue.dequeue\n # Check if it is target or nil\n return 'Could not locate your payload :(' if current_node.nil?\n return 'Found ...
[ "0.670371", "0.6650446", "0.6513655", "0.6368222", "0.63251084", "0.6279265", "0.6264661", "0.60817873", "0.60588306", "0.60422087", "0.6009444", "0.6006707", "0.5956425", "0.58821356", "0.5867668", "0.585436", "0.58422345", "0.5784777", "0.5778536", "0.57719797", "0.57342046...
0.7293459
0
Find entities which match all attributes attributes: Hash of attributes to match Returns: Array of entity objects.
def find_all_by(attributes = {}) raise NotImplementedError.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def semantic_find_all\n attributes = self.class.semantic_resource.columns.collect{|c| c.name.to_sym }\n conditions = { }\n params.keys.each{|p| conditions[p] = params[p] if attributes.include?(p.to_sym) }\n self.class.semantic_resource.find(:all, :conditions => conditions)\n end"...
[ "0.6427778", "0.638782", "0.60403734", "0.57986546", "0.5785672", "0.5775297", "0.5756768", "0.5647377", "0.56201416", "0.56098604", "0.55876213", "0.55650944", "0.5556188", "0.5545368", "0.5531247", "0.5526773", "0.55104667", "0.5492941", "0.5479464", "0.5423858", "0.5418994...
0.65226793
0
tries to get logs from current or previous pod depending on if it restarted TODO: move into resource_status.rb
def logs(container, end_time) fetch_logs(container, end_time, previous: !!restart_details) rescue *SamsonKubernetes.connection_errors # not found or pod is initializing begin fetch_logs(container, end_time, previous: !restart_details) rescue *SamsonKubernetes.connection_errors ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_logs(container, end_time, previous:)\n name = @pod.dig_fetch(:metadata, :name)\n namespace = @pod.dig_fetch(:metadata, :namespace)\n\n if previous\n SamsonKubernetes.retry_on_connection_errors do\n tries = 3\n tries.times do |i|\n logs = @c...
[ "0.6443494", "0.6362293", "0.5801088", "0.56677365", "0.5655261", "0.5635417", "0.5576907", "0.5562362", "0.54712373", "0.54684883", "0.54573697", "0.53721106", "0.5315064", "0.52745074", "0.5199533", "0.51567996", "0.512849", "0.51157093", "0.5072117", "0.5071511", "0.504231...
0.7094788
0
if the pod is still running we stream the logs until it times out to get as much info as possible necessary since logs often hang for a while even if the pod is already done
def fetch_logs(container, end_time, previous:) name = @pod.dig_fetch(:metadata, :name) namespace = @pod.dig_fetch(:metadata, :namespace) if previous SamsonKubernetes.retry_on_connection_errors do tries = 3 tries.times do |i| logs = @client.get_pod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def running_logs()\n if @container.nil?\n 'not yet'\n else\n wait_for_start_up\n @container.logs_container\n end\n end", "def logs(container, end_time)\n fetch_logs(container, end_time, previous: !!restart_details)\n rescue *SamsonKubernetes.connection_errors # not found or p...
[ "0.67510223", "0.6507706", "0.58680236", "0.5797776", "0.57967514", "0.5644862", "0.5505035", "0.5498189", "0.548772", "0.5414216", "0.54120725", "0.53887165", "0.53561366", "0.5310271", "0.53012544", "0.52193516", "0.5210961", "0.5166049", "0.5161958", "0.5127103", "0.511051...
0.65383685
1
Update user if they sent user params, otherwise return true. This is important because this controller is also handling removing trophies. (but we should move that to a different controller)
def conditionally_update return true unless params[:user] @user.update(user_params) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n\n # below line calls a function, user_param(). user_param() does the validation. it sees whether the user entered the correct params. We dont't want the current user to put any params and do a request. only correct params should be allowed\n if @user.update(user_p...
[ "0.7609839", "0.74431664", "0.7418892", "0.73948234", "0.736899", "0.7353197", "0.7341994", "0.7333794", "0.73275036", "0.7282859", "0.72778785", "0.7264407", "0.7263601", "0.726248", "0.7256387", "0.7224601", "0.7216373", "0.7198148", "0.7196749", "0.71924657", "0.71870023",...
0.8410162
0
if the user wants to remove any trophies, do that here.
def process_trophy_removal params.keys.select { |k, _v| k.starts_with? 'remove_trophy_' }.each do |smash_trophy| smash_trophy = smash_trophy.sub(/^remove_trophy_/, '') current_user.trophies.where(work_id: smash_trophy).destroy_all end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_tower\n end", "def remove; end", "def remove; end", "def remove; end", "def remove; end", "def remove_toy(toy)\n if toy.template.identifier != Constants::SCENE_TOY_IDENTIFIER\n undoManager.registerUndoWithTarget(self, selector: 'add_toy:', object: toy)\n @toys_in_scene.delete(t...
[ "0.70534205", "0.6549514", "0.6549514", "0.6549514", "0.6549514", "0.6531478", "0.64298946", "0.6389774", "0.63273007", "0.63021016", "0.628997", "0.6166968", "0.61511564", "0.6116899", "0.6105573", "0.6082979", "0.6055923", "0.6039372", "0.59806645", "0.5962733", "0.59596276...
0.69916236
1
Set default balance to 0
def set_defaults self.balance ||= 0 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_balance!(value)\n\t\t@balance.balance = value\n\t\t@bet = 0 \n\tend", "def update_normal_balance\n self.normal_balance = :none\n end", "def initialize\n @balance = 0\n end", "def default_values\n self.cash ||= 0.0\n end", "def private_reset!\n @balance = 0\n end", "def balance...
[ "0.74693877", "0.74277264", "0.74271846", "0.70978135", "0.69049", "0.68594307", "0.6772159", "0.6772159", "0.67370886", "0.6696416", "0.66454554", "0.6548945", "0.6536703", "0.65297747", "0.6502492", "0.6451147", "0.64247555", "0.6390928", "0.63666725", "0.6363551", "0.63564...
0.8344647
0
Get All Product in Wishlist for User
def index @wishlist = Wishlist.where(:user_id => current_user.id) @wishlist_items = Wishitem.where(:wishlist_id => @wishlist) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wishers\n @items = UserProductWish.includes(:account).where({product: @product}).all\n end", "def index\n @wishlists = Wishlist.where(user_id: current_user.id)\n end", "def wishlist\n @lineItems = LineItem.where(\"user_id = ? AND line_item_type = ?\", current_user.id, 1)\n @items = Array.new\...
[ "0.8161806", "0.7293703", "0.70846957", "0.7038927", "0.6913601", "0.6867886", "0.6767524", "0.6754371", "0.6741246", "0.66906977", "0.662427", "0.66124076", "0.6609344", "0.6594031", "0.6560187", "0.65120506", "0.6508213", "0.6504744", "0.6483553", "0.64579093", "0.643969", ...
0.73153555
1
GET /deweys_power_panels/1 GET /deweys_power_panels/1.xml
def show @deweys_power_panel = DeweysPowerPanel.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @deweys_power_panel } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @deweys_power_panel = DeweysPowerPanel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @deweys_power_panel }\n end\n end", "def show\n @control_panel = ControlPanel.find(params[:id])\n\n respond_to do |format|\n format.html # sho...
[ "0.68875563", "0.6160967", "0.6099372", "0.6072872", "0.6007726", "0.595271", "0.5877756", "0.58201545", "0.5772484", "0.5761619", "0.5709142", "0.56904787", "0.55829525", "0.5543981", "0.55125684", "0.5498244", "0.549163", "0.54705864", "0.54200953", "0.5403486", "0.53592336...
0.74794734
0
GET /deweys_power_panels/new GET /deweys_power_panels/new.xml
def new @deweys_power_panel = DeweysPowerPanel.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @deweys_power_panel } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @panel = Panel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @panel }\n end\n end", "def new\n @panel = Panel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @panel }\n end\n ...
[ "0.7264215", "0.7264215", "0.7020272", "0.7006462", "0.67583954", "0.6717895", "0.6667412", "0.6500836", "0.64193964", "0.6327084", "0.62764204", "0.6251684", "0.6240131", "0.6238065", "0.6238065", "0.62156534", "0.62051886", "0.6195547", "0.61909485", "0.61761475", "0.617347...
0.77730215
0
POST /deweys_power_panels POST /deweys_power_panels.xml
def create @deweys_power_panel = DeweysPowerPanel.new(params[:deweys_power_panel]) respond_to do |format| if @deweys_power_panel.save format.html { redirect_to(@deweys_power_panel, :notice => 'Deweys power panel was successfully created.') } format.xml { render :xml => @deweys_power_pane...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @deweys_power_panel = DeweysPowerPanel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @deweys_power_panel }\n end\n end", "def update\n @deweys_power_panel = DeweysPowerPanel.find(params[:id])\n\n respond_to do |format|\n if @de...
[ "0.6466403", "0.5780193", "0.577855", "0.5748411", "0.5694396", "0.54189277", "0.54148465", "0.5409598", "0.53909653", "0.53635186", "0.52615803", "0.5254718", "0.52017796", "0.5157608", "0.5105268", "0.5103327", "0.5099746", "0.5090005", "0.50723594", "0.5055526", "0.5022072...
0.67720073
0
PUT /deweys_power_panels/1 PUT /deweys_power_panels/1.xml
def update @deweys_power_panel = DeweysPowerPanel.find(params[:id]) respond_to do |format| if @deweys_power_panel.update_attributes(params[:deweys_power_panel]) format.html { redirect_to(@deweys_power_panel, :notice => 'Deweys power panel was successfully updated.') } format.xml { head :...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @panel = Panel.find(params[:id])\n\n respond_to do |format|\n if @panel.update_attributes(params[:panel])\n format.html { redirect_to(admin_panel_path(@panel), :notice => 'Panel was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render ...
[ "0.6222639", "0.60940707", "0.59898514", "0.57851976", "0.57086146", "0.56935716", "0.5675835", "0.56312835", "0.5628273", "0.56208944", "0.56162226", "0.55742097", "0.5571035", "0.554381", "0.5540606", "0.54907674", "0.5459304", "0.545275", "0.5413396", "0.5346857", "0.53178...
0.69261694
0
DELETE /deweys_power_panels/1 DELETE /deweys_power_panels/1.xml
def destroy @deweys_power_panel = DeweysPowerPanel.find(params[:id]) @deweys_power_panel.destroy respond_to do |format| format.html { redirect_to(deweys_power_panels_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @panel = Panel.find(params[:id])\n @panel.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_panels_url) }\n format.xml { head :ok }\n end\n end", "def db_delete\n assert_privileges(\"db_delete\")\n db = MiqWidgetSet.find(params[:id]) # temp var to de...
[ "0.66161394", "0.6483721", "0.6431325", "0.64098597", "0.6353968", "0.6326145", "0.61060643", "0.6058511", "0.60335845", "0.60222405", "0.59469676", "0.59414166", "0.59278786", "0.59043276", "0.5904092", "0.5876605", "0.5857822", "0.5848203", "0.58439285", "0.5841582", "0.578...
0.7286688
0
called by insurance_billing/sidebar_right also called by _patient_claim partial sums the eob payments
def ins_billing_eob_payments(billing) payment = 0 billing.eobs.each do |eob| payment += eob.payment_amount end return payment end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_payment_amount\n sum = 0.00\n unless self.insurance_payment_eobs.blank?\n self.insurance_payment_eobs.each do |eob|\n (sum = sum + eob.total_amount_paid_for_claim) unless eob.total_amount_paid_for_claim.nil?\n end\n end\n sum\n end", "def total_paid\n payments.collect{|...
[ "0.7652741", "0.67494065", "0.6648929", "0.6575665", "0.6561365", "0.6505679", "0.6489193", "0.64879656", "0.64559513", "0.64511836", "0.6368417", "0.63551235", "0.63456786", "0.633976", "0.63067675", "0.6282871", "0.6269264", "0.6218245", "0.6212941", "0.6212941", "0.6187269...
0.68316364
1
2x1 MUX for the Signal Inverter Demonstrated The correctness of it in the VHDL programs. Essentially the logic table overlapped with XOR.
def MUX2X1(x,y) XOR(x,y); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ALU1BIT(a,b,cin,binv,op1,op2) \n\tb = MUX2X1(b,binv)\n\tsUM_RESULT = ADDER(a,b,cin)\n\t#Send out an array pair of result, cout\n\treturn MUX4X1(AND(a,b),OR(a,b),sUM_RESULT[0],0,op1,op2), sUM_RESULT[1]\nend", "def ALU1BIT_OF (a,b,cin,binv,op1,op2)\n\tb = MUX2X1(b,binv)\n\tsUM_RESULT = ADDER(a,b,cin)\n\tputs s...
[ "0.61308324", "0.60354596", "0.56096935", "0.49807534", "0.48948556", "0.48775753", "0.48574287", "0.48422933", "0.48116565", "0.48076978", "0.48066938", "0.47816104", "0.4742279", "0.47189614", "0.46197274", "0.46128288", "0.4603881", "0.46037883", "0.45805857", "0.45781627", ...
0.7046255
0
2BitDecoder Maps a 2bit op signal into a size 4 array of signals. Only one of which are true.
def DECODER2(x,y) #Sends out an array of decoded values return AND(NOT(x),NOT(y)),AND(NOT(x),y),AND(x,NOT(y)),AND(x,y) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decoder_stub(state)\n\t\t[\n\t\t\t0x7ca52a79, # 0x1da4 <main>: xor. r5,r5,r5\n\t\t\t0x4082fffd, # 0x1da8 <main+4>: bnel+ 0x1da4 <main>\n\t\t\t0x7fe802a6, # 0x1dac <main+8>: mflr r31\n\t\t\t0x3bffd00c, # 0x1db0 <main+12>: addi r31,r31,-12276\n\t\t\t0x38a53...
[ "0.5091598", "0.50061184", "0.4942068", "0.48001218", "0.47916391", "0.47879806", "0.47845063", "0.4766525", "0.4737892", "0.4711896", "0.47009572", "0.46803588", "0.466656", "0.4640637", "0.46343356", "0.4631657", "0.4624498", "0.46098036", "0.4607275", "0.4586002", "0.45826...
0.58601004
0
4X1 MUX Utilizes the 2BitDecoder to map the op signal to the correct ALU output.
def MUX4X1(x,y,a,b,op1,op0) d = DECODER2(op1,op0) OR(OR(AND(x,d[0]),AND(y,d[1])),OR(AND(a,d[2]),AND(b,d[3]))) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ALU1BIT_OF (a,b,cin,binv,op1,op2)\n\tb = MUX2X1(b,binv)\n\tsUM_RESULT = ADDER(a,b,cin)\n\tputs sUM_RESULT[0]\n\tovf = OF_CHECKING(a,b,sUM_RESULT[0])\n\t#Send out an array triple of result, cout, overflow\n\treturn MUX4X1(AND(a,b),OR(a,b),sUM_RESULT[0],0,op1,op2), sUM_RESULT[1], ovf\nend", "def ALU1BIT(a,b,ci...
[ "0.58622676", "0.5829425", "0.55989224", "0.54765165", "0.45580408", "0.45497286", "0.44815424", "0.4452793", "0.43854693", "0.43729267", "0.43053705", "0.4270969", "0.42696092", "0.42582706", "0.41968408", "0.41244057", "0.4109976", "0.4109244", "0.4109063", "0.40523973", "0...
0.73065
0
1Bit ALU Computes and,or,sum and sends out the overflow, result and a carry out.
def ALU1BIT(a,b,cin,binv,op1,op2) b = MUX2X1(b,binv) sUM_RESULT = ADDER(a,b,cin) #Send out an array pair of result, cout return MUX4X1(AND(a,b),OR(a,b),sUM_RESULT[0],0,op1,op2), sUM_RESULT[1] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ALU1BIT_OF (a,b,cin,binv,op1,op2)\n\tb = MUX2X1(b,binv)\n\tsUM_RESULT = ADDER(a,b,cin)\n\tputs sUM_RESULT[0]\n\tovf = OF_CHECKING(a,b,sUM_RESULT[0])\n\t#Send out an array triple of result, cout, overflow\n\treturn MUX4X1(AND(a,b),OR(a,b),sUM_RESULT[0],0,op1,op2), sUM_RESULT[1], ovf\nend", "def ALU16BIT(a,b,c...
[ "0.73391306", "0.6301429", "0.56117994", "0.5508578", "0.5476454", "0.54740465", "0.54649043", "0.5460478", "0.5322453", "0.5322453", "0.5267645", "0.5259907", "0.5227519", "0.52066934", "0.52048963", "0.520191", "0.517917", "0.517917", "0.514145", "0.5128445", "0.51220125", ...
0.719777
1
1Bit ALU with Overflow Checking Same as ALU but with Overflow Checking
def ALU1BIT_OF (a,b,cin,binv,op1,op2) b = MUX2X1(b,binv) sUM_RESULT = ADDER(a,b,cin) puts sUM_RESULT[0] ovf = OF_CHECKING(a,b,sUM_RESULT[0]) #Send out an array triple of result, cout, overflow return MUX4X1(AND(a,b),OR(a,b),sUM_RESULT[0],0,op1,op2), sUM_RESULT[1], ovf end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ALU1BIT(a,b,cin,binv,op1,op2) \n\tb = MUX2X1(b,binv)\n\tsUM_RESULT = ADDER(a,b,cin)\n\t#Send out an array pair of result, cout\n\treturn MUX4X1(AND(a,b),OR(a,b),sUM_RESULT[0],0,op1,op2), sUM_RESULT[1]\nend", "def ALU16BIT(a,b,cin,binv,op1,op2)\n\tresult = [nil]*16\n\t15.downto(1).each{|i| result[i],cin = ALU...
[ "0.69342935", "0.69096833", "0.6019998", "0.58267874", "0.5818347", "0.5818347", "0.5772398", "0.56728095", "0.55925494", "0.55873275", "0.558292", "0.5573747", "0.5526309", "0.5522666", "0.5484536", "0.5483262", "0.5482124", "0.5469806", "0.5417867", "0.53806317", "0.5374884...
0.7322821
0
16Bit ALU Connects 16 1Bit ALUs to create a 16 bit result. The last ALU checks for overflow.
def ALU16BIT(a,b,cin,binv,op1,op2) result = [nil]*16 15.downto(1).each{|i| result[i],cin = ALU1BIT(a[i],b[i],cin,binv,op1,op2)} result[0],cout,ovf = ALU1BIT_OF(a[0],b[0],cin,binv,op1,op2) #Send out our result, carry out, and overflow return result,cout,ovf end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uint16()\n _uint16(\"uint16\")\n end", "def u16\n next_bytes(2).unpack(\"S>\").first\n end", "def uint16(*payloads)\n fixnums(2, FormatStrings::UINT16, payloads)\n end", "def i16u\n little? ? BinUtils.get_int16_le(read(2)) : BinUtils.get_int16_be(read(2)...
[ "0.65374905", "0.640786", "0.63783634", "0.6296515", "0.627977", "0.6131336", "0.5857883", "0.5770558", "0.5723808", "0.5638667", "0.5562039", "0.5472757", "0.5449914", "0.5394178", "0.5371754", "0.530306", "0.52883154", "0.52779806", "0.527611", "0.5251712", "0.5246984", "...
0.800406
0
Prints the State of the 16Bit Multiplier
def printState(count,md,mq,ac) puts(count.to_s(2)) puts("MD:" + md.join) puts("AC:" + ac.join) puts("MQ:" + mq.join) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_state\n @@rows.times do |row|\n @@columns.times do |column|\n print '%4.4s' % @state_array[row * @@columns + column].to_s,\" \"\n end\n print \"\\n\"\n end\n print \"\\n\"\n end", "def MULTIPLIER16BIT(multiplicand,multiplier)\n\taccumulator = ([0]*16)+multiplier\t\t\t\t...
[ "0.61566436", "0.58458483", "0.5801427", "0.5730938", "0.5717868", "0.5710503", "0.5687146", "0.568005", "0.5645783", "0.5645231", "0.5641426", "0.5633778", "0.5554697", "0.5550404", "0.55499506", "0.5548444", "0.5537471", "0.55129886", "0.5502262", "0.54755956", "0.5473547",...
0.603645
1
16Bit Multiplier Performs shift multiplication on two register values and outputs the values in a 32bit register.
def MULTIPLIER16BIT(multiplicand,multiplier) accumulator = ([0]*16)+multiplier #Initialize Concatenated Register [AC]+[MQ] count = 16 #Initialize n-bit count. printState(count,multiplicand,accumulator[16,32],accumulator[0,16]) while(count>=0) #Start: if shiftRight(ac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def word16(a, b)\n (a << 8) | b\n end", "def word16(bytes_a, bytes_b)\n (bytes_a << 8) | bytes_b\n end", "def ALU16BIT(a,b,cin,binv,op1,op2)\n\tresult = [nil]*16\n\t15.downto(1).each{|i| result[i],cin = ALU1BIT(a[i],b[i],cin,binv,op1,op2)}\n\tresult[0],cout,ovf = ALU1BIT_OF(a[0],b[0],cin,binv,op1,op2)\...
[ "0.62553686", "0.57320726", "0.554205", "0.548405", "0.5399427", "0.5135696", "0.5019342", "0.49688086", "0.49688086", "0.496511", "0.49536118", "0.484081", "0.48359263", "0.47815377", "0.47711468", "0.47600517", "0.47363007", "0.4700563", "0.464522", "0.46444798", "0.4628473...
0.7001033
0
Shifts a Register to the Right
def shiftRight(register) register.unshift(0).pop end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shiftLeft(register)\n\tregister.shift\n\tregister.push(0)\nend", "def shift_right\n @mid, @value2, @right = @left, @value1, @mid\n end", "def shift_right\n self.unshift(self.pop)\n end", "def move_right\n @memory_position += 1\n @memory_position = 0 if @memory_position > 0xfffffe\n end...
[ "0.71826947", "0.6885217", "0.66808", "0.6603987", "0.6572543", "0.65169823", "0.65169823", "0.63881755", "0.6375488", "0.6358082", "0.6358082", "0.6291538", "0.6236523", "0.6179961", "0.6179961", "0.6179961", "0.60492164", "0.59982747", "0.59806234", "0.5979064", "0.5964224"...
0.8117424
0
Shifts a Register to the Left
def shiftLeft(register) register.shift register.push(0) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shiftRight(register)\n\tregister.unshift(0).pop\nend", "def shift_left\n self.push(self.shift)\n end", "def shift_left\n @left, @value1, @mid = @mid, @value2, @right\n end", "def rotate_left(value, shift)\n ((value << shift) | (value >> (20 - shift))) & 0xFFFFF\n end", "def move_left\n ...
[ "0.77925456", "0.73051286", "0.72569007", "0.7148327", "0.69198847", "0.6785762", "0.6785762", "0.6723873", "0.66384447", "0.6615102", "0.66004956", "0.66004956", "0.6593669", "0.6586902", "0.6556738", "0.64791524", "0.6435789", "0.6435789", "0.6435789", "0.62645733", "0.6241...
0.84941745
0
Gives the template of an use case as JSON
def template_use_case @use_case_template = UseCaseTemplate.find(params[:use_case_template_id]) @json_obj = JSON.parse(@use_case_template.template_form) respond_to do |format| format.js {render 'template_form'} end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def template_name\n \"#{self.class.name.split('::').last.underscore}.json.jbuilder\"\n end", "def template(model_name)\n <<~HEREDOC\n {\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {}\n }\n HER...
[ "0.64434576", "0.63143045", "0.6240932", "0.6234062", "0.6234062", "0.6234062", "0.6234062", "0.6234062", "0.6234062", "0.6234062", "0.60990405", "0.6078205", "0.6074116", "0.6074116", "0.60605574", "0.6047795", "0.6011998", "0.60115516", "0.5996777", "0.5976033", "0.59388584...
0.63804716
1
Gives the list of documents of a project to attach to a use case
def attach_document @use_case = UseCase.find(params[:id]) @document_projects = DocumentProject.where(:project_id => params[:project_id]) respond_to do |format| format.html end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_doc_info\n if (@document == nil)\n return false\n end\n \n @collection = Collection.find(@document.collection)\n @project_list = []\n @collection.projects.each do |project|\n @project_list << project\n end\n end", "def show\n @project = Project.find(params[:id])\n db...
[ "0.6299673", "0.62958926", "0.62486595", "0.605626", "0.600205", "0.5984258", "0.5937808", "0.5890469", "0.58486956", "0.5818114", "0.5812338", "0.5805676", "0.5805676", "0.5782263", "0.573144", "0.5657223", "0.56364506", "0.56298465", "0.5612092", "0.55874085", "0.5585975", ...
0.7113177
0
Gives the view of the requirement of a certain use case
def requirements @use_case = UseCase.find(params[:id]) @project = @use_case.project @requirements = @use_case.requirements respond_to do |format| format.html end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_req\n @user=find_user\n if !@user.nil?\n @use_reqs=@use_case.requirements.find :all\n session[:use_case_id]=@use_case.id\n @attr=Attribute.find_by_project_id(session[:project_id])\n respond_to do |format|\n format.html { render \"requirements/index\" }\n end\n else...
[ "0.6544294", "0.63729227", "0.6077152", "0.6077152", "0.6059532", "0.6059532", "0.6059532", "0.6059532", "0.6028314", "0.6027648", "0.60089576", "0.60089576", "0.60089576", "0.5981157", "0.59562796", "0.5914783", "0.58335936", "0.5799914", "0.572479", "0.5708224", "0.5642425"...
0.6594421
0
Gives the view of the tasks of a certain use case
def tasks @use_case = UseCase.find(params[:id]) @project = @use_case.project respond_to do |format| format.html end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_tasks\n # ASK REPO for the tasks\n tasks = @task_repository.all\n # ASK VIEW to display them\n @tasks_view.display(tasks)\n end", "def show\n find_task\n end", "def interviewer_tasks\n tasks.find(:all, :conditions => { :context => 'interviewers', :show_for_context_object_tasks => t...
[ "0.7217174", "0.70797", "0.6923401", "0.68659025", "0.68518335", "0.68076086", "0.6698484", "0.665766", "0.664071", "0.66338015", "0.66276044", "0.6577122", "0.6562889", "0.652853", "0.65168786", "0.6447878", "0.6430879", "0.64280754", "0.6421458", "0.6411247", "0.63931054", ...
0.7159997
1
GET /freelancer_knowledges GET /freelancer_knowledges.json
def index @freelancer_knowledges = FreelancerKnowledge.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @knowledges = Knowledge.order(\"created_at desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @knowledges }\n end\n end", "def index\n @carrierknowledghes = Carrierknowledghe.all\n end", "def new\n @knowledge = current_user.know...
[ "0.630326", "0.60116845", "0.595098", "0.5839878", "0.5611794", "0.54542494", "0.54053175", "0.53874165", "0.5354847", "0.5344558", "0.53024244", "0.5292661", "0.5282269", "0.5247072", "0.52158225", "0.52143824", "0.5213206", "0.5210956", "0.520964", "0.5204123", "0.52009755"...
0.66673106
0
DELETE /freelancer_knowledges/1 DELETE /freelancer_knowledges/1.json
def destroy @freelancer_knowledge.destroy respond_to do |format| format.html { redirect_to freelancer_knowledges_url, notice: 'Freelancer knowledge was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @knowledge = current_user.knowledges.find(params[:id])\n @knowledge.destroy\n\n respond_to do |format|\n format.html { redirect_to knowledges_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @carrierknowledghe.destroy\n respond_to do |format|\n ...
[ "0.68897974", "0.6703361", "0.670041", "0.6646703", "0.6586873", "0.6571737", "0.6555517", "0.65274686", "0.6509075", "0.6493473", "0.6488995", "0.64743686", "0.6474076", "0.64381456", "0.64283895", "0.64078814", "0.6400561", "0.63977534", "0.63812995", "0.6376295", "0.637169...
0.6756347
1
read_cart_solved_file read the data of the solved cartfile
def read_solved_info(file_path) nil if File.exist? file_path cart_file_resolved = {} IO.foreach(file_path.to_s) do |block| block = block.strip next if block.empty? || (block == "\n") meta = /((?i)binary|git|github)\s+"([^"]+)"\s+"([^"]+)"/.match(block) if meta type = meta[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_cart_file(project_name, cart_file, is_private = false)\n cart_file_data = {}\n\n if File.exist? cart_file\n IO.foreach(cart_file) do |block|\n block = block.strip\n next if (block == '') || (block[0] == \"\\#\")\n\n meta = /((?i)binary|git|github)\\s+\"([^\"]+)\"\\s+(~>|==|>=)?\\s?\"?(...
[ "0.65166515", "0.5792084", "0.5531755", "0.5453012", "0.54495186", "0.5363613", "0.53139305", "0.5303696", "0.5253286", "0.52237546", "0.5196882", "0.51803017", "0.51794356", "0.5155329", "0.51530117", "0.5138323", "0.5134909", "0.512134", "0.5098019", "0.508683", "0.50642645...
0.72441465
0
link to this Goths voting page on gothornot.com
def goth_vote_link(goth) link_to goth.name, "http://gothornot.com/?vote_username=#{goth.name}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vote(id)\n require_login!\n url = get(ITEM_URL % id).match(/<a id=up_\\d+ onclick=\"return vote\\(this\\)\" href=\"(vote\\?[^\"]+)\">/)[1]\n get(BASE_URL + '/' + url)\n end", "def vote(id)\n require_login!\n url = get(ITEM_URL % id).match(/<a id=up_\\d+ onclick=\"return vote\\(this\\)\" href=...
[ "0.66571367", "0.66571367", "0.6273372", "0.6111617", "0.59387475", "0.5918416", "0.589596", "0.5848515", "0.58344", "0.5804372", "0.57919234", "0.578811", "0.57858884", "0.57737035", "0.5696298", "0.5670926", "0.56668305", "0.5627904", "0.5623263", "0.5599123", "0.55739385",...
0.7825385
0
GET /tipo_trabajadors GET /tipo_trabajadors.json
def index @tipo_trabajadors = TipoTrabajador.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @territorios = Territorio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @territorios }\n end\n end", "def index\n @tutorados = Tutorado.all\n\n render json: @tutorados, status: :ok\n end", "def index\n @trabajos = Trabajo.al...
[ "0.6562359", "0.6500437", "0.64546704", "0.63996834", "0.6310231", "0.6305107", "0.62981945", "0.62163496", "0.6206355", "0.61817247", "0.61596525", "0.6147515", "0.61049557", "0.6093744", "0.60577226", "0.6054802", "0.6052211", "0.60461366", "0.6036726", "0.6007146", "0.5988...
0.7252939
0
POST /tipo_trabajadors POST /tipo_trabajadors.json
def create @tipo_trabajador = TipoTrabajador.new(tipo_trabajador_params) respond_to do |format| if @tipo_trabajador.save format.html { redirect_to @tipo_trabajador, notice: 'Tipo trabajador was successfully created.' } format.json { render :show, status: :created, location: @tipo_trabajad...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n params[:trabajador][:rut] = RUT::format(params[:trabajador][:rut])\n\n @trabajador = Trabajador.new(trabajador_params)\n\n\n respond_to do |format|\n if @trabajador.save\n format.html { redirect_to @trabajador, notice: 'Trabajador was successfully created.' }\n format.json ...
[ "0.6625965", "0.6608725", "0.65799993", "0.64939344", "0.6410962", "0.6407443", "0.6405803", "0.6390898", "0.6349625", "0.62839717", "0.62795424", "0.62637067", "0.62425405", "0.62313706", "0.62252784", "0.6202286", "0.61469483", "0.6119907", "0.61034614", "0.610071", "0.6009...
0.6867104
0
PATCH/PUT /tipo_trabajadors/1 PATCH/PUT /tipo_trabajadors/1.json
def update respond_to do |format| if @tipo_trabajador.update(tipo_trabajador_params) format.html { redirect_to @tipo_trabajador, notice: 'Tipo trabajador was successfully updated.' } format.json { render :show, status: :ok, location: @tipo_trabajador } else format.html { render :...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n authorize! :update, Tipo\n respond_to do |format|\n if @tipo.update(tipo_params)\n log(\"Se ha editado la nomina #{@lt}\", 1)\n format.html { redirect_to tipos_path, notice: 'Los datos de la nómina fueron actualizados exitosamente.' }\n format.json { head :no_content }\...
[ "0.6830515", "0.66924304", "0.6628453", "0.66159123", "0.65230185", "0.64359015", "0.6402536", "0.6401434", "0.6396593", "0.6382682", "0.6351393", "0.631393", "0.63039446", "0.62860847", "0.62812626", "0.6269185", "0.62585235", "0.6235594", "0.62296796", "0.6224965", "0.62175...
0.6860651
0
DELETE /tipo_trabajadors/1 DELETE /tipo_trabajadors/1.json
def destroy @tipo_trabajador.destroy respond_to do |format| format.html { redirect_to tipo_trabajadors_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @tipo_contrato = TipoContrato.find(params[:id])\n @tipo_contrato.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_contratos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tipo_unidad.destroy\n respond_to do |format|\n form...
[ "0.73667073", "0.7229712", "0.7203466", "0.71501136", "0.71416914", "0.7120663", "0.7115516", "0.71129674", "0.7096762", "0.7094668", "0.70917386", "0.7079775", "0.7078534", "0.70775104", "0.70770556", "0.70713866", "0.70652306", "0.7058963", "0.70537335", "0.70482737", "0.70...
0.7584279
0
STONE PATH TASK RELATED METHODS _____________________________________________________________________ We need to create the stone path task "Evaluate Proposal" and assign it to a workbench of an Organization
def send_evaluate_prop task = @proposal.evaluate_proposals.create task.workbench = Organization.find params[:organization][:organization_id] task.save redirect_to :action => "pending" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_task(issue)\n # If there is a passed in OF project name, get the actual project object\n issue.omnifocus_project = omnifocus.project if issue.project\n # If there is a passed in OF context name, get the actual context object\n # Update the context property to be the actual context object not the contex...
[ "0.59835935", "0.59361476", "0.58880985", "0.58620656", "0.57810533", "0.57810533", "0.57759297", "0.56767803", "0.56474423", "0.5628783", "0.5627273", "0.5621204", "0.56188095", "0.55861264", "0.5567494", "0.55378795", "0.5525232", "0.55142766", "0.54967266", "0.54824024", "...
0.7015244
0
Fetch a list of webhook logs Returns a list of webhook logs. Response includes pagination.
def get_webhook_logs(opts = {}) data, _status_code, _headers = get_webhook_logs_with_http_info(opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list(options={})\n Mailgun.submit(:get, log_url, options)\n end", "def get_webhook_logs_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LogsApi.get_webhook_logs ...'\n end\n # resource path\n local_var_path = '/log...
[ "0.68233037", "0.67531914", "0.64127994", "0.640695", "0.6367033", "0.6350066", "0.62848735", "0.627408", "0.6247584", "0.6181621", "0.6174508", "0.61253816", "0.6123115", "0.61198145", "0.61084515", "0.61021256", "0.6092713", "0.60861313", "0.60808295", "0.6077693", "0.60727...
0.69760996
0
Check if exit code is successful
def success? exit_code == 0 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def successful?\n exit_code == 0\n end", "def success?\n exit_status == 0\n end", "def failure?\n exit_code != 0\n end", "def success?\n # note that Linux ruby returns nil when exitstatus is nil and a termsig\n # value is set instead.\n return @exitstatus ...
[ "0.85816276", "0.8432675", "0.82690567", "0.8076867", "0.800863", "0.79440194", "0.7924232", "0.7910442", "0.7878337", "0.77925354", "0.7749073", "0.77309525", "0.7727352", "0.76924384", "0.74531144", "0.7442919", "0.74366957", "0.73715097", "0.7360381", "0.7334392", "0.73311...
0.85124886
1
Check if exit code is not successful
def failure? exit_code != 0 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def successful?\n exit_code == 0\n end", "def success?\n exit_code == 0\n end", "def success?\n exit_status == 0\n end", "def has_errors?\n return @exitcode == 2 || @exitcode == 1\n end", "def check_exit_code!(executable, command, output)\n if $?.exitstatus != 0\n...
[ "0.8159192", "0.81381655", "0.80043775", "0.7929908", "0.79036874", "0.7856349", "0.77918094", "0.7761623", "0.7742327", "0.773521", "0.76649433", "0.76373565", "0.75694597", "0.7563239", "0.7501878", "0.73997825", "0.7399176", "0.73874354", "0.73707736", "0.7368859", "0.7236...
0.8578123
0
FORCE to implement content_for in controller
def view_context super.tap do |view| (@_content_for || {}).each do |name,content| view.content_for name, content end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view_context\n super.tap do |view|\n (@_content_for || {}).each do |name,content|\n view.content_for name, content\n end\n end\n end", "def view_context\n super.tap do |view|\n (@_content_for || {}).each do |name, content|\n view.content_for name, content\n ...
[ "0.75152975", "0.7484351", "0.73812956", "0.73812956", "0.73812956", "0.72570103", "0.7173389", "0.7173389", "0.7173389", "0.7066237", "0.690314", "0.68770504", "0.68770504", "0.68770504", "0.68770504", "0.68770504", "0.68770504", "0.68770504", "0.68770504", "0.68770504", "0....
0.75203246
0
Set the Typekit API token to be used for subsequent calls.
def set_token(token) headers 'X-Typekit-Token' => token end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_token\n @token = ENV[\"TYPEFORM_API_TOKEN\"]\n end", "def token=(value)\n resources.each do |klass|\n klass.headers['Authorization'] = 'OAuth ' + value.to_s\n end\n @token = value\n end", "def set_token(token)\n @token = token\n connection.headers[\"Authorization\...
[ "0.8389733", "0.6701101", "0.6693454", "0.6683265", "0.6674756", "0.6674756", "0.66705334", "0.6670426", "0.66278774", "0.66165125", "0.66165125", "0.6578287", "0.6567888", "0.6512362", "0.6512362", "0.6512362", "0.6512362", "0.6512362", "0.6512362", "0.6512362", "0.6512362",...
0.7869871
1
List kits available for this account
def kits Kit.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_kits\n resp = make_request :get, \"kits\"\n check_response_for_field resp, \"kits\"\n end", "def list_kits\n resp = make_request :get, \"kits\"\n check_response_for_field resp, \"kits\"\n end", "def list\n @keychain.keys\n end", "def list_keychains(params: {})\n ca...
[ "0.7334027", "0.7283168", "0.6660857", "0.64934003", "0.618094", "0.60779953", "0.60741824", "0.6027156", "0.5885507", "0.5884199", "0.58786285", "0.5831911", "0.5817243", "0.5783725", "0.5706927", "0.56496024", "0.56414753", "0.5640115", "0.5562918", "0.55515516", "0.5524134...
0.79159564
0
Retrieve a specific kit
def kit(id) Kit.find id end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kit_info(id)\n resp = make_request :get, \"kits/#{id}\"\n check_response_for_field resp, \"kit\"\n end", "def view_kit(id)\n resp = @api.kit_info(id)\n @io.display_kit_info resp\n # return the id so a queued operation can continue operating on this kit\n id\n end", "def list_and_select_...
[ "0.75393397", "0.7160241", "0.7072034", "0.6804429", "0.6804191", "0.67395633", "0.64189094", "0.6237461", "0.6189816", "0.6045735", "0.6020105", "0.6009366", "0.59802115", "0.59235466", "0.5886868", "0.5882871", "0.57290673", "0.5700375", "0.5651597", "0.5621777", "0.5605619...
0.8031954
0
Create a new kit
def create_kit(params) Kit.create(params) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @kit = Kit.new(kit_params)\n\n respond_to do |format|\n if @kit.save\n format.html { redirect_to @kit, notice: 'Kit was successfully created.' }\n format.json { render action: 'show', status: :created, location: @kit }\n else\n format.html { render action: 'new' }\...
[ "0.7430464", "0.7135066", "0.6733496", "0.6472933", "0.6398942", "0.6250337", "0.6247657", "0.6246657", "0.6230436", "0.6216024", "0.621553", "0.62020403", "0.6110378", "0.599956", "0.5852804", "0.5847052", "0.58352584", "0.58348656", "0.5829124", "0.5781603", "0.5770647", ...
0.8472343
0
Retrieve a specific Family
def family(id) Family.find(id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def family_by_name(name)\n Family.find_by_name(name)\n end", "def family_id\n @gapi.family_id\n end", "def family_by_slug(slug)\n Family.find_by_slug(slug)\n end", "def set_family\n @family = Family.friendly.find(params[:id])\n end", "def show\n ...
[ "0.7319066", "0.72770315", "0.7051443", "0.69871736", "0.6946799", "0.686697", "0.68240356", "0.6779231", "0.6779231", "0.67632324", "0.67632324", "0.67552435", "0.674776", "0.6692872", "0.6689179", "0.668413", "0.66783065", "0.66376096", "0.66012436", "0.65974367", "0.641618...
0.7985308
0
Retrieve a Family by Typekit slug
def family_by_slug(slug) Family.find_by_slug(slug) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find(slug)\n type = slug.to_s.demodulize.classify\n\n subclasses.find do |subclass|\n subclass.name.gsub(prefix, '') == type.to_s.gsub(prefix, '')\n end || raise(TypeError.new(type, types.to_sentence))\n end", "def find_territory\n Territory.find_by_slug(params[:slug])\n...
[ "0.6009303", "0.60016066", "0.5965216", "0.5937498", "0.59104013", "0.5902866", "0.563796", "0.55027175", "0.5432597", "0.5427232", "0.54232746", "0.53789157", "0.53659797", "0.53165007", "0.52633023", "0.525835", "0.52394164", "0.5228476", "0.52264816", "0.52117825", "0.5211...
0.81811064
0