<commit_before>#
#
# Copyright (c) 2004 <NAME>.
#

from socket import *

def leaveGroup(sock,addr):
    """Join a multicast group.
       arguments:
       sock = an already open socket.
       addr = either a string, which will be passed to gethostbyname(), or
       a 32 bit number (the string can be a DNS name, or a dotted quad.
"""
    mreq = _addr2mreq(addr)
    # And join the group .
    sock.setsockopt(IPPROTO_IP, IP_DROP_MEMBERSHIP, mreq)

def _addr2mreq(addr):
    import netnum,struct
    from socket import *

    if type(addr) is type(""):
        group = gethostbyname(addr)
        grpaddr = netnum.dq2num(group)
    else:
        grpaddr = addr
    mreq = struct.pack('ll', grpaddr, INADDR_ANY)
    return mreq

def joinGroup(sock,addr):
    """Join a multicast group.
       arguments:
       sock = an already open socket.
       addr = either a string, which will be passed to gethostbyname(), or
       a 32 bit number (the string can be a DNS name, or a dotted quad.
"""
    mreq = _addr2mreq(addr)
    sock.setsockopt(IPPROTO_IP, IP_ADD_MEMBERSHIP, mreq)
<commit_msg>ancient weakminded code ;)<commit_after>#
#
# Copyright (c) 2004 <NAME>.
#

import socket

def leaveGroup(sock,addr):
    """Join a multicast group.
       arguments:
       sock = an already open socket.
       addr = either a string, which will be passed to gethostbyname(), or
       a 32 bit number (the string can be a DNS name, or a dotted quad.
"""
    mreq = _addr2mreq(addr)
    # And join the group .
    sock.setsockopt(socket.IPPROTO_IP, socket.IP_DROP_MEMBERSHIP, mreq)

def _addr2mreq(addr):
    import netnum, struct

    if type(addr) is type(""):
        group = socket.gethostbyname(addr)
        grpaddr = netnum.dq2num(group)
    else:
        grpaddr = addr
    mreq = struct.pack('ll', grpaddr, socket.INADDR_ANY)
    return mreq

def joinGroup(sock,addr):
    """Join a multicast group.
       arguments:
       sock = an already open socket.
       addr = either a string, which will be passed to gethostbyname(), or
       a 32 bit number (the string can be a DNS name, or a dotted quad.
"""
    mreq = _addr2mreq(addr)
    sock.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq)

{'fraction_non_alphanumeric': 0.09692028985507246, 'fraction_numerical': 0.010869565217391304, 'mean_word_length': 2.802065404475043, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '5297392', 'n_tokens_mistral': 759, 'n_tokens_neox': 737, 'n_words': 244}