<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def connect_input(self, index, walker, trigger=None):
 """Connect an input to a stream walker. If the input is already connected to something an exception is thrown. Otherwise the walker is used to read inputs for that input. A triggering condition can optionally be passed that will determine when this input will be considered as triggered. Args: index (int):
 The index of the input that we want to connect walker (StreamWalker):
 The stream walker to use for the input trigger (InputTrigger):
 The trigger to use for the input. If no trigger is specified, the input is considered to always be triggered (so TrueTrigger is used) """


        if trigger is None:
            trigger = TrueTrigger()

        if index >= len(self.inputs):
            raise TooManyInputsError("Input index exceeded max number of inputs", index=index, max_inputs=len(self.inputs), stream=self.stream)

        self.inputs[index] = (walker, trigger)