<commit_before>#!/usr/bin/env python
# -*- coding: cp1252 -*-
"""
admin.py - Phenny Admin Module
Copyright 2008-9, <NAME>, inamidst.com
Licensed under the Eiffel Forum License 2.

http://inamidst.com/phenny/
"""

def join(phenny, input): 
   u"""Entra al cana especificat. Noms els administradors."""
   # Can only be done in privmsg by an admin
   if input.sender.startswith('#'): return
   if input.admin: 
      channel, key = input.group(1), input.group(2)
      if not key: 
         phenny.write(['JOIN'], channel)
      else: phenny.write(['JOIN', channel, key])
join.commands = ['join','entra']
join.priority = 'low'
join.example = '.entra #exemple or .entra #exemple contrassenya'

def part(phenny, input): 
   u"""Daixa el canal especificat. Noms els administradors."""
   # Can only be done in privmsg by an admin
   if input.sender.startswith('#'): return
   if input.admin: 
      phenny.write(['PART'], input.group(2))
part.commands = ['part','surt']
part.priority = 'low'
part.example = '.deixa #exemple'

def quit(phenny, input): 
   """Surt del servidor. Noms l'owner."""
   # Can only be done in privmsg by the owner
   if input.sender.startswith('#'): return
   if input.owner: 
      phenny.write(['QUIT'])
      __import__('os')._exit(0)
quit.commands = ['quit']
quit.priority = 'low'

def msg(phenny, input): 
   # Can only be done in privmsg by an admin
   if input.sender.startswith('#'): return
   a, b = input.group(2), input.group(3)
   if (not a) or (not b): return
   if input.admin: 
      phenny.msg(a, b)
msg.rule = (['msg'], r'(#?\S+) (.+)')
msg.priority = 'low'

def me(phenny, input): 
   # Can only be done in privmsg by an admin
   if input.sender.startswith('#'): return
   if input.admin: 
      msg = '\x01ACTION %s\x01' % input.group(3)
      phenny.msg(input.group(2) or input.sender, msg)<commit_msg>Update admin.py<commit_after>#!/usr/bin/env python
# -*- coding: cp1252 -*-

def join(phenny, input): 
   u"""Entra al cana especificat. Només els administradors."""
   # Can only be done in privmsg by an admin
   if input.sender.startswith('#'): return
   if input.admin: 
      channel, key = input.group(1), input.group(2)
      if not key: 
         phenny.write(['JOIN'], channel)
      else: phenny.write(['JOIN', channel, key])
join.commands = ['join','entra']
join.priority = 'low'
join.example = '.entra #exemple or .entra #exemple contrassenya'

def part(phenny, input): 
   u"""Daixa el canal especificat. Només els administradors."""
   # Can only be done in privmsg by an admin
   if input.sender.startswith('#'): return
   if input.admin: 
      phenny.write(['PART'], input.group(2))
part.commands = ['part','surt']
part.priority = 'low'
part.example = '.deixa #exemple'

def quit(phenny, input): 
   """Surt del servidor. Només l'owner."""
   # Can only be done in privmsg by the owner
   if input.sender.startswith('#'): return
   if input.owner: 
      phenny.write(['QUIT'])
      __import__('os')._exit(0)
quit.commands = ['quit']
quit.priority = 'low'

def msg(phenny, input): 
   # Can only be done in privmsg by an admin
   if input.sender.startswith('#'): return
   a, b = input.group(2), input.group(3)
   if (not a) or (not b): return
   if input.admin: 
      phenny.msg(a, b)
msg.rule = (['msg'], r'(#?\S+) (.+)')
msg.priority = 'low'

def me(phenny, input): 
   # Can only be done in privmsg by an admin
   if input.sender.startswith('#'): return
   if input.admin: 
      msg = '\x01ACTION %s\x01' % input.group(3)
      phenny.msg(input.group(2) or input.sender, msg)
{'fraction_non_alphanumeric': 0.16436035018356396, 'fraction_numerical': 0.010731431798926857, 'mean_word_length': 3.3142509135200973, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '6912099', 'n_tokens_mistral': 1292, 'n_tokens_neox': 1232, 'n_words': 362}