code: def orth(X, tol=1.0e-07):
      """
  
      Compute orthonormal basis for the column span of X.
  
      Rank is determined by zeroing all singular values, u, less
      than or equal to tol*u.max().
  
      INPUTS:
          X  -- n-by-p matrix
  
      OUTPUTS:
          B  -- n-by-rank(X) matrix with orthonormal columns spanning
                the column rank of X
      """
  
      B, u, _ = npl.svd(X, full_matrices=False)
      nkeep = np.greater(u, tol * u.max()).astype(np.int_).sum()
      return B[:, :nkeep]
  
imports: import numpy
  import numpy.linalg
label_desc: Use image node_id 1 for calling a global function with example usage: orth(X, tol) and returns: B