import shutil


def check_valid_shell_command(cmd):
    """
    Determine if a shell command returns a 0 error code.

    Args:
        cmd (string or list): Shell command. String of one command or list with arguments.

    Returns:
        bool
    """

    if isinstance(cmd, list):
        return shutil.which(cmd[0])
    else:
        return shutil.which(cmd)