Concatenates two DataTables together, as long as column names
        are identical (ignoring order). The resulting DataTable's columns
        are in the order of the table whose `concat` method was called.
2874
def concat(self, other_datatable, inplace=False):
        
        if not isinstance(other_datatable, DataTable):
            raise TypeError("`concat` requires a DataTable, not a %s" %
                            type(other_datatable))

        # if the self table is empty, we can just return the other table
        # if we need to do it in place, we just copy over the columns
        if not self.fields:
            if inplace:
                for field in other_datatable.fields:
                    self[field] = other_datatable[field]
                return self
            else:
                return other_datatable
        if not other_datatable.fields:
            return self

        if set(self.fields) != set(other_datatable.fields):
            raise Exception("Columns do not match:\nself: %s\nother: %s" %
                            (self.fields, other_datatable.fields))

        # TODO: this will fail if we're concatenating one table with `arrays`
        # TODO: to a table with lists, even if everything else is compatible
        # TODO: a TypeError is thrown
        # TODO: if we run through and just append, this may be faster and
        # TODO: more memory-efficient for large lists, as well as compatible
        # TODO: with arrays
        if inplace:
            for field in self.fields:
                self.__data[field] = self[field] + other_datatable[field]
            return self
        else:
            new_table = DataTable()
            for field in self.fields:
                new_table[field] = self[field] + other_datatable[field]
            return new_table
226118
FormattingContext concat(FormattingContext other) {
    if (isEmpty()) {
      return other;
    } else if (other.isEmpty()) {
      return this;
    } else {
      curIndent = ""; // don't serialize trailing whitespace in front of the next FormattingContext.
      return append(other.toString());
    }
  }
642947
public static void concatRows(DMatrixRMaj a , DMatrixRMaj b , DMatrixRMaj output ) {
        int rows = a.numRows + b.numRows;
        int cols = Math.max(a.numCols , b.numCols);

        output.reshape(rows,cols);
        output.zero();

        insert(a,output,0,0);
        insert(b,output,a.numRows,0);
    }
1246421
public static ResultSet combineResultSets(ResultSet first, ResultSet second) {
    Function<ColumnType, String> columnTypeToString = new Function<ColumnType, String>() {
      public String apply(ColumnType input) {
        return input.getLabelName();
      }
    };
    List<String> firstColumns =
        Lists.transform(Lists.newArrayList(first.getColumnTypes()), columnTypeToString);
    List<String> secondColumns =
        Lists.transform(Lists.newArrayList(second.getColumnTypes()), columnTypeToString);
    if (!firstColumns.equals(secondColumns)) {
      throw new IllegalArgumentException(String.format(
          "First result set columns [%s] do not match second columns [%s]",
          Joiner.on(",").join(firstColumns), Joiner.on(",").join(secondColumns)));
    }
    List<Row> combinedRows = Lists.newArrayList(first.getRows());
    if (second.getRows() != null) {
      combinedRows.addAll(Lists.newArrayList(second.getRows()));
    }

    ResultSet combinedResultSet = new ResultSet();
    combinedResultSet.getColumnTypes().addAll(first.getColumnTypes());
    combinedResultSet.getRows().addAll(combinedRows);
    return combinedResultSet;
  }
181053
def concatenate(cls, *args: List['ComponentRef']) -> 'ComponentRef':
        

        a = copy.deepcopy(args[0])
        n = a
        for b in args[1:]:
            while n.child:
                n = n.child[0]
            b = copy.deepcopy(b)  # Not strictly necessary
            n.child = [b]
        return a
1221404
def concat_same_type(self, to_concat, placement=None):
        
        values = self._concatenator([blk.values for blk in to_concat],
                                    axis=self.ndim - 1)
        return self.make_block_same_class(
            values, placement=placement or slice(0, len(values), 1))
997082
def _InnerAppendData(self, prev_col_values, data, col_index):
    """"""
    # We first check that col_index has not exceeded the columns size
    if col_index >= len(self.__columns):
      raise DataTableException("The data does not match description, too deep")

    # Dealing with the scalar case, the data is the last value.
    if self.__columns[col_index]["container"] == "scalar":
      prev_col_values[0][self.__columns[col_index]["id"]] = data
      self.__data.append(prev_col_values)
      return

    if self.__columns[col_index]["container"] == "iter":
      if not hasattr(data, "__iter__") or isinstance(data, dict):
        raise DataTableException("Expected iterable object, got %s" %
                                 type(data))
      # We only need to insert the rest of the columns
      # If there are less items than expected, we only add what there is.
      for value in data:
        if col_index >= len(self.__columns):
          raise DataTableException("Too many elements given in data")
        prev_col_values[0][self.__columns[col_index]["id"]] = value
        col_index += 1
      self.__data.append(prev_col_values)
      return

    # We know the current level is a dictionary, we verify the type.
    if not isinstance(data, dict):
      raise DataTableException("Expected dictionary at current level, got %s" %
                               type(data))
    # We check if this is the last level
    if self.__columns[col_index]["depth"] == self.__columns[-1]["depth"]:
      # We need to add the keys in the dictionary as they are
      for col in self.__columns[col_index:]:
        if col["id"] in data:
          prev_col_values[0][col["id"]] = data[col["id"]]
      self.__data.append(prev_col_values)
      return

    # We have a dictionary in an inner depth level.
    if not data.keys():
      # In case this is an empty dictionary, we add a record with the columns
      # filled only until this point.
      self.__data.append(prev_col_values)
    else:
      for key in sorted(data):
        col_values = dict(prev_col_values[0])
        col_values[self.__columns[col_index]["id"]] = key
        self._InnerAppendData((col_values, prev_col_values[1]),
                              data[key], col_index + 1)
