def _key2ref(self, key):
        """The keys of a Repository are also references to the head commit
        for that key.  This translates keys to the appropriate path (in
        /refs/heads/jsongit/).

        :raises: :class:`InvalidKeyError`
        """
        if not isinstance(key, basestring):
            raise InvalidKeyError("%s must be a string to be a key." % key)
        elif key[-1] == '.' or key[-1] == '/' or key[0] == '/' or key[0] == '.':
            raise InvalidKeyError("Key '%s' should not start or end in . or /" % key)
        else:
            return 'refs/heads/jsongit/%s' % key
dataset/ETHPy150Open talos/jsongit/jsongit/models.py/Repository._key2ref/original