parameters: (self)
return_statement: return connections[0]
docstring: Return a connection from the pool using the `ConnectionSelector`
          instance.
  
          It tries to resurrect eligible connections, forces a resurrection when
          no connections are availible and passes the list of live connections to
          the selector instance to choose from.
  
          Returns a connection instance and it's current fail count.
docstring_summary: Return a connection from the pool using the `ConnectionSelector`
          instance.
docstring_tokens: Return a connection from the pool using the ConnectionSelector instance .
function: def get_connection(self):
          """
          Return a connection from the pool using the `ConnectionSelector`
          instance.
  
          It tries to resurrect eligible connections, forces a resurrection when
          no connections are availible and passes the list of live connections to
          the selector instance to choose from.
  
          Returns a connection instance and it's current fail count.
          """
          self.resurrect()
          connections = self.connections[:]
  
          # no live nodes, resurrect one by force and return it
          if not connections:
              return self.resurrect(True)
  
          # only call selector if we have a selection
          if len(connections) > 1:
              return self.selector.select(connections)
  
          # only one connection, no need for a selector
          return connections[0]
function_tokens: def get_connection ( self ) : self . resurrect ( ) connections = self . connections [ : ] # no live nodes, resurrect one by force and return it if not connections : return self . resurrect ( True ) # only call selector if we have a selection if len ( connections ) > 1 : return self . selector . select ( connections ) # only one connection, no need for a selector return connections [ 0 ]