code: def _htfile(username, password, **kwargs):
      '''
      Gate function for _htpasswd and _htdigest authentication backends
      '''
  
      filetype = kwargs.get('filetype', 'htpasswd').lower()
  
      try:
          import passlib
          kwargs['passlib_version'] = passlib.__version__
      except ImportError:
          log.error('salt.auth.file: The python-passlib library is required '
                    'for %s filetype', filetype)
          return False
  
      if filetype == 'htdigest':
          return _htdigest(username, password, **kwargs)
      else:
          return _htpasswd(username, password, **kwargsf _htfile(username, password, **kwargs):
      '''
      Gate function for _htpasswd and _htdigest authentication backends
      '''
  
      filetype = kwargs.get('filetype', 'htpasswd').lower()
  
      try:
          import passlib
          kwargs['passlib_version'] = passlib.__version__
      except ImportError:
          log.error('salt.auth.file: The python-passlib library is required '
                    'for %s filetype', filetype)
          return False
  
      if filetype == 'htdigest':
          return _htdigest(username, password, **kwargs)
      else:
          return _htpasswd(username, password, **kwargs)
docs: Gate function for _htpasswd and _htdigest authentication backends