Returns a singleton instance of the class
160405
def getInstance(cls, *args):
        '''
        
        '''
        if not cls.__singleton:
            cls.__singleton = DriverManager(*args)
        return cls.__singleton
322469
def default_instance(cls):
        
        if cls._instance is None:
            with cls._instance_lock:
                if cls._instance is None:
                    cls._instance = MessageDispatcher()

        return cls._instance
1257397
private static function instance()
    {
        $currentClass = get_called_class();
        $instanceName = empty( self::$instance ) ? '' : new \ReflectionClass(self::$instance);
        if( empty( self::$instance ) || ( $instanceName->name != $currentClass ) ) {
            self::$instance = new static();
        }
        return self::$instance;
    }
890159
public static PojoUtil getInstance() {

    if (instance == null) {
      PojoUtilImpl impl = null;
      synchronized (PojoUtilImpl.class) {
        if (instance == null) {
          impl = new PojoUtilImpl();
          impl.initialize();
          instance = impl;
        }
      }
    }
    return instance;
  }
107826
public static ClasspathScanner getInstance() {

    if (instance == null) {
      synchronized (AbstractClasspathScanner.class) {
        if (instance == null) {
          ClasspathScannerImpl impl = new ClasspathScannerImpl();
          impl.initialize();
        }
      }
    }
    return instance;
  }
786181
public static ClassDescriptorCache getInstance() {
    if (INSTANCE == null) {
      synchronized (ClassDescriptorCache.class) {
        if (INSTANCE == null) {
          INSTANCE = new ClassDescriptorCache();
        }
      }
    }
    return INSTANCE;
  }
1051547
def instance(cls, *args, **kwgs):
        """"""
        if not hasattr(cls, "_instance"):
            cls._instance = cls(*args, **kwgs)
        return cls._instance
1221319
def instance(cls):
        

        if not hasattr(cls, "_instance") or cls._instance is None:
            cls._instance = cls()
        return cls._instance
1150901
public static ReflectionUtil getInstance() {

    if (instance == null) {
      ReflectionUtilImpl impl = null;
      synchronized (ReflectionUtilImpl.class) {
        if (instance == null) {
          impl = new ReflectionUtilImpl();
          instance = impl;
        }
      }
      if (impl != null) {
        // static access is generally discouraged, cyclic dependency forces this ugly initialization to
        // prevent deadlock.
        impl.initialize();
      }
    }
    return instance;
  }
1161919
public static function GetInstance() {
      if (!isset(self::$_Instance)) {
         $c = __CLASS__;
         self::$_Instance = new $c();
      }
      return self::$_Instance;
   }
255134
def singleton(the_class):
    
    class_instances = {}

    def get_instance(*args, **kwargs):
        """
        Creating or just return the one and only class instance.

        The singleton depends on the parameters used in __init__
        @type args: list
        @param args: positional arguments of the constructor.
        @type kwargs: dict
        @param kwargs: named parameters of the constructor.
        @rtype: decorated class type
        @return: singleton instance of decorated class.
        """
        key = (the_class, args, str(kwargs))
        if key not in class_instances:
            class_instances[key] = the_class(*args, **kwargs)
        return class_instances[key]

    return get_instance
1271134
public static DomUtil getInstance() {

    if (instance == null) {
      synchronized (DomUtilImpl.class) {
        if (instance == null) {
          DomUtilImpl util = new DomUtilImpl();
          util.initialize();
          instance = util;
        }
      }
    }
    return instance;
  }
346472
def instance(self_or_cls,**params):
        

        if isinstance (self_or_cls,ParameterizedMetaclass):
            cls = self_or_cls
        else:
            p = params
            params = dict(self_or_cls.get_param_values())
            params.update(p)
            params.pop('name')
            cls = self_or_cls.__class__

        inst=Parameterized.__new__(cls)
        Parameterized.__init__(inst,**params)
        if 'name' in params:  inst.__name__ = params['name']
        else:                 inst.__name__ = self_or_cls.name
        return inst
449139
def singleton(cls):
    
    instances = {}
    def getinstance(**kwargs):
        """
        Creates a new RGeocoder instance if not created already
        """
        if cls not in instances:
            instances[cls] = cls(**kwargs)
        return instances[cls]
    return getinstance
214654
public synchronized static Lesto getInstance() {
        if (lesto == null) {
            lesto = new Lesto(null);
            lesto.gatherInformations();
        }
        return lesto;
    }
344489
public static function getInstance()
    {
        if (null === self::$instance) {
            $class          = new \ReflectionClass(__CLASS__);
            self::$instance = $class->newInstanceArgs(func_get_args());
        }

        return self::$instance;
    }
109258
public static function singleton()
    {
        $returnValue = null;

        
        if (is_null(self::$instance)) {
        	self::$instance = new common_log_Dispatcher();
        }
        $returnValue = self::$instance;
        

        return $returnValue;
    }