parameters: (self, scope, equiv_set, loc, shapes, names)
return_statement: return tuple(reversed(new_shape)), sum(asserts, [])
docstring: Produce assert_equiv for sizes in each dimension, taking into account
          of dimension coercion and constant size of 1.
docstring_summary: Produce assert_equiv for sizes in each dimension, taking into account
          of dimension coercion and constant size of 1.
docstring_tokens: Produce assert_equiv for sizes in each dimension taking into account of dimension coercion and constant size of 1 .
function: def _broadcast_assert_shapes(self, scope, equiv_set, loc, shapes, names):
          """Produce assert_equiv for sizes in each dimension, taking into account
          of dimension coercion and constant size of 1.
          """
          asserts = []
          new_shape = []
          max_dim = max([len(shape) for shape in shapes])
          const_size_one = None
          for i in range(max_dim):
              sizes = []
              size_names = []
              for name, shape in zip(names, shapes):
                  if i < len(shape):
                      size = shape[len(shape) - 1 - i]
                      const_size = equiv_set.get_equiv_const(size)
                      if const_size == 1:
                          const_size_one = size
                      else:
                          sizes.append(size)  # non-1 size to front
                          size_names.append(name)
              if sizes == []:
                  assert(const_size_one != None)
                  sizes.append(const_size_one)
                  size_names.append("1")
              asserts.append(self._call_assert_equiv(scope, loc, equiv_set,
                                                     sizes, names=size_names))
              new_shape.append(sizes[0])
          return tuple(reversed(new_shape)), sum(asserts, [])
function_tokens: def _broadcast_assert_shapes ( self , scope , equiv_set , loc , shapes , names ) : asserts = [ ] new_shape = [ ] max_dim = max ( [ len ( shape ) for shape in shapes ] ) const_size_one = None for i in range ( max_dim ) : sizes = [ ] size_names = [ ] for name , shape in zip ( names , shapes ) : if i < len ( shape ) : size = shape [ len ( shape ) - 1 - i ] const_size = equiv_set . get_equiv_const ( size ) if const_size == 1 : const_size_one = size else : sizes . append ( size ) # non-1 size to front size_names . append ( name ) if sizes == [ ] : assert ( const_size_one != None ) sizes . append ( const_size_one ) size_names . append ( "1" ) asserts . append ( self . _call_assert_equiv ( scope , loc , equiv_set , sizes , names = size_names ) ) new_shape . append ( sizes [ 0 ] ) return tuple ( reversed ( new_shape ) ) , sum ( asserts , [ ] )