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
rubocop:disable Metrics/MethodLength rubocop:disable Metrics/AbcSize
def set_series(*args) if args.empty? matches = to_s.match(/^(.*)Metrics$/) @series = if matches.nil? superclass.respond_to?(:series) ? superclass.series : to_s.underscore else matches[1].split("::").join("_").underscore end ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def probers; end", "def implementation; end", "def implementation; end", "def refutal()\n end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def schubert; end", "def offences_by; end", "def strategy; end", "def used?; end", "def custo...
[ "0.76538837", "0.62887454", "0.62282014", "0.62282014", "0.61805004", "0.6156519", "0.6156519", "0.6156519", "0.6156519", "0.612837", "0.59572196", "0.5944528", "0.5892693", "0.5819787", "0.5819787", "0.5808322", "0.5808322", "0.58052987", "0.5795088", "0.57326925", "0.568785...
0.0
-1
rubocop:enable Metrics/MethodLength rubocop:enable Metrics/AbcSize
def all if current_scope current_scope.clone else default_scoped end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def probers; end", "def implementation; end", "def implementation; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def schubert; end", "def refutal()\n end", "def offences_by; end", "def used?; end", "def custom; end", "def custom;...
[ "0.77377087", "0.64517444", "0.63303995", "0.63303995", "0.62600356", "0.62600356", "0.62600356", "0.62600356", "0.6257051", "0.62275654", "0.59952784", "0.59768265", "0.59625435", "0.59625435", "0.59461933", "0.59388083", "0.59029776", "0.59029776", "0.5872845", "0.5845591", ...
0.0
-1
rubocop:disable Metrics/MethodLength rubocop:disable Metrics/AbcSize rubocop:disable Metrics/CyclomaticComplexity
def quoted_series(val = @series, instance = nil, write: false) case val when Regexp val.inspect when Proc quoted_series(val.call(instance), write: write) when Array if val.length > 1 "merge(#{val.map { |s| quoted_series(s, write: write) }.join(",...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def implementation; end", "def implementation; end", "def probers; end", "def refutal()\n end", "def schubert; end", "def strategy; end", "def offences_by; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def used?; end", "def inten...
[ "0.73515147", "0.6092936", "0.6092936", "0.6028529", "0.58965534", "0.58934176", "0.5822249", "0.5782098", "0.57795554", "0.57795554", "0.57795554", "0.57795554", "0.57372355", "0.5639051", "0.5633608", "0.5633608", "0.56016904", "0.559811", "0.559037", "0.559037", "0.5575397...
0.0
-1
Returns hash with metrics values
def values @attributes.reject { |k, _| tag_names.include?(k.to_s) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def metrics\n with_stats_lock do\n @stats_hash.keys.map { |spec| spec.to_s }\n end\n end", "def build_metrics\n {}\n end", "def get_metrics_hash(messages)\n metrics = []\n messages.each do |m|\n metric = m['metrics']\n if metric != nil\n ...
[ "0.7580891", "0.7511891", "0.73224", "0.73224", "0.7067848", "0.6955051", "0.6955051", "0.6853955", "0.68221813", "0.6790887", "0.6745986", "0.67432046", "0.67237395", "0.6720938", "0.67102414", "0.6585942", "0.6551239", "0.65298295", "0.64868075", "0.6471072", "0.645852", ...
0.0
-1
Returns hash with metrics tags
def tags @attributes.select { |k, _| tag_names.include?(k.to_s) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash\n [monitor_tags].hash\n end", "def tags\n @meta.merge(@metrics)\n end", "def metrics\n with_stats_lock do\n @stats_hash.keys.map { |spec| spec.to_s }\n end\n end", "def get_metrics_hash(messages)\n metrics = []\n messages.each do |m|\...
[ "0.74700755", "0.7164027", "0.6850348", "0.6704482", "0.6704482", "0.6437637", "0.6436002", "0.63952994", "0.6388523", "0.61376905", "0.6131667", "0.60784864", "0.60587406", "0.60378623", "0.6022478", "0.59839296", "0.5964814", "0.59604895", "0.594124", "0.5921417", "0.591357...
0.0
-1
=begin explain As with HTML files, this is the default implicit behavior. all_photos is found in app/controllers/application.rb =end
def index() @photos = all_photos() end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n\t@photos = Photo.all\n\tend", "def index\n # byebug\n @photos = Photo.all\n end", "def index\n @photos = Photo.all\n end", "def index\n if params[:all] == 'true'\n @photos = Photo.all\n else\n @photos = Photo.paginate(:page => params[:page], :per_page => 50)\n en...
[ "0.7127297", "0.7034264", "0.700839", "0.699742", "0.69688374", "0.69688374", "0.69688374", "0.69688374", "0.69688374", "0.69688374", "0.69688374", "0.69688374", "0.69688374", "0.68627155", "0.6822864", "0.68141097", "0.67961603", "0.6785008", "0.6775519", "0.6768301", "0.674...
0.76123315
0
=begin explain Set up any instance variables to be used in the View
def show() @photo = Photo.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def define_variables\n\t\tfname= \"#{self.class.name}.#{__method__}\"\n\t\tLOG.debug(fname) {\">>>>params=#{params.inspect}\"}\n\t\t@views = View.all\n\t\t@current_user= current_user\n\t\t@clipboard = session[:clipboard] ||= Clipboard.new\n\t\t#LOG.info(fname) {\"**** clipboard=#{@clipboard.inspect}\"}\n\t\t@...
[ "0.7024115", "0.6689148", "0.66524714", "0.6563936", "0.6559593", "0.65382975", "0.65191203", "0.651511", "0.651511", "0.6487424", "0.64690167", "0.6425792", "0.63388294", "0.6338721", "0.6328882", "0.6319841", "0.6313282", "0.6260971", "0.6236565", "0.6236565", "0.6220359", ...
0.0
-1
Declare a list of attributes for this resource.
def attributes(*args) args.each do |attr| attribute(attr) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attributes\n @attributes ||= []\n @attributes\n end", "def attributes\n @attributes ||= []\n end", "def list_of_attributes\n @list_of_attributes ||= []\n end", "def attributes(*attrs)\n if attrs.size > 0\n attrs.each{|attr| attribute attr}\n ...
[ "0.7105253", "0.7059382", "0.7033397", "0.6850828", "0.67640996", "0.6641084", "0.66316414", "0.66245806", "0.6616283", "0.66117793", "0.6575951", "0.6558878", "0.6509841", "0.6501138", "0.64957595", "0.64791435", "0.64657813", "0.6455758", "0.6455758", "0.6455758", "0.642682...
0.61691505
52
Creates card brand select field options
def card_options(payment) options = options_for_select(Payment::card_brands.map {|k, v| [k.humanize, card_values(k)] }, payment.card_brand) "<option disabled=\"disabled\"#{ 'selected="selected"' unless payment.card_brand}>-- Choose --</option>".html_safe + options end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def credit_card_brand_options\n SUPPORTED_CARDTYPES.map { |brand| [I18n.t(brand, scope: 'activemerchant.credit_card.brand'), brand] }\n end", "def fetch\n @brands = {}\n\n document.css('select[name*=maker]').last.css('option').each do |option|\n brand_name = option.text.strip\n brand_id = o...
[ "0.64465666", "0.62634456", "0.62109625", "0.5991791", "0.5989569", "0.5934253", "0.5898884", "0.5856738", "0.57214814", "0.56830066", "0.56632876", "0.563504", "0.56113786", "0.5597028", "0.5556275", "0.5554866", "0.5517517", "0.54874116", "0.54874116", "0.5485555", "0.54842...
0.6754837
0
Payments stage item HTML.
def payment_stage_item(value, selected=false, completed=false) if selected content_tag(:li, class: 'list-group-item active') do concat(content_tag(:div, class: 'row') do concat(content_tag(:div, class: 'col-xs-10') do concat(value) end) concat(content_tag(:div...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_item\n return \"Title: #{@title}; Description: #{@description}; Is Done: #{@is_done}; Due Date: #{@due_date}\"\n end", "def payments_json_response\n {\n key: 'payments',\n type: 'async',\n html: render_to_string(formats: ['html'], layout: false)\n }\n end", "def printItem\n ...
[ "0.56503993", "0.5444094", "0.5437202", "0.5354136", "0.53536254", "0.5301336", "0.5152572", "0.5137858", "0.511543", "0.5115105", "0.5108432", "0.51016927", "0.50957274", "0.50778025", "0.5072045", "0.5058669", "0.5035527", "0.5027029", "0.5021207", "0.5016051", "0.4997256",...
0.6635378
0
Registrar un nuevo libro.
def registro(isbn, titulo, autor, precio, unidades) nuevo = Libro.new(isbn,titulo,autor,precio,unidades) @libros.push(nuevo) VistaLibreria.muestra_mensaje("Se ha agregado el libro: \n#{nuevo.to_s}") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nuevo\n\tend", "def create\n @libro = Libro.new(params[:libro])\n\n respond_to do |format|\n if @libro.save\n\t\tguardar_log(session[:usuario_id], self.class.name,__method__.to_s, @libro,nil )\n format.html { redirect_to @libro, :notice => 'Libro creado exitosamente.' }\n format.json...
[ "0.58754474", "0.5832877", "0.55688083", "0.5524219", "0.5470443", "0.53869665", "0.53490597", "0.5310753", "0.5309584", "0.5307973", "0.5306709", "0.5301252", "0.52993554", "0.52993554", "0.52993554", "0.52472275", "0.52470756", "0.52408427", "0.5235199", "0.52137876", "0.52...
0.610722
0
Editar un libro por su autor.
def editar_autor(autor, isbn) libro = busca_libro(isbn) if libro @libros.delete(libro) libro.autor = autor @libros.push(libro) else VistaLibreria.muestra_mensaje("No se encuentra el libro.") end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_libro\n @libro = Libro.find(params[:id])\n end", "def update\n @libro = Libro.find(params[:id])\n\t@temp = @libro.dup\n respond_to do |format|\n if @libro.update_attributes(params[:libro])\n\t\tguardar_log(session[:usuario_id], self.class.name,__method__.to_s, @temp,@libro )\n\n ...
[ "0.6415013", "0.63711435", "0.616383", "0.602441", "0.59118795", "0.58518606", "0.5803579", "0.5796532", "0.57601446", "0.57564944", "0.57093894", "0.5697818", "0.5677082", "0.5637476", "0.56108373", "0.5591969", "0.55865693", "0.5584418", "0.55833536", "0.5563268", "0.555808...
0.7030826
0
Editar un libro por su precio.
def editar_precio(precio, isbn) libro = busca_libro(isbn) if libro @libros.delete(libro) libro.precio = precio @libros.push(libro) else VistaLibreria.muestra_mensaje("No se encuentra el libro.") end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_libro\n @libro = Libro.find(params[:id])\n end", "def update\n respond_to do |format|\n if @libro_compra.update(libro_compra_params)\n format.html { redirect_to @libro_compra, notice: 'Libro compra was successfully updated.' }\n format.json { render :show, status: :ok, locat...
[ "0.6521108", "0.6428345", "0.64190215", "0.6376638", "0.62338483", "0.61997163", "0.60504544", "0.6037173", "0.5980447", "0.59392416", "0.5923429", "0.5905012", "0.58882517", "0.5872029", "0.5871094", "0.5827674", "0.5810538", "0.58047676", "0.58036053", "0.5776108", "0.57710...
0.75033665
0
Muestra todos los libros.
def ver_libros cadena = "\n" num_registros = 0 for libro in @libros cadena += "#{libro.to_s}\n" num_registros += 1 end cadena += "\nNúmero de registros: #{num_registros}\n" VistaLibreria.muestra_mensaje(cadena) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def libs; end", "def index\n @libr_libros = LibrLibro.all\n end", "def listar\n @todos_los_tipos = TipoComida.all.order(id: :asc)\n @titulo_link = \"Registrar nuevo tipo de comida\"\n end", "def index\n @libro_compras = LibroCompra.all\n end", "def generate_libraries_list\n librar...
[ "0.6255715", "0.6086659", "0.58471555", "0.5793461", "0.5742019", "0.56983083", "0.56331587", "0.55687636", "0.5420736", "0.5375837", "0.53659254", "0.536503", "0.5364624", "0.53406274", "0.5338012", "0.5307446", "0.52504486", "0.5248847", "0.5245704", "0.5239885", "0.5239804...
0.6431175
0
Busca un libro por ISBN y lo regresa; nil si no se encuentra.
def busca_libro(isbn) for libro in @libros if libro.isbn == isbn return libro end end return nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isbn\n generate_barcode('barcode.isbn')\n end", "def isbn\n @isbn\n end", "def isbn\n @isbn\n end", "def isbn\n @isbn\n end", "def isbn\n return nil unless @marc_record.fields('020')\n isbns = @marc_record.fields('020').map do |field|\n StdNum::ISBN.normalize(fiel...
[ "0.6816232", "0.66654825", "0.6619426", "0.6619426", "0.65704894", "0.6536924", "0.6513609", "0.63084775", "0.6283416", "0.61480063", "0.6100415", "0.5995745", "0.59618485", "0.5935673", "0.5920771", "0.5886908", "0.58650035", "0.584043", "0.5835047", "0.5822003", "0.58215576...
0.7607239
0
method for adding new items to the list (array)
def add_item(name) todo_items.push(TodoItem.new(name)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_item(array, item)\n\tarray.push(item)\nend", "def add_item(item)\r\n \t@arr.push(item)\r\n end", "def add_item(array, item)\n\tarray << item\nend", "def add_item(item)\r\n @list << item \r\n end", "def add_item(current_list, item_added, quantity)\n current_list[item_added] = quantity...
[ "0.7616595", "0.75961334", "0.7556704", "0.750138", "0.74797326", "0.7461416", "0.7442647", "0.7442647", "0.7442647", "0.74138314", "0.74091095", "0.73690534", "0.7340051", "0.7325142", "0.72446775", "0.7232277", "0.72131735", "0.71859825", "0.7181343", "0.7159844", "0.715468...
0.0
-1
method to remove items from the list based on index
def remove_item(name) if index = find_index(name) todo_items.delete_at(index) return true else return false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_item_at(index)\n @list.slice!(index)\n end", "def remove_by_index(index)\n @items.delete_at(index-1)\n end", "def delete_item(idx, list)\n list.reject! { |item| item[:idx] == idx }\n end", "def delete_at_index(index)\n @list.delete_at(index)\n end", "def remove_at(idx)\n @todo...
[ "0.86187303", "0.85153526", "0.7831604", "0.77992594", "0.7744305", "0.7725194", "0.7703769", "0.7279188", "0.7229984", "0.72274935", "0.72274935", "0.7220888", "0.72089803", "0.709878", "0.7024915", "0.7020217", "0.7004998", "0.6992357", "0.69900537", "0.69868016", "0.697793...
0.0
-1
method for setting items status from incomplete to complete based on methods from todoitem.rb
def set_complete(name) if index = find_index(name) todo_items[index].set_complete! return true else return false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_completed\n uncompleted_items = todo_list_items.select { |e| !e.completed? }\n update(completed: true) if uncompleted_items.zero?\n end", "def update_complete\n # checks to see if the Item's :complete attribute is true\n if self.complete\n # if complete is arleady true, then update i...
[ "0.7555845", "0.7482661", "0.72162235", "0.6852941", "0.6807052", "0.67168045", "0.665708", "0.66062737", "0.65914774", "0.6574849", "0.6536328", "0.65213394", "0.6476054", "0.64538896", "0.64340824", "0.641562", "0.6401587", "0.63902247", "0.6317928", "0.6315552", "0.6311897...
0.6021565
36
method for finding index based on item name and using it in methods above
def find_index(name) index = 0 found = false todo_items.each do |item| if item.name == name found = true end if found break else index += 1 end end if found return index else return nil end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_position (item)\r\n position = 0\r\n self.items.each_with_index {|val, index|\r\n if (val.get_name == item.get_name)\r\n position = index\r\n end\r\n }\r\n return position\r\n end", "def index_for_item(item)\n for x in INVENTORY\n if x.has_value?(item)\n ...
[ "0.7488612", "0.7451563", "0.7135383", "0.7107224", "0.7066274", "0.7052211", "0.70460737", "0.70082796", "0.69588614", "0.6950582", "0.6860259", "0.68224895", "0.6796903", "0.6754362", "0.65729403", "0.6555108", "0.6555108", "0.65090036", "0.64317906", "0.641272", "0.6394697...
0.7375023
2
method for printing items based on the argument. If default value is set to all it will print all the items. output is alreay properly formatted thanks to redefining "to_s" method in todoitems.rb
def print_list(type='all') puts "{#name} List - #{type} items" print '-' * 30 + "\n" todo_items.each do |item| case type when 'all' puts item when 'complete' puts item if item.complete? when 'incomplete' puts item unless item.complete? end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_items\n @items.each { |item| print \"#{item} \"}\n puts \"\\n\"\n end", "def print_item\n return \"Title: #{@title}; Description: #{@description}; Is Done: #{@is_done}\"\n end", "def output_for items\n output = \"\"\n items.each_with_index do |item, position|\n output += \...
[ "0.7291157", "0.71397084", "0.7099912", "0.697936", "0.69340265", "0.6921471", "0.6909701", "0.68751943", "0.6861936", "0.6780423", "0.67720485", "0.6761932", "0.6757403", "0.6746534", "0.67401", "0.67371404", "0.672425", "0.67227626", "0.6702366", "0.6688429", "0.66871667", ...
0.68964165
7
Check for a _posts directory in current directory If we don't find one, puke an error message and die
def ensure_jekyll_dir unless File.exists?('./_posts') puts 'ERROR: Cannot locate _posts directory. Double check to make sure' puts ' that you are in a jekyll directory.' exit end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def posts\n Dir[\"#{posts_dir}/**\"].select {|e| e !~ /~$/ }\n end", "def are_sub_contents_posts?\n ret_val = true\n\n if @is_post\n ret_val = false\n else\n sub_directories = Dir.glob(@absolute_path + '*')\n\n sub_directories.each do |sub_directory|\n if File.exists?(sub_direc...
[ "0.6382393", "0.6350656", "0.6204378", "0.6035286", "0.59058136", "0.5608941", "0.555863", "0.55374336", "0.5523806", "0.54779303", "0.54566664", "0.5430505", "0.5419574", "0.5366474", "0.53659225", "0.53621495", "0.53347045", "0.5332717", "0.5331586", "0.5309024", "0.5302637...
0.75629824
0
Get a layout as a string. If layout_path is nonnil, will open that file and read it, otherwise will return a default one, and a file extension to use
def get_layout(layout_path) if layout_path.nil? contents = "---\n" contents << "title:\n" contents << "layout: post\n" contents << "date:\n" contents << "---\n" ext = nil else begin contents = File.open(layout_path, "r").read() ex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_layout(tpl)\n layout = \"#{tpl}_layout\"\n return layout if File.exists?(self.get_tpl_file(layout))\n\n items = tpl.split(/\\//)\n items.pop\n items << 'layout'\n layout = File.join(*items)\n return layout if File.exists?(self.get_tpl_file(layout))\n\n ...
[ "0.69647217", "0.66263777", "0.66084963", "0.6327269", "0.6099094", "0.6068287", "0.6056639", "0.59459937", "0.5857571", "0.58037275", "0.5787543", "0.57822734", "0.57493496", "0.5583335", "0.55826443", "0.5556747", "0.5556747", "0.5544307", "0.55401045", "0.5494423", "0.5483...
0.8052503
0
Given a post title (mixed case, spaces, etc.), generates a slug for This clobbers any nonASCII text (TODO don't do that)
def get_slug_for(title) title.downcase.gsub(/[^a-z0-9_\s-]/, '').gsub(/\s+/, '-') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def jekyll_sluggify( title )\n\t\t\t\t\tbegin\n\t\t\t\t\t\trequire 'unidecode'\n\t\t\t\t\t\ttitle = title.to_ascii\n\t\t\t\t\trescue LoadError\n\t\t\t\t\t\tSTDERR.puts \"Could not require 'unidecode'. If your post titles have non-ASCII characters, they may not match up to what Jekyll created for you.\"\n\t\t\t\t\t...
[ "0.8223891", "0.7971504", "0.7964956", "0.7810978", "0.78010464", "0.77860683", "0.77802277", "0.7778103", "0.7721892", "0.76887083", "0.7681045", "0.7681045", "0.7652825", "0.7652825", "0.7588523", "0.7583092", "0.7536807", "0.7536807", "0.74670297", "0.7461373", "0.7362284"...
0.79648864
3
Print a usage message and exit
def gen_usage puts 'Usage:' puts ' poole [ACTION] [ARG]' puts '' puts 'Actions:' puts ' draft Create a new draft in _drafts with title SLUG' puts ' post Create a new timestamped post in _posts with title SLUG' puts ' publish Publish the draft with SLUG, timest...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_usage_and_exit\n puts usage\n exit\n end", "def usage\n\t\t$stderr.printf \"usage: %s [ options ]\\n\",$0\n\t\t$stderr.printf \"\\n%s\\n\",$help\n\t\texit 0\n\tend", "def usage message\n puts \"error: #{message}\" unless nil == message\n printf USAGE_MESSAGE, VERSION\n exit 1\nend", "def ...
[ "0.9092999", "0.8335488", "0.81790304", "0.81163985", "0.8105614", "0.8064064", "0.80618703", "0.80325806", "0.7956724", "0.7943992", "0.79058564", "0.7897798", "0.78870153", "0.78688717", "0.780968", "0.7797461", "0.7795682", "0.7787937", "0.7765402", "0.774269", "0.7715444"...
0.7006427
84
CREATING TABLE FOR /companies/:id/financial_reports
def financial_reports_table_hash(period_type) financial_reports = get_financial_reports(period_type) FinancialReport.statements_array.inject({}) do |the_hash, statement| the_hash[statement] = financial_statement_table_hash(statement, financial_reports) the_hash end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_fund_table\n Bsf::Scraper.db.create_fund_table\n end", "def create_fund_table\n @connection.create_table?(:funds) do\n primary_key :id\n String :symbol, :size=>255, :unique => true, :index => true\n String :name, :size=>255\n String ...
[ "0.68343174", "0.62796277", "0.6251527", "0.6163915", "0.6074938", "0.5990446", "0.5969986", "0.5969986", "0.59128386", "0.58517337", "0.58517337", "0.5782407", "0.57803357", "0.5731138", "0.5701869", "0.57010096", "0.56445044", "0.5641856", "0.5586709", "0.55768603", "0.5558...
0.57240736
14
cfs_kit_scr_extend_osk() Leftovers from OSK 1.7 that need to be migrated
def cfs_kit_launch_app(screen, app) if (app == "UPDATE_TUTORIAL") # An exception will report any errors if cfs_kit_create_tutorial_screen prompt ("Successfuly created tutorial screen file #{tutorial_scr_file}\nusing #{tutorial_def_file}") end elsif (app == "PROTO_APPP") #TODO...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use_technology_preview=(_arg0); end", "def use_technology_preview; end", "def keppler\n end", "def osd_select\n \n end", "def send_kexinit; end", "def send_kexinit; end", "def dev_minor() end", "def deprecated_key=(_arg0); end", "def initialize(info={})\n super(update_info...
[ "0.5870083", "0.58429796", "0.54348594", "0.54090685", "0.53714913", "0.53714913", "0.53455037", "0.52128917", "0.5147724", "0.5106596", "0.50821203", "0.5068395", "0.50569123", "0.5052079", "0.50253046", "0.501578", "0.49847925", "0.49622586", "0.49579424", "0.49327904", "0....
0.52078074
8
cfs_kit_launch_app() Create Tutorial Screen When OSK is first installed the tutorial screen has the wrong absolute address. Some user's ignore the instructions to run 'Update'. This function checks the absolute path used when the tutorial screen was created and if it doesn't match the current installation it creates a ...
def cfs_kit_launch_tutorial_screen tutorial_scr_file = "#{Osk::SCR_DIR}/#{Osk::TUTORIAL_SCR_FILE}" scr_tutorial_dir = File.open(tutorial_scr_file) {|f| f.readline} if scr_tutorial_dir.index(Osk::SCR_DIR).nil? cfs_kit_create_tutorial_screen end display("CFS_KIT #{File.basename(Osk::TUTORIAL_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cfs_kit_launch_tutorial_screen\r\n\r\n tutorial_scr_file = \"#{Osk::SCR_DIR}/#{Osk::TUTORIAL_SCR_FILE}\"\r\n\r\n scr_tutorial_dir = File.open(tutorial_scr_file) {|f| f.readline}\r\n\r\n if scr_tutorial_dir.index(Osk::SCR_DIR).nil? \r\n cfs_kit_create_tutorial_screen\r\n end\r\n \r\n display(\"...
[ "0.7047227", "0.6799887", "0.6312625", "0.5683806", "0.5117331", "0.5117081", "0.5091573", "0.5071202", "0.50421387", "0.5041749", "0.50334775", "0.50037736", "0.4999758", "0.49933016", "0.49809343", "0.49297255", "0.49196327", "0.48894623", "0.48880816", "0.4882863", "0.4872...
0.7007679
1
cfs_kit_create_tutorial_screen() Create Template Info Screen
def cfs_kit_create_about_screen(scr_title, scr_text) t = Time.new time_stamp = "_#{t.year}_#{t.month}_#{t.day}_#{t.hour}#{t.min}#{t.sec}" scr_header = " ############################################################################### # cfs_kit About Screen # # Notes: # 1. Do not edit this fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cfs_kit_launch_tutorial_screen\r\n\r\n tutorial_scr_file = \"#{Osk::SCR_DIR}/#{Osk::TUTORIAL_SCR_FILE}\"\r\n\r\n scr_tutorial_dir = File.open(tutorial_scr_file) {|f| f.readline}\r\n\r\n if scr_tutorial_dir.index(Osk::SCR_DIR).nil? \r\n cfs_kit_create_tutorial_screen\r\n end\r\n \r\n display(\"...
[ "0.643818", "0.64238906", "0.61315006", "0.6107219", "0.6050658", "0.6024875", "0.5998159", "0.587846", "0.5859735", "0.58516717", "0.5825569", "0.5809584", "0.57926947", "0.5772938", "0.57239896", "0.57140857", "0.56976986", "0.56976986", "0.5697451", "0.5692614", "0.5684421...
0.65750766
0
GET /labs GET /labs.json
def index @labs = Lab.all respond_to do |format| format.html # index.html.erb format.json { render json: @labs } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @labs = Lab.all\n end", "def index\r\n add_breadcrumb I18n.t(\"breadcrumbs.labs.index\"), :labs_path\r\n @labs = Lab.all\r\n end", "def show\n @lab = Lab.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lab }\n en...
[ "0.68424505", "0.6835846", "0.6737951", "0.64988154", "0.6454879", "0.64449835", "0.64421123", "0.6441235", "0.6127141", "0.6062376", "0.60447806", "0.60294753", "0.60082936", "0.5963696", "0.59546036", "0.59546036", "0.5953955", "0.593615", "0.5931641", "0.591133", "0.587247...
0.7686901
1
GET /labs/1 GET /labs/1.json
def show @lab = Lab.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @lab } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @labs = Lab.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @labs }\n end\n end", "def index\n @labs = Lab.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @labs }\n end\n end"...
[ "0.75375235", "0.75375235", "0.6833477", "0.67428744", "0.66953963", "0.6527355", "0.64995974", "0.64070094", "0.63880324", "0.62980556", "0.62978065", "0.6282627", "0.6282627", "0.6196041", "0.61834574", "0.6163575", "0.6151225", "0.61303586", "0.6087381", "0.60813165", "0.6...
0.7078284
2
GET /labs/new GET /labs/new.json
def new @lab = Lab.new respond_to do |format| format.html # new.html.erb format.json { render json: @lab } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @lab_name = LabName.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lab_name }\n end\n end", "def new\n @slab = Slab.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @slab }\n end...
[ "0.7568122", "0.73490804", "0.7259464", "0.70627356", "0.7049876", "0.701863", "0.69868845", "0.69805014", "0.69578904", "0.6917302", "0.6891832", "0.68875706", "0.6887092", "0.6870368", "0.68547934", "0.6850146", "0.68314946", "0.6822533", "0.6819413", "0.6815267", "0.681349...
0.77330077
1
POST /labs POST /labs.json
def create @lab = Lab.new(lab_params) respond_to do |format| if @lab.save format.html { redirect_to @lab, notice: 'Lab was successfully created.' } format.json { render json: @lab, status: :created, location: @lab } else format.html { render action: "new" } format.js...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @lab = Lab.new(params[:lab])\n\n respond_to do |format|\n if @lab.save\n format.html { redirect_to @lab, notice: 'Lab was successfully created.' }\n format.json { render json: @lab, status: :created, location: @lab }\n else\n format.html { render action: \"new\" }\...
[ "0.67121834", "0.665847", "0.62697726", "0.62697726", "0.62298447", "0.6156751", "0.6077629", "0.6077629", "0.6031846", "0.6028969", "0.60179347", "0.6012336", "0.5914132", "0.58833253", "0.5877887", "0.58514315", "0.5776183", "0.5754824", "0.575445", "0.57518077", "0.5749029...
0.6699216
1
PATCH/PUT /labs/1 PATCH/PUT /labs/1.json
def update @lab = Lab.find(params[:id]) respond_to do |format| if @lab.update_attributes(lab_params) format.html { redirect_to @lab, notice: 'Lab was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @lab = lab.find(params[:id])\n\n respond_to do |format|\n if @lab.update_attributes(params[:lab])\n format.html { redirect_to @lab, notice: 'lab was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n ...
[ "0.6858211", "0.68270236", "0.674772", "0.6624046", "0.6608778", "0.6607562", "0.6364369", "0.63320535", "0.63159513", "0.62616247", "0.62616247", "0.6254917", "0.6251117", "0.623803", "0.6162118", "0.6140363", "0.60523576", "0.6037896", "0.6012691", "0.6010296", "0.6001484",...
0.6720605
3
DELETE /labs/1 DELETE /labs/1.json
def destroy @lab = Lab.find(params[:id]) @lab.destroy respond_to do |format| format.html { redirect_to labs_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @lab = lab.find(params[:id])\n @lab.destroy\n\n respond_to do |format|\n format.html { redirect_to labs_url }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @lab.destroy\r\n respond_to do |format|\r\n format.html { redirect_to labs_url, notice: '...
[ "0.75275344", "0.7173708", "0.7102326", "0.70175236", "0.6999288", "0.6990463", "0.69212866", "0.6920853", "0.6906477", "0.6906477", "0.6906477", "0.6906477", "0.6903442", "0.6889526", "0.680736", "0.67610747", "0.67588174", "0.6730703", "0.672922", "0.6728227", "0.67079395",...
0.7366508
1
Use this method to whitelist the permissible parameters. Example: params.require(:person).permit(:name, :age) Also, you can specialize this method with peruser checking of permissible attributes.
def lab_params params.require(:lab).permit(:name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def strong_params\n params.require(:user).pe...
[ "0.77181417", "0.7674666", "0.7520783", "0.7153518", "0.71424246", "0.7116623", "0.7102097", "0.70787674", "0.7037799", "0.7006524", "0.7001505", "0.7001174", "0.7001174", "0.6951357", "0.6936865", "0.69358796", "0.69357884", "0.68820316", "0.6796145", "0.67353827", "0.670466...
0.0
-1
Returns a new URI instance by appending a signature parameter to the query of +url+. The method accepts that +url+ can be either a String or a URI instance. signed_url = UrlSigner.sign(' => The following key/value parameters can be given to +options+: :key the secret key used for encryption :hash_method the hash functi...
def sign(url, *options) temp_signer = UrlSigner::Signer.new(url, *options) temp_signer.sign end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uri_with_signature\n separator = if request_parser.query_params? then '&' else '?' end\n encoded_signature = signature.extend(UriSigner::Helpers::String).escaped\n \"%s%s_signature=%s\" % [self.uri, separator, encoded_signature]\n end", "def sign\n url.query = url.query.to_s + \"&S...
[ "0.73924035", "0.72182393", "0.7116048", "0.7037463", "0.69675523", "0.66606516", "0.6307766", "0.6068581", "0.6002811", "0.5965051", "0.5951918", "0.58883286", "0.5853043", "0.5830645", "0.57906663", "0.5786066", "0.5737136", "0.570539", "0.56953263", "0.5656101", "0.56457",...
0.74290234
0
Verify the authenticity of the +url+ by checking the value of the signature query parameter (if present). The method accepts that +url+ can be either a String or a URI instance. The following key/value parameters can be given to +options+: :key the secret key used for encryption :hash_method the hash function to pass t...
def valid?(url, *options) temp_verifier = UrlSigner::Verifier.new(url, *options) temp_verifier.valid? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def signature_valid?(*options)\n UrlSigner.valid?(self, *options)\n end", "def validate(url, params, signature)\r\n params_hash = params.to_unsafe_h\r\n expected = build_signature_for(url, params_hash)\r\n ActiveSupport::SecurityUtils.secure_compare(expected, signature)\r\n end", "def...
[ "0.77125525", "0.7103224", "0.70420367", "0.6974528", "0.6627049", "0.6283571", "0.62426805", "0.61863434", "0.6127432", "0.5939486", "0.59171313", "0.5897863", "0.5896656", "0.58576316", "0.5838041", "0.5814186", "0.5814186", "0.5814186", "0.5788036", "0.57774836", "0.577748...
0.79219306
0
< HERE: Change this line, options are: 'local', develop', 'master' or 'feature' METHODS Use this funcion to compile PRIVATE pods as development in local
def local_pods color(32) { puts "Installing Local Pods..." } pod 'BasicCommons', :path => '../../BasicCommons/' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def feature_pods\n ### ONLY FOR DEVELOP PURPOSES ###\n feature_branch = \"develop\" # <- HERE: Change this line to setup ALL the pods repository from another branch WHEN pods_environment = \"develop\"\n ### ONLY FOR DEVELOP PURPOSES ###\n\n color(32) { puts \"Installing Develop Pods from branch: #{feat...
[ "0.720012", "0.7079517", "0.6776322", "0.6734557", "0.65750897", "0.6557752", "0.6527504", "0.63957596", "0.6357099", "0.6275952", "0.6134445", "0.61325717", "0.60697174", "0.6022967", "0.6002495", "0.5994354", "0.5925482", "0.5880423", "0.58455175", "0.58391833", "0.5819286"...
0.61703354
10
Use this funcion to compile feature pods as development in featue
def feature_pods ### ONLY FOR DEVELOP PURPOSES ### feature_branch = "develop" # <- HERE: Change this line to setup ALL the pods repository from another branch WHEN pods_environment = "develop" ### ONLY FOR DEVELOP PURPOSES ### color(32) { puts "Installing Develop Pods from branch: #{feature_branch}" } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def feature_pods\n ### ONLY FOR DEVELOP PURPOSES ###\n feature_branch = \"master\" # <- HERE: Change this line to setup ALL the pods repository from another branch WHEN pods_environment = \"develop\"\n ### ONLY FOR DEVELOP PURPOSES ###\n\n color(32) { puts \"Installing Develop Pods from branch: #{featu...
[ "0.74366677", "0.6684903", "0.6514013", "0.64914936", "0.63222075", "0.6124475", "0.6083138", "0.60660297", "0.60348153", "0.5913984", "0.58867896", "0.588218", "0.58572984", "0.58206767", "0.5755302", "0.5725741", "0.5717455", "0.56784356", "0.56735915", "0.56155133", "0.559...
0.7285655
1
Use this funcion to compile develop pods as development in develop
def develop_pods color(32) { puts "Installing Develop Pods..." } pod 'BasicCommons', :git => 'git@github.com:kevinOlivet/BasicCommons.git', :branch => 'develop' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def develop_pods\n color(32) { puts \"Installing Develop Pods...\" }\n pod 'BasicCommons', :git => 'git@github.com:kevinOlivet/BasicCommons.git', :branch => 'develop'\n pod 'BasicUIElements', :git => 'git@github.com:kevinOlivet/BasicUIElements.git', :branch => 'develop'\n pod 'CuotasModule', :git => 'g...
[ "0.7476234", "0.6830111", "0.68290895", "0.6793608", "0.6661779", "0.66341096", "0.6545592", "0.65371716", "0.6450044", "0.64125735", "0.6237869", "0.6208128", "0.61667", "0.6096555", "0.60846317", "0.6082091", "0.60314345", "0.6018655", "0.5996751", "0.5978746", "0.59699756"...
0.71147573
1
Use this funcion to compile master pods as development in master
def master_pods color(32) { puts "Installing Develop Pods..." } pod 'BasicCommons', :git => 'git@github.com:kevinOlivet/BasicCommons.git', :branch => 'master' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def master_pods\n color(32) { puts \"Installing Develop Pods...\" }\n pod 'BasicCommons', :git => 'git@github.com:kevinOlivet/BasicCommons.git', :branch => 'master'\n pod 'BasicUIElements', :git => 'git@github.com:kevinOlivet/BasicUIElements.git', :branch => 'master'\n pod 'CuotasModule', :git => 'git@...
[ "0.72904056", "0.68047255", "0.6772909", "0.666348", "0.65708846", "0.6472483", "0.6430266", "0.6251782", "0.6113424", "0.5883425", "0.587933", "0.5830139", "0.5760949", "0.57446724", "0.5727344", "0.57221544", "0.57171315", "0.57149386", "0.5694726", "0.5691412", "0.56864715...
0.70547014
1
Stores translations for the given locale in memory.
def store_translations(locale, data, options = {}) locale = locale.to_sym translations[locale] ||= {} data = data.deep_symbolize_keys translations[locale].deep_merge!(data) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def store_translations(locale, data)\n flatten_data(locale => data).each do |key, value|\n self[key] = value\n end\n end", "def store_translations(locale, data)\n data = flatten data\n data.each { |key, data| store_translation(locale, key, data) }\n end", "def store_translations(...
[ "0.804784", "0.79680693", "0.7910756", "0.78056765", "0.7586421", "0.7586421", "0.71330327", "0.7068819", "0.6615633", "0.6526288", "0.64726233", "0.6416502", "0.6376393", "0.6324002", "0.63175255", "0.6295793", "0.6204288", "0.60964847", "0.6065926", "0.6065872", "0.6062581"...
0.79098463
3
Get available locales from the translations hash
def available_locales init_translations unless initialized? translations.inject([]) do |locales, (locale, data)| locales << locale unless (data.keys - [:i18n]).empty? locales end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def available_locales\n resource.translations.all(:fields => [:locale_tag], :unique => true).map { |t| t.locale }\n end", "def available_locales\n translation_model.all(:fields => [:locale_tag], :unique => true).map { |t| t.locale }\n end", "def available_locales\n init_nam...
[ "0.791292", "0.75835174", "0.7503684", "0.7406696", "0.73954564", "0.7222097", "0.7222097", "0.7209709", "0.72033936", "0.717893", "0.71628946", "0.71517533", "0.7145055", "0.7130455", "0.7123255", "0.7123255", "0.7103268", "0.70909584", "0.7071751", "0.706964", "0.70694155",...
0.7725795
1
Clean up translations hash and set initialized to false on reload!
def reload! @initialized = false @translations = nil super end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_translations!\r\n @translation_caches = {}\r\n @stop_merging_translated_attributes = nil\r\n end", "def prepare_translations!\r\n stash.each do |locale, attrs|\r\n if attrs.any?\r\n translation = record.translations.find_by_locale(locale)\r\n translation ||= r...
[ "0.7400574", "0.6750066", "0.67466563", "0.67209506", "0.6616459", "0.65394884", "0.6458097", "0.63888323", "0.63874215", "0.61639696", "0.60594404", "0.6026396", "0.60256165", "0.60000175", "0.5999689", "0.59652334", "0.5959203", "0.5928776", "0.5928776", "0.5914653", "0.587...
0.8377962
0
Looks up a translation from the db. Returns nil if eiher key is nil, or locale, scope or key do not exist as a key in the nested translations hash. Splits keys or scopes containing dots into multiple keys, i.e. currency.format is regarded the same as %w(currency format).
def lookup(locale, key, scope = [], options = {}) init_translations unless initialized? result = nil _locale = ::Locale.first(:code => locale) key = pluralizer(_locale, key, options[:count]) value = _locale.translations.first(:code => key) result = value.valu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lookup(locale, key, scope = [], options = {})\n key = normalize_flat_keys(locale, key, scope, options[:separator])\n\n return if translations.missing?(locale, key)\n\n result = translations.lookup(locale, key, options)\n translations.missing(locale, key, options) if result.nil?\n\n ...
[ "0.7834698", "0.6872128", "0.6741371", "0.6599621", "0.6234187", "0.6105406", "0.61042047", "0.60840565", "0.60000116", "0.5885334", "0.5841277", "0.5810016", "0.58036244", "0.5793681", "0.57754964", "0.5564773", "0.54986596", "0.54082006", "0.53184325", "0.53158385", "0.5210...
0.69782096
1
Evaluates defaults. If given subject is an Array, it walks the array and returns the first translation that can be resolved. Otherwise it returns the last string value in the Array.
def default(locale, object, subject, options = {}) options = options.dup.reject { |key, value| key == :default } case subject when Array subject.count - 1 subject.each do |item| result = resolve(locale, object, item, options) #and return result ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_value_from_default(default)\n case default\n # Array elements\n when /\\AARRAY\\[(.*)\\]\\z/\n # TODO: Improve this since it's not the most safe approach\n eval(default.gsub(/ARRAY|::\\w+(\\[\\])?/, ''))\n else\n super\n en...
[ "0.5564765", "0.55293316", "0.53731245", "0.5339025", "0.5184133", "0.5175448", "0.5121119", "0.5064416", "0.505164", "0.49782458", "0.49726427", "0.49194536", "0.48877296", "0.48822674", "0.48544398", "0.47808084", "0.4767537", "0.4741737", "0.47356027", "0.4732198", "0.4730...
0.7119583
0
Attributes 1. pregnant > Number of times pregnant 2. oral_glucose_tolerance > Plasma glucose concentration a 2 hours in an oral glucose tolerance test 3. blood_pressure > Diastolic blood pressure (mm Hg) 4. skin_fold_thickness > Triceps skin fold thickness (mm) 5. serum_insulin > 2Hour serum insulin (mu U/ml) 6. body_m...
def initialize(kernel_type='RBF') @training_data_set = Diabetic.pick(538) @training = @training_data_set.collect {|d| [d.pregnant, d.oral_glucose_tolerance, d.blood_pressure, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def classifier_from_training( filename )\n classifier = Weka::Classifiers::Meta::AdaBoostM1.new # \n \n # http://weka.sourceforge.net/doc.dev/\n\n # java.lang.String[-P, 100, -S, 1, -I, 10, -W, weka.classifiers.trees.DecisionStump]@28c88600\n\n classifier.use_options(\"-I 100 -S #{ (rand * 10).floor }\")...
[ "0.5657299", "0.56343156", "0.5567318", "0.54633", "0.5422282", "0.54106337", "0.5394661", "0.5385544", "0.53610504", "0.5333493", "0.52680176", "0.51976", "0.51639277", "0.5143606", "0.51387864", "0.5097754", "0.5071522", "0.50678045", "0.50568753", "0.50550646", "0.50285846...
0.56230885
2
> signOn Method < "signOn" method for making GET request. In this method to genrate the session token by passing the identity_token. It returns the session token in string.
def signOn() begin response_xml = HTTParty.get(SIGNON_URL, headers: { "Content-Type" => "application/json", "Authorization" => "Basic #{encode_token(identity_token)}"}, verify: false,:timeout => 60 ) encode_token(response_xml) rescue Exception => ex return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sign_in identity\n cookies.permanent[:auth_token] = identity.token\n end", "def token\n session = Session.find_by(id: params[:id])\n token = @@opentok.generate_token(session.session_id)\n render :json => { OtToken: token }\n end", "def session(token)\n get(:signed, {:me...
[ "0.7110345", "0.6792578", "0.6769908", "0.65014505", "0.64666766", "0.6438523", "0.636416", "0.6261192", "0.6257066", "0.6234178", "0.62319833", "0.622437", "0.6212913", "0.6204927", "0.61669666", "0.61207503", "0.60767716", "0.60767716", "0.60767716", "0.6073086", "0.6072029...
0.82104707
0
Computes factorial of the input number and returns it
def factorial(number) accumulator = 1 if number.nil? raise ArgumentError.new("You can't factorialize 'nil.' ") elsif number == 0 || number == 1 return 1 else until number == 0 do accumulator = number * accumulator number -= 1 end end return accumulator end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def factorial(number)\n\tresult = 1\n\twhile number > 0\n\t\tresult *= number\n\t\tnumber -= 1\n\tend\n\treturn result\nend", "def factorial((number))\nif number == 0\n return 1\n else\n result = 1\n while number > 1\n result = result * number\n number -= 1\n end\nend\n return result\nend", "def factor...
[ "0.8573775", "0.85196304", "0.84798104", "0.8475185", "0.84475386", "0.84387624", "0.84186834", "0.84170794", "0.84066683", "0.8385247", "0.83772886", "0.8371864", "0.83610743", "0.83610743", "0.8353465", "0.83462596", "0.8343451", "0.8342992", "0.83401716", "0.83258146", "0....
0.0
-1
LADIES AND GENTLEMEN, NEWS TEAM 6 Brian Fantana Get the bits of real panther so you know it's good (it opens the file)
def load_file( file ) begin @filename = file rescue Exception => e baxter( e ) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def beetle_bhwlae\n puts File.open(\"./pics/beetle_bhwlae.txt\").read\n end", "def testget_leveled_file_contentUselessLVL\n # If set to 1, nothing will be leveled.\n RCodeLeveler::set_level(1)\n lNewContent, lDiff = RCodeLeveler.get_leveled_file_content('RequiredFiles/SimpleFile')\n File.open(\"#...
[ "0.59217477", "0.58760816", "0.5870544", "0.5868917", "0.5845877", "0.5845877", "0.5845877", "0.57386625", "0.57119393", "0.5706094", "0.57057816", "0.57016397", "0.5670325", "0.567006", "0.56646574", "0.5646625", "0.56249714", "0.5623", "0.561261", "0.5605817", "0.56006515",...
0.0
-1
Champ Kind Slap some BBQ sauce on them elements and woo, woo, woo!!!!
def add_classes_to_file( filename ) path = "#{ @view_directory }#{ filename }" temp_file = Tempfile.new( 'foo' ) begin File.open( path, 'r' ) do |file| file.each_line do |line| temp_file.puts make_classy( line, @file_identifier ) end end temp_file.close FileUtils.mv( temp_fil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def html5_noti\n \n end", "def scrape_it\n \n end", "def parse_block_html; end", "def markup\n self.text.sub(/^(.*)$/,'<b>\\1</b>')\n end", "def place_boutons_pour_balise_in code\n file_url = \"analyse/#{id}/show\"\n code.gsub(/<(h[2-6])(?:.*?)id=\"(.+?)\"(?:.*?)>(.+?)...
[ "0.556299", "0.554332", "0.5429491", "0.5373414", "0.53201604", "0.5253843", "0.524927", "0.5239092", "0.52238494", "0.52218956", "0.52216196", "0.52074957", "0.5176576", "0.5171906", "0.5148432", "0.5142635", "0.5142635", "0.5110524", "0.5109538", "0.5107803", "0.5087981", ...
0.0
-1
Brick Tamland Invite the ids to the pants party
def add_ids_to_file( filename ) path = "#{ @view_directory }#{ filename }" temp_file = Tempfile.new( 'foo' ) begin File.open( path, 'r' ) do |file| file.each_line do |line| temp_file.puts show_me_your_id( line ) end end temp_file.close FileUtils.mv( temp_file.path, path ) re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invite\n \n end", "def invite_people\n end", "def send_invites\n # Security stuff\n raise Kroogi::NotPermitted unless permitted?(@user, :profile_edit) # @user is inviter\n unless check_invites_quota(@user)\n redirect_to(:controller => 'invite', :action => 'find') and return\n end\n ...
[ "0.6726477", "0.6651254", "0.5999982", "0.59463036", "0.59160185", "0.5891879", "0.5874665", "0.58068", "0.5795659", "0.579456", "0.57840645", "0.5779295", "0.5775039", "0.57432795", "0.5711887", "0.5709027", "0.5709022", "0.5694264", "0.56894433", "0.56877494", "0.5667002", ...
0.0
-1
THESE TWO ARE THE BRANS OF THIS OPERATION
def make_classy( line, file_identifier ) # TODO: should add file name to end of class StayClassy::Builder::DEFAULT_CLASS_TAGS.each do |tag| if line.include?( "<#{ tag }" ) && !line.include?( "class=" ) line = line.gsub( "<#{ tag }", "<#{ tag } class=\"#{ @prefix }#{ tag }_#{ file_identifier }\"" ) end e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cops; end", "def cops; end", "def cops; end", "def op; end", "def operations; end", "def operations; end", "def operation; end", "def private; end", "def probers; end", "def berlioz; end", "def who_we_are\r\n end", "def anchored; end", "def romeo_and_juliet; end", "def schubert; end"...
[ "0.65279603", "0.65279603", "0.65279603", "0.64422864", "0.6393495", "0.6393495", "0.6389628", "0.6291894", "0.6244972", "0.6222276", "0.6172276", "0.6098895", "0.5992715", "0.5874147", "0.5847523", "0.58314073", "0.58223844", "0.5821186", "0.5815267", "0.5797783", "0.5772798...
0.0
-1
Complete the commonChild function below.
def commonChild(s1, s2) arr_s1 = s1.split(//) arr_s2 = s2.split(//) common = arr_s1 & arr_s2 if common.length != 0 s1_com = [] s2_com = [] arr_s1.each do |s1| if common.include?(s1) s1_com << s1 end end arr_s2.each do |s2| ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def commonChild(s1, s2)\nend", "def common\n \n end", "def child_condition; end", "def children\n child_check\n super\n end", "def children=(_arg0); end", "def children=(_arg0); end", "def each_child\n \n end", "def children; end", "def children; end", "def children; end", "def c...
[ "0.7329864", "0.66315013", "0.60423136", "0.56434065", "0.5632341", "0.5632341", "0.5607186", "0.5603087", "0.5603087", "0.5603087", "0.5603087", "0.5603087", "0.5603087", "0.5603087", "0.5603087", "0.5603087", "0.5603087", "0.5603087", "0.5603087", "0.5559163", "0.54936904",...
0.54996693
20
method to determine birthdate_path based on birthdate entered
def birthdate_path(birthdate) initial_sum_birthdate = birthdate[0].to_i + birthdate[1].to_i + birthdate[2].to_i + birthdate[3].to_i + birthdate[4].to_i + birthdate[5].to_i + birthdate[6].to_i + birthdate[7].to_i final_sum_birthdate = initial_sum_birthdate.to_s final_sum_birthdate = final_sum_birthdate[0].to_i + f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_birth_path_number(birthdate)\n number = birthdate[0].to_i + birthdate[1].to_i + birthdate[2].to_i + birthdate[3].to_i + birthdate[4].to_i + birthdate[5].to_i + birthdate[6].to_i + birthdate[7].to_i\n \n number = number.to_s \n number = number[0].to_i + number[1].to_i\n \n if number > 9\n ...
[ "0.67531955", "0.6752186", "0.66501516", "0.66018224", "0.6533504", "0.6533504", "0.64928097", "0.64329636", "0.6361464", "0.62788033", "0.621502", "0.61638904", "0.606642", "0.5916743", "0.5916628", "0.59064335", "0.5886669", "0.58734596", "0.5859153", "0.5853352", "0.579057...
0.742715
0
method to determine birthdate meaning
def birthdate_meaning(birthdate_path_num) meaning = "Your numerology number is #{birthdate_path_num}. " case birthdate_path_num when 1 meaning += "One is the leader. The number one indicates the ability to stand alone, and is a strong vibration. Ruled by the Sun." when 2 meaning += "This is the mediator and ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def birth\n date_parser(self[:birth])\n end", "def birth\n birth_date.try(:to_date)\n end", "def birthdate_for(user)\n\t\tuser.birthdate.strftime(\"%B %e, %Y\")\n\tend", "def birth_date\n getBirthDate && getBirthDate.to_date\n end", "def birth_date(user_birth_date)\n user_birth_d...
[ "0.77474785", "0.7687126", "0.7672495", "0.7627611", "0.75331557", "0.7528489", "0.7515679", "0.7495277", "0.7390615", "0.7383759", "0.7329771", "0.7296941", "0.72346294", "0.72295994", "0.7203721", "0.71956307", "0.7175562", "0.717095", "0.7169601", "0.71660304", "0.7160778"...
0.0
-1
Constructor This constructor should be used ONLY by UOA_ classes to ensure proper Undo/Redo management. Parameters:: iType (_Type_): The type iContent (_Object_): The content iMetadata (map): The metadata iTags (map): The Tags
def initialize(iType, iContent, iMetadata, iTags) @Type = iType @Content = iContent @Metadata = iMetadata @Tags = iTags end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(type, content=nil)\n @type = type\n @content = content\n end", "def initialize(type, content='', attr=nil)\n @type, @content, @attr = type, content, attr||OPTS\n end", "def initialize(type=:default, opts={})\n if opts[:from]\n @type = opts[:from].class.to_s.split(/...
[ "0.642298", "0.61089087", "0.55315876", "0.55111533", "0.54460263", "0.54113", "0.54113", "0.53457415", "0.533132", "0.5309116", "0.5309116", "0.5295791", "0.5252468", "0.51852614", "0.51847804", "0.5179011", "0.5128954", "0.5112386", "0.5112386", "0.5112386", "0.5100137", ...
0.8196298
0
Get the summary of its content. This could be used in tool tips for example. Return:: _String_: The content's summary
def getContentSummary @Type.getContentSummary(@Content) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def summary\n resource = pointer[\"resource\"]\n content, id = self.get_page_content\n line_limit = @ruhoh.db.config(resource)['summary_lines']\n line_count = 0\n line_breakpoint = content.lines.count\n\n content.lines.each_with_index do |line, i|\n if line =~ /^\\s*$/ # line ...
[ "0.7856708", "0.7856478", "0.772445", "0.772445", "0.772445", "0.76082075", "0.7571617", "0.7541804", "0.7501864", "0.7469675", "0.74053895", "0.7313877", "0.7307482", "0.72958994", "0.72766954", "0.7275429", "0.72623605", "0.7250115", "0.72377867", "0.7222038", "0.72160023",...
0.7814703
2
Dump the Shortcut's info in a String Parameters:: iPrefix (_String_): The prefix to append to the strings [optional = ''] Return:: _String_: The dump
def dump(iPrefix) rDump = '' rDump += "#{iPrefix}+-Type: #{@Type.inspect}\n" rDump += "#{iPrefix}+-Content: #{@Content.inspect}\n" rDump += "#{iPrefix}+-Metadata:\n" @Metadata.each do |iKey, iValue| rDump += "#{iPrefix}| +-#{iKey}: #{iValue.inspect}\n" end rDump += "#{...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dump\n general_prefix.join(' ')\n end", "def log_prefix\n \"[nsc/#{Customer.url_shortcut}/#{id.to_s}] \"\n end", "def prefix\n \"\".tap do |o|\n o << \" \" if @mcir.logger.debug?\n o << \"[#{name}] \".purple\n end\n end", "def info(prefix, msg = nil)\n if msg.nil?\n...
[ "0.69028115", "0.6039591", "0.59247696", "0.5699608", "0.56227225", "0.5568714", "0.5568714", "0.5568714", "0.5568714", "0.5568714", "0.5568714", "0.5568714", "0.5568714", "0.5568714", "0.5568714", "0.5551138", "0.5535418", "0.547211", "0.5424009", "0.5408153", "0.53976995", ...
0.72790956
0
Method that runs the Shortcut
def run @Type.run(@Content) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def action_run\n end", "def action\n puts \"use command!\\n\\n\"\n end", "def run_actions; end", "def launch!\n\t\tintroduction\n\t\t\taction = nil\n\t\t\tuntil action == :quit\n\t\t\t# action loop\n\t\t\t# what do you want to do? (list, find, add, quit)\n\t\t\tprint \"> \"\n\t\t\tuser_r...
[ "0.6447212", "0.6318488", "0.61511755", "0.6120001", "0.606234", "0.5954177", "0.5954177", "0.5954177", "0.5954177", "0.5954177", "0.5954177", "0.5918858", "0.586184", "0.5859022", "0.58562255", "0.58562255", "0.58290356", "0.57879514", "0.5785032", "0.5785032", "0.5785032", ...
0.0
-1
!!! Following methods have to be used ONLY by UAO_ classes. !!! This is the only way to ensure that Undo/Redo management will behave correctly. Set the content of the Shortcut. This is used only for Undo purposes. !!! This method has to be called ONLY inside protected AtomicOperation classes Parameters:: iNewContent (_...
def _UNDO_setContent(iNewContent) @Content = iNewContent end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setContent(value) \n @obj.setContent(value) \n end", "def setContent(content)\r\n\t\t\t\t\t@content = content\r\n\t\t\t\tend", "def setContent(content)\r\n\t\t\t\t\t@content = content\r\n\t\t\t\tend", "def content= (new_content)\n @content = new_content\n end", "def set_content(content)...
[ "0.63071257", "0.6238999", "0.6238999", "0.61791044", "0.6167487", "0.6117352", "0.59032553", "0.5755309", "0.5716847", "0.5716847", "0.5716847", "0.5716847", "0.5716847", "0.5716847", "0.5678464", "0.56686205", "0.56609964", "0.56446075", "0.5619109", "0.56074774", "0.558520...
0.65334517
0
Set the metadata of the Shortcut. This is used only for Undo purposes. !!! This method has to be called ONLY inside protected AtomicOperation classes Parameters:: iNewMetadata (map): The new metadata
def _UNDO_setMetadata(iNewMetadata) @Metadata = iNewMetadata end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_metadata(*args)\n self.metadata.set(*args)\n end", "def metadata=(value)\n @metadata = value\n end", "def metadata=(value)\n @metadata = value\n end", "def metadata=(metadata)\n @metadata = metadata\n end", "def metadata=(m...
[ "0.6750047", "0.6349794", "0.6349794", "0.6329748", "0.6329748", "0.6329748", "0.6329748", "0.63159704", "0.629327", "0.616464", "0.605716", "0.6030247", "0.60220385", "0.5956978", "0.58699816", "0.5847112", "0.58281815", "0.5802087", "0.58005637", "0.5741132", "0.57054293", ...
0.7520889
0
Set the tags of the Shortcut. This is used only for Undo purposes. !!! This method has to be called ONLY inside protected AtomicOperation classes Parameters:: iNewTags (map): The new tags
def _UNDO_setTags(iNewTags) # Remove Tags that are not part of the new list @Tags.delete_if do |iTag, iNil| !iNewTags.has_key?(iTag) end # Add Tags that are not part of the current list iNewTags.each do |iTag, iNil| @Tags[iTag] = nil end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_tags(tags)\n @tags.update(tags)\n end", "def set_tags(given_tags = {})\n @tags.merge!(given_tags)\n end", "def set_tags(tags)\n self.tags = tags.map.each do |tag|\n Tag.find_or_create_by_name tag\n end\n end", "def setTags(tags)\r\n\t\t\t\t\t@tags = tags\r\n\t\t\t\tend", ...
[ "0.7181288", "0.68482864", "0.6746661", "0.67222977", "0.65629804", "0.64291435", "0.6407791", "0.6407791", "0.6338133", "0.6238164", "0.6195976", "0.6195976", "0.6195976", "0.61864537", "0.61864537", "0.61864537", "0.61864537", "0.61864537", "0.61864537", "0.6133755", "0.612...
0.7222018
0
GET /project_implementations GET /project_implementations.json
def index @project_implementations = ProjectImplementation.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n #@project_implementations = ProjectImplementation.all\n @project = Project.find(params[:project_id])\n @project_implementations = ProjectImplementation.where(project_id: params[:project_id])\n end", "def create\n @project_implementation = ProjectImplementation.new(project_implementation_...
[ "0.7680401", "0.6216879", "0.60800177", "0.5979833", "0.5956683", "0.5944713", "0.5933098", "0.59240794", "0.58908343", "0.5872998", "0.58391297", "0.58118695", "0.5805924", "0.57942325", "0.5778016", "0.57681644", "0.5763689", "0.5760013", "0.5752981", "0.5746974", "0.574365...
0.7860334
0
GET /project_implementations/1 GET /project_implementations/1.json
def show; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n #@project_implementations = ProjectImplementation.all\n @project = Project.find(params[:project_id])\n @project_implementations = ProjectImplementation.where(project_id: params[:project_id])\n end", "def index\n @project_implementations = ProjectImplementation.all\n end", "def create\...
[ "0.7698181", "0.7642857", "0.6410304", "0.64046943", "0.6202778", "0.6183071", "0.61786205", "0.6170742", "0.614589", "0.61420506", "0.6141843", "0.6136734", "0.6131961", "0.6110531", "0.6097192", "0.6094479", "0.60892904", "0.6069885", "0.60583687", "0.6057853", "0.605155", ...
0.0
-1
POST /project_implementations POST /project_implementations.json
def create @project = Project.find(params[:project_id]) @project_implementation = @project.build_project_implementation(project_implementation_params) respond_to do |format| if @project_implementation.save! format.html { redirect_to new_project_project_evaluation_path(@project), notice: 'Proje...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @project_implementation = ProjectImplementation.new(project_implementation_params)\n @project = Project.find(params[:project_id])\n @project_implementation.project_id = @project.id\n respond_to do |format|\n if @project_implementation.save\n format.html { redirect_to current_us...
[ "0.73237276", "0.67438304", "0.66583014", "0.66109186", "0.6266527", "0.614498", "0.60755324", "0.5954059", "0.5954059", "0.5870781", "0.5851797", "0.5820334", "0.58074844", "0.58070916", "0.5806221", "0.577397", "0.5764069", "0.5763141", "0.576017", "0.5756516", "0.57432383"...
0.72361887
1
PATCH/PUT /project_implementations/1 PATCH/PUT /project_implementations/1.json
def update respond_to do |format| if @project_implementation.update(project_implementation_params) format.html { redirect_to project_project_implementation_path(@project), notice: 'Project implementation was successfully updated.' } format.json { render :show, status: :ok, location: @project_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @project_implementation.update(project_implementation_params)\n format.html { redirect_to current_user, notice: 'Project implementation was successfully updated.' }\n format.json { render :show, status: :ok, location: @project_implementation }\n e...
[ "0.68973964", "0.6659508", "0.66354567", "0.6605398", "0.657112", "0.6558473", "0.6539586", "0.65187776", "0.6513318", "0.6490236", "0.64695036", "0.64675623", "0.6452675", "0.64450943", "0.6431174", "0.6392698", "0.6387203", "0.6380696", "0.63599056", "0.63460904", "0.634037...
0.6897579
0
DELETE /project_implementations/1 DELETE /project_implementations/1.json
def destroy @project_implementation.destroy respond_to do |format| format.html { redirect_to project_implementations_url, notice: 'Project implementation was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @project.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n\t\t@project.destroy\n\t\trespond_to do |format|\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend", "def destroy\n project.destroy\n\n respond_to do |format|\n ...
[ "0.7342669", "0.7164312", "0.7141497", "0.7122704", "0.7114999", "0.70699203", "0.7063049", "0.7054961", "0.70408505", "0.7038265", "0.7037912", "0.7037718", "0.7037718", "0.7037718", "0.7037718", "0.7037718", "0.7032686", "0.7024237", "0.7024207", "0.70175046", "0.7009418", ...
0.7504554
0
Use callbacks to share common setup or constraints between actions.
def set_project_implementation @project = Project.find(params[:project_id]) @project_implementation = @project.project_implementation 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 project_implementation_params params.require(:project_implementation).permit(:project_id, project_bitacoras_attributes: ProjectBitacora.attribute_names.map(&:to_sym).push(:_destroy)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.6980629", "0.67819995", "0.67467666", "0.67419875", "0.67347664", "0.65928614", "0.6504013", "0.6498014", "0.64819515", "0.64797956", "0.64562726", "0.64400834", "0.6380117", "0.6377456", "0.63656694", "0.6320543", "0.63002014", "0.62997127", "0.629425", "0.6293866", "0.62...
0.0
-1
Standard entry point for REST requests.
def api_keys; rest_query(:api_key); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rest_end_point; end", "def rest_endpoint; end", "def rest_endpoint=(_arg0); end", "def rest_request(verb, url, data)\n if Rails.env.production?\n rest_production(verb, url, JSON.generate(data))\n else\n log_info(\"[#{Rails.env}]: #{verb} #{url}\", 200)\n end\n ...
[ "0.745546", "0.7429819", "0.685683", "0.6719303", "0.666809", "0.6547483", "0.645724", "0.64343077", "0.6366327", "0.6315485", "0.62793964", "0.6270224", "0.6205676", "0.61992997", "0.6194768", "0.6180824", "0.61726457", "0.6170002", "0.6130682", "0.61294776", "0.6121877", ...
0.0
-1
Loads the first page with simple form of invoice
def index @page_name = 'Invoice History' @invoices = Invoice.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n load_invoice_and_render\n end", "def show\n @invoice = Invoice.find(params[:id])\n render :layout => false\n end", "def new\n @invoice = Invoice.new\n @invoice.itens.build\n default_data\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :...
[ "0.7273847", "0.65659577", "0.6529535", "0.6489398", "0.6467142", "0.6458802", "0.64542985", "0.6428085", "0.6370666", "0.63067186", "0.62649643", "0.62556785", "0.62455624", "0.62323815", "0.62222636", "0.62130105", "0.6202401", "0.6185638", "0.6185427", "0.6173168", "0.6161...
0.63143104
9
Metodo que regresa todos los doctores en la tabla usuarios
def clinicas_todas(id) Usuario.find_by_datos_id(id, :conditions => "datos_type = 'Clinica'") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_usuario\n \n end", "def seguir(otro_usuario)\n\t\t# siguiendo << otro_usuario\n\t\trelaciones_activas.create(seguido_id: otro_usuario.id)\n\tend", "def index\n @usuario_seguidores = UsuarioSeguidor.all\n end", "def index\n @direccions = Direccion.all\n @usuarios = Usuario.all\n end", ...
[ "0.6083099", "0.60337025", "0.60164756", "0.5990498", "0.5964278", "0.5954002", "0.59153616", "0.58945143", "0.58772", "0.58404034", "0.58305895", "0.5827347", "0.57459337", "0.5722898", "0.57069075", "0.5698692", "0.5698692", "0.5698692", "0.569172", "0.569172", "0.569172", ...
0.57538944
12
GET /clinicas GET /clinicas.xml
def index @cont = 0 # Variable para acceso al arreglo de @usuarios en la vista @clinicas = Clinica.all @usuarios = Usuario.find(:all, :conditions => "datos_type = 'Clinica'") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @criancas = Crianca.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @criancas }\n end\n end", "def index\n @citas = Cita.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml =>...
[ "0.6738519", "0.6694732", "0.6675576", "0.666676", "0.64771634", "0.64511734", "0.6420999", "0.6324729", "0.62565595", "0.62513274", "0.6247885", "0.6230661", "0.621724", "0.62094194", "0.61611456", "0.612967", "0.61295724", "0.6108089", "0.6105475", "0.6102485", "0.61005104"...
0.0
-1
GET /clinicas/1 GET /clinicas/1.xml
def show @usuario = Usuario.find(session[:usuario_id]) @clinica = Clinica.find(@usuario.datos_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @criancas = Crianca.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @criancas }\n end\n end", "def index\n @citas = Cita.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml =>...
[ "0.6544775", "0.6444371", "0.64126223", "0.639532", "0.63522106", "0.6342741", "0.6264584", "0.6262967", "0.6262952", "0.6257725", "0.6243431", "0.62331647", "0.6224951", "0.6198721", "0.61872095", "0.6175122", "0.6159838", "0.6144725", "0.6144725", "0.6129554", "0.6128384", ...
0.0
-1
GET /clinicas/new GET /clinicas/new.xml
def new @clinica = Clinica.new @usuario = Usuario.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @convenio = Convenio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @convenio }\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ciclo }\n end\n end", "def new\...
[ "0.7130762", "0.70971775", "0.7054001", "0.7041122", "0.7041122", "0.69608796", "0.6953641", "0.6921111", "0.691624", "0.6885021", "0.6876416", "0.68581253", "0.6826955", "0.68235284", "0.6798539", "0.6792669", "0.6786458", "0.6779284", "0.6776192", "0.6769959", "0.676945", ...
0.0
-1
POST /clinicas POST /clinicas.xml
def create @clinica = Clinica.new(params[:clinica]) @usuario = Usuario.new(params[:usuario]) @usuario.datos = @clinica # @clinica.sitioWeb = "http://#{@clinica.sitioWeb}" respond_to do |format| if @clinica.valid? && @usuario.valid? @clinica.save @usuario.save flash[:notic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @clinica = Clinica.new(clinica_params)\n @clinica.estatus = \"A\" \n respond_to do |format|\n if @clinica.save\n format.html { redirect_to @clinica, notice: 'La clinica fue registrada exitosamente.' }\n format.json { render :show, status: :created, location: @clinica }\n ...
[ "0.6425431", "0.6382741", "0.60150033", "0.59707165", "0.5940692", "0.59269005", "0.59217656", "0.59025735", "0.5886257", "0.58650374", "0.5857946", "0.58528346", "0.58504415", "0.58063275", "0.58003134", "0.5790726", "0.57697046", "0.57534003", "0.5741943", "0.5740643", "0.5...
0.6541181
0
PUT /clinicas/1 PUT /clinicas/1.xml
def update @clinica = Clinica.find(params[:id]) id = @clinica.id @usuario = Usuario.find_by_datos_id(id, :conditions => "datos_type = 'Clinica'") # @clinica.sitioWeb = "http://#{@clinica.sitioWeb}" respond_to do |format| if @clinica.valid? && @usuario.valid? @clinica.update_attributes(params...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @clinica.update(clinica_params)\n format.html { redirect_to @clinica, notice: 'Clinica was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @clini...
[ "0.59126544", "0.5898621", "0.5856029", "0.5792129", "0.57574296", "0.57516146", "0.57516146", "0.5676936", "0.5652147", "0.56460065", "0.5643143", "0.56250614", "0.5611308", "0.55960417", "0.5581533", "0.5574564", "0.5569019", "0.55618954", "0.5548585", "0.5546211", "0.55358...
0.5786837
4
DELETE /clinicas/1 DELETE /clinicas/1.xml
def destroy @clinica = Clinica.find(params[:id]) id = @clinica.id @usuario = clinicas_todas(id) @clinica.destroy @usuario.destroy respond_to do |format| format.html { redirect_to(clinicas_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @convenio = Convenio.find(params[:id])\n @convenio.destroy\n\n respond_to do |format|\n format.html { redirect_to(convenios_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @cso = Cso.find(params[:id])\n @cso.destroy\n\n respond_to do |format|\n fo...
[ "0.6762896", "0.66143835", "0.659556", "0.6576814", "0.65745836", "0.6569664", "0.65624213", "0.6554548", "0.6533616", "0.65287155", "0.6523866", "0.6511764", "0.6506727", "0.64841443", "0.6461669", "0.6454941", "0.64519864", "0.64468503", "0.6421729", "0.642148", "0.642148",...
0.6690067
1
Method for determining if a number is float or integer
def number_type a if a.include?(".") return a.to_f.round(2) else return a.to_i end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_number?\n is_float? || is_integer?\n end", "def is_a_number?(num)\n is_integer?(num) || is_float?(num)\nend", "def is_number?(i)\n true if Float(i) rescue false\nend", "def is_number?(i)\n true if Float(i) rescue false\nend", "def number?(num)\n integer?(num) || float?(num)\nend", "def is_...
[ "0.84415907", "0.8418181", "0.8371225", "0.8371225", "0.8356896", "0.8316153", "0.8214506", "0.8104108", "0.8016317", "0.7986655", "0.79237396", "0.7900543", "0.7885048", "0.7861689", "0.78601503", "0.78518265", "0.7848198", "0.783185", "0.7829", "0.7823918", "0.781734", "0...
0.0
-1
Method for determining if a number is float or integer
def number_type b if b.include?(".") return b.to_f.round(2) else return b.to_i end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_number?\n is_float? || is_integer?\n end", "def is_a_number?(num)\n is_integer?(num) || is_float?(num)\nend", "def is_number?(i)\n true if Float(i) rescue false\nend", "def is_number?(i)\n true if Float(i) rescue false\nend", "def number?(num)\n integer?(num) || float?(num)\nend", "def is_...
[ "0.84424376", "0.84191227", "0.83716536", "0.83716536", "0.835817", "0.83162314", "0.8214726", "0.8103949", "0.80156827", "0.79866004", "0.79243445", "0.7900555", "0.7885112", "0.7860342", "0.7860238", "0.7852487", "0.7847768", "0.78326756", "0.7831606", "0.78233254", "0.7817...
0.0
-1
Method to return divide
def divide a, b if b == 0 return "Division by zero is undefined." else return "a / b = #{a/b}" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def divide(a, b)\n divide = a / b\n return divide\nend", "def divide\n match '/'\n factor\n emit_ln 'MOVE (SP)+,D1'\n emit_ln 'DIVS D1,D0'\nend", "def divide(number_1, number_2)\n return number_1 / number_2\nend", "def divide(number_1, number_2)\n return number_1 / number_2\nend", "def divide(numbe...
[ "0.80150384", "0.7948827", "0.7900024", "0.7900024", "0.7900024", "0.78939086", "0.7879262", "0.78560054", "0.7771624", "0.77647275", "0.7730861", "0.7725008", "0.77127063", "0.76554", "0.76314753", "0.7619707", "0.75830954", "0.75806034", "0.756546", "0.7551899", "0.7536189"...
0.65103894
86
Method to display exponify
def display_exponify a, b display = "#{a} * " * (b - 1) + "#{a} = " if b > 1 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show() end", "def show() end", "def show() end", "def display\n puts \"Title: #{@title}\"\n puts \"Author: #{@author}\"\n puts \"Price: #{@price}\"\n end", "def show\n \n end", "def show\n \n end", "def show\n \n end", "def show\n \n end", "def show\n \n end", ...
[ "0.66085374", "0.66085374", "0.66085374", "0.650053", "0.64495295", "0.64495295", "0.64495295", "0.64495295", "0.64495295", "0.64495295", "0.64495295", "0.64495295", "0.64495295", "0.6440147", "0.64334595", "0.6431518", "0.6394983", "0.6293706", "0.62774825", "0.62736404", "0...
0.0
-1
Method to return exponify
def exponify a, b return "a ^ b = #{display_exponify a, b}#{a**b}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_s\n return @exp\n end", "def exp_text\n @exp.to_s\n end", "def to_s\n return \"exp(#{self.arg.to_s})\"\n end", "def exponential(value1)\n result = Math.exp(value1)\n puts \"The result is #{ result }\"\nend", "def to_rexp\n raise \"hell\" if returns.kind_of?(Array)\n \...
[ "0.6375202", "0.6249908", "0.5907656", "0.5808493", "0.5767994", "0.5646745", "0.5631511", "0.5569248", "0.5569248", "0.5509479", "0.55064255", "0.54981154", "0.54981154", "0.5447728", "0.54358983", "0.54341024", "0.54321015", "0.5424196", "0.5424196", "0.5367194", "0.5308012...
0.5204379
34
The configuration key for the service.
def service_key (is_a?(Module) ? name : self.class.name).demodulize.underscore.to_sym end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def service_key\n SERVICE_KEY\n end", "def app_config_key\n return @app_config_key\n end", "def app_config_key=(value)\n @app_config_key = value\n end", "def cloud_config_yaml_key\n self.prefix_key('cloud_config.yaml')\n end", "def cloud_confi...
[ "0.7747655", "0.76117456", "0.71740955", "0.7145075", "0.7145075", "0.68627214", "0.6797505", "0.6768852", "0.6728682", "0.6696342", "0.66914636", "0.66509646", "0.66428095", "0.663613", "0.66180515", "0.65901554", "0.65578705", "0.6524966", "0.6524966", "0.6509078", "0.65057...
0.6705118
10
Indicate whether requests are enabled to this external service.
def enabled !false?(configuration[:enabled]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def service_enable?()\n return true if (@service == TAC_PLUS_AUTHEN_SVC_ENABLE)\n return false\n end", "def isEnabled(content, isRequest)\n true\n end", "def conditional_requests=(enabled); end", "def hasRequest?\n !requests.empty?\n end", "def enabled?()\n #This is a st...
[ "0.71065485", "0.6957672", "0.6927583", "0.66903543", "0.6651133", "0.6614778", "0.66137743", "0.6602971", "0.6600103", "0.6594746", "0.6578747", "0.65760416", "0.6520265", "0.65173423", "0.6513795", "0.6504794", "0.64844507", "0.64367545", "0.64367545", "0.64367545", "0.6436...
0.0
-1
Types of identifiers that the external service can find.
def types configuration[:types] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def id_types\n identifiers.map(&:type).uniq\n end", "def service_types_generated \n types = [ ServiceTypeValue[:fulltext], ServiceTypeValue[:holding], ServiceTypeValue[:table_of_contents], ServiceTypeValue[:relevant_link] ]\n \n return types\n end", "def registered_types\n end", "def get_...
[ "0.7436132", "0.6889959", "0.6882592", "0.6857726", "0.67783046", "0.6778059", "0.6637961", "0.6580295", "0.65622765", "0.65366954", "0.6529204", "0.6520436", "0.651626", "0.645922", "0.64532", "0.6446436", "0.6414506", "0.64008206", "0.6397516", "0.6336254", "0.63220555", ...
0.0
-1
How important the external service is as an authority for the type(s) of identifiers it can search.
def priority configuration[:priority] || DEFAULT_PRIORITY end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def known_identities; end", "def allowed_types\n [ Entities::SearchString, \n Entities::Organization, \n Entities::DnsRecord, \n Entities::Host,\n Entities::EmailAddress,\n Entities::Person, \n Entities::Username, \n Entities::Account]\nend", "def allowed_types\n [ Entities::SearchString...
[ "0.62239003", "0.57655334", "0.5663481", "0.5612018", "0.5593783", "0.555461", "0.5530326", "0.5511089", "0.5456859", "0.5438851", "0.54343176", "0.5424053", "0.5413592", "0.53749704", "0.5363182", "0.5315658", "0.5276349", "0.5254693", "0.5215556", "0.52144", "0.520985", "...
0.0
-1
How long to wait for a response from the external service.
def timeout configuration[:timeout] || DEFAULT_TIMEOUT end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timeout\n @timeout\n end", "def timeout\n return @timeout\n end", "def untilTimeout()\n return Timer.timeRemaining(@name)\n end", "def http_timeout; end", "def read_timeout\n @agent.read_timeout\n end", "def request_timeout()\n @req_timeout\n end", ...
[ "0.66137546", "0.66069883", "0.64176714", "0.64007056", "0.63952154", "0.63646597", "0.6305385", "0.6260458", "0.61850387", "0.61805296", "0.6177433", "0.6161107", "0.6151716", "0.6140912", "0.60989773", "0.6086165", "0.6053552", "0.60405236", "0.6039402", "0.60322237", "0.60...
0.57015175
74
displays form for creating new minor
def new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n\t\tminor = Minor.new(minor_params)\n\t\tif minor.save\n\t\t\tredirect_to '/minors'\n\t\telse\n\t\t\tflash[:notice] = \"The form you submitted is invalid.\"\n\t\t\tredirect_to '/minors/new'\n\t\tend\n\tend", "def create\n @minor = @user.minors.new(minor_params)\n\n respond_to do |format|\n ...
[ "0.78021514", "0.7075926", "0.662984", "0.6488643", "0.63057834", "0.6240489", "0.6239952", "0.62122464", "0.6186049", "0.6156541", "0.6111786", "0.60800767", "0.60258347", "0.60172373", "0.59919983", "0.5987652", "0.5908781", "0.5767839", "0.5748162", "0.57409835", "0.572785...
0.0
-1
handles post method from new minor form
def create minor = Minor.new(minor_params) if minor.save redirect_to '/minors' else flash[:notice] = "The form you submitted is invalid." redirect_to '/minors/new' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def POST; end", "def post\r\n end", "def post; end", "def post\n end", "def post_data; end", "def onSubmit(request, response, form, errors)\r\n\treturn form\r\n end", "def submit; end", "def onSubmit(request, response, form, errors) \r\n return form\r\n end", "def onSubmit(request, respo...
[ "0.77472866", "0.7187799", "0.71701455", "0.68588305", "0.6534306", "0.6528432", "0.65245295", "0.6519059", "0.6519059", "0.6519059", "0.6519059", "0.64974135", "0.6442962", "0.6442962", "0.63885784", "0.6368632", "0.6328986", "0.62904114", "0.6228192", "0.6128637", "0.612459...
0.5766526
42
displays a particular minor
def show @minor = Major.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def minor; end", "def minor; end", "def minor; end", "def minor=(_arg0); end", "def minor_version\n @version_helper.minor\n end", "def minor_version\n @version_helper.minor\n end", "def minor_version\n @version_helper.minor\n end", "def test_format_minor\n version = VMLib::Version....
[ "0.690192", "0.690192", "0.690192", "0.6765785", "0.6678079", "0.6678079", "0.6678079", "0.6652894", "0.64746416", "0.64293545", "0.6394376", "0.6161127", "0.60995793", "0.6080901", "0.60561985", "0.60117215", "0.5989441", "0.5911739", "0.5907004", "0.59014916", "0.5881902", ...
0.67348707
4
displays minor update form
def edit @minor = Minor.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @minor.update(minor_params)\n format.html { redirect_to :show, notice: 'Minor was successfully updated.' }\n format.json { render :show, status: :ok, location: @minor }\n else\n format.html { render :edit }\n format.json { render jso...
[ "0.66801625", "0.62001896", "0.6153784", "0.6153784", "0.61441255", "0.6062747", "0.60248", "0.5902592", "0.5893577", "0.5826261", "0.5783746", "0.5783746", "0.5783746", "0.5760921", "0.57001835", "0.568995", "0.5685149", "0.56700563", "0.56700563", "0.56700563", "0.56700563"...
0.67023546
0
Use callbacks to share common setup or constraints between actions.
def set_team @team = Team.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163754", "0.6045816", "0.5944853", "0.59169096", "0.58892167", "0.58342934", "0.5776148", "0.57057375", "0.57057375", "0.56534296", "0.56209534", "0.54244673", "0.54101455", "0.54101455", "0.54101455", "0.53951085", "0.5378493", "0.53563684", "0.53399915", "0.5338049", "0...
0.0
-1
Only allow a list of trusted parameters through.
def team_params params.require(:team).permit(:league_id, :name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "def param_whitelist\n [:role, :title]\...
[ "0.69497335", "0.6812623", "0.6803639", "0.6795365", "0.67448795", "0.67399913", "0.6526815", "0.6518771", "0.64931697", "0.6430388", "0.6430388", "0.6430388", "0.63983387", "0.6356042", "0.63535863", "0.63464934", "0.63444513", "0.6337208", "0.6326454", "0.6326454", "0.63264...
0.0
-1
Subscribe to a topic
def subscribe(_topic, **) raise 'not implemented' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subscribe!(topic)\n subscriptions.create!( :topic_id => topic.id )\n end", "def subscribe(*topics)\n # Defer subscribing until we are connected\n callback do\n send_packet(\n MQTT::Packet::Subscribe.new(\n :topics => topics,\n :message_id => @message_id.next\n )...
[ "0.81598896", "0.8004253", "0.77915907", "0.77212036", "0.74203664", "0.7400385", "0.73549014", "0.727808", "0.7194272", "0.7174886", "0.70929587", "0.7080044", "0.7079227", "0.7069261", "0.70616204", "0.7027993", "0.7021632", "0.6997103", "0.69629073", "0.6956849", "0.692787...
0.8601419
0
Record the version committer of the last version
def record_committer(content, user_key) user_key = user_key.user_key if user_key.respond_to?(:user_key) version = latest_version_of(content) return if version.nil? version_id = content.is_a?(Hyrax::FileMetadata) ? version.id.to_s : version.uri Hyrax::VersionCommitter.create(versi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_commit_log(last_version)\n range = \"v#{last_version}...\"\n `git log #{range} --no-merges --pretty=format:'%H\\t%s\\t%aN\\t%ad'`.chomp\nend", "def add_last_version_field\n logger.info \"Adding #{name}._last_version audit field...\"\n db.query(\"ALTER TABLE #{audit} ADD `_last_version` BIGINT...
[ "0.6528368", "0.65070146", "0.63203114", "0.62594086", "0.624158", "0.6179987", "0.61799186", "0.6169514", "0.6148249", "0.61428374", "0.6142819", "0.6142819", "0.6112128", "0.6106006", "0.6090917", "0.6068106", "0.6068106", "0.60635597", "0.6033634", "0.60224795", "0.6021423...
0.7474461
0
file loaded. Make changes to this file and then run 'ruby part1.rb' at the command line, this will run your program. Once you're satisfied with your work, save your file and upload it to the checker.
def palindrome?(str) letters=string.strip.downcase.gsub(/\W/, ''); letters == letters.reverse end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_sketch\n ensure_exists(filename)\n spin_up('run.rb', filename, argc)\n end", "def run_sketch\n ensure_exists(filename)\n spin_up('run.rb', filename, argc)\n end", "def start()\n source_in = File.new(@file, \"r\")\n read_source(source_in)\n\n # Pad with spa...
[ "0.63068354", "0.63068354", "0.58662605", "0.5813079", "0.58085376", "0.58052874", "0.57800347", "0.57746375", "0.5772061", "0.5755689", "0.57440305", "0.57334775", "0.5733151", "0.5717764", "0.5717596", "0.56959033", "0.56953484", "0.56953484", "0.5680121", "0.5665645", "0.5...
0.0
-1
check if an xinetd servicve is enabled
def check_xinetd_service(service) ret = false srv = Facter::Core::Execution.exec("chkconfig --list 2>/dev/null | grep #{service}") if srv.empty? ret = false else srvs = srv.split("\n") srvs.each do |line| data = line.split(%r{:}) if data[1].casecmp('off') != 0 ret = true en...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def service_enable?()\n return true if (@service == TAC_PLUS_AUTHEN_SVC_ENABLE)\n return false\n end", "def service_x25?()\n return true if (@service == TAC_PLUS_AUTHEN_SVC_X25)\n return false\n end", "def _service_enabled?(service_type, certname)\n case service_type\n ...
[ "0.72550553", "0.7199632", "0.69382733", "0.68742526", "0.6767819", "0.67643154", "0.6721727", "0.671876", "0.6689958", "0.6594337", "0.65062565", "0.64480895", "0.6443076", "0.64351064", "0.64303863", "0.64215463", "0.63648295", "0.6362825", "0.6362516", "0.6345743", "0.6305...
0.77600664
0
Time Complexity O(n) Space Complexity O(n), because of call stack Hint, you may want a recursive helper method
def fibonacci(n) raise ArgumentError if n < 0 return fib_helper(0, 1, 2, n) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recursive => nil", "def recursive_solution\n\n end", "def fibonacci(n)\n return fib_helper([0, 1], 2, n)\n # if you'd like to test what i THINK is an O(1) space complexity solution.....\n # i did run this through the tests and it SHOULD work:\n # return faster_fib_helper([0, 1], 2, n)\nend", "def fa...
[ "0.66138875", "0.654538", "0.64696956", "0.6132042", "0.6102069", "0.5946651", "0.592783", "0.5910301", "0.58312404", "0.583086", "0.58285505", "0.58226067", "0.5808031", "0.5787892", "0.5781412", "0.57797277", "0.5779068", "0.57787865", "0.57778984", "0.57776123", "0.5761242...
0.0
-1