:param app_list: A list of apps with models.
    :param n: Number of buckets to divide into.
    :return: Partition apps into n partitions, where the number of models in each list is roughly equal. We also factor
    in the app heading.
436944
def partition_app_list(app_list, n):
    
    num_rows = sum([1 + len(x['models']) for x in app_list]) # + 1 for app title
    num_rows_per_partition = num_rows / n

    result = [[] for i in range(n)] # start with n empty lists of lists
    partition = 0
    count = 0

    for a in app_list:
        # will the app fit in this column or overflow?
        c = len(a['models']) + 1 # the +1 is for the app title
        # if we're not on the last partition, and the models list fits
        # more on the next partition than this one, start the next partition.
        if (partition < n - 1) and (count + c/2.0 > num_rows_per_partition):
            partition += 1
            count = 0
        result[partition].append(a)
        count += c

    return result
1062045
def get_model_list(class_list):
    
    for idx, item in enumerate(class_list):
        if isinstance(item, six.string_types):
            model_class = apps.get_model(item)
            class_list[idx] = model_class
159763
public static function backfillMetrics($n, App $app)
    {
        $classes = self::metricClasses($app);

        $success = true;

        foreach ($classes as $metric) {
            if (!$metric->shouldBeCaptured()) {
                continue;
            }

            $i = 1;
            while ($i <= $n) {
                $success = $metric->savePeriod($i) && $success;

                ++$i;
            }
        }

        return $success;
    }
230674
def create_manage_py(self, apps):
        
        self.logger.debug('Creating manage.py ...')
        with open(self._get_manage_py_path(), mode='w') as f:
            south_migration_modules = []
            for app in apps:
                south_migration_modules.append("'%(app)s': '%(app)s.south_migrations'" % {'app': app})

            f.write(MANAGE_PY % {
                'apps_available': "', '".join(apps),
                'apps_path': self.apps_path,
                'south_migration_modules': ", ".join(south_migration_modules)


            })
1206702
def get_components(self):
        
        components = []
        for app_id in self.components:
            components.append(self.components[app_id])
        return components
528403
function list(appName, callback) {
    commons.get(format('/%s/apps/%s/perms/', deis.version, appName), callback);
  }
990407
function listFromOwnerApps(listByApp) {
    return app.info().
      then(function (appInfo) {
        return Promise.all(listByApp.
          filter(function (addon) {
            return addon.app.name !== appInfo.name;
          }).
          map(function (addon) {
            return client.addons(addon.name).info();
          }));
      });
  }
1358901
def get_list_class(context, list):
    
    return "list_%s_%s" % (list.model._meta.app_label, list.model._meta.model_name)
397754
def connect_apps(self):
        
        if self._connect_apps is None:
            self._connect_apps = ConnectAppList(self._version, account_sid=self._solution['sid'], )
        return self._connect_apps
752244
def partitionBy(self, numPartitions, partitionFunc=portable_hash):
        
        return self.transform(lambda rdd: rdd.partitionBy(numPartitions, partitionFunc))
272912
def make(self, apps):
        
        for subreport in self.subreports:
            logger.debug('Make subreport "{0}"'.format(subreport.name))
            subreport.make(apps)

        for subreport in self.subreports:
            subreport.compact_tables()
788939
def get_static_app_matching(apps):
    
    return reduce(lambda a, b: a + b,
                  [generate_static_matching(app)
                   for app in apps if app is not None])
127679
def get_list_of_applications():
    
    apps = mod_prg.Programs('Applications', 'C:\\apps')
    fl = mod_fl.FileList(['C:\\apps'], ['*.exe'], ["\\bk\\"])
    for f in fl.get_list():
        apps.add(f, 'autogenerated list')
    apps.list()
    apps.save()
481110
def _grow(list_of_lists, num_new):
    
    first = list_of_lists[0]
    for i in range(num_new):
        list_of_lists.append(copy.deepcopy(first))
    return list_of_lists
621706
def index
      @app_reviews = MnoEnterprise::AppFeedback
      @app_reviews = @app_reviews.limit(params[:limit]) if params[:limit]
      @app_reviews = @app_reviews.skip(params[:offset]) if params[:offset]
      @app_reviews = @app_reviews.order_by(params[:order_by]) if params[:order_by]
      @app_reviews = @app_reviews.where(params[:where]) if params[:where]
      @app_reviews = @app_reviews.all.fetch
      response.headers['X-Total-Count'] = @app_reviews.metadata[:pagination][:count]
    end
1162662
def lists(self, column, key=None):
        
        results = self._query.lists(column, key)

        if self._model.has_get_mutator(column):
            if isinstance(results, dict):
                for key, value in results.items():
                    fill = {column: value}

                    results[key] = self._model.new_from_builder(fill).column
            else:
                for i, value in enumerate(results):
                    fill = {column: value}

                    results[i] = self._model.new_from_builder(fill).column

        return results
407799
def get_apps(self):
        
        apps = []
        for resource in self._get_apps()['resources']:
            apps.append(resource['entity']['name'])

        return apps