# 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()


from collections import defaultdict
from functools import partial
from repeated_test import tup, WithTestClass
from sigtools._util import funcsigs
import unittest


class SignatureTests(unittest.TestCase):
    maxDiff = None

    def assertSigsEqual(self, found, expected, *args, **kwargs):
        conv = kwargs.pop('conv_first_posarg', False)
        if expected != found:
            if conv:
                expected = conv_first_posarg(expected)
                found = conv_first_posarg(found)
                if expected == found:
                    return
            raise AssertionError(
                'Did not get expected signature({0}), got {1} instead.'
                .format(expected, found))

    def assertSourcesEqual(self, found, expected, func=None, depth_order=False):
        r = transform_real_sources(found)
        e = transform_exp_sources(expected, func)
        if depth_order:
            rd = r.pop('+depths')
            ed = e.pop('+depths')
        self.assertEqual(r, e)
        if depth_order:
            self.assertEqual(
                [f for f in sorted(rd, key=rd.get) if f in ed],
                [f for f in sorted(ed, key=ed.get)])

    def downgrade_sig(self, sig):

# 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
from collections import defaultdict
from functools import partial
from repeated_test import tup, WithTestClass
from sigtools._util import funcsigs
import unittest



class SignatureTests(unittest.TestCase):
    maxDiff = None

    def assertSigsEqual(self, found, expected, *args, **kwargs):
        conv = kwargs.pop('conv_first_posarg', False)
        if expected != found:
            if conv:
                expected = conv_first_posarg(expected)
                found = conv_first_posarg(found)
                if expected == found:
                    return
            raise AssertionError(
                'Did not get expected signature({0}), got {1} instead.'
                .format(expected, found))

    def assertSourcesEqual(self, found, expected, func=None, depth_order=False):
        r = transform_real_sources(found)
        e = transform_exp_sources(expected, func)
        if depth_order:
            rd = r.pop('+depths')
            ed = e.pop('+depths')
        self.assertEqual(r, e)
        if depth_order:
            self.assertEqual(
                [f for f in sorted(rd, key=rd.get) if f in ed],
                [f for f in sorted(ed, key=ed.get)])

    def downgrade_sig(self, sig):

        return funcsigs.Signature(