def remove_port_from_tool_shed_url(tool_shed_url):
 try:
  if (tool_shed_url.find(':') > 0):
   new_tool_shed_url = tool_shed_url.split(':')[0]
  else:
   new_tool_shed_url = tool_shed_url
  return new_tool_shed_url.rstrip('/')
 except Exception as e:
  if (tool_shed_url is not None):
   log.exception('Handled exception removing the port from Tool Shed URL %s:\n%s', str(tool_shed_url), e)
  return tool_shed_url

def remove_port_from_tool_shed_url ( tool_shed_url ) : try : if ( tool_shed_url . find ( ':' ) > 0 ) : new_tool_shed_url = tool_shed_url . split ( ':' ) [ 0 ] else : new_tool_shed_url = tool_shed_url return new_tool_shed_url . rstrip ( '/' ) except Exception as e : if ( tool_shed_url is not None ) : log . exception ( 'Handled exception removing the port from Tool Shed URL %s:\n%s' , str ( tool_shed_url ) , e ) return tool_shed_url
return a partial tool shed url .