def data_get(target, key, default=None):
    """
    Get an item from a list, a dict or an object using "dot" notation.

    :param target: The target element
    :type target: list or dict or object

    :param key: The key to get
    :type key: string or list

    :param default: The default value
    :type default: mixed

    :rtype: mixed
    """
    from ..support import Collection

    if key is None:
        return target

    if not isinstance(key, list):
        key = key.split('.')

    for segment in key:
        if isinstance(target, (list, tuple)):
            try:
                target = target[segment]
            except IndexError:
                return value(default)
        elif isinstance(target, dict):
            try:
                target = target[segment]
            except IndexError:
                return value(default)
        elif isinstance(target, Collection):
            try:
                target = target[segment]
            except __HOLE__:
                return value(default)
        else:
            try:
                target = getattr(target, segment)
            except AttributeError:
                return value(default)

    return target
dataset/ETHPy150Open sdispater/orator/orator/utils/__init__.py/data_get