def _construct_bundling(bundle_config, bundle_descriptor):
    """Helper for ``construct_settings()``.

    Args:
      bundle_config (dict): A dictionary specifying a bundle parameters, the
        value for 'bundling' field in a method config (See
        ``construct_settings()`` for information on this config.)
      bundle_descriptor (BundleDescriptor): A BundleDescriptor object
        describing the structure of bundling for this method. If not set,
        this method will not bundle.

    Returns:
      Tuple[bundling.Executor, BundleDescriptor]: A tuple that configures
        bundling. The bundling.Executor may be None if this method should not
        bundle.
    """
    if bundle_config and bundle_descriptor:
        bundler = bundling.Executor(gax.BundleOptions(
            element_count_threshold=bundle_config.get(
                'element_count_threshold', 0),
            element_count_limit=bundle_config.get('element_count_limit', 0),
            request_byte_threshold=bundle_config.get(
                'request_byte_threshold', 0),
            request_byte_limit=bundle_config.get('request_byte_limit', 0),
            delay_threshold=bundle_config.get('delay_threshold_millis', 0)))
    else:
        bundler = None

    return bundler
Helper for ``construct_settings()``.

    Args:
      bundle_config (dict): A dictionary specifying a bundle parameters, the
        value for 'bundling' field in a method config (See
        ``construct_settings()`` for information on this config.)
      bundle_descriptor (BundleDescriptor): A BundleDescriptor object
        describing the structure of bundling for this method. If not set,
        this method will not bundle.

    Returns:
      Tuple[bundling.Executor, BundleDescriptor]: A tuple that configures
        bundling. The bundling.Executor may be None if this method should not
        bundle.