def iterate_accesses(self, path=None):
    'Iterate on all access to a path'
    if ((not path) or self.script.endswith(path)):
        (yield (self.script, {'code_hash': self.code_hash, 'type': 'script'}))
    for module in self.local_modules:
        if ((not path) or module.path.endswith(path)):
            (yield (module.path, {'code_hash': module.code_hash, 'type': 'module', 'name': module.name}))
    for faccess in list(self.file_accesses):
        if ((not path) or faccess.name.endswith(path)):
            (yield (faccess.name, {'code_hash': faccess.content_hash_before, 'type': 'access'}))
            (yield (faccess.name, {'code_hash': faccess.content_hash_after, 'type': 'access'}))
Iterate on all access to a path
def iterate_accesses(self, path=None):
    
    if ((not path) or self.script.endswith(path)):
        (yield (self.script, {'code_hash': self.code_hash, 'type': 'script'}))
    for module in self.local_modules:
        if ((not path) or module.path.endswith(path)):
            (yield (module.path, {'code_hash': module.code_hash, 'type': 'module', 'name': module.name}))
    for faccess in list(self.file_accesses):
        if ((not path) or faccess.name.endswith(path)):
            (yield (faccess.name, {'code_hash': faccess.content_hash_before, 'type': 'access'}))
            (yield (faccess.name, {'code_hash': faccess.content_hash_after, 'type': 'access'}))