def load_from_directory(list_name):
 data = {}
 dir_path = os.path.join(SECURITY_LISTS_DIR, list_name)
 for kd_name in listdir(dir_path):
  kd = datetime.strptime(kd_name, DATE_FORMAT).replace(tzinfo=pytz.utc)
  data[kd] = {}
  kd_path = os.path.join(dir_path, kd_name)
  for ld_name in listdir(kd_path):
   ld = datetime.strptime(ld_name, DATE_FORMAT).replace(tzinfo=pytz.utc)
   data[kd][ld] = {}
   ld_path = os.path.join(kd_path, ld_name)
   for fname in listdir(ld_path):
    fpath = os.path.join(ld_path, fname)
    with open(fpath) as f:
     symbols = f.read().splitlines()
     data[kd][ld][fname] = symbols
 return data

def load_from_directory ( list_name ) : data = { } dir_path = os . path . join ( SECURITY_LISTS_DIR , list_name ) for kd_name in listdir ( dir_path ) : kd = datetime . strptime ( kd_name , DATE_FORMAT ) . replace ( tzinfo = pytz . utc ) data [ kd ] = { } kd_path = os . path . join ( dir_path , kd_name ) for ld_name in listdir ( kd_path ) : ld = datetime . strptime ( ld_name , DATE_FORMAT ) . replace ( tzinfo = pytz . utc ) data [ kd ] [ ld ] = { } ld_path = os . path . join ( kd_path , ld_name ) for fname in listdir ( ld_path ) : fpath = os . path . join ( ld_path , fname ) with open ( fpath ) as f : symbols = f . read ( ) . splitlines ( ) data [ kd ] [ ld ] [ fname ] = symbols return data
to resolve the symbol in the leveraged_etf list .