Did I find the right examples for you? yes no

All Samples(48)  |  Call(48)  |  Derive(0)  |  Import(0)
Returns True if the value is a common unknown indicator:
''        is True
' '       is True
'na'      is True
'NA'      is True
'n/a'     is True
'N/A'     is True
'unk'     is True
'unknown' is True
'3'       is False(more...)

        def is_unknown(value):
    """ Returns True if the value is a common unknown indicator:
        ''        is True
        ' '       is True
        'na'      is True
        'NA'      is True
        'n/a'     is True
        'N/A'     is True
        'unk'     is True
        'unknown' is True
        '3'       is False
        '-3'      is False
        '33.22'   is False
        '4,333'   is False
        '$3'      is False
        'b'       is False
        3         is False
        3.3       is False
        None      is False
        Test coverage:
          - complete, via test harness
    """
    unk_vals = ['na', 'n/a', 'unk', 'unknown', '']
    try:
        if value.strip().lower() in unk_vals:
            return True
        else:
            return False
    except AttributeError:
        return False
    except TypeError:
        return False
        


src/d/a/datagristle-0.56/gristle/field_misc.py   datagristle(Download)
    # count occurances of each case field_type in values:
    for key in values:
        if typer.is_unknown(key):
            freq['unk']    += 1
        elif typer.is_integer(key):     # will be ignoring these
    known_vals = []
    for val in values:
        if not typer.is_unknown(val):
            try:
                if value_type == 'integer':
    known_vals = []
    for val in values:
        if not typer.is_unknown(val):
            try:
                if value_type == 'integer':
 
    for value in values:
        if not typer.is_unknown(value):
            if len(value) > max_length:
                max_length = len(value)
 
    for value in values:
        if not typer.is_unknown(value):
            if len(value) < min_length:
                min_length = len(value)

src/d/a/DataGristle-HEAD/gristle/field_misc.py   DataGristle(Download)
    # count occurances of each case field_type in values:
    for key in values:
        if typer.is_unknown(key):
            freq['unk']    += 1
        elif typer.is_integer(key):     # will be ignoring these
    known_vals = []
    for val in values:
        if not typer.is_unknown(val):
            try:
                if value_type == 'integer':
    known_vals = []
    for val in values:
        if not typer.is_unknown(val):
            try:
                if value_type == 'integer':
 
    for value in values:
        if not typer.is_unknown(value):
            if len(value) > max_length:
                max_length = len(value)
 
    for value in values:
        if not typer.is_unknown(value):
            if len(value) < min_length:
                min_length = len(value)

src/d/a/datagristle-0.56/gristle/field_determinator.py   datagristle(Download)
 
        return [val for val in self.field_freqs[fieldno]
                if typer.is_unknown(val) is False]
 
 

src/d/a/DataGristle-HEAD/gristle/field_determinator.py   DataGristle(Download)
 
        return [val for val in self.field_freqs[fieldno]
                if typer.is_unknown(val) is False]
 
 

src/d/a/datagristle-0.56/gristle/field_math.py   datagristle(Download)
    count   = 0
    for value in values:
        if not field_type.is_unknown(value):
            try:
                accum += len(value) * int(values[value])

src/d/a/DataGristle-HEAD/gristle/field_math.py   DataGristle(Download)
    count   = 0
    for value in values:
        if not field_type.is_unknown(value):
            try:
                accum += len(value) * int(values[value])

src/d/a/datagristle-0.56/gristle/tests/test_field_type.py   datagristle(Download)
    def test_is_unknown_basics(self):
        assert mod.is_unknown('')
        assert mod.is_unknown(' ')
        assert mod.is_unknown('na')
        assert mod.is_unknown('NA')
        assert mod.is_unknown('n/a')

src/d/a/DataGristle-HEAD/gristle/tests/test_field_type.py   DataGristle(Download)
    def test_is_unknown_basics(self):
        assert mod.is_unknown('')
        assert mod.is_unknown(' ')
        assert mod.is_unknown('na')
        assert mod.is_unknown('NA')
        assert mod.is_unknown('n/a')