Return an PyVabamorf instance.

        It returns the previously initialized instance or creates a new
        one if nothing exists. Also creates new instance in case the
        process has been forked.
764859
def instance():
        
        if not hasattr(Vabamorf, 'pid') or Vabamorf.pid != os.getpid():
            Vabamorf.pid = os.getpid()
            Vabamorf.morf = Vabamorf()
        return Vabamorf.morf
809608
def get_instance(self, payload):
        
        return QueueInstance(self._version, payload, account_sid=self._solution['account_sid'], )
977466
def get_instance(self, payload):
        
        return MessageInstance(self._version, payload, account_sid=self._solution['account_sid'], )
1055679
def create_spawnve(original_name):
    

    def new_spawnve(mode, path, args, env):
        import os
        send_process_created_message()
        return getattr(os, original_name)(mode, path, patch_args(args), env)

    return new_spawnve
627117
def _instance(self, cls, *args, **kwargs):
        
        logger.debug(f'args: {args}, kwargs: {kwargs}')
        return cls(*args, **kwargs)
626905
def create_fork_exec(original_name):
    

    def new_fork_exec(args, *other_args):
        import _posixsubprocess  # @UnresolvedImport
        args = patch_args(args)
        send_process_created_message()
        return getattr(_posixsubprocess, original_name)(args, *other_args)

    return new_fork_exec
24446
def instance():
        
        if not hasattr(IOLoop, "_instance"):
            with IOLoop._instance_lock:
                if not hasattr(IOLoop, "_instance"):
                    # New instance after double check
                    IOLoop._instance = IOLoop()
        return IOLoop._instance
475759
def get_instance(self, payload):
        
        return RecordInstance(self._version, payload, account_sid=self._solution['account_sid'], )
1242127
def instance(cls, public_keys_dir):
        ''''''
        if public_keys_dir in cls._authenticators:
            return cls._authenticators[public_keys_dir]
        new_instance = cls(public_keys_dir)
        cls._authenticators[public_keys_dir] = new_instance
        return new_instance
592162
def new_(self, df=pd.DataFrame(), db=None, quiet=False,
             nbload_libs=True):
        
        ds2 = Ds(df, db, nbload_libs)
        if quiet is False:
            self.ok("A new instance was created")
        return ds2
1253660
def instance(cls) -> 'MiddlewareManager':
        

        if cls._instance is None:
            cls._instance = cls()
            cls._instance.init()
        return cls._instance
602377
def create(cls, paramCount):
        

        return Particle(numpy.array([[]]*paramCount),
                 numpy.array([[]]*paramCount),
                 -numpy.Inf)
1316967
def new(self, name, *args, **kwargs):
        '''
        '''
        if name in self._instance_map:
            raise ValueError('Instance {0} is already initialized'
                             .format(name))

        instance = self._class_map[name](*args, **kwargs)
        self._instance_map[name] = instance
        return instance
96365
def create_refobject(self, ):
        
        parent = self.get_parent()
        if parent:
            prefobj = parent.get_refobj()
        else:
            prefobj = None
        refobj = self.get_refobjinter().create(self.get_typ(), self.get_id(), prefobj)
        return refobj
978499
def getInstance(self):
        
        try:
            return self._instance
        except AttributeError:
            self._instance = self._decorated()
            return self._instance
272654
def _instance_from_process(self, process):
    """"""
    return ProcessManager(name=process.name(),
                          pid=process.pid,
                          process_name=process.name(),
                          metadata_base_dir=self._metadata_base_dir)
161316
def singleton(cls):
    '''
    
    '''

    cls.__new_original__ = cls.__new__

    @wraps(cls.__new__)
    def singleton_new(cls, *args, **kw):
        it = cls.__dict__.get('__it__')
        if it is not None:
            return it

        cls.__it__ = it = cls.__new_original__(cls, *args, **kw)
        it.__init_original__(*args, **kw)
        return it

    cls.__new__ = singleton_new
    cls.__init_original__ = cls.__init__
    cls.__init__ = object.__init__

    return cls