def _broadcast_axis(a, b):
 if (a == b):
  return a
 elif (a == 1):
  return b
 elif (b == 1):
  return a
 else:
  raise ValueError('failed to broadcast {0} and {1}'.format(a, b))

def _broadcast_axis ( a , b ) : if ( a == b ) : return a elif ( a == 1 ) : return b elif ( b == 1 ) : return a else : raise ValueError ( 'failed to broadcast {0} and {1}' . format ( a , b ) )
raises valueerror if broadcast fails .