parameters: (u, v, transpose=True)
return_statement: return u, v
docstring: svd flip.
  
      Args:
          u (ndarray): the output of `linalg.svd`.
          v (ndarray): the output of `linalg.svd`.
          transpose (bool): if data is transposed.
docstring_summary: svd flip.
docstring_tokens: svd flip .
function: def _svd_flip(u, v, transpose=True):
      """
      svd flip.
  
      Args:
          u (ndarray): the output of `linalg.svd`.
          v (ndarray): the output of `linalg.svd`.
          transpose (bool): if data is transposed.
      """
      if not transpose:
          max_abs_cols = np.argmax(np.abs(u), axis=0)
          signs = np.sign(u[max_abs_cols, range(u.shape[1])])
          u *= signs
          v *= signs[:, np.newaxis]
      else:
          max_abs_rows = np.argmax(np.abs(v), axis=1)
          signs = np.sign(v[range(v.shape[0]), max_abs_rows])
          u *= signs
          v *= signs[:, np.newaxis]
      return u, v
function_tokens: def _svd_flip ( u , v , transpose = True ) : if not transpose : max_abs_cols = np . argmax ( np . abs ( u ) , axis = 0 ) signs = np . sign ( u [ max_abs_cols , range ( u . shape [ 1 ] ) ] ) u *= signs v *= signs [ : , np . newaxis ] else : max_abs_rows = np . argmax ( np . abs ( v ) , axis = 1 ) signs = np . sign ( v [ range ( v . shape [ 0 ] ) , max_abs_rows ] ) u *= signs v *= signs [ : , np . newaxis ] return u , v