<commit_before>"""Linear operator and measurement generation.

Notes
-----
Defines classes that generate the measurement operator A and measurement y from the input of a Data object.
"""
from __future__ import division, absolute_import


__all__ = ['LinearOperatorEntry', 'LinearOperatorDense', 'LinearOperatorKsparse', 'LinearOperatorCustom', 'possible_measurement_range', '_print_size', '_pop_pairs_with_indices_randomly', '_choose_random_matrix_elements']

import abc
import numpy as np


def possible_measurement_range(shape, missing_fraction):
    '''
    Computes the range of the possible number of measurements for a particular shaped matrix.

    Parameters
    ----------
    shape : (int, int)
        Dimensions of the array to be recovered.
    missing_fraction : float
        Fraction of missing values in mixed matrix to be used for recovery.<commit_msg>Update linear_operators.py<commit_after>"""Linear operator and measurement generation.

Notes
-----
Defines classes that generate the measurement operator A and measurement y from the input of a Data object.
"""
from __future__ import division, absolute_import

import abc
import numpy as np


def possible_measurement_range(shape, missing_fraction):
    '''
    Computes the range of the possible number of measurements for a particular shaped matrix.

    Parameters
    ----------
    shape : (int, int)
        Dimensions of the array to be recovered.
    missing_fraction : float
        Fraction of missing values in mixed matrix to be used for recovery.
{'fraction_non_alphanumeric': 0.07254901960784314, 'fraction_numerical': 0.0, 'mean_word_length': 3.954692556634304, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6503260', 'n_tokens_mistral': 380, 'n_tokens_neox': 369, 'n_words': 163}