parameters: (icuTzDir, ignoreFactory)
return_statement: return (zones, links)
docstring: Read the ICU time zone information from `icuTzDir`/zoneinfo64.txt
          and returns the tuple (zones, links).
docstring_summary: Read the ICU time zone information from `icuTzDir`/zoneinfo64.txt
          and returns the tuple (zones, links).
docstring_tokens: Read the ICU time zone information from icuTzDir / zoneinfo64 . txt and returns the tuple ( zones links ) .
function: def readICUTimeZonesFromZoneInfo(icuTzDir, ignoreFactory):
      """ Read the ICU time zone information from `icuTzDir`/zoneinfo64.txt
          and returns the tuple (zones, links).
      """
      zoneKey = "zoneinfo64:table(nofallback)|Zones:array|:table"
      linkKey = "zoneinfo64:table(nofallback)|Zones:array|:int"
      namesKey = "zoneinfo64:table(nofallback)|Names"
  
      tzId = 0
      tzLinks = dict()
      tzNames = []
  
      for name, value in readICUResourceFile(os.path.join(icuTzDir, "zoneinfo64.txt")):
          if name == zoneKey:
              tzId += 1
          elif name == linkKey:
              tzLinks[tzId] = int(value)
              tzId += 1
          elif name == namesKey:
              tzNames.extend(value)
  
      links = dict((Zone(tzNames[zone]), tzNames[target]) for (zone, target) in tzLinks.iteritems())
      zones = set([Zone(v) for v in tzNames if Zone(v) not in links])
  
      # Remove the ICU placeholder time zone "Etc/Unknown".
      zones.remove(Zone("Etc/Unknown"))
  
      # tzdata2017c removed the link Canada/East-Saskatchewan -> America/Regina,
      # but it is still present in ICU sources. Manually remove it to keep our
      # tables consistent with IANA.
      del links[Zone("Canada/East-Saskatchewan")]
  
      # Remove the placeholder time zone "Factory".
      if ignoreFactory:
          zones.remove(Zone("Factory"))
  
      validateTimeZones(zones, links)
  
      return (zones, links)
function_tokens: def readICUTimeZonesFromZoneInfo ( icuTzDir , ignoreFactory ) : zoneKey = "zoneinfo64:table(nofallback)|Zones:array|:table" linkKey = "zoneinfo64:table(nofallback)|Zones:array|:int" namesKey = "zoneinfo64:table(nofallback)|Names" tzId = 0 tzLinks = dict ( ) tzNames = [ ] for name , value in readICUResourceFile ( os . path . join ( icuTzDir , "zoneinfo64.txt" ) ) : if name == zoneKey : tzId += 1 elif name == linkKey : tzLinks [ tzId ] = int ( value ) tzId += 1 elif name == namesKey : tzNames . extend ( value ) links = dict ( ( Zone ( tzNames [ zone ] ) , tzNames [ target ] ) for ( zone , target ) in tzLinks . iteritems ( ) ) zones = set ( [ Zone ( v ) for v in tzNames if Zone ( v ) not in links ] ) # Remove the ICU placeholder time zone "Etc/Unknown". zones . remove ( Zone ( "Etc/Unknown" ) ) # tzdata2017c removed the link Canada/East-Saskatchewan -> America/Regina, # but it is still present in ICU sources. Manually remove it to keep our # tables consistent with IANA. del links [ Zone ( "Canada/East-Saskatchewan" ) ] # Remove the placeholder time zone "Factory". if ignoreFactory : zones . remove ( Zone ( "Factory" ) ) validateTimeZones ( zones , links ) return ( zones , links )