Did I find the right examples for you? yes no

All Samples(22)  |  Call(22)  |  Derive(0)  |  Import(0)
accepts a single string value and returns its potential type

Types identified (and returned) include:
  - unknown
  - string
  - number
  - integer
  - float
  - timestamp
(more...)

        def _get_type(value):
    """ accepts a single string value and returns its potential type

        Types identified (and returned) include:
          - unknown
          - string
          - number
          - integer
          - float
          - timestamp

        Test Coverage:
          - complete via test harness
    """
    dtc_status, dummy, dummy  = is_timestamp(value)
    if dtc_status:
        return 'timestamp'
    elif is_unknown(value):
        return 'unknown'
    elif is_float(value):
        return 'float'
    elif is_integer(value):
        return 'integer'
    elif is_string(value):
        return 'string'
    else:
        return 'string'
        


src/d/a/datagristle-0.56/gristle/tests/test_field_type.py   datagristle(Download)
    def test_get_type_basics(self):
        assert mod._get_type('n/a')  == 'unknown'
        assert mod._get_type('UNK')  == 'unknown'
        assert mod._get_type('unk')  == 'unknown'
        assert mod._get_type(' ')    == 'unknown'
        assert mod._get_type('')     == 'unknown'

src/d/a/DataGristle-HEAD/gristle/tests/test_field_type.py   DataGristle(Download)
    def test_get_type_basics(self):
        assert mod._get_type('n/a')  == 'unknown'
        assert mod._get_type('UNK')  == 'unknown'
        assert mod._get_type('unk')  == 'unknown'
        assert mod._get_type(' ')    == 'unknown'
        assert mod._get_type('')     == 'unknown'