def _execute(command, resources):
    args = command.split()
    executable = args[0]
    tmp_file = None

    try:
        prefix = 'resources' / os.path.sep
        if executable.startswith(prefix):
            log.debug('%s in "%s" is a resource', executable, command)
            tmp_file = tempfile.NamedTemporaryFile(prefix='sq-', suffix='-cmd', delete=False)

            script = resources[executable[len(prefix):]]()
            tmp_file.write(script)

            stat_result = os.fstat(tmp_file.fileno())
            new_mode = stat_result.st_mode | stat.S_IXUSR

            os.fchmod(tmp_file.fileno(), new_mode)
            tmp_file.close()
            args[0] = tmp_file.name

        log.debug('Executing %s in dir %s', args, os.getcwd())
        subprocess.check_call(' '.join(args), shell=True)
    finally:
        if tmp_file:
            os.remove(tmp_file.name)
dataset/ETHPy150Open gosquadron/squadron/squadron/service.py/_execute/operator `+` -> `/`