<commit_before>'''
Network tools to run from the Master
'''

import socket

def wollist(maclist, bcast='255.255.255.255', destport=9):
    '''
    Send a "Magic Packet" to wake up a list of Minions.
    This list must contain one MAC hardware address per line

    CLI Example::

        salt-run '/path/to/maclist'
        salt-run '/path/to/maclist' 255.255.255.255 7
        salt-run '/path/to/maclist' 255.255.255.255 7
    '''
def wol(mac, bcast='255.255.255.255', destport=9):
    '''
    Send a "Magic Packet" to wake up a Minion

    CLI Example::

        salt-run network.wol 08-00-27-13-69-77
        salt-run network.wol 080027136977 255.255.255.255 7
        salt-run network.wol 08:00:27:13:69:77 255.255.255.255 7
    '''
    if len(mac) == 12:<commit_msg>First try at opening the mac file and sending a magic packet to each entry<commit_after>'''
Network tools to run from the Master
'''

import socket

def wollist(maclist, bcast='255.255.255.255', destport=9):
    '''
    Send a "Magic Packet" to wake up a list of Minions.
    This list must contain one MAC hardware address per line

    CLI Example::

        salt-run '/path/to/maclist'
        salt-run '/path/to/maclist' 255.255.255.255 7
        salt-run '/path/to/maclist' 255.255.255.255 7
    '''
    try:
        macfile = open(maclist, 'r')
        for mac in macfile.readline().strip():
            wol(mac, bcast, destport)
            print "Waking up %s" % mac
    except:
        print "Failed to open the MAC file"

def wol(mac, bcast='255.255.255.255', destport=9):
    '''
    Send a "Magic Packet" to wake up a Minion

    CLI Example::

        salt-run network.wol 08-00-27-13-69-77
        salt-run network.wol 080027136977 255.255.255.255 7
        salt-run network.wol 08:00:27:13:69:77 255.255.255.255 7
    '''
    if len(mac) == 12:
{'fraction_non_alphanumeric': 0.1284153005464481, 'fraction_numerical': 0.126775956284153, 'mean_word_length': 2.403345724907063, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 12, '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': '2096718', 'n_tokens_mistral': 810, 'n_tokens_neox': 635, 'n_words': 193}