(cls, locale=None, providers=None, codename=None)
return cls.generators[codename]
use a codename to cache generators
use a codename to cache generators
use a codename to cache generators
def getGenerator(cls, locale=None, providers=None, codename=None):
        """
        use a codename to cache generators
        """

        codename = codename or cls.getCodename(locale, providers)

        if codename not in cls.generators:
            from faker import Faker as FakerGenerator
            # initialize with faker.generator.Generator instance
            # and remember in cache
            cls.generators[codename] = FakerGenerator( locale, providers )
            cls.generators[codename].seed( cls.generators[codename].randomInt() )

        return cls.generators[codename]
def getGenerator ( cls , locale = None , providers = None , codename = None ) : codename = codename or cls . getCodename ( locale , providers ) if codename not in cls . generators : from faker import Faker as FakerGenerator # initialize with faker.generator.Generator instance # and remember in cache cls . generators [ codename ] = FakerGenerator ( locale , providers ) cls . generators [ codename ] . seed ( cls . generators [ codename ] . randomInt ( ) ) return cls . generators [ codename ]