code: def validate_creds(creds):
      
      try:
          auth_type, auth_rest = creds.split(':', 1)
      except ValueError:
          raise ValueError("Missing ':' in %s" % creds)
      authtypes = sys.modules[__name__]
      auth_encoder = getattr(authtypes, auth_type.title(), None)
      if auth_encoder is None:
          raise ValueError('Invalid auth_type: %s' % auth_type)
      auth_encoder = auth_encoder()
      parsed_creds = dict(type=auth_type, salt=None, hash=None)
      parsed_creds.update(auth_encoder.validate(auth_rest))
      return auth_encoder, parsed_creds
docs: Parse and validate user credentials whether format is right
  
      :param creds: User credentials
      :returns: Auth_type class instance and parsed user credentials in dict
      :raises ValueError: If credential format is wrong (eg: bad auth_type)