Get a default dones object for ns.  If no dones object exists for ns yet,
    a DbDones object will be created, cached, and returned.
326781
def get(ns, dburl=None):
    '''
    
    '''
    if dburl is None:
        dburl = DONES_DB_URL

    cache_key = (ns, dburl)
    if ns not in DONES_CACHE:
        dones_ns = 'dones_{}'.format(ns)
        DONES_CACHE[cache_key] = DbDones(ns=dones_ns, dburl=dburl)

    return DONES_CACHE[cache_key]
1288179
public static MongoDatabase getOrInitDefaultDatabase(String connectionString, String database) {
        if (DEFAULT_DATABASE == null) {
            synchronized (LOCK) {
                if (DEFAULT_DATABASE == null) {
                    if (!StringUtil.isEmpty(connectionString)) {
                        DEFAULT_CLIENT = MongoClients.create(connectionString);
                        CodecRegistry pojoCodecRegistry = fromRegistries(
                                /*fromCodecs(new StringCodecExt()),*/
                                MongoClientSettings.getDefaultCodecRegistry(),
                                fromProviders(PojoCodecProvider.builder().automatic(true).build()));
                        DEFAULT_DATABASE = DEFAULT_CLIENT.getDatabase(database).withCodecRegistry(pojoCodecRegistry);
                    } else {
                        throw new RuntimeException("No datasource configuration found for mongodb.");
                    }
                }
            }
        }
        return DEFAULT_DATABASE;
    }
804473
def get(self, name, default=None, cache=False):
        
        if cache == True:
            for pane in self.cache:
                if pane.name == name:
                    return pane
            return default
        for pane in self:
            if pane.name == name:
                return pane
        return default
693990
function db(objectName) {
    if (_.isBoolean(save.hasLoaded)) deasync.loopWhile(() => !save.hasLoaded);
    if (!_.has(objects, objectName)) objects[objectName] = {};
    return createMethods(objects[objectName], save.bind(null, objectName));
  }
479537
def cache(ignore=None):
    
    def decorator(func):
        # Initialize both cached versions
        joblib_cached = constants.joblib_memory.cache(func, ignore=ignore)
        db_cached = DbMemoizedFunc(func, ignore)

        @functools.wraps(func)
        def wrapper(*args, **kwargs):
            """Dynamically choose the cache at call-time, not at import."""
            if func.__name__ == '_sia' and not config.CACHE_SIAS:
                f = func
            elif config.CACHING_BACKEND == 'fs':
                f = joblib_cached
            elif config.CACHING_BACKEND == 'db':
                f = db_cached
            return f(*args, **kwargs)

        return wrapper
    return decorator
756289
static public function getDefaultCacheHandler() {
        if(!isset(self::$defaultCacheHandler)) {            
            global $container;
            if(self::BACKWORDS_COMPATIBLE && isset($container) && isset($container['memcache'])) {
                // Backwards Compatibility
                if(class_exists("Memcache") && is_a($container['memcache'], "Memcache")) {
                    self::$defaultCacheHandler = new CacheHandler\Memcache($container['memcache']);
                } else if (class_exists("Memcached") && is_a($container['memcache'], "Memcached")) {
                    self::$defaultCacheHandler = new CacheHandler\Memcached($container['memcache']);    
                } else {
                    trigger_error("Before using NoizuLabs/Fragmented you must set a cache handler using NoizuLabs\FragmentedKeys\Configuration::setDefaultCacheHandler(ICacheHandle \$handler) or use only KeyRing entries with a specified storage mechanism.", E_USER_ERROR);    
                }
            }  else {
                trigger_error("Before using NoizuLabs/Fragmented you must set a cache handler using NoizuLabs\FragmentedKeys\Configuration::setDefaultCacheHandler(ICacheHandle \$handler) or use only KeyRing entries with a specified storage mechanism.", E_USER_ERROR);
            }
        }
        return self::$defaultCacheHandler;
    }
117311
def _called_thru_default_qs(self, node):
        """"""
        last_child = node.last_child()
        if not last_child:
            return False

        # the default qs manager is called 'objects', we check for it here
        attrname = getattr(last_child, 'attrname', None)
        if attrname != 'objects':
            return False

        base_cls = last_child.last_child()
        base_classes = DOCUMENT_BASES
        for cls in base_cls.inferred():
            if node_is_subclass(cls, *base_classes):
                return True

        return False
236522
def _nodeGetNonDefaultsDict(self):
        
        dct = {}
        if self.data != self.defaultData:
            dct['data'] = self.data.name()
        return dct
498932
def get_if_present(self, name, default=None):
        
        if not self.processed_data:
            raise exceptions.FormNotProcessed('The form data has not been processed yet')

        if name in self.field_dict:
            return self[name]

        return default
