<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _attempt_to_extract_ccc(self):
 """Extracts the country calling code from the beginning of _national_number to _prefix_before_national_number when they are available, and places the remaining input into _national_number. Returns True when a valid country calling code can be found. """

        if len(self._national_number) == 0:
            return False

        country_code, number_without_ccc = _extract_country_code(self._national_number)
        if country_code == 0:
            return False

        self._national_number = number_without_ccc
        new_region_code = region_code_for_country_code(country_code)
        if new_region_code == REGION_CODE_FOR_NON_GEO_ENTITY:
            self._current_metadata = PhoneMetadata.metadata_for_nongeo_region(country_code)
        elif new_region_code != self._default_country:
            self._current_metadata = _get_metadata_for_region(new_region_code)

        self._prefix_before_national_number += str(country_code)
        self._prefix_before_national_number += _SEPARATOR_BEFORE_NATIONAL_NUMBER
        # When we have successfully extracted the IDD, the previously
        # extracted NDD should be cleared because it is no longer valid.
        self._extracted_national_prefix = U_EMPTY_STRING
        return True