def setatrib(obj, attr: str, val):
    """
  Overiding the default getattr

  Arguments
  ---------
  obj : object
        The object from which to get the attribute.
  attr : str
         The attribute in string format.
  """
    attrs = attr.split('[')
    for ii in range(len(attrs)):
        if attrs[ii][-1] == ']':
            attr = attrs[ii][:-1]
        else:
            attr = attrs[ii]
        if ii == len(attrs) - 1:
            setattr(obj, attr, val)
        else:
            obj = getattr(obj, attr)
