<commit_before>##
## Author(s):
##  - <NAME> <<EMAIL>>
##  - <NAME> <<EMAIL>>
##
## Copyright (C) 2010, 2011 Aldebaran Robotics
##

""" QiMessaging Python bindings

Provided features are very close to C++, Python style.
"""<commit_msg>fix using qimessaging from a relocatable python SDK<commit_after>##
## Author(s):
##  - <NAME> <<EMAIL>>
##  - <NAME> <<EMAIL>>
##
## Copyright (C) 2010, 2011 Aldebaran Robotics
##

""" QiMessaging Python bindings

Provided features are very close to C++, Python style.
"""

import os
import sys
import ctypes

def load_libqimessaging():
    """ Load qimessaging.so and its dependencies.

    This makes qimessaging usable from a relocatable
    SDK without having to set LD_LIBRARY_PATH
    """
    deps = [
            "libqi.so",
            "libqitype.so",
            "libqimessaging.so",
    ]
    this_dir = os.path.abspath(os.path.dirname(__file__))
    for dep in deps:
        full_path = os.path.join(this_dir, "..", dep)
        ctypes.cdll.LoadLibrary(full_path)


if sys.platform.startswith("linux"):
    try:
        load_libqimessaging()
    except Exception, e:
        print e
{'fraction_non_alphanumeric': 0.13906111603188662, 'fraction_numerical': 0.0141718334809566, 'mean_word_length': 3.109090909090909, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1982446', 'n_tokens_mistral': 414, 'n_tokens_neox': 382, 'n_words': 104}