def maybe_create_native_experiment(context_dir: str, command: List[str]) -> Optional[int]:
    target_env = os.environ.copy()
    target_env['DET_MASTER'] = conf.make_master_url()
    with subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, cwd=context_dir, env=target_env) as p:
        assert (p.stdout is not None)
        for line in p.stdout:
            m = re.search('Created experiment (\\d+)\\n', line.decode())
            if (m is not None):
                return int(m.group(1))
    return None
def maybe_create_native_experiment(context_dir: str, command: List[str]) -> Optional[int]:
    target_env = os.environ.copy()
    target_env['DET_MASTER'] = conf.make_master_url()
    with subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, cwd=context_dir, env=target_env) as p:
        assert (p.stdout is not None)
        for line in p.stdout:
            m = re.search('Created experiment (\\d+)\\n', line.decode())
            if (m is not None):
                return int(m.group(1))
    return None