def is_binary_string(bytes_to_check):
    # Uses a simplified version of the Perl detection algorithm,
    # based roughly on Eli Bendersky's translation to Python:
    # http://eli.thegreenplace.net/2011/10/19/perls-guess-if-file-is-text-or-binary-implemented-in-python/

    # This is biased slightly more in favour of deeming files as text
    # files than the Perl algorithm, since all ASCII compatible character
    # sets are accepted as text, not just utf-8

    # Empty files are considered text files
    if not bytes_to_check:
        return False

    # Check for NUL bytes first
    if b'\x00' in bytes_to_check:
        return True

    # Now check for a high percentage of ASCII control characters
    # Binary if control chars are > 30% of the string
    control_chars = bytes_to_check.translate(None, _printable_extended_ascii)
    nontext_ratio = float(len(control_chars)) / float(len(bytes_to_check))
    return nontext_ratio > 0.3
Return scores of tasks completed in the specified time range.
dataset/ETHPy150Open kivy/kivy-ios/tools/external/binaryornot/helpers.py/is_binary_string--crossover with--dataset/ETHPy150Open StackStorm/st2contrib/packs/lastline/actions/lib/analysis_apiclient.py/TaskCompletion.get_completed