See base class for details.
512663
def encode_example(self, bbox):
    """"""
    # Validate the coordinates
    for coordinate in bbox:
      if not isinstance(coordinate, float):
        raise ValueError(
            'BBox coordinates should be float. Got {}.'.format(bbox))
      if not 0.0 <= coordinate <= 1.0:
        raise ValueError(
            'BBox coordinates should be between 0 and 1. Got {}.'.format(bbox))
      if bbox.xmax < bbox.xmin or bbox.ymax < bbox.ymin:
        raise ValueError(
            'BBox coordinates should have min <= max. Got {}.'.format(bbox))

    return super(BBoxFeature, self).encode_example(
        [bbox.ymin, bbox.xmin, bbox.ymax, bbox.xmax]
    )
1118645
def peek(self):
        """"""
        info = self._registry.get(self)
        obj = info and info.weakref()
        if obj is not None:
            return (obj, info.func, info.args, info.kwargs or {})
178552
def base(self, du):
        """"""
        parameter = 'base'
        if parameter not in self._by:
            self._by[parameter] = {}
            for clb in self.upi.values():
                if clb.floor == 0:
                    self._by[parameter][clb.du] = clb
        return self._by[parameter][du]
340003
async def detail(self, **kwargs):
        '''
        
        '''
        try:
            pk = self.pk_type(kwargs.get('pk'))
            obj = await self._meta.object_class.find_one(self.db, {self.pk: pk})
            if obj:
                return await obj.serialize()
            raise NotFound('Object matching the given {} with value {} was not found'.format(self.pk, str(pk)))
        except InvalidId:
            raise NotFound('Invalid ID')
606343
def visit_ClassDef(self, node):
        """"""
        # [[[cog
        # cog.out("print(pcolor('Enter class visitor', 'magenta'))")
        # ]]]
        # [[[end]]]
        # Get class information (name, line number, etc.)
        element_full_name = self._pop_indent_stack(node, "class")
        code_id = (self._fname, node.lineno)
        self._processed_line = node.lineno
        # Add class entry to dictionaries
        self._class_names.append(element_full_name)
        self._callables_db[element_full_name] = {
            "name": element_full_name,
            "type": "class",
            "code_id": code_id,
            "last_lineno": None,
        }
        self._reverse_callables_db[code_id] = element_full_name
        # [[[cog
        # code = """
        # print(
        #     pcolor(
        #         'Visiting class {0} @ {1}, indent = {2}'.format(
        #             element_full_name, code_id[1], self._get_indent(node)
        #         ),
        #         'green'
        #     )
        # )
        # """
        # cog.out(code)
        # ]]]
        # [[[end]]]
        self.generic_visit(node)
216561
def _get_base(obj):
    """"""
    if hasattr(obj, '__func__'):
        obj = obj.__func__
    elif isinstance(obj, property):
        obj = obj.fget
    elif isinstance(obj, (classmethod, staticmethod)):
        # Fallback for Python < 2.7 back when no `__func__` attribute
        # was defined for those descriptors.
        obj = obj.__get__(None, object)
    else:
        return obj

    return _get_base(obj)
836591
def get_lookups(cls):
        """"""
        class_lookups = [parent.__dict__.get('class_lookups', {}) for parent in inspect.getmro(cls)]
        return cls.merge_dicts(class_lookups)
529469
public void addBaseClasses(Class<?>... baseClasses) {

    if (this.baseClassList == null) {
      this.baseClassList = new ArrayList<>();
    }
    this.baseClassList.addAll(Arrays.asList(baseClasses));
  }
212398
def base_variables(self):
        """"""
        if isinstance(self.data, InteractiveList):
            return dict(chain(*map(
                lambda arr: six.iteritems(arr.psy.base_variables),
                self.data)))
        else:
            return self.data.psy.base_variables
