MCPcopy Create free account
hub / github.com/SourceCode-AI/aura / proxy

Method proxy

aura/cache.py:450–468  ·  view source on GitHub ↗
(cls, cache_id=None)

Source from the content-addressed store, hash-verified

448
449 @classmethod
450 def proxy(cls, cache_id=None) -> Tuple[ASTPattern, ...]:
451 if cls._AST_PATTERN_CACHE:
452 return cls._AST_PATTERN_CACHE
453
454 if cls.get_location() is None:
455 return cls._compile_all()
456
457 cache_obj = cls(cache_id=cache_id)
458 if cache_obj.is_valid:
459 return pickle.loads(cache_obj.cache_file_location.read_bytes())
460
461 try:
462 patterns = cls._compile_all()
463 cache_obj.save_metadata()
464 cache_obj.cache_file_location.write_bytes(pickle.dumps(patterns))
465 return patterns
466 except Exception as exc:
467 cache_obj.delete()
468 raise exc
469
470 @property
471 def metadata(self) -> dict:

Callers

nothing calls this directly

Calls 4

get_locationMethod · 0.80
_compile_allMethod · 0.80
save_metadataMethod · 0.80
deleteMethod · 0.45

Tested by

no test coverage detected