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)
Exemplo n.º 2
0
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'
Exemplo n.º 3
0
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)