def transform_command(src, show_diff=True):
 i = 0
 limit = sys.getrecursionlimit()
 lst = ''
 raw = src
 while (src != lst):
  lst = src
  srcs = events.on_transform_command.fire(src)
  for s in srcs:
   if (s != lst):
    src = s
    break
  i += 1
  if (i == limit):
   print_exception('Modifcations to source input took more than the recursion limit number of interations to converge.')
 debug_level = builtins.__xonsh_env__.get('XONSH_DEBUG')
 if (show_diff and (debug_level > 1) and (src != raw)):
  sys.stderr.writelines(difflib.unified_diff(raw.splitlines(keepends=True), src.splitlines(keepends=True), fromfile='before precommand event', tofile='after precommand event'))
 return src

def transform_command ( src , show_diff = True ) : i = 0 limit = sys . getrecursionlimit ( ) lst = '' raw = src while ( src != lst ) : lst = src srcs = events . on_transform_command . fire ( src ) for s in srcs : if ( s != lst ) : src = s break i += 1 if ( i == limit ) : print_exception ( 'Modifcations to source input took more than the recursion limit number of interations to converge.' ) debug_level = builtins . __xonsh_env__ . get ( 'XONSH_DEBUG' ) if ( show_diff and ( debug_level > 1 ) and ( src != raw ) ) : sys . stderr . writelines ( difflib . unified_diff ( raw . splitlines ( keepends = True ) , src . splitlines ( keepends = True ) , fromfile = 'before precommand event' , tofile = 'after precommand event' ) ) return src
returns the results of firing the precommand handles .