'shutdown(direction = "send")
Closes the tube for futher reading or writing depending on `direction`.
Arguments:
direction(str): Which direction to close; "in", "read" or "recv"
closes the tube in the ingoing direction, "out", "write" or "send"
closes it in the outgoing direction.
Returns:
:const:`None`
Examples:
>>> def p(x): print x
>>> t = tube()
>>> t.shutdown_raw = p
>>> _=map(t.shutdown, (\'in\', \'read\', \'recv\', \'out\', \'write\', \'send\'))
recv
recv
recv
send
send
send
>>> t.shutdown(\'bad_value\') #doctest: +ELLIPSIS
Traceback (most recent call last):
KeyError: "direction must be in [\'in\', \'out\', \'read\', \'recv\', \'send\', \'write\']"'

def shutdown(self, direction='send'):

    try:
        direction = self.shutdown_directions[direction]
    except KeyError:
        raise KeyError(('direction    must    be    in    %r' % sorted(self.shutdown_directions)))
    else:
        self.shutdown_raw(self.shutdown_directions[direction])
