def _coerce_flags_data(data): if isinstance(data, list): return data elif isinstance(data, dict): return flag_util.format_flag_assigns(data) else: _error("invalid flags value %r" % data)
def _default_run_label(flag_vals): """Returns a default run label for a map of flag values. The default label is a string containing flag assign as NAME=VALUE. """ non_null = { name: val for name, val in flag_vals.items() if val is not None } return " ".join( flag_util.format_flag_assigns(non_null, truncate_floats=True, shorten_paths=True))
def flags_desc(flags, truncate_floats=False, delim=", "): formatted = flag_util.format_flag_assigns(flags, truncate_floats) return delim.join(formatted)
def _step_flag_args(step): return flag_util.format_flag_assigns(step.flags)