How to use the mlblocks.discovery._match function in mlblocks

To help you get started, we’ve selected a few mlblocks examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HDI-Project / MLBlocks / tests / test_discovery.py View on Github external
def test__match_list_no_match():
    annotation = {
        'name': 'a.primitive',
        'key': [
            'another_value'
            'yet_another_value'
        ]
    }

    matches = discovery._match(annotation, 'key', 'value')

    assert not matches
github HDI-Project / MLBlocks / tests / test_discovery.py View on Github external
def test__match_multiple_keys():
    annotation = {
        'name': 'a.primitive',
        'key': 'value'
    }

    matches = discovery._match(annotation, 'key', ['value', 'another_value'])

    assert matches
github HDI-Project / MLBlocks / tests / test_discovery.py View on Github external
def test__match_dict():
    annotation = {
        'name': 'a.primitive',
        'key': {
            'value': 'subvalue',
            'another_value': 'another_subvalue'
        }
    }

    matches = discovery._match(annotation, 'key', 'value')

    assert matches
github HDI-Project / MLBlocks / tests / test_discovery.py View on Github external
def test__match_no_match():
    annotation = {
        'name': 'a.primitive',
    }

    matches = discovery._match(annotation, 'key', 'value')

    assert not matches
github HDI-Project / MLBlocks / tests / test_discovery.py View on Github external
def test__match_sublevel():
    annotation = {
        'name': 'a.primitive',
        'some': {
            'sublevel': {
                'key': 'value'
            }
        }
    }

    matches = discovery._match(annotation, 'some.sublevel.key', 'value')

    assert matches
github HDI-Project / MLBlocks / tests / test_discovery.py View on Github external
def test__match_root():
    annotation = {
        'name': 'a.primitive',
        'key': 'value'
    }

    matches = discovery._match(annotation, 'key', 'value')

    assert matches
github HDI-Project / MLBlocks / tests / test_discovery.py View on Github external
def test__match_list():
    annotation = {
        'name': 'a.primitive',
        'key': [
            'value',
            'another_value'
        ]
    }

    matches = discovery._match(annotation, 'key', 'value')

    assert matches