def METHOD_NAME(uri, namespaces):
    """Convert URI to CURIE
    Define namespaces we want to use:
    >>> nss = dict(dc='http://purl.org/dc/elements/1.1/')
    Converting a string URI to CURIE
    >>> uri2curie('http://purl.org/dc/elements/1.1/title', nss)
    u'dc:title'
    RDFLib data type conversions:
    URIRef to CURIE
    >>> uri2curie(URIRef('http://purl.org/dc/elements/1.1/title'), nss)
    u'dc:title'
    Blank node to CURIE
    >>> uri2curie(BNode('blanknode1'), nss)
    u'_:blanknode1'
    """
    # Use n3() method if BNode
    if isinstance(uri, BNode):
        result = uri.n3()
    else:
        result = uri
    #  result = unicode(uri)
    for ns in namespaces:
        ns_raw = "%s" % namespaces["%s" % ns]
        if ns_raw == "http://www.w3.org/2002/07/owl#uri":
            ns_raw = "http://www.w3.org/2002/07/owl#"
        result = result.replace(ns_raw, "%s:" % ns)
    result = result.replace("http://www.w3.org/2002/07/owl#", "owl:")
    return result