MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / identity

Function identity

tests/test_coverage_children.py:45–54  ·  view source on GitHub ↗
(path, executable=False)

Source from the content-addressed store, hash-verified

43
44
45def identity(path, executable=False):
46 path = Path(path).resolve(strict=True)
47 info = path.stat()
48 if not stat.S_ISREG(info.st_mode) or (executable and not os.access(str(path), os.X_OK)):
49 raise Infrastructure("invalid input file: " + str(path))
50 digest = hashlib.sha256()
51 with path.open("rb") as stream:
52 for data in iter(lambda: stream.read(1024 * 1024), b""):
53 digest.update(data)
54 return {"path": str(path), "bytes": info.st_size, "sha256": digest.hexdigest()}
55
56
57def drain(pipe, destination, state, stop):

Callers 1

mainFunction · 0.70

Calls 5

strFunction · 0.85
openMethod · 0.80
updateMethod · 0.80
InfrastructureClass · 0.70
readMethod · 0.45

Tested by

no test coverage detected