def close(self, other_side=True):
        """Close the connection

        Close the pipeline if open and make sure the other connection
        is closed too.

        :param other_side: if True close the other_side connection too.
            used to avoid infinite loop
        """
        waiters = [self.close_pipeline()]
        if self.other_side and other_side:
            waiters.append(self.other_side.close(False))
        if self.transport:
            self.transport.close()
        waiters = [w for w in waiters if w]
        if waiters:
            return waiters[0] if len(waiters) == 1 else gather(*waiters)
def close ( self , other_side = True ) : waiters = [ self . close_pipeline ( ) ] if self . other_side and other_side : waiters . append ( self . other_side . close ( False ) ) if self . transport : self . transport . close ( ) waiters = [ w for w in waiters if w ] if waiters : return waiters [ 0 ] if len ( waiters ) == 1 else gather ( * waiters )
Close the connection

        Close the pipeline if open and make sure the other connection
        is closed too.

        :param other_side: if True close the other_side connection too.
            used to avoid infinite loop