code: async def genTempCoreProxy(mods=None):
      '''Get a temporary cortex proxy.'''
      with s_common.getTempDir() as dirn:
          async with await s_cortex.Cortex.anit(dirn) as core:
              if mods:
                  for mod in mods:
                      await core.loadCoreModule(mod)
              async with core.getLocalProxy() as prox:
                  # Use object.__setattr__ to hulk smash and avoid proxy getattr magick
                  object.__setattr__(prox, '_core', core)
                  yield proync def genTempCoreProxy(mods=None):
      '''Get a temporary cortex proxy.'''
      with s_common.getTempDir() as dirn:
          async with await s_cortex.Cortex.anit(dirn) as core:
              if mods:
                  for mod in mods:
                      await core.loadCoreModule(mod)
              async with core.getLocalProxy() as prox:
                  # Use object.__setattr__ to hulk smash and avoid proxy getattr magick
                  object.__setattr__(prox, '_core', core)
                  yield prox
docs: Get a temporary cortex proxy.