MCPcopy Create free account
hub / github.com/dwavesystems/dwave-cloud-client / output

Function output

dwave/cloud/cli.py:450–465  ·  view source on GitHub ↗
(fmt=None, maxlen=None, **params)

Source from the content-addressed store, hash-verified

448 info = dict(datetime=now.isoformat(), timestamp=datetime_to_timestamp(now), code=0)
449
450 def output(fmt=None, maxlen=None, **params):
451 raw = params.pop('raw', None)
452 if raw_output:
453 if raw is not None:
454 click.echo(raw)
455 elif json_output:
456 info.update(params)
457 else:
458 if fmt is not None:
459 msg = fmt.format(**params)
460 else:
461 # logfmt-like output
462 msg = ' '.join(f'{k}={v}' for k,v in params.items())
463 if maxlen is not None:
464 msg = strtrunc(msg, maxlen)
465 click.echo(msg)
466
467 def flush():
468 if json_output and not raw_output:

Callers 15

_get_client_solverFunction · 0.85
_sampleFunction · 0.85
wrappedFunction · 0.85
pingFunction · 0.85
sampleFunction · 0.85
_loginFunction · 0.85
getFunction · 0.85
refreshFunction · 0.85
revokeFunction · 0.85
list_leap_projectsFunction · 0.85
leap_project_tokenFunction · 0.85

Calls 2

strtruncFunction · 0.90
formatMethod · 0.45

Tested by

no test coverage detected