# Path: alertaclient/utils.py
# def origin():
#     prog = os.path.basename(sys.argv[0])
#     return f'{prog}/{platform.uname()[1]}'


import sys
import click
from alertaclient.utils import origin
    Note: The "environment", "severity", "service" and "group" values are only
    used when heartbeat alerts are generated from slow or stale heartbeats.
    """
    client = obj['client']
    if delete:
        client.delete_heartbeat(delete)
    else:
        if any(t.startswith('environment') or t.startswith('group') for t in tags):
            click.secho('WARNING: Using tags for "environment" or "group" is deprecated. See help.', err=True)

        if severity in ['normal', 'ok', 'cleared']:
            raise click.UsageError('Must be a non-normal severity. "{}" is one of {}'.format(
                severity, ', '.join(['normal', 'ok', 'cleared']))
            )

        if severity and severity not in obj['alarm_model']['severity'].keys():
            raise click.UsageError('Must be a valid severity. "{}" is not one of {}'.format(
                severity, ', '.join(obj['alarm_model']['severity'].keys()))
            )
        attributes = dict()
        if environment:
            attributes['environment'] = environment
        if severity:
            attributes['severity'] = severity
        if service:
            attributes['service'] = service
        if group:
            attributes['group'] = group

        try:

# Path: alertaclient/utils.py
# def origin():
#     prog = os.path.basename(sys.argv[0])
#     return f'{prog}/{platform.uname()[1]}'


# Path: alertaclient/commands/cmd_heartbeat.py
import sys
import click
from alertaclient.utils import origin

    Note: The "environment", "severity", "service" and "group" values are only
    used when heartbeat alerts are generated from slow or stale heartbeats.
    """
    client = obj['client']
    if delete:
        client.delete_heartbeat(delete)
    else:
        if any(t.startswith('environment') or t.startswith('group') for t in tags):
            click.secho('WARNING: Using tags for "environment" or "group" is deprecated. See help.', err=True)

        if severity in ['normal', 'ok', 'cleared']:
            raise click.UsageError('Must be a non-normal severity. "{}" is one of {}'.format(
                severity, ', '.join(['normal', 'ok', 'cleared']))
            )

        if severity and severity not in obj['alarm_model']['severity'].keys():
            raise click.UsageError('Must be a valid severity. "{}" is not one of {}'.format(
                severity, ', '.join(obj['alarm_model']['severity'].keys()))
            )
        attributes = dict()
        if environment:
            attributes['environment'] = environment
        if severity:
            attributes['severity'] = severity
        if service:
            attributes['service'] = service
        if group:
            attributes['group'] = group

        try:

            heartbeat = client.heartbeat(origin=origin, tags=tags, attributes=attributes, timeout=timeout, customer=customer)