text: """
  Setting environment
  """
  import typing
  from functools import wraps
  from time import time
  import datetime
  import logging
  
  import meta as m
  
  
  def log_init(full_path: str, will_log: bool):
      """ Logging initsialisation
  
      :param full_path: full path to use (directory and filename)
      :param will_log: logging by default is set to True
      """
      if will_log is True:
          LOG_FORMAT = "%(levelname)s:%(name)s:%(asctime)s - %(message)s"
          logging.basicConfig(
              filename=rf'{full_path}\logi.log',
              level=logging.INFO, format=LOG_FORMAT, filemode='w')
      else:
          logging.getLogger(f'{m.__organization_est__}.foo').addHandler(logging.NullHandler())
  
  
  def splicegen(maxchars, stringlist):
      """
      Return a list of slices to print based on maxchars string-length boundary.
      """
      runningcount = 0  # start at 0
      tmpslice = []  # tmp list where we append slice numbers.
      for i, item in enumerate(stringlist):
          runningcount += len(item)
          if runningcount <= int(maxchars):
              tmpslice.append(item)
          else:
              yield tmpslice
              tmpslice = [item]
              runningcount = len(item)
      yield tmpslice
  
  
  def measure_time(func):
      """Timing decorator to measure the exectution time
  
      :param func: main function to be used
      :return:
      """
  
      @wraps(func)
      def _time_it(*args, **kwargs):
          start = int(round(time()))
          try:
              return func(*args, **kwargs)
          finally:
              end_ = int(round(time())) - start
              end_min = str(datetime.timedelta(seconds=end_))  # conversion
              logging.info(f"Total time: {end_min if end_ > 0 else 0}")
              print(f"Total time: {end_min if end_ > 0 else 0}")
  
      return _time_it
  
  
  def chunk_cadastre(estates: list, chunk_size: int = 100) -> typing.Generator:
      """ Splitting list of dictionaries into chunks
  
      :param estates: list of dictionaries should contain valid cadastre info
      :param chunk_size: chunk size to use, default is 200
      :return: chunked dictionaries in a list
      """
      # For item i in a range that is a length of l,
      for i in range(0, len(estates), chunk_size):
          # Create an index range for l of n items:
          yield estates[i:i + chunk_size]
  