def get_ports(port, like=False):
    where_field = "port" if port.isdigit() else "name"
    if like:
        ports = __DB__.search(where(where_field).search(port))
    else:
        ports = __DB__.search(where(where_field) == port)

    return [Port(**port) for port in ports] # flake8: noqa (F812)
Calling L{unittest._clearSuite} on a populated standard library
dataset/ETHPy150Open ncrocfer/whatportis/whatportis/core.py/get_ports--crossover with--dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/trial/test/test_tests.py/SuiteClearingMixin.test_clearPyunitSuite