<commit_before># Copyright 2015 Novo Nordisk Foundation Center for Biosustainability, DTU.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import absolute_import, print_function
from uuid import uuid4
from IPython.core.display import HTML, Javascript
from IPython.core.display import display

from cameo import util
import logging
import os
import six

from base64 import b64encode

ASSETS = os.path.join(os.path.dirname(__file__), "assets")

SEARCHING_IMAGE_FILE = os.path.join(ASSETS, "searching.gif")
with open(SEARCHING_IMAGE_FILE, "rb") as f:
    if six.PY2:
        SEARCHING_IMAGE = b64encode(f.read()).replace('\n', '')
    elif six.PY3:
        SEARCHING_IMAGE = str(b64encode(f.read())).replace('\n', '')

LOADING_IMAGE_FILE = os.path.join(ASSETS, "loading_wave.gif")
with open(LOADING_IMAGE_FILE, "rb") as f:
    if six.PY2:
        LOADING_IMAGE = b64encode(f.read()).replace('\n', '')
    elif six.PY3:
        s = f.read()
        LOADING_IMAGE = str(b64encode(f.read())).replace('\n', '')

logger = logging.getLogger(__name__)


def notice(message):
    if util.in_ipnb():
        display(HTML("<span>%s</span>" % message))
    else:
        print(message)


def bold(message):
    if util.in_ipnb():
        display(HTML("<strong>%s</strong>" % message))
    else:
        print("\033[1m" + message + "\033[0m")


def searching():
    if util.in_ipnb():
        identifier = str(uuid4())
        display(HTML("""<commit_msg>remove unnecessary code<commit_after># Copyright 2015 Novo Nordisk Foundation Center for Biosustainability, DTU.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import absolute_import, print_function
from uuid import uuid4
from IPython.core.display import HTML, Javascript
from IPython.core.display import display

from cameo import util
import logging
import os
import six

from base64 import b64encode

ASSETS = os.path.join(os.path.dirname(__file__), "assets")

SEARCHING_IMAGE_FILE = os.path.join(ASSETS, "searching.gif")
with open(SEARCHING_IMAGE_FILE, "rb") as f:
    if six.PY2:
        SEARCHING_IMAGE = b64encode(f.read()).replace('\n', '')
    elif six.PY3:
        SEARCHING_IMAGE = str(b64encode(f.read())).replace('\n', '')

LOADING_IMAGE_FILE = os.path.join(ASSETS, "loading_wave.gif")
with open(LOADING_IMAGE_FILE, "rb") as f:
    if six.PY2:
        LOADING_IMAGE = b64encode(f.read()).replace('\n', '')
    elif six.PY3:
        LOADING_IMAGE = str(b64encode(f.read())).replace('\n', '')

logger = logging.getLogger(__name__)


def notice(message):
    if util.in_ipnb():
        display(HTML("<span>%s</span>" % message))
    else:
        print(message)


def bold(message):
    if util.in_ipnb():
        display(HTML("<strong>%s</strong>" % message))
    else:
        print("\033[1m" + message + "\033[0m")


def searching():
    if util.in_ipnb():
        identifier = str(uuid4())
        display(HTML("""
{'fraction_non_alphanumeric': 0.12252252252252252, 'fraction_numerical': 0.017503217503217504, 'mean_word_length': 3.8880503144654086, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1416406', 'n_tokens_mistral': 1237, 'n_tokens_neox': 1200, 'n_words': 367}