code: def _broadcast_and_set_attrs(self, local_dict):
          
          del local_dict['self']
          self.remove_axis = False
          max_length = 0
          for key in local_dict:
              try:
                  length = len(local_dict[key])
                  if length > max_length:
                      max_length = length
  
              except TypeError:
                  pass
  
          if max_length == 0:
              self.remove_axis = True
              for key in local_dict:
                  setattr(self, key, np.array([local_dict[key]]))
  
          # check for bad length arrays
          else:
              for key in local_dict:
                  try:
                      if len(local_dict[key]) < max_length and len(local_dict[key]) > 1:
                          raise ValueError("Casting parameters not correct."
                                           + " Need all at a maximum shape and the rest being"
                                           + "len-1 arrays or scalars")
                  except TypeError:
                      pass
  
              # broadcast arrays
              for key in local_dict:
                  try:
                      if len(local_dict[key]) == max_length:
                          setattr(self, key, local_dict[key])
                      elif len(local_dict[key]) == 1:
                          setattr(self, key, np.full((max_length,), local_dict[key][0]))
                  except TypeError:
                      setattr(self, key, np.full((max_length,), local_dict[key]))
          return
docs: Cast all inputs to correct dimensions.
  
          This method fixes inputs who have different lengths. Namely one input as
          an array and others that are scalara or of len-1.
  
          Raises:
              Value Error: Multiple length arrays of len>1