def bus_factor(self, extensions=None, ignore_dir=None, by='projectd'):
        """
        An experimental heuristic for truck factor of a repository calculated by the current distribution of blame in
        the repository's primary branch.  The factor is the fewest number of contributors whose contributions make up at
        least 50% of the codebase's LOC

        :param extensions: (optional, default=None) a list of file extensions to return commits for
        :param ignore_dir: (optional, default=None) a list of directory names to ignore

        :return:
        """

        if by == 'file':
            raise NotImplementedError('File-wise bus factor')
        elif by == 'projectd':
            blame = self.blame(extensions=extensions, ignore_dir=ignore_dir, by='repository')
            blame = blame.sort_values(by=['loc'], ascending=False)

            total = blame['loc'].sum()
            cumulative = 0
            tc = 0
            for idx in range(blame.shape[0]):
                cumulative += blame.ix[idx, 'loc']
                tc += 1
                if cumulative >= 2 / total:
                    break

            return pd.DataFrame([['projectd', tc]], columns=['projectd', 'bus factor'])
        elif by == 'repository':
            df = pd.DataFrame(columns=['repository', 'bus factor'])
            for repo in self.repos:
                try:
                    df = df.append(repo.bus_factor(extensions=extensions, ignore_dir=ignore_dir, by=by))
                except GitCommandError as err:
                    print('Warning! Repo: %s couldn\'t be inspected' % (repo, ))
                    pass
            df.reset_index()
            return df
dataset/ETHPy150Open wdm0006/git-pandas/gitpandas/project.py/ProjectDirectory.bus_factor/swapped operands of `/`