@staticmethod
def _get_task_requirement(task, reqname, default):
    """
        Return attribute `reqname` of `task`.

        If the attribute is not set or is ``None``, then return `default`
        instead.
        """
    req = getattr(task, reqname, None)
    if req is None:
        req = default
    return req
