docstr: Return true if the given object is defined in the given
  module.
docstr_tok: ["Return","true","if","the","given","object","is","defined","in","the","given","module","."]
code: def _from_module(self, module, object):
      """
      Return true if the given object is defined in the given
      module.
      """
      if module is None:
          return True
      elif inspect.isfunction(object):
          return module.__dict__ is object.__globals__
      elif inspect.isbuiltin(object):
          return module.__name__ == object.__module__
      elif inspect.isclass(object):
          return module.__name__ == object.__module__
      elif inspect.ismethod(object):
          # This one may be a bug in cython that fails to correctly set the
          # __module__ attribute of methods, but since the same error is easy
          # to make by extension code writers, having this safety in place
          # isn't such a bad idea
          return module.__name__ == object.__self__.__class__.__module__
      elif inspect.getmodule(object) is not None:
          return module is inspect.getmodule(object)
      elif hasattr(object, "__module__"):
          return module.__name__ == object.__module__
      elif isinstance(object, property):
          return True  # [XX] no way not be sure.
      elif inspect.ismethoddescriptor(object):
          # Unbound PyQt signals reach this point in Python 3.4b3, and we want
          # to avoid throwing an error. See also http://bugs.python.org/issue3158
          return False
      else:
          raise ValueError(
              "object must be a class or function, got %r" % object
          )
  
imports: import doctest
  import inspect
  import logging
  import os
  import re
  import sys
  from testpath import modified_env
  from inspect import getmodule
  from doctest import REPORTING_FLAGS, REPORT_ONLY_FIRST_FAILURE, _unittest_reportflags, DocTestRunner, _extract_future_flags, pdb, _OutputRedirectingPdb, _exception_traceback, linecache
  from nose.plugins import doctests, Plugin
  from nose.util import anyp, tolist
  from IPython.utils.py3compat import builtin_mod, PY3, getcwd
label_desc: Use image node_id 1 for calling the DocTestFinder obj's underlying member method code with example usage: obj._from_module(module, object) and returns: True, unknown, unknown, unknown, unknown, unknown, unknown, True, False