<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def push(self, yts):
 """ Search for, add and return new file descriptor. Parameters yts : YTStor-obj or None ``YTStor`` object for which we want to allocate a descriptor or ``None``, if we allocate descriptor for a control file. Returns ------- k : int File descriptor. """


        if not isinstance(yts, (YTStor, YTMetaStor, type(None))):
            raise TypeError("Expected YTStor object, YTMetaStor object or None.")

        k = 0
        while k in self.keys():
            k += 1
        self[k] = yts

        return k