Args:
            typ: type of calibration to look for. See .coeffs.keys() for all types available
            date (Optional[str]): date of calibration

        Returns:
            list: all infos available for given typ
353961
def infos(self, typ, light=None, date=None):
        '''
        
        '''
        d = self._getDate(typ, light)
        if date is None:
            return [c[1] for c in d]
        # TODO: not struct time, but time in ms since epoch
        return _getFromDate(d, date)[1]
350411
def get_supported_types():
    
    from datetime import date, timedelta
    editable_types = [int, float, complex, list, set, dict, tuple, date,
                      timedelta] + list(TEXT_TYPES) + list(INT_TYPES)
    try:
        from numpy import ndarray, matrix, generic
        editable_types += [ndarray, matrix, generic]
    except:
        pass
    try:
        from pandas import DataFrame, Series, DatetimeIndex
        editable_types += [DataFrame, Series, Index]
    except:
        pass
    picklable_types = editable_types[:]
    try:
        from spyder.pil_patch import Image
        editable_types.append(Image.Image)
    except:
        pass
    return dict(picklable=picklable_types, editable=editable_types)
686756
def getDateFields(fc):
    
    if arcpyFound == False:
        raise Exception("ArcPy is required to use this function")
    return [field.name for field in arcpy.ListFields(fc, field_type="Date")]
210891
def _validate_type_scalar(self, value):
        
        if isinstance(
            value, _int_types + (_str_type, float, date, datetime, bool)
        ):
            return True
727221
def validate_iso_date key, value, opts
      if opts[:iso_date]
        return value.strftime("%Y-%m-%d")  if value.respond_to?(:strftime)
      end
      value
    end
1286053
def convert_type(self, type):
        

        # Mapping
        mapping = {
            'any': 'STRING',
            'array': None,
            'boolean': 'BOOLEAN',
            'date': 'DATE',
            'datetime': 'DATETIME',
            'duration': None,
            'geojson': None,
            'geopoint': None,
            'integer': 'INTEGER',
            'number': 'FLOAT',
            'object': None,
            'string': 'STRING',
            'time': 'TIME',
            'year': 'INTEGER',
            'yearmonth': None,
        }

        # Not supported type
        if type not in mapping:
            message = 'Type %s is not supported' % type
            raise tableschema.exceptions.StorageError(message)

        return mapping[type]
520872
def get_checks(self):
        """"""
        return [
            self.is_date,
            self.is_datetime,
            self.is_integer,
            self.is_float,
            self.default]
1264173
def _validate_parse_dates_arg(parse_dates):
    
    msg = ("Only booleans, lists, and "
           "dictionaries are accepted "
           "for the 'parse_dates' parameter")

    if parse_dates is not None:
        if is_scalar(parse_dates):
            if not lib.is_bool(parse_dates):
                raise TypeError(msg)

        elif not isinstance(parse_dates, (list, dict)):
            raise TypeError(msg)

    return parse_dates
878436
def _get_rel_of_type(self, reltype):
        
        matching = [rel for rel in self.values() if rel.reltype == reltype]
        if len(matching) == 0:
            tmpl = "no relationship of type '%s' in collection"
            raise KeyError(tmpl % reltype)
        if len(matching) > 1:
            tmpl = "multiple relationships of type '%s' in collection"
            raise ValueError(tmpl % reltype)
        return matching[0]
93327
def _get_date_type(date):
        
        if isinstance(date, str):
            return 'str'

        if isinstance(date, datetime.date):
            return 'date'

        if isinstance(date, int):
            return 'int'

        raise ValueError('Unexpected type {0!s}'.format(date.__class__))
1009700
def _calc_keys(self, config, name, timestamp):
    '''
    
    '''
    i_bucket = config['i_calc'].to_bucket( timestamp )
    r_bucket = config['r_calc'].to_bucket( timestamp )

    i_key = '%s%s:%s:%s'%(self._prefix, name, config['interval'], i_bucket)
    r_key = '%s:%s'%(i_key, r_bucket)

    return i_bucket, r_bucket, i_key, r_key
210960
def QA_util_id2date(idx, client):
    
    coll = client.quantaxis.trade_date
    temp_str = coll.find_one({'num': idx})
    return temp_str['date']
633456
def _get_time(header, keys, name):
        
        for key in keys:
            try:
                date_value = header.pop(key)
            except KeyError:
                continue
            try:
                # String to convert
                return to_timestamp(parse(date_value))
            except TypeError:
                # Already number
                return float(date_value)
        raise UnsupportedOperation(name)
7739
def get_validated_attribute_type_info(typ, item_type, attr_name):
    
    if (typ is None) or (typ is Parameter.empty):
        raise TypeInformationRequiredError.create_for_object_attributes(item_type, attr_name, typ)

    # resolve forward references
    typ = resolve_forward_ref(typ)

    if not is_valid_pep484_type_hint(typ):
        raise InvalidPEP484TypeHint.create_for_object_attributes(item_type, attr_name, typ)

    return typ
1099329
def typevalue(self, key, value):
        

        def listconvert(value):
            # this function might be called with both string
            # represenations of entire lists and simple (unquoted)
            # strings. String representations come in two flavours,
            # the (legacy/deprecated) python literal (eg "['foo',
            # 'bar']") and the simple (eg "foo, bar") The
            # ast.literal_eval handles the first case, and if the
            # value can't be parsed as a python expression, the second
            # way is attempted. If both fail, it is returned verbatim
            # (not wrapped in a list, for reasons)
            try:
                return ast.literal_eval(value)
            except (SyntaxError, ValueError):
                if "," in value:
                    return [x.strip() for x in value.split(",")]
                else:
                    return value

        # self.get(key) should never fail
        default = self.get(key)
        # if type(default) == type:
        if inspect.isclass(default):
            # print("Using class for %s" % key)
            t = default
        else:
            # print("Using instance for %s" % key)
            t = type(default)

        if t == bool:
            t = LayeredConfig.boolconvert
        elif t == list:
            t = listconvert
        elif t == date:
            t = LayeredConfig.dateconvert
        elif t == datetime:
            t = LayeredConfig.datetimeconvert
        # print("Converting %r to %r" % (value,t(value)))
        return t(value)
410955
def supported_cache_type(types):
    
    if isinstance(types, str):
        types = [typ.strip() for typ in types.split(",")]
    for typ in types:
        if typ not in ["reflink", "hardlink", "symlink", "copy"]:
            return False
    return True
335152
def is_sqlatype_date(coltype: TypeEngine) -> bool:
    
    coltype = _coltype_to_typeengine(coltype)
    # No longer valid in SQLAlchemy 1.2.11:
    # return isinstance(coltype, sqltypes._DateAffinity)
    return (
        isinstance(coltype, sqltypes.DateTime) or
        isinstance(coltype, sqltypes.Date)
    )