<commit_before>import os


def getLocalAddress():
    import socket
    try:
        s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        s.connect(('0.0.0.0', 56))
        return s.getsockname()[0]
    except:
        return "127.0.0.1"


def loadSettingsFile(filename):
    g = {}
    l = {}
    execfile(filename, g, l)
    settings = ((name, value) for name, value in l.items() if name.isupper() and  name in globals())
    globals().update(settings)


## SETTINGS ###########################################################

DEBUG = False

PORT = 8004
ADDRESS = getLocalAddress()
RUN_AS = None
#LOGDIR = "/opt/puli/logs"
LOGDIR = "/tmp/puli/logs"
#CONFDIR = "/opt/puli/conf"
CONFDIR = "/datas/puli/Puli/etc/puli"
PIDFILE = "dispatcher.pid"

RENDERNODE_REQUEST_MAX_RETRY_COUNT = 10
RENDERNODE_REQUEST_DELAY_AFTER_REQUEST_FAILURE = .1

# Delay in millisecond between two runs of the "main" iteration: i.e. update db, compute assignement, send orders...
MASTER_UPDATE_INTERVAL = 4000

POOLS_BACKEND_TYPE = "db"
#POOLS_BACKEND_TYPE = "file"
#POOLS_BACKEND_TYPE = "ws"

FILE_BACKEND_RN_PATH = os.path.join(CONFDIR, "workers.lst")
FILE_BACKEND_LICENCES_PATH = os.path.join(CONFDIR, "licences.lst")
FILE_BACKEND_POOL_PATH = os.path.join(CONFDIR, "pools")
WS_BACKEND_URL = ""
WS_BACKEND_PORT = 11800

DB_ENABLE = True
DB_CLEAN_DATA = False

#DB_URL = "mysql://red:0ct0pus@127.0.0.1/pulidb"
DB_URL = "mysql://puliuser:0ct0pus@127.0.0.1/pulidb"
#DB_URL = "sqlite:///path/to/my/database/file.db"

RN_TIMEOUT = 1200.0

MAX_RETRY_CMD_COUNT = 2
DELAY_BEFORE_AUTORETRY = 20.0

RN_NB_ERRORS_TOLERANCE = 5
<commit_msg>Change default param for dev logs and conf folders<commit_after>import os


def getLocalAddress():
    import socket
    try:
        s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        s.connect(('0.0.0.0', 56))
        return s.getsockname()[0]
    except:
        return "127.0.0.1"


def loadSettingsFile(filename):
    g = {}
    l = {}
    execfile(filename, g, l)
    settings = ((name, value) for name, value in l.items() if name.isupper() and  name in globals())
    globals().update(settings)


## SETTINGS ###########################################################

DEBUG = False

PORT = 8004
ADDRESS = getLocalAddress()
RUN_AS = None

# TEST/PROD ENV
#LOGDIR = "/opt/puli/logs"
#CONFDIR = "/opt/puli/conf"

# DEV ENV
LOGDIR = "/s/apps/lin/eval/puli/distrib/OpenRenderManagement/logs"
CONFDIR = "/s/apps/lin/eval/puli/distrib/OpenRenderManagement/Puli/etc/puli"

PIDFILE = "dispatcher.pid"

RENDERNODE_REQUEST_MAX_RETRY_COUNT = 10
RENDERNODE_REQUEST_DELAY_AFTER_REQUEST_FAILURE = .1

# Delay in millisecond between two runs of the "main" iteration: i.e. update db, compute assignement, send orders...
MASTER_UPDATE_INTERVAL = 4000

POOLS_BACKEND_TYPE = "db"
#POOLS_BACKEND_TYPE = "file"
#POOLS_BACKEND_TYPE = "ws"

FILE_BACKEND_RN_PATH = os.path.join(CONFDIR, "workers.lst")
FILE_BACKEND_LICENCES_PATH = os.path.join(CONFDIR, "licences.lst")
FILE_BACKEND_POOL_PATH = os.path.join(CONFDIR, "pools")
WS_BACKEND_URL = ""
WS_BACKEND_PORT = 11800

DB_ENABLE = True
DB_CLEAN_DATA = False

DB_URL = "mysql://puliuser:0ct0pus@127.0.0.1/pulidb"
#DB_URL = "sqlite:///path/to/my/database/file.db"

RN_TIMEOUT = 1200.0

MAX_RETRY_CMD_COUNT = 2
DELAY_BEFORE_AUTORETRY = 20.0

RN_NB_ERRORS_TOLERANCE = 5

{'fraction_non_alphanumeric': 0.162406015037594, 'fraction_numerical': 0.03067669172932331, 'mean_word_length': 4.313099041533547, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 7, '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': '3615758', 'n_tokens_mistral': 1354, 'n_tokens_neox': 1300, 'n_words': 244}