1128370
function (done) {
      Client.listByTrusted('true', {
        select: [
          '_id',
          'client_name',
          'client_uri',
          'application_type',
          'logo_uri',
          'trusted',
          'scopes',
          'created',
          'modified'
        ]
      }, function (err, clients) {
        if (err) { return done(err) }
        done(null, clients)
      })
    }
215041
def get_db(cls):
        """"""
        if cls._db:
            return getattr(cls._client, cls._db)
        return cls._client.get_default_database()
1116353
def db(cls, dbname=None):
        

        cls._load_entry_points()

        dbname = dbname or config.get('eop', 'dbname', fallback=cls.DEFAULT_DBNAME)

        if dbname not in cls._dbs.keys():
            raise EopError("Unknown database '%s'" % dbname)

        if isclass(cls._dbs[dbname]):
            # Instanciation
            try:
                cls._dbs[dbname] = cls._dbs[dbname]()
            except Exception as e:
                # Keep the exception in cache in order to not retry instanciation
                # every single time EopDb.db() is called, as instanciation
                # of database is generally a time consumming operation.
                # If it failed once, it will most probably fail again
                cls._dbs[dbname] = e

        if isinstance(cls._dbs[dbname], Exception):
            raise EopError("Problem at database instanciation") from cls._dbs[dbname]

        return cls._dbs[dbname]
805904
def get(self, name, default=None):
        '''
        
        '''

        session = self.__get_session_from_db()

        return session.get(name, default)
597419
def getDone(self, done):
        

        doneItems = self.noteDB['todo'] \
                        .find({"done": done}) \
                        .sort("date", pymongo.DESCENDING)
        IDs = [ii['ID'] for ii in doneItems]
        return IDs
896697
public K getSavedId() {
        if (dbObjects.length == 0) {
            throw new MongoException("No objects to return");
        }
        if (dbObjects[0] instanceof JacksonDBObject) {
            throw new UnsupportedOperationException("Generated _id retrieval not supported when using stream serialization");
        }
        return jacksonDBCollection.convertFromDbId(dbObjects[0].get("_id"));
    }
153517
def get_sql_for_new_models(apps=None, using=DEFAULT_DB_ALIAS):
    
    connection = connections[using]
    
    # Get a list of already installed *models* so that references work right.
    tables = connection.introspection.table_names()
    seen_models = connection.introspection.installed_models(tables)
    created_models = set()
    pending_references = {}
    
    if apps:
        apps = [models.get_app(a) for a in apps]
    else:
        apps = models.get_apps()
    
    # Build the manifest of apps and models that are to be synchronized
    all_models = [
        (app.__name__.split('.')[-2], [
            m
            for m in models.get_models(app, include_auto_created=True)
            if router.allow_syncdb(using, m)
        ])
        for app in apps
    ]
    
    def model_installed(model):
        opts = model._meta
        converter = connection.introspection.table_name_converter
        db_table_in = (converter(opts.db_table) in tables)
        auto_create_in = (
            opts.auto_created and
            converter(opts.auto_created._meta.db_table) in tables
        )
        return not (db_table_in or auto_create_in)
    
    manifest = SortedDict(
        (app_name, filter(model_installed, model_list))
        for app_name, model_list in all_models
    )
    
    statements = []
    sql = None
    for app_name, model_list in manifest.items():
        for model in model_list:
            # Create the model's database table, if it doesn't already exist.
            sql, references = connection.creation.sql_create_model(
                model,
                no_style(),
                seen_models
            )
            
            seen_models.add(model)
            created_models.add(model)
            statements.append("### New Model: %s.%s" % (
                app_name,
                str(model).replace("'>", "").split(".")[-1]
            ))
            
            for refto, refs in references.items():
                pending_references.setdefault(refto, []).extend(refs)
                if refto in seen_models:
                    sql.extend(
                        connection.creation.sql_for_pending_references(
                            refto,
                            no_style(),
                            pending_references
                        )
                    )
            
            sql.extend(
                connection.creation.sql_for_pending_references(
                    model,
                    no_style(),
                    pending_references
                )
            )
            statements.extend(sql)
    
    custom_sql = None
    for app_name, model_list in manifest.items():
        for model in model_list:
            if model in created_models:
                custom_sql = custom_sql_for_model(
                    model,
                    no_style(),
                    connection
                )
                
                if custom_sql:
                    statements.extend(custom_sql)
    
    index_sql = None
    for app_name, model_list in manifest.items():
        for model in model_list:
            if model in created_models:
                index_sql = connection.creation.sql_indexes_for_model(
                    model,
                    no_style()
                )
                
                if index_sql:
                    statements.extend(index_sql)
    
    return statements
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