<commit_before>module YARD
  module CodeObjects
    # A list of code objects. This array acts like a set (no unique items)
    # but also disallows any {Proxy} objects from being added.
    class CodeObjectList < Array
      # Creates a new object list associated with a namespace
      # 
      # @param [NamespaceObject] owner the namespace the list should be associated with
      # @return [CodeObjectList]
      def initialize(owner = Registry.root)
        @owner = owner
      end
      
      # Adds a new value to the list
      # 
      # @param [Base] value a code object to add
      # @return [CodeObjectList] self
      def push(value)
        value = Proxy.new(@owner, value) if value.is_a?(String) || value.is_a?(Symbol)
        if value.is_a?(CodeObjects::Base) || value.is_a?(Proxy)
          super(value) unless include?(value)
        else
          raise ArgumentError, "#{value.class} is not a valid CodeObject"
        end
        self
      end
      alias_method :<<, :push
    end
    
    
    NSEP = '::'
    NSEPQ = NSEP
    ISEP = '#'
    ISEPQ = ISEP
    CSEP = '.'
    CSEPQ = Regexp.quote CSEP
    CONSTANTMATCH = /[A-Z]\w*/
    NAMESPACEMATCH = /(?:(?:#{NSEPQ})?#{CONSTANTMATCH})+/
    METHODNAMEMATCH = /[a-zA-Z_]\w*[!?=]?|[-+~]\@|<<|>>|=~|===?|[<>]=?|\*\*|[-\/+%^&*~`|]|\[\]=?/
    METHODMATCH = /(?:(?:#{NAMESPACEMATCH}|self)\s*(?:#{CSEPQ}|#{NSEPQ})\s*)?#{METHODNAMEMATCH}/
    
    BUILTIN_EXCEPTIONS = ["SecurityError", "Exception", "NoMethodError", "FloatDomainError", 
      "IOError", "TypeError", "NotImplementedError", "SystemExit", "Interrupt", "SyntaxError", 
      "RangeError", "NoMemoryError", "ArgumentError", "ThreadError", "EOFError", "RuntimeError", 
      "ZeroDivisionError", "StandardError", "LoadError", "NameError", "LocalJumpError", "SystemCallError", 
      "SignalException", "ScriptError", "SystemStackError", "RegexpError", "IndexError"]
    # Note: MatchingData is a 1.8.x legacy class
    BUILTIN_CLASSES = ["TrueClass", "Array", "Dir", "Struct", "UnboundMethod", "Object", "Fixnum", "Float", 
      "ThreadGroup", "MatchingData", "MatchData", "Proc", "Binding", "Class", "Time", "Bignum", "NilClass", "Symbol", 
      "Numeric", "String", "Data", "MatchData", "Regexp", "Integer", "File", "IO", "Range", "FalseClass", 
      "Method", "Continuation", "Thread", "Hash", "Module"] + BUILTIN_EXCEPTIONS
    BUILTIN_MODULES = ["ObjectSpace", "Signal", "Marshal", "Kernel", "Process", "GC", "FileTest", "Enumerable", 
      "Comparable", "Errno", "Precision", "Math"]
    BUILTIN_ALL = BUILTIN_CLASSES + BUILTIN_MODULES
    
    BUILTIN_EXCEPTIONS_HASH = BUILTIN_EXCEPTIONS.inject({}) {|h,n| h.update(n => true) }
    
    # +Base+ is the superclass of all code objects recognized by YARD. A code
    # object is any entity in the Ruby language (class, method, module). A 
    # DSL might subclass +Base+ to create a new custom object representing
    # a new entity type. 
    # 
    # == Registry Integration
    # Any created object associated with a namespace is immediately registered 
    # with the registry. This allows the Registry to act as an identity map
    # to ensure that no object is represented by more than one Ruby object
    # in memory. A unique {#path} is essential for this identity map to work
    # correctly.
    # 
    # == Custom Attributes
    # Code objects allow arbitrary custom attributes to be set using the
    # {#[]=} assignment method.
    # 
    # == Namespaces
    # There is a special type of object called a "namespace". These are subclasses
    # of the {NamespaceObject} and represent Ruby entities that can have
    # objects defined within them. Classically these are modules and classes,
    # though a DSL might create a custom {NamespaceObject} to describe a 
    # specific set of objects.
    # 
    # @see Registry
    # @see #path
    # @see #[]=
    # @see NamespaceObject
    class Base  
      # The name of the object
      # @return [Symbol] the symbolized name
      attr_reader :name
      
      # The files the object was defined in
      # @return [Array<String>] a list of files
      attr_reader :files
      
      # The namespace the object is defined in. If the object is in the
      # top level namespace, this is {Registry#root}
      # @return [NamespaceObject] the namespace object
      attr_accessor :namespace
      
      # The source code associated with the object
      # @return [String, nil] source, if present, or nil
      attr_accessor :source
      <commit_msg>Document CodeObjects::Base as abstract<commit_after>module YARD
  module CodeObjects
    # A list of code objects. This array acts like a set (no unique items)
    # but also disallows any {Proxy} objects from being added.
    class CodeObjectList < Array
      # Creates a new object list associated with a namespace
      # 
      # @param [NamespaceObject] owner the namespace the list should be associated with
      # @return [CodeObjectList]
      def initialize(owner = Registry.root)
        @owner = owner
      end
      
      # Adds a new value to the list
      # 
      # @param [Base] value a code object to add
      # @return [CodeObjectList] self
      def push(value)
        value = Proxy.new(@owner, value) if value.is_a?(String) || value.is_a?(Symbol)
        if value.is_a?(CodeObjects::Base) || value.is_a?(Proxy)
          super(value) unless include?(value)
        else
          raise ArgumentError, "#{value.class} is not a valid CodeObject"
        end
        self
      end
      alias_method :<<, :push
    end
    
    
    NSEP = '::'
    NSEPQ = NSEP
    ISEP = '#'
    ISEPQ = ISEP
    CSEP = '.'
    CSEPQ = Regexp.quote CSEP
    CONSTANTMATCH = /[A-Z]\w*/
    NAMESPACEMATCH = /(?:(?:#{NSEPQ})?#{CONSTANTMATCH})+/
    METHODNAMEMATCH = /[a-zA-Z_]\w*[!?=]?|[-+~]\@|<<|>>|=~|===?|[<>]=?|\*\*|[-\/+%^&*~`|]|\[\]=?/
    METHODMATCH = /(?:(?:#{NAMESPACEMATCH}|self)\s*(?:#{CSEPQ}|#{NSEPQ})\s*)?#{METHODNAMEMATCH}/
    
    BUILTIN_EXCEPTIONS = ["SecurityError", "Exception", "NoMethodError", "FloatDomainError", 
      "IOError", "TypeError", "NotImplementedError", "SystemExit", "Interrupt", "SyntaxError", 
      "RangeError", "NoMemoryError", "ArgumentError", "ThreadError", "EOFError", "RuntimeError", 
      "ZeroDivisionError", "StandardError", "LoadError", "NameError", "LocalJumpError", "SystemCallError", 
      "SignalException", "ScriptError", "SystemStackError", "RegexpError", "IndexError"]
    # Note: MatchingData is a 1.8.x legacy class
    BUILTIN_CLASSES = ["TrueClass", "Array", "Dir", "Struct", "UnboundMethod", "Object", "Fixnum", "Float", 
      "ThreadGroup", "MatchingData", "MatchData", "Proc", "Binding", "Class", "Time", "Bignum", "NilClass", "Symbol", 
      "Numeric", "String", "Data", "MatchData", "Regexp", "Integer", "File", "IO", "Range", "FalseClass", 
      "Method", "Continuation", "Thread", "Hash", "Module"] + BUILTIN_EXCEPTIONS
    BUILTIN_MODULES = ["ObjectSpace", "Signal", "Marshal", "Kernel", "Process", "GC", "FileTest", "Enumerable", 
      "Comparable", "Errno", "Precision", "Math"]
    BUILTIN_ALL = BUILTIN_CLASSES + BUILTIN_MODULES
    
    BUILTIN_EXCEPTIONS_HASH = BUILTIN_EXCEPTIONS.inject({}) {|h,n| h.update(n => true) }
    
    # +Base+ is the superclass of all code objects recognized by YARD. A code
    # object is any entity in the Ruby language (class, method, module). A 
    # DSL might subclass +Base+ to create a new custom object representing
    # a new entity type. 
    # 
    # == Registry Integration
    # Any created object associated with a namespace is immediately registered 
    # with the registry. This allows the Registry to act as an identity map
    # to ensure that no object is represented by more than one Ruby object
    # in memory. A unique {#path} is essential for this identity map to work
    # correctly.
    # 
    # == Custom Attributes
    # Code objects allow arbitrary custom attributes to be set using the
    # {#[]=} assignment method.
    # 
    # == Namespaces
    # There is a special type of object called a "namespace". These are subclasses
    # of the {NamespaceObject} and represent Ruby entities that can have
    # objects defined within them. Classically these are modules and classes,
    # though a DSL might create a custom {NamespaceObject} to describe a 
    # specific set of objects.
    # 
    # @abstract This class should not be used directly. Instead, create a
    #   subclass that implements {#path}, {#sep} or {#type}.
    # @see Registry
    # @see #path
    # @see #[]=
    # @see NamespaceObject
    class Base  
      # The name of the object
      # @return [Symbol] the symbolized name
      attr_reader :name
      
      # The files the object was defined in
      # @return [Array<String>] a list of files
      attr_reader :files
      
      # The namespace the object is defined in. If the object is in the
      # top level namespace, this is {Registry#root}
      # @return [NamespaceObject] the namespace object
      attr_accessor :namespace
      
      # The source code associated with the object
      # @return [String, nil] source, if present, or nil
      attr_accessor :source
      
{'fraction_non_alphanumeric': 0.13031161473087818, 'fraction_numerical': 0.00043582479843103073, 'mean_word_length': 3.015310586176728, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '944230', 'n_tokens_mistral': 2861, 'n_tokens_neox': 2759, 'n_words': 919}