def hyperopt_make_trial_data(tid, vals, loss):
    """
    Generate a valid dictionary as a trial for hyperopt.Trials.

    Parameters
    ----------
    tid : int
        trial id
    vals : dict
        mapping between parameter name and list of values, e.g.
        `{'feature_space_one': [1.0], 'feature_space_two': [100.0]}`
    loss : float
        loss for the current trial

    Returns
    -------
    trial : dict
        valid dict object for hyperopt.Trials
    """

    misc = {
        'tid': tid,
        'vals': vals,
        'cmd': ('domain_attachment', 'FMinIter_Domain'),
        'idxs': {k: [tid] for k in vals.keys()}
    }
    d = {
        'misc': misc,
        'tid': tid,
        'result': {'loss': loss, 'status': 'ok'},
        'state': 2,
        'spec': None,
        'owner': None,
        'book_time': None,
        'refresh_time': None,
        'exp_key': None
    }
    return d