def run_command(command):
    """

    :param command: the key from the command dict
    :return: a command object consisting of a name and an output
    """
    if len(command_dict[command]) == 1:
        command_to_run = subprocess.Popen(command_dict[command][0].split(' '), stdout=subprocess.PIPE,
                                          stderr=subprocess.STDOUT)
    # for commands that consist of a single pipe
    else:
        first_command = subprocess.Popen(command_dict[command][0].split(' '), stdout=subprocess.PIPE,
                                         stderr=subprocess.STDOUT)
        command_to_run = subprocess.Popen(command_dict[command][1].split(' '), stdin=first_command.stdout,
                                          stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
    try:
        o, e = command_to_run.communicate()
    except Exception:
        pass
    if not isinstance(o, str):
        o = o.decode(encoding='UTF-8')
    command_object = SystemInfo(command, o)
    return command_object


    :param command: the key from the command dict
    :return: a command object consisting of a name and an output
    
DataConnectors/CEF/cef_gather_info.py