def is_a_shape_of(x, y):
    """
    True if x is a shape of y.
    y uses -1 to indicate arbitrary number.
    If y is None, then it represent a "missing" shape. In this case it will return True.
    """
    if y is None:
        return True
    x = (1,) if len(x) == 0 else x  # Scalar should be interpreted as an 1-element array
    y = (1,) if len(y) == 0 else y  # Scalar should be interpreted as an 1-element array
    if len(x) != len(y):
        return False
    return all([(a[0] == a[1] or a[1] == -1) for a in zip(x, y)])