def get_tool_shed_url_from_tool_shed_registry(app, tool_shed):
 cleaned_tool_shed = remove_protocol_from_tool_shed_url(tool_shed)
 for shed_url in app.tool_shed_registry.tool_sheds.values():
  if (shed_url.find(cleaned_tool_shed) >= 0):
   if shed_url.endswith('/'):
    shed_url = shed_url.rstrip('/')
   return shed_url
 return None

def get_tool_shed_url_from_tool_shed_registry ( app , tool_shed ) : cleaned_tool_shed = remove_protocol_from_tool_shed_url ( tool_shed ) for shed_url in app . tool_shed_registry . tool_sheds . values ( ) : if ( shed_url . find ( cleaned_tool_shed ) >= 0 ) : if shed_url . endswith ( '/' ) : shed_url = shed_url . rstrip ( '/' ) return shed_url return None
the value of tool_shed is something like: toolshed .