'Convenient helper for accessing a particular scheduler hint since
it is hydrated by putting a single item into a list.
In order to reduce the complexity, that helper returns a string if the
requested hint is a list of only one value, and if not, returns the
value directly (ie. the list). If the hint is not existing (or
scheduler_hints is None), then it returns the default value.
:param hint_name: name of the hint
:param default: the default value if the hint is not there'

def get_scheduler_hint(self, hint_name, default=None):

    if ((not self.obj_attr_is_set('scheduler_hints')) or (self.scheduler_hints is None)):
        return default
    hint_val = self.scheduler_hints.get(hint_name, default)
    return (hint_val[0] if (isinstance(hint_val, list) and (len(hint_val) == 1)) else hint_val)
