<commit_before>#!/usr/bin/env python3
#
#  Copyright (C) 2015  <NAME> <<EMAIL>>
#
#  Permission to use, copy, modify, and/or distribute this software for any
#  purpose with or without fee is hereby granted, provided that the above
#  copyright notice and this permission notice appear in all copies.
#
#  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
#  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
#  ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
#  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
#  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
#  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

import icebox
import getopt, sys, os, re

chipname = "iCE40 HX1K"
chipdbfile = "chipdb-1k.txt"
outdir = None
mode8k = False
mode384 = False
tx, ty = 0, 0

def usage():
    print("Usage: %s [options]" % sys.argv[0])
    print("  -x tile_x_coordinate")
    print("  -y tile_y_coordinate")
    print("  -d outdir")
    print("  -8")
    print("  -3")
    sys.exit(0)

try:
    opts, args = getopt.getopt(sys.argv[1:], "x:y:d:8:3")
except:
    usage()

for o, a in opts:
    if o == "-x":
        tx = int(a)
    elif o == "-y":
        ty = int(a)
    elif o == "-d":
        outdir = a
    elif o == "-8":
        mode8k = True
        chipname = "iCE40 HX8K"
        chipdbfile = "chipdb-8k.txt"
    elif o == "-3":
        mode384 = True
        chipname = "iCE40 LP384"
        chipdbfile = "chipdb-384.txt"
    else:<commit_msg>Fix icebox_html -8 mode<commit_after>#!/usr/bin/env python3
#
#  Copyright (C) 2015  <NAME> <<EMAIL>>
#
#  Permission to use, copy, modify, and/or distribute this software for any
#  purpose with or without fee is hereby granted, provided that the above
#  copyright notice and this permission notice appear in all copies.
#
#  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
#  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
#  ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
#  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
#  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
#  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

import icebox
import getopt, sys, os, re

chipname = "iCE40 HX1K"
chipdbfile = "chipdb-1k.txt"
outdir = None
mode8k = False
mode384 = False
tx, ty = 0, 0

def usage():
    print("Usage: %s [options]" % sys.argv[0])
    print("  -x tile_x_coordinate")
    print("  -y tile_y_coordinate")
    print("  -d outdir")
    print("  -8")
    print("  -3")
    sys.exit(0)

try:
    opts, args = getopt.getopt(sys.argv[1:], "x:y:d:83")
except:
    usage()

for o, a in opts:
    if o == "-x":
        tx = int(a)
    elif o == "-y":
        ty = int(a)
    elif o == "-d":
        outdir = a
    elif o == "-8":
        mode8k = True
        chipname = "iCE40 HX8K"
        chipdbfile = "chipdb-8k.txt"
    elif o == "-3":
        mode384 = True
        chipname = "iCE40 LP384"
        chipdbfile = "chipdb-384.txt"
    else:
{'fraction_non_alphanumeric': 0.11289833080424887, 'fraction_numerical': 0.024582701062215478, 'mean_word_length': 2.8549707602339183, 'pattern_counts': {'":': 10, '<': 9, '<?xml version=': 0, '>': 9, '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': '6052731', 'n_tokens_mistral': 1183, 'n_tokens_neox': 1099, 'n_words': 418}