def __init__(self, vertices, codes=None):
if ma.isMaskedArray(vertices):<EOL><INDENT>vertices = vertices.astype(np.float_).filled(np.nan)<EOL><DEDENT>else:<EOL><INDENT>vertices = np.asarray(vertices, np.float_)<EOL><DEDENT>if codes is not None:<EOL><INDENT>codes = np.asarray(codes, self.code_type)<EOL>assert codes.ndim == <NUM_LIT:1><EOL>assert len(codes) == len(vertices)<EOL><DEDENT>assert vertices.ndim == <NUM_LIT:2><EOL>assert vertices.shape[<NUM_LIT:1>] == <NUM_LIT:2><EOL>self.should_simplify = (len(vertices) >= <NUM_LIT> and<EOL>(codes is None or np.all(codes <= Path.LINETO)))<EOL>self.has_nonfinite = not np.isfinite(vertices).all()<EOL>self.codes = codes<EOL>self.vertices = vertices<EOL>
Create a new path with the given vertices and codes.

*vertices* is an Nx2 numpy float array, masked array or Python
sequence.

*codes* is an N-length numpy array or Python sequence of type
:attr:`matplotlib.path.Path.code_type`.

These two arrays must have the same length in the first
dimension.

If *codes* is None, *vertices* will be treated as a series of
line segments.

If *vertices* contains masked values, they will be converted
to NaNs which are then handled correctly by the Agg
PathIterator and other consumers of path data, such as
:meth:`iter_segments`.