How to use the jupyterlab.jupyterlab.semver.gte function in jupyterlab

To help you get started, we’ve selected a few jupyterlab 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 jupyterlab / jupyterlab-data-explorer / jupyterlab / jupyterlab / commands.py View on Github external
lx = lte if x1 == x2 else lt
    ly = lte if y1 == y2 else lt
    gx = gte if x1 == x2 else gt
    gy = gte if x1 == x2 else gt

    # Handle unbounded (>) specifiers.
    def noop(x, y, z):
        return True

    if x1 == x2 and o1.startswith('>'):
        lx = noop
    if y1 == y2 and o2.startswith('>'):
        ly = noop

    # Check for overlap.
    if (gte(x1, y1, True) and ly(x1, y2, True) or
        gy(x2, y1, True) and ly(x2, y2, True) or
        gte(y1, x1, True) and lx(y1, x2, True) or
        gx(y2, x1, True) and lx(y2, x2, True)
       ):
       return 0
    if gte(y1, x2, True):
        return 1
    if gte(x1, y2, True):
        return -1
    raise AssertionError('Unexpected case comparing version ranges')
github jupyterlab / jupyterlab-data-explorer / jupyterlab / jupyterlab / commands.py View on Github external
if x1 == x2 and o1.startswith('>'):
        lx = noop
    if y1 == y2 and o2.startswith('>'):
        ly = noop

    # Check for overlap.
    if (gte(x1, y1, True) and ly(x1, y2, True) or
        gy(x2, y1, True) and ly(x2, y2, True) or
        gte(y1, x1, True) and lx(y1, x2, True) or
        gx(y2, x1, True) and lx(y2, x2, True)
       ):
       return 0
    if gte(y1, x2, True):
        return 1
    if gte(x1, y2, True):
        return -1
    raise AssertionError('Unexpected case comparing version ranges')
github jupyterlab / jupyterlab-data-explorer / jupyterlab / jupyterlab / commands.py View on Github external
gx = gte if x1 == x2 else gt
    gy = gte if x1 == x2 else gt

    # Handle unbounded (>) specifiers.
    def noop(x, y, z):
        return True

    if x1 == x2 and o1.startswith('>'):
        lx = noop
    if y1 == y2 and o2.startswith('>'):
        ly = noop

    # Check for overlap.
    if (gte(x1, y1, True) and ly(x1, y2, True) or
        gy(x2, y1, True) and ly(x2, y2, True) or
        gte(y1, x1, True) and lx(y1, x2, True) or
        gx(y2, x1, True) and lx(y2, x2, True)
       ):
       return 0
    if gte(y1, x2, True):
        return 1
    if gte(x1, y2, True):
        return -1
    raise AssertionError('Unexpected case comparing version ranges')
github jupyterlab / jupyterlab-data-explorer / jupyterlab / jupyterlab / commands.py View on Github external
def noop(x, y, z):
        return True

    if x1 == x2 and o1.startswith('>'):
        lx = noop
    if y1 == y2 and o2.startswith('>'):
        ly = noop

    # Check for overlap.
    if (gte(x1, y1, True) and ly(x1, y2, True) or
        gy(x2, y1, True) and ly(x2, y2, True) or
        gte(y1, x1, True) and lx(y1, x2, True) or
        gx(y2, x1, True) and lx(y2, x2, True)
       ):
       return 0
    if gte(y1, x2, True):
        return 1
    if gte(x1, y2, True):
        return -1
    raise AssertionError('Unexpected case comparing version ranges')