parameters: (p, sep, altsep, extsep)
return_statement: return p, ''
docstring: Split the extension from a pathname.
  
      Extension is everything from the last dot to the end, ignoring
      leading dots.  Returns "(root, ext)"; ext may be empty.
docstring_summary: Split the extension from a pathname.
docstring_tokens: Split the extension from a pathname .
function: def _splitext(p, sep, altsep, extsep):
      """Split the extension from a pathname.
  
      Extension is everything from the last dot to the end, ignoring
      leading dots.  Returns "(root, ext)"; ext may be empty."""
  
      sepIndex = p.rfind(sep)
      if altsep:
          altsepIndex = p.rfind(altsep)
          sepIndex = max(sepIndex, altsepIndex)
  
      dotIndex = p.rfind(extsep)
      if dotIndex > sepIndex:
          # skip all leading dots
          filenameIndex = sepIndex + 1
          while filenameIndex < dotIndex:
              if p[filenameIndex] != extsep:
                  return p[:dotIndex], p[dotIndex:]
              filenameIndex += 1
  
      return p, ''
function_tokens: def _splitext ( p , sep , altsep , extsep ) : sepIndex = p . rfind ( sep ) if altsep : altsepIndex = p . rfind ( altsep ) sepIndex = max ( sepIndex , altsepIndex ) dotIndex = p . rfind ( extsep ) if dotIndex > sepIndex : # skip all leading dots filenameIndex = sepIndex + 1 while filenameIndex < dotIndex : if p [ filenameIndex ] != extsep : return p [ : dotIndex ] , p [ dotIndex : ] filenameIndex += 1 return p , ''