def average(self, evalNodes):
        """
        SYNOPSIS
         Calculate the mathematical average position of passed nodes or components

        INPUTS
         (string?/PyNode?) evalNodes:	list of components or nodes

        RETURNS: (float list) average position
         """

        if not evalNodes:
            evalNodes = selected(fl=1)

        select(cl=1)
        filteredEval = []
        if evalNodes:
            for e in evalNodes:
                select(e, r=1)
                if len(e.split('.')) > 1:
                    if not search('MeshVertex', str(type(e))):
                        mel.ConvertSelectionToVertices()
                        for a in selected(fl=1):
                            filteredEval.append(a)
                        select(cl=1)
                    else:
                        filteredEval.append(e)
                else:
                    if nodeType(e) == 'transform':
                        filteredEval.append(e)

        if filteredEval:
            divFactor = float(len(filteredEval))

            xComp = float(0.0000)
            yComp = float(0.0000)
            zComp = float(0.0000)
            for each in filteredEval:
                # Branch component items here
                if len(each.split('.')) > 1:
                    xComp = xComp + float(each.getPosition('world')[0])
                    yComp = yComp + float(each.getPosition('world')[1])
                    zComp = zComp + float(each.getPosition('world')[2])
                else:
                    if nodeType(each) == 'transform':
                        xComp = xComp + float(each.getTranslation('world')[0])
                        yComp = yComp + float(each.getTranslation('world')[1])
                        zComp = zComp + float(each.getTranslation('world')[2])
            self.logger.debug('X - %s' % xComp)
            self.logger.debug('Y - %s' % yComp)
            self.logger.debug('Z - %s' % zComp)
            self.logger.debug('X Result - %s' % str(xComp / divFactor))
            self.logger.debug('Y Result - %s' % str(yComp / divFactor))
            self.logger.debug('Z Result - %s' % str(zComp / divFactor))

            return [xComp / divFactor, yComp / divFactor, zComp / divFactor]
dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/core/mayaCore.py/MayaMiscCore.average/original