code: def nodeChunk(lines):
      
      # Constants
      KEYWORDS = ('NODE',
                  'X_Y',
                  'ELEV')
  
      result = {'node': None,
                'x': None,
                'y': None,
                'elev': None}
  
      chunks = pt.chunk(KEYWORDS, lines)
  
      # Parse chunks associated with each key
      for key, chunkList in iteritems(chunks):
          # Parse each chunk in the chunk list
          for chunk in chunkList:
              schunk = chunk[0].strip().split()
              if key == 'X_Y':
                  result['x'] = schunk[1]
                  result['y'] = schunk[2]
              else:
                  result[key.lower()] = schunk[1]
  
      return result
docs: Parse NODE Method