code: def get_attr(attr_list, global_attrs):
      
      local_attr = [], {}
      for kv in attr_list:
          keyword = kv[0]
          if len(kv) == 1:
              local_attr[0].append(keyword)
              continue
          elif len(kv) == 2:
              value = kv[1]
          elif len(kv) > 2:
              value = kv[1:]
  
          if keyword == 'tag':
              local_attr[1].setdefault(keyword, set()).add(value)
          else:
              local_attr[1][keyword] = value
  
      attr0 = copy.copy(global_attrs[0])
      attr1 = copy.copy(global_attrs[1])
  
      if local_attr[0]:
          attr0.extend(local_attr[0])
  
      if local_attr[1]:
          attr1.update(local_attr[1])
  
      return attr0, attr1
docs: Parameters
      ----------
      attr_list : list
          A list of (keyword, value) tuple pairs
      global_attrs : tuple(list, dict)
          Global attributes which update the local attributes