def recurseMayaScriptPath(roots=[], verbose=False, excludeRegex=None, errors='warn', prepend=False):

    regex = '[.]|(obsolete)'

    if excludeRegex:
        assert isinstance(excludeRegex, basestring), "please pass a regular expression as a string"
        regex = regex + '|' + excludeRegex

    includeRegex =  "(?!(" + regex + "))" # add a negative lookahead assertion




    scriptPath = os.environ["MAYA_SCRIPT_PATH"]
    varList = scriptPath.split(os.path.pathsep)
    initalLen = len(varList)

    def addDir(toAdd):
        if toAdd not in varList:
            if prepend:
                _logger.debug("Prepending script path directory %s" % toAdd)
                varList.insert(0, toAdd)
            else:
                _logger.debug("Appending script path directory %s" % toAdd)
                varList.append(toAdd)

    if roots:
        if isinstance( roots, list) or isinstance( roots, tuple):
            rootVars = list(roots)
        else:
            rootVars = [roots]
        # Roots are always added to the script path, even if they don't have
        # .mel files
        for d in rootVars:
            addDir(d)
    ##  else expand the whole  environment  currently set
    else:
        rootVars = varList[:]



    _logger.debug("Recursing Maya script path")
    _logger.debug( "Only directories which match %s will be traversed" % includeRegex )
    for rootVar in rootVars:
        root = _path( rootVar )
        if re.match( includeRegex, root.name ) and root.exists():
            _logger.debug( "Searching for all valid script directories below %s" % rootVar )
            for f in root.walkdirs( errors=errors, regex=includeRegex ):
                try:
                    if len(f.files("*.mel")):
                        addDir(str(f))
                except OSError: pass

    if len(varList) > initalLen:
        os.environ["MAYA_SCRIPT_PATH"] = os.path.pathsep.join( varList )
        _logger.info("Added %d directories to Maya script path" % (len(varList) - initalLen) )
    else:
        _logger.info("Maya script path recursion did not find any paths to add")
Set the base URL to be retrieved.
dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.5/pymel/mayautils.py/recurseMayaScriptPath--crossover with--dataset/ETHPy150Open cloudaice/simple-data/misc/virtenv/lib/python2.7/site-packages/curl/__init__.py/Curl.set_url