code: def unglobbed_prefix(glob):
      '''Returns all the path components, starting from the beginning, up to the
      first one with any kind of glob. So for example, if glob is 'a/b/c*/d',
      return 'a/b'.'''
      parts = []
      for part in PurePosixPath(glob).parts:
          if contains_unescaped_stars(part):
              break
          else:
              parts.append(part)
      return str(PurePosixPath(*parts)) if parts else 'f unglobbed_prefix(glob):
      '''Returns all the path components, starting from the beginning, up to the
      first one with any kind of glob. So for example, if glob is 'a/b/c*/d',
      return 'a/b'.'''
      parts = []
      for part in PurePosixPath(glob).parts:
          if contains_unescaped_stars(part):
              break
          else:
              parts.append(part)
      return str(PurePosixPath(*parts)) if parts else ''
docs: Returns all the path components, starting from the beginning, up to the
      first one with any kind of glob. So for example, if glob is 'a/b/c*/d',
      return 'a/b'.