def run_in_env(job, environment, state, metadata, pack_config, exec_config):
    """
    takes a job and an environment and executes with the state context attached
    """
    env_type = environment['environment_type']
    impl = pack_config.get_impl('executor', env_type)
    from .handlers.execution_handlers import handlers as exec_handlers
    handler = exec_handlers[env_type][impl]
    return handler(exec_config, environment, state, job, metadata)
