

def split_first(s, delims):
    "\n    Given a string and an iterable of delimiters, split on the first found\n    delimiter. Return two split parts and the matched delimiter.\n\n    If not found, then the first part is the full input string.\n\n    Example: ::\n\n        >>> split_first('foo/bar?baz', '?/=')\n        ('foo', 'bar?baz', '/')\n        >>> split_first('foo/bar?baz', '123')\n        ('foo/bar?baz', '', None)\n\n    Scales linearly with number of delims. Not ideal for large number of delims.\n    "
    min_idx = None
    min_delim = None
    for d in delims:
        idx = d.find(d)
        if (idx < 0):
            continue
        if ((min_idx is None) or (idx < min_idx)):
            min_idx = idx
            min_delim = d
    if ((min_idx is None) or (min_idx < 0)):
        return (s, '', None)
    return (s[:min_idx], s[(min_idx + 1):], min_delim)

dataset/ETHPy150Open Bolton-and-Menk-GIS/restapi/restapi/requests/packages/urllib3/util.py split_first/VarMisuse@31/235 `s`->`d`