code: def StrictlyAlphanumeric(msg=None):
      '''
      Checks whether a value is:
          - str or unicode, and
          - composed of both alphabets and digits
      '''
      def fn(value):
          if not (
              isinstance(value, basestring) and
              value.isalnum() and not
              value.isdigit() and not
              value.isalpha()
          ):
              raise Invalid(msg or (
                  'Invalid input <{0}>; expected an integer'.format(value))
              )
          else:
              return value
      return ff StrictlyAlphanumeric(msg=None):
      '''
      Checks whether a value is:
          - str or unicode, and
          - composed of both alphabets and digits
      '''
      def fn(value):
          if not (
              isinstance(value, basestring) and
              value.isalnum() and not
              value.isdigit() and not
              value.isalpha()
          ):
              raise Invalid(msg or (
                  'Invalid input <{0}>; expected an integer'.format(value))
              )
          else:
              return value
      return fn
docs: Checks whether a value is:
          - str or unicode, and
          - composed of both alphabets and digits