(mib, symbol)
return ParsedSymbol(name=name, oid=oid, extract_value_pattern=extract_value_pattern, oids_to_resolve={name: oid})
Parse an OID symbol.

    This can either be the unresolved name of a symbol:

    ```
    symbol: ifNumber
    ```

    Or a resolved OID/name object:

    ```
    symbol:
        OID: 1.3.6.1.2.1.2.1
        name: ifNumber
    ```
Parse an OID symbol.
Parse an OID symbol .
def _parse_symbol(mib, symbol):
    # type: (str, Union[str, Symbol]) -> ParsedSymbol
    """
    Parse an OID symbol.

    This can either be the unresolved name of a symbol:

    ```
    symbol: ifNumber
    ```

    Or a resolved OID/name object:

    ```
    symbol:
        OID: 1.3.6.1.2.1.2.1
        name: ifNumber
    ```
    """
    if isinstance(symbol, str):
        oid = OID(ObjectIdentity(mib, symbol))
        return ParsedSymbol(name=symbol, oid=oid, extract_value_pattern=None, oids_to_resolve={})

    oid = OID(symbol['OID'])
    name = symbol['name']

    extract_value = symbol.get('extract_value')
    extract_value_pattern = None
    if extract_value:
        try:
            extract_value_pattern = re.compile(extract_value)
        except re.error as exc:
            raise ConfigurationError('Failed to compile regular expression {!r}: {}'.format(extract_value, exc))

    return ParsedSymbol(name=name, oid=oid, extract_value_pattern=extract_value_pattern, oids_to_resolve={name: oid})
def _parse_symbol ( mib , symbol ) : # type: (str, Union[str, Symbol]) -> ParsedSymbol if isinstance ( symbol , str ) : oid = OID ( ObjectIdentity ( mib , symbol ) ) return ParsedSymbol ( name = symbol , oid = oid , extract_value_pattern = None , oids_to_resolve = { } ) oid = OID ( symbol [ 'OID' ] ) name = symbol [ 'name' ] extract_value = symbol . get ( 'extract_value' ) extract_value_pattern = None if extract_value : try : extract_value_pattern = re . compile ( extract_value ) except re . error as exc : raise ConfigurationError ( 'Failed to compile regular expression {!r}: {}' . format ( extract_value , exc ) ) return ParsedSymbol ( name = name , oid = oid , extract_value_pattern = extract_value_pattern , oids_to_resolve = { name : oid } )