444566
public T concatColumns( SimpleBase ...matrices ) {
        convertType.specify0(this,matrices);
        T A = convertType.convert(this);

        int numCols = A.numCols();
        int numRows = A.numRows();
        for (int i = 0; i < matrices.length; i++) {
            numRows = Math.max(numRows,matrices[i].numRows());
            numCols += matrices[i].numCols();
        }

        SimpleMatrix combined = SimpleMatrix.wrap(convertType.commonType.create(numRows,numCols));

        A.ops.extract(A.mat,0,A.numRows(),0,A.numCols(),combined.mat,0,0);
        int col = A.numCols();
        for (int i = 0; i < matrices.length; i++) {
            Matrix m = convertType.convert(matrices[i]).mat;
            int cols = m.getNumCols();
            int rows = m.getNumRows();;
            A.ops.extract(m,0,rows,0,cols,combined.mat,0,col);
            col += cols;
        }

        return (T)combined;
    }
320245
def concat(mats):
    
    for mat in mats:
        if mat.isdiagonal:
            raise NotImplementedError("concat not supported for diagonal mats")

    row_match = True
    col_match = True
    for mat in mats[1:]:
        if sorted(mats[0].row_names) != sorted(mat.row_names):
            row_match = False
        if sorted(mats[0].col_names) != sorted(mat.col_names):
            col_match = False
    if not row_match and not col_match:
        raise Exception("mat_handler.concat(): all Matrix objects"+\
                        "must share either rows or cols")

    if row_match and col_match:
        raise Exception("mat_handler.concat(): all Matrix objects"+\
                        "share both rows and cols")

    if row_match:
        row_names = copy.deepcopy(mats[0].row_names)
        col_names = []
        for mat in mats:
            col_names.extend(copy.deepcopy(mat.col_names))
        x = mats[0].newx.copy()
        for mat in mats[1:]:
            mat.align(mats[0].row_names, axis=0)
            other_x = mat.newx
            x = np.append(x, other_x, axis=1)

    else:
        col_names = copy.deepcopy(mats[0].col_names)
        row_names = []
        for mat in mats:
            row_names.extend(copy.deepcopy(mat.row_names))
        x = mats[0].newx.copy()
        for mat in mats[1:]:
            mat.align(mats[0].col_names, axis=1)
            other_x = mat.newx
            x = np.append(x, other_x, axis=0)
    return Matrix(x=x, row_names=row_names, col_names=col_names)
364690
private byte[] concat(final byte[] input1, final byte[] input2, final int position) {
        // Preconition checks
        assert input1 != null : "Input 1 must be specified";
        assert input2 != null : "Input 2 must be specified";
        assert position >= 0 : "Position must be 0 or higher";
        // Allocate a new array of enough space (either current size or position + input2.length, whichever is greater)
        final int newSize = position < input1.length ? input1.length + input2.length : position + input2.length;
        final byte[] merged = new byte[newSize];
        // Copy in the contents of input 1 with 0 offset
        System.arraycopy(input1, 0, merged, 0, input1.length);
        // Copy in the contents of input2 with offset the length of input 1
        System.arraycopy(input2, 0, merged, position, input2.length);
        return merged;
    }
1268433
function concat(a, b) {
  if (a.concat) { // Is `a` an Array?
    return a.concat(b);
  }
  if (a instanceof Blob) {
    return new Blob([a,b], {type: a.type});
  }
  if (a.set) { // Is `a` a typed array?
    var c = new a.constructor(a.length + b.length);
    c.set(a);
    c.set(b, a.length);
    return c;
  }
  throw new Error("Unknown data type");
}
126310
def concatenate(self, other):
        

        if self.is_absolute() and len(other) > 0:
            raise AbsoluteConcatenation
        labels = list(self.labels)
        labels.extend(list(other.labels))
        return Name(labels)
419636
public static Object[] concat(Object array1[], Object array2[]){
        Class<?> class1 = array1.getClass().getComponentType();
        Class<?> class2 = array2.getClass().getComponentType();
        Class<?> commonClass = class1.isAssignableFrom(class2)
                                    ? class1
                                    : (class2.isAssignableFrom(class1) ? class2 : Object.class);
        return concat(array1, array2, commonClass);
    }
413208
def combineColumns(cols):
    ''
    return Column("+".join(c.name for c in cols),
                  getter=lambda col,row,cols=cols,ch=' ': ch.join(c.getDisplayValue(row) for c in cols))
928999
public void concat(NFA<T> nfa)
    {
        last.addEpsilon(nfa.getFirst());
        last = nfa.last;
    }
940473
private function mergeColumns(): void
  {
    foreach ($this->oldColumns as $table_name => $table)
    {
      foreach ($table as $column_name => $column)
      {
        if (isset($this->columns[$table_name][$column_name]))
        {
          $this->columns[$table_name][$column_name]['constant_name'] = $column['constant_name'];
        }
      }
    }
  }
608502
function concatenation() {
    var ret = this.seq(
        repetition,
        this.manyf(this.seqf(
            this.many1f(c_wsp),
            repetition)));
    if (ret[2].length === 0) {
        return ret[1];
    }
    var cats = ret[2].map(function(el){ return el[2]; });
    return [].concat(ret[1]).concat(cats);
}