query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Get Activation State of Save
def save_enabled !$game_system.save_disabled end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save\n @saved = @state\n end", "def activate\n @activated = true\n self.active = true\n save(false)\n end", "def activate\n self.active = true\n save\n end", "def activate!\n self.active = true\n save\n end", "def activate\n @activated = true\n self.activated...
[ "0.61939377", "0.61769474", "0.61218005", "0.6110869", "0.60982126", "0.6063052", "0.6022516", "0.60035855", "0.59981245", "0.5975244", "0.5969648", "0.5969206", "0.5968292", "0.5959558", "0.5959558", "0.5959558", "0.5959558", "0.5959558", "0.5959558", "0.5959558", "0.5959558...
0.0
-1
Processing When OK Button Is Pressed
def process_ok @@last_command_symbol = current_symbol super end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_ok\n if current_item_enabled?\n Sound.play_ok \n Input.update\n deactivate unless @symbol.nil?\n call_ok_handler\n else\n Sound.play_buzzer\n end\n end", "def process_ok\n if enabled?\n Sound.play_ok\n Input.update\n deactivate\n call_ok_handl...
[ "0.6994379", "0.69362414", "0.6932597", "0.6915822", "0.67144406", "0.6324494", "0.62522656", "0.6119142", "0.6098833", "0.6095444", "0.60421187", "0.5914742", "0.59120286", "0.5896609", "0.58950263", "0.5880061", "0.5878361", "0.58349687", "0.58275026", "0.5825857", "0.58238...
0.0
-1
Restore Previous Selection Position
def select_last select_symbol(@@last_command_symbol) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_selection()\n @last_pos = nil\n @selection = nil\n end", "def goto_prev_selection\n return if selected_rows().length == 0 \n row = selected_rows().sort{|a,b| b <=> a}.find { |i| i < @obj.current_index }\n row ||= @obj.current_index\n #@obj.current_index = row\n @ob...
[ "0.7496809", "0.6882158", "0.6835485", "0.67443246", "0.6729972", "0.6703168", "0.6622941", "0.6573272", "0.6542829", "0.64859325", "0.6433048", "0.63308626", "0.6312895", "0.6309042", "0.6305897", "0.6176294", "0.61544055", "0.6147746", "0.6118368", "0.6098318", "0.60708594"...
0.0
-1
This method will be executed when you run this knife command.
def run Shef::Extensions.extend_context_object(self) ssh_config = [] ssh_config << "\n\n### BEGIN KNIFE BLOCK ###" ssh_config << "## This was generated by `knife setup ssh`:" STDOUT.sync = true nodes.all do |n| next if /vagrant/.match(n.name) name = n.name name << '.lisausa....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def knife(sub_cmd)\n chef_exec(knife_cmd(sub_cmd))\nend", "def bootstrap_run\n knife.name_args = [config[:public_ip_address]]\n knife.run\n end", "def knife\n @knife ||= begin\n lf = create_log_file\n Chef::Knife::Bootstrap.load_deps\n kb = Chef::Knife::Boo...
[ "0.6914825", "0.67020196", "0.65666264", "0.63498694", "0.6272977", "0.5812792", "0.57426745", "0.5725629", "0.57044655", "0.56933075", "0.5542876", "0.545824", "0.5400144", "0.5381994", "0.5355182", "0.5334784", "0.53248537", "0.5280028", "0.5242993", "0.5218561", "0.5204048...
0.6249058
5
int binarySearch(int arr[], int l, int r, int x)
def binarySearch(arr, l, r, x) if r >= l mid = l + (r - l) / 2 # // If the element is present at the middle itself return mid if (arr[mid] == x) # // If element is smaller than mid, then it can only be present in left subarray # // Else the element can only be present in right subarray (arr[mi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def binary_search(arr, l, r, x)\n if r >= l\n mid = l + (r - l)\n\n # If the element is present\n # at the middle itself\n if arr[mid] == x\n return mid\n end\n\n # If element is smaller than\n # mid, then it can only be\n # present in left subarray\n\n if arr[mid] > x\n retur...
[ "0.86607337", "0.81856465", "0.76425284", "0.76409435", "0.7540075", "0.7530456", "0.7504224", "0.7499799", "0.74972427", "0.74841666", "0.7464011", "0.7455254", "0.74536484", "0.7449733", "0.7438467", "0.743576", "0.7425298", "0.7422653", "0.7416506", "0.7414566", "0.7406899...
0.86009586
1
def binary_search(arr, l, r, target) if l target) ? binary_search(arr, l, mid 1, target) : binary_search(arr, mid + 1, r, target) end 1 end def binary_search(arr, l, r, target) return 1 if l > r mid = l + (r l) / 2 return mid if (arr[mid] == target) Found match! (arr[mid] > target) ? binary_search(arr, l, mid 1, target...
def binary_search(arr, l, r, target) return [-1, l, r] if l > r mid = l + (r - l) / 2 return [mid, l, r] if (arr[mid] == target) # Found match! (arr[mid] > target) ? binary_search(arr, l, mid - 1, target) : binary_search(arr, mid + 1, r, target) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def binary_search(arr, target)\n new_arr = arr\n return nil if arr.empty? \n middle = (arr.length - 1) / 2\n if arr[middle] > target\n binary_search(arr[0...middle], target)\n elsif arr[middle] < target \n if binary_search(arr[middle+1..-1], target).nil?\n return nil\n else\n binary_search(...
[ "0.90340745", "0.897995", "0.89640373", "0.89217806", "0.88611424", "0.8858785", "0.88443935", "0.88438195", "0.8748194", "0.87273204", "0.8711708", "0.8688265", "0.86683905", "0.8665924", "0.8656013", "0.8642435", "0.86257005", "0.86154675", "0.85812384", "0.85805947", "0.85...
0.9401777
0
FIXME: Looks like you can claim these twice that's handled in the controller but I don't think it belongs there FIXME: This doesn't sound like a responsibility of the bank
def claim_bucks(student, otu_code) if otu_code.is_ebuck? if otu_code.teacher.present? @credit_manager.issue_ecredits_to_student(otu_code.school, otu_code.teacher, student, otu_code.points, otu_code) else @credit_manager.issue_game_credits_to_student(otu_code.source_string, student, otu_c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def who_we_are\r\n end", "def business_decision_support \n end", "def policies; end", "def access_control\n \n end", "def appraisals; end", "def appraisals; end", "def request; end", "def request; end", "def request; end", "def request; end", "def request; end", "d...
[ "0.6346133", "0.60103583", "0.5875514", "0.5624332", "0.5619999", "0.56069076", "0.56069076", "0.55795896", "0.55795896", "0.55795896", "0.55795896", "0.55795896", "0.55795896", "0.55795896", "0.55795896", "0.55795896", "0.55795896", "0.55795896", "0.5566414", "0.5545556", "0...
0.0
-1
def cut comment, length = 100, suffix = "..." cut = comment.chars.slice(0, length) cut = comment cut.size == length ? cut + suffix : comment end
def loading_indicator div_id "<div id=\"#{div_id}\" style=\"display: none; float: right;\">#{image_tag 'ajax-loader.gif'}</div>" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cut(length, cut_at, options = {})\n append = options[:append] || ''\n @modified_string.size > (length) ? @modified_string = @modified_string.mb_chars[0...cut_at] + append : @modified_message\n self\n end", "def cutoff(str, limit = 100)\n if str.length > limit\n str[0, limit] + '...'...
[ "0.7293962", "0.6497649", "0.6481613", "0.64212966", "0.64000595", "0.6399567", "0.6330619", "0.6323075", "0.6278089", "0.62758917", "0.62304133", "0.6224458", "0.6207119", "0.6203063", "0.6180126", "0.6166234", "0.615988", "0.6141664", "0.6138755", "0.6135853", "0.61279404",...
0.0
-1
This handles outputting the communication data back to the UI
def handle_comm(type, data) if [:stderr, :stdout].include?(type) # Output the data with the proper color based on the stream. color = type == :stdout ? :green : :red # Clear out the newline since we add one data = data.chomp return if data.empty? opt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output(data)\n msg @presenter.format(data)\n end", "def output(data)\n msg @presenter.format(data)\n end", "def relay_output_from_backend(host, data)\r\n WinRM::Log.debug(\":relay_output_from_backend => #{[host, data]}\")\r\n data = @on_output.call(host, data) if @on_outpu...
[ "0.6909786", "0.6845082", "0.6435338", "0.6333897", "0.6327864", "0.6327334", "0.6327334", "0.6213519", "0.61617434", "0.61491114", "0.61000866", "0.5951636", "0.5947148", "0.5921793", "0.58979654", "0.58833593", "0.58549756", "0.58275586", "0.5819285", "0.5819063", "0.581443...
0.62127304
8
This is the provision method called if SSH is what is running on the remote end, which assumes a POSIXstyle host.
def provision_ssh(args) env = config.env.map { |k,v| "#{k}=#{quote_and_escape(v.to_s)}" } env = env.join(" ") command = "chmod +x '#{config.upload_path}'" command << " &&" command << " #{env}" if !env.empty? command << " #{config.upload_path}#{args}" with_scrip...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configure_ssh(vm)\n vm.provision \"shell\", inline: <<-SHELL\n mkdir -p /home/vagrant/.ssh\n rm -rf /home/vagrant/.ssh/id_rsa*\n chown vagrant:vagrant /home/vagrant/.ssh\n SHELL\n vm.provision \"file\", source: '~/.ssh/id_rsa', destination: '~/.ssh/id_rsa'\n vm.provision \"file\", source: '~/.ssh/...
[ "0.7078592", "0.70284545", "0.69895387", "0.6877475", "0.68337893", "0.680417", "0.6777858", "0.6774893", "0.67548513", "0.6725603", "0.67060244", "0.6660204", "0.6658527", "0.6630527", "0.6597052", "0.65872884", "0.6530384", "0.6513233", "0.64225394", "0.64034724", "0.636284...
0.70180357
2
This is the provision method called if Windows OpenSSH is what is running on the remote end, which assumes a nonPOSIXstyle host.
def provision_winssh(args) with_script_file do |path| # Upload the script to the machine @machine.communicate.tap do |comm| env = config.env.map{|k,v| comm.generate_environment_export(k, v)}.join upload_path = config.upload_path.to_s if File.extname(upload...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def provision_ssh(args)\n env = config.env.map { |k,v| \"#{k}=#{quote_and_escape(v.to_s)}\" }\n env = env.join(\" \")\n\n command = \"chmod +x '#{config.upload_path}'\"\n command << \" &&\"\n command << \" #{env}\" if !env.empty?\n command << \" #{config.upload_path}#{arg...
[ "0.6611588", "0.66014487", "0.6508826", "0.6503023", "0.6470919", "0.6386908", "0.63052225", "0.62682897", "0.6257627", "0.6214883", "0.62058", "0.6181634", "0.6029145", "0.59659016", "0.5963649", "0.595278", "0.59216225", "0.5917382", "0.5804116", "0.57987523", "0.5782396", ...
0.73965514
0
This provisions using WinRM, which assumes a PowerShell console on the other side.
def provision_winrm(args) if @machine.guest.capability?(:wait_for_reboot) @machine.guest.capability(:wait_for_reboot) end with_script_file do |path| @machine.communicate.tap do |comm| # Make sure that the upload path has an extension, since # having a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialWinRMTasks(shell)\n retries = 0\n rebootable_fails = 0\n begin\n if !@config['use_cloud_provider_windows_password']\n pw = @groomer.getSecret(\n vault: @config['mu_name'],\n item: \"windows_credentials\",\n f...
[ "0.6161514", "0.6107433", "0.5970253", "0.57880676", "0.5688117", "0.56645375", "0.56421876", "0.56410986", "0.5594688", "0.5484316", "0.54626656", "0.5402233", "0.53343964", "0.5327836", "0.53263", "0.53129715", "0.53046644", "0.5257006", "0.52204865", "0.51176167", "0.51071...
0.65816337
0
Quote and escape strings for shell execution, thanks to Capistrano.
def quote_and_escape(text, quote = '"') "#{quote}#{text.gsub(/#{quote}/) { |m| "#{m}\\#{m}#{m}" }}#{quote}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shell_quote(str = \"\")\n @tmp_command_line ||= Cocaine::CommandLine.new(\"\")\n @tmp_command_line.send :shell_quote, str\n end", "def escape_shell_string(str)\n str = str.gsub(/\\\\/, \"\\\\\\\\\\\\\")\n str = str.gsub(/\"/, \"\\\\\\\"\")\n str = str.gsub(/`/, \"\\\\`\")\n ...
[ "0.7479188", "0.7405753", "0.7253019", "0.71191543", "0.70912075", "0.6816184", "0.66006327", "0.65963197", "0.64579266", "0.63792735", "0.63325036", "0.6278324", "0.6183949", "0.6133441", "0.6133441", "0.6131552", "0.61250186", "0.6119502", "0.6104004", "0.6081912", "0.60769...
0.55432814
72
This method yields the path to a script to upload and execute on the remote server. This method will properly clean up the script file if needed.
def with_script_file ext = nil script = nil if config.remote? download_path = @machine.env.tmp_path.join( "#{@machine.id}-remote-script") download_path.delete if download_path.file? begin Vagrant::Util::Downloader.new( conf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deploy\n system %Q[ssh -lroot \"#{server}\" <<'EOF'\n \tcat >\"#{remote_script_name}\" <<'EOS'\n#{generate}EOS\nchmod +x \"#{remote_script_name}\"\nsource \"#{remote_script_name}\"\nEOF\n ]\n end", "def upload_files_for_updater(update_ssh_host, update_ssh_user, update_path,\n ...
[ "0.60759765", "0.5958682", "0.590013", "0.57438976", "0.5716309", "0.5672694", "0.561743", "0.5557019", "0.5455784", "0.5447415", "0.5447415", "0.5412433", "0.54047614", "0.53833044", "0.5377132", "0.53625405", "0.5361512", "0.5331145", "0.5322974", "0.5308246", "0.53023887",...
0.64514947
0
Get a valid JWT based on existing user
def login(user) post '/api/v1/login', params: {email: user.email, password: user.password} return json['auth_token'] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authenticate_user_from_jwt\n _, token = request.headers['Authorization'].split\n decoded_token = AuthToken.decode(token)\n User.find(decoded_token[:user_id])\n rescue NoMethodError\n raise Exceptions::UnauthorizedError\n end", "def call\n # after user login, will pass the user-id to the JWT ...
[ "0.7380753", "0.7336454", "0.7255215", "0.7020365", "0.70004016", "0.69551927", "0.6869836", "0.6864819", "0.6855889", "0.68110013", "0.6788357", "0.6764556", "0.6747859", "0.6722227", "0.6694655", "0.667206", "0.6657705", "0.6608142", "0.6596095", "0.65847975", "0.657327", ...
0.0
-1
Given an image file, checks to see if the image exists in the filesystem. If it does, display the image. If not, suppress the generation of the image tag. Used to add modelspecific icons to the UI. If the icon does not exist, ensures no broken image tag or alternate text is rendered to the page.
def image_tag_if_exists(image, options = {}) image_tag(image, options) if(File.exist?File.join(STREAMLINED_RAILS_ROOT, 'public', 'images', image)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def icon_no_link_processing(method, url=nil, alt=nil, label=method.humanize)\n\n if (label == 'Destroy')\n label = 'Delete';\n end\n\n return nil unless (filename = method_to_icon_filename(method.downcase))\n \n # if method.to_s == \"info\"\n # make into cool javascript div thing!\n \n i...
[ "0.60569435", "0.60509366", "0.6007378", "0.5984123", "0.5753741", "0.57494015", "0.571504", "0.5707949", "0.56836927", "0.5636152", "0.5623014", "0.5622229", "0.56133395", "0.561194", "0.5589875", "0.55664885", "0.55397797", "0.55218184", "0.55076885", "0.5498734", "0.549720...
0.6500782
0
invisible links are plucked out by unobtrusive JavaScript to add functionality
def invisible_link_to(options = {}, html_options={}, *parms) link_to('', options, html_options.merge(:style=>"display:none;"), *parms) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hide_links_and_search\n javascript_tag \"$(function() { hideLinksAndSearch(); });\"\n end", "def links_present\n resend_email_link.visible?\n change_email_link.visible?\n back_to_login_page_link.visible?\n end", "def check_only_links\n end", "def clickable\n @clickable ||=...
[ "0.64388764", "0.6349545", "0.6149914", "0.60994124", "0.6093397", "0.6093397", "0.6074663", "0.6074663", "0.6039786", "0.6036444", "0.5991108", "0.59813434", "0.59813434", "0.5968033", "0.5964878", "0.58949393", "0.5889735", "0.587971", "0.58689153", "0.5855639", "0.5794334"...
0.62083536
2
just sugar for unrolling these
def import_data_points(shared, row, tuples) rows = [] tuples.each do |tuple| grade, assessment_period, assessment_key, row_key = tuple data_point = row[row_key] if data_point.nil? || ['?', 'n/a', 'absent'].include?(data_point.downcase) @missing_data_point +=1 next end ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def combine_ins(obj); end", "def escaper=(_); end", "def wrappers(*args, &block); end", "def tr(p0, p1) end", "def f6; return *['a','b'] &['a','Y','Z'] end", "def probers=(_arg0); end", "def result=(_); end", "def _reduce_579(val, _values, result)\n _, margs, _ = val\n\n ...
[ "0.5981413", "0.5750422", "0.5730571", "0.5712463", "0.56681836", "0.55906504", "0.5574805", "0.55725235", "0.55725235", "0.55516857", "0.55516857", "0.55073655", "0.5496675", "0.5495441", "0.549494", "0.5476312", "0.54658777", "0.54658777", "0.5456871", "0.5456871", "0.54568...
0.0
-1
Attribute reader falling back to WCC::Contentful configuration needed for locale fallbacks
def configuration @configuration || WCC::Contentful.configuration end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_attribute(name, options = {})\r\n options = {:translated => true, :locale => nil}.merge(options)\r\n if translated?(name) and options[:translated]\r\n globalize.fetch(options[:locale] || Mongoid::Globalize.locale, name)\r\n else\r\n super(name)\r\n end\r\n end", "def...
[ "0.62378114", "0.5819758", "0.5625803", "0.56119066", "0.554328", "0.55289614", "0.5458747", "0.5385419", "0.5366616", "0.5358443", "0.52914244", "0.5225758", "0.52013755", "0.51642376", "0.51546156", "0.51475716", "0.5122514", "0.51088494", "0.5106043", "0.50872064", "0.5057...
0.0
-1
Takes an entry which represents a specific 'sys.locale' and transforms it to the 'locale=' format
def transform_to_star(entry) # locale=* entries have a nil sys.locale unless entry_locale = entry.dig('sys', 'locale') # nothing to do return entry end new_entry = entry.dup new_entry['sys'] = entry['sys'].except('locale').merge({ 'WCC::Contentful::EntryLocaleTransformer:locales_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_locale\n self.locale = self.locale.gsub('_', '-').split(',').first.split('-').first if self.locale.present?\n end", "def apply_locale; end", "def transform_to_locale(entry, locale)\n # If the backing store already returned a localized entry, nothing to do\n if entry_locale = entry.dig(...
[ "0.75093275", "0.72069126", "0.71742725", "0.7011233", "0.6944667", "0.6782567", "0.6713256", "0.66889936", "0.66749036", "0.6597778", "0.65911615", "0.6562971", "0.6528657", "0.6512164", "0.6492945", "0.6475748", "0.64539826", "0.6424581", "0.63962966", "0.6390089", "0.63756...
0.6180793
40
Takes an entry in the 'locale=' format and transforms it to a specific locale
def transform_to_locale(entry, locale) # If the backing store already returned a localized entry, nothing to do if entry_locale = entry.dig('sys', 'locale') unless entry_locale == locale raise WCC::Contentful::LocaleMismatchError, "expected #{locale} but was #{entry_locale}" end ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_locale\n self.locale = self.locale.gsub('_', '-').split(',').first.split('-').first if self.locale.present?\n end", "def apply_locale; end", "def locale=(value); end", "def locale=(_arg0); end", "def locale=(locale); end", "def to_deepl_compatible_locale(locale)\n locale.to_s.spli...
[ "0.75440603", "0.7400098", "0.7199847", "0.69771594", "0.6890116", "0.68734914", "0.67647034", "0.6737671", "0.6728189", "0.6714626", "0.6685317", "0.66339064", "0.66324055", "0.66324055", "0.6586637", "0.65519655", "0.65519655", "0.6537727", "0.65316325", "0.6528847", "0.651...
0.80418295
0
Takes an entry in a specific 'sys.locale' and merges it into an entry that is in the 'locale=' format
def reduce_to_star(memo, entry) if memo_locale = memo.dig('sys', 'locale') raise WCC::Contentful::LocaleMismatchError, "expected locale: * but was #{memo_locale}" end unless entry_locale = entry.dig('sys', 'locale') raise WCC::Contentful::LocaleMismatchError, 'expected a specific locale but got ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform_to_locale(entry, locale)\n # If the backing store already returned a localized entry, nothing to do\n if entry_locale = entry.dig('sys', 'locale')\n unless entry_locale == locale\n raise WCC::Contentful::LocaleMismatchError,\n \"expected #{locale} but was #{entry_locale}\"\...
[ "0.7198477", "0.6892569", "0.6820758", "0.65068644", "0.6455452", "0.6437378", "0.6383335", "0.63334787", "0.6332521", "0.6326297", "0.617993", "0.6148443", "0.6124992", "0.6058146", "0.60452783", "0.60272145", "0.5992308", "0.59886956", "0.59886956", "0.59886956", "0.5943917...
0.5417159
75
Quine: puts <<22,2 puts <<22,2 2 "puts <<2" print all the text from after this statement until you reach the string "2". ...."2" Print that string twice ....", 2" And then print the value 2 The second "puts <<22,2" is just text, and the final "2" is the delimiter.
def five(number) number % 5 == 0 ? true : false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def roll_two\n puts %Q{...........}\n puts %Q{: * :}\n puts %Q{: :}\n puts %Q{: * :}\n puts %Q{'''''''''''}\nend", "def roll_six\n puts %Q{...........}\n puts %Q{: * * :}\n puts %Q{: * * :}\n puts %Q{: * * :}\n puts %Q{'''''''''''}\nend", "def roll_one\n puts %Q{........
[ "0.59762144", "0.58765894", "0.5873718", "0.585186", "0.58279836", "0.5789929", "0.5615603", "0.5615603", "0.5615603", "0.56044954", "0.5556981", "0.55294424", "0.5517998", "0.5509222", "0.5493329", "0.54744273", "0.54743004", "0.5472981", "0.5470591", "0.5463285", "0.5460165...
0.0
-1
adds node to FRONT of list, storing given data in the node.
def ll_push(data) new_node = Node.new(data) if @num_nodes == 0 @head = new_node @tail = new_node else current = @head new_node.set_Next(current) @head = new_node end @num_nodes += 1 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ll_append(data)\n new_node = Node.new(data)\n \n if @num_nodes == 0\n @head = new_node\n @tail = new_node\n else\n end_node = @tail\n end_node.set_Next(new_node)\n @tail = new_node\n end\n \n @num_nodes += 1\n end", "def add_node(data)\n\n\t\t# chang...
[ "0.75029135", "0.71315783", "0.7128094", "0.7080718", "0.70042336", "0.69959474", "0.6968195", "0.69643104", "0.69601685", "0.6907932", "0.6906814", "0.6877153", "0.6873213", "0.68100166", "0.6713858", "0.670508", "0.6640344", "0.65949357", "0.65715706", "0.65715706", "0.6571...
0.6904485
11
removes node at FRONT of list and returns corresponding data
def ll_pop() current = @head if @num_nodes == 0 return nil elsif @num_nodes == 1 @head = nil @tail = nil else second = @head.get_Next() @head = second end @num_nodes -= 1 return current.get_Data() end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove node\n # if the node is at beginning or end of list\n # handle this separately\n return remove_first if node.prev_node == nil\n return remove_last if node.next_node == nil\n\n # tell adjacent nodes to 'skip' over this node\n node.next_node.prev_node = node.prev_node\n node.prev_node...
[ "0.72131026", "0.70842266", "0.6927051", "0.67692155", "0.6710322", "0.663943", "0.6630834", "0.661825", "0.641877", "0.6416647", "0.64161104", "0.6413469", "0.6408106", "0.6401078", "0.6388934", "0.6367033", "0.6341518", "0.63242954", "0.63241404", "0.6322492", "0.6294781", ...
0.63220066
20
adds node to end of list, storing given data in node
def ll_append(data) new_node = Node.new(data) if @num_nodes == 0 @head = new_node @tail = new_node else end_node = @tail end_node.set_Next(new_node) @tail = new_node end @num_nodes += 1 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_to_tail (data)\n new_element = Node.new (data)\n if @head.nil?\n @head = new_element\n else\n current_node = @head\n while current_node.next\n current_node = current_node.next\n end\n current_node.next = new_element\n end\n end", "def append(data)\n if @hea...
[ "0.7983035", "0.7890232", "0.7888017", "0.78718466", "0.78606474", "0.7850122", "0.78492355", "0.78226084", "0.7796721", "0.7769113", "0.77648157", "0.7755077", "0.7743992", "0.7743927", "0.7729154", "0.77217925", "0.77172524", "0.7711769", "0.7711067", "0.7684944", "0.765941...
0.83070636
0
removes first node in list THAT MATCHES target returns pointer to the data UNLESS node does not exist (returns nil)
def ll_remove(target) target_node = find_node(target) if target_node == nil return nil end # if first node is being removed -> need to reset head to node if target_node[0] == 0 if @num_nodes == 1 @head = nil @tail = nil else @head = @head.get_Next() end ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove(target)\n @head = @head.next if @head == target\n prev = find() do |item| # prev set to the node right before the node we want to remove\n item.next == target\n end\n prev.next = prev.next.next if prev # set the node before's pointer to the target node's next thereby bypassing\n end...
[ "0.77919406", "0.7752994", "0.75380784", "0.67022645", "0.6617061", "0.6615239", "0.65998805", "0.6576167", "0.6495146", "0.6456615", "0.6422828", "0.6415624", "0.6409309", "0.6407635", "0.6354696", "0.6354696", "0.6337306", "0.6328446", "0.6327151", "0.6270374", "0.62665224"...
0.7782042
1
traverses linked list searching for node that matches target returns pointer to node w/ value unless doesn't exist (returns nil)
def find_node(target) if @num_nodes == 0 return nil else current = 0 current_node = @head while current < @num_nodes if current_node.get_Data() == target return current, current_node end current_node = current_node.get_Next() current += 1 end re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove(target)\n return nil if target == nil || @head == nil\n @head = @head.next if @head == target\n prev_node = find do |item|\n item.next == target\n end\n prev_node.next = prev_node.next.next if prev_node\n end", "def remove(target)\n @head = @head.next if @head == ...
[ "0.6690044", "0.652086", "0.6246575", "0.6229369", "0.6135796", "0.6125855", "0.5872961", "0.58613133", "0.5860186", "0.5772552", "0.5772183", "0.5760182", "0.5753002", "0.5741149", "0.572401", "0.57061243", "0.57035106", "0.5702411", "0.56924814", "0.56860065", "0.5675607", ...
0.6631278
1
removes all nodes from list
def ll_clear() @head = nil @tail = nil @num_nodes = 0 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def erase\n @nodes.erase\n end", "def remove\n each { |x| x.parent.children.delete(x) }\n end", "def remove_all\n @peer.remove_all\n# @children.each { |child| scene.unindex_prop(child) } if scene\n# @children = []\n end", "def clear_nodes\n\t\t\t@tree = []\n\t\t\t@node...
[ "0.72514135", "0.6990174", "0.6976418", "0.68702143", "0.67705405", "0.669668", "0.6683144", "0.6659121", "0.6628757", "0.65953046", "0.65341514", "0.65308034", "0.65292054", "0.65204144", "0.64964104", "0.64964104", "0.64964104", "0.6439573", "0.6432845", "0.6325385", "0.632...
0.6658718
8
traverses list and applies given function to the data in each node
def ll_map(function) current = 0 current_node = @head while current < @num_nodes current_node.set_Data(function.call(current_node.get_Data())) current_node = current_node.get_Next() current += 1 end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def map(func)\n\t\tif (!@head) then return end\n\t\tcurrent = @head\n\t\twhile (current)\n\t\t\tcurrent.alter(func)\n\t\t\tcurrent = current.get_next()\n\t\tend\n\tend", "def map(list, &function)\n list.reduce([]) do |acc, val|\n acc.push function.call(val)\n end\nend", "def transform(tree); end", "def ...
[ "0.59042484", "0.5607125", "0.5533487", "0.54409236", "0.5311446", "0.5261461", "0.52340114", "0.50751823", "0.5073853", "0.5054846", "0.49995282", "0.49868467", "0.49868467", "0.4937809", "0.4937447", "0.4937447", "0.49146825", "0.4902533", "0.4889333", "0.48843893", "0.4874...
0.5949223
0
returns size of linked list
def ll_size() return @num_nodes end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def size\n node = @list\n size = 0\n while node != nil\n size += 1\n node = node.nextNode\n end\n size\n end", "def list_size()\n counter = 0\n temp_node = @head #start traversting from first elemnt\n until temp_node == nil #stop when reach end of list\n te...
[ "0.88807565", "0.8696248", "0.86506426", "0.8595079", "0.851358", "0.84921813", "0.8430324", "0.8430324", "0.8417024", "0.83983636", "0.8395785", "0.83836067", "0.83816797", "0.8379551", "0.8367774", "0.8361944", "0.83600056", "0.8354681", "0.83529484", "0.83126974", "0.82881...
0.77092606
57
returns NODE head is pointing to
def get_Head() return @head end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def node_first\n @head\n end", "def head_node\n return nil unless valid?\n\n head_node = @nodes.select { |n| n.is_shadow? }.compact\n \n # TODO: is the last guard necessary?\n head_node.empty? ? nil : head_node[0]\n end", "def head\n @head ||= node.attr(:head).to_i\n end...
[ "0.79740375", "0.7677651", "0.76662534", "0.741208", "0.7287678", "0.7221949", "0.7140583", "0.71332085", "0.71111554", "0.7090211", "0.7083567", "0.707784", "0.7064796", "0.7026073", "0.6985558", "0.6969514", "0.68683505", "0.6839997", "0.6787371", "0.67412204", "0.6731893",...
0.7291628
4
returns NODE tail is pointing to
def get_Tail() return @tail end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tail\n last_node(head)\nend", "def tail\n node_at(size - 1)\n end", "def tail\n if @head.nil?\n nil\n else\n current_node = @head\n current_node = current_node.next_node until current_node.next_node.nil?\n end\n end", "def tail?\n @next_node.nil?\n end", "def tail\...
[ "0.7705871", "0.7472127", "0.73682165", "0.734834", "0.73323315", "0.72692335", "0.7256494", "0.7186294", "0.7146406", "0.71231085", "0.71169007", "0.7084051", "0.70826876", "0.70822805", "0.7050087", "0.7047907", "0.700533", "0.7001773", "0.697897", "0.69672644", "0.69662076...
0.6733609
32
creates new LinkedList, initializes, and returns
def ll_create() return Linked_List.new() end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_list\n list = SinglyLinkedList.new\n list.insert_at_end 1\n list.insert_at_end 2\n list.insert_at_end 3\n list.insert_at_end 4\n list.insert_at_end 5\n list.insert_at_end 6\n list.insert_at_end 7\n list\nend", "def initialize (head)\n raise \"LinkedList must be initialized with a Node.\"...
[ "0.7057759", "0.70360565", "0.68866944", "0.6801317", "0.6737784", "0.67328984", "0.67259496", "0.6717657", "0.6695697", "0.6677563", "0.6664199", "0.66474503", "0.66402817", "0.6607466", "0.65653366", "0.6556408", "0.6530275", "0.6524591", "0.65047354", "0.6493716", "0.64781...
0.8162178
0
l2 = 1.1, 2.2, 3.3, 4.4, 5.5 squares value within node
def square(value) puts value**2 return value**2 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum_lists_direct(a, b)\n sum = ll_to_i(a) + ll_to_i(b)\n\n res = nil\n\n while sum > 0 do\n res = LLNode.new(sum % 10, res)\n sum = sum / 10\n end\n\n res\nend", "def l2\n\t\t\t\t@l2\n\t\t\tend", "def add_two_numbers(l1, l2)\n l1_str = to_reverse_string(l1)\n l2_str = to_reverse_string(l2)...
[ "0.5898878", "0.5670472", "0.5626492", "0.55730194", "0.5564381", "0.55240935", "0.54944223", "0.54659796", "0.5458297", "0.53818446", "0.53502417", "0.52834177", "0.52524686", "0.52391076", "0.5201488", "0.51962256", "0.5192229", "0.5169272", "0.5147735", "0.5142829", "0.510...
0.0
-1
Finds the LtiCredential & Account based on the oauth_consumer_key
def find_lti_credentials raise OpenAssessments::NoLtiKey unless params["oauth_consumer_key"].present? if @lti_credential = LtiCredential.enabled.where(lti_key: params["oauth_consumer_key"]).first @current_account = @lti_credential.account @lti_credential else #todo: next refactor stage: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def account_from_oauth(auth)\n extractor = Extractor::Base.load(auth)\n\n accounts.where(extractor.signature).first_or_initialize do |account|\n account.username = extractor.username\n account.oauth_token = extractor.oauth_token\n account.oauth_secret = extractor.oauth_secret\n ac...
[ "0.6388478", "0.6126464", "0.59044105", "0.57566273", "0.5602327", "0.5585292", "0.55467004", "0.5542311", "0.55060184", "0.5499018", "0.5472087", "0.5462525", "0.5453349", "0.5452926", "0.5437988", "0.5423689", "0.5416835", "0.54161745", "0.5367974", "0.5339445", "0.5331057"...
0.77312523
0
After saving need to make sure that cached pages for css and js for this layout and its children are gone. Good enough to avoid using cache sweepers.
def clear_cache FileUtils.rm File.expand_path("cms-css/#{self.slug}.css", Rails.public_path), :force => true FileUtils.rm File.expand_path("cms-js/#{self.slug}.js", Rails.public_path), :force => true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_cached_page_content\n self.cms_pages.each{ |page| page.save! }\n self.children.each{ |child_layout| child_layout.save! }\n end", "def remove_archive_cache\n expire_action(:controller => '/articles', :action => 'index')\n expire_fragment(%r{/articles/page/*})\n expire_fragment(%r{/catego...
[ "0.75124556", "0.6358397", "0.61805314", "0.6038417", "0.60250205", "0.6016332", "0.5915712", "0.5829763", "0.57721066", "0.570798", "0.5693367", "0.5679735", "0.56778675", "0.56748253", "0.5674354", "0.5674354", "0.5674354", "0.56622136", "0.5628651", "0.56114256", "0.560793...
0.69261426
1
Forcing page content reload
def clear_cached_page_content self.cms_pages.each{ |page| page.save! } self.children.each{ |child_layout| child_layout.save! } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reloads\n load_page\n end", "def reload\n Howitzer::Log.info \"Reload '#{current_url}'\"\n visit current_url\n end", "def refresh\n render js: \"location.reload()\"\n end", "def reload\n\t\tself.request( :reload )\n\tend", "def refresh()\r\n #set_browser_docume...
[ "0.8349382", "0.7721967", "0.729564", "0.7134454", "0.7118101", "0.6934028", "0.6923", "0.6923", "0.6848383", "0.6831548", "0.68107903", "0.6781688", "0.6781688", "0.67402124", "0.67402124", "0.67402124", "0.67402124", "0.67402124", "0.67402124", "0.67402124", "0.6710265", ...
0.0
-1
GET /timelines GET /timelines.json
def index if params[:tag] @tag = Tag.find_by_name(params[:tag]) @timelines = @tag.timelines.where("user_id > 0").order("CREATED_AT DESC") else @timelines = Timeline.where("user_id > 0").order("CREATED_AT DESC") end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @time_lines = TimeLine.all\n end", "def timeline\n request('timeline')\n end", "def index\n\n @metro_lines = MetroLine.all\n\n render json: @metro_lines\n\n end", "def get_lines_with_http_info(year, opts = {})\n if @api_client.config.debugging\n @api_client....
[ "0.73934925", "0.64798343", "0.6226493", "0.62090915", "0.6175456", "0.6160409", "0.61273205", "0.60771465", "0.6048008", "0.60305995", "0.600101", "0.59700704", "0.5967818", "0.59137195", "0.5887116", "0.5875612", "0.58714193", "0.58714193", "0.5858883", "0.58386683", "0.583...
0.57954615
21
GET /timelines/1 GET /timelines/1.json
def show # trying to place things on timeline # (D / T) * (# of pixels in the line) if @timeline.events.where("user_id > 0").count > 0 events = @timeline.events.where("user_id > 0").order("date ASC") @start_date = events.first.date end_date = events.last.date @total_time_length = end...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @time_lines = TimeLine.all\n end", "def find_timeline match_id\n DynamicModel.new perform_request api_url \"timelines/by-match/#{match_id}\"\n end", "def index\n\n @metro_lines = MetroLine.all\n\n render json: @metro_lines\n\n end", "def timeline\n request('timeline'...
[ "0.72330636", "0.62893975", "0.6126051", "0.6081426", "0.6070609", "0.60703796", "0.6069262", "0.60509694", "0.60469913", "0.603694", "0.60345155", "0.60053366", "0.60053366", "0.60015523", "0.598556", "0.59845454", "0.59786654", "0.59697235", "0.59575796", "0.5948783", "0.59...
0.0
-1
POST /timelines POST /timelines.json
def create @timeline = Timeline.new(timeline_params) @timeline.user = current_user if @timeline.save if current_user redirect_to @timeline, notice: "Timeline published." else session[:unsaved_timeline] = @timeline.id redirect_to "/auth/facebook" end else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @time_line = TimeLine.new(time_line_params)\n\n respond_to do |format|\n if @time_line.save\n format.html { redirect_to @time_line, notice: 'Time line was successfully created.' }\n format.json { render :show, status: :created, location: @time_line }\n else\n forma...
[ "0.70102185", "0.6316071", "0.61472714", "0.61373806", "0.6116878", "0.60245836", "0.5993686", "0.59350246", "0.582204", "0.58167076", "0.57876885", "0.5768601", "0.5668363", "0.5668363", "0.5644153", "0.56169885", "0.56111187", "0.5585266", "0.5578234", "0.5562811", "0.55609...
0.0
-1
PATCH/PUT /timelines/1 PATCH/PUT /timelines/1.json
def update respond_to do |format| if @timeline.update(timeline_params) format.html { redirect_to @timeline, notice: 'Timeline was successfully updated.' } format.json { render :show, status: :ok, location: @timeline } else format.html { render :edit } format.json { render...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @time_line.update(time_line_params)\n format.html { redirect_to @time_line, notice: 'Time line was successfully updated.' }\n format.json { render :show, status: :ok, location: @time_line }\n else\n format.html { render :edit }\n for...
[ "0.71653247", "0.6364411", "0.6343682", "0.6343682", "0.6298806", "0.6285462", "0.62227196", "0.6147849", "0.610395", "0.6086054", "0.6074228", "0.60639846", "0.6054628", "0.6018801", "0.5997374", "0.59903765", "0.5970429", "0.59346265", "0.59238", "0.5920436", "0.592029", ...
0.6252899
7
DELETE /timelines/1 DELETE /timelines/1.json
def destroy @timeline.destroy respond_to do |format| format.html { redirect_to timelines_url, notice: 'Timeline was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @time_line.destroy\n respond_to do |format|\n format.html { redirect_to time_lines_url, notice: 'Time line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @timeline = Timeline.find(params[:id])\n @timeline.destroy\n\n respo...
[ "0.7714029", "0.74526316", "0.74414647", "0.72424203", "0.6934347", "0.69284695", "0.68735766", "0.6805788", "0.67969483", "0.6725651", "0.66980547", "0.66980547", "0.6693398", "0.6690874", "0.66741633", "0.6672487", "0.6666954", "0.6663088", "0.6662217", "0.66586536", "0.662...
0.702809
5
Use callbacks to share common setup or constraints between actions.
def set_timeline @timeline = Timeline.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def timeline_params params.require(:timeline).permit(:title, :tagline, :description) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
GET /drivers_licesnses GET /drivers_licesnses.json
def index @drivers_licesnses = DriversLicesnse.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_drivers_licesnse\n @drivers_licesnse = DriversLicesnse.find(params[:id])\n end", "def index\n @drivers = Driver.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @drivers }\n end\n end", "def index\n @drivers = Driver.all\n\n re...
[ "0.7172705", "0.60340273", "0.60340273", "0.59172094", "0.58379966", "0.57715344", "0.57238096", "0.55955327", "0.55955327", "0.5595323", "0.55920035", "0.5544699", "0.5528817", "0.55016357", "0.54497266", "0.54328156", "0.5423586", "0.5402053", "0.5371387", "0.53437483", "0....
0.7475432
0
GET /drivers_licesnses/1 GET /drivers_licesnses/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @drivers_licesnses = DriversLicesnse.all\n end", "def set_drivers_licesnse\n @drivers_licesnse = DriversLicesnse.find(params[:id])\n end", "def index\n @drivers = Driver.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @drivers }...
[ "0.7256676", "0.72293186", "0.61513114", "0.61513114", "0.61289394", "0.5799434", "0.57935894", "0.5771262", "0.5714878", "0.56680495", "0.5622909", "0.5622909", "0.56170595", "0.5598584", "0.5590924", "0.5483177", "0.5483177", "0.5446796", "0.54436433", "0.5385117", "0.53717...
0.0
-1
POST /drivers_licesnses POST /drivers_licesnses.json
def create @drivers_licesnse = DriversLicesnse.new(drivers_licesnse_params) respond_to do |format| if @drivers_licesnse.save format.html { redirect_to @drivers_licesnse, notice: 'Drivers licesnse was successfully created.' } format.json { render :show, status: :created, location: @drivers...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def drivers_licesnse_params\n params.require(:drivers_licesnse).permit(:technician_id, :license_id, :height, :weight, :eye_color, :birthday, :hair_color, :state, :expiration)\n end", "def set_drivers_licesnse\n @drivers_licesnse = DriversLicesnse.find(params[:id])\n end", "def index\n @drive...
[ "0.67362875", "0.66987413", "0.6348816", "0.5857736", "0.55932474", "0.5320573", "0.49687582", "0.48411366", "0.48411366", "0.47926515", "0.47655082", "0.4734434", "0.47169697", "0.47082466", "0.47008526", "0.46724364", "0.46679288", "0.4665645", "0.4659617", "0.46564543", "0...
0.7132217
0
PATCH/PUT /drivers_licesnses/1 PATCH/PUT /drivers_licesnses/1.json
def update respond_to do |format| if @drivers_licesnse.update(drivers_licesnse_params) format.html { redirect_to @drivers_licesnse, notice: 'Drivers licesnse was successfully updated.' } format.json { render :show, status: :ok, location: @drivers_licesnse } else format.html { ren...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_drivers_licesnse\n @drivers_licesnse = DriversLicesnse.find(params[:id])\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override...
[ "0.6159118", "0.58543074", "0.5800088", "0.57885563", "0.5674885", "0.5641955", "0.5585624", "0.5547176", "0.5522716", "0.5519686", "0.55128914", "0.5484412", "0.54633355", "0.5450496", "0.5426094", "0.54189354", "0.5414983", "0.5407957", "0.5387228", "0.5377563", "0.537302",...
0.73466337
0
DELETE /drivers_licesnses/1 DELETE /drivers_licesnses/1.json
def destroy @drivers_licesnse.destroy respond_to do |format| format.html { redirect_to drivers_licesnses_url, notice: 'Drivers licesnse was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @driver.destroy\n respond_to do |format|\n format.html { redirect_to drivers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @driver = Driver.find(params[:id])\n @driver.destroy\n\n respond_to do |format|\n format.html { redirect_to drivers_ur...
[ "0.6798889", "0.66945976", "0.66412926", "0.661733", "0.6580633", "0.65717894", "0.65680075", "0.65680075", "0.65680075", "0.65395945", "0.6521738", "0.65192413", "0.64847016", "0.64695585", "0.64404345", "0.642146", "0.63814664", "0.63643503", "0.63620776", "0.6361039", "0.6...
0.76517916
0
Use callbacks to share common setup or constraints between actions.
def set_drivers_licesnse @drivers_licesnse = DriversLicesnse.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def drivers_licesnse_params params.require(:drivers_licesnse).permit(:technician_id, :license_id, :height, :weight, :eye_color, :birthday, :hair_color, :state, :expiration) 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.6981269", "0.6783559", "0.6746007", "0.67423046", "0.6735905", "0.6593568", "0.6504213", "0.649792", "0.6482664", "0.6478558", "0.64566684", "0.64392304", "0.6380194", "0.6376366", "0.636562", "0.63208145", "0.63006365", "0.63001287", "0.6292953", "0.62927175", "0.62911004...
0.0
-1
Sets visible to false
def hide @visible = false self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hide!\n visible(false)\n end", "def hide!\n visible(false)\n end", "def hide\n self.visible = false\n clear_dmg_preview\n end", "def hide!\n self[:hidden] = true\n self\n end", "def hide\n #return unless visible? # added 2011-10-14 these 2 are not behavi...
[ "0.83427525", "0.83427525", "0.7670964", "0.73987275", "0.7301057", "0.7289147", "0.7148411", "0.7040515", "0.7040515", "0.7040515", "0.70321435", "0.69997066", "0.69981635", "0.69933254", "0.69933254", "0.6910383", "0.6872132", "0.68138564", "0.68067014", "0.6802133", "0.680...
0.82138264
2
Sets visible to true
def show @visible = true self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n self.visible = true\n end", "def show!\n visible(true)\n end", "def show!\n visible(true)\n end", "def setVisible(visible=true)\n DOM.setVisible(@element, visible)\n end", "def visible=(vis)\n if vis\n show\n else\n hide\n ...
[ "0.8379594", "0.80365956", "0.80365956", "0.78830796", "0.78802097", "0.7858681", "0.78532684", "0.77956873", "0.7740215", "0.7735612", "0.76651186", "0.76633227", "0.76633227", "0.76003903", "0.7571199", "0.75675446", "0.75387", "0.75387", "0.753653", "0.753653", "0.75311667...
0.79928285
3
CREATE A SLICE = DESCRIPTION Create a new Slice object from scratch. = USAGE chr4 = SeqRegion.find_by_name('4') my_slice = Slice.new(chr4, 95000, 98000, 1) Arguments: seq_region: SeqRegion object start: start position of the Slice on the SeqRegion (default = 1) stop: stop position of the Slice on the SeqRegion (default...
def initialize(seq_region, start = 1, stop = seq_region.length, strand = 1) if start.nil? start = 1 end if stop.nil? stop = seq_region.length end unless seq_region.class == Ensembl::Core::SeqRegion raise 'First argument has to be a Ensembl::Cor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def slice(start=0,stop=self.length,strand=1) \n self.genome_db.connect_to_genome_new\n seq_region = Ensembl::Core::SeqRegion.find_by_name(self.name)\n return Ensembl::Core::Slice.new(seq_region, start, stop, strand) \n end", "def sub_slice(start = self.start, stop = self.s...
[ "0.78437704", "0.6890883", "0.686019", "0.67908204", "0.6439554", "0.607419", "0.59665334", "0.5787394", "0.57534707", "0.5667927", "0.56000525", "0.55107355", "0.54497486", "0.5388026", "0.53753555", "0.5358685", "0.524061", "0.52297354", "0.5227407", "0.5210636", "0.5169644...
0.6411467
5
GENERAL METHODS = DESCRIPTION Get the length of a slice = USAGE chr4 = SeqRegion.find_by_name('4') my_slice = Slice.new(chr4, 95000, 98000, 1) puts my_slice.length Arguments:: none Returns:: Integer
def length return self.stop - self.start + 1 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def length()\n #This is a stub, used for indexing\n end", "def length() end", "def length() end", "def length() end", "def length() end", "def length\n @client.call('length', @name)\n end", "def length; end", "def length; end", "def length; end", "def length; end", "def length...
[ "0.6799194", "0.67843693", "0.67843693", "0.67843693", "0.67843693", "0.67347115", "0.672292", "0.672292", "0.672292", "0.672292", "0.672292", "0.672292", "0.672292", "0.67188376", "0.6705713", "0.66779464", "0.6656074", "0.66538364", "0.6608578", "0.6608578", "0.6567158", ...
0.6374767
36
= DESCRIPTION The display_name method returns a full name of this slice, containing the name of the coordinate system, the sequence region, start and stop positions on that sequence region and the strand. E.g. for a slice of bovine chromosome 4 from position 95000 to 98000 on the reverse strand, the display_name would ...
def display_name return [self.seq_region.coord_system.name, self.seq_region.coord_system.version, self.seq_region.name, self.start.to_s, self.stop.to_s, self.strand.to_s].join(':') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_name\n \treturn [self.seq_region.coord_system.name, self.seq_region.coord_system.version, self.seq_region.name, self.start.to_s, self.stop.to_s, self.strand.to_s].join(':')\n end", "def display_name\n return '' unless @research_output.is_a?(ResearchOutput)\n return \"#{@research_outpu...
[ "0.71321523", "0.681726", "0.65252376", "0.6491613", "0.6420956", "0.6420926", "0.6420926", "0.6392528", "0.63767207", "0.6370165", "0.633015", "0.6322558", "0.63152885", "0.6313507", "0.6308362", "0.63009316", "0.62752223", "0.62707484", "0.6255066", "0.6253441", "0.6253441"...
0.7123771
1
= DESCRIPTION The Sliceoverlaps? method checks if this slice overlaps another one. The other slice has to be on the same coordinate system = USAGE slice_a = Slice.fetch_by_region('chromosome','X',1,1000) slice_b = Slice.fetch_by_region('chromosome','X',900,1500) if slice_a.overlaps?(slice_b) puts "There slices overlap"...
def overlaps?(other_slice) if ! other_slice.class == Slice raise RuntimeError, "The Slice#overlaps? method takes a Slice object as its arguments." end if self.seq_region.coord_system != other_slice.seq_region.coord_system raise RuntimeError, "The argument slice of Slice#...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def within?(other_slice)\r\n if ! other_slice.class == Slice\r\n raise RuntimeError, \"The Slice#overlaps? method takes a Slice object as its arguments.\"\r\n end\r\n if self.seq_region.coord_system != other_slice.seq_region.coord_system\r\n raise RuntimeError, \"The argument...
[ "0.8490798", "0.8435253", "0.8417924", "0.72707367", "0.71674556", "0.71674556", "0.71674556", "0.7127089", "0.69167256", "0.6749351", "0.6748362", "0.6745123", "0.67354625", "0.6720376", "0.6684288", "0.66689396", "0.6663298", "0.6653399", "0.66384125", "0.66370314", "0.6613...
0.8499739
0
= DESCRIPTION The Slicewithin? method checks if this slice is contained withing another one. The other slice has to be on the same coordinate system = USAGE slice_a = Slice.fetch_by_region('chromosome','X',1,1000) slice_b = Slice.fetch_by_region('chromosome','X',900,950) if slice_b.overlaps?(slice_a) puts "Slice b is w...
def within?(other_slice) if ! other_slice.class == Slice raise RuntimeError, "The Slice#overlaps? method takes a Slice object as its arguments." end if self.seq_region.coord_system != other_slice.seq_region.coord_system raise RuntimeError, "The argument slice of Slice#ov...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def within?(other_slice)\n if ! other_slice.class == Slice\n raise RuntimeError, \"The Slice#overlaps? method takes a Slice object as its arguments.\"\n end\n if self.seq_region.coord_system != other_slice.seq_region.coord_system\n raise RuntimeError, \"The argument slice of ...
[ "0.8177703", "0.7773871", "0.7679438", "0.68039215", "0.66671675", "0.66209465", "0.66209465", "0.66209465", "0.6596299", "0.6589978", "0.65475583", "0.6507309", "0.6459016", "0.64520234", "0.64433765", "0.64143693", "0.64093095", "0.64025253", "0.64015853", "0.6390593", "0.6...
0.82361704
0
= DESCRIPTION The Sliceexcise method removes a bit of a slice and returns the remainder as separate slices. = USAGE original_slice = Slice.fetch_by_region('chromosome','X',1,10000) new_slices = original_slice.excise([500..750, 1050..1075]) new_slices.each do |s| puts s.display_name end result: chromosome:X:1:499:1 chro...
def excise(ranges) if ranges.class != Array raise RuntimeError, "Argument should be an array of ranges" end ranges.each do |r| if r.class != Range raise RuntimeError, "Argument should be an array of ranges" end end answer = Arr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def excise(ranges)\n if ranges.class != Array\n raise RuntimeError, \"Argument should be an array of ranges\"\n end\n ranges.each do |r|\n if r.class != Range\n raise RuntimeError, \"Argument should be an array of ranges\"\n end\n end\n\n ans...
[ "0.6820223", "0.6382385", "0.5862968", "0.5862557", "0.57931596", "0.57589495", "0.5740166", "0.5636483", "0.56215775", "0.56215775", "0.56215775", "0.56215775", "0.56215775", "0.56215775", "0.56215775", "0.56215775", "0.5529842", "0.55192", "0.54987174", "0.5483124", "0.5472...
0.68082726
1
= DESCRIPTION Get the sequence of the Slice as a Bio::Sequence::NA object. If the Slice is on a CoordSystem that is not seq_level, it will try to project it coordinates to the CoordSystem that does. At this moment, this is only done if there is a direct link between the two coordinate systems. (The perl API allows for ...
def seq # If we already accessed the sequence, we can just # call the instance variable. Otherwise, we'll have # to get the sequence first and create a Bio::Sequence::NA # object. if @seq.nil? # First check if the slice is on the seqlevel coordinate # syste...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def seq\n \t# If we already accessed the sequence, we can just\n \t# call the instance variable. Otherwise, we'll have\n # to get the sequence first and create a Bio::Sequence::NA\n \t# object.\n if @seq.nil?\n # First check if the slice is on the seqlevel coordinate\n \t...
[ "0.80898994", "0.67043334", "0.6068382", "0.5828373", "0.5800096", "0.57992786", "0.57230896", "0.5720506", "0.569142", "0.55779254", "0.54183143", "0.540882", "0.54068726", "0.5396837", "0.53838277", "0.53321785", "0.5299862", "0.52706826", "0.52228475", "0.52091247", "0.518...
0.81492203
0
= DESCRIPTION Take a sub_slice from an existing one. = USAGE my_sub_slice = my_slice.sub_slice(400,500) Arguments: start: start of subslice relative to slice (default: start of slice) stop: stop of subslice relative to slice (default: stop of slice) Returns:: Ensembl::Core::Slice object
def sub_slice(start = self.start, stop = self.stop) return self.class.new(self.seq_region, start, stop, self.strand) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sub_slice(start = self.start, stop = self.stop)\n \treturn self.class.new(self.seq_region, start, stop, self.strand)\n end", "def slice(start, length)\n end", "def subsequence(start, stop)\n \treturn self.seq.slice(start - 1, (stop - start) + 1)\n end", "def slice(start=0,stop=self.l...
[ "0.8124563", "0.7401284", "0.7190674", "0.6939544", "0.66572785", "0.65686685", "0.65686685", "0.6542338", "0.65177906", "0.6383946", "0.63494015", "0.6326494", "0.6308979", "0.62936723", "0.6199156", "0.61896855", "0.61774457", "0.61364985", "0.61357373", "0.6083997", "0.603...
0.8105001
1
= DESCRIPTION Creates overlapping subslices for a given Slice. = USAGE my_slice.split(50000, 250).each do |sub_slice| puts sub_slice.display_name end Arguments: max_size: maximal size of subslices (default: 100000) overlap: overlap in bp between consecutive subslices (default: 0) Returns:: array of Ensembl::Core::Slice...
def split(max_size = 100000, overlap = 0) sub_slices = Array.new i = 0 self.start.step(self.length, max_size - overlap - 1) do |i| sub_slices.push(self.sub_slice(i, i + max_size - 1)) end i -= (overlap + 1) sub_slices.push(self.sub_slice(i + max_size)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split(max_size = 100000, overlap = 0)\n \tsub_slices = Array.new\n i = 0\n \tself.start.step(self.length, max_size - overlap - 1) do |i|\n sub_slices.push(self.sub_slice(i, i + max_size - 1))\n end\n \ti -= (overlap + 1)\n sub_slices.push(self.sub_slice(i + max_size...
[ "0.88053054", "0.61495405", "0.6132552", "0.60704446", "0.58625704", "0.58562", "0.58120203", "0.57541126", "0.572651", "0.5666951", "0.5643903", "0.55445445", "0.54656357", "0.54104894", "0.54104894", "0.53359306", "0.53318363", "0.5315869", "0.53132665", "0.53020537", "0.52...
0.8825266
0
GET ELEMENTS WITHIN SLICE As there should be 'getters' for a lot of classes, we'll implement this with method_missing. For some of the original methods, see the end of this file. The optional argument is either 'true' or 'false' (default = false). False if the features have to be completely contained within the slice; ...
def method_missing(method_name, *args) table_name = method_name.to_s.singularize class_name = table_name.camelcase # Convert to the class object target_class = nil ObjectSpace.each_object(Class) do |o| if o.name =~ /^Ensembl::Core::#{class_name}$/ t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sliced?\n slicing ? slicing.map.any? : false\n end", "def get_intersection\n end", "def within?(other_slice)\r\n if ! other_slice.class == Slice\r\n raise RuntimeError, \"The Slice#overlaps? method takes a Slice object as its arguments.\"\r\n end\r\n if self.seq_reg...
[ "0.604141", "0.5898467", "0.56536585", "0.55543655", "0.5520742", "0.5449208", "0.5395677", "0.53931206", "0.5378755", "0.5327926", "0.52841854", "0.52046967", "0.51725847", "0.51725847", "0.5167554", "0.5167554", "0.5167554", "0.51347375", "0.5108024", "0.50971913", "0.50894...
0.0
-1
Don't use this method yourself.
def get_objects(target_class, table_name, inclusive = false) answer = Array.new # Get all the coord_systems with this type of features on them coord_system_ids_with_features = MetaCoord.find_all_by_table_name(table_name).collect{|mc| mc.coord_system_id} # Get the featur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def probers; end", "def schubert; end", "def refutal()\n end", "def private_method\n end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def custom; end", "def custom; end", "def implementation; end", "def implementation; end", "d...
[ "0.8037641", "0.6719274", "0.6683273", "0.6583381", "0.65729916", "0.6500507", "0.6500507", "0.6500507", "0.6500507", "0.64709467", "0.64709467", "0.6426159", "0.6426159", "0.6386245", "0.63130397", "0.62172735", "0.6217058", "0.61770207", "0.6175809", "0.6096357", "0.6054888...
0.0
-1
= DESCRIPTION Get all MiscFeatures that are located on a Slice for a given MiscSet. Pitfall: just looks at the CoordSystem that the Slice is located on. For example, if a Slice is located on a SeqRegion on the 'chromosome' CoordSystem, but all misc_features are annotated on SeqRegions of the 'scaffold' CoordSystem, thi...
def misc_features(code) answer = Array.new if code.nil? self.seq_region.misc_features.each do |mf| if mf.seq_region_start > self.start and mf.seq_region_end < self.stop answer.push(mf) end end else self.seq_region.misc_f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def misc_features(code)\n \tanswer = Array.new\n if code.nil?\n self.seq_region.misc_features.each do |mf|\n if mf.seq_region_start > self.start and mf.seq_region_end < self.stop\n answer.push(mf)\n end\n end\n else\n self.seq_region....
[ "0.6877249", "0.50480545", "0.47569752", "0.47247645", "0.44504878", "0.44415116", "0.44309187", "0.44027227", "0.43188465", "0.4177623", "0.4175129", "0.4175004", "0.41225716", "0.4103932", "0.4064118", "0.4006335", "0.39896783", "0.39818004", "0.39518425", "0.39357093", "0....
0.69652325
0
= DESCRIPTION Get all DnaAlignFeatures that are located on a Slice for a given Analysis. Pitfall: just looks at the CoordSystem that the Slice is located on. For example, if a Slice is located on a SeqRegion on the 'chromosome' CoordSystem, but all dna_align_features are annotated on SeqRegions of the 'scaffold' CoordS...
def dna_align_features(analysis_name = nil) if analysis_name.nil? return DnaAlignFeature.find_by_sql('SELECT * FROM dna_align_feature WHERE seq_region_id = ' + self.seq_region.id.to_s + ' AND seq_region_start >= ' + self.start.to_s + ' AND seq_region_end <= ' + self.stop.to_s) else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dna_align_features(analysis_name = nil)\n \tif analysis_name.nil?\n return DnaAlignFeature.find_by_sql('SELECT * FROM dna_align_feature WHERE seq_region_id = ' + self.seq_region.id.to_s + ' AND seq_region_start >= ' + self.start.to_s + ' AND seq_region_end <= ' + self.stop.to_s)\n else\n ...
[ "0.6160723", "0.6098879", "0.6000319", "0.5894018", "0.5830434", "0.5805251", "0.57787895", "0.5048486", "0.5047297", "0.47548363", "0.4532026", "0.45165443", "0.45061556", "0.44920328", "0.4450872", "0.442224", "0.4421353", "0.44060987", "0.42562893", "0.42291808", "0.420666...
0.6162427
0
= DESCRIPTION Get all ProteinAlignFeatures that are located on a Slice for a given Analysis. Pitfall: just looks at the CoordSystem that the Slice is located on. For example, if a Slice is located on a SeqRegion on the 'chromosome' CoordSystem, but all protein_align_features are annotated on SeqRegions of the 'scaffold...
def protein_align_features(analysis_name) if analysis_name.nil? return ProteinAlignFeature.find_by_sql('SELECT * FROM protein_align_feature WHERE seq_region_id = ' + self.seq_region.id.to_s + ' AND seq_region_start >= ' + self.start.to_s + ' AND seq_region_end <= ' + self.stop.to_s) else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def protein_align_features(analysis_name)\n \tif analysis_name.nil?\n return ProteinAlignFeature.find_by_sql('SELECT * FROM protein_align_feature WHERE seq_region_id = ' + self.seq_region.id.to_s + ' AND seq_region_start >= ' + self.start.to_s + ' AND seq_region_end <= ' + self.stop.to_s)\n el...
[ "0.6212755", "0.61212236", "0.60882974", "0.6042742", "0.5984275", "0.524059", "0.5235025", "0.4940224", "0.49172541", "0.49011698", "0.47791278", "0.4721949", "0.45591235", "0.45447633", "0.45408973", "0.4492636", "0.4476777", "0.44357944", "0.4374633", "0.4362998", "0.43530...
0.6218298
0
= DESCRIPTION Create a new Gap object from scratch. = USAGE my_coord_system = CoordSystem.find_by_name('chromosome') Create a gap of 10kb. gap = Gap.new(my_coord_system, 10000) Arguments: coord_system: CoordSystem object (required) length: length of the gap (required) Returns:: Gap object
def initialize(coord_system, size) @coord_system, @size = coord_system, size end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def increase_gap\n\n @gap = @gap + 50\n\n end", "def increase_gap\n\n @gap = @gap + 50\n\n end", "def gaps=(gaps)\n if gaps.nil?\n fail ArgumentError, 'gaps cannot be nil'\n end\n\n if gaps.to_s.length < 1\n fail ArgumentError, 'invalid value for \"gaps\", the character len...
[ "0.533143", "0.533143", "0.52398396", "0.5024958", "0.49238282", "0.4907269", "0.48814008", "0.4843086", "0.47573102", "0.4682156", "0.46765277", "0.46543458", "0.4631309", "0.46162477", "0.46095994", "0.459939", "0.456016", "0.4554324", "0.45348448", "0.45199528", "0.4496915...
0.4323148
40
POST /projects POST /projects.json
def create @role = ProjectRole.new(projectrole_params) respond_to do |format| if @role.save format.html { redirect_to @project, notice: 'Project was successfully created.' } format.json { render :show, status: :created, location: @project } else format.html { render :new } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.json { render :json => @project, :status => :created, :location => @project }\n format.html { redirect_to(projects_path) }\n else\n format.html { render :action => \"new...
[ "0.7338948", "0.73139244", "0.7308003", "0.7299582", "0.7227503", "0.7225945", "0.71982473", "0.71170384", "0.7104803", "0.7095263", "0.7070636", "0.70408624", "0.70358187", "0.7024969", "0.70191896", "0.7009597", "0.698481", "0.697517", "0.6963753", "0.6963096", "0.6948756",...
0.0
-1
This is the Wilson Confidence Interval
def ci_lower_bound(pos, n, power) return 0 if n == 0 z = Statistics2.normaldist(1-power/2) phat = 1.0*pos/n (phat + z*z/(2*n) - z * Math.sqrt((phat*(1-phat)+z*z/(4*n))/n))/(1+z*z/n) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cnd(x)\r\n l = x.abs\r\n k = 1.0 / (1.0 + 0.2316419 * l)\r\n w = 1.0 - 1.0 / Math.sqrt(2 * Math::PI) * Math.exp(-l * l / 2.0) *\r\n ( 0.31938153 * k +\r\n -0.356563782 * (k ** 2) +\r\n 1.781477937 * (k ** 3) +\r\n -1.821255978 * (k ** 4) +\r\n ...
[ "0.59830743", "0.5920103", "0.5353738", "0.5301929", "0.5246608", "0.52274996", "0.52274996", "0.5186209", "0.51798815", "0.51669806", "0.5166814", "0.51666546", "0.51623994", "0.51571286", "0.5147047", "0.5117573", "0.5117573", "0.5096869", "0.5082659", "0.5081312", "0.50622...
0.0
-1
function to display the best answer to the user
def get_answer(link) # splitting the link into the seperate parts to extract the question id @question_id = link.to_s.split('/')[4] # making sure the question id is a number and not text if @question_id.to_i != 0 # Running the question id through the stack overflow API # will fetch t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def best_answer\n\n answer = self.answers.order('up - down DESC').first\n\n #verifica se melhor resposta tem algum voto\n #se nao houver nenhum voto nao fica como melhor resposta\n if !answer.nil? && (( answer.up == 0 && answer.down == 0) || self.answers.first == answer || self.answers.count == 1 )\n ...
[ "0.6848796", "0.6511861", "0.643124", "0.64163846", "0.6393117", "0.6393117", "0.6384188", "0.635548", "0.63371396", "0.6317703", "0.6208514", "0.61837715", "0.6113687", "0.6113687", "0.60878164", "0.60727316", "0.60126686", "0.59782964", "0.59751874", "0.59664345", "0.594189...
0.0
-1
Create a network with onevnet by passing in a temporary template.
def create file = Tempfile.new("oneimage-#{resource[:name]}") File.chmod(0644, file.path) template = ERB.new <<-EOF NAME = "<%= resource[:name] %>" <% if resource[:description] %>DESCRIPTION = "<%= resource[:description] %>"<% end%> <% if resource[:type] %>TYPE = <%= resource[:type].upcase %...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(cluster_id)\n if @p_template['provision']['count'] && @p_template['ar']\n (Integer(@p_template['provision']['count']) - 1).times do\n @p_template['ar'] << @p_template['ar'][0]\n end\n end\n\n net_id = super\n\n ...
[ "0.69096893", "0.69021505", "0.6675079", "0.6671091", "0.6507813", "0.638013", "0.6368924", "0.6137123", "0.6119117", "0.6115876", "0.6095773", "0.60517246", "0.60093665", "0.5989158", "0.5948796", "0.5945815", "0.59007376", "0.5869194", "0.58100635", "0.57825106", "0.5779933...
0.0
-1
Destroy a network using onevnet delete
def destroy output = "oneimage delete #{resource[:name]} ", self.class.login `#{output}` end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_network(request, params)\n network = VirtualNetworkOCCI.new(\n VirtualNetwork.build_xml(params[:id]),\n @client)\n\n # --- Delete the VNET ---\n rc = network.delete\n if OpenNebula.is_error?(rc)\n return rc, CloudServer...
[ "0.780026", "0.7517072", "0.7272577", "0.7265213", "0.7265213", "0.7265213", "0.7255592", "0.721866", "0.7200836", "0.7196349", "0.71721804", "0.71543574", "0.7114183", "0.7100155", "0.7089989", "0.7051602", "0.7013523", "0.6994131", "0.69686216", "0.694289", "0.6932381", "...
0.5848649
91
Check if a network exists by scanning the onevnet list
def exists? if self.class.oneimage_list().include?(resource[:name]) self.debug "Found image #{resource[:name]}" true end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def network_exists?(network_name)\n networks_list.include?(network_name)\n end", "def network_exists?(name)\n net_obj = Com::Vmware::Vcenter::Network.new(vapi_config)\n filter = Com::Vmware::Vcenter::Network::FilterSpec.new(names: Set.new([name]))\n net = net_obj.list(filter)\n\n ...
[ "0.7621919", "0.75739646", "0.7283591", "0.6696067", "0.6449437", "0.63744", "0.61357504", "0.6045145", "0.6001965", "0.59702945", "0.5961721", "0.5957676", "0.5956124", "0.595527", "0.5925181", "0.5874913", "0.5867946", "0.5855797", "0.58467263", "0.57746315", "0.57558763", ...
0.50237733
93
GET /shopcodes GET /shopcodes.json
def index @shopcodes = Shopcode.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @sales_code = SalesCode.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sales_code }\n end\n end", "def show\n @code = Code.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.j...
[ "0.6637005", "0.6561944", "0.64640003", "0.63976175", "0.6389796", "0.6275431", "0.6272414", "0.6270762", "0.6270762", "0.6270762", "0.6270762", "0.62174594", "0.61830634", "0.6166547", "0.61486775", "0.60458124", "0.60439736", "0.60418034", "0.60410154", "0.60197467", "0.600...
0.69762146
0
GET /shopcodes/1 GET /shopcodes/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @shopcodes = Shopcode.all\n end", "def show\n @sales_code = SalesCode.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sales_code }\n end\n end", "def show\n @code = Code.find(params[:id])\n\n respond_to do |forma...
[ "0.6937843", "0.6915354", "0.6814354", "0.65825844", "0.6559351", "0.65398407", "0.64736813", "0.64213777", "0.6410024", "0.636206", "0.6354684", "0.63203186", "0.6262296", "0.6258546", "0.62581277", "0.62303597", "0.6217322", "0.61742586", "0.61450595", "0.6142869", "0.61361...
0.0
-1
POST /shopcodes POST /shopcodes.json
def create @shopcode = Shopcode.new(shopcode_params) respond_to do |format| if @shopcode.save format.html { redirect_to @shopcode, notice: 'Shopcode was successfully created.' } format.json { render :show, status: :created, location: @shopcode } else format.html { render :ne...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @sales_code = SalesCode.new(params[:sales_code])\n\n respond_to do |format|\n if @sales_code.save\n format.html { redirect_to @sales_code, notice: 'Sales code was successfully created.' }\n format.json { render json: @sales_code, status: :created, location: @sales_code }\n ...
[ "0.6428582", "0.62885505", "0.6173677", "0.6173677", "0.6173677", "0.6173677", "0.6173677", "0.6145338", "0.61431223", "0.5942547", "0.5927091", "0.5921732", "0.5849399", "0.58295614", "0.5811345", "0.57975745", "0.57946426", "0.5774858", "0.5751952", "0.57508177", "0.5731895...
0.70924455
0
PATCH/PUT /shopcodes/1 PATCH/PUT /shopcodes/1.json
def update respond_to do |format| if @shopcode.update(shopcode_params) format.html { redirect_to @shopcode, notice: 'Shopcode was successfully updated.' } format.json { render :show, status: :ok, location: @shopcode } else format.html { render :edit } format.json { render...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @shop = Shop.find(params[:id])\n\n if @shop.update(shop_params)\n head :no_content\n else\n render json: @shop.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @shop.update(shop_params)\n format.html { redirect_to bac...
[ "0.6528418", "0.6510886", "0.6344636", "0.63328505", "0.63136375", "0.628646", "0.62715626", "0.6267313", "0.6267313", "0.62424785", "0.61832696", "0.6178717", "0.6176817", "0.61680377", "0.61680377", "0.6163248", "0.61626065", "0.61612654", "0.6147785", "0.61474335", "0.6075...
0.69678074
0
DELETE /shopcodes/1 DELETE /shopcodes/1.json
def destroy @shopcode.destroy respond_to do |format| format.html { redirect_to shopcodes_url, notice: 'Shopcode was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @shop.destroy\n respond_to do |format|\n format.html { redirect_to backend_shops_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @sales_code = SalesCode.find(params[:id])\n @sales_code.destroy\n\n respond_to do |format|\n format.html { redirec...
[ "0.7276555", "0.72546923", "0.71681154", "0.71465635", "0.71465635", "0.71465635", "0.7135326", "0.7135326", "0.7098472", "0.7073837", "0.7066151", "0.7031895", "0.70223075", "0.70105195", "0.7010109", "0.69978213", "0.69970876", "0.6967716", "0.6956475", "0.6954943", "0.6950...
0.77292717
0
Use callbacks to share common setup or constraints between actions.
def set_shopcode @shopcode = Shopcode.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def shopcode_params params.require(:shopcode).permit(:order_no, :first_name, :last_name, :email, :shop_code, :store_credit, :issue_date, :exp_date, :comment, :status) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
Applies the adapter of given name on SimpleCov.configure
def load(name) name = name.to_sym raise "Could not find SimpleCov Adapter called '#{name}'" unless has_key?(name) SimpleCov.configure(&self[name]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adapter(name, options = {}, &block)\n use(Adapters.const_get(name), options, &block)\n end", "def apply_adapter_name(config)\n db_adapter = config[:db_adapter] || config[:adapter]\n config.merge(:adapter => db_adapter)\n end", "def set_http_adapter( module_name='RestClientAdapter...
[ "0.656601", "0.62744933", "0.5892702", "0.5867338", "0.5771486", "0.5771486", "0.57190025", "0.56945634", "0.5671692", "0.558888", "0.55806357", "0.55800503", "0.55754125", "0.55198616", "0.5480468", "0.5480468", "0.5480468", "0.5466624", "0.54564923", "0.5445614", "0.5439557...
0.7832852
1
Each method will take a string as a parameter Set a counter Create an until loop Return encrypt or decrypted string End
def prev_char(single_letter) (single_letter.ord - 1).chr end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encrypt(str)\n str_count = 0\n str_actual = \"\"\n until str_count == str.length\n if str[str_count] == \"z\"\n str_actual += \"a\"\n else\n str_actual += str[str_count].next\n end\n str_count += 1\n end\n encrypt = str_actual\nend", "def encrypt(secret_password)\n# Create a characte...
[ "0.7142575", "0.71402454", "0.713948", "0.6888225", "0.68529373", "0.6834711", "0.6834085", "0.6774794", "0.675276", "0.67507714", "0.6746052", "0.6714369", "0.6711426", "0.67100656", "0.67035186", "0.66666234", "0.6658587", "0.66476744", "0.66323996", "0.6585722", "0.6543557...
0.0
-1
=begin Visitorvisit_Element(element, rest) callback method. =end
def visit_Element(element, *rest) element.children_accept(self, *rest) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def visit(elem, data)\r\n @@log.debug(\"XmlVisitor::visit\")\r\n @@log.debug(elem.inspect)\r\n\r\n case elem.name\r\n when 'Compute'\r\n data = visitCompute(elem, data)\r\n\r\n when 'Operator'\r\n data = visitOperator(elem, data)\r\n\r\n when 'LeftOperand'\r\n data = vi...
[ "0.67463964", "0.67047423", "0.6538481", "0.6538481", "0.6538481", "0.6538481", "0.64953524", "0.64810383", "0.62926567", "0.62926567", "0.61958355", "0.61856484", "0.612637", "0.6081935", "0.6073738", "0.60296804", "0.60296804", "0.6007532", "0.59884167", "0.59708714", "0.59...
0.64338857
8
=begin Visitorvisit_Text(text, rest) callback method. =end
def visit_Text(text, *rest) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def text(string); end", "def text(string); end", "def parse_text(text)\n\n end", "def parse(text); end", "def _test_text ; process_test_case(\"text\") ; end", "def text(str); end", "def text text\n end", "def scrape_text\n\n end", "def text(node); end", "def text(node); end", "def text; ...
[ "0.6740885", "0.6740885", "0.6739284", "0.668873", "0.6591286", "0.65300506", "0.6448071", "0.6384385", "0.6306698", "0.6306698", "0.6297037", "0.6297037", "0.6297037", "0.6297037", "0.6297037", "0.6297037", "0.6297037", "0.6297037", "0.6297037", "0.6297037", "0.6297037", "...
0.8298478
0
=begin Visitorvisit_CDATASection(text, rest) callback method. =end
def visit_CDATASection(text, *rest) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cdata_section(content); end", "def cdata content\n end", "def cdataSection(content)\n\t finishStartTag() if @inStartTag\n\t @io << \"<![CDATA[#{content}]]>\"\n\t @io << \"\\n\" if @prettify\n\tend", "def cdata_section(content)\n splitted = content.to_s.gsub(/\\]\\]\\>/, \"]]]]><![CDATA[>...
[ "0.82720363", "0.75243574", "0.7274025", "0.72292084", "0.72292084", "0.7021724", "0.69789386", "0.69789386", "0.69751936", "0.69695437", "0.69695437", "0.6869381", "0.68058866", "0.6691257", "0.66849077", "0.66849077", "0.66840285", "0.6612216", "0.6497127", "0.649703", "0.6...
0.9156104
0
=begin Visitorvisit_Comment(comment, rest) callback method. =end
def visit_Comment(comment, *rest) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def com...
[ "0.75815034", "0.75815034", "0.75815034", "0.75815034", "0.75815034", "0.75815034", "0.75815034", "0.75815034", "0.75815034", "0.75815034", "0.75815034", "0.75815034", "0.75815034", "0.75815034", "0.75815034", "0.75815034", "0.75815034", "0.7418291", "0.71764255", "0.71764255",...
0.85658765
0
=begin Visitorvisit_ProcessingInstruction(pi, rest) callback method. =end
def visit_ProcessingInstruction(pi, *rest) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_processing_instruction(target, data)\n end", "def processing_instruction(data)\n end", "def processing_instruction?; end", "def processing_instruction?; end", "def processing_instruction(name, content); end", "def processing_instruction(name, content); end", "def process_instruction an...
[ "0.7488859", "0.7421297", "0.7155841", "0.7155841", "0.7028472", "0.7028472", "0.67809635", "0.623076", "0.61268675", "0.6054787", "0.6041234", "0.6041234", "0.6041234", "0.6041234", "0.6041234", "0.6041234", "0.6041234", "0.6041234", "0.59848267", "0.59848267", "0.5955977", ...
0.8927148
0
=begin Nodeaccept_name(visitor, rest) call back visit_name_ method. =end
def accept_name(visitor, *rest) if nodeType == ELEMENT_NODE name_method = "visit_name_" + nodeName visitor.send(name_method, self, *rest) else self.accept(visitor, *rest) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accept(visitor); end", "def accept(visitor); end", "def visit_node(n); end", "def node(name, ref, *args, &block); end", "def accept visitor\n visitor.accept_raw self\n end", "def accept_visitor(visitor)\n visit_method_name = \"visit#{basename(self.class.name.to_s.gsub(/::/,...
[ "0.7257669", "0.7257669", "0.690859", "0.685344", "0.6722121", "0.6650139", "0.6637037", "0.6632704", "0.6612784", "0.66025794", "0.65983033", "0.65983033", "0.65983033", "0.6570261", "0.63690984", "0.6343887", "0.6337426", "0.6326278", "0.6325058", "0.6319337", "0.6221154", ...
0.8343741
0
=begin Nodechildren_accept(visitor, rest) for each children, call back visit_ methods. =end
def children_accept(visitor, *rest) ret = [] @children && @children.each { |node| ret.push(node.accept(visitor, *rest)) } ret end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_child_nodes(node); end", "def visit_all(&block)\n visit &block\n children.each {|c| c.visit_all &block}\n end", "def children_accept_name(visitor, *rest)\n ret = []\n @children && @children.each { |node|\n ret.push(node.accept_name(visitor, *rest))\n }\n ...
[ "0.7770953", "0.7741194", "0.73503846", "0.7129767", "0.7129767", "0.6966106", "0.6958754", "0.6912116", "0.6850443", "0.6842564", "0.6842564", "0.68303275", "0.6758063", "0.6711184", "0.66411674", "0.66105205", "0.65911484", "0.65795934", "0.654258", "0.651908", "0.65059495"...
0.83780724
0
=begin Nodechildren_accept_name(visitor, rest) for each children, call back visit_name_ method. =end
def children_accept_name(visitor, *rest) ret = [] @children && @children.each { |node| ret.push(node.accept_name(visitor, *rest)) } ret end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accept_name(visitor, *rest)\n if nodeType == ELEMENT_NODE\n name_method = \"visit_name_\" + nodeName\n visitor.send(name_method, self, *rest)\n else\n self.accept(visitor, *rest)\n end\n end", "def process_child_nodes(node); end", "def children_accept(vi...
[ "0.74253464", "0.7320825", "0.7189975", "0.67318594", "0.6596394", "0.63730013", "0.63730013", "0.6353029", "0.6353029", "0.63477254", "0.63407755", "0.6333198", "0.6258151", "0.6258151", "0.6258151", "0.6258151", "0.6258151", "0.6258151", "0.6258151", "0.6258151", "0.6258151...
0.84516877
0
Aliases to work with AppgenOrderLineitem
def part_number productnum end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def special_list_item_line(text)\n end", "def to_order_line\n OrderLine.new(\n product_id: 0,\n product_sku: SKU,\n product_name: name,\n product_price: price_adjustment,\n vat_amount: tax_adjustment\n )\n end", "def to_order_line\n OrderLine.new(\n product_id: produc...
[ "0.60557425", "0.60534054", "0.59845644", "0.59675914", "0.595825", "0.5940981", "0.59378344", "0.5885379", "0.5885379", "0.58661914", "0.5844995", "0.5831508", "0.5827015", "0.58091605", "0.5776419", "0.5771726", "0.5738429", "0.5711271", "0.57045144", "0.56737083", "0.56737...
0.0
-1
recupere, stocke, et retourne l'image de la serie
def retrieve_for(myserie) myserie = myserie.downcase path = banner_path(myserie) if path && File.exists?(path) && (File.size(path)>100) @seriesBanners[myserie] ||= OSX::NSImage.alloc.initWithContentsOfFile_(path) else # Recherche sur TheTVdb monURL = "http://www.thetvdb.com/api/GetSeries.php?seriesname...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_image \n image = CARMD.image(self.vin)\n if image == \"\"\n image = \"http://clipart-library.com/img/2050778.png\"\n end\n self.auto_image = image \n self.save \n end", "def image; end", "def fetch_image(host,old_file,new_file)\n\t`rm #{old_file}` \n\t`mv #{new_file} ...
[ "0.6814711", "0.6789708", "0.66831034", "0.66134554", "0.66134554", "0.659972", "0.658629", "0.65169674", "0.65169674", "0.6465641", "0.64101386", "0.64006203", "0.6393553", "0.6304339", "0.62997824", "0.6293261", "0.62892646", "0.62611395", "0.62383014", "0.6194694", "0.6191...
0.0
-1
edit the user's basic info
def edit @title = "Edit basic info" @user=User.find(session[:user_id]) if param_posted?(:user) attribute = params[:attribute] case attribute when "email" try_to_update @user, attribute when "password" if @user.correct_password?(params) try_to_updat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_info\n\t\t\"name: #{name} \\n\"+\n\t\t\"email: #{email}\"\n\t\t\t\n\tend", "def edit_info(params, userid)\n db = connect()\n db.execute('UPDATE users SET Info=? WHERE Id=?', params[\"info\"], userid)\n end", "def edit\n @update_welcome = 'You have accessed the update page'\n @us...
[ "0.69239205", "0.67918605", "0.6741881", "0.65900123", "0.65900123", "0.6587715", "0.6475328", "0.6373772", "0.6360519", "0.63516665", "0.63318175", "0.63169575", "0.6311486", "0.63110006", "0.6276878", "0.6271588", "0.62693805", "0.62679464", "0.6237865", "0.6237824", "0.623...
0.73959386
0
register.rhtml register a new account
def register @title="Register" if param_posted?(:user) #output goes to log file (log/development.log in development mode) #logger.info params[:user].inspect #output goes to browser #raise params[:user].inspect @user=User.new(params[:user]) if @user.save ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def registration(login, pass, first_name, last_name)\n visit(HomePage)\n on(HomePage).register_element.when_visible($WT).click\n on(RegisterPage).user_login_element.when_visible($WT).send_keys login\n on(RegisterPage).user_password = pass\n on(RegisterPage).user_password_confirmation = pass\n on(...
[ "0.7147916", "0.68630105", "0.68156767", "0.6687383", "0.6633598", "0.66077894", "0.66077894", "0.6598098", "0.65888244", "0.65828294", "0.6555367", "0.6539228", "0.6539228", "0.6539228", "0.64874595", "0.6458018", "0.64482903", "0.64113", "0.6407832", "0.64074874", "0.639036...
0.6150938
42
login.rhtml log into the system
def login @title="Log in to Design Pad" if request.get? @user=User.new(:remember_me=>remember_me_string) elsif param_posted?(:user) @user=User.new(params[:user]) user=User.find_by_screen_name_and_password(@user.screen_name, @user.password) if user user.login!(session) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_login page\n page = page.form_with(action: \"/login\") do |f|\n f.userid = @@username\n f.password = @@password\n end.click_button \n end", "def do_login page\n page = page.form_with(action: \"/login\") do |f|\n f.userid = @@username\n f.password = @@pass...
[ "0.8070379", "0.8070379", "0.8015007", "0.79686993", "0.7870071", "0.7870071", "0.7870071", "0.7870071", "0.7870071", "0.7870071", "0.7870071", "0.7870071", "0.7870071", "0.7834781", "0.78316677", "0.7758631", "0.7758631", "0.7755656", "0.7726108", "0.76921666", "0.7583322", ...
0.0
-1
log out of the system
def logout User.logout!(session,cookies) flash[:notice]="Logged out" redirect_to :action=>"index", :controller=>"site" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_out\n\t\t# current_user.delete_auth_token # won't work with curl, but html is good\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend", "def log_out\n\t \tsession.delete(:user_id)\n\t \t@current_user =nil\n\t end", "def log_out\n reset_session\n @current_user = nil\n end", "def l...
[ "0.8267434", "0.8250633", "0.8245424", "0.82112014", "0.8190073", "0.815408", "0.815408", "0.815408", "0.815408", "0.815339", "0.8143382", "0.81389457", "0.81337035", "0.81213564", "0.8110642", "0.81088424", "0.80937225", "0.80743027", "0.80743027", "0.80743027", "0.80743027"...
0.0
-1
redirect to the previously requested URL (if present)
def redirect_to_forwarding_url if(redirect_url=session[:protected_page]) session[:protected_page]=nil redirect_to redirect_url else redirect_to :action=>"index" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def redirect(url); end", "def redirect(location, status = '302'); request.redirect(location, status); end", "def redirect?; end", "def redirect(url)\n headers['Location'] = url\n self.status = 302\n raise FinishRequest\n end", "def redirect_to(url)\n check_already_rende...
[ "0.7772974", "0.7523316", "0.74459755", "0.7381173", "0.732043", "0.7291348", "0.7249878", "0.71947867", "0.71895796", "0.7179712", "0.7175822", "0.7164299", "0.7150925", "0.7106916", "0.7095301", "0.70760167", "0.70275676", "0.7024603", "0.70200336", "0.70200336", "0.7008778...
0.0
-1
returns the remember me string
def remember_me_string cookies[:remember_me]||"0" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remember_me_string\n cookies[:remember_me] || \"0\"\n end", "def remember_me_string\n cookies[:remember_me] || \"0\"\n end", "def remember_me\n remember_me_for REMEMBER_ME_TIME\n end", "def remember_me; end", "def remember_me?; end", "def remember_me\n remember_me_for(14)\n end", ...
[ "0.8087147", "0.8087147", "0.7747948", "0.7619873", "0.752617", "0.7493425", "0.74726236", "0.7341357", "0.72525537", "0.72200114", "0.7214148", "0.72092044", "0.72085845", "0.72085845", "0.72085845", "0.72085845", "0.72085845", "0.72085845", "0.72085845", "0.72085845", "0.72...
0.81014997
0