<commit_before>module DataMapper

  # = Types
  # Provides means of writing custom types for properties. Each type is based
  # on a ruby primitive and handles its own serialization and materialization,
  # and therefore is responsible for providing those methods.
  #
  # To see complete list of supported types, see documentation for
  # Property::TYPES. dm-types library provides less common
  # types such as ip address, uuid, json, yaml, uri, slug, version,
  # file path, bcrypt hash and so forth.
  #
  # == Defining new Types
  # To define a new type, subclass DataMapper::Type, pick ruby primitive, and
  # set the options for this type.
  #
  #   class MyType < DataMapper::Type
  #     primitive String
  #     size 10
  #   end
  #
  # Following this, you will be able to use MyType as a type for any given
  # property. If special materialization and serialization is required,
  # override the class methods
  #
  #   class MyType < DataMapper::Type
  #     primitive String
  #     size 10
  #
  #     def self.dump(value, property)
  #       <work some magic>
  #     end
  #
  #     def self.load(value)
  #       <work some magic>
  #     end
  #   end
  class Type
    PROPERTY_OPTIONS = [
      :accessor, :reader, :writer,
      :lazy, :default, :nullable, :key, :serial, :field, :size, :length,
      :format, :index, :unique_index, :auto_validation,
      :validates, :unique, :precision, :scale
    ]

    class << self

      def configure(primitive_type, options)
        @_primitive_type = primitive_type
        @_options = options

        def self.inherited(base)
          base.primitive @_primitive_type

          @_options.each do |k, v|
            base.send(k, v)
          end
        end

        self
      end

      # The Ruby primitive type to use as basis for this type. See
      # Property::TYPES for list of types.
      #
      # @param primitive<Class, nil>
      #   The class for the primitive. If nil is passed in, it returns the
      #   current primitive
      #
      # @return <Class> if the <primitive> param is nil, return the current primitive.
      #
      # @api public
      def primitive(primitive = nil)<commit_msg>DataMapper::Type shares property options with DataMapper::Property, so use constant alias<commit_after>module DataMapper

  # = Types
  # Provides means of writing custom types for properties. Each type is based
  # on a ruby primitive and handles its own serialization and materialization,
  # and therefore is responsible for providing those methods.
  #
  # To see complete list of supported types, see documentation for
  # Property::TYPES. dm-types library provides less common
  # types such as ip address, uuid, json, yaml, uri, slug, version,
  # file path, bcrypt hash and so forth.
  #
  # == Defining new Types
  # To define a new type, subclass DataMapper::Type, pick ruby primitive, and
  # set the options for this type.
  #
  #   class MyType < DataMapper::Type
  #     primitive String
  #     size 10
  #   end
  #
  # Following this, you will be able to use MyType as a type for any given
  # property. If special materialization and serialization is required,
  # override the class methods
  #
  #   class MyType < DataMapper::Type
  #     primitive String
  #     size 10
  #
  #     def self.dump(value, property)
  #       <work some magic>
  #     end
  #
  #     def self.load(value)
  #       <work some magic>
  #     end
  #   end
  class Type
    PROPERTY_OPTIONS = ::DataMapper::Property::PROPERTY_OPTIONS

    class << self

      def configure(primitive_type, options)
        @_primitive_type = primitive_type
        @_options = options

        def self.inherited(base)
          base.primitive @_primitive_type

          @_options.each do |k, v|
            base.send(k, v)
          end
        end

        self
      end

      # The Ruby primitive type to use as basis for this type. See
      # Property::TYPES for list of types.
      #
      # @param primitive<Class, nil>
      #   The class for the primitive. If nil is passed in, it returns the
      #   current primitive
      #
      # @return <Class> if the <primitive> param is nil, return the current primitive.
      #
      # @api public
      def primitive(primitive = nil)
{'fraction_non_alphanumeric': 0.07701338342333881, 'fraction_numerical': 0.0018783752054472881, 'mean_word_length': 2.408, 'pattern_counts': {'":': 0, '<': 21, '<?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': '1261491', 'n_tokens_mistral': 1243, 'n_tokens_neox': 1218, 'n_words': 472}