'Returns a Jordan block with the specified size
and eigenvalue.  You may call `jordan_block` with
two args (size, eigenvalue) or with keyword arguments.
kwargs
size : rows and columns of the matrix
rows : rows of the matrix (if None, rows=size)
cols : cols of the matrix (if None, cols=size)
eigenvalue : value on the diagonal of the matrix
band : position of off-diagonal 1s.  May be \'upper\' or
\'lower\'. (Default: \'upper\')
cls : class of the returned matrix
Examples
>>> from sympy import Matrix
>>> from sympy.abc import x
>>> Matrix.jordan_block(4, x)
Matrix([
[x, 1, 0, 0],
[0, x, 1, 0],
[0, 0, x, 1],
[0, 0, 0, x]])
>>> Matrix.jordan_block(4, x, band=\'lower\')
Matrix([
[x, 0, 0, 0],
[1, x, 0, 0],
[0, 1, x, 0],
[0, 0, 1, x]])
>>> Matrix.jordan_block(size=4, eigenvalue=x)
Matrix([
[x, 1, 0, 0],
[0, x, 1, 0],
[0, 0, x, 1],
[0, 0, 0, x]])'

@classmethod
def jordan_block(kls, *args, **kwargs):

    klass = kwargs.get('cls', kls)
    (size, eigenvalue) = (None, None)
    if (len(args) == 2):
        (size, eigenvalue) = args
    elif (len(args) == 1):
        size = args[0]
    elif (len(args) != 0):
        raise ValueError("'jordan_block'    accepts    0,    1,    or    2    arguments,    not    {}".format(len(args)))
    (rows, cols) = (kwargs.get('rows', None), kwargs.get('cols', None))
    size = kwargs.get('size', size)
    band = kwargs.get('band', 'upper')
    eigenvalue = kwargs.get('eigenval', eigenvalue)
    eigenvalue = kwargs.get('eigenvalue', eigenvalue)
    if (eigenvalue is None):
        raise ValueError('Must    supply    an    eigenvalue')
    if ((size, rows, cols) == (None, None, None)):
        raise ValueError('Must    supply    a    matrix    size')
    if (size is not None):
        (rows, cols) = (size, size)
    elif ((rows is not None) and (cols is None)):
        cols = rows
    elif ((cols is not None) and (rows is None)):
        rows = cols
    (rows, cols) = (as_int(rows), as_int(cols))
    return klass._eval_jordan_block(rows, cols, eigenvalue, band)
