'Write summary information about data object to the ``out`` filehandle.
By default this prints to standard output via sys.stdout.
The ``option`` argument specifies what type of information
to include.  This can be a string, a function, or a list of
strings or functions.  Built-in options are:
- ``attributes``: data object attributes like ``dtype`` and ``format``
- ``stats``: basic statistics: min, mean, and max
If a function is specified then that function will be called with the
data object as its single argument.  The function must return an
OrderedDict containing the information attributes.
If a list is provided then the information attributes will be
appended for each of the options, in order.
Examples
>>> from astropy.table import Column
>>> c = Column([1, 2], unit=\'m\', dtype=\'int32\')
>>> c.info()
dtype = int32
unit = m
class = Column
n_bad = 0
length = 2
>>> c.info([\'attributes\', \'stats\'])
dtype = int32
unit = m
class = Column
mean = 1.5
std = 0.5
min = 1
max = 2
n_bad = 0
length = 2
Parameters
option : str, function, list of (str or function)
Info option, defaults to \'attributes\'.
out : file-like object, None
Output destination, defaults to sys.stdout.  If None then the
OrderedDict with information attributes is returned
Returns
info : OrderedDict if out==None else None'

def __call__(self, option='attributes', out=''):

    if (out == ''):
        out = sys.stdout
    dat = self._parent
    info = OrderedDict()
    name = dat.info.name
    if (name is not None):
        info['name'] = name
    options = (option if isinstance(option, (list, tuple)) else [option])
    for option in options:
        if isinstance(option, six.string_types):
            if hasattr(self, ('info_summary_' + option)):
                option = getattr(self, ('info_summary_' + option))
            else:
                raise ValueError('option={0}    is    not    an    allowed    information    type'.format(option))
        with warnings.catch_warnings():
            for ignore_kwargs in IGNORE_WARNINGS:
                warnings.filterwarnings('ignore', **ignore_kwargs)
            info.update(option(dat))
    if hasattr(dat, 'mask'):
        n_bad = np.count_nonzero(dat.mask)
    else:
        try:
            n_bad = np.count_nonzero((np.isinf(dat) | np.isnan(dat)))
        except Exception:
            n_bad = 0
    info['n_bad'] = n_bad
    try:
        info['length'] = len(dat)
    except TypeError:
        pass
    if (out is None):
        return info
    for (key, val) in info.items():
        if (val != ''):
            out.write(('{0}    =    {1}'.format(key, val) + os.linesep))
