def METHOD_NAME(self, only_primitive=False):
    D = self.parent().gens_orders()
    F = list(self.exponents())
    i = len(D)-1
    while True:
        F[i] -= 1
        if F[i] < 0:
            F[i] = D[i] - 1
            i -= 1
            if i < 0:
                return None
        else:
            c = HeckeChar(self.parent(), F)
            if not only_primitive or c.is_primitive():
                return c