def _fill_shape(x, n):
 if ((not isinstance(n, numbers.Integral)) or (n < 1)):
  raise TypeError('n must be a positive integer')
 if isinstance(x, numbers.Integral):
  return ((x,) * n)
 elif (isinstance(x, collections.Iterable) and (len(x) == n) and all((isinstance(v, numbers.Integral) for v in x))):
  return tuple(x)
 else:
  raise TypeError('x is {}, must be either an integer or an iterable of integers of size {}'.format(x, n))

def _fill_shape ( x , n ) : if ( ( not isinstance ( n , numbers . Integral ) ) or ( n < 1 ) ) : raise TypeError ( 'n must be a positive integer' ) if isinstance ( x , numbers . Integral ) : return ( ( x , ) * n ) elif ( isinstance ( x , collections . Iterable ) and ( len ( x ) == n ) and all ( ( isinstance ( v , numbers . Integral ) for v in x ) ) ) : return tuple ( x ) else : raise TypeError ( 'x is {}, must be either an integer or an iterable of integers of size {}' . format ( x , n ) )
idempotentally converts an integer to a tuple of integers of a given size .