def try_number(value):

    for cast_function in [int, float]:
        try:
            return cast_function(value)
        except ValueError:
            pass

    raise ValueError("Unable to use value as int or float: {0!r}"
                     .format(value))
Method to get active 'before_storage_plugins' plugins for Doccode Plugin Mapping instance
dataset/ETHPy150Open alphagov/performanceplatform-collector/performanceplatform/collector/ga/core.py/try_number--crossover with--dataset/ETHPy150Open adlibre/Adlibre-DMS/adlibre_dms/apps/dms_plugins/models.py/DoccodePluginMapping.get_before_storage_plugins