code: def replace_subject(rdf, fromuri, touri):
      
      if fromuri == touri:
          return
      for p, o in rdf.predicate_objects(fromuri):
          rdf.remove((fromuri, p, o))
          if touri is not None:
              if not isinstance(touri, (list, tuple)):
                  touri = [touri]
              for uri in touri:
                  rdf.add((uri, p, o))
docs: Replace occurrences of fromuri as subject with touri in given model.
  
      If touri=None, will delete all occurrences of fromuri instead.
      If touri is a list or tuple of URIRefs, all values will be inserted.