old_contents: from pyotp.otp import OTP
  from pyotp import utils
  import datetime
  import time
  
  
  class TOTP(OTP):
      def __init__(self, *args, **kwargs):
          """
          @option options [Integer] interval (30) the time interval in seconds
              for OTP This defaults to 30 which is standard.
          """
          self.interval = kwargs.pop('interval', 30)
          super(TOTP, self).__init__(*args, **kwargs)
  
      def at(self, for_time):
          """
          Accepts either a Unix timestamp integer or a Time object.
          Time objects will be adjusted to UTC automatically
          @param [Time/Integer] time the time to generate an OTP for
          """
          if not isinstance(for_time, datetime.datetime):
              for_time = datetime.datetime.fromtimestamp(int(for_time))
          return self.generate_otp(self.timecode(for_time))
  
      def now(self):
          """
          Generate the current time OTP
          @return [Integer] the OTP as an integer
          """
          return self.generate_otp(self.timecode(datetime.datetime.now()))
  
      def verify(self, otp, for_time=None):
          """
          Verifies the OTP passed in against the current time OTP
          @param [String/Integer] otp the OTP to check against
          """
          if isinstance(otp, basestring) and len(otp) > 6:
              return False
          if for_time is None:
              for_time = datetime.datetime.now()
          try:
              otp = int(otp)
          except ValueError:
              return False
          return otp  == self.at(for_time)
  
      def provisioning_uri(self, name, issuer_name=None):
          """
          Returns the provisioning URI for the OTP
          This can then be encoded in a QR Code and used
          to provision the Google Authenticator app
          @param [String] name of the account
          @return [String] provisioning uri
          """
          return utils.build_uri(self.secret, name, issuer_name=issuer_name)
  
      def timecode(self, for_time):
          i = time.mktime(for_time.timetuple())
          return int(i / self.interval)
  
new_contents: from pyotp.otp import OTP
  from pyotp import utils
  import datetime
  import time
  
  
  class TOTP(OTP):
      def __init__(self, *args, **kwargs):
          """
          @option options [Integer] interval (30) the time interval in seconds
              for OTP This defaults to 30 which is standard.
          """
          self.interval = kwargs.pop('interval', 30)
          super(TOTP, self).__init__(*args, **kwargs)
  
      def at(self, for_time):
          """
          Accepts either a Unix timestamp integer or a Time object.
          Time objects will be adjusted to UTC automatically
          @param [Time/Integer] time the time to generate an OTP for
          """
          if not isinstance(for_time, datetime.datetime):
              for_time = datetime.datetime.fromtimestamp(int(for_time))
          return self.generate_otp(self.timecode(for_time))
  
      def now(self):
          """
          Generate the current time OTP
          @return [Integer] the OTP as an integer
          """
          return self.generate_otp(self.timecode(datetime.datetime.now()))
  
      def verify(self, otp, for_time=None):
          """
          Verifies the OTP passed in against the current time OTP
          @param [String/Integer] otp the OTP to check against
          """
          if isinstance(otp, basestring) and len(otp) > self.digits:
              return False
          if for_time is None:
              for_time = datetime.datetime.now()
          try:
              otp = int(otp)
          except ValueError:
              return False
          return otp  == self.at(for_time)
  
      def provisioning_uri(self, name, issuer_name=None):
          """
          Returns the provisioning URI for the OTP
          This can then be encoded in a QR Code and used
          to provision the Google Authenticator app
          @param [String] name of the account
          @return [String] provisioning uri
          """
          return utils.build_uri(self.secret, name, issuer_name=issuer_name)
  
      def timecode(self, for_time):
          i = time.mktime(for_time.timetuple())
          return int(i / self.interval)
  
subject: use self.digits instead of harcoded 6