def _oid_valid_format(oid):
    """Determine whether the format of the oid is correct.

    Args:
        oid: OID string

    Returns:
        True if valid

    """
    # oid cannot be numeric
    if isinstance(oid, str) is False:
        return False

    # Make sure the oid is not blank
    stripped_oid = oid.strip()
    if not stripped_oid:
        return False

    # Must start with a '.'
    if oid[0] != '.':
        return False

    # Must not end with a '.'
    if oid[-1] == '.':
        return False

    # Test each octet to be numeric
    octets = oid.split('.')

    # Remove the first element of the list
    octets.pop(0)
    for value in octets:
        try:
            int(value)
        except:
            return False

    # Otherwise valid
    return True