<commit_before># TODO
# handle no internet connection exception
# handle internet timeout exception
# handle html parse exception
# D0 PNR validations number, length etc

from lxml import html
import httplib, urllib

from constants import *

class PNRClass:
   pnr = {}

   def __init__(self):
      self.pnr["Status"] = {"code": 0, "message": "None"}

   def getJourneyDetails(self, data):
      trElements = data.getchildren()
       
      journeyDetails = trElements[2].getchildren()
      self.pnr["TrainNumber"] = journeyDetails[0].text
      self.pnr["TrainName"]   = (journeyDetails[1].text).lstrip().rstrip()
      self.pnr["BoardingDate"] = journeyDetails[2].text
      self.pnr["From"] = journeyDetails[3].text
      self.pnr["To"] = journeyDetails[4].text
      self.pnr["ReservedUpto"] = journeyDetails[5].text<commit_msg>BUG fix : new request response contains the previous response data<commit_after># TODO
# handle no internet connection exception
# handle internet timeout exception
# handle html parse exception
# D0 PNR validations number, length etc

from lxml import html
import httplib, urllib

from constants import *

class PNRClass:
   pnr = {}

   def __init__(self):
      self.pnr = {}
      self.pnr["Status"] = {"code": 0, "message": "None"}

   def getJourneyDetails(self, data):
      trElements = data.getchildren()
       
      journeyDetails = trElements[2].getchildren()
      self.pnr["TrainNumber"] = journeyDetails[0].text
      self.pnr["TrainName"]   = (journeyDetails[1].text).lstrip().rstrip()
      self.pnr["BoardingDate"] = journeyDetails[2].text
      self.pnr["From"] = journeyDetails[3].text
      self.pnr["To"] = journeyDetails[4].text
      self.pnr["ReservedUpto"] = journeyDetails[5].text
{'fraction_non_alphanumeric': 0.13023522662076878, 'fraction_numerical': 0.010327022375215147, 'mean_word_length': 3.8310249307479225, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5534473', 'n_tokens_mistral': 541, 'n_tokens_neox': 532, 'n_words': 129}