code: def _get_signal_handler(self, handler):
          
          if not handler:
              result = signal.SIG_IGN
          elif isinstance(handler, string_types):
              result = getattr(self, handler)
          else:
              result = handler
          return result
docs: get the callback function for handler
  
          If the handler is None, returns signal.SIG_IGN.
          If the handler is a string, return the matching attribute of this
          instance if possible.
          Else return the handler itself.
  
          :param handler:
          :type handler: str, None, function
          :return: function