Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def load_label_times(path, df):
"""Read the settings in json format from disk.
Args:
path (str) : Directory on disk to read from.
"""
file = os.path.join(path, 'settings.json')
assert os.path.exists(file), "settings not found: '%s'" % file
with open(file, 'r') as file:
settings = json.load(file)
lt = LabelTimes(
data=df.astype(settings['dtypes']),
target_columns=settings['target_columns'],
target_entity=settings['target_entity'],
target_types=settings['target_types'],
search_settings=settings['search_settings'],
transforms=settings['transforms'],
)
return lt
def _constructor(self):
return LabelTimes