def clean_tool_shed_url( tool_shed_url ):
    """Return a tool shed URL, eliminating the port if it exists."""
    if tool_shed_url.find( ':' ) > 0:
        # Eliminate the port, if any, since it will result in an invalid directory name.
        return tool_shed_url.split( ':' )[ 0 ]
    return tool_shed_url.rstrip( '/' )