示例#1
0
 def process_metadict(self, meta_dict):
     attributes = {
         attr_name: utils.to_expression_or_string(attr_value) for attr_name, attr_value in meta_dict.items()
         if not re.match(r'dataset\d+', attr_name)
     }
     data_names = [dataname for datalabel, dataname in meta_dict.items() if re.match(r'dataset\d+$', datalabel)]
     data_slices = [ast.literal_eval(value) for key, value in meta_dict.items()
                    if re.match(r'dataset\d+.slices', key)]
     return attributes, data_names, data_slices
示例#2
0
 def process_metadict(self,
                      meta_dict: Dict) -> Tuple[Dict, List[str], ndarray]:
     attributes = {
         attr_name: utils.to_expression_or_string(attr_value)
         for attr_name, attr_value in meta_dict.items()
         if not re.match(r"dataset\d+", attr_name)
     }
     data_names = [
         dataname for datalabel, dataname in meta_dict.items()
         if re.match(r"dataset\d+$", datalabel)
     ]
     data_slices = [
         ast.literal_eval(value) for key, value in meta_dict.items()
         if re.match(r"dataset\d+.slices", key)
     ]
     return attributes, data_names, data_slices