data/data_collection.py
def _get_file_versions(self, commits: List[dict]) -> dict:
        """Retrieves the file versions of a list of commits.

        This function takes a list of commit information dicts and aggregates
        the number of file versions by each file path.

        Args:
            commits: A list of dicts. Each dict is a commit information dict.
        Returns:
            A dict of file versions. The keys are the file path and the values
            are the number of file versions.
        """
        file_versions_dict = defaultdict(int)
        for commit in commits:
            commit_ref = commit['sha']
            commit_info = get_commit_info(
                self._repo_name, commit_ref, self._auth)
            if not commit_info:
                continue
            commit_files = commit_info['files']
            for commit_file in commit_files:
                commit_file_name = commit_file['filename']
                file_versions_dict[commit_file_name] += 1
        return dict(file_versions_dict)
Retrieves the file versions of a list of commits.

        This function takes a list of commit information dicts and aggregates
        the number of file versions by each file path.

        Args:
            commits: A list of dicts. Each dict is a commit information dict.
        Returns:
            A dict of file versions. The keys are the file path and the values
            are the number of file versions.
        
Retrieves the file versions of a list of commits.
This function takes a list of commit information dicts and aggregates
the number of file versions by each file path.
Retrieves the file versions of a list of commits . This function takes a list of commit information dicts and aggregates the number of file versions by each file path .
def _get_file_versions(self, commits: List[dict]) -> dict:
        file_versions_dict = defaultdict(int)
        for commit in commits:
            commit_ref = commit['sha']
            commit_info = get_commit_info(
                self._repo_name, commit_ref, self._auth)
            if not commit_info:
                continue
            commit_files = commit_info['files']
            for commit_file in commit_files:
                commit_file_name = commit_file['filename']
                file_versions_dict[commit_file_name] += 1
        return dict(file_versions_dict)
def _get_file_versions ( self , commits : List [ dict ] ) -> dict : file_versions_dict = defaultdict ( int ) for commit in commits : commit_ref = commit [ 'sha' ] commit_info = get_commit_info ( self . _repo_name , commit_ref , self . _auth ) if not commit_info : continue commit_files = commit_info [ 'files' ] for commit_file in commit_files : commit_file_name = commit_file [ 'filename' ] file_versions_dict [ commit_file_name ] += 1 return dict ( file_versions_dict )
Retrieves the file versions of a list of commits.
Retrieves the file versions of a list of commits .
"""Retrieves the file versions of a list of commits.

        This function takes a list of commit information dicts and aggregates
        the number of file versions by each file path.

        Args:
            commits: A list of dicts. Each dict is a commit information dict.
        Returns:
            A dict of file versions. The keys are the file path and the values
            are the number of file versions.
        """
A dict of file versions. The keys are the file path and the values
are the number of file versions.
A dict of file versions . The keys are the file path and the values are the number of file versions .
self
commits
List[dict]
A list of dicts. Each dict is a commit information dict.
A list of dicts . Each dict is a commit information dict .