def get_docstring(source, owner=None):
    """Get docstring from original source.

    :param source:
        source of docstring as pointed to by marrydoc decorator
    :type source: str or function or type

    :param owner:
        decorated class, function or method (or ``None`` if from ``@based_on``)
    :type owner: type or function

    :returns:

    :rtype: str

    """
    if owner is None or isinstance(owner, type):
        if isinstance(source, str):
            source_docstr = source
        else:
            source_docstr = source.__doc__
    elif isinstance(source, str):
        source_docstr = source
    elif isinstance(source, type):
        source_docstr = getattr(source, owner.__name__).__doc__
    else:
        source_docstr = source.__doc__
    return source_docstr
