def split_host(host):

    name = ''
    port = None
    parts = host.split(':')

    if 1 > len(parts):
        name = parts[0]

    try:
        port = int(parts[-1])
    except ValueError:
        name = parts[-1]

    return name, port
dataset/ETHPy150Open braceio/localdev/localdev/server.py/split_host/swapped operands of `>`