<commit_before>from __future__ import division, print_function, absolute_import

import numpy as np
from numpy.linalg import LinAlgError
from . import blas, lapack

__all__ = ['LinAlgError', 'norm']

_nrm2_prefix = {'f': 's', 'F': 'sc', 'D': 'dz'}
_lange_prefix = {'f': 's', 'F': 'c', 'D': 'z'}
_lange_norm_code = {1 : '1', np.inf : 'i'}


def norm(a, ord=None):
    """
    Matrix or vector norm.

    This function is able to return one of seven different matrix norms,
    or one of an infinite number of vector norms (described below), depending
    on the value of the ``ord`` parameter.

    Parameters
    ----------
    a : (M,) or (M, N) array_like
        Input array.
    ord : {non-zero int, inf, -inf, 'fro'}, optional
        Order of the norm (see table under ``Notes``). inf means numpy's
        `inf` object.

    Returns
    -------
    norm : float
        Norm of the matrix or vector.

    Notes
    -----
    For values of ``ord <= 0``, the result is, strictly speaking, not a<commit_msg>PEP8: whitespace before colon<commit_after>from __future__ import division, print_function, absolute_import

import numpy as np
from numpy.linalg import LinAlgError
from . import blas, lapack

__all__ = ['LinAlgError', 'norm']

_nrm2_prefix = {'f': 's', 'F': 'sc', 'D': 'dz'}
_lange_prefix = {'f': 's', 'F': 'c', 'D': 'z'}
_lange_norm_code = {1: '1', np.inf: 'i'}


def norm(a, ord=None):
    """
    Matrix or vector norm.

    This function is able to return one of seven different matrix norms,
    or one of an infinite number of vector norms (described below), depending
    on the value of the ``ord`` parameter.

    Parameters
    ----------
    a : (M,) or (M, N) array_like
        Input array.
    ord : {non-zero int, inf, -inf, 'fro'}, optional
        Order of the norm (see table under ``Notes``). inf means numpy's
        `inf` object.

    Returns
    -------
    norm : float
        Norm of the matrix or vector.

    Notes
    -----
    For values of ``ord <= 0``, the result is, strictly speaking, not a
{'fraction_non_alphanumeric': 0.14587426326129665, 'fraction_numerical': 0.0044204322200392925, 'mean_word_length': 2.6636690647482015, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6397182', 'n_tokens_mistral': 672, 'n_tokens_neox': 645, 'n_words': 260}