<commit_before>import os
import uuid

from mischief.actors.pipe import get_local_ip
import yaml


def read_serfnode_yml():
    with open('/serfnode.yml') as input:
        conf = yaml.load(input) or {}
        return conf.get('serfnode') or {}


yml = read_serfnode_yml()


role = os.environ.get('ROLE') or yml.get('ROLE') or 'no_role'
peer = os.environ.get('PEER') or yml.get('PEER')
ip = (os.environ.get('SERF_IP') or yml.get('SERF_IP') or
      get_local_ip('8.8.8.8'))
bind_port = os.environ.get('SERF_PORT') or yml.get('SERF_PORT') or 7946
node = os.environ.get('NODE_NAME') or uuid.uuid4().hex
rpc_port = os.environ.get('RPC_PORT') or 7373
service = os.environ.get('SERVICE_IP') or yml.get('SERVICE_IP') or ip
service_port = os.environ.get('SERVICE_PORT') or yml.get('SERVICE_PORT') or 0<commit_msg>Leave service_ip empty if not given<commit_after>import os
import uuid

from mischief.actors.pipe import get_local_ip
import yaml


def read_serfnode_yml():
    with open('/serfnode.yml') as input:
        conf = yaml.load(input) or {}
        return conf.get('serfnode') or {}


yml = read_serfnode_yml()


role = os.environ.get('ROLE') or yml.get('ROLE') or 'no_role'
peer = os.environ.get('PEER') or yml.get('PEER')
ip = (os.environ.get('SERF_IP') or yml.get('SERF_IP') or
      get_local_ip('8.8.8.8'))
bind_port = os.environ.get('SERF_PORT') or yml.get('SERF_PORT') or 7946
node = os.environ.get('NODE_NAME') or uuid.uuid4().hex
rpc_port = os.environ.get('RPC_PORT') or 7373
service = os.environ.get('SERVICE_IP') or yml.get('SERVICE_IP')
service_port = os.environ.get('SERVICE_PORT') or yml.get('SERVICE_PORT') or 0
{'fraction_non_alphanumeric': 0.16236162361623616, 'fraction_numerical': 0.017220172201722016, 'mean_word_length': 4.610344827586207, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '1751136', 'n_tokens_mistral': 652, 'n_tokens_neox': 651, 'n_words': 134}