code: def bus_factor(self, ignore_globs=None, include_globs=None, by='projectd'):
          
  
          if by == 'file':
              raise NotImplementedError('File-wise bus factor')
          elif by == 'projectd':
              blame = self.blame(ignore_globs=ignore_globs, include_globs=include_globs, 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 >= total / 2:
                      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(ignore_globs=include_globs, include_globs=include_globs, by=by))
                  except GitCommandError:
                      print('Warning! Repo: %s couldn\'t be inspected' % (repo, ))
  
              df.reset_index()
              return df
docs: 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 ignore_globs: (optional, default=None) a list of globs to ignore, default none excludes nothing
          :param include_globs: (optinal, default=None) a list of globs to include, default of None includes everything.
  
          :return: