<commit_before>--- Python-2.7.2.orig/Python/dynload_shlib.c	2010-05-09 16:46:46.000000000 +0200
+++ Python-2.7.2/Python/dynload_shlib.c	2011-04-20 17:52:12.000000000 +0200
@@ -6,6 +6,7 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <stdlib.h>
 
 #if defined(__NetBSD__)
 #include <sys/param.h>
@@ -75,6 +76,21 @@
     char pathbuf[260];
     int dlopenflags=0;
 
+    static void *libpymodules = NULL;
+    void *rv = NULL;
+
+    /* Ensure we have access to libpymodules. */
+    if (libpymodules == NULL) {
+        printf("ANDROID_PRIVATE = %s\n", getenv("ANDROID_PRIVATE"));
+        PyOS_snprintf(pathbuf, sizeof(pathbuf), "%s/libpymodules.so", getenv("ANDROID_PRIVATE"));
+        libpymodules = dlopen(pathbuf, RTLD_NOW);
+
+        if (libpymodules == NULL) {
+            //abort();
+        }
+    }
+        
+
     if (strchr(pathname, '/') == NULL) {
         /* Prefix bare filename with "./" */
         PyOS_snprintf(pathbuf, sizeof(pathbuf), "./%-.255s", pathname);
@@ -84,6 +100,17 @@
     PyOS_snprintf(funcname, sizeof(funcname),
                   LEAD_UNDERSCORE "init%.200s", shortname);
 
+
+    /* Read symbols that have been linked into the main binary. */
+
+    if (libpymodules) {
+        rv = dlsym(libpymodules, funcname);
+        if (rv != NULL) {
+            return rv;<commit_msg>only try to load libpymodules.so once<commit_after>--- Python-2.7.2.orig/Python/dynload_shlib.c	2010-05-09 16:46:46.000000000 +0200
+++ Python-2.7.2/Python/dynload_shlib.c	2011-04-20 17:52:12.000000000 +0200
@@ -6,6 +6,7 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <stdlib.h>
 
 #if defined(__NetBSD__)
 #include <sys/param.h>
@@ -75,6 +76,21 @@
     char pathbuf[260];
     int dlopenflags=0;
 
+    static void *libpymodules = -1;
+    void *rv = NULL;
+
+    /* Ensure we have access to libpymodules. */
+    if (libpymodules == -1) {
+        printf("ANDROID_PRIVATE = %s\n", getenv("ANDROID_PRIVATE"));
+        PyOS_snprintf(pathbuf, sizeof(pathbuf), "%s/libpymodules.so", getenv("ANDROID_PRIVATE"));
+        libpymodules = dlopen(pathbuf, RTLD_NOW);
+
+        if (libpymodules == NULL) {
+            //abort();
+        }
+    }
+        
+
     if (strchr(pathname, '/') == NULL) {
         /* Prefix bare filename with "./" */
         PyOS_snprintf(pathbuf, sizeof(pathbuf), "./%-.255s", pathname);
@@ -84,6 +100,17 @@
     PyOS_snprintf(funcname, sizeof(funcname),
                   LEAD_UNDERSCORE "init%.200s", shortname);
 
+
+    /* Read symbols that have been linked into the main binary. */
+
+    if (libpymodules) {
+        rv = dlsym(libpymodules, funcname);
+        if (rv != NULL) {
+            return rv;
{'fraction_non_alphanumeric': 0.1769746646795827, 'fraction_numerical': 0.06706408345752608, 'mean_word_length': 2.5943775100401605, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, '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': '7389974', 'n_tokens_mistral': 1158, 'n_tokens_neox': 1028, 'n_words': 194}