<commit_before>"""Example of integration between Fabric and Datadog.
"""

from fabric.api import *
from fabric.colors import *
from dogapi.fab import setup, notify

setup(api_key = "YOUR API KEY HERE")

# Make sure @notify is just above @task
@notify
@task(default=True, alias="success")
def sweet_task(some_arg, other_arg):
    """Always succeeds"""
    print(green("My sweet task always runs properly."))

@notify
@task(alias="failure")
def boring_task(some_arg):
    """Always fails"""
    print(red("My boring task is designed to fail."))
    raise Exception("failure!!!")<commit_msg>Update fabric examples to reflect changes.<commit_after>"""Example of integration between Fabric and Datadog.
"""

from fabric.api import *
from fabric.colors import *
from dogapi.fab import setup, notify

setup(api_key = "YOUR API KEY HERE")

# Make sure @notify is just below @task
@task(default=True, alias="success")
@notify
def sweet_task(some_arg, other_arg):
    """Always succeeds"""
    print(green("My sweet task always runs properly."))

@task(alias="failure")
@notify
def boring_task(some_arg):
    """Always fails"""
    print(red("My boring task is designed to fail."))
    raise Exception("failure!!!")

env.roledefs.update({
    'webserver': ['localhost']
})

@task(alias="has_roles")
@notify
@roles('webserver')
@hosts('localhost')
def roles_task(arg_1, arg_2):
    run('touch /tmp/fab_test')
{'fraction_non_alphanumeric': 0.14387974230493916, 'fraction_numerical': 0.0014316392269148174, 'mean_word_length': 5.3545454545454545, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3174993', 'n_tokens_mistral': 442, 'n_tokens_neox': 430, 'n_words': 134}