code: def parameters_to_readable_string(
      params, is_public_partition: Optional[bool] = None
  ) -> str:
      result = [f"{type(params).__name__}:"]
      if hasattr(params, "metrics_str"):
          result.append(f" {params.metrics_str}")
      if hasattr(params, "noise_kind"):
          result.append(f" noise_kind={params.noise_kind.value}")
      if hasattr(params, "budget_weight"):
          result.append(f" budget_weight={params.budget_weight}")
      result.append(f" Contribution bounding:")
      _add_if_obj_has_property(
          params, "max_partitions_contributed", 2, result
      )
      _add_if_obj_has_property(
          params, "max_contributions_per_partition", 2, result
      )
      _add_if_obj_has_property(params, "max_contributions", 2, result)
      _add_if_obj_has_property(params, "min_value", 2, result)
      _add_if_obj_has_property(params, "max_value", 2, result)
      _add_if_obj_has_property(
          params, "min_sum_per_partition", 2, result
      )
      _add_if_obj_has_property(
          params, "max_sum_per_partition", 2, result
      )
      if (
          hasattr(params, "contribution_bounds_already_enforced")
          and params.contribution_bounds_already_enforced
      ):
          result.append("  contribution_bounds_already_enforced=True")
      _add_if_obj_has_property(params, "vector_max_norm", 2, result)
      _add_if_obj_has_property(params, "vector_size", 2, result)
      _add_if_obj_has_property(params, "vector_norm_kind", 2, result)
  
      if is_public_partition is not None:
          type_str = (
              "public" if is_public_partition else "private"
          ) + " partitions"
          result.append(f" Partition selection: {type_str}")
  
      return "\n".join(result)
  
imports: import logging
  import math
  from dataclasses import dataclass
  from enum import Enum
  from typing import Any, Sequence, Callable, Optional, List
  import numpy
  from pipeline_dp import input_validators
label_desc: Use image node_id 7 for calling a global function with example usage: parameters_to_readable_string(params, is_public_partition) and returns: str