<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def num_inputs(self):
 """Return the number of connected inputs. Returns: int: The number of connected inputs """


        num = 0

        for walker, _ in self.inputs:
            if not isinstance(walker, InvalidStreamWalker):
                num += 1

        return num