Check the type of the transformer and column match.

        Args:
            column_metadata(dict): Metadata of the column.

        Raises a ValueError if the types don't match
197733
def check_data_type(self):
        
        metadata_type = self.column_metadata.get('type')
        if self.type != metadata_type and metadata_type not in self.type:
            raise ValueError('Types of transformer don\'t match')
109251
def types(self):
        """"""
        res = []
        for column in self.column_definitions:
            tmp = column.get('type', None)
            res.append(ModelCompiler.get_column_type(tmp)) if tmp else False
        res = list(set(res))
        return res
1184203
def get_column_type(self, table: str, column: str) -> str:
        """"""
        return self.flavour.get_column_type(self, table, column).upper()
310903
def check_type(self):
        """"""
        self.isdiscrete = {}
        for stochastic in self.stochastics:
            if stochastic.dtype in integer_dtypes:
                self.isdiscrete[stochastic] = True
            elif stochastic.dtype in bool_dtypes:
                raise ValueError(
                    'Binary stochastics not supported by AdaptativeMetropolis.')
            else:
                self.isdiscrete[stochastic] = False
266951
function validateMetaType(name, metaType) {
        assert(_.isObject(metaType), ERR_METATYPE_OBJECT, { name: name });
        assert(metaType.name, ERR_REQUIRE_FIELD, { metaType: metaType, field: "name" });
        assert(metaType.kind === "enum" || metaType.kind === "class", ERR_METATYPE_KIND, { metaType: metaType });

        // Enum MetaType
        if (metaType.kind === "enum") {
            var lits = metaType.literals;
            assert(Array.isArray(lits) && lits.length > 0, ERR_ENUM_HAS_LITERALS, { metaType: metaType });

            // Check duplicated literal
            _.each(lits, function (lit1) {
                var len = _.filter(lits, function (lit2) { return lit2 === lit1; }).length;
                assert(len === 1, ERR_DUPLICATED_LITERAL, { metaType: metaType, literal: lit1 });
            });
        }

        // Class MetaType
        if (metaType.kind === "class") {

            // Check .super
            if (metaType.super) {
                assert(metaType.super && _global.meta[metaType.super], ERR_TYPE_NOT_FOUND, { metaType: metaType, type: metaType.super, field: "super" });
            }

            // Check Attributes
            if (metaType.attributes) {
                assert(Array.isArray(metaType.attributes), ERR_FIELD_TYPE, { metaType: metaType, field: "attributes", type: "Array" });
                _.each(metaType.attributes, function (attribute) {

                    // check 'name'
                    assert(attribute.name, ERR_UNNAMED_ATTRIBUTE, { metaType: metaType });

                    // Check 'kind'
                    assert(_.contains(["prim", "enum", "var", "ref", "refs", "obj", "objs", "custom"], attribute.kind), ERR_ATTRIBUTE_KIND, { metaType: metaType, attribute: attribute });

                    // Check 'type'
                    if (attribute.kind === "prim") {
                        assert(_.contains(["Integer", "String", "Boolean", "Real"], attribute.type), ERR_ATTRIBUTE_PRIM_TYPE, { metaType: metaType, attribute: attribute });
                    } else if (attribute.kind !== "custom") {
                        assert(_global.meta[attribute.type], ERR_TYPE_NOT_FOUND, { metaType: metaType, type: attribute.type, field: attribute.name + ".type" });
                    }

                    // Check duplicated attribute in all inherited attributes
                    var len = _.filter(getMetaAttributes(metaType.name), function (attr) { return attr.name === attribute.name; }).length;
                    assert(len === 1, ERR_DUPLICATED_ATTRIBUTE, { metaType: metaType, attribute: attribute });
                });
            }
        }
    }
813894
def db_type(python_type_representation):
    
    for type_name in _candidate_type_names(python_type_representation):
        db_type_name = _lookup_type_name(type_name)
        if db_type_name:
            return db_type_name
    raise ValueError("Failed to find sqlite3 column type for %s" % (
        python_type_representation))
419048
def register_meta(self, type, **meta):
        
        try:
            self.registered_formats[type]['meta'] = meta
        except KeyError:
            self.registered_formats[type] = {'meta': meta}
1204965
def parse_meta(filename, data):
    
    if "." not in filename:
        raise MetaParsingException(
            "Can't recognize type of your metadata ('%s')!" % filename
        )

    suffix = filename.rsplit(".", 1)[1].lower()

    if suffix not in SUPPORTED_FILES:
        raise MetaParsingException("Can't parse file of type '%s'!" % suffix)

    fp = validator.FieldParser()
    for key, val in SUPPORTED_FILES[suffix](data).items():
        fp.process(key, val)

    return fp.get_epublication()
1374238
def getMetadataId(self, metadata):
        
        return str(datamodel.VariantSetMetadataCompoundId(
            self.getCompoundId(), 'metadata:' + metadata.key))
