code: def _submit_calcs_on_client(calcs, client, func):
      
      logging.info('Connected to client: {}'.format(client))
      if LooseVersion(dask.__version__) < '0.18':
          dask_option_setter = dask.set_options
      else:
          dask_option_setter = dask.config.set
      with dask_option_setter(get=client.get):
          return db.from_sequence(calcs).map(func).compute()
docs: Submit calculations via dask.bag and a distributed client