parameters: (idx, length, is_start=True)
return_statement: return idx
docstring: Parameters
      ----------
      idx : int or None
          the index
      length : int
          the string length
      is_start : bool; optional with defaults to True
          Is it the *start* or the *stop* of the slice?
  
      Returns
      -------
      norm_idx : int
          normalized index
docstring_summary: Parameters
      ----------
      idx : int or None
          the index
      length : int
          the string length
      is_start : bool; optional with defaults to True
          Is it the *start* or the *stop* of the slice?
docstring_tokens: Parameters ---------- idx : int or None the index length : int the string length is_start : bool ; optional with defaults to True Is it the * start * or the * stop * of the slice?
function: def normalize_str_idx(idx, length, is_start=True):
      """
      Parameters
      ----------
      idx : int or None
          the index
      length : int
          the string length
      is_start : bool; optional with defaults to True
          Is it the *start* or the *stop* of the slice?
  
      Returns
      -------
      norm_idx : int
          normalized index
      """
      if idx is None:
          if is_start:
              return 0
          else:
              return length
      elif idx < 0:
          idx += length
  
      if idx < 0 or idx >= length:
          raise IndexError("string index out of range")
  
      return idx
function_tokens: def normalize_str_idx ( idx , length , is_start = True ) : if idx is None : if is_start : return 0 else : return length elif idx < 0 : idx += length if idx < 0 or idx >= length : raise IndexError ( "string index out of range" ) return idx