def extend(self, table, keys=None):
    if keys:
      for k in keys:
        if k not in self._Header():
          raise IndexError("Unknown key: '%s'", k)

    extend_with = []
    for column in table.header:
      if column not in self.header:
        extend_with.append(column)

    if not extend_with:
      return

    for column in extend_with:
      self.AddColumn(column)

    if not keys:
      for row1, row2 in zip(self, table):
        for column in extend_with:
          row1[column] = row2[column]
      return

    for row1 in self:
      for row2 in table:
        for k in keys:
          if row1[k] != row2[k]:
            break
        else:
          for column in extend_with:
            row1[column] = row2[column]
          break

  # pylint: enable=C6409
Handle custom types defined in imported template files
dataset/ETHPy150Open google/textfsm/texttable.py/TextTable.extend--crossover with--dataset/ETHPy150Open openstack/tosca-parser/toscaparser/tosca_template.py/ToscaTemplate._get_custom_types