Every object (BasisKet, LocalSigma) that contains a label or index
        for an eigenstate of some LocalSpace should call this routine to check
        the type of that label or index (or, use
        :meth:`_unpack_basis_label_or_index`
491663
def _check_basis_label_type(cls, label_or_index):
        """"""
        if not isinstance(label_or_index, cls._basis_label_types):
            raise TypeError(
                "label_or_index must be an instance of one of %s; not %s" % (
                    ", ".join([t.__name__ for t in cls._basis_label_types]),
                    label_or_index.__class__.__name__))
1142386
function getprototypeat(index) {
		var prev = buffer.substr(0, index);
		var indx = prev.length;
		while(--indx && prev[indx].match(CLASSNAME)) {}
		return prev.substring(indx + 1) + '.prototype.';
	}
175692
function (object, callback) {
                var list;
                if (object instanceof List) {
                    list = object;
                } else if (object instanceof Array) {
                    list = new List(object);
                } else {
                    list = new List([object]);
                }

                if (list.size()) {
                    var element = list.at(0);
                    var objectType = this.getObjectTypeIdForElement(element);
                    if (!objectType) {
                        callback("Couldn't find label object type for " + element.prototype.constructor.name);
                        return;
                    }
                    var query = new Query().in("objectIds", list.toArray(function (object) {
                        return object && object.identifier();
                    })).in('objectTypeId', [objectType]);


                    var labels = this.$.dataSource.createCollection(Collection.of(Label)).query(query);

                    labels.fetch({fullData: true}, callback);
                } else {
                    callback && callback();
                }
            }
782727
def _check_parameters(self):
        
        if self._map_type != "planar" and self._map_type != "toroid":
            raise Exception("Invalid parameter for _map_type: " +
                            self._map_type)
        if self._grid_type != "rectangular" and self._grid_type != "hexagonal":
            raise Exception("Invalid parameter for _grid_type: " +
                            self._grid_type)
        if self._neighborhood != "gaussian" and self._neighborhood != "bubble":
            raise Exception("Invalid parameter for neighborhood: " +
                            self._neighborhood)
        if self._kernel_type != 0 and self._kernel_type != 1:
            raise Exception("Invalid parameter for kernelTye: " +
                            self._kernel_type)
        if self._verbose < 0 and self._verbose > 2:
            raise Exception("Invalid parameter for verbose: " +
                            self._kernel_type)
639705
Symbol findIdentInPackage(Env<AttrContext> env, TypeSymbol pck,
                              Name name, KindSelector kind) {
        Name fullname = TypeSymbol.formFullName(name, pck);
        Symbol bestSoFar = typeNotFound;
        if (kind.contains(KindSelector.TYP)) {
            RecoveryLoadClass recoveryLoadClass =
                    allowModules && !kind.contains(KindSelector.PCK) &&
                    !pck.exists() && !env.info.isSpeculative ?
                        doRecoveryLoadClass : noRecovery;
            Symbol sym = loadClass(env, fullname, recoveryLoadClass);
            if (sym.exists()) {
                // don't allow programs to use flatnames
                if (name == sym.name) return sym;
            }
            else bestSoFar = bestOf(bestSoFar, sym);
        }
        if (kind.contains(KindSelector.PCK)) {
            return lookupPackage(env, fullname);
        }
        return bestSoFar;
    }
793543
def load_label(self, idx, label_type=None):
        
        if label_type == 'semantic':
            label = scipy.io.loadmat('{}/SemanticLabels/spatial_envelope_256x256_static_8outdoorcategories/{}.mat'.format(self.siftflow_dir, idx))['S']
        elif label_type == 'geometric':
            label = scipy.io.loadmat('{}/GeoLabels/spatial_envelope_256x256_static_8outdoorcategories/{}.mat'.format(self.siftflow_dir, idx))['S']
            label[label == -1] = 0
        else:
            raise Exception("Unknown label type: {}. Pick semantic or geometric.".format(label_type))
        label = label.astype(np.uint8)
        label -= 1  # rotate labels so classes start at 0, void is 255
        label = label[np.newaxis, ...]
        return label.copy()
975602
def identify(label, column_type = :integer)
      if column_type == :uuid
        NamedSeeds.uuid_v5(label)
      else
        Zlib.crc32(label.to_s) % MAX_ID
      end
    end
1019147
def TYPE(type_):
        
        if isinstance(type_, symbols.TYPE):
            return type_

        assert TYPE.is_valid(type_)
        return gl.SYMBOL_TABLE.basic_types[type_]
1361637
function(m) {
					var conditionValue = (typeof m === "object") ?
						readMemberExpression(conditionExport, m) : m;

					if (substitution) {
						if (typeof conditionValue !== "string") {
							throw new TypeError(
								"The condition value for " +
									conditionalMatch[0] +
									" doesn't resolve to a string."
							);
						}

						name = name.replace(conditionalRegEx, conditionValue);
					}
					else {
						if (typeof conditionValue !== "boolean") {
							throw new TypeError(
								"The condition value for " +
									conditionalMatch[0] +
									" isn't resolving to a boolean."
							);
						}
						if (booleanNegation) {
							conditionValue = !conditionValue;
						}
						if (!conditionValue) {
							name = "@empty";
						} else {
							name = name.replace(conditionalRegEx, "");
						}
					}

					if (name === "@empty") {
						return normalize.call(loader, name, parentName, parentAddress, pluginNormalize);
					} else {
						// call the full normalize in case the module name
						// is an npm package (that needs to be normalized)
						return loader.normalize.call(loader, name, parentName, parentAddress, pluginNormalize);
					}
				}
1197151
function getSingleCallSignature(type) {
            if (type.flags & 2588672 /* ObjectType */) {
                var resolved = resolveStructuredTypeMembers(type);
                if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 &&
                    resolved.properties.length === 0 && !resolved.stringIndexInfo && !resolved.numberIndexInfo) {
                    return resolved.callSignatures[0];
                }
            }
            return undefined;
        }
