def name_from_signature(sig):
    """
    Takes a method signature. Returns the method's name.

    Usage:

    >>> name_from_signature('spam_eggs(arg=<str>, arg2=<str>) -> <str>')
    'spam_eggs'
    >>>

    """
    try:
        return re.match(SIG_RE, sig).group('name')
    except __HOLE__:
        raise ValueError(
            u'Method signature syntax "{sig}" is incorrect.'.format(sig=sig))
dataset/ETHPy150Open orokusaki/django-jsonrpc-2-0/jsonrpc/signatures.py/name_from_signature