<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def getAlgorithmInstance(self, layer="L2", column=0):
 """ Returns an instance of the underlying algorithm. For example, layer=L2 and column=1 could return the actual instance of ColumnPooler that is responsible for column 1. """

    assert ( (column>=0) and (column<self.numColumns)), ("Column number not "
                          "in valid range")

    if layer == "L2":
      return self.L2Columns[column].getAlgorithmInstance()
    elif layer == "L4":
      return self.L4Columns[column].getAlgorithmInstance()
    else:
      raise Exception("Invalid layer. Must be 'L4' or 'L2'")