parameters: (attrs, attr_names)
return_statement: return r
docstring: Check attrs
  
      :param attrs: key-value attrs
      :param attr_names: list with attr_names
      :return: [], a list of errors otherwise
docstring_summary: Check attrs
docstring_tokens: Check attrs
function: def check_attrs(attrs, attr_names):
      """
      Check attrs
  
      :param attrs: key-value attrs
      :param attr_names: list with attr_names
      :return: [], a list of errors otherwise
      """
  
      r = []
  
      # We have found that some times attrs containts non-ASCII characters and printing can be problematic if
      # we don't use .encode('utf-8')
  
      # All in attrs is in attr_names
      for attr in attrs.keys():
          if base_name(attr).replace('=','.') not in attr_names:
              r.append('     * ERROR: base name of attr <{0}> in attrs keymap cannot be found in attrNames list'.format(attr.encode('utf-8')))
  
      # All in attr_names is in attrs
      for attr in attr_names:
          # map() used to get only the first token in attrs keys
          if attr not in map(lambda x: x.split('()')[0].replace('=','.'), attrs.keys()):
              r.append('     * ERROR: attr <{0}> in attrName list cannot be found in attrs keymap'.format(attr.encode('utf-8')))
  
      return r
function_tokens: def check_attrs ( attrs , attr_names ) : r = [ ] # We have found that some times attrs containts non-ASCII characters and printing can be problematic if # we don't use .encode('utf-8') # All in attrs is in attr_names for attr in attrs . keys ( ) : if base_name ( attr ) . replace ( '=' , '.' ) not in attr_names : r . append ( '     * ERROR: base name of attr <{0}> in attrs keymap cannot be found in attrNames list' . format ( attr . encode ( 'utf-8' ) ) ) # All in attr_names is in attrs for attr in attr_names : # map() used to get only the first token in attrs keys if attr not in map ( lambda x : x . split ( '()' ) [ 0 ] . replace ( '=' , '.' ) , attrs . keys ( ) ) : r . append ( '     * ERROR: attr <{0}> in attrName list cannot be found in attrs keymap' . format ( attr . encode ( 'utf-8' ) ) ) return r