294348
def validate_type(value, types, **kwargs):
    
    if not is_value_of_any_type(value, types):
        raise ValidationError(MESSAGES['type']['invalid'].format(
            repr(value), get_type_for_value(value), types,
        ))
147472
def _supported_types_for_metadata(metadata):
    """"""
    numtypes = set()
    for numtype in PhoneNumberType.values():
        if numtype in (PhoneNumberType.FIXED_LINE_OR_MOBILE, PhoneNumberType.UNKNOWN):
            # Never return FIXED_LINE_OR_MOBILE (it is a convenience type, and represents that a
            # particular number type can't be determined) or UNKNOWN (the non-type).
            continue
        if _desc_has_data(_number_desc_by_type(metadata, numtype)):
            numtypes.add(numtype)
    return numtypes
996385
def is_metatype(rdtype):
    """"""

    if rdtype >= TKEY and rdtype <= ANY or rdtype in _metatypes:
        return True
    return False
185370
def IsMetaMetaDict(AST):
    
    isintpair = lambda x : (isinstance(x,Tuple) and (len(x.asList()) == 2) and 
                            isctype(x.asList()[0], int) and 
                            isctype(x.asList()[1], int))
    try:
        if ((len(AST.getChildren()) > 1) and 
            isinstance(AST.getChildren()[1], Stmt)):
            if isinstance(AST.getChildren()[1].getChildren()[0], Assign):
                [s, d] = AST.getChildren()[1].getChildren()[0].asList()
    except (TypeError, AttributeError):
        return False
    else:
        if (isinstance(s, AssName) and s.name == 'metametadata'):     
            if isinstance(d, Dict):
                return all([isctype(k, str) and 
                            (isctype(v, int) or isintpair(v)) 
                            for (k,v) in d.items])
1057042
def column_types_equal(a_coltype: TypeEngine, b_coltype: TypeEngine) -> bool:
      # noqa
    return str(a_coltype) == str(b_coltype)
226059
def apply_transformer_types(network):
    

    trafos_with_types_b = network.transformers.type != ""
    if trafos_with_types_b.zsum() == 0:
        return

    missing_types = (pd.Index(network.transformers.loc[trafos_with_types_b, 'type'].unique())
                     .difference(network.transformer_types.index))
    assert missing_types.empty, ("The type(s) {} do(es) not exist in network.transformer_types"
                                 .format(", ".join(missing_types)))

    # Get a copy of the transformers data
    # (joining pulls in "phase_shift", "s_nom", "tap_side" from TransformerType)
    t = (network.transformers.loc[trafos_with_types_b, ["type", "tap_position", "num_parallel"]]
         .join(network.transformer_types, on='type'))

    t["r"] = t["vscr"] /100.
    t["x"] = np.sqrt((t["vsc"]/100.)**2 - t["r"]**2)

    #NB: b and g are per unit of s_nom
    t["g"] = t["pfe"]/(1000. * t["s_nom"])

    #for some bizarre reason, some of the standard types in pandapower have i0^2 < g^2
    t["b"] = - np.sqrt(((t["i0"]/100.)**2 - t["g"]**2).clip(lower=0))

    for attr in ["r","x"]:
        t[attr] /= t["num_parallel"]

    for attr in ["b","g"]:
        t[attr] *= t["num_parallel"]

    #deal with tap positions

    t["tap_ratio"] = 1. + (t["tap_position"] - t["tap_neutral"]) * (t["tap_step"]/100.)

    # now set calculated values on live transformers
    for attr in ["r", "x", "g", "b", "phase_shift", "s_nom", "tap_side", "tap_ratio"]:
        network.transformers.loc[trafos_with_types_b, attr] = t[attr]
533864
def _checkMetadata(self, variantFile):
        
        metadata = self._getMetadataFromVcf(variantFile)
        if self._metadata is not None and self._metadata != metadata:
            raise exceptions.InconsistentMetaDataException(
                variantFile.filename)
1187345
def _check_patch_type_mismatch(self, patched_item, existing_item):
        """"""
        def raise_mismatch_error(patched_item, existing_item, data_type_name):
            error_msg = ('Type mismatch. Patch {} corresponds to pre-existing '
                'data_type {} ({}:{}) that has type other than {}.')
            raise InvalidSpec(error_msg.format(
                quote(patched_item.name),
                quote(existing_item.name),
                existing_item.path,
                existing_item.lineno,
                quote(data_type_name)), patched_item.lineno, patched_item.path)

        if isinstance(patched_item, AstStructPatch):
            if not isinstance(existing_item, AstStructDef):
                raise_mismatch_error(patched_item, existing_item, 'struct')
        elif isinstance(patched_item, AstUnionPatch):
            if not isinstance(existing_item, AstUnionDef):
                raise_mismatch_error(patched_item, existing_item, 'union')
            else:
                if existing_item.closed != patched_item.closed:
                    raise_mismatch_error(
                        patched_item, existing_item,
                        'union_closed' if existing_item.closed else 'union')
        else:
            raise AssertionError(
                'Unknown Patch Object Type {}'.format(patched_item.__class__.__name__))