docs: def setData(self, data, setName=None):
          """
          Assign the data in the dataframe to the AMPL entities with the names
          corresponding to the column names.
  
          Args:
              data: The dataframe containing the data to be assigned.
  
              setName: The name of the set to which the indices values of the
              DataFrame are to be assigned.
  
          Raises:
              AMPLException: if the data assignment procedure was not successful.
          """
          if not isinstance(data, DataFrame):
              if pd is not None and isinstance(data, pd.DataFrame):
                  data = DataFrame.fromPandas(data)
          if setName is None:
              lock_and_call(
                  lambda: self._impl.setData(data._impl),
                  self._lock
              )
          else:
              lock_and_call(
                  lambda: self._impl.setData(data._impl, setName),
                  self._lock
              )