def populate_from_match(self, match):
        """Populate instance data from a match.

        Args:
            match: A regex match corresponding to the match method for
                this class.

        Raises:
            GitRvException: If the match is None.
            GitRvException: If the project named group is not in the match.
        """
        if match is None:
            raise GitRvException('Expected match, received None.')

        try:
            project = match.group('project')
        except IndexError:
            raise GitRvException('Expected group not matched.')

        repository = None
        dot_count = project.count('.')
        if dot_count == 1:
            project, repository = project.split('.')
        elif dot_count > 1:
            raise GitRvException(
                    GOOGLE_CODEHOSTING_BAD_URI_TEMPLATE % (project,))
        self.project = project
        self.repository = repository
dataset/ETHPy150Open googlearchive/git-rv/utils.py/GoogleCodehostingRepositoryInfo.populate_from_match/original