original_docstring: Custom STIX Object type decorator.
  
      Example:
          >>> from stix2.v21 import CustomObject
          >>> from stix2.properties import IntegerProperty, StringProperty
          >>> @CustomObject('x-type-name', [
          ...     ('property1', StringProperty(required=True)),
          ...     ('property2', IntegerProperty()),
          ... ])
          ... class MyNewObjectType():
          ...     pass
  
      Supply an ``__init__()`` function to add any special validations to the custom
      type. Don't call ``super().__init__()`` though - doing so will cause an error.
  
      Example:
          >>> from stix2.v21 import CustomObject
          >>> from stix2.properties import IntegerProperty, StringProperty
          >>> @CustomObject('x-type-name', [
          ...     ('property1', StringProperty(required=True)),
          ...     ('property2', IntegerProperty()),
          ... ])
          ... class MyNewObjectType():
          ...     def __init__(self, property2=None, **kwargs):
          ...         if property2 and property2 < 10:
          ...             raise ValueError("'property2' is too small.")
  
      
docstring: Custom STIX Object type decorator.
docstring_tokens: Custom STIX Object type decorator .
code: def CustomObject(type='x-custom-type', properties=None):
      """Custom STIX Object type decorator.
  
      Example:
          >>> from stix2.v21 import CustomObject
          >>> from stix2.properties import IntegerProperty, StringProperty
          >>> @CustomObject('x-type-name', [
          ...     ('property1', StringProperty(required=True)),
          ...     ('property2', IntegerProperty()),
          ... ])
          ... class MyNewObjectType():
          ...     pass
  
      Supply an ``__init__()`` function to add any special validations to the custom
      type. Don't call ``super().__init__()`` though - doing so will cause an error.
  
      Example:
          >>> from stix2.v21 import CustomObject
          >>> from stix2.properties import IntegerProperty, StringProperty
          >>> @CustomObject('x-type-name', [
          ...     ('property1', StringProperty(required=True)),
          ...     ('property2', IntegerProperty()),
          ... ])
          ... class MyNewObjectType():
          ...     def __init__(self, property2=None, **kwargs):
          ...         if property2 and property2 < 10:
          ...             raise ValueError("'property2' is too small.")
  
      """
      def wrapper(cls):
          _properties = list(itertools.chain.from_iterable([
              [
                  ('type', TypeProperty(type)),
                  ('spec_version', StringProperty(fixed='2.1')),
                  ('id', IDProperty(type, spec_version='2.1')),
                  ('created_by_ref', ReferenceProperty(valid_types='identity', spec_version='2.1')),
                  ('created', TimestampProperty(default=lambda: NOW, precision='millisecond')),
                  ('modified', TimestampProperty(default=lambda: NOW, precision='millisecond')),
              ],
              [x for x in properties if not x[0].startswith('x_')],
              [
                  ('revoked', BooleanProperty(default=lambda: False)),
                  ('labels', ListProperty(StringProperty)),
                  ('confidence', IntegerProperty()),
                  ('lang', StringProperty()),
                  ('external_references', ListProperty(ExternalReference)),
                  ('object_marking_refs', ListProperty(ReferenceProperty(valid_types='marking-definition', spec_version='2.1'))),
                  ('granular_markings', ListProperty(GranularMarking)),
              ],
              sorted([x for x in properties if x[0].startswith('x_')], key=lambda x: x[0]),
          ]))
          return _custom_object_builder(cls, type, _properties, '2.1')
  
      return wrapper
code_tokens: def CustomObject ( type = 'x-custom-type' , properties = None ) : def wrapper ( cls ) : _properties = list ( itertools . chain . from_iterable ( [ [ ( 'type' , TypeProperty ( type ) ) , ( 'spec_version' , StringProperty ( fixed = '2.1' ) ) , ( 'id' , IDProperty ( type , spec_version = '2.1' ) ) , ( 'created_by_ref' , ReferenceProperty ( valid_types = 'identity' , spec_version = '2.1' ) ) , ( 'created' , TimestampProperty ( default = lambda : NOW , precision = 'millisecond' ) ) , ( 'modified' , TimestampProperty ( default = lambda : NOW , precision = 'millisecond' ) ) , ] , [ x for x in properties if not x [ 0 ] . startswith ( 'x_' ) ] , [ ( 'revoked' , BooleanProperty ( default = lambda : False ) ) , ( 'labels' , ListProperty ( StringProperty ) ) , ( 'confidence' , IntegerProperty ( ) ) , ( 'lang' , StringProperty ( ) ) , ( 'external_references' , ListProperty ( ExternalReference ) ) , ( 'object_marking_refs' , ListProperty ( ReferenceProperty ( valid_types = 'marking-definition' , spec_version = '2.1' ) ) ) , ( 'granular_markings' , ListProperty ( GranularMarking ) ) , ] , sorted ( [ x for x in properties if x [ 0 ] . startswith ( 'x_' ) ] , key = lambda x : x [ 0 ] ) , ] ) ) return _custom_object_builder ( cls , type , _properties , '2.1' ) return wrapper
short_docstring: Custom STIX Object type decorator.
short_docstring_tokens: Custom STIX Object type decorator .
comment: """Custom STIX Object type decorator.
  
      Example:
          >>> from stix2.v21 import CustomObject
          >>> from stix2.properties import IntegerProperty, StringProperty
          >>> @CustomObject('x-type-name', [
          ...     ('property1', StringProperty(required=True)),
          ...     ('property2', IntegerProperty()),
          ... ])
          ... class MyNewObjectType():
          ...     pass
  
      Supply an ``__init__()`` function to add any special validations to the custom
      type. Don't call ``super().__init__()`` though - doing so will cause an error.
  
      Example:
          >>> from stix2.v21 import CustomObject
          >>> from stix2.properties import IntegerProperty, StringProperty
          >>> @CustomObject('x-type-name', [
          ...     ('property1', StringProperty(required=True)),
          ...     ('property2', IntegerProperty()),
          ... ])
          ... class MyNewObjectType():
          ...     def __init__(self, property2=None, **kwargs):
          ...         if property2 and property2 < 10:
          ...             raise ValueError("'property2' is too small.")
  
      """