MCPcopy Index your code
hub / github.com/bayesian-optimization/BayesianOptimization / _format_bool

Method _format_bool

bayes_opt/logger.py:106–119  ·  view source on GitHub ↗

Format a boolean. Parameters ---------- x : boolean Value to format. Returns ------- A stringified, formatted version of `x`.

(self, x: bool)

Source from the content-addressed store, hash-verified

104 return result
105
106 def _format_bool(self, x: bool) -> str:
107 """Format a boolean.
108
109 Parameters
110 ----------
111 x : boolean
112 Value to format.
113
114 Returns
115 -------
116 A stringified, formatted version of `x`.
117 """
118 x_ = ("T" if x else "F") if self._default_cell_size < 5 else str(x)
119 return f"{x_:<{self._default_cell_size}}"
120
121 def _format_str(self, str_: str) -> str:
122 """Format a str.

Callers 2

test_format_boolFunction · 0.95
_print_stepMethod · 0.95

Calls

no outgoing calls

Tested by 1

test_format_boolFunction · 0.76