799180
def get_labels(obj):
        
        if Clustering.is_pyclustering_instance(obj.model):
            return obj._labels_from_pyclusters
        else:
            return obj.model.labels_
1259893
def from_dict(cls, d):
        
        labels_dict = d['labels_dict']
        projections = {}
        structure = None
        if isinstance(list(d['bands'].values())[0], dict):
            eigenvals = {Spin(int(k)): np.array(d['bands'][k]['data'])
                         for k in d['bands']}
        else:
            eigenvals = {Spin(int(k)): d['bands'][k] for k in d['bands']}
        if 'structure' in d:
            structure = Structure.from_dict(d['structure'])
        if d.get('projections'):
            projections = {Spin(int(spin)): np.array(v)
                           for spin, v in d["projections"].items()}

        return BandStructure(
            d['kpoints'], eigenvals,
            Lattice(d['lattice_rec']['matrix']), d['efermi'],
            labels_dict, structure=structure, projections=projections)
1269095
final void validateColumnType(int columnIndex, VoltType... types) {
        if (m_position < 0)
            throw new RuntimeException("VoltTableRow is in an invalid state. Consider calling advanceRow().");

        if ((columnIndex >= getColumnCount()) || (columnIndex < 0)) {
            throw new IndexOutOfBoundsException("Column index " + columnIndex + " is greater than the number of columns");
        }
        final VoltType columnType = getColumnType(columnIndex);
        for (VoltType type : types)
            if (columnType == type)
                return;
        throw new IllegalArgumentException("Column index " + columnIndex + " is type " + columnType);
    }
218440
def lookup_object(spec):
    
    parts, target = spec.split(':') if ':' in spec else (spec, None)
    module = __import__(parts)

    for part in parts.split('.')[1:] + ([target] if target else []):
        module = getattr(module, part)

    return module
1120348
def pks_from_objects(self, objects):
        
        return {o.pk if isinstance(o, Model) else o for o in objects}
663528
def _handleLookupType2Format2(subtable, lookupIndex, subtableIndex):
    
    # extract the classes
    leftClasses = _extractFeatureClasses(lookupIndex=lookupIndex, subtableIndex=subtableIndex, classDefs=subtable.ClassDef1.classDefs, coverage=subtable.Coverage.glyphs)
    rightClasses = _extractFeatureClasses(lookupIndex=lookupIndex, subtableIndex=subtableIndex, classDefs=subtable.ClassDef2.classDefs)
    # extract the pairs
    kerning = {}
    for class1RecordIndex, class1Record in enumerate(subtable.Class1Record):
        for class2RecordIndex, class2Record in enumerate(class1Record.Class2Record):
            leftClass = (lookupIndex, subtableIndex, class1RecordIndex)
            rightClass = (lookupIndex, subtableIndex, class2RecordIndex)
            valueFormat1 = subtable.ValueFormat1
            if valueFormat1:
                value = class2Record.Value1
            else:
                value = class2Record.Value2
            if hasattr(value, "XAdvance") and value.XAdvance != 0:
                value = value.XAdvance
                kerning[leftClass, rightClass] = value
    return kerning, leftClasses, rightClasses
543152
def component_type(cls_or_slf, node):
        ""
        if node is None: return ''
        return cls_or_slf.type_formatter.format(type=str(type(node).__name__))