This function returns the summary for a given model
17292
def _summarize_object_type(model):
    
    # the fields for the service's model
    model_fields = {field.name: field for field in list(model.fields())}
    # summarize the model
    return {
        'fields': [{
            'name': key,
            'type': type(convert_peewee_field(value)).__name__
            } for key, value in model_fields.items()
        ]
    }
1150054
def get_for_model(self, model):
        
        return self.get_or_create(
            content_type    = ContentType.objects.get_for_model(model),
            object_id       = model.pk
        )
1321090
def get_summary(content):
  """"""
  soup = BeautifulSoup(content, "html.parser")
  summary = soup.find_all(attrs={
      'class': re.compile(r".*\bsummary-content\b.*")})

  if summary[0].p.string is None:
    return summary[0].p.p.getText()
  return summary[0].p.getText()
587975
def __summary(self):
        """"""
        text = "Time: %s\n" % self.when
        text += "Comitter: %s\n" % self.editor

        inst = self.timemachine.presently

        if self.action_type == "dl":
            text += "Deleted %s\n" % inst._object_type_text()
        elif self.action_type == "cr":
            text += "Created %s\n" % inst._object_type_text()
        else:
            text += "Modified %s\n" % inst._object_type_text()
        text += self._details(nohtml=True)
        return text
140500
def summary(self):
        
        if not self.bug.resolution:
            return self.bug.summary
        if (self.bug.resolution.lower() in self.parent.resolutions
                or "all" in self.parent.resolutions):
            return "{0} [{1}]".format(
                self.bug.summary, self.bug.resolution.lower())
        return self.bug.summary
282162
def summary(self):
        
        if self.get('Summary'):
            return self.get('Summary')

        body, more, is_markdown = self._entry_content
        return TrueCallableProxy(
            self._get_summary,
            body or more) if is_markdown else CallableProxy(None)
570881
function summariser(results) {
    var response = [],
        callback = function(output) {
            response.push(output);
        };

    var passed = 0;
    if (results.hasOwnProperty('passed')) {
        passed = countSpecs(results.passed);
    }
    var failed = 0;
    if (results.hasOwnProperty('failed')) {
        failed = countSpecs(results.failed);
    }
    var pending = 0;

    if (results.hasOwnProperty('pending')) {
        pending = countSpecs(results.pending);
    }
    var total = passed + failed + pending;

    coloriseOutput(total + ' Specs defined', 'bold', callback);
    if (total > 0) {
        coloriseOutput(passed + ' Passed' + displayPercentage(total, passed), 'green', callback);
        coloriseOutput(failed + ' Failed' + displayPercentage(total, failed), 'red', callback);
        coloriseOutput(pending + ' Pending' + displayPercentage(total, pending), 'yellow', callback);
    }
    return response;
}
989435
def for_model(self, model):
        
        ct = ContentType.objects.get_for_model(model)
        qs = self.get_queryset().filter(content_type=ct)
        if isinstance(model, models.Model):
            qs = qs.filter(object_pk=force_text(model._get_pk_val()))
        return qs
605320
def summary(self):
        
        if self.hasSummary:
            if self.numClasses <= 2:
                return BinaryLogisticRegressionTrainingSummary(super(LogisticRegressionModel,
                                                                     self).summary)
            else:
                return LogisticRegressionTrainingSummary(super(LogisticRegressionModel,
                                                               self).summary)
        else:
            raise RuntimeError("No training summary available for this %s" %
                               self.__class__.__name__)
431149
protected function showDetail(Model $model)
    {
        $name = $this->manager->getClassName($model);

        $this->title("Summary of Model {$name} :");

        $summary = $this->manager->getModelSummary($name);
        $rows = [];

        foreach ($summary as $key => $value) {
            if (is_bool($value)) {
                $value = $value ? 'yes' : 'no';
            }

            $valueText = $this->paintString($value, 'brown');

            $rows[] = [$key, $valueText];
        }

        $this->table(['Key', 'Value'], $rows);

        $this->showDatabaseFields($model);
        $this->showRelatoins($model);
        $this->showModifier($model);
    }
700904
def summary(self):
        
        if self._summary is None:
            self._summary = CallSummaryList(self)
        return self._summary
1115062
private static void summarizeAndEnhanceFrame(FrameSummary summary, Frame frame, boolean find_compatible_models, Map<String, Model> all_models, Map<String, Set<String>> all_models_cols) {
    UniqueId unique_id = frame.getUniqueId();
    summary.id = unique_id.getId();
    summary.key = unique_id.getKey();
    summary.creation_epoch_time_millis = unique_id.getCreationEpochTimeMillis();

    summary.column_names = frame._names;
    summary.is_raw_frame = frame.isRawData();

    if (find_compatible_models) {
      Map<String, Model> compatible_models = findCompatibleModels(frame, all_models, all_models_cols);
      summary.compatible_models = compatible_models.keySet();
    }
  }
310649
def _count_model(self, model):
        
        try:
            res = model.objects.all().count()
        except Exception as e:
            self.err(e)
            return
        return res
1245544
def summary(self, compute=False) -> pd.DataFrame:
        
        if compute or self.result is None:
            self.compute()
        return summary(self.result)
1065119
private static void summarizeDRFModel(ModelSummary summary, hex.drf.DRF.DRFModel model) {
    // add generic fields such as column names
    summarizeModelCommonFields(summary, model);

    summary.model_algorithm = "BigData RF";

    JsonObject all_params = (model.get_params()).toJSON();
    summary.critical_parameters = whitelistJsonObject(all_params, DRF_critical_params);
    summary.secondary_parameters = whitelistJsonObject(all_params, DRF_secondary_params);
    summary.expert_parameters = whitelistJsonObject(all_params, DRF_expert_params);
  }
544462
def model_get(method_name):
    

    def model_get(_value, context, **_params):
        method = getattr(context["model"], method_name)
        return _get(method, context["key"], (), {})

    return model_get
414897
def model_inspect(obj):
        '''
        
        '''
        # Prepare the information object
        info = {}
        if hasattr(obj, '_meta'):
            info['verbose_name'] = getattr(obj._meta, 'verbose_name', None)
        else:
            info['verbose_name'] = None

        # Get info from the object
        if hasattr(obj, 'model') and obj.model:
            model = obj.model
        else:
            model = obj.__class__

        namesp = str(model)
        namesp = namesp.replace("<class ", "").replace(">", "").replace("'", "").split(".")

        # Remember information
        info['appname'] = namesp[-3]
        info['modelname'] = namesp[-1]
        info['model'] = model

        # Return the info
        return info