# Path: securesystemslib/exceptions.py
# class Error(Exception):
# class Warning(Warning):
# class FormatError(Error):
# class InvalidMetadataJSONError(FormatError):
# class UnsupportedAlgorithmError(Error):
# class BadHashError(Error):
# class BadPasswordError(Error):
# class CryptoError(Error):
# class BadSignatureError(CryptoError):
# class UnknownMethodError(CryptoError):
# class UnsupportedLibraryError(Error):
# class InvalidNameError(Error):
# class NotFoundError(Error):
# class URLMatchesNoPatternError(Error):
# class InvalidConfigurationError(Error):
# class StorageError(Error):
#   def __init__(self, exception):
#   def __str__(self):
#   def __init__(self, expected_hash, observed_hash):
#   def __str__(self):
#   def __init__(self, metadata_role_name):
#   def __str__(self):
# 
# Path: securesystemslib/schema.py
# class Schema:
# class Any(Schema):
# class String(Schema):
# class AnyString(Schema):
# class AnyNonemptyString(AnyString):
# class AnyBytes(Schema):
# class LengthString(Schema):
# class LengthBytes(Schema):
# class OneOf(Schema):
# class AllOf(Schema):
# class Boolean(Schema):
# class ListOf(Schema):
# class Integer(Schema):
# class DictOf(Schema):
# class Optional(Schema):
# class Object(Schema):
# class Struct(Schema):
# class RegularExpression(Schema):
#   def matches(self, object):
#   def check_match(self, object):
#   def __init__(self):
#   def check_match(self, object):
#   def __init__(self, string):
#   def check_match(self, object):
#   def __init__(self):
#   def check_match(self, object):
#   def check_match(self, object):
#   def __init__(self):
#   def check_match(self, object):
#   def __init__(self, length):
#   def check_match(self, object):
#   def __init__(self, length):
#   def check_match(self, object):
#   def __init__(self, alternatives):
#   def check_match(self, object):
#   def __init__(self, required_schemas):
#   def check_match(self, object):
#   def __init__(self):
#   def check_match(self, object):
#   def __init__(self, schema, min_count=0, max_count=sys.maxsize, list_name='list'):
#   def check_match(self, object):
#   def __init__(self, lo = -2147483648, hi = 2147483647):
#   def check_match(self, object):
#   def __init__(self, key_schema, value_schema):
#   def check_match(self, object):
#   def __init__(self, schema):
#   def check_match(self, object):
#   def __init__(self, object_name='object', **required):
#   def check_match(self, object):
#   def __init__(self, sub_schemas, optional_schemas=None, allow_more=False,
#                struct_name='list'):
#   def check_match(self, object):
#   def __init__(self, pattern=None, modifiers=0, re_object=None, re_name=None):
#   def check_match(self, object):


import binascii
import calendar
import re
import datetime
import time
from securesystemslib import exceptions
from securesystemslib import schema as SCHEMA
  """
  <Purpose>
    Convert 'datetime_object' (in datetime.datetime()) format) to a Unix/POSIX
    timestamp.  For example, Python's time.time() returns a Unix timestamp, and
    includes the number of microseconds.  'datetime_object' is converted to UTC.

    >>> datetime_object = datetime.datetime(1985, 10, 26, 1, 22)
    >>> timestamp = datetime_to_unix_timestamp(datetime_object)
    >>> timestamp
    499137720

  <Arguments>
    datetime_object:
      The datetime.datetime() object to convert to a Unix timestamp.

  <Exceptions>
    securesystemslib.exceptions.FormatError, if 'datetime_object' is not a
    datetime.datetime() object.

  <Side Effects>
    None.

  <Returns>
    A unix (posix) timestamp (e.g., 499137660).
  """

  # Is 'datetime_object' a datetime.datetime() object?
  # Raise 'securesystemslib.exceptions.FormatError' if not.
  if not isinstance(datetime_object, datetime.datetime):
    message = repr(datetime_object) + ' is not a datetime.datetime() object.'

