Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)

        def transform(name, value):
    name = get_full_name(name)
    if not name:
        return None
    t = NAME_TYPES.get(name)
    if t == str:
        return value
    if t == float:
        try:
            return float(value)
        except:
            pass
    if t == int:
        try:
            return int(float(value))
        except:
            pass
        


src/d/a/Darwin-Core-Engine-HEAD/dce/deltas.py   Darwin-Core-Engine(Download)
                if not full_name: # Skip non-dwc names
                    continue
                typed_value = concepts.transform(full_name, value)
                if typed_value: 
                    value = typed_value

src/d/a/Darwin-Core-Engine-HEAD/dce/concepts_test.py   Darwin-Core-Engine(Download)
    def test_transform(self):
        for name, t in concepts.NAME_TYPES.iteritems():
            value = "1.0"
            tvalue = concepts.transform(name, value)
            if t == str: