pretty_string

negmas.helpers.pretty_string(src, tab_size=2, compact=False)[source]

Recursively print nested elements.

Parameters:
  • src (Any) – The source to be converted to a printable string

  • tab_size (int) – Tab size in spaces

  • compact (bool) – If true the output is converted into a single line

Returns:

The pretty version of the input

Return type:

str

Remarks:
  • This function assumes that the patterns `` “`` and ": do not appear anywhere in the input. If they appear, the space, : will be removed.