def implete_none(lst):
    'Replace the None elemnets at the beginning and the end of list by auto\n    increment integers.\n    \n    Convert the first and last few `None` elements to auto increment integers.\n    These integers are determined by the first and last integers in the input\n    array.\n    While the `None` elements between two integers in the input list will\n    remain.\n\n    Args:\n        lst (list): A list contaning None values.\n    Returns:\n        newlst (list): A list containing auto increment integers.\n\t\n    Examples:\n        .. code-block:: python\n\n            >>> a = [None,None,3,4,None,5,6,None,None]\n            >>> implete_none(a)\n            [1, 2, 3, 4, None, 5, 6, 7, 8]\n\n    '
    notnone_lst = [v for v in lst if (v is not None)]
    for (i, v) in enumerate(lst):
        if (v == notnone_lst[0]):
            notnone1 = i
            value1 = v
        if (v == notnone_lst[(- 1)]):
            notnone2 = i
            value2 = v
    newlst = []
    for (i, v) in enumerate(lst):
        if (i < notnone1):
            newlst.append((value1 - (notnone1 - i)))
        elif (i > notnone2):
            newlst.append((value2 + (i - notnone2)))
        else:
            newlst.append(v)
    return newlst
Replace the None elemnets at the beginning and the end of list by auto
increment integers.

Convert the first and last few `None` elements to auto increment integers.
These integers are determined by the first and last integers in the input
array.
While the `None` elements between two integers in the input list will
remain.

Args:
    lst (list): A list contaning None values.
Returns:
    newlst (list): A list containing auto increment integers.
    
Examples:
    .. code-block:: python

        >>> a = [None,None,3,4,None,5,6,None,None]
        >>> implete_none(a)
        [1, 2, 3, 4, None, 5, 6, 7, 8]
def implete_none(lst):
    'Replace the None elemnets at the beginning and the end of list by auto\n    increment integers.\n    \n    Convert the first and last few `None` elements to auto increment integers.\n    These integers are determined by the first and last integers in the input\n    array.\n    While the `None` elements between two integers in the input list will\n    remain.\n\n    Args:\n        lst (list): A list contaning None values.\n    Returns:\n        newlst (list): A list containing auto increment integers.\n\t\n    Examples:\n        .. code-block:: python\n\n            >>> a = [None,None,3,4,None,5,6,None,None]\n            >>> implete_none(a)\n            [1, 2, 3, 4, None, 5, 6, 7, 8]\n\n    '
    notnone_lst = [v for v in lst if (v is not None)]
    for (i, v) in enumerate(lst):
        if (v == notnone_lst[0]):
            notnone1 = i
            value1 = v
        if (v == notnone_lst[(- 1)]):
            notnone2 = i
            value2 = v
    newlst = []
    for (i, v) in enumerate(lst):
        if (i < notnone1):
            newlst.append((value1 - (notnone1 - i)))
        elif (i > notnone2):
            newlst.append((value2 + (i - notnone2)))
        else:
            newlst.append(v)
    return newlst