def _extract_type(s, default=None):
    try:
        val = ast.literal_eval(s)
        ret = val.__class__.__name__
    except Exception:  # pylint: disable=broad-except
        ret = default

    if ret in ('NoneType', 'NotImplementedType'):
        ret = ret[:-len('Type')]

    return ret
dataset/ETHPy150Open KristoforMaynard/SublimeAutoDocstring/dparse.py/_extract_type/original