code: def svd_flip(u, v, u_based_decision=True):  # noqa: D103
      if u_based_decision:
          # columns of u, rows of v
          max_abs_cols = np.argmax(np.abs(u), axis=0)
          signs = np.sign(u[max_abs_cols, np.arange(u.shape[1])])
          u *= signs
          v *= signs[:, np.newaxis]
      else:
          # rows of v, columns of u
          max_abs_rows = np.argmax(np.abs(v), axis=1)
          signs = np.sign(v[np.arange(v.shape[0]), max_abs_rows])
          u *= signs
          v *= signs[:, np.newaxis]
      return u, v
  
imports: import inspect
  import operator
  import os
  import warnings
  from contextlib import contextmanager
  from io import StringIO
  from math import log
  from pprint import pprint
  import numpy
label_desc: Use image node_id 14 for calling a global function with example usage: svd_flip(u, v, u_based_decision) and returns: u,  v