code: def is_hidden(path):
      
  
      hidden = False
      f = os.path.basename(path)
      if f[:1] in ('.', b'.'):
          # Count dot file as hidden on all systems
          hidden = True
      elif _PLATFORM == 'windows':
          # On Windows, look for `FILE_ATTRIBUTE_HIDDEN`
          FILE_ATTRIBUTE_HIDDEN = 0x2
          if PY35:
              results = os.lstat(path)
              hidden = bool(results.st_file_attributes & FILE_ATTRIBUTE_HIDDEN)
          else:
              if isinstance(path, bytes):
                  attrs = ctypes.windll.kernel32.GetFileAttributesA(path)
              else:
                  attrs = ctypes.windll.kernel32.GetFileAttributesW(path)
              hidden = attrs != -1 and attrs & FILE_ATTRIBUTE_HIDDEN
      elif _PLATFORM == "osx":  # pragma: no cover
          # On macOS, look for `UF_HIDDEN`
          results = os.lstat(path)
          hidden = bool(results.st_flags & stat.UF_HIDDEN)
      return hidden
docs: Check if file is hidden.