def _getDirects(self, aManager, location=None):
        """

        :type aManager: str
        :return:
        """
        peopleFilter = PeopleFilter()
        directReports = []
        peopleFilter.addManagerFilter(aManager)
        peopleFilter.addIsTBHFilter(False)
        if location:
            peopleFilter.addLocationFilter(location)
        directReports.extend(self.multiOrgParser.getFilteredPeople(peopleFilter))

        return directReports
    def _getDirects(self, aManager, location=None):
        """

        :type aManager: str
        :return:
        """
        peopleFilter = PeopleFilter()
        directReports = []
        peopleFilter.addManagerFilter(aManager)
        peopleFilter.addIsTBHFilter(False)
        if location:
            peopleFilter.addLocationFilter(location)
        directReports.extend(
            self.multiOrgParser.getFilteredPeople(peopleFilter))

        return directReports
    def drawProduct(self,
                    productName,
                    drawFeatureTeams=False,
                    drawLocations=False,
                    drawExpatsInTeam=True):
        """

        :type productName: str
        """
        if not productName:
            if not self.draftMode:
                return

        featureTeamList = [""]
        if drawFeatureTeams:
            featureTeamList = list(
                self.multiOrgParser.getFeatureTeamSet(productName))

        functionList = list(self.multiOrgParser.getFunctionSet(productName))
        functionList.sort(cmp=self._sortByFunc)

        teamModelText = None

        locations = [""]

        # If draw locations has been set (could still be an empty list) then break the chart up by locations.
        # if locations is set and isn't an empty list, only show the locations specified.
        if drawLocations is not None:
            locations = self.multiOrgParser.getLocationSet(productName)
            for drawLocation in drawLocations:
                if drawLocation not in locations:
                    raise ValueError(
                        "{} is not found in available locations: {}".format(
                            drawLocations, locations))

        for aLocation in drawLocations or locations:
            locationName = aLocation.strip() or self.multiOrgParser.getOrgName(
            )

            for aFeatureTeam in featureTeamList:
                if not productName:
                    slideTitle = orgchart_parser.NOT_SET
                elif drawFeatureTeams:
                    teamName = "- {} ".format(aFeatureTeam)
                    if not aFeatureTeam:
                        if len(featureTeamList) > 1:
                            teamName = "- Cross "
                        else:
                            teamName = ""
                    slideTitle = "{} {}Feature Team".format(
                        productName, teamName)
                else:
                    slideTitle = "{}".format(productName)
                    modelDict = self.multiOrgParser.getTeamModel()
                    if productName in modelDict:
                        teamModelText = modelDict[productName]

                chartDrawer = DrawChartSlide(self.presentation, slideTitle,
                                             self.slideLayout, teamModelText)
                if len(locations) > 1 and aLocation:
                    chartDrawer.setLocation(locationName)

                for aFunction in functionList:
                    if aFunction.lower(
                    ) in self.multiOrgParser.getCrossFunctions():
                        continue

                    peopleFilter = PeopleFilter()
                    peopleFilter.addProductFilter(productName)
                    peopleFilter.addFunctionFilter(aFunction)
                    if drawLocations is not None:
                        peopleFilter.addLocationFilter(aLocation)

                    if drawFeatureTeams:
                        peopleFilter.addFeatureTeamFilter(aFeatureTeam)
                    else:
                        if not drawExpatsInTeam:
                            peopleFilter.addIsExpatFilter(False)
                        peopleFilter.addIsInternFilter(False)
                        # peopleFilter.addIsProductManagerFilter(False)

                    functionPeople = self.multiOrgParser.getFilteredPeople(
                        peopleFilter)
                    self.buildGroup(aFunction, functionPeople, chartDrawer)

                chartDrawer.drawSlide()
    def drawProduct(self, productName, drawFeatureTeams=False, drawLocations=False, drawExpatsInTeam=True):
        """

        :type productName: str
        """
        if not productName:
            if not self.draftMode:
                return

        featureTeamList = [""]
        if drawFeatureTeams:
            featureTeamList = list(self.multiOrgParser.getFeatureTeamSet(productName))

        functionList = list(self.multiOrgParser.getFunctionSet(productName))
        functionList.sort(cmp=self._sortByFunc)

        teamModelText = None

        locations = [""]

        # If draw locations has been set (could still be an empty list) then break the chart up by locations.
        # if locations is set and isn't an empty list, only show the locations specified.
        if drawLocations is not None:
            locations = self.multiOrgParser.getLocationSet(productName)
            for drawLocation in drawLocations:
                if drawLocation not in locations:
                    raise ValueError("{} is not found in available locations: {}".format(drawLocations, locations))


        for aLocation in drawLocations or locations:
            locationName = aLocation.strip() or self.multiOrgParser.getOrgName()

            for aFeatureTeam in featureTeamList:
                if not productName:
                    slideTitle = orgchart_parser.NOT_SET
                elif drawFeatureTeams:
                    teamName = "- {} ".format(aFeatureTeam)
                    if not aFeatureTeam:
                        if len(featureTeamList) > 1:
                            teamName = "- Cross "
                        else:
                            teamName = ""
                    slideTitle = "{} {}Feature Team".format(productName, teamName)
                else:
                    slideTitle = "{}".format(productName)
                    modelDict = self.multiOrgParser.getTeamModel()
                    if productName in modelDict:
                        teamModelText = modelDict[productName]

                chartDrawer = DrawChartSlide(self.presentation, slideTitle, self.slideLayout, teamModelText)
                if len(locations) > 1 and aLocation:
                   chartDrawer.setLocation(locationName)

                for aFunction in functionList:
                    if aFunction.lower() in self.multiOrgParser.getCrossFunctions():
                        continue

                    peopleFilter = PeopleFilter()
                    peopleFilter.addProductFilter(productName)
                    peopleFilter.addFunctionFilter(aFunction)
                    if drawLocations is not None:
                        peopleFilter.addLocationFilter(aLocation)

                    if drawFeatureTeams:
                        peopleFilter.addFeatureTeamFilter(aFeatureTeam)
                    else:
                        if not drawExpatsInTeam:
                            peopleFilter.addIsExpatFilter(False)
                        peopleFilter.addIsInternFilter(False)
                        # peopleFilter.addIsProductManagerFilter(False)

                    functionPeople = self.multiOrgParser.getFilteredPeople(peopleFilter)
                    self.buildGroup(aFunction, functionPeople, chartDrawer)

                chartDrawer.drawSlide()