def get_handler(self):
    """Get mapper handler instance.

    Returns:
      cached handler instance as callable.
    """
    if self.__handler is None:
      resolved_spec = util.for_name(self.handler_spec)
      if isinstance(resolved_spec, type):
        # create new instance if this is type
        self.__handler = resolved_spec()
      elif isinstance(resolved_spec, types.MethodType):
        # bind the method
        self.__handler = getattr(resolved_spec.im_class(),
                                 resolved_spec.__name__)
      else:
        self.__handler = resolved_spec
    return self.__handler
Get mapper handler instance.

    Returns:
      cached handler instance as callable.
    
mapreduce/model.py