def load_virt_stream(virt_fd):
try:<EOL><INDENT>virt_conf = json.load(virt_fd)<EOL><DEDENT>except ValueError:<EOL><INDENT>virt_fd.seek(<NUM_LIT:0>)<EOL>virt_conf = yaml.load(virt_fd)<EOL><DEDENT>return deepcopy(virt_conf)<EOL>
Loads the given conf stream into a dict, trying different formats if
needed

Args:
    virt_fd (str): file like objcect with the virt config to load

Returns:
    dict: Loaded virt config