<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def process_subj_or_pred(self, component: Union[URIRef, str]) -> URIRef: """ Adds viable uri from iri or expands viable qname to iri to be triple ready Need to have a viable qualified name (qname) in order to use a qname. You can make it viable by either add the namespace beforehand with add_namespace(s) or if its already in the local common_namespaces preloaded. Args: component: entity subject or predicate to be expanded or have its uri saved. Returns: rdflib URIRef ready subject or predicate to be put into a triple. Raises: SystemExit: When expecting a qname to be expanded, but is not valid or if component is not a qualified name or a iri. """

        if 'http' in component:
            prefix = self.find_prefix(component) # Find uri in iri based on common_namespaces
            if prefix: self.process_prefix(prefix) # if match, will add to Graph namespaces
            return URIRef(component)
        elif ':' in component:
            presumed_prefix, info = component.split(':', 1)
            namespace: Union[Namespace, None] = self.process_prefix(presumed_prefix)
            if not namespace: exit(component + ': qname namespace does\'t exist yet.')
            return namespace[info]
        exit(component + ': is not a valid subject or predicate')