<commit_before>class Phone(object):
    def __init__(self):
        pass<commit_msg>Add initial solution<commit_after>import re


class Phone(object):
    def __init__(self, n):
        cleaned = "".join(filter(str.isnumeric, n))
        m = re.match("^(1)?([2-9][0-9]{2})([2-9][0-9]{2})([0-9]{4})$", cleaned)
        if m:
            self._parts = [p if p else "" for p in m.groups()]
        else:
            self._parts = ("", "000", "000", "0000")

    def area_code(self):
        return self._parts[1]

    def pretty(self):
        return "({1}) {2}-{3}".format(*self._parts)

    @property
    def number(self):
        return "{1}{2}{3}".format(*self._parts)
{'fraction_non_alphanumeric': 0.20328849028400597, 'fraction_numerical': 0.04633781763826607, 'mean_word_length': 2.544973544973545, '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': '1049592', 'n_tokens_mistral': 244, 'n_tokens_neox': 233, 'n_words': 49}