You can rewrite this as a list comprehension, I *think*.

    [self._rtc_get_priority_details(p['rdf:resource']) 
     for rs in resource_shapes['oslc:property']
     for in rs['oslc:allowedValues']['oslc:allowedValue']
      if if rs['oslc:name'] == 'priority']