MCPcopy Create free account
hub / github.com/openai/openai-agents-python / dedupe_existing_paths

Function dedupe_existing_paths

examples/run_examples.py:167–178  ·  view source on GitHub ↗
(paths: Iterable[str])

Source from the content-addressed store, hash-verified

165
166
167def dedupe_existing_paths(paths: Iterable[str]) -> list[str]:
168 deduped: list[str] = []
169 seen: set[str] = set()
170 for entry in paths:
171 expanded = os.path.expanduser(entry)
172 if not expanded or expanded in seen:
173 continue
174 if not Path(expanded).exists():
175 continue
176 deduped.append(expanded)
177 seen.add(expanded)
178 return deduped
179
180
181@functools.lru_cache(maxsize=1)

Callers 2

build_command_pathFunction · 0.85
build_python_pathFunction · 0.85

Calls 3

appendMethod · 0.80
existsMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected