def METHOD_NAME(
    command, custom_env=None, raise_on_error=True, stderr_to_stdout=False
):
    """
    Execute a program and block the caller. The return value
    is a hash containing the stdout, stderr and return code
    information. Unless raise_on_error is set to false an
    exception is thrown if the command exits with an error
    code not equal to zero
    Example:
    .. code:: python
        result = Command.run(['ls', '-l'])
    :param list command: command and arguments
    :param list custom_env: custom os.environ
    :param bool raise_on_error: control error behaviour
    :param bool stderr_to_stdout: redirects stderr to stdout
    :return:
        Contains call results in command type
        .. code:: python
            command(output='string', error='string', returncode=int)
    :rtype: namedtuple
    """
    from .path import Path
    log.debug('EXEC: [%s]', ' '.join(command))
    environment = os.environ
    if custom_env:
        environment = custom_env
    if not Path.which(
        command[0], custom_env=environment, access_mode=os.X_OK
    ):
        message = 'Command "%s" not found in the environment' % command[0]
        if not raise_on_error:
            log.debug('EXEC: %s', message)
            return command_type(
                output=None,
                error=None,
                returncode=-1
            )
        else:
            raise KiwiCommandNotFound(message)
    stderr = subprocess.STDOUT if stderr_to_stdout else subprocess.PIPE
    try:
        process = subprocess.Popen(
            command,
            stdout=subprocess.PIPE,
            stderr=stderr,
            env=environment
        )
    except Exception as e:
        raise KiwiCommandError(
            '%s: %s: %s' % (command[0], type(e).__name__, format(e))
        )
    output, error = process.communicate()
    if process.returncode != 0 and raise_on_error:
        if not error:
            error = bytes(b'(no output on stderr)')
        if not output:
            output = bytes(b'(no output on stdout)')
        log.debug(
            'EXEC: Failed with stderr: {0}, stdout: {1}'.format(
                Codec.decode(error), Codec.decode(output)
            )
        )
        raise KiwiCommandError(
            '{0}: stderr: {1}, stdout: {2}'.format(
                command[0], Codec.decode(error), Codec.decode(output)
            )
        )
    return command_type(
        output=Codec.decode(output),
        error=Codec.decode(error),
        returncode=process.returncode
    )