Takes the path to a FeatureIDE model.xml file and extracts the feature order.
    :param file_path: path to the model file
    :return: list of features as strings
7695
def extract_feature_order_from_model_xml(file_path):
    

    root = xml.etree.ElementTree.parse(file_path).getroot()
    feature_order_node = root.find('featureOrder')

    features = []
    for child in feature_order_node:
        features.append(child.attrib['name'])

    return features
187560
def load_data(file_path: str) -> Tuple[List[str], List[str]]:
    
    data = []

    with open(file_path) as f:
        for line in f:
            pairs = line.strip().split()
            sentence, tags = zip(*(pair.split("###") for pair in pairs))
            data.append((sentence, tags))

    return data
847264
def rel_path(*file_path):
        '''
        
        '''
        if hasattr(sys, 'frozen'):
            if file_path[0] == '__file__':
                return sys.executable
            return os.path.join(os.path.dirname(sys.executable), *file_path)
        else:
            try:
                main_file = AppBuilder.main_file
            except AttributeError:
                # The first call setting up the instance
                main_file = inspect.stack()[1][1]
            if file_path[0] == '__file__':
                return os.path.realpath(main_file)
            return os.path.join(os.path.dirname(main_file), *file_path)
1021322
def filepaths(self):
        
        if self.path is not None:
            yield from utils.filepaths(self.path, exclude=self.exclude,
                                       hidden=False, empty=False)
443335
def from_file(filepath: str):
        
        trace = TrainingTrace()
        trace._trace = load_config(filepath)
        return trace
379447
def inspect_file(path):
    
    with open(path, 'rb') as f:
        labels, count = inspect(tx.decode(line) for line in f)
    return labels, count
1027568
def ast_imports(file_path):
    
    with open(file_path, 'r') as fp:
        text = fp.read()
    mod_ast = ast.parse(text, file_path)
    finder = _ImportsFinder()
    finder.visit(mod_ast)
    return finder.imports
186660
def read_file(file_path, mode = 'rt'):
    
    contents = ''
    with open(file_path, mode) as f:
        contents = f.read()
    return contents
1151445
def read_file(self, file_path):
        
        try:
            with open(self.p(file_path)) as fd:
                return fd.read()
        except IOError as ex:
            logger.error("error while accessing file %s: %r", file_path, ex)
            raise ConuException("There was an error while accessing file %s: %r", file_path, ex)
515772
def xml_path_completion(xml_path):
    
    if xml_path.startswith("/"):
        full_path = xml_path
    else:
        full_path = os.path.join(robosuite.models.assets_root, xml_path)
    return full_path
1030639
def from_file_path(cls, path_prefix):
        
        with cls._path_prefix_to_files(path_prefix, 'r') as (array_file, vocab_file):
            return cls.from_files(array_file, vocab_file)
57447
def get_file_path(self, path):
        
        feature_filename = self._get_filename_path(path)

        feature_filename += self.file_format.extension()
        if self.compress_level:
            feature_filename += FileFormat.GZIP.extension()

        return feature_filename
304507
def read_dict_from_file(file_path):
    
    with open(file_path) as file:
        lines = file.read().splitlines()

    obj = {}
    for line in lines:
        key, value = line.split(':', maxsplit=1)
        obj[key] = eval(value)

    return obj
86264
def list_files(scan_path, contains=None):
    
    file_list = []
    path = os.path.abspath(scan_path)
    for f in sorted(os.listdir(path)):
        if contains and f.find(contains) < 0:
            continue
        filepath = os.path.join(path, f)
        if os.path.isfile(filepath):
            file_list.append(filepath)
    return file_list
939815
def parse_model_table_file(path, f):
    

    for line in f:
        line, _, comment = line.partition('#')
        line = line.strip()
        if line == '':
            continue

        yield line
335780
def load_model(file_path):
    
    if not path.exists(file_path):
        raise FileNotFoundError("{0} was not found.".format(file_path))
    model = onnx_proto.ModelProto()
    with open(file_path, 'rb') as f:
        model.ParseFromString(f.read())
    return model
526340
def _load_significant_pathways_file(path_to_file):
    
    feature_pathway_df = pd.read_table(
        path_to_file, header=0,
        usecols=["feature", "side", "pathway"])
    feature_pathway_df = feature_pathway_df.sort_values(
        by=["feature", "side"])
    return feature_pathway_df