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

def _resolve_prefix(celt, prefix):
    '''resolve prefix to a namespaceURI.  If None or 
    empty str, return default namespace or None.

    Parameters:
      celt -- element node
      prefix -- xmlns:prefix, or empty str or None
    '''
    namespace = None
    while _is_element(celt):
        if prefix:
            namespaceURI = _find_xmlns_prefix(celt, prefix)
        else:
            namespaceURI = _find_default_namespace(celt)
        if namespaceURI: break
        celt = celt.parentNode
    else:
        if prefix:  
            raise EvaluateException, 'cant resolve xmlns:%s' %prefix
    return namespaceURI