<commit_before>import re
import socket

class Location(object):
  " Determine which cluster the code is running in, or CORP if we are not in prod. "

  CORP = "corp"

  @staticmethod
  def get_location():
    hostname = socket.gethostname()
    prod_matcher = re.match('^(\w{3}).*.twitter\.com$', hostname)

    if re.search('.+\.local$', hostname):
      return Location.CORP
    elif prod_matcher is not None:
      return prod_matcher.group(1)
    else:
      print 'Can\'t determine location (prod vs. corp). Hostname=%s' % hostname
      return None<commit_msg>Update Location determination to current hostname standards.<commit_after>import re
import socket

class Location(object):
  """Determine which cluster the code is running in, or CORP if we are not in prod."""

  CORP = "corp"

  @staticmethod
  def get_location():
    hostname = socket.gethostname()
    prod_matcher = re.match('^(\w{3}\d+).*\.twitter\.com$', hostname)
    prod_host = prod_matcher.group(1) if prod_matcher else None
    if hostname.endswith('.local') or hostname.endswith('.office.twttr.net') or 'sfo0' == prod_host:
      return Location.CORP
    elif prod_host:
      return prod_host
    else:
      print 'Can\'t determine location (prod vs. corp). Hostname=%s' % hostname
      return None
{'fraction_non_alphanumeric': 0.1203125, 'fraction_numerical': 0.00390625, 'mean_word_length': 3.4172413793103447, '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': '6798582', 'n_tokens_mistral': 417, 'n_tokens_neox': 398, 'n_words': 124}