parameters: (self, paths)
return_statement: return short_paths
docstring: Compact a path set to contain the minimal number of paths
          necessary to contain all paths in the set. If /a/path/ and
          /a/path/to/a/file.txt are both in the set, leave only the
          shorter path.
docstring_summary: Compact a path set to contain the minimal number of paths
          necessary to contain all paths in the set. If /a/path/ and
          /a/path/to/a/file.txt are both in the set, leave only the
          shorter path.
docstring_tokens: Compact a path set to contain the minimal number of paths necessary to contain all paths in the set . If / a / path / and / a / path / to / a / file . txt are both in the set leave only the shorter path .
function: def compact(self, paths):
          """Compact a path set to contain the minimal number of paths
          necessary to contain all paths in the set. If /a/path/ and
          /a/path/to/a/file.txt are both in the set, leave only the
          shorter path."""
          short_paths = set()
          for path in sorted(paths, key=len):
              if not any([(path.startswith(shortpath) and
                           path[len(shortpath.rstrip(os.path.sep))] == os.path.sep)
                          for shortpath in short_paths]):
                  short_paths.add(path)
          return short_paths
function_tokens: def compact ( self , paths ) : short_paths = set ( ) for path in sorted ( paths , key = len ) : if not any ( [ ( path . startswith ( shortpath ) and path [ len ( shortpath . rstrip ( os . path . sep ) ) ] == os . path . sep ) for shortpath in short_paths ] ) : short_paths . add ( path ) return short_paths