Return feature_names and coef_scale (if with_coef_scale is True),
    calling .get_feature_names for invhashing vectorizers.
347243
def handle_hashing_vec(vec, feature_names, coef_scale, with_coef_scale=True):
    
    needs_coef_scale = with_coef_scale and coef_scale is None
    if is_invhashing(vec):
        if feature_names is None:
            feature_names = vec.get_feature_names(always_signed=False)
        if needs_coef_scale:
            coef_scale = vec.column_signs_
    elif (isinstance(vec, FeatureUnion) and
              any(is_invhashing(v) for _, v in vec.transformer_list) and
              (needs_coef_scale or feature_names is None)):
        _feature_names, _coef_scale = _invhashing_union_feature_names_scale(vec)
        if feature_names is None:
            feature_names = _feature_names
        if needs_coef_scale:
            coef_scale = _coef_scale
    return (feature_names, coef_scale) if with_coef_scale else feature_names
162756
def feature_names(self):
        
        if self._feature_names is None:
            self._feature_names = ['f{0}'.format(i) for i in range(self.num_col())]
        return self._feature_names
464235
def get_features(cls, entry):
        
        features = []

        for feature in entry.iterfind("./feature"):

            feature_dict = {
                'description': feature.attrib.get('description'),
                'type_': feature.attrib['type'],
                'identifier': feature.attrib.get('id')
            }

            features.append(models.Feature(**feature_dict))

        return features
565056
private FeatureShape getFeatureShape(Map<Long, FeatureShape> featureIds, long featureId) {

        FeatureShape featureShape = featureIds.get(featureId);
        if (featureShape == null) {
            featureShape = new FeatureShape(featureId);
            featureIds.put(featureId, featureShape);
        }
        return featureShape;
    }
589334
def coef_(self):
        
        coef = numpy.zeros(self.n_features_ + 1, dtype=float)

        for estimator in self.estimators_:
            coef[estimator.component] += self.learning_rate * estimator.coef_

        return coef
73764
def get_num_features(estimator):
    
    if hasattr(estimator, 'coef_'):  # linear models
        if len(estimator.coef_.shape) == 0:
            return 1
        return estimator.coef_.shape[-1]
    elif hasattr(estimator, 'feature_importances_'):  # ensembles
        return estimator.feature_importances_.shape[-1]
    elif hasattr(estimator, 'feature_count_'):  # naive bayes
        return estimator.feature_count_.shape[-1]
    elif hasattr(estimator, 'theta_'):
        return estimator.theta_.shape[-1]
    elif hasattr(estimator, 'estimators_') and len(estimator.estimators_):
        # OvR
        return get_num_features(estimator.estimators_[0])
    else:
        raise ValueError("Can't figure out feature vector size for %s" %
                         estimator)
288222
def _property_names(self):
        
        property_names = []

        for name in dir(self):
            try:
                attr = getattr(type(self), name)

                if isinstance(attr, property) or isinstance(attr, cached_property):
                    property_names.append(name)

            except AttributeError:
                pass

        return property_names
760098
def gene_names(self):
        
        return self.ensembl.gene_names_at_locus(
            self.contig, self.start, self.end)
749431
def feature_list():
    
    lib_features_c_array = ctypes.POINTER(Feature)()
    lib_features_size = ctypes.c_size_t()
    check_call(_LIB.MXLibInfoFeatures(ctypes.byref(lib_features_c_array), ctypes.byref(lib_features_size)))
    features = [lib_features_c_array[i] for i in range(lib_features_size.value)]
    return features
185841
def feature_names(self, feature_names):
        
        if feature_names is not None:
            # validate feature name
            try:
                if not isinstance(feature_names, str):
                    feature_names = [n for n in iter(feature_names)]
                else:
                    feature_names = [feature_names]
            except TypeError:
                feature_names = [feature_names]

            if len(feature_names) != len(set(feature_names)):
                raise ValueError('feature_names must be unique')
            if len(feature_names) != self.num_col():
                msg = 'feature_names must have the same length as data'
                raise ValueError(msg)
            # prohibit to use symbols may affect to parse. e.g. []<
            if not all(isinstance(f, STRING_TYPES) and
                       not any(x in f for x in set(('[', ']', '<')))
                       for f in feature_names):
                raise ValueError('feature_names may not contain [, ] or <')
        else:
            # reset feature_types also
            self.feature_types = None
        self._feature_names = feature_names
654436
def _features_as_kv(self):
        
        self._data = self.get_data()
        key_list = self.key()
        values_list = self.values()
        result = {}
        for column in values_list:
            key_prefix = self.cache_key_prefix() + "#" + column
            self._data['cache_key'] = self._data[key_list].apply(lambda xdf: key_prefix + "=" + '#'.join(xdf.astype(str).values), axis=1)
            result[column] = dict(zip(self._data.cache_key.values, self._data[column].values))
        return result
966115
def _get_prefixes(self):
        """"""
        prefixes = {
            "@": "o",
            "+": "v",
        }
        feature_prefixes = self.server.features.get('PREFIX')
        if feature_prefixes:
            modes = feature_prefixes[1:len(feature_prefixes)//2]
            symbols = feature_prefixes[len(feature_prefixes)//2+1:]
            prefixes = dict(zip(symbols, modes))
        return prefixes
537497
def map_exp_ids(self, exp):
        
        names = self.exp_feature_names
        if self.discretized_feature_names is not None:
            names = self.discretized_feature_names
        return [(names[x[0]], x[1]) for x in exp]
1133152
def get_layer_names(self):
    
    layer_names = [x.name for x in self.model.layers]
    return layer_names
1122385
def get_pres_features(self, features=None):
        
        if features is None:
            features = self.dist_funcs.keys()
        elif not isinstance(features, list):
            features = [features]
        return self.pres.applymap(lambda x: {k:v for k,v in x.items() if k in features} if x is not None else None)
380232
def get_suffixes():
    

    names = []

    if at_least_libvips(8, 8):
        array = vips_lib.vips_foreign_get_suffixes()
        i = 0
        while array[i] != ffi.NULL:
            name = _to_string(array[i])
            if name not in names:
                names.append(name)
            glib_lib.g_free(array[i])
            i += 1
        glib_lib.g_free(array)

    return names
1171165
def get_polygon_filter_names():
    """"""
    names = []
    for p in PolygonFilter.instances:
        names.append(p.name)
    return names