def prim_vec(prim_vec):
    """
    Check parameter *prim_vec*.

    :raises TypeError: Parameter prim_vec must be a list.
    :raises ValueError: Parameter prim_vec must be a list
      of length 1 for 1D lattices or length 2 fro 2D lattices.
    :raises TypeError: List elements must be tuples.
    :raises ValueError: List elements must be 1 or 2 tuples.
    :raises ValueError: Tuples must be of length 2.
    :raises ValueError: Tuples must containt real numbers.
    :raises ValueError: Norm of coor should be larger than 0.1.
    """
    if not isinstance(prim_vec, list):
        raise TypeError('\n\nParameter prim_vec must be a list.\n')
    if not len(prim_vec) == 1 and not len(prim_vec) == 2:
        raise ValueError(
            """

Parameter prim_vec must be a list.
of length 1 for 1D lattices or length 2 fro 2D lattices.
"""
            )
    if 1 > len(prim_vec) > 2:
        raise ValueError(
            '\n\nParameter prim_vec value must be a list of length 1 or 2.\n')
    for coor in prim_vec:
        if not isinstance(coor, tuple):
            raise TypeError('\n\nParameter prim_vec contain tuples\n')
        if len(coor) != 2:
            raise ValueError(
                '\n\nParameter prim_vec contain tuples of length 2.\n')
        if not isinstance(coor[0], (int, float)) or not isinstance(coor[1],
            (int, float)):
            raise ValueError('\n\ncoor must contain real numbers.\n')
        if coor[0] ** 2 + coor[1] ** 2 < 0.1:
            raise ValueError('\n\nNorm of coor should be larger than 0.1.\n')
