parameters: (resp)
return_statement: return host, port
docstring: Parse the '227' response for a PASV request.
      Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)'
      Return ('host.addr.as.numbers', port#) tuple.
docstring_summary: Parse the '227' response for a PASV request.
      Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)'
      Return ('host.addr.as.numbers', port#) tuple.
docstring_tokens: Parse the 227 response for a PASV request . Raises error_proto if it does not contain ( h1 h2 h3 h4 p1 p2 ) Return ( host . addr . as . numbers port# ) tuple .
function: def parse227(resp):
      '''Parse the '227' response for a PASV request.
      Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)'
      Return ('host.addr.as.numbers', port#) tuple.'''
  
      if resp[:3] != '227':
          raise error_reply, resp
      global _227_re
      if _227_re is None:
          import re
          _227_re = re.compile(r'(\d+),(\d+),(\d+),(\d+),(\d+),(\d+)')
      m = _227_re.search(resp)
      if not m:
          raise error_proto, resp
      numbers = m.groups()
      host = '.'.join(numbers[:4])
      port = (int(numbers[4]) << 8) + int(numbers[5])
      return host, port
function_tokens: def parse227 ( resp ) : if resp [ : 3 ] != '227' : raise error_reply , resp global _227_re if _227_re is None : import re _227_re = re . compile ( r'(\d+),(\d+),(\d+),(\d+),(\d+),(\d+)' ) m = _227_re . search ( resp ) if not m : raise error_proto , resp numbers = m . groups ( ) host = '.' . join ( numbers [ : 4 ] ) port = ( int ( numbers [ 4 ] ) << 8 ) + int ( numbers [ 5 ] ) return host , port