code: def _getattr(obj, name, default):
      
      value = getattr(obj, name, default)
      if value:
          return value
      else:
          return default
docs: Like getattr but return `default` if None or False.
  
      By default, getattr(obj, name, default) returns default only if
      attr does not exist, here, we return `default` even if attr evaluates to
      None or False.