def merge_paths(base_uri, relative_path):
 if ((base_uri.path is None) and (base_uri.authority is not None)):
  return ('/' + relative_path)
 else:
  path = (base_uri.path or '')
  index = path.rfind('/')
  return ((path[:index] + '/') + relative_path)

def merge_paths ( base_uri , relative_path ) : if ( ( base_uri . path is None ) and ( base_uri . authority is not None ) ) : return ( '/' + relative_path ) else : path = ( base_uri . path or '' ) index = path . rfind ( '/' ) return ( ( path [ : index ] + '/' ) + relative_path )
merge a base uris path with a relative uris path .