Return the list of pretty app names that are available in the database.

        Returns:
            set of str.
965762
def get_pretty_app_names(self):
        
        pretty_app_names = set()
        for app_name in self.get_app_names():
            pretty_app_names.add(self.get_name(app_name))

        return pretty_app_names
1012051
def _models(self, appname):
        
        try:
            app = self._get_app(appname)
        except Exception as e:
            self.err("Can not get app " + appname, e)
            return
        if appname not in self.appnames:
            self.err("App " + appname + " not found in settings")
            return
        models = self._get_models(app)
        return models
815450
def apps(self):
        
        logger.debug("initialize applications ...")
        enabled = None
        apps = self.args.apps or self._config_apps.keys()
        unknown = set(apps) - set(self._config_apps.keys())
        if unknown:
            raise LogRaptorArgumentError("--apps", "not found apps %r" % list(unknown))

        if apps or enabled is None:
            return {k: v for k, v in self._config_apps.items() if k in apps}
        else:
            return {k: v for k, v in self._config_apps.items() if k in apps and v.enabled == enabled}
660041
def get_public_cms_app_namespaces():
    
    qs = Page.objects.public()
    qs = qs.exclude(application_namespace=None)
    qs = qs.order_by('application_namespace')

    try:
        application_namespaces = list(
            qs.distinct('application_namespace').values_list(
                'application_namespace', flat=True))
    except NotImplementedError:
        # If SQLite used:
        #   DISTINCT ON fields is not supported by this database backend
        application_namespaces = list(
            set(qs.values_list('application_namespace', flat=True)))

    application_namespaces.sort()

    return tuple(application_namespaces)
1088725
def DbGetInstanceNameList(self, argin):
        
        self._log.debug("In DbGetInstanceNameList()")
        return self.db.get_instance_name_list(argin)
854720
def pretty(self):
        ""
        pretty_obj = OrderedDict()
        for key, value in sorted(iteritems(self.__dict__)):
            if value is None:
                pretty_obj[key] = None
            elif is_str_or_unicode(value):
                pretty_obj[key] = self.__dict__.get(key)
            elif isinstance(value, list):
                pretty_obj[key] = []
            elif isinstance(value, dict):
                pretty_obj[key] = {}
            else:
                pretty_obj[key] = unicode_value(value)
        return pretty_obj
800436
def get_app_list(region_name=None,filter_name=None):
    
    try:
        conn = get_conn()
        c = conn.cursor()

        cond = []
        where_clause = ""
        if region_name:
            cond.append( "region='{0}' ".format(region_name) )
        if filter_name:
            cond.append( "lower(name) like '%{0}%' ".format(filter_name.lower()) )
        if len(cond) > 0:
            where_clause = 'and ' + 'and '.join( cond )

        sqlcmd = "SELECT name,source_id,region,state,create_at,change_at FROM app where state<>'Terminated' %s " % where_clause
        log = logging.getLogger(__name__)
        log.debug('> sql : %s' % sqlcmd)

        c.execute(sqlcmd)
        rlt = c.fetchall()
        conn.commit()
        conn.close()

        return rlt
    except Exception,e:
        raise RuntimeError('list app failed! %s ' % e)
589868
def get_list_database(self):
        """"""
        url = "db"

        response = self.request(
            url=url,
            method='GET',
            expected_response_code=200
        )

        return response.json()
1288340
def get_tables(self, db_name, pattern):
    
    self.send_get_tables(db_name, pattern)
    return self.recv_get_tables()
977770
def tables(self):
        
        select = ("SELECT name FROM sqlite_master",)
        query = self.execute(*select)
        result = query.fetchall()

        # Filter first column from rows.
        return [row[0] for row in result]
922638
def get_apps_to_backup(self):
        
        # Instantiate the app db
        app_db = appsdb.ApplicationsDatabase()

        # If a list of apps to sync is specify, we only allow those
        # Or we allow every supported app by default
        apps_to_backup = self._config.apps_to_sync or app_db.get_app_names()

        # Remove the specified apps to ignore
        for app_name in self._config.apps_to_ignore:
            apps_to_backup.discard(app_name)

        return apps_to_backup
467113
def as_list(self):
        
        self._sanitise()
        l = []
        for name in self.names:
            l.append(getattr(self, name))
        return l
370454
def data_names(self):
        """"""
        if self.binded:
            return self._curr_module.data_names
        else:
            _, data_names, _ = self._call_sym_gen(self._default_bucket_key)
            return data_names
118326
def _tables(self) -> List[Tuple[str, str]]:
        
        return [(k.rsplit('.', 1)[1] if '.' in k else k, k) for k in self._ont_tables.keys()]
407799
def get_apps(self):
        
        apps = []
        for resource in self._get_apps()['resources']:
            apps.append(resource['entity']['name'])

        return apps
408895
def get_campaign_name_list(self):
        
        campaigns = self.find('campaigns', {})
        campaign_names = []
        for campaign in campaigns:
            if 'name' in campaign:
                campaign_names.append(campaign['name'])
        return campaign_names
414666
def getDatabases(self):
        
        cur = self._conn.cursor()
        cur.execute("""SHOW DATABASES;""")
        rows = cur.fetchall()
        if rows:
            return [row[0] for row in rows]
        else:
            return []