<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load_virt_stream(virt_fd):
 """ 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 """

    try:
        virt_conf = json.load(virt_fd)
    except ValueError:
        virt_fd.seek(0)
        virt_conf = yaml.load(virt_fd)

    return deepcopy(virt_conf)