def split_by_length(str, length, rejoin_with=None):
  str_arr = []
  counter = 0
  while counter<len(str):
    str_arr.append(str[counter:counter+length])
    counter += length

  if rejoin_with:
    return rejoin_with.join(str_arr)
  else:
    return str_arr
split a string by a given length
dataset/ETHPy150Open benadida/helios-server/helios/utils.py/split_by_length