<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: caktux
# @Date:   2014-12-21 12:44:20
# @Last Modified by:   caktux
# @Last Modified time: 2014-12-22 04:36:43

import logging

import api
import json
import yaml
import config as c
config = c.read_config()

logger = logging.getLogger(__name__)

from serpent import compile

default_from = config.get('api', 'address')
default_gas = int(config.get('deploy', 'gas'))
default_gas_price = int(config.get('deploy', 'gas_price'))

def deploy(filename, wait=False):
    # Load YAML definitions
    definitions = load_yaml(filename)

    # Dynamic variables
    variables = {}

    logger.info("Parsing %s..." % filename)

    for definition in definitions:
        for key in definition:
            logger.info("%s: " % key)

            if key == 'set':
                for name in definition[key]:
                    # Replace variables
                    for repdef in definitions:
                        for repkey in repdef:
                            for repname in repdef[repkey]:
                                if repkey != 'set':
                                    for repoption in repdef[repkey][repname]:
                                        if repdef[repkey][repname][repoption] == "$%s" % name:
                                            logger.debug("Replacing $%s with %s" % (name, definition[key][name]))
                                            repdef[repkey][repname][repoption] = definition[key][name]
                    logger.info("  %s: %s" % (name, definition[key][name]))
                logger.debug(definitions)

            if key == 'deploy':
                for name in definition[key]:
                    # Reset default values at each definition
                    from_ = default_from
                    gas = default_gas
                    gas_price = default_gas_price
                    wait = False
                    for option in definition[key][name]:
                        if option == 'contract':
                            contract = definition[key][name][option]
                        if option == 'gas':<commit_msg>missing value reset in deploy<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: caktux
# @Date:   2014-12-21 12:44:20
# @Last Modified by:   caktux
# @Last Modified time: 2014-12-22 08:56:33

import logging

import api
import json
import yaml
import config as c
config = c.read_config()

logger = logging.getLogger(__name__)

from serpent import compile

default_from = config.get('api', 'address')
default_gas = int(config.get('deploy', 'gas'))
default_gas_price = int(config.get('deploy', 'gas_price'))

def deploy(filename, wait=False):
    # Load YAML definitions
    definitions = load_yaml(filename)

    # Dynamic variables
    variables = {}

    logger.info("Parsing %s..." % filename)

    for definition in definitions:
        for key in definition:
            logger.info("%s: " % key)

            if key == 'set':
                for name in definition[key]:
                    # Replace variables
                    for repdef in definitions:
                        for repkey in repdef:
                            for repname in repdef[repkey]:
                                if repkey != 'set':
                                    for repoption in repdef[repkey][repname]:
                                        if repdef[repkey][repname][repoption] == "$%s" % name:
                                            logger.debug("Replacing $%s with %s" % (name, definition[key][name]))
                                            repdef[repkey][repname][repoption] = definition[key][name]
                    logger.info("  %s: %s" % (name, definition[key][name]))
                logger.debug(definitions)

            if key == 'deploy':
                for name in definition[key]:
                    # Reset default values at each definition
                    from_ = default_from
                    gas = default_gas
                    gas_price = default_gas_price
                    value = 0
                    wait = False
                    for option in definition[key][name]:
                        if option == 'contract':
                            contract = definition[key][name][option]
                        if option == 'gas':
{'fraction_non_alphanumeric': 0.10510579576816928, 'fraction_numerical': 0.013569457221711132, 'mean_word_length': 1.5255516840882695, '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': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5474485', 'n_tokens_mistral': 1166, 'n_tokens_neox': 1057, 'n_words': 305}