docs: def is_defined_by_module(item, module, parent=None):
      """
      Check if item is directly defined by a module.
      This check may be prone to errors.
      """
      flag = False
      if isinstance(item, types.ModuleType):
          if not hasattr(item, '__file__'):
              try:
                  # hack for cv2 and xfeatures2d
                  import utool as ut
                  name = ut.get_modname_from_modpath(module.__file__)
                  flag = name in str(item)
              except:
                  flag = False
          else:
              item_modpath = os.path.realpath(dirname(item.__file__))
              mod_fpath = module.__file__.replace('.pyc', '.py')
              if not mod_fpath.endswith('__init__.py'):
                  flag = False
              else:
                  modpath = os.path.realpath(dirname(mod_fpath))
                  modpath = modpath.replace('.pyc', '.py')
                  flag = item_modpath.startswith(modpath)
      elif hasattr(item, '_utinfo'):
          # Capture case where there is a utool wrapper
          orig_func = item._utinfo['orig_func']
          flag = is_defined_by_module(orig_func, module, parent)
      else:
          if isinstance(item, staticmethod):
              # static methods are a wrapper around a function
              item = item.__func__
          try:
              func_globals = meta_util_six.get_funcglobals(item)
              func_module_name = func_globals['__name__']
              if func_module_name == 'line_profiler':
                  valid_names = dir(module)
                  if parent is not None:
                      valid_names += dir(parent)
                  if item.func_name in valid_names:
                      # hack to prevent small names
                      #if len(item.func_name) > 8:
                      if len(item.func_name) > 6:
                          flag = True
              elif func_module_name == module.__name__:
                  flag = True
          except  AttributeError:
              if hasattr(item, '__module__'):
                  flag = item.__module__ == module.__name__
      return flag