Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)

        def conjunction_uri(*sources):
    """
    Make a URI representing a conjunction of sources that work together to provide
    an assertion. The sources will be sorted in lexicographic order.

    >>> conjunction_uri('/s/contributor/omcs/dev')
    '/s/contributor/omcs/dev'
    
    >>> conjunction_uri('/s/rule/some_kind_of_parser', '/s/contributor/omcs/dev')
    '/and/[/s/contributor/omcs/dev/,/s/rule/some_kind_of_parser/]'
    """
    if len(sources) == 0:
        # Logically, a conjunction with 0 inputs represents 'True', a
        # proposition that cannot be denied. This could be useful as a
        # justification for, say, mathematical axioms, but when it comes to
        # ConceptNet, that kind of thing makes us uncomfortable and shouldn't
        # appear in the data.
        raise ValueError("Conjunctions of 0 things are not allowed")
    elif len(sources) == 1:
        return sources[0]
    else:
        return compound_uri('/and', sorted(set(sources)))
        


src/c/o/ConceptNet-5.2.2/conceptnet5/edges.py   ConceptNet(Download)
from __future__ import unicode_literals
from hashlib import sha1
from conceptnet5.uri import (conjunction_uri, assertion_uri, Licenses,
                             parse_possible_compound_uri)
from pprint import pprint
    uri = assertion_uri(rel, start, end)
    if isinstance(sources, list):
        source_tree = conjunction_uri(*sources)
        source_list = sources
    else:

src/c/o/conceptnet5-HEAD/conceptnet5/edges.py   conceptnet5(Download)
from __future__ import unicode_literals
from hashlib import sha1
from conceptnet5.uri import (conjunction_uri, assertion_uri, Licenses,
                             parse_possible_compound_uri)
from pprint import pprint
    uri = assertion_uri(rel, start, end)
    if isinstance(sources, list):
        source_tree = conjunction_uri(*sources)
        source_list = sources
    else: