Utility function that fetches quota types.
180555
public static List<QuotaType> getQuotaTypes(List<String> strQuotaTypes) {
        if(strQuotaTypes.size() < 1) {
            throw new VoldemortException("Quota type not specified.");
        }
        List<QuotaType> quotaTypes;
        if(strQuotaTypes.size() == 1 && strQuotaTypes.get(0).equals(AdminToolUtils.QUOTATYPE_ALL)) {
            quotaTypes = Arrays.asList(QuotaType.values());
        } else {
            quotaTypes = new ArrayList<QuotaType>();
            for(String strQuotaType: strQuotaTypes) {
                QuotaType type = QuotaType.valueOf(strQuotaType);
                quotaTypes.add(type);
            }
        }
        return quotaTypes;
    }
886039
def filter_by_type():
    """"""
    if request.method == 'OPTIONS':
        return {}
    response = request.body.read().decode('utf-8')
    body = json.loads(response)
    stmts_json = body.get('statements')
    stmt_type_str = body.get('type')
    stmt_type_str = stmt_type_str.capitalize()
    stmt_type = getattr(sys.modules[__name__], stmt_type_str)
    stmts = stmts_from_json(stmts_json)
    stmts_out = ac.filter_by_type(stmts, stmt_type)
    return _return_stmts(stmts_out)
866994
def get_field_type(f):
    """"""
    types = (t[5:] for t in dir(f) if t[:4] == 'TYPE' and
             getattr(f, t) == f.type)
    return next(types)
167865
def quota(self, quota):
        
        if quota is None:
            raise ValueError("Invalid value for `quota`, must not be `None`")
        if quota is not None and quota < 0:
            raise ValueError("Invalid value for `quota`, must be a value greater than or equal to `0`")

        self._quota = quota
866079
def get_all(kind='2'):
        '''
        
        '''
        return TabPost.select().where(
            (TabPost.kind == kind) &
            (TabPost.valid == 1)
        ).order_by(
            TabPost.time_update.desc()
        )
1078339
def _get_candidates(self):
        
        candidates = np.where(self.dpp_vector == 0)
        return None if len(candidates[0]) == 0 else candidates[0]
735237
def filter(self, table, group_types, filter_string):
        """"""
        query = filter_string.lower()
        return [group_type for group_type in group_types
                if query in group_type.name.lower()]
1143712
def get_types(obj, **kwargs):
    """"""
    max_iterable_length = kwargs.get('max_iterable_length', 100000)

    it, = itertools.tee(obj, 1)
    s = set()

    too_big = False

    for i, v in enumerate(it):
        if i <= max_iterable_length:
            s.add(type(v))
        else:
            too_big = True
            break

    return {"types": s, "too_big": too_big}
688213
def simple_types_filter(data):
    '''
    
    '''
    if data is None:
        return data

    simpletypes_keys = (six.string_types, six.text_type, six.integer_types, float, bool)
    simpletypes_values = tuple(list(simpletypes_keys) + [list, tuple])

    if isinstance(data, (list, tuple)):
        simplearray = []
        for value in data:
            if value is not None:
                if isinstance(value, (dict, list)):
                    value = simple_types_filter(value)
                elif not isinstance(value, simpletypes_values):
                    value = repr(value)
            simplearray.append(value)
        return simplearray

    if isinstance(data, dict):
        simpledict = {}
        for key, value in six.iteritems(data):
            if key is not None and not isinstance(key, simpletypes_keys):
                key = repr(key)
            if value is not None and isinstance(value, (dict, list, tuple)):
                value = simple_types_filter(value)
            elif value is not None and not isinstance(value, simpletypes_values):
                value = repr(value)
            simpledict[key] = value
        return simpledict

    return data
208008
def get_type(obj, **kwargs):
    """"""
    t = type(obj)

    s = extract_type(str(t))

    return 'Type: {}'.format(s)
1240469
def get_quota_remaining(self):
        """"""
        api = self._get_api(billing.DefaultApi)
        quota = api.get_service_package_quota()
        return None if quota is None else int(quota.quota)
44992
def parse_query_filter():
    """"""
    query_string = request.args.get("queryFilter")
    if query_string is None:
        return {"type": "and", "filters": []}
    query = json.loads(query_string)
    assert type(query) == dict
    assert type(query.get("type")) == str
    return query
1295402
def extract_type(s):
    """"""
    r = re.compile(r"<class '(.*)'>", re.MULTILINE | re.IGNORECASE)
    try:
        m = r.match(str(s)).group(1)
    except (IndexError, AttributeError) as e:
        m = None

    return m
8228
def _getParameters(self):
        """"""
        param = self.query._getParameters() 
        index = self._getFilterIndex()
        param.update({
        'filter['+str(index)+'][columnAlias]' : self.__column,
        'filter['+str(index)+'][data][type]' : self.__type,
        'filter['+str(index)+'][data][value]' : self.__value,
        'filter['+str(index)+'][data][comparison]' : self.__comparison})        
        #self.__column.getColumnAlias()
        return param
999613
function getChoices() {
  const name = choice => fp.padStart(MAX_DESC)(choice.value)
  const desc = choice => wrap(choice.description, MAX)
  return types.map(choice => {
    if (choice.value === 'separator') return SEPARATOR
    return {
      name: `${name(choice)}  ${choice.emoji}  ${desc(choice)}`,
      value: choice.value,
      short: name(choice)
    }
  })
}
1369130
def list(self, request, *args, **kwargs):
        
        return super(QuotaViewSet, self).list(request, *args, **kwargs)
259653
def db_type(cls, dtype):
        """"""
        if isinstance(dtype, ExtensionDtype):
            return cls.type_map.get(dtype.kind)
        elif hasattr(dtype, 'char'):
            return cls.type_map.get(dtype.char)