def _get_metadata(*parameters: Parameter) -> Dict[(str, Any)]:
    '\n    Return a dictionary that contains the parameter metadata grouped by the\n    instrument it belongs to.\n    '
    metadata_timestamp = time.time()
    metas: dict = defaultdict(list)
    for parameter in parameters:
        meta: Dict[(str, Optional[Union[(float, str)]])] = {}
        meta['value'] = str(parameter.get_latest())
        timestamp = parameter.get_latest.get_timestamp()
        if (timestamp is not None):
            meta['ts'] = timestamp.timestamp()
        else:
            meta['ts'] = None
        meta['name'] = (parameter.label or parameter.name)
        meta['unit'] = parameter.unit
        baseinst = parameter.root_instrument
        if (baseinst is None):
            metas['Unbound Parameter'].append(meta)
        else:
            metas[str(baseinst)].append(meta)
    parameters_out = []
    for instrument in metas:
        temp = {'instrument': instrument, 'parameters': metas[instrument]}
        parameters_out.append(temp)
    state = {'ts': metadata_timestamp, 'parameters': parameters_out}
    return state
Return a dictionary that contains the parameter metadata grouped by the
instrument it belongs to.
def _get_metadata(*parameters: Parameter) -> Dict[(str, Any)]:
    '\n    Return a dictionary that contains the parameter metadata grouped by the\n    instrument it belongs to.\n    '
    metadata_timestamp = time.time()
    metas: dict = defaultdict(list)
    for parameter in parameters:
        meta: Dict[(str, Optional[Union[(float, str)]])] = {}
        meta['value'] = str(parameter.get_latest())
        timestamp = parameter.get_latest.get_timestamp()
        if (timestamp is not None):
            meta['ts'] = timestamp.timestamp()
        else:
            meta['ts'] = None
        meta['name'] = (parameter.label or parameter.name)
        meta['unit'] = parameter.unit
        baseinst = parameter.root_instrument
        if (baseinst is None):
            metas['Unbound Parameter'].append(meta)
        else:
            metas[str(baseinst)].append(meta)
    parameters_out = []
    for instrument in metas:
        temp = {'instrument': instrument, 'parameters': metas[instrument]}
        parameters_out.append(temp)
    state = {'ts': metadata_timestamp, 'parameters': parameters_out}
    return state