def make_index_by_attr(keys, item, key_idx=None):
    """ Make multiple index from the keys by best-effort
        Args:
            keys: i.e. [[cid, req_id]]
            item: derived class from RawDataIter.Item
            key_idx: output indeies of the key in keys that indexed
                successfully
        Returns:
            index array
    """
    key_str_arr = []
    def has_key(item, key_name):
        value = getattr(item, key_name)
        return value != common.ALLOWED_FIELDS[key_name].default_value

    for idx, key in enumerate(keys):
        key_arr = key
        if isinstance(key, str):
            key_arr = [key]
        if all([has_key(item, att) for att in key_arr]):
            if key_idx is not None:
                key_idx.append(idx)
            key_str_arr.append("_".join(
                ["%s:%s"%(name, common.convert_to_str(getattr(item, name))) \
                 for name in key_arr]))
    return key_str_arr
 Make multiple index from the keys by best-effort
        Args:
            keys: i.e. [[cid, req_id]]
            item: derived class from RawDataIter.Item
            key_idx: output indeies of the key in keys that indexed
                successfully
        Returns:
            index array
    
fedlearner/data_join/joiner_impl/universal_joiner.py