<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def register(self, uri, prefix):
        '''Registers the given URI and associates it with the given prefix.

        If the URI has already been registered, this is a no-op.

        :param uri: string
        :param prefix: string
        '''
        if not is_valid_schema_uri(uri):
            raise KeyError(
                'cannot register invalid URI {} (prefix {})'.format(
                    uri, prefix))
        if not is_valid_prefix(prefix):
            raise ValueError(
                'cannot register invalid prefix %q for URI %q'.format(
                    prefix, uri))
        if self._uri_to_prefix.get(uri) is None:
            self._uri_to_prefix[uri] = prefix