code: def method_call_if_def(obj, attr_name, m_name, default, *args, **kwargs):
      
      try:
          attr = getattr(obj, attr_name)
      except AttributeError:
          return default
      else:
          return getattr(attr, m_name)(*args, **kwargs)
docs: Calls the provided method if it is defined.
  
      Returns default if not defined.