620035
def generate_endpoint_classes(db, generate_pks=False):
    """"""
    seen_classes = set()
    for cls in current_app.class_references.values():
        seen_classes.add(cls.__tablename__)
    with app.app_context():
        db.metadata.reflect(bind=db.engine)
        for name, table in db.metadata.tables.items():
            if not name in seen_classes:
                seen_classes.add(name)
                if not table.primary_key and generate_pks:
                    cls = add_pk_if_required(db, table, name)
                else:
                    cls = type(
                        str(name),
                        (sandman_model, db.Model),
                        {'__tablename__': name})
                register(cls)
276976
def has_known_bases(klass, context=None):
    """"""
    try:
        return klass._all_bases_known
    except AttributeError:
        pass
    for base in klass.bases:
        result = safe_infer(base, context=context)
        # TODO: check for A->B->A->B pattern in class structure too?
        if (
            not isinstance(result, scoped_nodes.ClassDef)
            or result is klass
            or not has_known_bases(result, context=context)
        ):
            klass._all_bases_known = False
            return False
    klass._all_bases_known = True
    return True
623809
def base (self):
        
        result = [p for p in self.lazy_properties
                  if not(p.feature.incidental or p.feature.free)]
        result.extend(self.base_)
        return result
285806
def doit(self, classes=None, recursive=True, **kwargs):
        
        return super().doit(classes, recursive, **kwargs)
140363
def _initialize_counters(model_class, name, bases, attrs):
    """"""
    model_class._counters = []
    for k, v in attrs.iteritems():
        if isinstance(v, Counter):
            model_class._counters.append(k)
522329
def _subclassed(base, *classes):
        
        return all(map(lambda obj: isinstance(obj, base), classes))
1326981
public void getBaseDataClass(FieldStuff fieldStuff)
    {
        Record recClassInfo2 = m_recClassInfo2;
        FieldData recFieldData = (FieldData)this.getRecord(FieldData.FIELD_DATA_FILE);
        
        String strRecordClass = recFieldData.getField(FieldData.FIELD_CLASS).getString();
        fieldStuff.strBaseFieldClass = null;
        try   {
            while (true)
            {
                recClassInfo2.setKeyArea(ClassInfo.CLASS_NAME_KEY);
                recClassInfo2.getField(ClassInfo.CLASS_NAME).setString(strRecordClass);   // Class of this record
                if ((!recClassInfo2.seek("=")) || (strRecordClass == null) || (strRecordClass.length() == 0))
                {
                    if (fieldStuff.strBaseFieldClass == null)
                        fieldStuff.strBaseFieldClass = recFieldData.getField(FieldData.FIELD_CLASS).getString();   // Never
                    return;
                }
                if (fieldStuff.strBaseFieldClass == null)
                {
                	String packageName = ((ClassInfo)recClassInfo2).getPackageName(null);
                    if (packageName.endsWith(".base.field"))
                        fieldStuff.strBaseFieldClass = recClassInfo2.getField(ClassInfo.CLASS_NAME).toString();
                }
                if (strRecordClass.indexOf("Field") != -1)
                {
                    String strType = strRecordClass.substring(0, strRecordClass.indexOf("Field"));
                    if ((strType.equals("DateTime")) || (strType.equals("Time")))
                        strType = "Date";
                    if (strType.length() > 0)
                        if ("Short Integer Double Float Boolean String Date".indexOf(strType) != -1)
                    {
                        if ((fieldStuff.strDataClass == null) || (fieldStuff.strDataClass.length() == 0))
                            fieldStuff.strDataClass = strType;      // End of based records - not found
                        return;
                    }
                }
                strRecordClass = recClassInfo2.getField(ClassInfo.BASE_CLASS_NAME).getString();
            }
        } catch (DBException ex)    {
            ex.printStackTrace();
        }
    }
1262055
def get_backend_cls(self):
        """"""
        backend_cls = self.backend_cls
        if not backend_cls or isinstance(backend_cls, basestring):
            backend_cls = get_backend_cls(backend_cls)
        return backend_cls