<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add(self, component: Union[Component, Sequence[Component]]) -> None: """Add a widget to the grid in the next available cell. Searches over columns then rows for available cells. Parameters components : bowtie._Component A Bowtie widget instance. """

        try:
            self[Span(*self._available_cell())] = component
        except NoUnusedCellsError:
            span = list(self._spans.keys())[-1]
            self._spans[span] += component