def METHOD_NAME(self, data):
    if isinstance(data, (np.ndarray, np.generic)):
        if (
            0 != self.size
            and self.component_count > 1
            and data.size // self.component_count != data.size / self.component_count
        ):
            raise ValueError(
                f"An array of shape {self.shape} is expected and "
                f"shape {data.shape} was input"
            )
    string_list = integral_types.MutableListString(data)
    return self._api.csstring_field_set_data(self, _get_size_of_list(data), string_list)