/usr/lib/python2.7/dist-packages/rdflib/Variable.py is in python-rdflib 2.4.2-3build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | from rdflib.Identifier import Identifier
try:
from hashlib import md5
except ImportError:
from md5 import md5
class Variable(Identifier):
"""
"""
__slots__ = ()
def __new__(cls, value):
if value[0]=='?':
value=value[1:]
return unicode.__new__(cls, value)
def __repr__(self):
return self.n3()
def n3(self):
return "?%s" % self
def __reduce__(self):
return (Variable, (unicode(self),))
def md5_term_hash(self):
d = md5(str(self))
d.update("V")
return d.hexdigest()
|