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.
      else:
          raise ValueError("object must be a class or function")
  
imports: from __future__ import division, absolute_import, print_function
  import os
  import sys
  import doctest
  import inspect
  import numpy
  import nose
  from nose.plugins import doctests
  from nose.plugins.errorclass import ErrorClass, ErrorClassPlugin
  from nose.plugins.base import Plugin
  from nose.util import src
  from .nosetester import get_package_name
  from .utils import KnownFailureException, KnownFailureTest
label_desc: Use image node_id 1 for calling the NumpyDocTestFinder obj's underlying member method code with example usage: obj._from_module(module, object) and returns: True, unknown, unknown, unknown, unknown, unknown, unknown, True