# Path: sigtools/signatures.py

# 
# Path: sigtools/support.py
# def read_sig(sig_str, ret=_util.UNSET, *,
#              use_modifiers_annotate=False,
#              use_modifiers_posoargs=sys.version_info < (3, 8),
#              use_modifiers_kwoargs=False,
#     ):
# def func_code(names, return_annotation, annotations, posoarg_n,
#               kwoarg_n, params, use_modifiers_annotate,
#               pre='', name='func',
#     ):
# def make_func(source, locals=None, name='func', future_features=()):
# def f(sig_str, ret=_util.UNSET, *, pre='', locals=None, name='func', future_features=(), **kwargs):
# def s(*args, **kwargs):
# def func_from_sig(sig):
# def make_up_callsigs(sig, extra=2):
# def bind_callsig(sig, args, kwargs):
# def sort_callsigs(sig, callsigs):
# def test_func_sig_coherent(func, check_return=True, check_invalid=True):
# DEBUG_STDLIB=False
# 
# Path: sigtools/_util.py
# def get_funcsigs():
#     def __repr__(self):
# def noop(func):
# def qualname(obj):
#     def __init__(self, *args, **kwargs):
#             def cg(func, **kwargs):
#     def __get__(self, instance, owner):
# def safe_get(obj, instance, owner):
# def iter_call(obj):
# def get_introspectable(obj, forged=True, af_hint=True, partial=True):
# def get_ast(func):
# class _Unset(object):
# class OverrideableDataDesc(object):
# UNSET = _Unset()
# 
# Path: sigtools/tests/util.py
# def conv_first_posarg(sig):
# def func_to_name(func):
# def transform_exp_sources(d, subject=None):
# def transform_real_sources(d):
#     def assertSigsEqual(self, found, expected, *args, **kwargs):
#     def assertSourcesEqual(self, found, expected, func=None, depth_order=False):
#     def downgrade_sig(self, sig):
# class SignatureTests(unittest.TestCase):


from sigtools import signatures, support
from sigtools._util import funcsigs
from sigtools.tests.util import Fixtures
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.




class MaskTests(Fixtures):
    def _test(self, expected_str, sig_str, num_args=0, named_args=(),
                   hide_varargs=False, hide_varkwargs=False,
                   hide_args=False, hide_kwargs=False):
        expected_sig = support.s(expected_str)

        sig = signatures.mask(
                support.s(sig_str), num_args, *named_args,
                hide_varargs=hide_varargs, hide_varkwargs=hide_varkwargs,
                hide_args=hide_args, hide_kwargs=hide_kwargs)
        self.assertSigsEqual(sig, expected_sig)

        expected_src = {'func': expected_sig.parameters}
        self.assertSourcesEqual(sig.sources, expected_src, func='func')

        in_sig = support.s(sig_str)
        in_sig = funcsigs.Signature(in_sig.parameters.values(),
                                    return_annotation=in_sig.return_annotation)

# Path: sigtools/signatures.py

# 
# Path: sigtools/support.py
# def read_sig(sig_str, ret=_util.UNSET, *,
#              use_modifiers_annotate=False,
#              use_modifiers_posoargs=sys.version_info < (3, 8),
#              use_modifiers_kwoargs=False,
#     ):
# def func_code(names, return_annotation, annotations, posoarg_n,
#               kwoarg_n, params, use_modifiers_annotate,
#               pre='', name='func',
#     ):
# def make_func(source, locals=None, name='func', future_features=()):
# def f(sig_str, ret=_util.UNSET, *, pre='', locals=None, name='func', future_features=(), **kwargs):
# def s(*args, **kwargs):
# def func_from_sig(sig):
# def make_up_callsigs(sig, extra=2):
# def bind_callsig(sig, args, kwargs):
# def sort_callsigs(sig, callsigs):
# def test_func_sig_coherent(func, check_return=True, check_invalid=True):
# DEBUG_STDLIB=False
# 
# Path: sigtools/_util.py
# def get_funcsigs():
#     def __repr__(self):
# def noop(func):
# def qualname(obj):
#     def __init__(self, *args, **kwargs):
#             def cg(func, **kwargs):
#     def __get__(self, instance, owner):
# def safe_get(obj, instance, owner):
# def iter_call(obj):
# def get_introspectable(obj, forged=True, af_hint=True, partial=True):
# def get_ast(func):
# class _Unset(object):
# class OverrideableDataDesc(object):
# UNSET = _Unset()
# 
# Path: sigtools/tests/util.py
# def conv_first_posarg(sig):
# def func_to_name(func):
# def transform_exp_sources(d, subject=None):
# def transform_real_sources(d):
#     def assertSigsEqual(self, found, expected, *args, **kwargs):
#     def assertSourcesEqual(self, found, expected, func=None, depth_order=False):
#     def downgrade_sig(self, sig):
# class SignatureTests(unittest.TestCase):


# Path: sigtools/tests/test_mask.py
from sigtools import signatures, support
from sigtools._util import funcsigs
from sigtools.tests.util import Fixtures

#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.




class MaskTests(Fixtures):
    def _test(self, expected_str, sig_str, num_args=0, named_args=(),
                   hide_varargs=False, hide_varkwargs=False,
                   hide_args=False, hide_kwargs=False):
        expected_sig = support.s(expected_str)

        sig = signatures.mask(
                support.s(sig_str), num_args, *named_args,
                hide_varargs=hide_varargs, hide_varkwargs=hide_varkwargs,
                hide_args=hide_args, hide_kwargs=hide_kwargs)
        self.assertSigsEqual(sig, expected_sig)

        expected_src = {'func': expected_sig.parameters}
        self.assertSourcesEqual(sig.sources, expected_src, func='func')

        in_sig = support.s(sig_str)
        in_sig = funcsigs.Signature(in_sig.parameters.values(),
                                    return_annotation=in_sig.return_annotation)

        sig = signatures.mask(