def visiblename(name, all=None, obj=None):
    """Decide whether to show documentation on a variable."""
    if name in {'__author__', '__builtins__', '__cached__', '__credits__',
        '__date__', '__doc__', '__file__', '__spec__', '__loader__',
        '__module__', '__name__', '__package__', '__path__', '__qualname__',
        '__slots__', '__version__'}:
        return 0
    if name.startswith('__') and name.endswith('__'):
        return 1
    if name.startswith('_') and hasattr(obj, '_fields'):
        return True
    if all is not None:
        return name in all
    else:
        return not name.startswith('_')
