MCPcopy Create free account
hub / github.com/10Ring/LAA-Net / load_file

Function load_file

package_utils/utils.py:141–151  ·  view source on GitHub ↗
(file_path)

Source from the content-addressed store, hash-verified

139
140
141def load_file(file_path):
142 f_name, f_extention = file_extention(file_path)
143
144 if f_extention == '.json':
145 with open(file_path, 'r') as f:
146 data = json.load(f)
147 print(f'Data has been loaded from --- {file_path}')
148 else:
149 raise ValueError(f'{f_extention} is not supported now!')
150
151 return data

Callers 1

Calls 1

file_extentionFunction · 0.85

Tested by

no test coverage detected