<commit_before>import socket
import urllib2

from cement.core import controller, foundation, handler

IP_DETECT_URL = 'http://rgh-go-sandpit.appspot.com/myip/'
IP_UPDATE_URL = (
  'http://svc.joker.com/nic/update?username=%s&password=%s&hostname=%s')

class DNSUpdateController(controller.CementBaseController):
  class Meta:
    label = 'base'
    description = 'DNS Updater'
    config_defaults = {}

  def detect_ip(self):
    ip_lookup = urllib2.urlopen(IP_DETECT_URL)
    my_address = ip_lookup.read()
    self.app.log.info('Detected IP address: %s' % my_address)
    ip_lookup.close()
    return my_address

  def update_ip(self):
    ip_setter = urllib2.urlopen(
      IP_UPDATE_URL % (self.app.config.get('base', 'username'),
                       self.app.config.get('base', 'password'),
                       self.app.config.get('base', 'hostname'),))
    response = ip_setter.read()
    self.app.log.debug('Update result: %r' % response)
    ip_setter.close()

  @controller.expose(hide=True, aliases=['run'])<commit_msg>Move IP detection log to debug<commit_after>import socket
import urllib2

from cement.core import controller, foundation, handler

IP_DETECT_URL = 'http://rgh-go-sandpit.appspot.com/myip/'
IP_UPDATE_URL = (
  'http://svc.joker.com/nic/update?username=%s&password=%s&hostname=%s')

class DNSUpdateController(controller.CementBaseController):
  class Meta:
    label = 'base'
    description = 'DNS Updater'
    config_defaults = {}

  def detect_ip(self):
    ip_lookup = urllib2.urlopen(IP_DETECT_URL)
    my_address = ip_lookup.read()
    self.app.log.debug('Detected IP address: %s' % my_address)
    ip_lookup.close()
    return my_address

  def update_ip(self):
    ip_setter = urllib2.urlopen(
      IP_UPDATE_URL % (self.app.config.get('base', 'username'),
                       self.app.config.get('base', 'password'),
                       self.app.config.get('base', 'hostname'),))
    response = ip_setter.read()
    self.app.log.debug('Update result: %r' % response)
    ip_setter.close()

  @controller.expose(hide=True, aliases=['run'])
{'fraction_non_alphanumeric': 0.14189837008628955, 'fraction_numerical': 0.0028763183125599234, 'mean_word_length': 3.5767543859649122, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7183874', 'n_tokens_mistral': 724, 'n_tokens_neox': 709, 'n_words': 120}