code: def _split_stock_code(self, code):
          stock_str = str(code)
  
          split_loc = stock_str.find(".")
          '''do not use the built-in split function in python.
          The built-in function cannot handle some stock strings correctly.
          for instance, US..DJI, where the dot . itself is a part of original code'''
          if 0 <= split_loc < len(
                  stock_str) - 1 and stock_str[0:split_loc] in MKT_MAP:
              market_str = stock_str[0:split_loc]
              partial_stock_str = stock_str[split_loc + 1:]
              return RET_OK, (market_str, partial_stock_str)
  
          else:
              error_str = ERROR_STR_PREFIX + "format of %s is wrong. (US.AAPL, HK.00700, SZ.000001)" % stock_str
              return RET_ERROR, error_stf _split_stock_code(self, code):
          stock_str = str(code)
  
          split_loc = stock_str.find(".")
          '''do not use the built-in split function in python.
          The built-in function cannot handle some stock strings correctly.
          for instance, US..DJI, where the dot . itself is a part of original code'''
          if 0 <= split_loc < len(
                  stock_str) - 1 and stock_str[0:split_loc] in MKT_MAP:
              market_str = stock_str[0:split_loc]
              partial_stock_str = stock_str[split_loc + 1:]
              return RET_OK, (market_str, partial_stock_str)
  
          else:
              error_str = ERROR_STR_PREFIX + "format of %s is wrong. (US.AAPL, HK.00700, SZ.000001)" % stock_str
              return RET_ERROR, error_str
docs: do not use the built-in split function in python.
          The built-in function cannot handle some stock strings correctly.
          for instance, US..DJI, where the dot . itself is a part of original code