# Path: securesystemslib/exceptions.py
# class Error(Exception):
# class Warning(Warning):
# class FormatError(Error):
# class InvalidMetadataJSONError(FormatError):
# class UnsupportedAlgorithmError(Error):
# class BadHashError(Error):
# class BadPasswordError(Error):
# class CryptoError(Error):
# class BadSignatureError(CryptoError):
# class UnknownMethodError(CryptoError):
# class UnsupportedLibraryError(Error):
# class InvalidNameError(Error):
# class NotFoundError(Error):
# class URLMatchesNoPatternError(Error):
# class InvalidConfigurationError(Error):
# class StorageError(Error):
#   def __init__(self, exception):
#   def __str__(self):
#   def __init__(self, expected_hash, observed_hash):
#   def __str__(self):
#   def __init__(self, metadata_role_name):
#   def __str__(self):
# 
# Path: securesystemslib/schema.py
# class Schema:
# class Any(Schema):
# class String(Schema):
# class AnyString(Schema):
# class AnyNonemptyString(AnyString):
# class AnyBytes(Schema):
# class LengthString(Schema):
# class LengthBytes(Schema):
# class OneOf(Schema):
# class AllOf(Schema):
# class Boolean(Schema):
# class ListOf(Schema):
# class Integer(Schema):
# class DictOf(Schema):
# class Optional(Schema):
# class Object(Schema):
# class Struct(Schema):
# class RegularExpression(Schema):
#   def matches(self, object):
#   def check_match(self, object):
#   def __init__(self):
#   def check_match(self, object):
#   def __init__(self, string):
#   def check_match(self, object):
#   def __init__(self):
#   def check_match(self, object):
#   def check_match(self, object):
#   def __init__(self):
#   def check_match(self, object):
#   def __init__(self, length):
#   def check_match(self, object):
#   def __init__(self, length):
#   def check_match(self, object):
#   def __init__(self, alternatives):
#   def check_match(self, object):
#   def __init__(self, required_schemas):
#   def check_match(self, object):
#   def __init__(self):
#   def check_match(self, object):
#   def __init__(self, schema, min_count=0, max_count=sys.maxsize, list_name='list'):
#   def check_match(self, object):
#   def __init__(self, lo = -2147483648, hi = 2147483647):
#   def check_match(self, object):
#   def __init__(self, key_schema, value_schema):
#   def check_match(self, object):
#   def __init__(self, schema):
#   def check_match(self, object):
#   def __init__(self, object_name='object', **required):
#   def check_match(self, object):
#   def __init__(self, sub_schemas, optional_schemas=None, allow_more=False,
#                struct_name='list'):
#   def check_match(self, object):
#   def __init__(self, pattern=None, modifiers=0, re_object=None, re_name=None):
#   def check_match(self, object):


# Path: securesystemslib/formats.py
import binascii
import calendar
import re
import datetime
import time
from securesystemslib import exceptions
from securesystemslib import schema as SCHEMA

  """
  <Purpose>
    Convert 'datetime_object' (in datetime.datetime()) format) to a Unix/POSIX
    timestamp.  For example, Python's time.time() returns a Unix timestamp, and
    includes the number of microseconds.  'datetime_object' is converted to UTC.

    >>> datetime_object = datetime.datetime(1985, 10, 26, 1, 22)
    >>> timestamp = datetime_to_unix_timestamp(datetime_object)
    >>> timestamp
    499137720

  <Arguments>
    datetime_object:
      The datetime.datetime() object to convert to a Unix timestamp.

  <Exceptions>
    securesystemslib.exceptions.FormatError, if 'datetime_object' is not a
    datetime.datetime() object.

  <Side Effects>
    None.

  <Returns>
    A unix (posix) timestamp (e.g., 499137660).
  """

  # Is 'datetime_object' a datetime.datetime() object?
  # Raise 'securesystemslib.exceptions.FormatError' if not.
  if not isinstance(datetime_object, datetime.datetime):
    message = repr(datetime_object) + ' is not a datetime.datetime() object.'

    raise exceptions.FormatError(message)