parameters: (api, profile, elem)
return_statement: return True
docstring: Return whether an API and profile
      being generated matches an element's profile
  
      - api - string naming the API to match
      - profile - string naming the profile to match
      - elem - Element which (may) have 'api' and 'profile'
        attributes to match to.
  
      If a tag is not present in the Element, the corresponding API
        or profile always matches.
  
      Otherwise, the tag must exactly match the API or profile.
  
      Thus, if 'profile' = core:
  
      - `<remove>`  with no attribute will match
      - `<remove profile="core">` will match
      - `<remove profile="compatibility">` will not match
  
      Possible match conditions:
  
      ```
        Requested   Element
        Profile     Profile
        ---------   --------
        None        None        Always matches
        'string'    None        Always matches
        None        'string'    Does not match. Can't generate multiple APIs
                                or profiles, so if an API/profile constraint
                                is present, it must be asked for explicitly.
        'string'    'string'    Strings must match
      ```
  
      ** In the future, we will allow regexes for the attributes,
      not just strings, so that `api="^(gl|gles2)"` will match. Even
      this isn't really quite enough, we might prefer something
      like `"gl(core)|gles1(common-lite)"`.
docstring_summary: Return whether an API and profile
      being generated matches an element's profile
docstring_tokens: Return whether an API and profile being generated matches an element s profile
function: def matchAPIProfile(api, profile, elem):
      """Return whether an API and profile
      being generated matches an element's profile
  
      - api - string naming the API to match
      - profile - string naming the profile to match
      - elem - Element which (may) have 'api' and 'profile'
        attributes to match to.
  
      If a tag is not present in the Element, the corresponding API
        or profile always matches.
  
      Otherwise, the tag must exactly match the API or profile.
  
      Thus, if 'profile' = core:
  
      - `<remove>`  with no attribute will match
      - `<remove profile="core">` will match
      - `<remove profile="compatibility">` will not match
  
      Possible match conditions:
  
      ```
        Requested   Element
        Profile     Profile
        ---------   --------
        None        None        Always matches
        'string'    None        Always matches
        None        'string'    Does not match. Can't generate multiple APIs
                                or profiles, so if an API/profile constraint
                                is present, it must be asked for explicitly.
        'string'    'string'    Strings must match
      ```
  
      ** In the future, we will allow regexes for the attributes,
      not just strings, so that `api="^(gl|gles2)"` will match. Even
      this isn't really quite enough, we might prefer something
      like `"gl(core)|gles1(common-lite)"`."""
      # Match 'api', if present
      elem_api = elem.get('api')
      if elem_api:
          if api is None:
              raise UserWarning("No API requested, but 'api' attribute is present with value '"
                                + elem_api + "'")
          elif api != elem_api:
              # Requested API doesn't match attribute
              return False
      elem_profile = elem.get('profile')
      if elem_profile:
          if profile is None:
              raise UserWarning("No profile requested, but 'profile' attribute is present with value '"
                                + elem_profile + "'")
          elif profile != elem_profile:
              # Requested profile doesn't match attribute
              return False
      return True
function_tokens: def matchAPIProfile ( api , profile , elem ) : # Match 'api', if present elem_api = elem . get ( 'api' ) if elem_api : if api is None : raise UserWarning ( "No API requested, but 'api' attribute is present with value '" + elem_api + "'" ) elif api != elem_api : # Requested API doesn't match attribute return False elem_profile = elem . get ( 'profile' ) if elem_profile : if profile is None : raise UserWarning ( "No profile requested, but 'profile' attribute is present with value '" + elem_profile + "'" ) elif profile != elem_profile : # Requested profile doesn't match attribute return False return True