code: def gradient_compression_params(args: argparse.Namespace) -> Optional[Dict[str, Any]]:
      
      if args.gradient_compression_type is None:
          return None
      else:
          return {'type': args.gradient_compression_type, 'threshold': args.gradient_compression_threshold}
docs: :param args: Arguments as returned by argparse.
      :return: Gradient compression parameters or None.