<commit_before>from cloudify import ctx
from cloudify.decorators import operation
from cloudify.exceptions import NonRecoverableError, RecoverableError
import connection



@operation
def create(**_):
    params = ctx.node.properties['parameters']
    cloud = connection.MistConnectionClient().cloud
    del params["cloud_id"]
    try:
        network = cloud.create_network(**params)

        ctx.instance.runtime_properties["info"] = network
    except Exception as exc:
        raise Exception(exc)
    # connection.MistConnectionClient().machine.destroy()
    # ctx.logger.info('Machine destroyed')



@operation
def delete(**_):

    try:
        network_id = ctx.instance.runtime_properties["info"]["id"]
        connection.MistConnectionClient().cloud.delete_network(network_id)
    except Exception as exc:
        raise Exception(exc)
    # connection.MistConnectionClient().machine.destroy()
    # ctx.logger.info('Machine destroyed')

@operation
def associate_network(**kwargs):
    print "associatekk"
    import ipdb
    ipdb.set_trace()
    ip = kwargs.get("ip")
    assign = kwargs.get("assign")
    machine_id = ctx.target.instance.runtime_properties["machine_id"]
    cloud_id = ctx.target.node.properties["cloud_id"]<commit_msg>remove print and ipdb's<commit_after>from cloudify import ctx
from cloudify.decorators import operation
from cloudify.exceptions import NonRecoverableError, RecoverableError
import connection



@operation
def create(**_):
    params = ctx.node.properties['parameters']
    cloud = connection.MistConnectionClient().cloud
    del params["cloud_id"]
    try:
        network = cloud.create_network(**params)

        ctx.instance.runtime_properties["info"] = network
    except Exception as exc:
        raise Exception(exc)
    # connection.MistConnectionClient().machine.destroy()
    # ctx.logger.info('Machine destroyed')



@operation
def delete(**_):

    try:
        network_id = ctx.instance.runtime_properties["info"]["id"]
        connection.MistConnectionClient().cloud.delete_network(network_id)
    except Exception as exc:
        raise Exception(exc)
    # connection.MistConnectionClient().machine.destroy()
    # ctx.logger.info('Machine destroyed')

@operation
def associate_network(**kwargs):
    ip = kwargs.get("ip")
    assign = kwargs.get("assign")
    machine_id = ctx.target.instance.runtime_properties["machine_id"]
    cloud_id = ctx.target.node.properties["cloud_id"]
{'fraction_non_alphanumeric': 0.11470708725931995, 'fraction_numerical': 0.0, 'mean_word_length': 4.151898734177215, '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': '5855062', 'n_tokens_mistral': 683, 'n_tokens_neox': 669, 'n_words': 137}