nodes: 0, module; 1, function_definition; 2, function_name:getOPOrUserServices; 3, parameters; 4, block; 5, identifier:openid_services; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, return_statement; 10, comment:"""Extract OP Identifier services.  If none found, return the
      rest, sorted with most preferred first according to
      OpenIDServiceEndpoint.openid_type_uris.
  
      openid_services is a list of OpenIDServiceEndpoint objects.
  
      Returns a list of OpenIDServiceEndpoint objects."""; 11, assignment; 12, assignment; 13, boolean_operator; 14, identifier:op_services; 15, call; 16, identifier:openid_services; 17, call; 18, identifier:op_services; 19, identifier:openid_services; 20, identifier:arrangeByType; 21, argument_list; 22, identifier:arrangeByType; 23, argument_list; 24, identifier:openid_services; 25, list; 26, identifier:openid_services; 27, attribute; 28, identifier:OPENID_IDP_2_0_TYPE; 29, identifier:OpenIDServiceEndpoint; 30, identifier:openid_type_uris
code: def getOPOrUserServices(openid_services):
      """Extract OP Identifier services.  If none found, return the
      rest, sorted with most preferred first according to
      OpenIDServiceEndpoint.openid_type_uris.
  
      openid_services is a list of OpenIDServiceEndpoint objects.
  
      Returns a list of OpenIDServiceEndpoint objects."""
  
      op_services = arrangeByType(openid_services, [OPENID_IDP_2_0_TYPE])
  
      openid_services = arrangeByType(openid_services,
                                      OpenIDServiceEndpoint.openid_type_uris)
  
      return op_services or openid_services