code: def sort_uri_list_by_name(uri_list, bypassNamespace=False):
      def get_last_bit(uri_string):
          try:
              x = uri_string.split("
          except:
              x = uri_string.split("/")[-1]
          return x
      try:
          if bypassNamespace:
              return sorted(uri_list, key=lambda x: get_last_bit(x.__str__()))
          else:
              return sorted(uri_list)
      except:
          print(
              "Error in <sort_uri_list_by_name>: possibly a UnicodeEncodeError")
          return uri_list