code: def one_hot(x, m=None):
      """One-hot representation of integer vector.
  
      Given a vector of integers from 0 to m-1, returns a matrix
      with a one-hot representation, where each row corresponds
      to an element of x.
  
      Parameters
      ----------
      x : integer vector
          The integer vector to convert to a one-hot representation.
      m : int, optional
          The number of different columns for the one-hot representation. This
          needs to be strictly greater than the maximum value of `x`.
          Defaults to ``max(x) + 1``.
  
      Returns
      -------
      Theano tensor variable
          A Theano tensor variable of shape (``n``, `m`), where ``n`` is the
          length of `x`, with the one-hot representation of `x`.
  
      Notes
      -----
      If your integer vector represents target class memberships, and you wish to
      compute the cross-entropy between predictions and the target class
      memberships, then there is no need to use this function, since the function
      :func:`lasagne.objectives.categorical_crossentropy()` can compute the
      cross-entropy from the integer vector directly.
  
      """
      if m is None:
          m = T.cast(T.max(x) + 1, "int32")
  
      return T.eye(m)[T.cast(x, "int32")]
  
file_path: Lasagne/lasagne/utils.py
imports: import numbers
  import numpy
  import theano
  import theano.tensor
label_desc: Use image node_id 5 for calling a global function with example usage: one_hot(x, m) and returns: T