'Find a definition location using Rope'

def get_definition(self, info):

    if (self.project is None):
        return
    filename = info['filename']
    source_code = info['source_code']
    offset = info['position']
    if PY2:
        filename = filename.encode('utf-8')
    else:
        pass
    try:
        resource = rope.base.libutils.path_to_resource(self.project, filename)
    except Exception as _error:
        if DEBUG_EDITOR:
            log_last_error(LOG_FILENAME, ('path_to_resource:    %r' % filename))
        resource = None
    try:
        if DEBUG_EDITOR:
            t0 = time.time()
        (resource, lineno) = rope.contrib.codeassist.get_definition_location(self.project, source_code, offset, resource, maxfixes=3)
        if DEBUG_EDITOR:
            log_dt(LOG_FILENAME, 'get_definition_location', t0)
        if (resource is not None):
            filename = resource.real_path
        if (filename and lineno):
            return (filename, lineno)
    except Exception as _error:
        if DEBUG_EDITOR:
            log_last_error(LOG_FILENAME, 'get_definition_location')
