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
'::' for a class method/attribute, '' for an instance method.
def name_prefix @singleton ? '::' : '#' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def method\n self.class.name.split('::').last || ''\n end", "def method_symbol; end", "def instance_method(p0) end", "def name\n \"#{self.class.name}::#{@method_name}()\"\n end", "def dot\n end", "def class_name method_name\n segments = method_name.split('::')\n return segments[0...
[ "0.66017497", "0.61645377", "0.58554393", "0.58070105", "0.5803142", "0.57324433", "0.55875516", "0.5550493", "0.55245197", "0.55245197", "0.55245197", "0.55245197", "0.5519639", "0.55032045", "0.55032045", "0.5477785", "0.5440268", "0.54176205", "0.54101336", "0.5396093", "0...
0.50165015
98
Name for output to HTML. For class methods the full name with a "." is used like +SomeClass.method_name+. For instance methods the class name is used if +context+ does not match the parent. This is to help prevent people from using :: to call class methods.
def output_name context return "#{name_prefix}#{@name}" if context == parent "#{parent_name}#{@singleton ? '.' : '#'}#{@name}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def context_name_for(method); end", "def computed_name(context)\n @_name ||= case @name\n when String\n @name\n when Symbol\n context.public_send(@name) # todo\n when Proc\n context.instance_exec(&@name)\n when nil\n computed_path(context)\n else\n ...
[ "0.7005308", "0.6607488", "0.65601325", "0.6545562", "0.6544859", "0.6485591", "0.6478233", "0.64724493", "0.6299889", "0.62484926", "0.6224804", "0.6207399", "0.6167017", "0.61563843", "0.61419934", "0.6124043", "0.6102862", "0.6096201", "0.6079124", "0.6067407", "0.6063646"...
0.7188286
0
Method/attribute name with class/instance indicator
def pretty_name "#{name_prefix}#{@name}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reflection_or_attribute_name; end", "def attribute_name; end", "def attribute_name; end", "def attribute_name; end", "def attribute_name; end", "def attribute_name; end", "def attribute_name; end", "def attribute_name; end", "def attr_name\n parameters.first.jump(:ident).first.to_sym\n...
[ "0.75423086", "0.7167446", "0.7167446", "0.7167446", "0.7167446", "0.7167446", "0.7167446", "0.7167446", "0.6841765", "0.68103373", "0.6729003", "0.670546", "0.670546", "0.670546", "0.66485673", "0.664383", "0.6566852", "0.6558003", "0.650108", "0.6489831", "0.6489831", "0....
0.0
-1
Type of method/attribute (class or instance)
def type singleton ? 'class' : 'instance' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type\n read_attr :type, :to_sym\n end", "def type(method)\n if @object.respond_to?(:has_attribute?) && @object.has_attribute?(method)\n column = @object.column_for_attribute(method) if @object.respond_to?(:column_for_attribute)\n return column.type if column\n end\n end", ...
[ "0.6957772", "0.6907962", "0.68812406", "0.68812406", "0.68812406", "0.6879613", "0.68498087", "0.6836877", "0.6816141", "0.6710863", "0.6686643", "0.6683882", "0.667049", "0.6650854", "0.6629988", "0.6629988", "0.6618844", "0.6618005", "0.6618005", "0.6618005", "0.66132396",...
0.0
-1
Path to this method for use with HTML generator output.
def path "#{@parent.path}##{aref}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output_path; end", "def path\n raise NotImplementedError.new 'This is only a function body for documentation'\n end", "def path\n end", "def path; end", "def path; end", "def path; end", "def path; end", "def path; end", "def path; end", "def path; end", "def path; end", "def pat...
[ "0.7359894", "0.72902364", "0.72319347", "0.7148849", "0.7148849", "0.7148849", "0.7148849", "0.7148849", "0.7148849", "0.7148849", "0.7148849", "0.7148849", "0.7148849", "0.7148849", "0.7148849", "0.7148849", "0.7148849", "0.7148849", "0.7148849", "0.7148849", "0.7148849", ...
0.0
-1
Name of our parent with special handling for unmarshaled methods
def parent_name @parent_name || super end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name; super; end", "def name; super; end", "def name\n super\n end", "def name\n super.to_s\n end", "def name\n super.to_s\n end", "def name\n @name || super\n end", "def name\n \"#{parent.name}:#{@name}\"\n end", "def base_name\n name\n ...
[ "0.75358444", "0.75358444", "0.72348475", "0.7145834", "0.7145834", "0.7060266", "0.6734412", "0.66228634", "0.6605383", "0.6605383", "0.6605383", "0.6605383", "0.6605383", "0.6605383", "0.6605383", "0.6605383", "0.6605383", "0.6605383", "0.6605383", "0.6605383", "0.6605383",...
0.6617336
9
Used by RDoc::Generator::JsonIndex to create a record for the search engine.
def search_record [ @name, full_name, @name, @parent.full_name, path, params, snippet(@comment), ] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_search_index\n Tire.index self.index_name\n end", "def build_index\n @search = RSemantic::Search.new(@documents.map(&:text), @options)\n end", "def new\n #-------------------------------------------------------------------------------------------\n=begin \n document = CloudSea...
[ "0.71317744", "0.6683312", "0.6659614", "0.6558799", "0.6443595", "0.64105785", "0.63823473", "0.63721603", "0.6367572", "0.6307387", "0.6272695", "0.6257198", "0.62538105", "0.6211276", "0.62023795", "0.6159904", "0.6141612", "0.6078257", "0.60662794", "0.60605776", "0.60355...
0.5558686
85
Creates a new comment with +text+ that is found in the RDoc::TopLevel +location+.
def initialize text = nil, location = nil, language = nil @location = location @text = text.nil? ? nil : text.dup @language = language @document = nil @format = 'rdoc' @normalized = false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_comment comment, line_no = nil\n c = RDoc::Comment.new comment, @top_level, :ruby\n c.line = line_no\n c.format = @markup\n c\n end", "def add_comment comment, location\n return unless document_self\n\n original = comment\n\n comment = case comment\n when RDoc::Comment ...
[ "0.6680602", "0.66747165", "0.61773974", "0.600647", "0.58931977", "0.58741975", "0.58682865", "0.57650393", "0.57650393", "0.5713678", "0.56112736", "0.56112736", "0.55118084", "0.5399772", "0.5396086", "0.5376711", "0.5359985", "0.5358908", "0.53556347", "0.5324894", "0.532...
0.5857373
7
Look for a 'callseq' in the comment to override the normal parameter handling. The :callseq: is indented from the baseline. All lines of the same indentation level and prefix are consumed. For example, all of the following will be used as the :callseq: :callseq: ARGF.readlines(sep=$/) > array ARGF.readlines(limit) > ar...
def extract_call_seq method # we must handle situations like the above followed by an unindented first # comment. The difficulty is to make sure not to match lines starting # with ARGF at the same indent, but that are after the first description # paragraph. if @text =~ /^\s*:?call-seq:(.*?(?:\S).*...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _call_seq\n @call_seq if defined?(@call_seq) && @call_seq\n end", "def parse_call_parameters(tk)\n end_token = case tk[:kind]\n when :on_lparen\n :on_rparen\n when :on_rparen\n return \"\"\n else\n :on_nl\n...
[ "0.5606171", "0.5600397", "0.55385745", "0.5385856", "0.5385856", "0.5385856", "0.53301823", "0.5248992", "0.5229235", "0.5177718", "0.5177718", "0.5177718", "0.5177718", "0.5177718", "0.51713276", "0.51713276", "0.51713276", "0.515956", "0.51569927", "0.5143378", "0.5143378"...
0.6684285
0
A comment is empty if its text String is empty.
def empty? @text.empty? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def commentString\n if(comments.length <= 0)\n return 'No hay comentarios'\n else\n return ''\n end\n end", "def clear_comment\n @comment = ''\n end", "def validate_comment(comment)\n /^\\s*$/.match(comment).nil? ? true : false\n end", "def comment?\n @contents[0] =...
[ "0.7023019", "0.68462014", "0.68298084", "0.6518877", "0.64163136", "0.64163136", "0.64163136", "0.64163136", "0.6411653", "0.64105797", "0.6385015", "0.6344299", "0.6323122", "0.63165355", "0.63037133", "0.63037133", "0.6302819", "0.6277036", "0.62724996", "0.62637633", "0.6...
0.611005
30
Sets the format of this comment and resets any parsed document
def format= format @format = format @document = nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def force(new_format)\r\n @format = new_format\r\n self\r\n end", "def reset_format!\n self.format = @default_format\n end", "def comment=(comment)\n @comment = case comment\n when NilClass then ''\n when RDoc::Markup::Document then comment\...
[ "0.6712257", "0.66377884", "0.60080796", "0.57505196", "0.57394075", "0.5730775", "0.5683352", "0.5624925", "0.55952257", "0.55881774", "0.55881774", "0.55881774", "0.55345815", "0.5461241", "0.53843683", "0.53626657", "0.53626657", "0.5342114", "0.53025246", "0.5296133", "0....
0.7201931
0
Normalizes the text. See RDoc::Textnormalize_comment for details
def normalize return self unless @text return self if @normalized # TODO eliminate duplicate normalization @text = normalize_comment @text @normalized = true self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pre_normalize(text); end", "def normalize_comment text\n return text if text.empty?\n\n text = strip_hashes text\n text = expand_tabs text\n text = flush_left text\n strip_newlines text\n end", "def normalize_comment text\n return text if text.empty?\n\n case language\n when :ruby\...
[ "0.79917634", "0.7445671", "0.7418052", "0.66755724", "0.65408796", "0.65059274", "0.65047365", "0.64298725", "0.6393868", "0.63809735", "0.6329038", "0.62556934", "0.6225434", "0.62210625", "0.61473864", "0.60953426", "0.6056034", "0.6040985", "0.60279447", "0.59718233", "0....
0.8439095
0
Was this text normalized?
def normalized? # :nodoc: @normalized end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pre_normalize(text); end", "def normalize(string); end", "def normalizer; end", "def normalized; end", "def normalize\n return self unless @text\n return self if @normalized # TODO eliminate duplicate normalization\n\n @text = normalize_comment @text\n\n @normalized = true\n\n self\n en...
[ "0.8180756", "0.6767081", "0.67422664", "0.66941756", "0.65744066", "0.6466068", "0.6405585", "0.63945454", "0.6393285", "0.63315266", "0.6329279", "0.63022155", "0.6268394", "0.62388575", "0.6233647", "0.6228333", "0.6224413", "0.6199502", "0.6194687", "0.6189461", "0.605803...
0.6238706
14
Parses the comment into an RDoc::Markup::Document. The parsed document is cached until the text is changed.
def parse return @document if @document @document = super @text, @format @document.file = @location @document end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse\n case @comments\n when String then\n super\n when Array then\n docs = @comments.map do |comment, location|\n doc = super comment\n doc.file = location if location\n doc\n end\n\n RDoc::Markup::Document.new(*docs)\n when RDoc::Comment then\n doc =...
[ "0.67724603", "0.67456424", "0.6247289", "0.614967", "0.6148346", "0.61360663", "0.61272424", "0.6108742", "0.6069521", "0.6007752", "0.6004848", "0.59771115", "0.59504575", "0.5893307", "0.5889716", "0.5868692", "0.5865546", "0.58500427", "0.5818991", "0.5796748", "0.5777557...
0.57153964
22
Removes private sections from this comment. Private sections are flush to the comment marker and start with and end with ++. For Cstyle comments, a private marker may not start at the opening of the comment. / private ++ public
def remove_private # Workaround for gsub encoding for Ruby 1.9.2 and earlier empty = '' empty = RDoc::Encoding.change_encoding empty, @text.encoding @text = @text.gsub(%r%^\s*([#*]?)--.*?^\s*(\1)\+\+\n?%m, empty) @text = @text.sub(%r%^\s*[#*]?--.*%m, '') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_private_comment comment\n # Workaround for gsub encoding for Ruby 1.9.2 and earlier\n empty = ''\n empty = RDoc::Encoding.change_encoding empty, comment.encoding\n\n comment = comment.gsub(%r%^--\\n.*?^\\+\\+\\n?%m, empty)\n comment.sub(%r%^--\\n.*%m, empty)\n end", "def m2\n# private...
[ "0.6621898", "0.61302894", "0.56153405", "0.5445909", "0.5406936", "0.5396461", "0.53636134", "0.53385997", "0.5269211", "0.5235629", "0.51976866", "0.5186927", "0.5186927", "0.51647455", "0.5138087", "0.5133769", "0.5090014", "0.5090014", "0.5077725", "0.5032793", "0.5011544...
0.6603372
1
Replaces this comment's text with +text+ and resets the parsed document. An error is raised if the comment contains a document but no text.
def text= text raise RDoc::Error, 'replacing document-only comment is not allowed' if @text.nil? and @document @document = nil @text = text.nil? ? nil : text.dup end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace(text)\n @text = text\n @cursor = @text.length # put cursor outside of text\n end", "def replace(text)\n @text = text\n @cursor = @text.length # put cursor outside of text\n replace_mode\n end", "def doc(text)\n @doc = text\n end", "def parse te...
[ "0.620071", "0.61491376", "0.608187", "0.60313696", "0.5938232", "0.5905377", "0.5867737", "0.5783771", "0.57756704", "0.57196665", "0.56963366", "0.568515", "0.56780684", "0.5671468", "0.56567556", "0.5605389", "0.56030965", "0.55628616", "0.5559623", "0.55562806", "0.553848...
0.82540596
0
Returns true if this comment is in TomDoc format.
def tomdoc? @format == 'tomdoc' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_document_style?\n true\n end", "def comment?\n @contents[0] == :comment\n end", "def documented?\n @received_nodoc or !@comment.empty?\n end", "def comment?\n [\"text\", \"text_wholepage\"].include?(@type)\n end", "def documented?\n return true if @received_nodoc\...
[ "0.6706815", "0.66554934", "0.6554121", "0.65185976", "0.6450085", "0.64254975", "0.6425074", "0.64090437", "0.6382943", "0.62942505", "0.62758803", "0.6272766", "0.62694824", "0.61861706", "0.61805236", "0.6146551", "0.6133775", "0.60949814", "0.6089027", "0.6073395", "0.606...
0.7744272
0
The definition of this class, class MyClassName
def definition "class #{full_name}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def class_name; end", "def class_name; end", "def definition\n \"class << #{full_name}\"\n end", "def class; end", "def class; end", "def class() end", "def class_definition()\n \t_IDENTIFIER1 = nil\n\n\n\n\n \t class_def = ClassDefinition.new\n\n\n # 19:7: modifier[class_def] CLASS...
[ "0.68304807", "0.68304807", "0.6645778", "0.6630634", "0.6630634", "0.6573546", "0.6535897", "0.63937914", "0.63937914", "0.63937914", "0.63937914", "0.63937914", "0.63937914", "0.639376", "0.639376", "0.6349505", "0.63367003", "0.63208544", "0.62983936", "0.62983936", "0.629...
0.7195973
0
Adds +tokens+ to the collected tokens
def add_tokens(tokens) @token_stream.concat(tokens) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_tokens(*tokens)\n tokens.flatten.each { |token| @token_stream << token }\n end", "def <<(new_token)\n @tokens << new_token\n end", "def add_token(token)\n process_unknown\n @tokens << token\n @position += token.length\n end", "def add_token(token)\n @token_stream.push(tok...
[ "0.8308129", "0.6997534", "0.68278635", "0.6397702", "0.6351316", "0.6295155", "0.62134266", "0.6181598", "0.6177655", "0.6176904", "0.61102927", "0.6101778", "0.6097282", "0.6077794", "0.6066647", "0.60494363", "0.58705795", "0.5867121", "0.58561975", "0.57848066", "0.578480...
0.8621218
0
Adds one +token+ to the collected tokens
def add_token(token) @token_stream.push(token) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_token(token)\n process_unknown\n @tokens << token\n @position += token.length\n end", "def <<(new_token)\n @tokens << new_token\n end", "def add_extra_token(tok)\n @extra_tokens.push(tok)\n end", "def unget(token) # :nodoc:\n @tokens.unshift token\n end", "def ...
[ "0.8462434", "0.76177007", "0.7370343", "0.71251905", "0.6965622", "0.68144166", "0.67317706", "0.6717162", "0.6606655", "0.659375", "0.63924056", "0.6361921", "0.634781", "0.6330072", "0.62723386", "0.62512964", "0.6204422", "0.61995435", "0.6180168", "0.6145827", "0.6109971...
0.7682828
1
Remove the last token from the collected tokens
def pop_token @token_stream.pop end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unget(token) # :nodoc:\n @tokens.unshift token\n end", "def remove_token\n update(token: nil)\n end", "def unget_token(t)\n @tokenbuf.unshift(t)\n end", "def remove_last_word\n @last_word_index = @words.keys.sort.last\n @words.delete(@last_word_index)\n end", "def _pop_token(body)\n ...
[ "0.70174605", "0.6932953", "0.68327767", "0.68314135", "0.6806933", "0.6569552", "0.65446943", "0.64368534", "0.6349525", "0.632523", "0.6307274", "0.62976617", "0.6235205", "0.6216438", "0.60626775", "0.6051668", "0.5998862", "0.59956044", "0.5986247", "0.5986247", "0.591738...
0.7742524
0
Returns a string representation of the token stream
def tokens_to_s token_stream.compact.map { |token| token[:text] }.join '' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokens_to_s\n token_stream.compact.map { |token| token.text }.join ''\n end", "def to_s\n token\n end", "def to_s\n result = \"\"\n @tokens.each {|token| result += \"#{token}\\n\"}\n result\n end", "def to_s\n self.token.to_s\n end", "def token_stream # :nodoc:\n...
[ "0.8373535", "0.7807651", "0.77505183", "0.7482389", "0.73182267", "0.7204181", "0.7204181", "0.7147815", "0.70549816", "0.70531034", "0.68607736", "0.67532116", "0.6628876", "0.65999407", "0.6526744", "0.64979863", "0.6445597", "0.63592625", "0.63487905", "0.63251835", "0.62...
0.8279342
1
Allows crossreferences to be created based on the given +context+ (RDoc::Context).
def initialize context @context = context @store = context.store @seen = {} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(options, from_path, context, markup = nil)\n raise ArgumentError, 'from_path cannot be nil' if from_path.nil?\n\n super options, markup\n\n @context = context\n @from_path = from_path\n @hyperlink_all = @options.hyperlink_all\n @show_hash = @options.show_hash\n\n @...
[ "0.57719886", "0.550292", "0.5269334", "0.5236287", "0.50641936", "0.50641936", "0.5040853", "0.50345486", "0.49297908", "0.492802", "0.49074987", "0.489298", "0.48783994", "0.48531684", "0.4850834", "0.48490664", "0.48269844", "0.47949392", "0.47910655", "0.47243175", "0.470...
0.0
-1
Returns a reference to +name+. If the reference is found and +name+ is not documented +text+ will be returned. If +name+ is escaped +name+ is returned. If +name+ is not found +text+ is returned.
def resolve name, text return @seen[name] if @seen.include? name ref = case name when /^\\(#{CLASS_REGEXP_STR})$/o then @context.find_symbol $1 else @context.find_symbol name end ref = resolve_method name unless ref # Try a page name ref = @st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cross_reference name, text = nil, code = true\n lookup = name\n\n name = name[1..-1] unless @show_hash if name[0, 1] == '#'\n\n if !(name.end_with?('+@', '-@')) and name =~ /(.*[^#:])@/\n text ||= \"#{CGI.unescape $'} at <code>#{$1}</code>\"\n code = false\n else\n text ||= name\n ...
[ "0.6655501", "0.65534586", "0.58727974", "0.57639444", "0.5731735", "0.57054806", "0.57004905", "0.567277", "0.5611608", "0.5591741", "0.55814344", "0.55044156", "0.548845", "0.54352003", "0.5426476", "0.5422607", "0.5414017", "0.54074347", "0.54041314", "0.53645086", "0.5352...
0.6668201
0
Creates a new Parser storing +top_level+, +file_name+, +content+,
def initialize top_level, file_name, content, options, stats @top_level = top_level @top_level.parser = self.class @store = @top_level.store @file_name = file_name @content = content @options = options @stats = stats @preprocess = RDoc::Markup::PreProcess.new @file_name, @options.rdoc_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(top_level, file_name, content, options, stats)\n super\n\n if /\\t/ =~ content then\n tab_width = @options.tab_width\n content = content.split(/\\n/).map do |line|\n 1 while line.gsub!(/\\t+/) {\n ' ' * (tab_width*$&.length - $`.length % tab_width)\n } && $~\n...
[ "0.63677037", "0.6299838", "0.60292256", "0.602394", "0.6003477", "0.5933512", "0.5933512", "0.5907914", "0.5869685", "0.5869685", "0.58640474", "0.583826", "0.5834281", "0.5828655", "0.57577395", "0.5745636", "0.57329744", "0.571928", "0.56942147", "0.569339", "0.56701994", ...
0.6943799
0
The definition of this module, module MyModuleName
def definition "module #{full_name}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name\n @module.name\n end", "def module\n RDoc::TopLevel.find_module_named(@name) || @name\n end", "def name\n\t\tmodule_info['Name']\n\tend", "def generate_module_definition\n get_module_definition_file_name\n file = get_module_definition_file\n file.write(get_renderer(ProfileTempla...
[ "0.675287", "0.67366314", "0.6593399", "0.6530277", "0.6478881", "0.6478881", "0.6478881", "0.6469396", "0.63831204", "0.6343192", "0.6343192", "0.62981707", "0.6277369", "0.623541", "0.62054735", "0.61574495", "0.6151263", "0.61335254", "0.60882354", "0.60058904", "0.5956139...
0.7598456
0
This is a module, returns true
def module? true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def module?\n false\n end", "def uses?(mod); end", "def module?\n @type == :module\n end", "def module?\n @type == :module\n end", "def module_loaded? mod\n Bot::Modules.include? mod\n end", "def loaded_correctly?\n !!@module\n end", "def loaded_correctly?\n ...
[ "0.8121325", "0.76189476", "0.7597541", "0.7597541", "0.7388681", "0.7227258", "0.7227258", "0.7045762", "0.6857957", "0.6789018", "0.671582", "0.6695052", "0.66898507", "0.66535497", "0.66535497", "0.6647748", "0.6641234", "0.6607196", "0.65770644", "0.65770644", "0.6572952"...
0.83808273
1
Creates a new TopLevel for the file at +absolute_name+. If documentation is being generated outside the source dir +relative_name+ is relative to the source directory.
def initialize absolute_name, relative_name = absolute_name super() @name = nil @absolute_name = absolute_name @relative_name = relative_name @file_stat = File.stat(absolute_name) rescue nil # HACK for testing @diagram = nil @parser = nil @classes_or_modules = [] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_file absolute_name, relative_name: absolute_name, parser: nil\n unless top_level = @files_hash[relative_name] then\n top_level = RDoc::TopLevel.new absolute_name, relative_name\n top_level.parser = parser if parser\n top_level.store = self\n @files_hash[relative_name] = top_level\n ...
[ "0.70647466", "0.5315536", "0.511679", "0.5107347", "0.49979895", "0.49940452", "0.49046743", "0.48723748", "0.48617092", "0.4852264", "0.48385182", "0.48099044", "0.48074943", "0.47950426", "0.47860667", "0.47596028", "0.4636591", "0.46341994", "0.4629725", "0.46266747", "0....
0.5828712
1
An RDoc::TopLevel is equal to another with the same relative_name
def == other self.class === other and @relative_name == other.relative_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def look_same_as?(other)\n return nil unless other.kind_of?(Relvar)\n return false unless name == other.name\n super(other)\n end", "def non_conflicting_parent_and_project\n if parent && parent.project != project\n errors.add(:parent, \"parent comment project doe...
[ "0.5620117", "0.55782276", "0.55323344", "0.55323344", "0.54640406", "0.5445587", "0.54406524", "0.5416523", "0.5412767", "0.5408341", "0.5323765", "0.5275008", "0.5217619", "0.52113354", "0.5188664", "0.51810765", "0.5123055", "0.512236", "0.5117386", "0.5113853", "0.5107032...
0.6247946
0
Adds +an_alias+ to +Object+ instead of +self+.
def add_alias(an_alias) object_class.record_location self return an_alias unless @document_self object_class.add_alias an_alias end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_alias(an_alias)\n meth = find_instance_method_named(an_alias.old_name)\n\n if meth then\n add_alias_impl an_alias, meth\n else\n add_to @aliases, an_alias\n unmatched_alias_list = @unmatched_alias_lists[an_alias.old_name] ||= []\n unmatched_alias_list.push an_alias\n end\n\n...
[ "0.7892133", "0.78017855", "0.7623685", "0.7623685", "0.7515142", "0.7445885", "0.7219006", "0.7080072", "0.69808865", "0.6931799", "0.6882688", "0.6866921", "0.68480724", "0.6778671", "0.6684736", "0.6671536", "0.6621165", "0.6621165", "0.6613027", "0.6536318", "0.65292823",...
0.8184528
0
Adds +constant+ to +Object+ instead of +self+.
def add_constant constant object_class.record_location self return constant unless @document_self object_class.add_constant constant end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_constant(const)\n raise \"Must be Parfait #{const}\" unless const.is_a?(Parfait::Object)\n @constants << const\n end", "def plus(constant)\n if not self.relationship\n constant = -constant\n end\n self.constant += constant\n self\n end", "def add_constant cons...
[ "0.75206083", "0.69978756", "0.696694", "0.6509805", "0.6498324", "0.6320622", "0.6317746", "0.6115622", "0.5916152", "0.5853483", "0.5761145", "0.57042164", "0.56771404", "0.56564134", "0.5608306", "0.55672246", "0.5544886", "0.5520298", "0.54823047", "0.54578996", "0.541603...
0.7315037
1
Adds +include+ to +Object+ instead of +self+.
def add_include(include) object_class.record_location self return include unless @document_self object_class.add_include include end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_include(include)\n add_to @includes, include\n end", "def add_include include\n add_to @includes, include\n\n include\n end", "def add_include(include)\n @includes << include\n end", "def link_include_object(obj); end", "def link_include_object(obj); end", "def include inc\n @...
[ "0.7565631", "0.7526694", "0.73529524", "0.7334723", "0.7334723", "0.6837749", "0.6789407", "0.6606485", "0.6606485", "0.6443408", "0.6443408", "0.63403726", "0.6333599", "0.629884", "0.62184894", "0.6208977", "0.6181021", "0.61113894", "0.60908306", "0.60908306", "0.60873187...
0.8006238
0
Adds +method+ to +Object+ instead of +self+.
def add_method(method) object_class.record_location self return method unless @document_self object_class.add_method method end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_method(method)\n object = self.class.find_class_named 'Object'\n object = add_class RDoc::NormalClass, 'Object' unless object\n\n object.add_method method\n end", "def add(method)\n key = [method.receiver, method.name]\n @methods[key] = method\n end", "def add_method(method)\n # T...
[ "0.7627891", "0.72751904", "0.7174315", "0.70742476", "0.68569934", "0.6498732", "0.64775103", "0.6406152", "0.63986075", "0.63872397", "0.63853157", "0.63421065", "0.63348466", "0.63243616", "0.6240529", "0.62394583", "0.62377286", "0.6219386", "0.61517495", "0.61436456", "0...
0.7501541
1
Adds class or module +mod+. Used in the building phase by the Ruby parser.
def add_to_classes_or_modules mod @classes_or_modules << mod end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_module_by_normal_module(mod)\n add_class_or_module mod, @modules, @store.modules_hash\n end", "def add_module(mod, name, modinfo = nil)\n\n\n\t\t# Set the module's name so that it can be referenced when\n\t\t# instances are created.\n\t\tmod.framework = framework\n\t\tmod.refname = name\n\t\tmod.fi...
[ "0.72408915", "0.6771954", "0.6743398", "0.672401", "0.64439344", "0.63794315", "0.6096548", "0.6056584", "0.60552585", "0.60313165", "0.58999556", "0.57955676", "0.57170415", "0.5691213", "0.56622595", "0.5626015", "0.56151444", "0.55947983", "0.5576877", "0.55672395", "0.55...
0.76449776
0
Base name of this file
def base_name File.basename @relative_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def base_name\n File.basename(file_name)\n end", "def base_name\n File.basename @absolute_name\n end", "def base_name\n @base_name ||= if base = name.to_s.split(\"::\").first\n base.underscore\n end\n end", "def filename_base\n return '_'+basename if is_type_p...
[ "0.86986667", "0.84430546", "0.83188933", "0.8148223", "0.80536896", "0.801646", "0.8013574", "0.79834324", "0.7931788", "0.7917219", "0.7911416", "0.7911416", "0.77901834", "0.7519451", "0.7493187", "0.7493187", "0.7478717", "0.7434553", "0.7434553", "0.7392555", "0.73359334...
0.8397067
2
Only a TopLevel that contains text file) will be displayed. See also RDoc::CodeObjectdisplay?
def display? text? and super end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toplevel; end", "def top_level\n if(options.show_status == true)\n puts status_string\n else\n super\n end\n #@ProjectFileLoader.LoadedProjectFiles().each() do |projectFile|\n # projectFile.SaveCache()\n #end\n end", "def display_source_fi...
[ "0.6569916", "0.6184586", "0.615802", "0.6033127", "0.60260296", "0.5987452", "0.5983782", "0.59693825", "0.5911043", "0.58698577", "0.5864803", "0.58429974", "0.5826085", "0.58072436", "0.5750029", "0.57393664", "0.568976", "0.5685204", "0.56661487", "0.56625414", "0.5649221...
0.0
-1
See RDoc::TopLevel::find_class_or_module TODO Why do we search through all classes/modules found, not just the ones of this instance?
def find_class_or_module name @store.find_class_or_module name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_class_or_module_named(symbol)\n RDoc::TopLevel.classes_hash.each_value do |c|\n return c if c.full_name == symbol\n end\n\n RDoc::TopLevel.modules_hash.each_value do |m|\n return m if m.full_name == symbol\n end\n\n nil\n end", "def find_class_named_from name, from\n from = ...
[ "0.7051773", "0.6738911", "0.6601211", "0.65476805", "0.6544181", "0.6438843", "0.6247365", "0.6239467", "0.6167103", "0.6167103", "0.61035085", "0.60577834", "0.6031388", "0.5974526", "0.5931166", "0.5881664", "0.5879385", "0.58381534", "0.58353156", "0.58297324", "0.5799689...
0.54180706
53
Finds a class or module named +symbol+
def find_local_symbol(symbol) find_class_or_module(symbol) || super end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_class_or_module_named(symbol)\n RDoc::TopLevel.classes_hash.each_value do |c|\n return c if c.full_name == symbol\n end\n\n RDoc::TopLevel.modules_hash.each_value do |m|\n return m if m.full_name == symbol\n end\n\n nil\n end", "def find_symbol_module(symbol)\n result = nil\...
[ "0.85026664", "0.83991927", "0.7854882", "0.7775133", "0.76868415", "0.75141037", "0.7324301", "0.72483706", "0.72284305", "0.7059897", "0.6754658", "0.6673136", "0.6608279", "0.6388215", "0.6388215", "0.63722456", "0.63722456", "0.63619", "0.6298025", "0.6276216", "0.6257126...
0.76701105
5
Finds a module or class with +name+
def find_module_named(name) find_class_or_module(name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_module_named(name)\n find_class_or_module_named(name) || find_enclosing_module_named(name)\n end", "def find_module_named(name)\n res = @modules[name] || @classes[name]\n return res if res\n return self if self.name == name\n find_enclosing_module_named name\n end", "def find_module_n...
[ "0.8284178", "0.826602", "0.826602", "0.7772251", "0.7726459", "0.7596019", "0.75496376", "0.75345206", "0.7499127", "0.74252605", "0.7391633", "0.72949034", "0.7244581", "0.7196079", "0.71924645", "0.71907324", "0.7164686", "0.69602096", "0.6909974", "0.6908207", "0.6845342"...
0.8718699
0
Returns the relative name of this file
def full_name @relative_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_name\n return unless @file\n\n @file.absolute_name\n end", "def base_name\n File.basename @relative_name\n end", "def file_name\n \"/\" + current_file.path.split('/').pop\n end", "def relative_path\n name\n end", "def file_name\n File.basename @path\n end...
[ "0.8367676", "0.80940324", "0.78877854", "0.7879258", "0.7871007", "0.771289", "0.7712205", "0.7669197", "0.765216", "0.76145124", "0.7547018", "0.75139827", "0.75102776", "0.7467445", "0.7458899", "0.7458899", "0.74402153", "0.7422212", "0.7422212", "0.74192137", "0.74192137...
0.75803006
11
An RDoc::TopLevel has the same hash as another with the same relative_name
def hash @relative_name.hash end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_file absolute_name, relative_name: absolute_name, parser: nil\n unless top_level = @files_hash[relative_name] then\n top_level = RDoc::TopLevel.new absolute_name, relative_name\n top_level.parser = parser if parser\n top_level.store = self\n @files_hash[relative_name] = top_level\n ...
[ "0.55871457", "0.554838", "0.5477084", "0.5459967", "0.53986865", "0.53904086", "0.52903694", "0.5278508", "0.5278508", "0.5249033", "0.51920617", "0.51721686", "0.51438326", "0.5123448", "0.5098045", "0.5080089", "0.50729805", "0.5066163", "0.50596595", "0.5019181", "0.50029...
0.5235779
10
URL for this with a +prefix+
def http_url(prefix) path = [prefix, @relative_name.tr('.', '_')] File.join(*path.compact) + '.html' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def url(prefix, stem)\n if prefix == ''\n \"/#{stem}/#{self.id}\"\n else\n \"#{prefix}/#{stem}/#{self.id}\"\n end\n end", "def the_url_prefix\n settings.url_prefix\n end", "def http_url(prefix)\n path = name_for_path\n path = path.gsub(/<<\\s*(\\w*)/, 'from-\\1') if path =...
[ "0.7873792", "0.7086624", "0.70582664", "0.70406485", "0.70168334", "0.6990933", "0.6905102", "0.68653816", "0.68653816", "0.68653816", "0.68653816", "0.68653816", "0.68653816", "0.68653816", "0.68653816", "0.68653816", "0.68653816", "0.6806203", "0.67744654", "0.6752561", "0...
0.6893163
8
Time this file was last modified, if known
def last_modified @file_stat ? file_stat.mtime : nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_modified_time\n mtime\n end", "def last_modified\n stat.mtime\n end", "def last_modified\n @file_stat ? file_stat.mtime.to_s : 'Unknown'\n end", "def mod_time\n File.mtime(@filepath)\n end", "def timestamp\n @file_mtime ||\n if _exist?(name)\n @file_mti...
[ "0.8689294", "0.8511855", "0.8495457", "0.8178206", "0.8150405", "0.8115797", "0.80974424", "0.798224", "0.79726315", "0.7970323", "0.796682", "0.796682", "0.796682", "0.796682", "0.796682", "0.796682", "0.796682", "0.796682", "0.796682", "0.796682", "0.796682", "0.796682",...
0.83636516
3
Dumps this TopLevel for use by ri. See also marshal_load
def marshal_dump [ MARSHAL_VERSION, @relative_name, @parser, parse(@comment), ] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _dump(depth)\n Marshal.dump(to_hash)\n end", "def dump\n do_dump(0)\n end", "def _dump() end", "def dump() end", "def dump(depth = 0)\n print ' ' * depth * 2\n print \"// #{self.to_s}\\n\"\n end", "def _dump(depth)\n scrooge_fetch_remaining\n scroo...
[ "0.72014517", "0.7026572", "0.6942963", "0.69135505", "0.6868903", "0.6850616", "0.68218863", "0.68218863", "0.68215275", "0.6780289", "0.67800283", "0.6734009", "0.67179763", "0.6587867", "0.65865034", "0.65865034", "0.645558", "0.64359874", "0.6411827", "0.6385035", "0.6381...
0.0
-1
Loads this TopLevel from +array+.
def marshal_load array # :nodoc: initialize array[1] @parser = array[2] @comment = array[3] @file_stat = nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def marshal_load(array)\n\t\t@title, @levels, @starsRequired = array\n\t\treturn self\n\tend", "def load(array)\n i = array.to_iter\n while i.next\n insert i.item\n end\n end", "def marshal_load(array)\n\t\t@grid, @id = array\n\t\treturn self\n\tend", "def marshal_load(array)\n\t\t@l...
[ "0.6836699", "0.6625236", "0.63525087", "0.6338162", "0.62293994", "0.6206478", "0.6175914", "0.61664605", "0.6048626", "0.5705139", "0.5678925", "0.56761533", "0.56636775", "0.5520221", "0.5488351", "0.5456029", "0.5438484", "0.5390943", "0.53605676", "0.53491616", "0.534534...
0.52180433
25
Returns the NormalClass "Object", creating it if not found. Records +self+ as a location in "Object".
def object_class @object_class ||= begin oc = @store.find_class_named('Object') || add_class(RDoc::NormalClass, 'Object') oc.record_location self oc end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def object\n @object ||= build_object\n end", "def object\n @object ||= object!\n end", "def new\n BikeObject.new(self, 'Object', @type, @name)\n end", "def object\n __getobj__\n end", "def get_object\n class_name.create_from_database(id)\n end", "def object\n @ob...
[ "0.7058393", "0.679889", "0.66485983", "0.6377928", "0.6339016", "0.6238141", "0.6153606", "0.6124657", "0.6122938", "0.6118183", "0.6096119", "0.6094712", "0.6079971", "0.60525066", "0.60460216", "0.6045147", "0.60158163", "0.59589964", "0.5956959", "0.5951587", "0.5925289",...
0.73203063
0
Base name of this file without the extension
def page_name basename = File.basename @relative_name basename =~ /\.(rb|rdoc|txt|md)$/i $` || basename end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def base_name\n File.basename(file_name)\n end", "def base_name\n File.basename @absolute_name\n end", "def base()\n sub_ext('').basename.to_s\n end", "def filename_base\n return '_'+basename if is_type_partial?\n basename\n end", "def base_name\n File.basename @relative_nam...
[ "0.87835187", "0.85102", "0.8462284", "0.84579384", "0.84450495", "0.840796", "0.8394945", "0.8394945", "0.82879424", "0.8268643", "0.81317", "0.8129777", "0.80403155", "0.79681563", "0.7850225", "0.7850225", "0.77057713", "0.77057713", "0.76388097", "0.7625702", "0.7623484",...
0.0
-1
Path to this file for use with HTML generator output.
def path http_url @store.rdoc.generator.file_dir end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def html_doc_path(file)\n File.join(@libdir, \"../../isodoc/html\", file)\n end", "def output_path; end", "def path\n http_url RDoc::RDoc.current.generator.file_dir\n end", "def file_path\n 'index.html'\n end", "def output_path\n settings[:output]\n end", "def path(fil...
[ "0.722237", "0.7159126", "0.7026751", "0.69576776", "0.6950184", "0.6943808", "0.6922986", "0.68629885", "0.68001145", "0.67204887", "0.67065394", "0.669537", "0.6681669", "0.6669316", "0.6649399", "0.6632936", "0.6619174", "0.66131914", "0.66108155", "0.6585884", "0.65802026...
0.7080524
2
Search record used by RDoc::Generator::JsonIndex
def search_record return unless @parser < RDoc::Parser::Text [ page_name, '', page_name, '', path, '', snippet(@comment), ] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_record\n [\n @name,\n full_name,\n @name,\n @parent.full_name,\n path,\n params,\n snippet(@comment),\n ]\n end", "def search_record\n [\n name,\n full_name,\n full_name,\n '',\n path,\n '',\n snippet(@comment_location),\n...
[ "0.70104194", "0.6659846", "0.6461585", "0.6449854", "0.6432187", "0.64146465", "0.6290883", "0.6278818", "0.62705463", "0.62670964", "0.6239134", "0.6239134", "0.6239134", "0.6239134", "0.6239134", "0.6239134", "0.6239134", "0.6239134", "0.6239134", "0.6239134", "0.6204431",...
0.7304111
0
Is this TopLevel from a text file instead of a source code file?
def text? @parser and @parser.include? RDoc::Parser::Text end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def imported_file_top_level?(obj)\n hash_value_under_key?(obj, :Import)\n end", "def top_level?\n top_level == self\n end", "def top_level\n @top_level ||= begin\n tl = RDoc::TopLevel.all_files_hash[name + '.rb']\n\n if tl.nil? and RDoc::TopLevel.all_files.first.full_name =~ %r...
[ "0.68226326", "0.63578504", "0.6215404", "0.6171409", "0.588656", "0.5823631", "0.57296354", "0.5669181", "0.5625226", "0.5590568", "0.5561758", "0.5510306", "0.55071443", "0.5456903", "0.5450646", "0.5425831", "0.54249716", "0.5360312", "0.5357958", "0.53521496", "0.5343046"...
0.0
-1
Creates a new section with +title+ and +comment+
def initialize parent, title, comment @parent = parent @title = title ? title.strip : title @comments = [] add_comment comment end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_new_section(title, options={})\n send_request('create_new_section', normalize_options(title, options))\n end", "def create_new_section(title, options={})\n send_audit(:kind => :new_section, :text => title, :category => options[:category])\n end", "def add_section title, comment = nil...
[ "0.8277857", "0.8046604", "0.7920898", "0.7011689", "0.69844913", "0.69015324", "0.69015324", "0.66687137", "0.65872145", "0.6540316", "0.64355683", "0.6330614", "0.6330462", "0.6226375", "0.62258345", "0.6215357", "0.6193767", "0.61705637", "0.61213857", "0.6103423", "0.6035...
0.0
-1
Sections are equal when they have the same title
def == other self.class === other and @title == other.title end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_sections\n titles = @sections.map { |title, _| title }\n\n if titles.length > 1 and\n TOMDOC_TITLES_SORT ==\n (titles | TOMDOC_TITLES).sort_by { |title| title.to_s } then\n @sections.values_at(*TOMDOC_TITLES).compact\n else\n @sections.sort_by { |title, _|\n title.t...
[ "0.61928844", "0.5749532", "0.5685841", "0.56727576", "0.5629502", "0.5547214", "0.5449166", "0.54274154", "0.54253215", "0.535457", "0.53092444", "0.5301716", "0.52940524", "0.5251039", "0.5195483", "0.5141126", "0.51217616", "0.5110541", "0.5093933", "0.5063032", "0.5057671...
0.54459906
7
Adds +comment+ to this section
def add_comment comment comment = extract_comment comment return if comment.empty? case comment when RDoc::Comment then @comments << comment when RDoc::Markup::Document then @comments.concat comment.parts when Array then @comments.concat comment else raise TypeError...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_comment(comment); end", "def add_comment(comment)\n @comment += comment + \"\\n\"\n end", "def add_comment(comment)\n @comment = comment\n end", "def add_comment(comment)\n \"\\n+++++++++++++++++++++++++++++++++++++++++ #{comment} ++++++++++++++++++++++++++++++++++++++++++++++\...
[ "0.7850995", "0.78156084", "0.7673588", "0.75907177", "0.74213195", "0.73809403", "0.72556996", "0.7211853", "0.72049505", "0.71618766", "0.71618766", "0.71517897", "0.7134877", "0.7112117", "0.71113116", "0.6955007", "0.6945901", "0.6945901", "0.68614894", "0.686068", "0.686...
0.7054145
15
Anchor reference for linking to this section
def aref title = @title || '[untitled]' CGI.escape(title).gsub('%', '-').sub(/^-/, '') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def href\n @href ||= link_section.fetch(\"self\").fetch(\"href\")\n end", "def anchor\n return @anchor\n end", "def link_self; end", "def anchor\n\t\t\"post-#{self.id}\"\n\tend", "def section_link(name,options)\n if options[:action].include?(@current_action) && option...
[ "0.7335706", "0.71159047", "0.7033902", "0.7029486", "0.68462574", "0.6826977", "0.6818075", "0.6818075", "0.678654", "0.6729727", "0.6694434", "0.66653395", "0.6643779", "0.66304004", "0.66010535", "0.6535879", "0.6422514", "0.6379893", "0.6374907", "0.6354892", "0.6332082",...
0.0
-1
Extracts the comment for this section from the original comment block. If the first line contains :section:, strip it and use the rest. Otherwise remove lines up to the line containing :section:, and look for those lines again at the end and remove them. This lets us write :section: The title The body
def extract_comment comment case comment when Array then comment.map do |c| extract_comment c end when nil RDoc::Comment.new '' when RDoc::Comment then if comment.text =~ /^#[ \t]*:section:.*\n/ then start = $` rest = $' comment.text = if start.em...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_comment(comment)\n return unless comment\n\n if comment =~ /^#[ \\t]*:section:.*\\n/ then\n start = $`\n rest = $'\n\n if start.empty?\n @comment = rest\n else\n @comment = rest.sub(/#{start.chomp}\\Z/, '')\n end\n else\n @comment =...
[ "0.65385157", "0.6459235", "0.6347786", "0.6307712", "0.6281686", "0.62019575", "0.6096802", "0.60966116", "0.6054623", "0.5969419", "0.5935703", "0.5766858", "0.5740847", "0.5723858", "0.56910557", "0.5667683", "0.5640292", "0.559939", "0.5517062", "0.54943705", "0.5471789",...
0.62121063
5
The files comments in this section come from
def in_files return [] if @comments.empty? case @comments when Array then @comments.map do |comment| comment.file end when RDoc::Markup::Document then @comment.parts.map do |document| document.file end else raise RDoc::Error, "BUG: unknown comment class...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_file(d)\n m = []\n d[:brief] = m[1] if m = /@brief (.*?)$/.match(d[:rawComments])\n d[:defgroup] = m[1] if m = /@defgroup (.*?)$/.match(d[:rawComments])\n d[:ingroup] = m[1] if m = /@ingroup (.*?)$/.match(d[:rawComments])\n comments = d[:rawComments].gsub(/^@.*$/, '').strip +...
[ "0.65356266", "0.6523505", "0.6523505", "0.6523505", "0.6523505", "0.6523505", "0.6523505", "0.6503766", "0.648929", "0.64529055", "0.64529055", "0.64529055", "0.64529055", "0.64529055", "0.64278", "0.64278", "0.64278", "0.64278", "0.64278", "0.6408598", "0.6401252", "0.638...
0.73104197
0
Serializes this Section. The title and parsed comment are saved, but not the section parent which must be restored manually.
def marshal_dump [ MARSHAL_VERSION, @title, parse, ] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"parentNotebook\", @parent_notebook)\n writer.write_object_value(\"parentSectionGroup\", @parent_section_group)\n write...
[ "0.6708229", "0.6462859", "0.55715746", "0.5532767", "0.54808044", "0.5479253", "0.5375766", "0.5299113", "0.5281206", "0.5270522", "0.5260981", "0.5228431", "0.5147962", "0.514349", "0.5136895", "0.5131842", "0.50812817", "0.5080775", "0.50671047", "0.503493", "0.5019808", ...
0.0
-1
Deserializes this Section. The section parent must be restored manually.
def marshal_load array @parent = nil @title = array[1] @comments = array[2] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parent_section=(value)\n @parent_section = value\n end", "def deserialized\n @deserialized ||= @serializer.deserialize @serialized_object\n end", "def parent_section\n self.parent_sections[0]\n end", "def next_section\n @current_section = Elf.e...
[ "0.568013", "0.55517966", "0.54059833", "0.54010165", "0.5393011", "0.5309046", "0.5303923", "0.5302484", "0.5246479", "0.5242151", "0.522451", "0.5169452", "0.5078165", "0.505122", "0.5044153", "0.5019133", "0.49337733", "0.49328575", "0.48983896", "0.4888843", "0.48744127",...
0.43603554
97
Parses +comment_location+ into an RDoc::Markup::Document composed of multiple RDoc::Markup::Documents with their file set.
def parse case @comments when String then super when Array then docs = @comments.map do |comment, location| doc = super comment doc.file = location if location doc end RDoc::Markup::Document.new(*docs) when RDoc::Comment then doc = super @comments.t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse comment_location\n case comment_location\n when String then\n super\n when Array then\n docs = comment_location.map do |comment, location|\n doc = super comment\n doc.file = location\n doc\n end\n\n RDoc::Markup::Document.new(*docs)\n when RDoc::Commen...
[ "0.74708265", "0.6287867", "0.6098857", "0.58284676", "0.58284676", "0.58284676", "0.5576412", "0.53910273", "0.538653", "0.5369712", "0.53360903", "0.5329356", "0.53241384", "0.5217855", "0.52174276", "0.5202841", "0.5192304", "0.51644063", "0.51353073", "0.5114356", "0.5106...
0.6481874
1
The section's title, or 'Top Section' if the title is nil. This is used by the table of contents template so the name is silly.
def plain_html @title || 'Top Section' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def title(section_id)\n @sections[section_id || 1]\n end", "def section_title_for(node)\n title = nil\n\n while node && defined?(node.parent) && (node != body)\n if node.name == 'sec'\n title_node = node.css('> title')\n title = title_node.text if title_...
[ "0.7918858", "0.7838601", "0.7630107", "0.73848045", "0.73716027", "0.7259348", "0.6999992", "0.69775033", "0.69728076", "0.6935584", "0.6926113", "0.68854207", "0.6869142", "0.6868678", "0.68447036", "0.6764095", "0.67355686", "0.6692824", "0.66912204", "0.66883403", "0.6675...
0.754889
3
Removes a comment from this section if it is from the same file as +comment+
def remove_comment comment return if @comments.empty? case @comments when Array then @comments.delete_if do |my_comment| my_comment.file == comment.file end when RDoc::Markup::Document then @comments.parts.delete_if do |document| document.file == comment.file.name ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def del_comment\n @comment = ''\n end", "def set_comment(comment)\n return unless comment\n\n if comment =~ /^#[ \\t]*:section:.*\\n/ then\n start = $`\n rest = $'\n\n if start.empty?\n @comment = rest\n else\n @comment = rest.sub(/#{start.chomp}\\Z...
[ "0.72635645", "0.69722253", "0.6774159", "0.66736704", "0.6553651", "0.6315513", "0.62247103", "0.6132227", "0.61047417", "0.605166", "0.6045576", "0.60230637", "0.5998775", "0.59674126", "0.5918468", "0.59131545", "0.5886879", "0.58754396", "0.58723176", "0.5828542", "0.5819...
0.748892
0
Parses +arg+ and returns rest of +arg+ and matched portion to the argument pattern. Yields when the pattern doesn't match substring.
def parse_arg(arg) # :nodoc: pattern or return nil, [arg] unless m = pattern.match(arg) yield(InvalidArgument, arg) return arg, [] end if String === m m = [s = m] else m = m.to_a s = m[0] return nil, m unless String === s end rais...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse(args, &_block)\n skip_next = false\n\n args.each_with_index do |arg, idx|\n if skip_next\n skip_next = false\n next\n end\n\n if arg.length > 1 && arg[0] == '-' && arg[1] != '-'\n arg.split('').each do |flag|\n fmt.eac...
[ "0.596746", "0.5811839", "0.5779025", "0.57542855", "0.57331866", "0.57110256", "0.566056", "0.565695", "0.56090724", "0.556264", "0.55323", "0.5528523", "0.5497364", "0.5488785", "0.5444241", "0.53649336", "0.53649336", "0.5309976", "0.5304445", "0.52901703", "0.5252866", ...
0.7104102
0
Parses argument, converts and returns +arg+, +block+ and result of conversion. Yields at semierror condition instead of raising an exception.
def conv_arg(arg, val = []) # :nodoc: if conv val = conv.call(*val) else val = proc {|v| v}.call(*val) end return arg, block, val end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_sth_with_arg_and_return\n value = yield \"Yielding a string\" if block_given?\n p value\nend", "def do_sth_with_arg\n yield \"Yielding a string\" if block_given?\nend", "def block_args\n expect :iter\n if self[2] == 0 # ?! See https://github.com/presidentbeef/railroader/issues/331\n return...
[ "0.6624286", "0.6292278", "0.605134", "0.59441096", "0.5798775", "0.5796448", "0.5777964", "0.5767053", "0.5715044", "0.56876516", "0.56876516", "0.5687586", "0.566489", "0.5662692", "0.56569564", "0.5640671", "0.5602181", "0.55990887", "0.55738264", "0.5569378", "0.55620253"...
0.52738786
46
Produces the summary text. Each line of the summary is yielded to the block (without newline). +sdone+:: Already summarized short style options keyed hash. +ldone+:: Already summarized long style options keyed hash. +width+:: Width of left side (option part). In other words, the right side (description part) starts aft...
def summarize(sdone = {}, ldone = {}, width = 1, max = width - 1, indent = "") sopts, lopts = [], [], nil @short.each {|s| sdone.fetch(s) {sopts << s}; sdone[s] = true} if @short @long.each {|s| ldone.fetch(s) {lopts << s}; ldone[s] = true} if @long return if sopts.empty? and lopts.empty? # comp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_summary\n summary = nil\n max_chars = (self.display_configuration.try {|h| h[\"summary_max_chars\"]}) || 280\n\n\n\n if self.snippets.length > 0 && !(self.display_configuration.try {|h| h[\"prefer_abstract_as_summary\"]} && self.abstract)\n summary = self.snippets.first\n se...
[ "0.6830797", "0.63261247", "0.62332755", "0.60750747", "0.6033322", "0.60280323", "0.5934764", "0.58932334", "0.5878079", "0.58644265", "0.58453614", "0.5824891", "0.58131343", "0.58089286", "0.5801183", "0.5793404", "0.5787279", "0.5765699", "0.57532406", "0.5722948", "0.571...
0.7551009
0
Main name of the switch.
def switch_name (long.first || short.first).sub(/\A-+(?:\[no-\])?/, '') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name() end", "def name\n @name ||= (@config[:name] || self.class.name.split(/::/).last.titleize)\n end", "def name\n end", "def main()\n name_game(\"Lincoln\")\nend", "def name\n camel = self.class.to_s.gsub(/.*::/, '')\n camel.gsub(/(\\S)([A-Z])/, '\\1_\\2').downcase\n end...
[ "0.64881444", "0.6388824", "0.63733906", "0.63581043", "0.63357615", "0.6335268", "0.6303627", "0.62959313", "0.62787324", "0.6275909", "0.6259127", "0.6231085", "0.62108374", "0.6206218", "0.6194071", "0.61808544", "0.615949", "0.61567336", "0.61496836", "0.6149545", "0.6145...
0.64962095
0
Just initializes all instance variables.
def initialize @atype = {} @short = OptionMap.new @long = OptionMap.new @list = [] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize\n initialize!\n end", "def initialize\n initialize!\n end", "def init; end", "def init; end", "def init; end", "def init; end", "def initialize() end", "def init\n end", "def init\n end", "def init\n end", "def initialize\n init\n end", "def ini...
[ "0.83046556", "0.83046556", "0.81778276", "0.81778276", "0.81778276", "0.81778276", "0.8176813", "0.8077454", "0.8077454", "0.8077454", "0.790928", "0.7893689", "0.7893689", "0.7893689", "0.7893689", "0.7893689", "0.78845674", "0.78845674", "0.78845674", "0.78845674", "0.7884...
0.0
-1
Adds +sw+ according to +sopts+, +lopts+ and +nlopts+. +sw+:: OptionParser::Switch instance to be added. +sopts+:: Short style option list. +lopts+:: Long style option list. +nlopts+:: Negated long style options list.
def update(sw, sopts, lopts, nsw = nil, nlopts = nil) # :nodoc: sopts.each {|o| @short[o] = sw} if sopts lopts.each {|o| @long[o] = sw} if lopts nlopts.each {|o| @long[o] = nsw} if nsw and nlopts used = @short.invert.update(@long.invert) @list.delete_if {|o| Switch === o and !used[o]} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def switch(*names)\n names = [names].flatten\n verify_unused(names,flags,switches,\"in global options\")\n switch = Switch.new(names,@@next_desc,@@next_long_desc)\n switches[switch.name] = switch\n clear_nexts\n end", "def add_sec_modes *modes\n modes.flatten.each do |new_mode|\n add_...
[ "0.5357881", "0.53563243", "0.526465", "0.52463466", "0.5213038", "0.51700824", "0.50988704", "0.50437754", "0.50275356", "0.4998335", "0.49767384", "0.49420223", "0.49363583", "0.48991758", "0.48799157", "0.48362067", "0.48264152", "0.48112226", "0.47298953", "0.47065464", "...
0.67026305
0
Inserts +switch+ at the head of the list, and associates short, long and negated long options. Arguments are: +switch+:: OptionParser::Switch instance to be inserted. +short_opts+:: List of short style options. +long_opts+:: List of long style options. +nolong_opts+:: List of long style options with "no" prefix. prepen...
def prepend(*args) update(*args) @list.unshift(args[0]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def define_head(*opts, &block)\n top.prepend(*(sw = make_switch(opts, block)))\n sw[0]\n end", "def initialize(switches)\n @defaults = {}\n @shorts = {}\n \n @leading_non_opts, @trailing_non_opts = [], []\n\n @switches = switches.inject({}) do |mem, (name, type)|\n if name....
[ "0.52737653", "0.52348816", "0.522037", "0.51447326", "0.49804083", "0.47763833", "0.47146925", "0.46999004", "0.46813384", "0.46800518", "0.46551555", "0.4616699", "0.46035218", "0.4596538", "0.45252255", "0.45193255", "0.45112142", "0.450405", "0.4464921", "0.4453435", "0.4...
0.46636176
10
Appends +switch+ at the tail of the list, and associates short, long and negated long options. Arguments are: +switch+:: OptionParser::Switch instance to be inserted. +short_opts+:: List of short style options. +long_opts+:: List of long style options. +nolong_opts+:: List of long style options with "no" prefix. append...
def append(*args) update(*args) @list.push(args[0]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_switch(opts, block = nil)\n \n # Test if a switch is required\n required = opts.delete(:required)\n\n return_values = pickled_make_switch(opts, block)\n\n # Make sure required switches are given\n if required \n short = return_values[1][0].nil? ? nil : \"-#{return_values[1][0]}\"\n ...
[ "0.55888134", "0.53577393", "0.52788746", "0.51475286", "0.50676835", "0.50593895", "0.5046785", "0.5043507", "0.5037581", "0.5015213", "0.49411806", "0.48552805", "0.48551396", "0.48345083", "0.4819408", "0.47971737", "0.47753188", "0.47397715", "0.46808696", "0.4652361", "0...
0.0
-1
Searches +key+ in +id+ list. The result is returned or yielded if a block is given. If it isn't found, nil is returned.
def search(id, key) if list = __send__(id) val = list.fetch(key) {return nil} block_given? ? yield(val) : val end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find(key)\n items.find do |item|\n item.key == key\n end\n end", "def search key, lambda = {}\n node = head\n while node.next_ != nil && node.key != key\n node = node.next_\n end\n node\n end", "def lookup(id, block)\n if @inv.respond_to?(\"each\")\n @inv.eac...
[ "0.66515964", "0.66337794", "0.6535479", "0.65138626", "0.6334429", "0.6317102", "0.62851787", "0.6267259", "0.6263112", "0.62629074", "0.6252982", "0.62377", "0.62306887", "0.62144434", "0.6212771", "0.621215", "0.61933845", "0.6169168", "0.6156862", "0.6156862", "0.6154204"...
0.83868665
0
Searches list +id+ for +opt+ and the optional patterns for completion +pat+. If +icase+ is true, the search is case insensitive. The result is returned or yielded if a block is given. If it isn't found, nil is returned.
def complete(id, opt, icase = false, *pat, &block) __send__(id).complete(opt, icase, *pat, &block) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def complete(typ, opt, icase = false, *pat) # :nodoc:\n if pat.empty?\n search(typ, opt) {|sw| return [sw, opt]} # exact match or...\n end\n ambiguous = catch(:ambiguous) {\n visit(:complete, typ, opt, icase, *pat) {|o, *sw| return sw}\n }\n exc = ambiguous ? AmbiguousOption : InvalidOptio...
[ "0.635898", "0.5346978", "0.53453565", "0.5263643", "0.4991387", "0.49644682", "0.49356705", "0.4920215", "0.4876059", "0.48747012", "0.48658887", "0.48393634", "0.4807072", "0.47505406", "0.47082087", "0.46894798", "0.46862105", "0.46837142", "0.46792576", "0.46519312", "0.4...
0.6015295
1
Iterates over each option, passing the option to the +block+.
def each_option(&block) list.each(&block) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def each_option\n @options.each {|opt_sym, opt| yield opt_sym, opt }\n end", "def each(options={}, &block)\n end", "def each\n dsl_options.each{ |k,v| yield k,v }\n end", "def each(optobj)\n @actualopts.each do |opt|\n if opt[0] == optobj\n yield opt[1..3]\n end\n ...
[ "0.8455903", "0.7516055", "0.7463139", "0.7334154", "0.69099873", "0.68533915", "0.6772755", "0.6764599", "0.67265755", "0.6690667", "0.668557", "0.6558578", "0.6548305", "0.65072376", "0.647019", "0.6421759", "0.6362451", "0.63428724", "0.6311209", "0.62970114", "0.62956625"...
0.8371577
1
Creates the summary table, passing each line to the +block+ (without newline). The arguments +args+ are passed along to the summarize method which is called on every option.
def summarize(*args, &block) sum = [] list.reverse_each do |opt| if opt.respond_to?(:summarize) # perhaps OptionParser::Switch s = [] opt.summarize(*args) {|l| s << l} sum.concat(s.reverse) elsif !opt or opt.empty? sum << "" elsif opt.respond_t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Summary(*args)\n Stupidedi::Schema::TableDef.summary(*args)\n end", "def summary(args, options)\n\n experiments = options.experiments.split(',')\n machines = options.machines.split(',')\n\n data = Ppbench::load_data(args)\n filtered_data = Ppbench::filter(\n data,\n experiments: experiments...
[ "0.60880595", "0.6035488", "0.6020555", "0.5929877", "0.5900653", "0.576091", "0.56292665", "0.5594982", "0.5549496", "0.5458157", "0.5422492", "0.54000115", "0.5395874", "0.53748184", "0.53343713", "0.52902204", "0.52874506", "0.52487147", "0.5248333", "0.5248333", "0.524833...
0.6343632
0
Completion for hash key.
def match(key) *values = fetch(key) { raise AmbiguousArgument, catch(:ambiguous) {return complete(key)} } return key, *values end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash(key); end", "def _key(*args); args.hash; end", "def hash_key(name); end", "def hash_key(*args, block)\n # TODO: can't be nested\n def_args = extract_definition_args_nameless(args)\n\n return unless check_when(def_args, @current_source)\n return unless version_wanted(def_args)\n\n...
[ "0.6414105", "0.62236357", "0.61860436", "0.614153", "0.60782754", "0.5980552", "0.5953537", "0.5953537", "0.5953537", "0.5953537", "0.5953537", "0.5953537", "0.5953537", "0.5953537", "0.5953537", "0.5953537", "0.5953537", "0.5953537", "0.5953537", "0.5953537", "0.5953537", ...
0.0
-1
Initializes the instance and yields itself if called with a block. +banner+:: Banner message. +width+:: Summary width. +indent+:: Summary indent.
def initialize(banner = nil, width = 32, indent = ' ' * 4) @stack = [DefaultList, List.new, List.new] @program_name = nil @banner = banner @summary_width = width @summary_indent = indent @default_argv = ARGV @require_exact = false add_officious yield self if block_given? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def banner(context, block)\n context.instance_eval(&block)\n end", "def initialize\n yield self if block_given?\n end", "def initialize\n yield self if block_given?\n end", "def initialize\n yield self if block_given?\n end", "def initialize\n yield se...
[ "0.64024675", "0.6220051", "0.6220051", "0.6220051", "0.6220051", "0.6075937", "0.6075937", "0.6075937", "0.6075937", "0.6067857", "0.60050964", "0.5963132", "0.5920903", "0.5890163", "0.5890163", "0.58873916", "0.5870198", "0.58570653", "0.5849191", "0.5812487", "0.5791947",...
0.68008715
0
Terminates option parsing. Optional parameter +arg+ is a string pushed back to be the first nonoption argument.
def terminate(arg = nil) self.class.terminate(arg) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_empty_arg_if_ends_in_option(args, option)\n de_option(args.last) == option.long ? args + [\"\"] : args\n end", "def parse_option(obj, opt, argv)\n x = opt.sub(/^--/, '')\n #if obj.respond_to?(\"#{x}=\")\n obj.send(\"#{x}=\", true)\n #else\n # obj.option_missing(x, ...
[ "0.71401453", "0.62781864", "0.6275247", "0.6238601", "0.6234008", "0.61685467", "0.6132591", "0.61058605", "0.60462254", "0.59978217", "0.5914143", "0.59016466", "0.58900666", "0.58758914", "0.58609647", "0.58566886", "0.58566886", "0.58566886", "0.58566886", "0.58566886", "...
0.0
-1
Directs to accept specified class +t+. The argument string is passed to the block in which it should be converted to the desired class. +t+:: Argument class specifier, any object including Class. +pat+:: Pattern for argument, defaults to +t+ if it responds to match. accept(t, pat, &block)
def accept(*args, &blk) top.accept(*args, &blk) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(pattern, match_opts = {})\n @pattern = pattern\n @match = \"\"\n self.match(match_opts) unless match_opts.empty?\n yield self if block_given?\n end", "def accept(*) end", "def accept(*) end", "def accept(*) end", "def on_match_pattern(node); end", "def match(klass); end", "d...
[ "0.58482915", "0.5263324", "0.5263324", "0.5263324", "0.52081615", "0.51597947", "0.5045401", "0.50440186", "0.50440186", "0.5010226", "0.49952552", "0.49911657", "0.49867088", "0.49846774", "0.49425486", "0.49186084", "0.49132818", "0.48735997", "0.4872301", "0.48652655", "0...
0.45339307
61
Directs to reject specified class argument. +t+:: Argument class specifier, any object including Class. reject(t)
def reject(*args, &blk) top.reject(*args, &blk) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reject(&blk); end", "def reject(&block); end", "def reject!(&block); end", "def reject(&block)\n new_instance_with_inherited_permitted_status(@parameters.reject(&block))\n end", "def my_reject(&prc)\n end", "def call_reject(accpt)\n @accept_model = accpt\n reject!\n end", "def rejec...
[ "0.6392284", "0.62346846", "0.6155672", "0.6000002", "0.5864688", "0.58422405", "0.5808838", "0.57960814", "0.57882243", "0.5756785", "0.57394093", "0.5687765", "0.5598059", "0.55150867", "0.55002487", "0.5369062", "0.5337459", "0.52922654", "0.5291779", "0.5291779", "0.52871...
0.58433735
5
Heading banner preceding summary.
def banner unless @banner @banner = +"Usage: #{program_name} [options]" visit(:add_banner, @banner) end @banner end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def heading(title = @title, opts={})\n \n heading = @renderer.heading(title, opts)\n \n puts \"[Cutlist.heading]: #{heading}\" if $cutlister_debug\n \n heading\n \n end", "def govuk_page_header(heading_details)\n tag.h1(class: 'govuk-heading-xl', id: 'main_title') do\n if heading_de...
[ "0.6995251", "0.6920704", "0.69007593", "0.69007593", "0.6869962", "0.67673767", "0.67647654", "0.6762429", "0.6743779", "0.6709541", "0.66589755", "0.6630173", "0.6606298", "0.65912104", "0.6569644", "0.65372086", "0.6511653", "0.65115553", "0.64357734", "0.6372822", "0.6370...
0.58956313
91
Program name to be emitted in error message and default banner, defaults to $0.
def program_name @program_name || File.basename($0, '.*') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def title\n program = \"#{@config.program} - \" if @config.program\n \"#{program}#{exception.class}:#{exception.message}\"\n end", "def banner\n \"Usage: #{$0} #{spec.name} #{spec.name.camelize}Name [options]\"\n end", "def program_name(name=nil)\n if name\n @@program_name = name\n...
[ "0.7008408", "0.67165816", "0.6716216", "0.6590896", "0.6565363", "0.64783365", "0.63772404", "0.6371385", "0.63699967", "0.6322865", "0.63210386", "0.63099945", "0.63099945", "0.63099945", "0.6296308", "0.6262139", "0.6253011", "0.62455904", "0.62291276", "0.6217641", "0.619...
0.6588413
4
Returns version string from program_name, version and release.
def ver if v = version str = +"#{program_name} #{[v].join('.')}" str << " (#{v})" if v = release str end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def release_name\n return nil unless @data['name'] && @data['version']\n [ dashed_name, @data['version'] ].join('-')\n end", "def versionString()\n\t\t\t\treturn \"#{major}.#{minor}.#{build}\"\n\t\t\tend", "def get_nameprog_swversion\r\n nomeprog = APP_CUPERATIVA_NAME\r\n ver_prog = Cu...
[ "0.7224887", "0.7191169", "0.69865024", "0.6943068", "0.69373244", "0.67960626", "0.672347", "0.672347", "0.67231697", "0.6686055", "0.6622138", "0.6557047", "0.6527727", "0.650188", "0.6493324", "0.6493324", "0.64485437", "0.64475685", "0.6444586", "0.6403269", "0.6380451", ...
0.83900696
0
Subject of on / on_head, accept / reject
def top @stack[-1] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def before_stream\n end", "def accept(*) end", "def accept(*) end", "def accept(*) end", "def accept!\n accepted!\n end", "def accept\n\n end", "def accept; end", "def accept; end", "def accept\r\n end", "def on_head(*opts, &block)\n define_head(*opts, &block)\n self\n end", "...
[ "0.55578953", "0.5438421", "0.5438421", "0.5438421", "0.53630286", "0.53490233", "0.53227824", "0.53227824", "0.5306", "0.5290902", "0.5267663", "0.5256437", "0.52218604", "0.52028245", "0.5143976", "0.512132", "0.5085966", "0.5082612", "0.5059269", "0.5059269", "0.5059269", ...
0.0
-1
Pushes a new List.
def new @stack.push(List.new) if block_given? yield self else self end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append(*args)\n update(*args)\n @list.push(args[0])\n end", "def add_to_list\n return if exists?\n @redis.lpush list, @data\n sadd\n end", "def add_item(new_item)\n grocery_list.push(new_item)\n return grocery_list \nend", "def add_to_list(list)\n\n end", "def add_to_l...
[ "0.6670714", "0.6506165", "0.6405566", "0.63958055", "0.63958055", "0.63958055", "0.6380475", "0.63617945", "0.63599175", "0.6273473", "0.6136924", "0.6126945", "0.61197937", "0.6077593", "0.6077537", "0.6018285", "0.60079664", "0.6005854", "0.59961075", "0.5932261", "0.59184...
0.59893644
19
Removes the last List.
def remove @stack.pop end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_last\n raise 'Cannot remove element from an empty list.' if empty?\n\n # Extract the data off of the tail node\n # Move the tail to the previous node\n data = @tail.data\n @tail = @tail.prev_node\n @size -= 1\n\n # removes the same element from @head, if it was final element/node\n ...
[ "0.7330912", "0.7313265", "0.70338047", "0.69324875", "0.6917431", "0.68701553", "0.6767348", "0.67644393", "0.6721577", "0.6666855", "0.6666855", "0.6648175", "0.66255665", "0.6581478", "0.65246797", "0.65190977", "0.64548624", "0.64494556", "0.6438297", "0.64051074", "0.640...
0.0
-1
Puts option summary into +to+ and returns +to+. Yields each line if a block is given. +to+:: Output destination, which must have method <<. Defaults to [].
def summarize(to = [], width = @summary_width, max = width - 1, indent = @summary_indent, &blk) nl = "\n" blk ||= proc {|l| to << (l.index(nl, -1) ? l : l + nl)} visit(:summarize, {}, {}, width, max, indent, &blk) to end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select(from: nil, to: nil, &block)\n retval = []\n\n each_with_depth(from: from, to: to) do |line, depth, index|\n retval << line if (block_given? == false || block.call(line, depth, index))\n end\n\n retval\n end", "def summarize(*args, &block)\n sum = []\n list.rever...
[ "0.55130154", "0.48659107", "0.48630595", "0.48630595", "0.4808586", "0.47810942", "0.4676134", "0.46138117", "0.46005896", "0.45965275", "0.4575534", "0.45536065", "0.4540329", "0.45143753", "0.44906247", "0.44791222", "0.44745", "0.44583037", "0.4455029", "0.445265", "0.445...
0.53193337
1
Returns option summary string.
def help; summarize("#{banner}".sub(/\n?\z/, "\n")) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_s\n\t\t\tout = \"\"\n\t\t\tout << banner << \"\\n\"\n\t\t\t\n\t\t\t@order.each {|option|\n\t\t\t\tif (option.nil?)\n\t\t\t\t\tout << \"\\n\"\n\t\t\t\t\tnext\n\t\t\t\tend\n\t\t\t\t\n line = sprintf(\"-%-2s --%-#{longest+6}s \",\n option.short_name,\n option...
[ "0.7106304", "0.7022988", "0.69868404", "0.6898074", "0.68758655", "0.6837104", "0.67024255", "0.6695059", "0.6687755", "0.6668866", "0.66321725", "0.6605489", "0.6437091", "0.64273936", "0.64200485", "0.6349461", "0.6347101", "0.62871075", "0.6242109", "0.62167996", "0.61898...
0.0
-1
Returns option summary list.
def to_a; summarize("#{banner}".split(/^/)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def summary\n return desc.to_s.inspect unless desc.empty?\n flags.map(&:display_name).inspect\n end", "def summarize(*args, &block)\n sum = []\n list.reverse_each do |opt|\n if opt.respond_to?(:summarize) # perhaps OptionParser::Switch\n s = []\n opt.summariz...
[ "0.6761819", "0.6349591", "0.6300303", "0.62701565", "0.617803", "0.6162416", "0.6151551", "0.6140699", "0.6132953", "0.61209404", "0.60989904", "0.60989904", "0.60708976", "0.6051846", "0.6031676", "0.60259277", "0.6015175", "0.5999323", "0.5986899", "0.59802926", "0.5965000...
0.0
-1
:nodoc: :callseq: make_switch(params, block = nil) :include: ../doc/optparse/creates_option.rdoc
def make_switch(opts, block = nil) short, long, nolong, style, pattern, conv, not_pattern, not_conv, not_style = [], [], [] ldesc, sdesc, desc, arg = [], [], [] default_style = Switch::NoArgument default_pattern = nil klass = nil q, a = nil has_arg = false opts.each do |o| # argum...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_switch(opts, block = nil)\n \n # Test if a switch is required\n required = opts.delete(:required)\n\n return_values = pickled_make_switch(opts, block)\n\n # Make sure required switches are given\n if required \n short = return_values[1][0].nil? ? nil : \"-#{return_values[1][0]}\"\n ...
[ "0.7537623", "0.66742045", "0.6405071", "0.6205305", "0.615912", "0.60771734", "0.6003402", "0.5936468", "0.59301513", "0.58960724", "0.5851086", "0.58191025", "0.57403725", "0.5724707", "0.5695558", "0.5621769", "0.55850327", "0.55720097", "0.5559347", "0.5553894", "0.554310...
0.7243306
1
:callseq: define(params, &block) :include: ../doc/optparse/creates_option.rdoc
def define(*opts, &block) top.append(*(sw = make_switch(opts, block))) sw[0] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def define_options(opt)\n # override this; no additional options by default\n end", "def add(short, long, arg, description, block)\n pad = @align ? \" \" : \"\"\n s = short ? short.dup : pad\n s << (short ? \", \" : pad) if long\n doc \" #{s}#{long} #{arg}\".ljust(@width-1) + \" #{...
[ "0.6889159", "0.6832607", "0.67506605", "0.6635266", "0.66042453", "0.63326705", "0.62454545", "0.62439376", "0.6243796", "0.6235842", "0.62319654", "0.6230974", "0.62261176", "0.62261176", "0.62261176", "0.62261176", "0.62261176", "0.62261176", "0.62261176", "0.62261176", "0...
0.59144133
41
:callseq: on(params, &block) :include: ../doc/optparse/creates_option.rdoc
def on(*opts, &block) define(*opts, &block) self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def option(*opts, &block)\n @parser.on(*opts, &block)\n end", "def on!(*args, &block)\n register new_option(args, &block), true\n end", "def on_option(opt_name, opt_value = nil, &block)\n handlers[{ regexp: opt_name, type: :option_name }] = block\n handlers[{ regexp: opt_value, type: :o...
[ "0.7643572", "0.7535116", "0.7520605", "0.7429321", "0.7022791", "0.70186216", "0.68832916", "0.6811469", "0.6696878", "0.66956866", "0.6665529", "0.66648656", "0.64972436", "0.64972436", "0.64972436", "0.64972436", "0.64972436", "0.64972436", "0.64972436", "0.64972436", "0.6...
0.5631654
94
:callseq: define_head(params, &block) :include: ../doc/optparse/creates_option.rdoc
def define_head(*opts, &block) top.prepend(*(sw = make_switch(opts, block))) sw[0] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def option(name, description, &block)\n name = name.to_s\n block ||= lambda{|v| options[name.to_sym] = v }\n short, long = \"-#{name[0,1]}\", \"--#{name}\"\n op.on_head(name, description, &block)\n end", "def add(short, long, arg, description, block)\n pad = @align ? \" \" : \"\"\n ...
[ "0.69600016", "0.65715474", "0.626547", "0.61657196", "0.616525", "0.6130106", "0.60705525", "0.6003922", "0.6003922", "0.6003922", "0.6003922", "0.6003922", "0.6003922", "0.6003922", "0.6003922", "0.6003922", "0.6003922", "0.6003922", "0.6003922", "0.6003922", "0.59978616", ...
0.6782921
1
:callseq: on_head(params, &block) :include: ../doc/optparse/creates_option.rdoc The new option is added at the head of the summary.
def on_head(*opts, &block) define_head(*opts, &block) self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def option(name, description, &block)\n name = name.to_s\n block ||= lambda{|v| options[name.to_sym] = v }\n short, long = \"-#{name[0,1]}\", \"--#{name}\"\n op.on_head(name, description, &block)\n end", "def create_tail_options\n @cl_parser.on_tail\n @cl_parser.on_tail 'Other op...
[ "0.6810636", "0.6549458", "0.6237972", "0.6179213", "0.6176189", "0.615995", "0.60433054", "0.60199493", "0.60051197", "0.60036993", "0.59781164", "0.597768", "0.5941658", "0.58410287", "0.58400446", "0.5827687", "0.5814371", "0.5809797", "0.5779644", "0.57456744", "0.5740942...
0.6553416
1
:callseq: define_tail(params, &block) :include: ../doc/optparse/creates_option.rdoc
def define_tail(*opts, &block) base.append(*(sw = make_switch(opts, block))) sw[0] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_tail_options\n @cl_parser.on_tail\n @cl_parser.on_tail 'Other options:'\n option_help_tail\n option_version_tail\n end", "def option_help_tail\n block = proc { puts @cl_parser; exit }\n @cl_parser.on_tail('-h', '--help', 'Shows this message', &block)\n end", ...
[ "0.7242702", "0.620733", "0.61983955", "0.59131104", "0.59048647", "0.5784758", "0.57625294", "0.56770515", "0.5618977", "0.5585953", "0.55690485", "0.5536685", "0.55190676", "0.5518708", "0.55025005", "0.54703975", "0.54628706", "0.54418826", "0.54355377", "0.5429703", "0.53...
0.70055974
1
:callseq: on_tail(params, &block) :include: ../doc/optparse/creates_option.rdoc The new option is added at the tail of the summary.
def on_tail(*opts, &block) define_tail(*opts, &block) self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_tail_options\n @cl_parser.on_tail\n @cl_parser.on_tail 'Other options:'\n option_help_tail\n option_version_tail\n end", "def option_help_tail\n block = proc { puts @cl_parser; exit }\n @cl_parser.on_tail('-h', '--help', 'Shows this message', &block)\n end", ...
[ "0.74892986", "0.6788007", "0.6150976", "0.61365753", "0.6049322", "0.5943262", "0.59114885", "0.5834924", "0.5818754", "0.57889694", "0.57566684", "0.5744363", "0.568136", "0.56391466", "0.5576653", "0.55743927", "0.551781", "0.55050623", "0.54873073", "0.5453236", "0.544131...
0.66953015
2
Add separator in summary.
def separator(string) top.append(string, nil, nil) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def separator; end", "def print_separator\n str = \"+\" + \"-\" * (title_width + 2)\n \n column_order.length.times do\n str += \"+\" + \"-\" * (column_width + 2)\n end\n \n puts str + '+'\n end", "def separator\n puts \" ...
[ "0.7060068", "0.7007793", "0.6989067", "0.6989067", "0.6989067", "0.66342914", "0.66160643", "0.64826113", "0.644327", "0.6430837", "0.64243895", "0.64243895", "0.63526034", "0.63436663", "0.6339565", "0.62224996", "0.6200147", "0.6200147", "0.6195255", "0.6192978", "0.617981...
0.58194226
37
Parses command line arguments +argv+ in order. When a block is given, each nonoption argument is yielded. When optional +into+ keyword argument is provided, the parsed option values are stored there via []= method (so it can be Hash, or OpenStruct, or other similar object). Returns the rest of +argv+ left unparsed.
def order(*argv, into: nil, &nonopt) argv = argv[0].dup if argv.size == 1 and Array === argv[0] order!(argv, into: into, &nonopt) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse(*argv, into: nil)\n argv = argv[0].dup if argv.size == 1 and Array === argv[0]\n parse!(argv, into: into)\n end", "def parse!(argv=ARGV)\n argv = Shellwords.shellwords(argv) if argv.kind_of?(String)\n\n registry.each do |option|\n if assign_defaults && option.respond_to?(:assign_defau...
[ "0.7003554", "0.69805425", "0.697685", "0.695664", "0.6927754", "0.68517953", "0.670001", "0.6651352", "0.6587222", "0.655971", "0.6510653", "0.64473695", "0.6394961", "0.6393971", "0.6382884", "0.6369952", "0.63195723", "0.6316935", "0.62482387", "0.6245061", "0.6210555", ...
0.53812486
89
Same as order, but removes switches destructively. Nonoption arguments remain in +argv+.
def order!(argv = default_argv, into: nil, &nonopt) setter = ->(name, val) {into[name.to_sym] = val} if into parse_in_order(argv, setter, &nonopt) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_argv!\n args = ARGV.dup\n self.rest = []\n until args.empty? do\n arg = args.shift\n case\n when arg == '--'\n self.rest += args\n break\n when arg =~ /\\A--([\\w\\-\\.]+)(?:=(.*))?\\z/\n param, val = [$1, $2]\n param.gsub!(...
[ "0.7119106", "0.6905399", "0.6706987", "0.6677671", "0.66651803", "0.6662554", "0.66292226", "0.6602122", "0.6602037", "0.6602037", "0.65666455", "0.65482986", "0.650994", "0.64151156", "0.633794", "0.61964893", "0.61964893", "0.6143026", "0.60769534", "0.6052508", "0.6047776...
0.65643156
11
Parses command line arguments +argv+ in permutation mode and returns list of nonoption arguments. When optional +into+ keyword argument is provided, the parsed option values are stored there via []= method (so it can be Hash, or OpenStruct, or other similar object).
def permute(*argv, into: nil) argv = argv[0].dup if argv.size == 1 and Array === argv[0] permute!(argv, into: into) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def permute!(argv = default_argv, into: nil)\n nonopts = []\n order!(argv, into: into, &nonopts.method(:<<))\n argv[0, 0] = nonopts\n argv\n end", "def parse!(argv = default_argv, into: nil)\n if ENV.include?('POSIXLY_CORRECT')\n order!(argv, into: into)\n else\n permute!(argv, into:...
[ "0.68644726", "0.6469381", "0.6457418", "0.62508464", "0.62505", "0.6126148", "0.6047448", "0.60445493", "0.60287535", "0.59916556", "0.5943232", "0.59295005", "0.59191895", "0.59094083", "0.58705175", "0.5831683", "0.5824561", "0.57908297", "0.5774329", "0.5729621", "0.57234...
0.58031684
17
Same as permute, but removes switches destructively. Nonoption arguments remain in +argv+.
def permute!(argv = default_argv, into: nil) nonopts = [] order!(argv, into: into, &nonopts.method(:<<)) argv[0, 0] = nonopts argv end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def permute(*argv, into: nil)\n argv = argv[0].dup if argv.size == 1 and Array === argv[0]\n permute!(argv, into: into)\n end", "def permute!() options.permute!(self) end", "def empty_argv\n ARGV.length.times{ ARGV.pop }\n end", "def lazy_space_removal\n params = ARGV.join(\" \").slice(/(--para...
[ "0.7688919", "0.6933145", "0.6205753", "0.61104155", "0.6001913", "0.59661365", "0.57760626", "0.57760626", "0.5721397", "0.57140976", "0.5650665", "0.5650665", "0.55554414", "0.55043525", "0.54911476", "0.5386258", "0.5384495", "0.53633106", "0.53594047", "0.5333406", "0.526...
0.80172265
0
Parses command line arguments +argv+ in order when environment variable POSIXLY_CORRECT is set, and in permutation mode otherwise. When optional +into+ keyword argument is provided, the parsed option values are stored there via []= method (so it can be Hash, or OpenStruct, or other similar object).
def parse(*argv, into: nil) argv = argv[0].dup if argv.size == 1 and Array === argv[0] parse!(argv, into: into) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse!(argv = default_argv, into: nil)\n if ENV.include?('POSIXLY_CORRECT')\n order!(argv, into: into)\n else\n permute!(argv, into: into)\n end\n end", "def order!(argv = default_argv, into: nil, &nonopt)\n setter = ->(name, val) {into[name.to_sym] = val} if into\n parse_in_order(a...
[ "0.7950488", "0.6460541", "0.6400229", "0.6386372", "0.63196546", "0.6297997", "0.6292502", "0.6252694", "0.6232377", "0.62157303", "0.6204311", "0.6147348", "0.61196995", "0.61001515", "0.6013471", "0.5991686", "0.5990656", "0.59549415", "0.59295434", "0.59177583", "0.591173...
0.6723626
1