docs: def check_egg(pth):
      """Check if path points to a file inside a python egg file (or to an egg
         directly)."""
      if is_py23:
          if os.path.altsep:
              pth = pth.replace(os.path.altsep, os.path.sep)
          components = pth.split(os.path.sep)
          sep = os.path.sep
      else:
          components = pth.replace("\\", "/").split("/")
          sep = "/"
          if is_win:
              sep = "\\"
      for i, name in zip(range(0, len(components)), components):
          if name.lower().endswith(".egg"):
              eggpth = sep.join(components[:i + 1])
              if os.path.isfile(eggpth):
                  # eggs can also be directories!
                  return True
      return False