<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def GetConnection(self, ConnectionObj):
 		""" 		Get a Open and active connection 		 		Returns a PySQLConnectionManager if one is open else it will create a new one if the max active connections hasn't been hit. 		If all possible connections are used. Then None is returned. 		 		@param PySQLConnectionObj: PySQLConnection Object representing your connection string 		@author: Nick Verbeck 		@since: 5/12/2008 		"""

		
		key = ConnectionObj.getKey()
		
		connection = None
		
		if self.connections.has_key(key):
			connection = self._getConnectionFromPoolSet(key)
			
			if connection is None:
				self.lock.acquire()
				if len(self.connections[key]) < self.maxActiveConnections:
					#Create a new connection
					connection = self._createConnection(ConnectionObj)
					self.connections[key].append(connection)
					self.lock.release()
				else:
					#Wait for a free connection. We maintain the lock on the pool so we are the 1st to get a connection.
					while connection is None:
						connection = self._getConnectionFromPoolSet(key)
					self.lock.release()
					
		#Create new Connection Pool Set
		else:
			self.lock.acquire()
			#We do a double check now that its locked to be sure some other thread didn't create this while we may have been waiting.
			if not self.connections.has_key(key):
				self.connections[key] = []
			
			if len(self.connections[key]) < self.maxActiveConnections:
				#Create a new connection
				connection = self._createConnection(ConnectionObj)
				self.connections[key].append(connection)
			else:
				#A rare thing happened. So many threads created connections so fast we need to wait for a free one.
				while connection is None:
					connection = self._getConnectionFromPoolSet(key)
			self.lock.release()
			
		return connection