def slugify_string(in_str):
    
    # Collapse all white space and to a single hyphen
    slug = re.sub('\\s+', '-', in_str)
    
    # Remove all instances of camel-case text and convert to hyphens. Remove leading and trailing hyphen.
    slug = re.sub('(((?<=[a-z])[A-Z])|([A-Z](?![A-Z]|$)))', '-\\1', slug).lower().strip('-')
    
    # Collapse any duplicate hyphens
    slug = re.sub('-+', '-', slug)
          
    return slug;
Turns a string into a slug.
dataset/ETHPy150Open opencolorado/OpenColorado-Tools-and-Utilities/Scripts/ArcGIS/10.0/Python/PublishOpenDataset.py/slugify_string