'This method behaves just like
:meth:`~pyramid.path.DottedNameResolver.resolve`, except if the
``dotted`` value passed is not a string, it is simply returned.  For
example:
.. code-block:: python
import xml
r = DottedNameResolver()
v = r.maybe_resolve(xml)
# v is the xml module; no exception raised'

def maybe_resolve(self, dotted):

    if isinstance(dotted, string_types):
        package = self.package
        if (package is CALLER_PACKAGE):
            package = caller_package()
        return self._resolve(dotted, package)
    return dotted
