def username_validator(form, field):
    username = field.data
    if len(username) < 3:
        raise ValidationError(_('Username must be at least 3 characters long'))
    valid_chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._'
    chars = list(username)
    for char in chars:
        if char not in valid_chars:
            raise ValidationError(_("Username may only contain letters, numbers, '-', '.' and '_'"))
Write graph G as a list of edges with numeric weights.
dataset/ETHPy150Open lingthio/Flask-User/flask_user/forms.py/username_validator--crossover with--dataset/ETHPy150Open networkx/networkx/networkx/readwrite/edgelist.py/write_weighted_edgelist