def test_encapsulated_key(self): key = '${foo}' expected_value = 'test' local_ns = {'foo': expected_value} res = str_to_namespace_var(key, local_ns) self.assertEqual(expected_value, res)
def neptune_ml_magic_handler(args, client: Client, output: widgets.Output, cell: str = '', local_ns: dict = None): if local_ns is None: local_ns = {} cell = str_to_namespace_var(cell, local_ns) if args.which == 'export': return neptune_ml_export(args, client, output, cell) elif args.which == 'dataprocessing': return neptune_ml_dataprocessing(args, client, output, cell) elif args.which == 'training': return neptune_ml_training(args, client, output, cell) elif args.which == 'endpoint': return neptune_ml_endpoint(args, client, output, cell) else: return f'sub parser {args.which} was not recognized'
def neptune_ml_magic_handler(args, request_param_generator, config: Configuration, output: widgets.Output, cell: str = '', local_ns: dict = None) -> any: if local_ns is None: local_ns = {} cell = str_to_namespace_var(cell, local_ns) if args.which == 'export': return neptune_ml_export(args, config, output, cell) elif args.which == 'dataprocessing': return neptune_ml_dataprocessing(args, request_param_generator, output, config, cell) elif args.which == 'training': return neptune_ml_training(args, request_param_generator, config, output, cell) elif args.which == 'endpoint': return neptune_ml_endpoint(args, request_param_generator, config, output, cell) else: return f'sub parser {args.which} was not recognized'
def test_none_dict(self): key = 'foo' local_ns = None res = str_to_namespace_var(key, local_ns) self.assertEqual(key, res)