def URLify(s, num_chars=None):

    ret = _RE_REMOVE.sub('', s)
    ret = _RE_UNNEEDED.sub('', s)
    ret = ret.strip().replace(' ', '-').lower()

    if num_chars is not None:
        ret = ret[:num_chars]

    # remove duplicate '-'
    while '--' in ret: ret = ret.replace('--', '-')

    return ret
# URLify
Return a component graph based on
dataset/ETHPy150Open dokterbob/satchmo/satchmo/apps/satchmo_utils/thumbnail/text.py/URLify--crossover with--dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/depgraph.py/CollapsedGraph.component_graph