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 |
|---|---|---|---|---|---|---|
Approves user's email address | def activate
AuthenticationManager.new.activate(params[:token])
notice(:activated)
rescue ManagerError
notice(:invalid_token)
ensure
redirect_to root_path
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def email_approve(params)\n http_helper.send_post_request(\"#{@url_prefix}/#{get_user_id!(params)}/email/approve\", params)\n end",
"def email_address_activation\n user = User.first\n email_address = EmailAddress.find_by(id: user.primary_email_address_id)\n email_address.activation_token = n... | [
"0.74310446",
"0.69950056",
"0.69466317",
"0.69185495",
"0.68303764",
"0.68293214",
"0.67642766",
"0.6737831",
"0.67312485",
"0.67263705",
"0.66782814",
"0.66520226",
"0.66487014",
"0.66487014",
"0.6645663",
"0.6632595",
"0.66253173",
"0.6620395",
"0.6609753",
"0.65911365",
"... | 0.0 | -1 |
Establish a new connection and Session ID | def login
begin
r = execute(make_xml('LoginRequest', { 'sync-id' => 0, 'password' => @password, 'user-id' => @username }))
rescue APIError
raise AuthenticationFailed.new(r)
end
if(r.success)
@session_id = r.sid
return true
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def connect!\n sessions\n self\n end",
"def create_session\n @connection.create_session(@config || {})\n end",
"def handle_connection(conn, opts={})\n create_session(conn, opts)\n end",
"def new_connection; end",
"def establish_connection\n LOG.debug self.inspect\n ... | [
"0.7299614",
"0.7008923",
"0.6956309",
"0.689601",
"0.67615384",
"0.6653493",
"0.66326696",
"0.6589359",
"0.65800464",
"0.64879966",
"0.648724",
"0.64623755",
"0.6457635",
"0.6450514",
"0.6403341",
"0.63472",
"0.6327163",
"0.628388",
"0.6273333",
"0.6220409",
"0.6209101",
"... | 0.0 | -1 |
Logout of the current connection | def logout
r = execute(make_xml('LogoutRequest', {'sync-id' => 0}))
if(r.success)
return true
end
raise APIError.new(r, 'Logout failed')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def disconnect\n @connection.logout\n end",
"def close(context)\n context.debug('Logout connection')\n @connection_info = nil\n @client.logout\n @client = nil\n @system = nil\n end",
"def close_connection\n current_connection.logout if current_connection?\n cur... | [
"0.84108204",
"0.8232616",
"0.8214078",
"0.81717443",
"0.79759353",
"0.7786689",
"0.7773485",
"0.7736944",
"0.76943",
"0.7682785",
"0.7658213",
"0.7632888",
"0.757366",
"0.7548772",
"0.752573",
"0.74645066",
"0.74304545",
"0.7397647",
"0.7396665",
"0.7381065",
"0.73534375",
... | 0.7358088 | 20 |
Execute an API request | def execute(xml)
APIRequest.execute(url,xml.to_s)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exec_api(json_req)\n begin\n req = sign_request(json_req)\n return HttpChannel.new(api_uri).execute(req)\n rescue Curl::Err::CurlError => ex\n return JsonResponse.new(\"fail\", ex.message)\n end\n end",
"def execute!\n validate_request!\n perform_request!\n\n ... | [
"0.75179553",
"0.74322677",
"0.74305844",
"0.73435104",
"0.73174834",
"0.71619284",
"0.71151555",
"0.70756507",
"0.700665",
"0.6986231",
"0.69841236",
"0.690092",
"0.68794423",
"0.6840006",
"0.6824639",
"0.6824373",
"0.6797847",
"0.6791755",
"0.6786474",
"0.67700005",
"0.6741... | 0.65856713 | 30 |
Download a specific URL | def download(url)
uri = URI.parse(url)
http = Net::HTTP.new(@host, @port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE # XXX: security issue
headers = {'Cookie' => "nexposeCCSessionID=#{@session_id}"}
resp, data = http.get(uri.path, headers)
data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def download(url)\n Net::HTTP.get_response(url)\n end",
"def download!(source_url, destination_file); end",
"def download\n open(download_url, \"rb\")\n end",
"def download_url(url)\n ethon = ethon_easy_requester\n ethon.url = uri_escape(url)\n ethon.perform\n check_and_raise_... | [
"0.8186735",
"0.80647045",
"0.7876316",
"0.7814024",
"0.7764997",
"0.7737409",
"0.7725789",
"0.76725215",
"0.76248175",
"0.7551136",
"0.7549274",
"0.7537272",
"0.75163966",
"0.7500233",
"0.74871737",
"0.7462842",
"0.7302108",
"0.72932494",
"0.72647786",
"0.7261847",
"0.723799... | 0.6902561 | 48 |
Constructor SiteSummary(id, site_name, description, riskfactor = 1) | def initialize(id, site_name, description, riskfactor = 1)
@id = id
@site_name = site_name
@description = description
@riskfactor = riskfactor
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setSiteSummary(site_name, description, riskfactor = 1)\n\t\t@site_summary = SiteSummary.new(-1,site_name,description,riskfactor)\n\n\tend",
"def initialize(id, name, description = nil, risk_factor = 1.0, risk_score = 0.0)\n @id = id\n @name = name\n @description = description\n... | [
"0.7996299",
"0.6256466",
"0.614319",
"0.5923391",
"0.55336595",
"0.5499226",
"0.5499226",
"0.5499226",
"0.5460647",
"0.5457253",
"0.5456801",
"0.54563326",
"0.54563326",
"0.54563326",
"0.54563326",
"0.54442704",
"0.5425054",
"0.5362183",
"0.5361901",
"0.53580004",
"0.5358000... | 0.775324 | 1 |
Adds a new host to the hosts array | def addHost(host)
@hosts.push(host)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_host(new_host)\n @hosts.push(new_host)\n end",
"def add_hosts(hosts:)\n @hosts = @hosts.+ Array hosts\n\n self\n end",
"def add_host(host)\r\n if host.class == String\r\n host = Regexp.new(host)\r\n end\r\n unless @hosts.include?(host)\r\n @hosts ... | [
"0.8884084",
"0.8204349",
"0.79286087",
"0.72284275",
"0.6981448",
"0.69287103",
"0.687841",
"0.6864809",
"0.6852867",
"0.6831244",
"0.6806289",
"0.67702657",
"0.6681193",
"0.6625394",
"0.6564127",
"0.6503439",
"0.6469259",
"0.6459399",
"0.6385966",
"0.6375869",
"0.63107795",... | 0.8804393 | 1 |
Adds a new alert to the alerts array | def addAlert(alert)
@alerts.push(alert)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def processNewAlerts\n @session.alerts.each{ |alert|\n if alert.is_a? Libtorrent::TorrentAlert\n if alert.handle.valid? && alert.handle.has_metadata\n addToHashList @torrentAlerts, alert.handle.name, alert\n end\n else\n @globalAlerts.push alert\n # For now since n... | [
"0.6480227",
"0.6450747",
"0.6443525",
"0.63254565",
"0.6305897",
"0.624604",
"0.60154456",
"0.60154456",
"0.60058093",
"0.59780246",
"0.594556",
"0.5941758",
"0.59299964",
"0.59228575",
"0.5909573",
"0.58718413",
"0.5863563",
"0.58624804",
"0.58624804",
"0.58624804",
"0.5862... | 0.86483246 | 0 |
Adds a new set of credentials to the credentials array | def addCredentials(credential)
@credentials.push(credential)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add(new_creds)\n @credentials.merge!(new_creds) { |_, old_val, new_val| old_val + new_val }\n end",
"def add_credentials!\n @accessor.auth_manager.add_credentials(self)\n end",
"def credentials= (new_credentials)\n @credentials = new_credentials\n refresh_config_for_api_objects!\n... | [
"0.7433037",
"0.6598774",
"0.6492768",
"0.62903905",
"0.6286005",
"0.62440145",
"0.6187075",
"0.59325254",
"0.59186363",
"0.5910078",
"0.58930194",
"0.58930194",
"0.588049",
"0.58173776",
"0.56765944",
"0.5674232",
"0.56511533",
"0.5614458",
"0.55812615",
"0.55790323",
"0.549... | 0.7587862 | 0 |
Creates a new site summary | def setSiteSummary(site_name, description, riskfactor = 1)
@site_summary = SiteSummary.new(-1,site_name,description,riskfactor)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_site(site_id)\n sites << SiteSummary.new(site_id, nil)\n end",
"def create_summary\r\n puts \"Creating a summary...\"\r\n #@lists.disp_summary\r\n create_html_summary\r\n file = File.open('test.html','w')\r\n file << @html\r\n file.close\r\n end",
"def create_site\n ... | [
"0.69197255",
"0.6624789",
"0.6449357",
"0.6373097",
"0.62918705",
"0.6279494",
"0.6032118",
"0.5928891",
"0.589962",
"0.58874506",
"0.5818572",
"0.5816346",
"0.5792674",
"0.57792425",
"0.57620955",
"0.57620955",
"0.57620955",
"0.5749058",
"0.5739657",
"0.5734253",
"0.5713904... | 0.73696053 | 0 |
Creates a new site configuration | def setSiteConfig(site_name, description, riskfactor = 1)
setSiteSummary(site_name,description,riskfactor)
@site_config = SiteConfig.new()
@site_config._set_site_id(-1)
@site_config._set_site_name(site_name)
@site_config._set_description(description)
@site_config._set_riskfactor(riskfactor)
@site_config._... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n\t\t@siteconfig = Siteconfig.new(siteconfig_params)\n\n\t\trespond_to do |format|\n\t\t\tif @siteconfig.save\n\t\t\t\tformat.html { redirect_to @siteconfig, notice: 'Siteconfig was successfully created.' }\n\t\t\t\tformat.json { render :show, status: :created, location: @siteconfig }\n\t\t\telse\n\t\t\... | [
"0.7455201",
"0.7371334",
"0.68948835",
"0.6650039",
"0.6587849",
"0.6536037",
"0.65266025",
"0.6513843",
"0.6501553",
"0.6490257",
"0.6385314",
"0.6371129",
"0.6346639",
"0.6322155",
"0.63117313",
"0.6303964",
"0.62797934",
"0.62659323",
"0.625457",
"0.62357",
"0.6187445",
... | 0.6391646 | 10 |
Initiates a scan of this site. If successful returns scan_id and engine_id in an associative array. Returns false if scan is unsuccessful. | def scanSite()
r = @connection.execute('<SiteScanRequest session-id="' + "#{@connection.session_id}" + '" site-id="' + "#{@site_id}" + '"/>')
if(r.success)
res = {}
r.res.elements.each('//Scan/') do |s|
res[:scan_id] = s.attributes['scan-id']
res[:engine_id] = s.attributes['engine-id']
end
ret... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scan\n @radar_scan, @known_items = import_data\n @results = Services::Scan.new(\n radar_scan: @radar_scan,\n known_items: @known_items,\n accuracy: MATCH_ACCURACY\n ).run\n rescue ArgumentError => e\n puts \"Error: #{e.message}\"\n end",
"def set_scan\n @sc... | [
"0.6170824",
"0.57609826",
"0.5449362",
"0.54262173",
"0.53911483",
"0.5362158",
"0.53206366",
"0.53129786",
"0.5270734",
"0.5194445",
"0.51837474",
"0.5124518",
"0.5124272",
"0.5124272",
"0.5120403",
"0.51109487",
"0.5106184",
"0.50939775",
"0.5085293",
"0.5066643",
"0.50643... | 0.71475154 | 0 |
Saves this site in the NSC | def saveSite()
r = @connection.execute('<SiteSaveRequest session-id="' + @connection.session_id + '">' + getSiteXML() + ' </SiteSaveRequest>')
if (r.success)
@site_id = r.attributes['site-id']
@site_config._set_site_id(@site_id)
@site_config.scanConfig._set_configID(@site_id)
@site_config.scanConfig._s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new_site_save\n active_submit.click\n end",
"def save_site params\n SiteProcessor.new(self).save_site(params)\n end",
"def save_webpage\n @webpage = Webpage.find_or_initialize_by(url: webpage_url)\n @webpage.update(\n body: response_body,\n content_type: content_type,\n ... | [
"0.7453241",
"0.7168237",
"0.68512344",
"0.67026675",
"0.6648153",
"0.6610345",
"0.6496004",
"0.6484621",
"0.64741284",
"0.6424018",
"0.64164394",
"0.6369484",
"0.6286029",
"0.6251189",
"0.6251189",
"0.62299",
"0.62079716",
"0.619089",
"0.6182036",
"0.6182036",
"0.6182036",
... | 0.7602464 | 0 |
Sets the credentials information for this object. | def setCredentials(service, host, port, userid, password, realm)
@isblob = false
@securityblob = nil
@service = service
@host = host
@port = port
@userid = userid
@password = password
@realm = realm
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_credentials(credentials)\n @credentials = credentials\n end",
"def credentials=(credentials)\n @lock.synchronize do\n @credentials = credentials\n end\n end",
"def set_credentials\n @user = User.find(current_user.id)\n end",
"def credentials=(cr... | [
"0.82665646",
"0.77419454",
"0.75250876",
"0.7500264",
"0.74559146",
"0.7382858",
"0.72577965",
"0.71712106",
"0.6980227",
"0.6855445",
"0.6855445",
"0.68333644",
"0.6801266",
"0.67686224",
"0.6754271",
"0.6751831",
"0.6694294",
"0.6691563",
"0.6665129",
"0.6654712",
"0.65431... | 0.667312 | 18 |
Adds a new Recipient to the recipients array | def addRecipient(recipient)
@recipients.push(recipient)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add(*recipients)\n return if recipients.size == 0\n recipients.each do |r|\n if r.is_a?(Array) && !r.empty? \n if r.size==2 && r[1].is_a?(Hash)\n add_recipient(r)\n else\n r.each { |rr| self.add_recipient(Mail::Tools::Recipient.coerce(rr)) ... | [
"0.77624243",
"0.75566787",
"0.7318761",
"0.7114402",
"0.7097566",
"0.7093831",
"0.6890958",
"0.6860568",
"0.67513597",
"0.6637786",
"0.66249275",
"0.66249275",
"0.65181446",
"0.64514905",
"0.6307483",
"0.6225928",
"0.62237793",
"0.6185645",
"0.61758286",
"0.61685497",
"0.614... | 0.8006889 | 0 |
Sets the Vulnerability Filter for this alert. | def setVulnFilter(vulnFilter)
@vulnFilter = vulnFilter
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filter(filter)\n @filters << CGI.escape(filter)\n self\n end",
"def set_PrivacyFilter(value)\n set_input(\"PrivacyFilter\", value)\n end",
"def set_PrivacyFilter(value)\n set_input(\"PrivacyFilter\", value)\n end",
"def set_PrivacyFilter(value)\n set_... | [
"0.5885756",
"0.5863853",
"0.5863853",
"0.5863853",
"0.5863853",
"0.5863853",
"0.5863853",
"0.5842787",
"0.5732268",
"0.56916726",
"0.56916726",
"0.56916726",
"0.56612587",
"0.5615621",
"0.56097573",
"0.5541768",
"0.55300343",
"0.5509347",
"0.5509347",
"0.5458578",
"0.5450688... | 0.7089711 | 1 |
Sets the Vulnerability Filter for this alert. | def setVulnFilter(vulnFilter)
@vulnFilter = vulnFilter
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filter(filter)\n @filters << CGI.escape(filter)\n self\n end",
"def set_PrivacyFilter(value)\n set_input(\"PrivacyFilter\", value)\n end",
"def set_PrivacyFilter(value)\n set_input(\"PrivacyFilter\", value)\n end",
"def set_PrivacyFilter(value)\n set_... | [
"0.58906376",
"0.58672285",
"0.58672285",
"0.58672285",
"0.58672285",
"0.58672285",
"0.58672285",
"0.5847989",
"0.57377106",
"0.56953704",
"0.56953704",
"0.56953704",
"0.5664974",
"0.5619388",
"0.5613349",
"0.5547952",
"0.55341315",
"0.55129045",
"0.55129045",
"0.54629785",
"... | 0.7090936 | 0 |
Sets the Vulnerability Filter for this alert. | def setVulnFilter(vulnFilter)
@vulnFilter = vulnFilter
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filter(filter)\n @filters << CGI.escape(filter)\n self\n end",
"def set_PrivacyFilter(value)\n set_input(\"PrivacyFilter\", value)\n end",
"def set_PrivacyFilter(value)\n set_input(\"PrivacyFilter\", value)\n end",
"def set_PrivacyFilter(value)\n set_... | [
"0.5885636",
"0.58639044",
"0.58639044",
"0.58639044",
"0.58639044",
"0.58639044",
"0.58639044",
"0.58427024",
"0.57327527",
"0.5691024",
"0.5691024",
"0.5691024",
"0.5661069",
"0.56151944",
"0.56092066",
"0.55419254",
"0.55295134",
"0.5508874",
"0.5508874",
"0.54588276",
"0.... | 0.7088162 | 2 |
Adds a new Schedule for this ScanConfig | def addSchedule(schedule)
@schedules.push(schedule)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def schedule=(value)\n @schedule = value\n end",
"def schedule=(value)\n @schedule = value\n end",
"def schedule=(value)\n @schedule = value\n end",
"def add_schedule(schedule_id)\n check_schedule_validity(schedule_id)\n ... | [
"0.64903384",
"0.64903384",
"0.64903384",
"0.6332242",
"0.62668866",
"0.6224667",
"0.6138975",
"0.6079842",
"0.6044136",
"0.5940203",
"0.5879883",
"0.586989",
"0.5844843",
"0.58115256",
"0.57530886",
"0.57030046",
"0.57005304",
"0.57005304",
"0.57005304",
"0.57005304",
"0.570... | 0.74734527 | 0 |
Adds a new ScanTrigger to the scanTriggers array | def addScanTrigger(scanTrigger)
@scanTriggers.push(scanTrigger)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_trigger(opts)\n opts = opts.with_indifferent_access\n t = Trigger.new\n t.check_id = opts[:check_id]\n t.metric_id = opts[:metric_id]\n t.set_severity(opts[:severity])\n t.sign = opts[:sign].to_sym\n t.threshold = opts[:threshold]\n t.status = array(opts[:status]).map{ |s| ... | [
"0.5425216",
"0.5297298",
"0.5225742",
"0.5108681",
"0.50138247",
"0.4959681",
"0.4959681",
"0.49407697",
"0.48955232",
"0.48653728",
"0.48476997",
"0.48457587",
"0.48438084",
"0.48076475",
"0.47451892",
"0.4744748",
"0.47108138",
"0.4710766",
"0.4676499",
"0.4653168",
"0.464... | 0.8580232 | 0 |
Constructor ScanSummary(can_id, $engine_id, $name, tartTime, $endTime, tatus) | def initialize(scan_id, engine_id, name, startTime, endTime, status)
@scan_id = scan_id
@engine_id = engine_id
@name = name
@startTime = startTime
@endTime = endTime
@status = status
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(title, kind, date = nil)\n @title = title\n @kind = kind\n @date = date\n @table_name = nil\n @total_pot = 0.0\n @rake = 0.0\n @blinds_amounts = { :bb => 0, :sb => 0, :ante => 0 }\n @max_players = 0\n @button_seat = -1\n @actions = []\n @players... | [
"0.54013187",
"0.53773266",
"0.5212786",
"0.5212786",
"0.5212786",
"0.5212786",
"0.51704276",
"0.51690835",
"0.5152465",
"0.5127417",
"0.51271296",
"0.5094957",
"0.5066028",
"0.5060461",
"0.50496036",
"0.5031509",
"0.50091547",
"0.50091547",
"0.49861288",
"0.49745643",
"0.496... | 0.6622308 | 0 |
Constructor EngineSummary(id, name, address, port, status) | def initialize(id, name, address, port, status)
@id = id
@name = name
@address = address
@port = port
@status = status
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(scan_id, engine_id, name, startTime, endTime, status)\n\n\t\t@scan_id = scan_id\n\t\t@engine_id = engine_id\n\t\t@name = name\n\t\t@startTime = startTime\n\t\t@endTime = endTime\n\t\t@status = status\n\n\tend",
"def initialize(summary)\n @entity_url = summary.entityId\n @brand_name = sum... | [
"0.64699847",
"0.6057656",
"0.5701173",
"0.5575756",
"0.5569841",
"0.5569477",
"0.5549608",
"0.55174804",
"0.5514345",
"0.55086356",
"0.5477247",
"0.54565996",
"0.5450669",
"0.54370093",
"0.5433135",
"0.5417728",
"0.540083",
"0.53785896",
"0.53759104",
"0.53687584",
"0.535408... | 0.66249514 | 0 |
Constructor VulnerabilitySummary(id, title, severity) | def initialize(id, title, severity)
@id = id
@title = title
@severity = severity
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(id, site_name, description, riskfactor = 1)\n\t\t@id = id\n\t\t@site_name = site_name\n\t\t@description = description\n\t\t@riskfactor = riskfactor\n\tend",
"def initialize(id, name, description = nil, risk_factor = 1.0, risk_score = 0.0)\n @id = id\n @name = name\n ... | [
"0.6209961",
"0.61192906",
"0.5910134",
"0.5768752",
"0.57491994",
"0.57230395",
"0.567855",
"0.56354827",
"0.5568866",
"0.5527819",
"0.5523959",
"0.5507932",
"0.5426278",
"0.541638",
"0.541638",
"0.53385717",
"0.5329982",
"0.53145117",
"0.53098786",
"0.5301345",
"0.5287747",... | 0.77862 | 0 |
Constructor ReportConfigSummary(id, name, format, last_generated_on, last_generated_uri) | def initialize(id, name, format, last_generated_on, last_generated_uri)
@id = id
@name = name
@format = format
@last_generated_on = last_generated_on
@last_generated_uri = last_generated_uri
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new_config\n Config.new(\n # This field is expected in API responses\n # and should point to an individual resource with more data\n :uri_property_name => :href,\n # Total number of entries\n # Used to paginate lists\n :total_entries_property_name => :... | [
"0.54770464",
"0.527277",
"0.52092046",
"0.5160364",
"0.5130664",
"0.50825983",
"0.503878",
"0.5035823",
"0.49941522",
"0.49850184",
"0.497442",
"0.4970757",
"0.49411067",
"0.49237147",
"0.49172655",
"0.49090278",
"0.48740774",
"0.48553368",
"0.4852006",
"0.48232898",
"0.4815... | 0.5754099 | 0 |
=== Description Generate a new report on this report definition. Returns the new report ID. | def generateReport(debug = false)
return generateReport(@connection, @config_id, debug)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_new_report!; end",
"def create_new_report!; end",
"def create_report\n Report.create_for_team(id)\n end",
"def create_report\n Report.create_for_team(id)\n end",
"def create_new_report!\n File.write(report_filename, report_title + report_body)\n end",
"def create_re... | [
"0.7242479",
"0.7242479",
"0.69362444",
"0.69362444",
"0.674303",
"0.6535895",
"0.6285572",
"0.61921424",
"0.60053045",
"0.5990438",
"0.59561235",
"0.5936578",
"0.58932966",
"0.5834243",
"0.582366",
"0.5822751",
"0.58107716",
"0.5792759",
"0.5790903",
"0.57754374",
"0.5751093... | 0.5534835 | 52 |
=== Description Save the report definition to the NSC. Returns the configid. | def saveReport()
r = @connection.execute('<ReportSaveRequest session-id="' + @connection.session_id.to_s + '">' + getXML().to_s + ' </ReportSaveRequest>')
if(r.success)
@config_id = r.attributes['reportcfg-id']
return true
end
return false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_report\n report = Report.create(name: @name, start_date: @start_date,\n end_date: @end_date, type: @type,\n creator: User.current.id,\n renderer_type: 'PDF')\n\n values = save_report_values(report)\n\n ... | [
"0.6069493",
"0.5912755",
"0.5886813",
"0.5832655",
"0.57867104",
"0.57588726",
"0.5753608",
"0.57301337",
"0.5694701",
"0.56403196",
"0.5639328",
"0.5633168",
"0.5603479",
"0.5579907",
"0.5558074",
"0.55407864",
"0.5513967",
"0.54481465",
"0.54255843",
"0.5421813",
"0.540058... | 0.75546724 | 0 |
=== Description Adds a new filter to the report config | def addFilter(filter_type, id)
filter = ReportFilter.new(filter_type,id)
@filters.push(filter)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_filter\n @filter = true \n end",
"def add_filter(filter)\n @filters << filter\n end",
"def add_filter(filter)\n @filters << filter\n self\n end",
"def add_filter(name, assertion, equals)\n @filters << Filter.new(name, assertion, equals)\n end",
"def add_filters(filt... | [
"0.7747643",
"0.7698446",
"0.7629641",
"0.73331916",
"0.72938246",
"0.7254023",
"0.7254023",
"0.6916323",
"0.6886741",
"0.68830293",
"0.67512846",
"0.66852164",
"0.66699076",
"0.66151154",
"0.66121596",
"0.660925",
"0.66009843",
"0.6581277",
"0.65280443",
"0.6492708",
"0.6486... | 0.7290029 | 5 |
=== Description Adds a new email recipient | def addEmailRecipient(recipient)
@email_recipients.push(recipient)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def addrecipient(msgid, recipient)\n req(\"addrecipient\", recipient, \"\", msgid, \"\")\n end",
"def add_recipient(recipient, params = {})\n @api.post(\"#{@api.path}/Group/#{@id}/Recipient\", body: recipient, params: params)\n end",
"def addRecipient(recipient)\n\t\t@reci... | [
"0.753981",
"0.7121937",
"0.70514554",
"0.7043569",
"0.7021833",
"0.69916505",
"0.69285893",
"0.68473405",
"0.68473405",
"0.6782109",
"0.6684777",
"0.6673069",
"0.66706085",
"0.6655151",
"0.6645464",
"0.6633746",
"0.66304773",
"0.6537875",
"0.65224797",
"0.65001464",
"0.64519... | 0.7529928 | 1 |
=== Description Sets the schedule for this report config | def setSchedule(schedule)
@schedule = schedule
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def schedule=(value)\n @schedule = value\n end",
"def schedule=(value)\n @schedule = value\n end",
"def schedule=(value)\n @schedule = value\n end",
"def set_schedule\n @schedule = Schedule.find(params[:id])\n end",
"... | [
"0.80143857",
"0.80143857",
"0.80143857",
"0.69363636",
"0.6713448",
"0.6713448",
"0.6713448",
"0.6713448",
"0.6713448",
"0.6713448",
"0.6713448",
"0.6713448",
"0.6713448",
"0.6713448",
"0.6713448",
"0.6713448",
"0.6713448",
"0.6713448",
"0.6713448",
"0.6713448",
"0.6713448",... | 0.75945896 | 3 |
Compute details hash and key according to user options (e.g. passed from render). default "details": default_formats: ::ActionView::Base.default_formats || [:html, :text, :js, :css, :xml, :json] default_variants: [] default_handlers: ::ActionView::Template::Handlers.extensions deault_locale: [:en] (after calculation ;)... | def detail_args_for(options)
# for most plain case, you may not provide any of [:locale, :formats, :variants, :handlers]
# it will return here
return @details, details_key if options.empty?
# merge details with "details" provided by "user"
user_details = @details.merge(option... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def details\n return @details if @defaults\n\n @details = {}\n @details[:info] = {container: \"bg-indigo-100 text-indigo-600 border-indigo-200\", icon: \"fa-info-circle text-indigo-500\"}\n @details[:warning] = {container: \"bg-yellow-100 text-yellow-600 border-yellow-200\", icon: \"fa-exclamation-tria... | [
"0.64307237",
"0.6337939",
"0.60298926",
"0.5854514",
"0.58430016",
"0.57796705",
"0.5695896",
"0.5541859",
"0.55260664",
"0.55217904",
"0.54269826",
"0.5415095",
"0.539638",
"0.5377416",
"0.53724694",
"0.53706205",
"0.5370051",
"0.5329351",
"0.53011703",
"0.5264823",
"0.5256... | 0.6559962 | 0 |
Support legacy foo.erb names even though we now ignore .erb as well as incorrectly putting part of the path in the template name instead of the prefix. | def normalize_name(name, prefixes) #:nodoc:
prefixes = prefixes.presence
parts = name.to_s.split('/')
parts.shift if parts.first.empty?
name = parts.pop
# return here if name is just like "show"
return name, prefixes || [""] if parts.empty?
# other... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def template_module_name(path)\n 'Template_' + path.to_s.gsub(/[^a-z0-9]/i, '_')\n end",
"def template_name\n self.path.scan(/[^\\/]+$/).first\n end",
"def render_file_path(template)\n template.gsub(%r{.templates/.*?erb}, File.basename(template)).gsub('.erb', '')\n end",
"def temp... | [
"0.67174166",
"0.6611181",
"0.65604025",
"0.6474987",
"0.63748586",
"0.62962997",
"0.62907815",
"0.62621474",
"0.62580824",
"0.6222011",
"0.6203872",
"0.6200402",
"0.61216086",
"0.6077668",
"0.6071521",
"0.6068821",
"0.6068821",
"0.60284144",
"0.59723717",
"0.5953947",
"0.590... | 0.0 | -1 |
The following is for controlling Clients through Admin Profiles | def index_clients
@client = Client.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setAsAdmin\n self.clientType = CLIENT_TYPES[:administrator]\n end",
"def admin_only\n current_client == current_user\n unless current_user.admin? || @client == current_user\n redirect_to clients_path, :alert => \"Access denied.\"\n end\n end",
"def set_client\n if current_user.t... | [
"0.69572324",
"0.67739016",
"0.6562565",
"0.65421546",
"0.6310869",
"0.6265495",
"0.62603426",
"0.6234657",
"0.6169198",
"0.61201304",
"0.6031078",
"0.6026301",
"0.6004032",
"0.60002285",
"0.59623796",
"0.5951686",
"0.59516734",
"0.59319675",
"0.5923241",
"0.59210384",
"0.591... | 0.0 | -1 |
The following is for controlling Stylists through Admin Profiles | def show_stylist
@stylist = Stylist.find(params[:id])
@rating = @stylist.ratings
@portfolio = @stylist.portfolios
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def activate\n Layout.send :is_site_scoped, :shareable => true\n Snippet.send :is_site_scoped, :shareable => true\n User.send :is_site_scoped, :shareable => true\n ApplicationHelper.send :include, ScopedHelper\n \n unless admin.users.edit.form && admin.users.edit.form.include?('choose_site')\... | [
"0.57102096",
"0.5685032",
"0.5669773",
"0.5669773",
"0.55536485",
"0.54828966",
"0.54388225",
"0.54181534",
"0.53956264",
"0.53913945",
"0.53883195",
"0.5377363",
"0.53122973",
"0.529951",
"0.5286082",
"0.5277033",
"0.5273355",
"0.52712166",
"0.5242003",
"0.5236346",
"0.5196... | 0.0 | -1 |
The following is for controlling Ratings through Admin Profiles | def index_ratings
@rating = Rating.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rating\r\n\t\t@rating\r\n\tend",
"def rating #Getter\n @rating\n end",
"def set_Rating(value)\n set_input(\"Rating\", value)\n end",
"def show\n set_rating\n end",
"def rating\n @rating\n end",
"def rating\n @ole.Rating\n end",
"def set_rating\n @rating = ... | [
"0.70589596",
"0.6993022",
"0.6915261",
"0.68495697",
"0.6849106",
"0.6799402",
"0.67697287",
"0.6767396",
"0.6765267",
"0.6765267",
"0.6765267",
"0.6762394",
"0.6762394",
"0.6762394",
"0.6762394",
"0.6762394",
"0.6762394",
"0.6762394",
"0.6762394",
"0.6762394",
"0.6762394",
... | 0.59673685 | 81 |
GET /users GET /users.json | def index
@users = User.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def users(args = {})\n get(\"/users.json\",args)\n end",
"def show\n begin\n user = User.find(params[:user_id])\n render json: { users: user }, status: :ok\n rescue => e\n render json: { errors: e.message}, status: 404\n end\n end",
"def GetUsers params = {}\n\n para... | [
"0.82109934",
"0.7873764",
"0.7860689",
"0.78108346",
"0.78067017",
"0.7678852",
"0.76586664",
"0.76318866",
"0.7582366",
"0.75291824",
"0.7487637",
"0.74485743",
"0.7439024",
"0.7437192",
"0.7427442",
"0.73978853",
"0.73978853",
"0.73978853",
"0.73978853",
"0.7377353",
"0.73... | 0.0 | -1 |
GET /users/1 GET /users/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/users.json\"\t \n response = RestClient.get(url)\n @users = JSON.parse(response.body)\t\t \n\tend\n ... | [
"0.81048656",
"0.77027845",
"0.77025455",
"0.76260805",
"0.75833637",
"0.7480247",
"0.74608636",
"0.74466467",
"0.73058736",
"0.73001456",
"0.7289628",
"0.727714",
"0.7235184",
"0.723314",
"0.723314",
"0.723314",
"0.723314",
"0.723314",
"0.723314",
"0.723314",
"0.7224975",
... | 0.0 | -1 |
POST /users POST /users.json | def create
@user = User.new(user_params)
respond_to do |format|
if @user.save
format.html { redirect_to user_url(@user), notice: 'User was successfully created.' }
format.json { render :show, status: :created, location: @user }
else
format.html { render :new }
format... | {
"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 CreateUser params = {}\n \n APICall(path: 'users.json',method: 'POST',payload: params.to_json)\n \n end",
"def post b... | [
"0.77161855",
"0.75194556",
"0.7383022",
"0.7240797",
"0.71973956",
"0.714118",
"0.7104371",
"0.7059066",
"0.7041304",
"0.7024592",
"0.700339",
"0.70024",
"0.70024",
"0.70024",
"0.69927466",
"0.6990943",
"0.69806844",
"0.6979046",
"0.69788784",
"0.69788784",
"0.6976385",
"0... | 0.0 | -1 |
PATCH/PUT /users/1 PATCH/PUT /users/1.json | def update
respond_to do |format|
if @user.update(user_params)
format.html { redirect_to user_url(@user), notice: 'User was successfully updated.' }
format.json { render :show, status: :ok, location: @user }
else
format.html { render :edit }
format.json { render json: @us... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end",
"def update\n render json: Users.update(params[\"id\"], params[\"user\"])\n end",
"def UpdateUser params = {}\n \n APICall(path: 'users.json',method: 'PUT',payload: params.to_json)\n \n end",
"de... | [
"0.72253805",
"0.71289",
"0.700331",
"0.69041485",
"0.6821952",
"0.6815513",
"0.6708841",
"0.66929746",
"0.66804945",
"0.6673429",
"0.6671784",
"0.6664563",
"0.6664563",
"0.6659639",
"0.6659639",
"0.665341",
"0.6647372",
"0.66439104",
"0.66416556",
"0.663512",
"0.66181254",
... | 0.0 | -1 |
DELETE /users/1 DELETE /users/1.json | def destroy
@user.destroy
respond_to do |format|
format.html { redirect_to users_url, notice: 'User was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def DeleteUser id\n \n APICall(path: \"users/#{id}.json\",method: 'DELETE')\n \n end",
"def delete\n render json: User.delete(params[\"id\"])\n end",
"def delete(id)\n request(:delete, \"/users/#{id}.json\")\n end",
"def delete\n render json: Users.delete(params[\"id\... | [
"0.78748035",
"0.7751536",
"0.77133286",
"0.7609853",
"0.74719006",
"0.74066395",
"0.74066395",
"0.73689586",
"0.73451644",
"0.7339677",
"0.732709",
"0.73090446",
"0.7308616",
"0.73056364",
"0.72965425",
"0.7290797",
"0.7290501",
"0.72882193",
"0.7283193",
"0.7249783",
"0.724... | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_user
@user = User.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6165152",
"0.60463154",
"0.59467196",
"0.5917112",
"0.5890387",
"0.58345735",
"0.57773316",
"0.56991524",
"0.56991524",
"0.565454",
"0.5622282",
"0.54232633",
"0.54119074",
"0.54119074",
"0.54119074",
"0.53937256",
"0.53801376",
"0.5358599",
"0.53412294",
"0.5340814",
"0.5... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def user_params
params.require(:user).permit(:first_name, :last_name, :image, :api_key, :rotate, :role)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.6980629",
"0.67819995",
"0.67467666",
"0.67419875",
"0.67347664",
"0.65928614",
"0.6504013",
"0.6498014",
"0.64819515",
"0.64797956",
"0.64562726",
"0.64400834",
"0.6380117",
"0.6377456",
"0.63656694",
"0.6320543",
"0.63002014",
"0.62997127",
"0.629425",
"0.6293866",
"0.62... | 0.0 | -1 |
POST /loan_munitions POST /loan_munitions.json | def create
@reserve = Reserve.where(id: params[:reserf_id]).first
@soldier = Soldier.find(params[:soldier_id])
@loan = Loan.find(params[:loan_id])
@loan_munition = @loan.loan_munitions.build(loan_munition_params)
@loan_munition.loan = @loan
@loan_munition.reserve = @reserve
@loan_munit... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def loan_munition_params\n params.require(:loan_munition).permit(:munition_id, :amount)\n end",
"def set_loan_munition\n @reserve = Reserve.where(id: params[:reserf_id]).first\n @soldier = Soldier.find(params[:soldier_id])\n @loan = Loan.find(params[:loan_id])\n @loan_munition = LoanM... | [
"0.6222281",
"0.5927909",
"0.54956794",
"0.5398362",
"0.5326531",
"0.53179896",
"0.5267985",
"0.5260056",
"0.52212197",
"0.5185385",
"0.5152805",
"0.5152805",
"0.5129171",
"0.5111754",
"0.5104885",
"0.5084888",
"0.50612223",
"0.50598335",
"0.50305545",
"0.50062007",
"0.498692... | 0.58554304 | 2 |
PATCH/PUT /loan_munitions/1 PATCH/PUT /loan_munitions/1.json | def update
respond_to do |format|
if @loan_munition.update(loan_munition_params)
format.html { redirect_to reserf_soldier_loan_path(@reserve,@soldier,@loan), notice: 'Loan munition was successfully updated.' }
format.json { render :show, status: :ok, location: reserf_soldier_loan_path(@reserve... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @loan_management.update(loan_management_params)\n format.html { redirect_to @loan_management, notice: 'Loan management was successfully updated.' }\n format.json { render :show, status: :ok, location: @loan_management }\n else\n format.html... | [
"0.62619996",
"0.6243723",
"0.61526173",
"0.61253095",
"0.6124814",
"0.6102781",
"0.6102781",
"0.60500157",
"0.60246336",
"0.59828866",
"0.59479374",
"0.59458",
"0.5940857",
"0.59295976",
"0.5923546",
"0.59103423",
"0.59037495",
"0.58986086",
"0.5880054",
"0.5879823",
"0.5868... | 0.676114 | 0 |
DELETE /loan_munitions/1 DELETE /loan_munitions/1.json | def destroy
@munition = Munition.find(@loan_munition.munition)
@munition.amount += @loan_munition.amount
@munition.save
@loan_munition.destroy
respond_to do |format|
format.html { redirect_to reserf_soldier_loan_path(@reserve,@soldier,@loan), notice: 'Loan munition was successfully destroyed.'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @loan_management.destroy\n respond_to do |format|\n format.html { redirect_to loan_managements_url, notice: 'Loan management was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @loan.destroy\n respond_to do |format|\n format.... | [
"0.6708563",
"0.6641663",
"0.65834576",
"0.6568065",
"0.65612054",
"0.65612054",
"0.655981",
"0.6541289",
"0.65245533",
"0.6518052",
"0.65087986",
"0.6495988",
"0.6490028",
"0.6490028",
"0.6490028",
"0.6480536",
"0.6465683",
"0.6445573",
"0.64387393",
"0.6429554",
"0.6419782"... | 0.6746377 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_loan_munition
@reserve = Reserve.where(id: params[:reserf_id]).first
@soldier = Soldier.find(params[:soldier_id])
@loan = Loan.find(params[:loan_id])
@loan_munition = LoanMunition.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163754",
"0.6045816",
"0.5944853",
"0.59169096",
"0.58892167",
"0.58342934",
"0.5776148",
"0.57057375",
"0.57057375",
"0.56534296",
"0.56209534",
"0.54244673",
"0.54101455",
"0.54101455",
"0.54101455",
"0.53951085",
"0.5378493",
"0.53563684",
"0.53399915",
"0.5338049",
"0... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def loan_munition_params
params.require(:loan_munition).permit(:munition_id, :amount)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.6979893",
"0.6781746",
"0.6746611",
"0.6742344",
"0.6735229",
"0.6592651",
"0.65027124",
"0.6498011",
"0.648163",
"0.647716",
"0.64556813",
"0.64386255",
"0.63784456",
"0.63756156",
"0.636574",
"0.6319542",
"0.63004524",
"0.6299559",
"0.62925464",
"0.62923217",
"0.6289894"... | 0.0 | -1 |
:doggo_id cant equal :friend_id | def void_self_friendship
if doggo_id == friend_id
errors.add(:doggo_id, 'cannot friend self you lonely doggo')
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_already_friend(friend_id)\n @friend = Friendship.where('friend_id = ' + friend_id.to_s + \" AND user_id = \"+id.to_s)[0]\n return !@friend.blank?\n end",
"def is_friends_bottle?(id) \n# ......\n# ......\n return false\n end",
"def friendship(friend)\n \t ::Fr... | [
"0.6398396",
"0.6314842",
"0.6226219",
"0.6178185",
"0.6162854",
"0.61565965",
"0.6033557",
"0.5930046",
"0.5886764",
"0.5834712",
"0.5819339",
"0.577932",
"0.57601523",
"0.57590467",
"0.57426506",
"0.5736402",
"0.57243633",
"0.5706337",
"0.5668207",
"0.56341225",
"0.56119096... | 0.71596116 | 0 |
Also fetch if followers, followings, or repos are empty | def fetch
super
if [:followers, :followings, :repos].any? {|assoc| self.send(assoc).empty?}
api_obj.fetch(:followers, :followings, :repos)
@followers = @followings = @projects = nil
end
self
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fetch\n return nil if !repo || !user\n if fetched?\n pull\n else\n clone\n end\n end",
"def should_fetch?\n last_fetched_at.nil? or !fetched_directly? or facebook_api_error.present?\n end",
"def fetch\n if fetcher.fetch_required?\n fetcher.fetch\n ... | [
"0.6233493",
"0.6209737",
"0.610181",
"0.6031901",
"0.5977632",
"0.58893025",
"0.5831355",
"0.58056355",
"0.57287544",
"0.5671464",
"0.564988",
"0.562829",
"0.562469",
"0.56119615",
"0.56104195",
"0.5601308",
"0.5556018",
"0.55543256",
"0.5517222",
"0.5515503",
"0.5504512",
... | 0.73332727 | 0 |
Synchronize object with GitHub | def sync
api_obj.fetch(:self, :followers, :followings, :repos)
@followers = @followings = @projects = nil
self
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sync\n get_github_issues\n update_authors_synced_with_issue\n delete_authors_synced_with_no_issue\n create_issues_for_authors_not_yet_synced\n create_authors_for_issues_not_yet_synced\n rescue => err\n Rails.logger.error \"Aborting synchronization\"\n Rails.logger.error \"There was an err... | [
"0.70651305",
"0.69089687",
"0.6578515",
"0.6494935",
"0.6494935",
"0.6371453",
"0.63009435",
"0.62352675",
"0.62352675",
"0.62352675",
"0.62335134",
"0.62294686",
"0.62077415",
"0.61755055",
"0.607593",
"0.6062422",
"0.6040865",
"0.6006604",
"0.59710395",
"0.594083",
"0.5937... | 0.6508476 | 3 |
Override each to descend into project. Can't do that through normal summary information, as it leads to recursion loops | def each(summary = nil, &block)
super
projects.each {|p| p.each(&block)} unless summary
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def each_project(&block)\n depth_first = lambda do |p|\n p.projects.each { |c| depth_first.call(c, &block) }\n block.call(p)\n end\n depth_first.call(@project)\n end",
"def deep_each\n \n end",
"def projects ; end",
"def projects_analysis\n @projects.each { |p| project_... | [
"0.6716064",
"0.6256608",
"0.6185965",
"0.6083455",
"0.5948059",
"0.5897111",
"0.5834117",
"0.57668734",
"0.57422286",
"0.5731031",
"0.5721884",
"0.56973344",
"0.56812406",
"0.567294",
"0.56596553",
"0.5620456",
"0.5582016",
"0.5564866",
"0.5535453",
"0.5530286",
"0.5486438",... | 0.738929 | 0 |
I worked on this challenge [by myself, with: ]. This challenge took me [] hours. Pseudocode =begin 1. Take a string a input 2. split each string into separate array elements 3. reverse each element of the array 4. join the array back together 5. print the output =end Initial Solution | def reverse_words(string)
# reversed_string = string.reverse!
# reversed_array = reversed_string.split(" ")
# p reversed_array
# reversed_array.sort! {|x, y| y<=>x}
# p reversed_array
split_string = string.split(" ")
split_string.each do |word|
word.reverse!
end
reversed_str... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reverse(string)\n #declare new array\n reversed = []\n #split string into separate characters in an array\n stringArray = string.split\n #loop through array from end to beginning\n i = string.length-1\n while (i >= 0)\n reversed.push(stringArray[i])\n i = i-1\n #push all characters in... | [
"0.8125435",
"0.79121673",
"0.7812403",
"0.7787222",
"0.77661294",
"0.77410185",
"0.7739197",
"0.7704209",
"0.76642585",
"0.76242316",
"0.7584712",
"0.75660104",
"0.75584495",
"0.75458616",
"0.7504843",
"0.7481074",
"0.74702835",
"0.74699",
"0.74494743",
"0.7441484",
"0.74262... | 0.72757375 | 34 |
plugs in the correct info for other methods | def virus_effects
predicted_deaths
speed_of_spread
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_info\n end",
"def get_info\n end",
"def get_info\n end",
"def private; end",
"def info; end",
"def info; end",
"def details; end",
"def probers; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def who_we_are\r\n end",
"def my_info\r\n end",
... | [
"0.63576925",
"0.63576925",
"0.63576925",
"0.6344179",
"0.6285667",
"0.6285667",
"0.60955393",
"0.6093819",
"0.6066756",
"0.6066756",
"0.6066756",
"0.6066756",
"0.603846",
"0.6023579",
"0.59938455",
"0.59866977",
"0.5965189",
"0.5900487",
"0.58796495",
"0.58559495",
"0.581599... | 0.0 | -1 |
Starts a new UDP server that listens on the given port. The state is updated atomically and yielded to an optional block everytime a change is made. By returning `false` the block can cancel the state update. This call is blocking. | def run(host: nil, port: DEFAULT_PORT, &block)
logger.info "Listening on port #{port}"
Socket.udp_server_loop host, port do |msg, sender|
logger.debug { "#{sender.remote_address.inspect} -> '#{msg.inspect}'" }
handler = @handlers.find { |h| h.handles? msg } || next
@state_lock.synch... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start(&block)\n return false if running?\n log \"Starting receiving on port #{@rtp_port}...\"\n\n @packet_writer = start_packet_writer(&block)\n @packet_writer.abort_on_exception = true\n\n @socket = init_socket(@transport_protocol, @rtp_port, @ip_address)\n\n @listener = start_li... | [
"0.6456076",
"0.6234125",
"0.59170735",
"0.59162205",
"0.5904518",
"0.58726656",
"0.58616936",
"0.5795678",
"0.5759232",
"0.57437545",
"0.56692684",
"0.5639053",
"0.56192225",
"0.55496156",
"0.553744",
"0.55356467",
"0.55329394",
"0.5519712",
"0.5438993",
"0.5433464",
"0.5408... | 0.6317193 | 1 |
Updates the state atomicly. The current state will be yielded to the given block and the return value used as the next state. | def update
@state_lock.synchronize do
@state = yield @state
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update(&block)\n instance_eval(&block)\n end",
"def update(&block)\n @update_block = block\n end",
"def update(&block)\n self.each_with_index do |e,i|\n self[i] = block.call(e)\n end\nend",
"def state_execute\n robot = @state.first\n if robot && block_given?\n updated_... | [
"0.6388809",
"0.62751526",
"0.6250403",
"0.61549115",
"0.6114822",
"0.60367614",
"0.6004292",
"0.59605676",
"0.5924732",
"0.58951694",
"0.58049023",
"0.577676",
"0.5719083",
"0.5706972",
"0.5690703",
"0.56593055",
"0.56057155",
"0.55688924",
"0.5565571",
"0.55221695",
"0.5521... | 0.8436289 | 0 |
Returns a Text object | def get_data
null_byte = @data.index(0.chr)
if null_byte.nil?
warn "Invalid tEXt chunk! Missing null byte."
return Imgrb::Text.new("", @data)
end
keyword = @data[0...null_byte]
if keyword.length < 1 || keyword.length > 79
warn "Keyword length is outs... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def as_text\n @text\n end",
"def text(*args)\n Text.new(self, *args)\n end",
"def get_text\n return self.text\n end",
"def getText\n @text\n end",
"def getText\n @text\n end",
"def text\n @text\n end",
"def text\n @text\n end",
"... | [
"0.78510374",
"0.7603311",
"0.7556645",
"0.7552127",
"0.7552127",
"0.7530163",
"0.7527472",
"0.7457165",
"0.73592216",
"0.7277232",
"0.72281957",
"0.721901",
"0.7213679",
"0.72136366",
"0.72136366",
"0.7118482",
"0.7094964",
"0.7094964",
"0.7045222",
"0.70391554",
"0.70391554... | 0.0 | -1 |
Returns a Text object | def get_data
#CHUNK MAY CONTAIN CHARACTERS NOT IN
#Latin-1 character set. Testing needed to determine
#how well UTF-8 is handled.
data = @data
null_byte = data.index(0.chr)
if null_byte.nil?
warn "Invalid iTXt chunk! Missing null byte."
return nil
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def as_text\n @text\n end",
"def text(*args)\n Text.new(self, *args)\n end",
"def get_text\n return self.text\n end",
"def getText\n @text\n end",
"def getText\n @text\n end",
"def text\n @text\n end",
"def text\n @text\n end",
"... | [
"0.7853142",
"0.7603201",
"0.7558089",
"0.75542337",
"0.75542337",
"0.7532243",
"0.75295335",
"0.74585736",
"0.7360672",
"0.7279703",
"0.7230888",
"0.72211605",
"0.72158736",
"0.72158736",
"0.72156286",
"0.7119971",
"0.7096676",
"0.7096676",
"0.70461315",
"0.70410335",
"0.704... | 0.0 | -1 |
Returns a Text object | def get_data
null_byte = @data.index(0.chr)
if null_byte.nil?
warn "Invalid zTXt chunk! Missing null byte."
return nil
end
keyword = @data[0...null_byte]
if keyword.length < 1 || keyword.length > 79
warn "Keyword length is outside proper bounds of 1-... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def as_text\n @text\n end",
"def text(*args)\n Text.new(self, *args)\n end",
"def get_text\n return self.text\n end",
"def getText\n @text\n end",
"def getText\n @text\n end",
"def text\n @text\n end",
"def text\n @text\n end",
"... | [
"0.78510374",
"0.7603311",
"0.7556645",
"0.7552127",
"0.7552127",
"0.7530163",
"0.7527472",
"0.7457165",
"0.73592216",
"0.7277232",
"0.72281957",
"0.721901",
"0.7213679",
"0.72136366",
"0.72136366",
"0.7118482",
"0.7094964",
"0.7094964",
"0.7045222",
"0.70391554",
"0.70391554... | 0.0 | -1 |
Returns a DateTime object | def get_data
data = @data.unpack("C*")
year = data[0..1]
year = Shared::interpret_bytes_2(year)
#Year, Month, Day, Hour, Min, Sec, UTC
return Time.new(year, data[2],
data[3], data[4],
data[5], data[6], "UTC")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_datetime\n ::DateTime.new(@year, @month, @day, @hour, @minute, @second)\n end",
"def to_datetime()\n #This is a stub, used for indexing\n end",
"def date_class\n ::DateTime\n end",
"def to_datetime\n # Thread-safety: It is possible that the value of @datetime may be ... | [
"0.773148",
"0.7424447",
"0.69898224",
"0.6954757",
"0.69466513",
"0.69410175",
"0.6918794",
"0.6918794",
"0.6912957",
"0.68014395",
"0.6774477",
"0.67431134",
"0.65553015",
"0.6552606",
"0.6545551",
"0.64859456",
"0.6475955",
"0.64130473",
"0.64130473",
"0.6411192",
"0.63885... | 0.0 | -1 |
Returns the gamma value as a float If gamma is 0 the chunk should be ignored | def get_data
gamma = @data[0..3].unpack("C*")
gamma = Shared::interpret_bytes_4(gamma)/100000.0
return gamma
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gamma(x)\n if x < 0.0\n return PI / (sin(PI * x) * exp(log_gamma(1 - x)))\n else\n exp(log_gamma(x))\n end\n end",
"def gamma(x)\n if (x < 0.0)\n return Math::PI / (Math.sin(Math::PI * x) * Math.exp(loggamma(1 - x))) #/\n end\n Math.exp(loggamma(x))\n ... | [
"0.70195085",
"0.69317883",
"0.684066",
"0.6633223",
"0.661303",
"0.64171124",
"0.6326158",
"0.6287519",
"0.61126924",
"0.5978701",
"0.5968559",
"0.5942508",
"0.59088016",
"0.5888929",
"0.5756691",
"0.5751273",
"0.57341194",
"0.57015467",
"0.56741595",
"0.5664924",
"0.5636076... | 0.65910214 | 5 |
See To apply gamma, compute: imgdecoding_exponent after dividing by maximal integer for given bit depth. If gamma is 0 this returns Infinity and should be ignored. | def get_decoding_exponent(display_exponent = 2.2)
gamma = get_data
return 1.0/(gamma * display_exponent)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gamma_fnc(num)\n return nil if num == 0\n return 1 if num == 1\n val = num-1\n val*gamma_fnc(num-1)\n end",
"def gamma_fnc(num)\n return nil if num == 0\n return 1 if num == 1\n (num - 1) * gamma_fnc(num - 1)\nend",
"def gamma(x)\n if (x < 0.0)\n return Math::PI / (Math.sin(Math... | [
"0.65295607",
"0.65188044",
"0.65086",
"0.64254975",
"0.64027697",
"0.63890004",
"0.63809395",
"0.63044417",
"0.6258761",
"0.6246405",
"0.6146177",
"0.6065829",
"0.6035552",
"0.60046875",
"0.60037524",
"0.5973156",
"0.59495467",
"0.5935868",
"0.59245044",
"0.59182554",
"0.591... | 0.64937186 | 3 |
Returns the 1931 CIE x, y chromaticities of r, g, b display primaries and the white point as an arrray: [white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y] | def get_data
white_x = Shared::interpret_bytes_4(@data[0..3].unpack("C*"))/100000.0
white_y = Shared::interpret_bytes_4(@data[4..7].unpack("C*"))/100000.0
red_x = Shared::interpret_bytes_4(@data[8..11].unpack("C*"))/100000.0
red_y = Shared::interpret_bytes_4(@data[12..15].unpack("C*"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_array\n\t\t\tm_color = self.color.delete(' ')\n\t\t\tm_color.delete!('cielab(')\n\t\t\tm_color.delete!(')')\n\n\t\t\tm_color = m_color.split(',')\n\t\t\tm_color[0] = m_color[0].to_f / 100\n\t\t\tm_color[1] = m_color[1].to_f.round(4) \n\t\t\tm_color[2] = m_color[2].to_f.round(4)\n\t\t\tm_color \n\t\tend",
... | [
"0.58008814",
"0.57536906",
"0.5652122",
"0.5640202",
"0.561339",
"0.55961263",
"0.5495706",
"0.54911596",
"0.548786",
"0.5401918",
"0.5395908",
"0.53806895",
"0.5380685",
"0.5380445",
"0.5369063",
"0.5328186",
"0.53075564",
"0.5305333",
"0.52999073",
"0.52852046",
"0.5256255... | 0.62033224 | 0 |
Returns the number of significant bits per channel in order. | def get_data
return @data.unpack("C*")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def channels_count\n channels.count\n end",
"def count_signs\n # suskaiciuojami visi zenklai\n temp = 0\n @signs.size.times do |i|\n temp += 1 if @signs[i] != 0\n end\n temp\n end",
"def count_bits(n)\r\n n.to_s(2).count \"1\"\r\nend",
"def countSetBits(x)\n\tcount = 0\n\n\twhile(x ... | [
"0.6359484",
"0.6042232",
"0.58242416",
"0.5821429",
"0.574639",
"0.574639",
"0.5717782",
"0.5712912",
"0.5602322",
"0.5591854",
"0.55890226",
"0.5569751",
"0.5509304",
"0.54885656",
"0.5482774",
"0.5455564",
"0.5443278",
"0.5353332",
"0.53258044",
"0.53254616",
"0.5320584",
... | 0.0 | -1 |
Returns the number of significant bits per channel in order. | def get_data
return @data.unpack("S>*")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def channels_count\n channels.count\n end",
"def count_signs\n # suskaiciuojami visi zenklai\n temp = 0\n @signs.size.times do |i|\n temp += 1 if @signs[i] != 0\n end\n temp\n end",
"def count_bits(n)\r\n n.to_s(2).count \"1\"\r\nend",
"def countSetBits(x)\n\tcount = 0\n\n\twhile(x ... | [
"0.6359484",
"0.6042232",
"0.58242416",
"0.5821429",
"0.574639",
"0.574639",
"0.5717782",
"0.5712912",
"0.5602322",
"0.5591854",
"0.55890226",
"0.5569751",
"0.5509304",
"0.54885656",
"0.5482774",
"0.5455564",
"0.5443278",
"0.5353332",
"0.53258044",
"0.53254616",
"0.5320584",
... | 0.0 | -1 |
Returns array of: Pixel xdimension Pixel ydimension unit (see png spec) | def get_data
xd = @data[0..3].unpack("C*")
xd = Shared::interpret_bytes_4(xd)
yd = @data[4..7].unpack("C*")
yd = Shared::interpret_bytes_4(yd)
unit = @data[8].unpack("C*")[0]
if !(unit == 0 || unit == 1)
warn "Unrecognised unit value for pHYs chunk: #{unit}."
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extent\n @size.map{|i| i * @pixels}\n end",
"def pixels; end",
"def pixel_at x, y\n pixel_base = 3 * (@width * y + x)\n (0..2).map {|i| @data[ pixel_base + i] }\n end",
"def coords(x, y)\n return [x % WIDTH, y % HEIGHT]\n end",
"def pixel_size; size.x * size.y; end",
"def t... | [
"0.70131546",
"0.69115126",
"0.6907738",
"0.65006435",
"0.6485497",
"0.64689696",
"0.64689696",
"0.644663",
"0.644663",
"0.6395053",
"0.63879603",
"0.6370153",
"0.6339086",
"0.62602454",
"0.6176621",
"0.6102004",
"0.60374486",
"0.6030685",
"0.599211",
"0.59890944",
"0.5978170... | 0.58267474 | 31 |
Returns array of: xoffset yoffset the unit (see png spec) | def get_data
xoff, yoff, unit = @data.unpack("l>l>C")
if !(unit == 0 || unit == 1)
warn "Unrecognised unit value for oFFs chunk: #{unit}."
end
return [xoff, yoff, unit]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def coords(x, y)\n return [x % WIDTH, y % HEIGHT]\n end",
"def extent\n @size.map{|i| i * @pixels}\n end",
"def pixels; end",
"def [] y, x=nil\n if x\n @pixels[(@size[1]-y)*@size[0]+x]\n else\n @pixels[(@size[1]-y)*@size[0],@size[0]]\n end\n end",
"def [] y, x=... | [
"0.6022281",
"0.6020255",
"0.58228505",
"0.56353074",
"0.56353074",
"0.56307536",
"0.56231916",
"0.5565395",
"0.5502799",
"0.54669",
"0.54481244",
"0.5409396",
"0.5400761",
"0.5399659",
"0.5399659",
"0.5347954",
"0.534605",
"0.5296775",
"0.5296636",
"0.529341",
"0.5271788",
... | 0.53754026 | 15 |
Returns value of background color (single value if grayscale, array of 3 if truecolor) | def get_data
#Color type 0 or 4 i.e. grayscale without or with alpha
if @data.length == 2
return Shared::interpret_bytes_2(@data.unpack("C*"))
elsif @data.length == 6
r = Shared::interpret_bytes_2(@data[0..1].unpack("C*"))
g = Shared::interpret_bytes_2(@data[2..3].u... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def background_colour\n @cr[0xf] >> 4\n end",
"def background_color\n @background_color ||= [0, 0, 0]\n end",
"def to_3f; return [red, green, blue].map {|i| i / 255.0}; end",
"def background_color(color); end",
"def shades_of_green value\n #Bunch of shades\n shades = %w( 00FF00 00F800... | [
"0.7172088",
"0.67009664",
"0.6393909",
"0.6378368",
"0.63178545",
"0.6307658",
"0.62773836",
"0.6260946",
"0.618505",
"0.6172726",
"0.61374176",
"0.61360097",
"0.61217767",
"0.6065479",
"0.606204",
"0.6029973",
"0.60087687",
"0.6002843",
"0.59773797",
"0.59719",
"0.5969175",... | 0.57553416 | 36 |
Returns array representing the transparency palette. By default formatted as if the image is an indexed image. Pass :nonindexed if rgb or grayscale image. | def get_data(format = :indexed)
if format == :indexed
return @data.unpack("C*")
elsif format == :nonindexed
return @data.unpack("S>*")
else
raise ArgumentError, "Unexpected format #{format}"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def opaque_palette\n self.class.new(map { |c| ChunkyPNG::Color.opaque!(c) })\n end",
"def to_ary\n [@red, @blue, @green, @alpha]\n end",
"def rgba\n [red, green, blue, alpha].freeze\n end",
"def map_transparent_pixels(img_path)\n print_status(\"Mapping transparent pixels for #{img_pa... | [
"0.6263577",
"0.6126636",
"0.6028893",
"0.6012513",
"0.58901703",
"0.58109826",
"0.5728929",
"0.5677974",
"0.56232184",
"0.5605562",
"0.5602728",
"0.5556328",
"0.5550042",
"0.55436563",
"0.5522323",
"0.54865456",
"0.5485974",
"0.5441233",
"0.54340154",
"0.54340154",
"0.543031... | 0.0 | -1 |
Returns a hash containing fields that are stored in arrays associated with a tag. Normally, the array should only have a single member, but in case of tag collisions the fields are stored in this way. To get the data of a field in a parsed format, call +get_data+ Example: exif_hash = img.ancillary_chunks[:eXIf][0].get_... | def get_data
#First time, create hash contaning exif fields, freeze the hash, then
#return it. For future calls, simply return the frozen hash.
@pack_str ||= get_pack_str
if @pack_str == ""
warn "Unknown Exif format!"
return self.data
end
if @exif_h... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_fields\n return @fields if @fields\n return @fields = CICPHash.new unless has_tag\n ape_items = CICPHash.new\n offset = 0\n last_possible_item_start = tag_data.length - ApeItem::MIN_SIZE\n tag_item_count.times do\n raise ApeTagError, \"End of tag reached but more items ... | [
"0.64269894",
"0.63418883",
"0.6302451",
"0.63018674",
"0.5979135",
"0.59126204",
"0.58230054",
"0.58218193",
"0.5741889",
"0.5725916",
"0.5636057",
"0.5614697",
"0.5569078",
"0.55019546",
"0.54820305",
"0.5462957",
"0.5448327",
"0.54472995",
"0.5413077",
"0.53992534",
"0.539... | 0.67587477 | 0 |
Returns an array [+num_frames+, +num_plays+] | def get_data
dat = @data.unpack("C*")
num_frames = Shared::interpret_bytes_4(dat[0..3])
num_plays = Shared::interpret_bytes_4(dat[4..7])
return [num_frames, num_plays]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plays\n return @plays_array\n end",
"def length; return @totalFrames; end",
"def frames\n @keyframes.last.index + @keyframes.last.duration\n end",
"def plays\n return @plays\n end",
"def score_all_frames\n frames.reduce(0) do |total, frame|\n total + frame.total\n end\n end"... | [
"0.67616194",
"0.6650921",
"0.642186",
"0.6144788",
"0.612762",
"0.6110673",
"0.6052958",
"0.6033238",
"0.6033238",
"0.6032511",
"0.6023956",
"0.59974766",
"0.59967047",
"0.59846485",
"0.59418064",
"0.59082985",
"0.58884466",
"0.5815329",
"0.5800323",
"0.575133",
"0.5736061",... | 0.7232919 | 0 |
Returns a Headers::PngHeader based on the chunk data | def to_png_header(header)
h = header
Imgrb::Headers::PngHeader.new(@width, @height, h.bit_depth, 0,
h.image_type, 0, 0)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_png_header\n self\n end",
"def png_header\n return @png_header unless @png_header.nil?\n _pos = @_io.pos\n @_io.seek(ofs_img)\n @png_header = @_io.read_bytes(8)\n @_io.seek(_pos)\n @png_header\n end",
"def to_png_header\n PngHeader.new(@width, @height, @bi... | [
"0.68748665",
"0.6833379",
"0.6684614",
"0.63353926",
"0.6152145",
"0.598352",
"0.589768",
"0.5894307",
"0.588519",
"0.58534",
"0.57955873",
"0.57762104",
"0.57741225",
"0.5746004",
"0.57040906",
"0.5671008",
"0.5664049",
"0.56317425",
"0.5616787",
"0.5616692",
"0.5614631",
... | 0.6839197 | 1 |
Returns the delay in seconds | def delay
if @delay_den != 0
@delay_num/@delay_den
else
@delay_num/100
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delay_seconds\n seconds = nil\n if delay = @delay || @config_delay\n min_delay = max_delay = nil\n if delay =~ /([\\d]+)\\.\\.([\\d]+)/\n min_delay = Regexp.last_match[1].to_i\n max_delay = Regexp.last_match[2].to_i\n elsif delay.to_i.to_s == delay\n mi... | [
"0.83731776",
"0.8046297",
"0.80338037",
"0.80219847",
"0.78611547",
"0.768229",
"0.73708385",
"0.7339932",
"0.7322286",
"0.73112065",
"0.72974974",
"0.7274407",
"0.7233695",
"0.7233695",
"0.7107309",
"0.7015692",
"0.697703",
"0.69703645",
"0.69561183",
"0.6938685",
"0.688381... | 0.7789048 | 5 |
Gives the name of the dispose operation: +:none+ +:background+ or +:previous+ | def dispose_operation
case @dispose_op
when 0
:none
when 1
:background
when 2
:previous
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def auto_dispose\n info[\"auto-dispose\"]\n end",
"def disposing(ev)\n end",
"def name\n @operation.name\n end",
"def dispose\n $game_system.name_timer = @timer\n super\n end",
"def disposed?\n end",
"def name\n Tensorflow::TF_OperationName(c)\n end",
"def name\n @... | [
"0.63157594",
"0.57095706",
"0.53660494",
"0.52950865",
"0.52770954",
"0.5273525",
"0.52439517",
"0.52075183",
"0.5201833",
"0.5191231",
"0.51824594",
"0.51704866",
"0.5168274",
"0.5164014",
"0.5050967",
"0.50433975",
"0.502562",
"0.5015656",
"0.5003555",
"0.4998672",
"0.4998... | 0.80153024 | 0 |
Gives the name of the blend operation: +:source+ or +:over+ | def blend_operation
case @blend_op
when 0
:source
when 1
:over
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name\n @operation.name\n end",
"def target_def; target.name; end",
"def contextual_name\n dep_source.cloneable? ? \"#{dep_source.name}:#{name}\" : name\n end",
"def img_name\n \"#{@function}_#{@side.to_s[0,1]}\"\n end",
"def string_to_copyop(str)\n case str\n when 'burn'\n ... | [
"0.585329",
"0.57792795",
"0.57568675",
"0.5748711",
"0.568828",
"0.55514187",
"0.54415965",
"0.5414839",
"0.5405716",
"0.5392759",
"0.53553814",
"0.5354309",
"0.53442496",
"0.5333281",
"0.5319543",
"0.5319543",
"0.53036284",
"0.52916086",
"0.52673477",
"0.52505594",
"0.52317... | 0.79893535 | 0 |
Deduce whether private/public from chunk name | def public?
Imgrb::PngMethods::chunk_type_public?(type)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_public?\n return @uti.start_with?(\"public.\")\n end",
"def private_name?\n fullname =~ /(\\A|#|\\.)_/\n end",
"def private?\n private == 'private'\n end",
"def all_private\n \treturn is_name_private && is_message_private && is_amount_private\n end",
"def publi... | [
"0.6614079",
"0.6604938",
"0.6484023",
"0.63195825",
"0.61574686",
"0.6134055",
"0.61291885",
"0.60743695",
"0.60743695",
"0.59873825",
"0.59826744",
"0.59760505",
"0.5965927",
"0.5948024",
"0.5945977",
"0.5924377",
"0.5917892",
"0.5906851",
"0.5888701",
"0.5884327",
"0.58697... | 0.5822092 | 25 |
The relative position of a safetocopy ancillary chunk is only relevant in so far as it specifies whether the chunk appears before or after IDAT. I.e., e.g. a PLTE chunk may be inserted before or after an unknown safe chunk. | def required_pos
:unknown
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def part_of_head?\n return true if self.position == 0\n begin\n if self.nominal?\n # there are no non-nominal segments between given\n # segment and the beginning of its spelling\n gap = false\n self.spelling.segments.each do |prev_segment|\n ... | [
"0.53055376",
"0.5302117",
"0.52779466",
"0.5265773",
"0.526488",
"0.51926345",
"0.5179694",
"0.51474655",
"0.51059395",
"0.5079999",
"0.5067186",
"0.5049839",
"0.50345093",
"0.5033532",
"0.50134486",
"0.5004124",
"0.49824542",
"0.4979466",
"0.49773753",
"0.49676424",
"0.4953... | 0.4947356 | 30 |
Deduce whether private/public from chunk name | def public?
Imgrb::PngMethods::chunk_type_public?(type)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_public?\n return @uti.start_with?(\"public.\")\n end",
"def private_name?\n fullname =~ /(\\A|#|\\.)_/\n end",
"def private?\n private == 'private'\n end",
"def all_private\n \treturn is_name_private && is_message_private && is_amount_private\n end",
"def publi... | [
"0.6615465",
"0.6607453",
"0.64842856",
"0.6319279",
"0.615799",
"0.61343586",
"0.6130559",
"0.6074219",
"0.6074219",
"0.5987533",
"0.59828645",
"0.5975094",
"0.59658575",
"0.59484375",
"0.5948134",
"0.59243554",
"0.5919325",
"0.5907597",
"0.58886045",
"0.5884998",
"0.5869625... | 0.5821751 | 24 |
The relative position of an unsafetocopy ancillary chunk does not change with respect to critical chunks, thus respecting the png spec. | def required_pos
:unknown
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def byte_offset(loc) loc.y * line_byte_size + loc.x * pixel_byte_size; end",
"def snap_offset\n @y += @off_y / 32\n @x += @off_x / 32\n @real_x = @x * 128\n @real_y = @y * 128\n @off_y = 0#@off_y % 32\n @off_x = 0#@off_x % 32\n end",
"def set_bitmap_position\n end",
"def clip_at(filename,... | [
"0.6074121",
"0.55768764",
"0.5496544",
"0.54075766",
"0.53857756",
"0.5379346",
"0.5307747",
"0.5273223",
"0.52520794",
"0.52302915",
"0.5194912",
"0.51939386",
"0.51874393",
"0.51761913",
"0.51625156",
"0.5104",
"0.5102949",
"0.50643915",
"0.50510037",
"0.50500166",
"0.5038... | 0.0 | -1 |
Confirms the correct user. | def correct_user
@user = User.find(params[:user_id])
redirect_to root_url, notice: "Can't access others' Decks" unless current_user?(@user)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def correct_user\n msg = \"You do not have permission to update another user's information\"\n require_correct_user(@user, msg)\n end",
"def correct_user\n\t\t\tauthenticate_user!\n\t\t\tunless @user == current_user || current_user.admin?\n\t\t\t\tredirect_to (root_path)\n\t\t\t\tflash[:alert]\n... | [
"0.7474259",
"0.73411936",
"0.7317917",
"0.7183303",
"0.7174887",
"0.7049758",
"0.70130193",
"0.7012358",
"0.7006517",
"0.7006201",
"0.7003461",
"0.69663024",
"0.69136065",
"0.6911695",
"0.690295",
"0.6892608",
"0.68439376",
"0.6842948",
"0.68397075",
"0.683463",
"0.6826711",... | 0.0 | -1 |
Send a friend request. We'd rather call this "request", but that's not allowed by Rails. | def create_request
Friendship.request(@user, @friend)
flash[:notice] = "Friend request sent."
redirect_to :back
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def friend_request(id)\n deprecated('friend_request', 'send_friend_request')\n send_friend_request(id)\n end",
"def send_friend_request\n request_response = post(\"/users/#{id}/request\")[\"response\"]\n @user = Foursquared::Response::User.new(client, request_response[\"userreque... | [
"0.7778312",
"0.7741804",
"0.7388545",
"0.73245704",
"0.7307123",
"0.71098703",
"0.7100947",
"0.69858706",
"0.6981509",
"0.6920179",
"0.68088186",
"0.6717053",
"0.6697299",
"0.6635561",
"0.6630275",
"0.66251904",
"0.6600881",
"0.6558504",
"0.64617383",
"0.644889",
"0.64435935... | 0.67750233 | 11 |
filter(possible_moves) is in Piece.rb | def filter_out_board_edges(possible_moves)
inbound_moves = possible_moves.map do |move_stretch|
move_stretch.select do |move|
move.first.between?(0,7) && move.last.between?(0,7)
end
end
inbound_moves.delete([])
inbound_moves
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filter_for_self_check(pieces, moves, color)\n\t\t\tcolor = (color == \"w\") ? \"white\" : \"black\"\n\t\t\topp_color = (color == \"white\") ? \"b\" : \"w\"\n splices = []\n king = pieces.find { |p| p.name == \"king\" && p.color == color }\n return [] if king.nil? \n\n # for each move w... | [
"0.74225605",
"0.7156509",
"0.7143342",
"0.6952576",
"0.69230247",
"0.6884841",
"0.6813262",
"0.6764718",
"0.67225516",
"0.6716233",
"0.6695441",
"0.6661113",
"0.6644641",
"0.6601742",
"0.65940154",
"0.6589858",
"0.6565401",
"0.6540418",
"0.6537638",
"0.65342814",
"0.6516141"... | 0.6626142 | 13 |
def to_param username end | def default_folder
self.folders.create(:name => "LNKS!")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_param; username end",
"def to_param; username end",
"def to_param\n username\n end",
"def to_param\n username\n end",
"def to_param\n username\n end",
"def to_param\n username\n end",
"def to_param\n username\n end",
"def to_param\n username\n end",
"def to_param\n ... | [
"0.94200355",
"0.94200355",
"0.9023838",
"0.9023838",
"0.9023838",
"0.9023838",
"0.9023838",
"0.9023838",
"0.9023838",
"0.9023838",
"0.9023838",
"0.9023838",
"0.9023838",
"0.9023838",
"0.9023838",
"0.9023838",
"0.9023838",
"0.9023838",
"0.9003149",
"0.8903129",
"0.8903129",
... | 0.0 | -1 |
GET /backend/users GET /backend/users.json | def index
# @backend_users = User.all
@search = User.order(created_at: :desc).search(params[:q])
@backend_users = @search.result(:distinct => true)
@backend_users = @backend_users.page(params[:page])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_users\n self.class.get('/users')\n end",
"def users(args = {})\n get(\"/users.json\",args)\n end",
"def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \... | [
"0.78534806",
"0.7774883",
"0.7683873",
"0.7574525",
"0.7557968",
"0.75391465",
"0.752931",
"0.747719",
"0.7467183",
"0.7466159",
"0.74523896",
"0.7447009",
"0.7434293",
"0.7434293",
"0.7434293",
"0.7434293",
"0.74249536",
"0.7404175",
"0.7403599",
"0.73897076",
"0.7380823",
... | 0.0 | -1 |
GET /backend/users/1 GET /backend/users/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/users.json\"\t \n response = RestClient.get(url)\n @users = JSON.parse(response.body)\t\t \n\tend\n ... | [
"0.7751861",
"0.736692",
"0.7278733",
"0.7189795",
"0.71807426",
"0.7173702",
"0.7158717",
"0.71551216",
"0.70793056",
"0.70382893",
"0.7018453",
"0.6996136",
"0.69823474",
"0.69797057",
"0.6947483",
"0.6947483",
"0.6946506",
"0.69464594",
"0.69464594",
"0.69464594",
"0.69464... | 0.0 | -1 |
POST /backend/users POST /backend/users.json | def create
@backend_user = User.new(create_user_params)
respond_to do |format|
if @backend_user.save
format.html { redirect_to backend_users_path, notice: 'User was successfully created.' }
format.json { render :show, status: :created, location: @backend_user }
else
format.h... | {
"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 create\n # render json: params\n render json: Users.create(params[\"user\"])\n end",
"def post body=nil, headers={}\n @connecti... | [
"0.7461823",
"0.71135116",
"0.7096028",
"0.70922834",
"0.6942504",
"0.69285333",
"0.687579",
"0.6824362",
"0.68216145",
"0.6779356",
"0.67560303",
"0.67412746",
"0.6738373",
"0.673761",
"0.6732041",
"0.6732041",
"0.6732041",
"0.6728037",
"0.6720913",
"0.6713774",
"0.6713509",... | 0.68284863 | 7 |
PATCH/PUT /backend/users/1 PATCH/PUT /backend/users/1.json | def update
respond_to do |format|
if @backend_user.update(update_user_params)
format.html { redirect_to backend_users_url, notice: 'User was successfully updated.' }
format.json { render :show, status: :ok, location: @backend_user }
else
format.html { render :edit }
forma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end",
"def update\n render json: Users.update(params[\"id\"], params[\"user\"])\n end",
"def update_users_password(args = {}) \n put(\"/users.json/backoffice/#{args[:userId]}/password/#{args[:password]}\", args)\nend",
"def upd... | [
"0.7079798",
"0.6954704",
"0.672087",
"0.672087",
"0.67092574",
"0.66705614",
"0.6629018",
"0.66061056",
"0.6604445",
"0.65692466",
"0.65661484",
"0.65424585",
"0.6538933",
"0.6536359",
"0.64959586",
"0.64930624",
"0.6443905",
"0.643617",
"0.64345014",
"0.6433474",
"0.640657"... | 0.6399172 | 22 |
DELETE /backend/users/1 DELETE /backend/users/1.json | def destroy
@backend_user.destroy
respond_to do |format|
format.html { redirect_to backend_users_url, notice: 'User was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n render json: User.delete(params[\"id\"])\n end",
"def delete_user_for_tenant(args = {}) \n delete(\"/tenants.json/#{args[:tenantId]}/users/#{args[:userId]}\", args)\nend",
"def delete\n render json: Users.delete(params[\"id\"])\n end",
"def DeleteUser id\n \n APICall(path: ... | [
"0.7502326",
"0.7397536",
"0.7378111",
"0.7264337",
"0.7122694",
"0.7092619",
"0.70644253",
"0.70511174",
"0.69889355",
"0.6986129",
"0.6972008",
"0.69581866",
"0.694721",
"0.6934963",
"0.6934963",
"0.68990153",
"0.68936807",
"0.68750197",
"0.6860488",
"0.6859842",
"0.6856735... | 0.7341402 | 3 |
Use callbacks to share common setup or constraints between actions. | def set_backend_user
@backend_user = User.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6164095",
"0.6046031",
"0.5945298",
"0.59179014",
"0.58890367",
"0.58341795",
"0.5776118",
"0.5700777",
"0.5700777",
"0.5656277",
"0.56218207",
"0.5423995",
"0.5411516",
"0.5411516",
"0.5411516",
"0.5395004",
"0.53783494",
"0.53593004",
"0.53412604",
"0.534078",
"0.5332865... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def backend_user_params
params.permit!
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.6981273",
"0.6783789",
"0.67460483",
"0.6742222",
"0.67354137",
"0.65934366",
"0.65028495",
"0.6497783",
"0.64826745",
"0.6479415",
"0.6456823",
"0.6440081",
"0.63800216",
"0.6376521",
"0.636652",
"0.6319898",
"0.6300256",
"0.62994003",
"0.6293621",
"0.6292629",
"0.6291586... | 0.5866886 | 90 |
can change this and write new values for health and power | def initialize (name, health, power)
@name = name
@health = health
@power = power
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def health=(v) self['Health'] = v end",
"def health=(new_health)\n @health = new_health\n end",
"def heal!\n @health_remaining = @max_health\n end",
"def heal(amount)\n self.health += amount\n self.save!\n end",
"def heal\n 2.times { super } # or self.helth = [self.helth + 2, MAX_... | [
"0.75825644",
"0.7158929",
"0.65191114",
"0.64936906",
"0.6485691",
"0.64769584",
"0.646371",
"0.6367512",
"0.63437223",
"0.6325531",
"0.63162017",
"0.6310193",
"0.6233182",
"0.6233182",
"0.6222213",
"0.6221371",
"0.6164926",
"0.61617756",
"0.6159653",
"0.61460763",
"0.614326... | 0.61425954 | 22 |
GET /promotersbinds/1 GET /promotersbinds/1.json | def show
@promotersbind = Promotersbind.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render :json => @promotersbind }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @promotersbind = Promotersbind.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @promotersbind }\n end\n end",
"def create\n @promotersbind = Promotersbind.new(params[:promotersbind])\n\n respond_to do |format|\n if @promotersbin... | [
"0.62732947",
"0.6074942",
"0.56078756",
"0.55870813",
"0.5361648",
"0.5215578",
"0.5117779",
"0.50871545",
"0.5060755",
"0.5027901",
"0.49943283",
"0.49229416",
"0.48372683",
"0.4816787",
"0.4813831",
"0.4791112",
"0.4755945",
"0.4725183",
"0.46888468",
"0.46848932",
"0.4681... | 0.6716727 | 0 |
GET /promotersbinds/new GET /promotersbinds/new.json | def new
@promotersbind = Promotersbind.new
respond_to do |format|
format.html # new.html.erb
format.json { render :json => @promotersbind }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @promotersbind = Promotersbind.new(params[:promotersbind])\n\n respond_to do |format|\n if @promotersbind.save\n format.html { redirect_to @promotersbind, :notice => 'Promotersbind was successfully created.' }\n format.json { render :json => @promotersbind, :status => :created... | [
"0.7135488",
"0.6005263",
"0.59665304",
"0.595862",
"0.589127",
"0.589127",
"0.5876238",
"0.5875173",
"0.5838627",
"0.5834853",
"0.58213055",
"0.5809952",
"0.5771444",
"0.57376295",
"0.5734648",
"0.5696062",
"0.56914556",
"0.5689796",
"0.56552726",
"0.5652297",
"0.5640027",
... | 0.7325588 | 0 |
POST /promotersbinds POST /promotersbinds.json | def create
@promotersbind = Promotersbind.new(params[:promotersbind])
respond_to do |format|
if @promotersbind.save
format.html { redirect_to @promotersbind, :notice => 'Promotersbind was successfully created.' }
format.json { render :json => @promotersbind, :status => :created, :location... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @promotersbind = Promotersbind.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @promotersbind }\n end\n end",
"def destroy\n @promotersbind = Promotersbind.find(params[:id])\n @promotersbind.destroy\n\n respond_to do |format|\n ... | [
"0.57290906",
"0.54588884",
"0.53635794",
"0.5266532",
"0.5259659",
"0.5031224",
"0.49779677",
"0.49475208",
"0.4939404",
"0.49145898",
"0.48952234",
"0.48627168",
"0.48546702",
"0.47676817",
"0.4716766",
"0.4688202",
"0.46739691",
"0.4626302",
"0.4626302",
"0.46023554",
"0.4... | 0.6946774 | 0 |
PUT /promotersbinds/1 PUT /promotersbinds/1.json | def update
@promotersbind = Promotersbind.find(params[:id])
respond_to do |format|
if @promotersbind.update_attributes(params[:promotersbind])
format.html { redirect_to @promotersbind, :notice => 'Promotersbind was successfully updated.' }
format.json { head :ok }
else
forma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @promotersbind = Promotersbind.new(params[:promotersbind])\n\n respond_to do |format|\n if @promotersbind.save\n format.html { redirect_to @promotersbind, :notice => 'Promotersbind was successfully created.' }\n format.json { render :json => @promotersbind, :status => :created... | [
"0.6235408",
"0.5656823",
"0.5426031",
"0.53034955",
"0.52377886",
"0.5196514",
"0.5071481",
"0.49953613",
"0.49761856",
"0.4951495",
"0.4942369",
"0.49400294",
"0.49320665",
"0.4929027",
"0.49214825",
"0.48938614",
"0.48879245",
"0.48526782",
"0.48041597",
"0.48037356",
"0.4... | 0.66717625 | 0 |
DELETE /promotersbinds/1 DELETE /promotersbinds/1.json | def destroy
@promotersbind = Promotersbind.find(params[:id])
@promotersbind.destroy
respond_to do |format|
format.html { redirect_to promotersbinds_url }
format.json { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @productsbind = Productsbind.find(params[:id])\n @productsbind.destroy\n\n respond_to do |format|\n format.html { redirect_to productsbinds_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @vpn = Vpn.find(params[:id])\n checkaccountobject(\"vpns\",@vpn)\n ... | [
"0.6199162",
"0.6009662",
"0.59360933",
"0.58930504",
"0.58465225",
"0.5827941",
"0.5821974",
"0.58038336",
"0.5775588",
"0.5748595",
"0.57139444",
"0.5699837",
"0.5695152",
"0.56934184",
"0.5671248",
"0.5667175",
"0.56396204",
"0.56243926",
"0.5618395",
"0.56043035",
"0.5596... | 0.75495464 | 0 |
just gets the extension of uploaded file | def extension
@file_data.original_filename.split(".").last
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extension\n begin\n @file_data.original_filename.split(\".\").last\n rescue\n @file_data.path.split(\".\").last\n end\n end",
"def ext\n file.extension.downcase\n end",
"def file_extension\n filename.split(\".\").last\n end",
"def file_extension; end",
"def file_extensi... | [
"0.87294775",
"0.8637149",
"0.85444975",
"0.85022414",
"0.85022414",
"0.85022414",
"0.83905953",
"0.8307434",
"0.8300763",
"0.8275652",
"0.8246337",
"0.8208107",
"0.8199294",
"0.8132942",
"0.8107331",
"0.80937254",
"0.80811656",
"0.8045561",
"0.8015333",
"0.79960996",
"0.7996... | 0.8684702 | 3 |
GET /empathy_map_records GET /empathy_map_records.json | def index
@empathy_map_records = EmpathyMapRecord.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @maps = Map.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @maps }\n end\n end",
"def index\n @estates = Estate.all\n @json = @estates.to_gmaps4rails\n respond_with(@estates)\n \n end",
"def get_records\n return error... | [
"0.6500663",
"0.64055026",
"0.631687",
"0.62815154",
"0.6167403",
"0.61560583",
"0.6080702",
"0.6055565",
"0.60398763",
"0.60275567",
"0.5973913",
"0.59738135",
"0.5963351",
"0.59488356",
"0.5910635",
"0.5906512",
"0.58980036",
"0.58980036",
"0.5884574",
"0.5881507",
"0.58752... | 0.78049237 | 0 |
GET /empathy_map_records/1 GET /empathy_map_records/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @empathy_map_records = EmpathyMapRecord.all\n end",
"def index\n @maps = Map.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @maps }\n end\n end",
"def index\n @estates = Estate.all\n @json = @estates.to_gmaps4rails\n respo... | [
"0.7428379",
"0.63924855",
"0.6278297",
"0.62596405",
"0.616653",
"0.6141495",
"0.60877126",
"0.6083921",
"0.60547155",
"0.6008916",
"0.6008916",
"0.5970934",
"0.59493065",
"0.594803",
"0.5945625",
"0.59258246",
"0.59222937",
"0.590643",
"0.58969146",
"0.5881853",
"0.58752346... | 0.0 | -1 |
POST /empathy_map_records POST /empathy_map_records.json | def create
@empathy_map = EmpathyMap.find_or_create_by(id: empathy_map_record_params[:empathy_map_id])
@empathy_map_record = EmpathyMapRecord.new(empathy_map_record_params.merge(empathy_map_id: @empathy_map.id))
respond_to do |format|
if @empathy_map_record.save
format.html { redirect_to @emp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def empathy_map_record_params\n params.require(:empathy_map_record).permit(:empathy_map_id, :record_type, :group, :position, :text)\n end",
"def index\n @empathy_map_records = EmpathyMapRecord.all\n end",
"def create\n @map = Map.new(map_params)\n @file = @map.meta_data\n # binding.pry\n\n... | [
"0.6359411",
"0.63294953",
"0.61117625",
"0.60362226",
"0.5970591",
"0.59499484",
"0.5850525",
"0.58487934",
"0.5760065",
"0.57546157",
"0.5734936",
"0.5716146",
"0.5686847",
"0.56604856",
"0.5648587",
"0.5576687",
"0.5560353",
"0.5552128",
"0.5551046",
"0.5548536",
"0.554293... | 0.7155881 | 0 |
PATCH/PUT /empathy_map_records/1 PATCH/PUT /empathy_map_records/1.json | def update
respond_to do |format|
if @empathy_map_record.update(empathy_map_record_params)
format.html { redirect_to @empathy_map_record, notice: 'Empathy map record was successfully updated.' }
format.json { render :show, status: :ok, location: @empathy_map_record }
else
format.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @file = @map.meta_data\n # binding.pry\n\n @meta_data = []\n @kind = @map.kind\n fips_to_hc_key\n @map.meta_data = @meta_data\n\n respond_to do |format|\n if @map.update(map_params)\n format.html { redirect_to @map, notice: 'Map was successfully updated.' }\n fo... | [
"0.62298256",
"0.61644906",
"0.6104029",
"0.60306925",
"0.60221034",
"0.6010777",
"0.599141",
"0.59058815",
"0.5888329",
"0.5868043",
"0.5862917",
"0.5859758",
"0.5850415",
"0.58359027",
"0.58263934",
"0.5800484",
"0.5797279",
"0.5794727",
"0.5791822",
"0.57814777",
"0.577080... | 0.7117935 | 0 |
DELETE /empathy_map_records/1 DELETE /empathy_map_records/1.json | def destroy
@empathy_map_record.destroy
respond_to do |format|
format.html { redirect_to empathy_map_records_url, notice: 'Empathy map record was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @map.destroy\n\n respond_to do |format|\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-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_respons... | [
"0.71058065",
"0.6834193",
"0.681958",
"0.68166447",
"0.68166447",
"0.68166447",
"0.68079823",
"0.6797014",
"0.67409605",
"0.673812",
"0.67270386",
"0.6723896",
"0.6713866",
"0.67096734",
"0.67064863",
"0.6628545",
"0.6622566",
"0.6595475",
"0.6590619",
"0.6573899",
"0.655248... | 0.74722886 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.