content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import json
colours = json.loads(open("theme/default.json").read()) | [
11748,
33918,
198,
198,
4033,
4662,
796,
33918,
13,
46030,
7,
9654,
7203,
43810,
14,
12286,
13,
17752,
11074,
961,
28955
] | 3.238095 | 21 |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import multiprocessing
import os
import random
import time
from enum import Enum
import numpy as np
from PIL import Image
from set... | [
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
17168,
5964,
1043,
287,
262,
198,
2,
38559,
24290,
2393,
287,
262,
6808,
8619,
286,
428,
2723,
5509,
13,
628,
198,
11748... | 3.297872 | 188 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 17 15:05:43 2020
@author: lihaoyang03
"""
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
19480,
2365,
1596,
1315,
25,
2713,
25,
3559,
12131,
198,
198,
31,
9800,
25,
7649,
3099,
7... | 2.142857 | 56 |
import sys
import time
import random
from sync_utils import Thread, Semaphore, Barrier, watch
SANTA = Semaphore(0)
NUM_DEERS = 0
DEER_MUTEX = Semaphore(1)
SLEDGE = Semaphore(0)
SLEDGE_READY = Semaphore(0)
BARRIER = Barrier(9)
NUM_ELVES = 0
ELF_MUTEX = Semaphore(1)
ELF_MULTIPLEX = Semaphore(3)
HELP = Semaphore(0)
... | [
11748,
25064,
198,
11748,
640,
198,
11748,
4738,
198,
6738,
17510,
62,
26791,
1330,
14122,
11,
12449,
6570,
382,
11,
32804,
11,
2342,
628,
198,
36753,
5603,
796,
12449,
6570,
382,
7,
15,
8,
198,
198,
41359,
62,
7206,
4877,
796,
657,
... | 2.27027 | 148 |
import pandas as pd
import numpy as np
| [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198
] | 3 | 13 |
#!/usr/bin/python
import argparse
import dns.resolver
import dns.query
import dns.zone
import os
import sys
from multiprocessing import Pool
INPUTFILE = sys.stdin
OUTPUTFILE = sys.stdout
LOGFILE = sys.stderr
PROCESSES = 20
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
11748,
1822,
29572,
198,
11748,
288,
5907,
13,
411,
14375,
198,
11748,
288,
5907,
13,
22766,
198,
11748,
288,
5907,
13,
11340,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
6738,
18540,
305,
... | 2.673469 | 98 |
"""Script to convert non-jpgs in a folder to jpg"""
import os
from pathlib import Path
from PIL import Image
from glob import glob
from tqdm import tqdm
from shutil import move
cwd = Path.cwd()
DATA_DIR = cwd.parent / 'data' / 'stanford-car-dataset-by-classes-folder' / 'car_data' / 'new_data'
if __name__ == '__ma... | [
37811,
7391,
284,
10385,
1729,
12,
9479,
82,
287,
257,
9483,
284,
474,
6024,
37811,
198,
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
15095,
1330,
15095,
198,
6738,
256,
80,
36020,
1330,... | 2.76378 | 127 |
import learnable_histogram
import TauDataset
import data_processing as dp
import numpy as np
import tensorflow as tf
import losses
import histogram
import visualizer
import CubeDataset
from report import print_report, error_statistics
mode = 'rb'
# path = "/media/donik/Disk/intel_tau/paths_field.txt"
# imgs = load_... | [
11748,
2193,
540,
62,
10034,
21857,
198,
11748,
36849,
27354,
292,
316,
198,
11748,
1366,
62,
36948,
355,
288,
79,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
9089,
198,
11748,
1554,
21857,
... | 2.142017 | 1,190 |
from .rotation import * | [
6738,
764,
10599,
341,
1330,
1635
] | 3.833333 | 6 |
from output.models.nist_data.list_pkg.any_uri.schema_instance.nistschema_sv_iv_list_any_uri_max_length_3_xsd.nistschema_sv_iv_list_any_uri_max_length_3 import NistschemaSvIvListAnyUriMaxLength3
__all__ = [
"NistschemaSvIvListAnyUriMaxLength3",
]
| [
6738,
5072,
13,
27530,
13,
77,
396,
62,
7890,
13,
4868,
62,
35339,
13,
1092,
62,
9900,
13,
15952,
2611,
62,
39098,
13,
77,
1023,
2395,
2611,
62,
21370,
62,
452,
62,
4868,
62,
1092,
62,
9900,
62,
9806,
62,
13664,
62,
18,
62,
87,
... | 2.241071 | 112 |
# -*- coding: utf-8 -*-
import sys, time, random
#FLASK
from flask import Flask, request
from flaskJSONRPCServer import flaskJSONRPCServer
echo._alias='helloworld' #setting alias for method
app=Flask(__name__)
@app.route('/readpost', methods=['POST'])
app2=Flask(__name__)
@app2.route('/helloworld', methods=['GET'])... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
25064,
11,
640,
11,
4738,
198,
198,
2,
3697,
1921,
42,
198,
6738,
42903,
1330,
46947,
11,
2581,
198,
198,
6738,
42903,
40386,
49,
5662,
10697,
1330,
42903,
40386,... | 2.59806 | 928 |
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pathlib import Path
import pytest
from pants.core.util_rules.distdir import DistDir, InvalidDistDir, validate_distdir
| [
2,
15069,
13130,
41689,
1628,
20420,
357,
3826,
27342,
9865,
3843,
20673,
13,
9132,
737,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
3826,
38559,
24290,
737,
198,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
1... | 3.685714 | 70 |
import numpy as np
import pickle
from .testutil import datadir
from brainstat.stats.SLM import SLM, f_test
from brainstat.stats.terms import Term
# test data *pkl consists of slm1* and slm2* keys
# slm1* variables will be assigned to slm1 dictionary, and slm2* to the slm2 dict.
| [
11748,
299,
32152,
355,
45941,
198,
11748,
2298,
293,
198,
6738,
764,
9288,
22602,
1330,
4818,
324,
343,
198,
6738,
3632,
14269,
13,
34242,
13,
8634,
44,
1330,
12419,
44,
11,
277,
62,
9288,
198,
6738,
3632,
14269,
13,
34242,
13,
38707... | 2.94 | 100 |
import os
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import pickle
from collections import OrderedDict
from fragresp.gaussian_tools import check_opt as _check_opt
from fragresp.gaussian_tools import check_esp as _check_esp
from fragresp.gaussian_tools import get_energy a... | [
11748,
28686,
198,
11748,
2603,
29487,
8019,
355,
285,
489,
198,
76,
489,
13,
1904,
10786,
46384,
11537,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2298,
293,
198,
6738,... | 3.201681 | 119 |
from model.factor import RandomVar
from model.factor import CPD
from model.factor import Factor
from model.influence import InfluenceDiagram
from inference.exact import ExpectedUtility
if __name__ == '__main__':
main()
| [
6738,
2746,
13,
31412,
1330,
14534,
19852,
198,
6738,
2746,
13,
31412,
1330,
327,
5760,
198,
6738,
2746,
13,
31412,
1330,
27929,
198,
6738,
2746,
13,
10745,
23079,
1330,
35948,
18683,
6713,
198,
6738,
32278,
13,
1069,
529,
1330,
1475,
7... | 3.603175 | 63 |
#!/usr/bin/python
# Importing custom files
import sys
sys.path.insert(1, '../')
import utils
import instagram
from datetime import date
from PIL import Image, ImageDraw
from bs4 import BeautifulSoup
import urllib.request
import requests
import time
import wget
import json
import os
if __name__ == "__main__":
i... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
2,
17267,
278,
2183,
3696,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
28463,
7,
16,
11,
705,
40720,
11537,
198,
198,
11748,
3384,
4487,
198,
11748,
916,
6713,
198,
198,
6738,
4818,
8... | 2.526042 | 192 |
import os
| [
11748,
28686,
628
] | 3.666667 | 3 |
import sys
import os
sys.path.append(os.path.abspath('.'))
sys.path.append(os.path.abspath('../'))
sys.path.append(os.path.abspath('../../'))
import matplotlib.pyplot as plt
import numpy as np
from fusion.scheduling import batch_size
from fusion.scheduling import Resource
from fusion.scheduling import LoopLowerBound
... | [
11748,
25064,
198,
11748,
28686,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
397,
2777,
776,
10786,
2637,
4008,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
397,
2777,
776,
10786,
40720,
6,
4008,
198,
17597,
13,... | 2.328431 | 1,224 |
from libfuturize.fixes.fix_future_builtins import FixFutureBuiltins
| [
6738,
9195,
69,
315,
333,
1096,
13,
42624,
13,
13049,
62,
37443,
62,
18780,
1040,
1330,
13268,
29783,
39582,
1040,
198
] | 3.238095 | 21 |
"""This module does blah blah."""
import httplib2
resp, content = httplib2.Http().request("http://myip.dk")
#start = content.find("ipv4address")
#end = start + 100
print (content) #[start:end].strip()) | [
37811,
1212,
8265,
857,
33367,
33367,
526,
15931,
198,
11748,
1841,
489,
571,
17,
198,
4363,
11,
2695,
796,
1841,
489,
571,
17,
13,
43481,
22446,
25927,
7203,
4023,
1378,
1820,
541,
13,
34388,
4943,
198,
2,
9688,
796,
2695,
13,
19796,... | 2.927536 | 69 |
from enum import Enum
import requests
from bbdata.config import output_api_url
from bbdata.util import handle_response
from bbdata.exceptions import ClientException
| [
6738,
33829,
1330,
2039,
388,
198,
11748,
7007,
198,
6738,
275,
65,
7890,
13,
11250,
1330,
5072,
62,
15042,
62,
6371,
198,
6738,
275,
65,
7890,
13,
22602,
1330,
5412,
62,
26209,
198,
6738,
275,
65,
7890,
13,
1069,
11755,
1330,
20985,
... | 3.772727 | 44 |
from collections import defaultdict
from lxml import html
import requests
from plumbum import colors
from dict_tiny.setting import TIME_OUT
def is_alphabet(word):
"""
return the word is English or Chinese
:param word:
:return:
"""
is_alphabet = defaultdict(int)
word = word.replace(' ', '')... | [
6738,
17268,
1330,
4277,
11600,
198,
6738,
300,
19875,
1330,
27711,
198,
11748,
7007,
198,
6738,
458,
2178,
388,
1330,
7577,
198,
6738,
8633,
62,
44152,
13,
33990,
1330,
20460,
62,
12425,
628,
198,
4299,
318,
62,
17307,
8380,
7,
4775,
... | 2.320652 | 736 |
#!/usr/bin/env python3
"""
Created on Thr Apr 8 18:00:00 2021
:Authors:
Mark Driver <mdd31>
Mark J. Williamson <mjw99>
"""
import logging
from cmlgenerator.test.cmlgeneratortests import run_tests
logging.basicConfig()
LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(logging.WARN)
if __name__ == "__main... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
41972,
319,
16283,
2758,
807,
1248,
25,
405,
25,
405,
33448,
198,
198,
25,
30515,
669,
25,
198,
220,
220,
220,
2940,
12434,
1279,
76,
1860,
3132,
29,
198,
220,
220,
... | 2.544776 | 134 |
from math import cos, sin, pi
import bgl
import blf
import bpy
import gpu
from bpy.props import *
from bpy.types import Operator
from gpu_extras.batch import batch_for_shader
from .utils import dpifac, draw_tri_fan
from ...preferences import get_pref
class RSN_OT_DrawNodes(Operator):
"""Draw the active ... | [
6738,
10688,
1330,
8615,
11,
7813,
11,
31028,
198,
198,
11748,
275,
4743,
198,
11748,
698,
69,
198,
11748,
275,
9078,
198,
11748,
308,
19944,
198,
198,
6738,
275,
9078,
13,
1676,
862,
1330,
1635,
198,
6738,
275,
9078,
13,
19199,
1330,... | 2.625 | 168 |
from internal.model import Node, Rule, ExistRule, ChildRule, Direction, RuleNode, ParentChildRule
| [
6738,
5387,
13,
19849,
1330,
19081,
11,
14330,
11,
1475,
396,
31929,
11,
5932,
31929,
11,
41837,
11,
14330,
19667,
11,
16774,
16424,
31929,
628,
628,
628,
198
] | 3.714286 | 28 |
from marshmallow import fields, post_load
from portals.wwits.apis.rest import BaseSchemaExcludeFields as Schema
from .models import ParmModel, FunctionAuthorizeListModel, FunctionModel
| [
6738,
22397,
42725,
1330,
7032,
11,
1281,
62,
2220,
198,
6738,
42604,
13,
1383,
896,
13,
499,
271,
13,
2118,
1330,
7308,
27054,
2611,
3109,
9152,
15878,
82,
355,
10011,
2611,
198,
198,
6738,
764,
27530,
1330,
47796,
17633,
11,
15553,
... | 3.78 | 50 |
#!/usr/bin/env python3
# IB002 Domaci uloha 6.
#
# V nasledujicim textu pouzivame pojem "halda" ve vyznamu "binarni halda".
#
# Minimova halda je v kanonickem tvaru, pokud pro kazdy jeji prvek se dvema
# potomky plati, ze jeho levy potomek je mensi nez ten pravy nebo se oba
# rovnaji.
#
# Je v kanonickem tvaru | Neni... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
628,
198,
2,
34782,
21601,
9666,
32009,
14856,
28083,
718,
13,
198,
2,
198,
2,
569,
25221,
992,
23577,
291,
320,
2420,
84,
279,
280,
89,
452,
480,
745,
73,
368,
366,
71,
1940,
64,
... | 2.14209 | 3,167 |
import os, glob
import json
from transformers import BertTokenizer
from tqdm import tqdm
from argparse import ArgumentParser
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument('--file_path', type=str, required=True)
parser.add_argument('--output_path', type=str, required=True)
... | [
11748,
28686,
11,
15095,
198,
11748,
33918,
198,
6738,
6121,
364,
1330,
22108,
30642,
7509,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
6738,
1822,
29572,
1330,
45751,
46677,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
83... | 2.183636 | 550 |
from django.conf.urls import include, url
from django.contrib import admin
from chapter.view.createChapter import *
from chapter.view.getChapter import *
urlpatterns = [
# url('^login/$', login),
url('^createAChapter/$', createAChapter),
url('^getChapter/$', getChapter),
url('^bookChapter/$', bookCha... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
2291,
11,
19016,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
6843,
13,
1177,
13,
17953,
14126,
1330,
220,
1635,
198,
6738,
6843,
13,
1177,
13,
1136,
14126,
1330,
2... | 2.990909 | 110 |
"""
This module imports the configuration for yggdrasil.
.. todo::
Remove reference to environment variables for accessing config options.
"""
import os
import sys
import json
import shutil
import logging
import warnings
import subprocess
from yggdrasil.backwards import configparser
from yggdrasil import platform,... | [
37811,
198,
1212,
8265,
17944,
262,
8398,
329,
331,
1130,
7109,
292,
346,
13,
198,
198,
492,
284,
4598,
3712,
198,
220,
220,
17220,
4941,
284,
2858,
9633,
329,
22534,
4566,
3689,
13,
198,
198,
37811,
198,
11748,
28686,
198,
11748,
250... | 2.236475 | 6,525 |
# -*- coding:utf-8; -*-
class Solution:
"""
解题思路:递归
"""
| [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
26,
532,
9,
12,
628,
198,
4871,
28186,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
5525,
100,
96,
165,
95,
246,
45250,
251,
164,
115,
107,
171,
120,
248,
34460,
240,
37605,
240,
... | 1.372549 | 51 |
import requests_unixsocket
import json
from errors import NoSuchContainerError, ServerErrorError
from utils.utils import Utils
u = Utils()
#https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/
| [
11748,
7007,
62,
403,
844,
44971,
198,
11748,
33918,
198,
6738,
8563,
1330,
1400,
16678,
29869,
12331,
11,
9652,
12331,
12331,
198,
198,
6738,
3384,
4487,
13,
26791,
1330,
7273,
4487,
198,
84,
796,
7273,
4487,
3419,
628,
198,
2,
5450,
... | 2.8875 | 80 |
quant_de_testes = int(input())
soma_de_impares_consecutivos(quant_de_testes)
| [
628,
198,
40972,
62,
2934,
62,
9288,
274,
796,
493,
7,
15414,
28955,
198,
82,
6086,
62,
2934,
62,
11011,
3565,
62,
1102,
4552,
452,
418,
7,
40972,
62,
2934,
62,
9288,
274,
8,
198
] | 2.285714 | 35 |
# Copyright 2018 Google LLC
#
# 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, ... | [
2,
15069,
2864,
3012,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330... | 2.88932 | 515 |
import os
import subprocess
import sys
import shutil
import logging
from typing import Optional, List
import click
from google.cloud import storage
@click.command()
@click.option('-b', "--bucket_name", help="(str) Name of GCS bucket")
@click.option(
'-r',
"--requirement",
help="(str) Name of Python packa... | [
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
11748,
4423,
346,
198,
11748,
18931,
198,
6738,
19720,
1330,
32233,
11,
7343,
198,
198,
11748,
3904,
198,
6738,
23645,
13,
17721,
1330,
6143,
628,
198,
31,
12976,
13,
21812,
... | 2.27459 | 1,708 |
#!/usr/bin/env python
from django.core.management.utils import get_random_secret_key
print(get_random_secret_key())
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
26791,
1330,
651,
62,
25120,
62,
21078,
62,
2539,
198,
198,
4798,
7,
1136,
62,
25120,
62,
21078,
62,
2539,
28955,
198
] | 2.95 | 40 |
import json
import os
| [
11748,
33918,
198,
11748,
28686,
628,
198
] | 3.428571 | 7 |
from .locate import (
this_dir,
allow_relative_location_imports,
force_relative_location_imports,
append_sys_path,
prepend_sys_path,
)
| [
6738,
764,
75,
13369,
1330,
357,
198,
220,
220,
220,
428,
62,
15908,
11,
198,
220,
220,
220,
1249,
62,
43762,
62,
24886,
62,
320,
3742,
11,
198,
220,
220,
220,
2700,
62,
43762,
62,
24886,
62,
320,
3742,
11,
198,
220,
220,
220,
2... | 2.421875 | 64 |
from .basecontainer import inflateChildren
from .. import LabeledContainer
| [
6738,
764,
8692,
34924,
1330,
1167,
17660,
26829,
198,
6738,
11485,
1330,
3498,
18449,
29869,
198
] | 4.6875 | 16 |
from functools import wraps
import re
from urllib.parse import unquote
from twilio.base.exceptions import TwilioRestException
from flask import (
current_app as app,
render_template,
request,
Response,
url_for,
)
| [
6738,
1257,
310,
10141,
1330,
27521,
198,
11748,
302,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
555,
22708,
198,
198,
6738,
665,
346,
952,
13,
8692,
13,
1069,
11755,
1330,
1815,
346,
952,
19452,
16922,
198,
198,
6738,
42903,
1330,
3... | 2.802326 | 86 |
"""
.. module:: ldtui
:synopsis: Main tools UI.
.. moduleauthor:: Ezequiel Mastrasso
"""
from Qt import QtGui, QtWidgets, QtCore
from Qt.QtWidgets import QApplication, QWidget, QLabel, QMainWindow
import sys
import imp
import os
import logging
from functools import partial
from ldtui import qtutils
import ldt
... | [
37811,
198,
492,
8265,
3712,
300,
28664,
9019,
198,
220,
220,
1058,
28869,
24608,
25,
8774,
4899,
12454,
13,
198,
198,
492,
8265,
9800,
3712,
412,
2736,
421,
8207,
30868,
81,
28372,
198,
198,
37811,
198,
198,
6738,
33734,
1330,
33734,
... | 2.976744 | 172 |
import unittest
from poker import best_hands
if __name__ == "__main__":
unittest.main()
| [
11748,
555,
715,
395,
198,
198,
6738,
27101,
1330,
1266,
62,
43365,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 2.714286 | 35 |
from lib.actions import BaseAction
| [
6738,
9195,
13,
4658,
1330,
7308,
12502,
628
] | 4.5 | 8 |
from rest_framework import serializers
from .models import Exchange
| [
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
198,
6738,
764,
27530,
1330,
12516,
198
] | 4.6 | 15 |
from dataclasses import field
from enum import Enum
from typing import Dict, List, Optional, Union
from . import is_pydantic_available
from .doc import generate_doc_dataclass
if is_pydantic_available():
from pydantic.dataclasses import dataclass
else:
from dataclasses import dataclass
@generate_doc_dat... | [
6738,
4818,
330,
28958,
1330,
2214,
198,
6738,
33829,
1330,
2039,
388,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
11,
32233,
11,
4479,
198,
198,
6738,
764,
1330,
318,
62,
79,
5173,
5109,
62,
15182,
198,
6738,
764,
15390,
1330,
7716,
... | 2.947679 | 1,185 |
"""
===========================================================
Plot single trial activity, grouped by ROI and sorted by RT
===========================================================
This will produce what is sometimes called an event related
potential / field (ERP/ERF) image.
The EEGLAB example file, which contains... | [
37811,
198,
10052,
4770,
2559,
18604,
198,
43328,
2060,
4473,
3842,
11,
32824,
416,
15107,
40,
290,
23243,
416,
11923,
198,
10052,
4770,
2559,
18604,
198,
198,
1212,
481,
4439,
644,
318,
3360,
1444,
281,
1785,
3519,
198,
13059,
1843,
12... | 2.432369 | 1,279 |
# This file is intended for local testing when contributing to this repository
# Do not commit any changes
# You will need to generate a GitLab Personal Access Token to use this
from os import environ as env
import gitlab
from gitlabchangelog.changelog import Changelog
env["GITLAB_URL"] = "https://gitlab.invenia.ca"
e... | [
2,
770,
2393,
318,
5292,
329,
1957,
4856,
618,
14329,
284,
428,
16099,
198,
2,
2141,
407,
4589,
597,
2458,
198,
2,
921,
481,
761,
284,
7716,
257,
15151,
17822,
15644,
8798,
29130,
284,
779,
428,
198,
6738,
28686,
1330,
551,
2268,
35... | 3 | 469 |
import os
from pathlib import Path
from colorama import Fore, init
if __name__ == '__main__':
Tree().main()
| [
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
3124,
1689,
1330,
4558,
11,
2315,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
12200,
2244... | 2.688889 | 45 |
import uuid
from django.core.exceptions import ValidationError
from django.db import models
from sagepaypi.constants import COUNTRY_CHOICES, US_STATE_CHOICES
from sagepaypi.models import CardIdentifier
from tests.test_case import AppTestCase
# fields
# properties
# validation
| [
11748,
334,
27112,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
3254,
24765,
12331,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
6738,
35021,
15577,
14415,
13,
9979,
1187,
1330,
31404,
40405,
62,
44899,
34444... | 3.288889 | 90 |
"""Setup for Axis."""
from setuptools import setup
setup(
name="axis",
packages=["axis"],
version="33",
description="A Python library for communicating with devices from Axis Communications",
author="Robert Svensson",
author_email="Kane610@users.noreply.github.com",
license="MIT",
url=... | [
37811,
40786,
329,
38349,
526,
15931,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
2625,
22704,
1600,
198,
220,
220,
220,
10392,
28,
14692,
22704,
33116,
198,
220,
220,
220,
2196,
2625,
... | 2.901345 | 223 |
from keras import backend as K
from keras.layers import Input, Convolution2D, MaxPooling2D, Activation, concatenate, Dense, add, GaussianNoise
from keras.layers import GlobalAveragePooling2D
from keras.models import Model
from keras.regularizers import l2
sq1x1 = "squeeze1x1"
exp1x1 = "expand1x1"
exp3x3 = "expand3x3"
... | [
6738,
41927,
292,
1330,
30203,
355,
509,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
23412,
11,
34872,
2122,
17,
35,
11,
5436,
27201,
278,
17,
35,
11,
13144,
341,
11,
1673,
36686,
378,
11,
360,
1072,
11,
751,
11,
12822,
31562,
2949,
... | 2.305872 | 1,141 |
co = float(input('Medida do cateto oposto: '))
ca = float(input('Medida do cateto adjacente:'))
hi = ((co**2) + (ca**2)) ** (1/2)
print('A hipotenusa mede {:.2f}.'.format(hi))
| [
1073,
796,
12178,
7,
15414,
10786,
9921,
3755,
466,
3797,
27206,
1034,
455,
78,
25,
705,
4008,
198,
6888,
796,
12178,
7,
15414,
10786,
9921,
3755,
466,
3797,
27206,
15909,
68,
32105,
4008,
198,
198,
5303,
796,
14808,
1073,
1174,
17,
8... | 2.311688 | 77 |
from typing import Optional
from pydantic import BaseModel, Field, validator
from app.airtable.response import AirtableResponse, ListAirtableResponse
from app.airtable.validators import get_first_or_default_none
| [
6738,
19720,
1330,
32233,
198,
198,
6738,
279,
5173,
5109,
1330,
7308,
17633,
11,
7663,
11,
4938,
1352,
198,
198,
6738,
598,
13,
958,
11487,
13,
26209,
1330,
317,
2265,
540,
31077,
11,
7343,
32,
2265,
540,
31077,
198,
6738,
598,
13,
... | 3.677966 | 59 |
'''
import boto3
from boto.mturk.connection import MTurkConnection
from boto.mturk.question import HTMLQuestion
from boto.mturk.layoutparam import LayoutParameter
from boto.mturk.layoutparam import LayoutParameters
import json
# Create your connection to MTurk
mtc = MTurkConnection(aws_access_key_id='AKIAIBPHQKOJQZULH... | [
7061,
6,
198,
11748,
275,
2069,
18,
198,
6738,
275,
2069,
13,
16762,
333,
74,
13,
38659,
1330,
337,
17483,
74,
32048,
198,
6738,
275,
2069,
13,
16762,
333,
74,
13,
25652,
1330,
11532,
24361,
198,
6738,
275,
2069,
13,
16762,
333,
74,... | 2.624133 | 721 |
import torch
import torch.nn as nn
# import torch.onnx
# import onnx
# import onnx_caffe2.backend
# from onnx import checker, helper
import torch.optim as optim
import numpy as np
import cv2
from PIL import Image
import torch.utils.model_zoo as model_zoo
import torch.onnx
# print(make_prediction("test/Prairie.jpg"))... | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
2,
1330,
28034,
13,
261,
77,
87,
198,
2,
1330,
319,
77,
87,
198,
2,
1330,
319,
77,
87,
62,
66,
21223,
17,
13,
1891,
437,
198,
2,
422,
319,
77,
87,
1330,
2198,
263,... | 2.77619 | 210 |
## SPDX-License-Identifier: MIT
## The content of this file has been developed in the context of the MOSIM research project.
## Original author(s): Jannes Lehwald
# -*- coding: utf-8 -*-
"""
"""
from MOSIM.mmi.register import MMIAdapter
#from MMIStandard import MMIAdapter
from MOSIM.abstraction.access.interface.ad... | [
2235,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
17168,
198,
2235,
383,
2695,
286,
428,
2393,
468,
587,
4166,
287,
262,
4732,
286,
262,
337,
2640,
3955,
2267,
1628,
13,
198,
2235,
13745,
1772,
7,
82,
2599,
449,
1236,
274,
29921,
216... | 2.53944 | 393 |
from argparse import ArgumentParser
from getpass import getpass
from os.path import isfile, expanduser
from sys import exit | [
6738,
1822,
29572,
1330,
45751,
46677,
198,
6738,
651,
6603,
1330,
651,
6603,
198,
6738,
28686,
13,
6978,
1330,
318,
7753,
11,
4292,
7220,
198,
6738,
25064,
1330,
8420
] | 4.241379 | 29 |
#!/usr/bin/env python
# -*- coding: utf-8
"""
Taxonomy Resolver
:copyright: (c) 2020-2021.
:license: Apache 2.0, see LICENSE for more details.
"""
import os
import pytest
from taxonresolver import TaxonResolver
from taxonresolver.utils import load_logging
@pytest.fixture
@pytest.fixture
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
27017,
30565,
1874,
14375,
198,
198,
25,
22163,
4766,
25,
357,
66,
8,
12131,
12,
1238,
2481,
13,
198,
25,
43085,
... | 2.724771 | 109 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from pyspark.mllib.tree import DecisionTree
from functions_MLlib import spark_context, training_set, test_set, write_result, brexit_labeled_data, mode_predict
if __name__ == "__main__" :
sc = spark_context()
numFeatures = 10000
print("Trainin... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
628,
198,
6738,
279,
893,
20928,
13,
76,
297,
571,
13,
21048,
1330,
26423,
27660,
198,
6738,
5499,
62,
5805,
8019,
133... | 2.528947 | 380 |
# SPDX-FileCopyrightText: 2021 Sandy Macdonald
#
# SPDX-License-Identifier: MIT
"""
`Keybow 2040 CircuitPython library`
====================================================
CircuitPython driver for the Pimoroni Keybow 2040 and Pico RGB Keypad Base.
Drop the `lib` contents (`keybow2040.py` file and `keybow_hardware` ... | [
2,
30628,
55,
12,
8979,
15269,
8206,
25,
33448,
17581,
4100,
40915,
198,
2,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
17168,
198,
198,
37811,
198,
63,
9218,
8176,
1160,
1821,
13588,
37906,
5888,
63,
198,
10052,
4770,
1421,
... | 2.680542 | 1,033 |
import urequests
from simp_py import lcd, mon
while 1:
try:
response = urequests.get('http://api.coindesk.com/v1/bpi/currentprice.json')
if response.reason==b'OK':
data= response.json()
updated=data['time']['updatedISO']
btc = data['bpi']['USD']['rate_float']
lcd.text(0,140,updated)
... | [
11748,
334,
8897,
3558,
198,
6738,
985,
79,
62,
9078,
1330,
300,
10210,
11,
937,
198,
4514,
352,
25,
198,
220,
1949,
25,
198,
220,
220,
220,
2882,
796,
334,
8897,
3558,
13,
1136,
10786,
4023,
1378,
15042,
13,
1073,
521,
274,
74,
1... | 2.067227 | 238 |
# mapGenerator.py
import os, os.path, sys, tempfile
# NOTE: The following needs to be added to fix a problem with my path and
# Python3. Remove to make this work generally.
sys.path.insert(0, "/usr/local/lib/python3.3/site-packages")
# End of fix.
import mapnik
| [
2,
3975,
8645,
1352,
13,
9078,
198,
198,
11748,
28686,
11,
28686,
13,
6978,
11,
25064,
11,
20218,
7753,
198,
198,
2,
24550,
25,
383,
1708,
2476,
284,
307,
2087,
284,
4259,
257,
1917,
351,
616,
3108,
290,
198,
2,
11361,
18,
13,
220... | 3.022727 | 88 |
""" The Code is under Tencent Youtu Public Rule
builder for transforms
transforms from torch or home-made
"""
import copy
from torchvision import transforms
from .randaugment import RandAugmentMC
from .gaussian_blur import GaussianBlur
other_func = {"RandAugmentMC": RandAugmentMC,"GaussianBlur":GaussianBlur}
cla... | [
37811,
383,
6127,
318,
739,
9368,
1087,
575,
448,
84,
5094,
14330,
198,
38272,
329,
31408,
198,
198,
7645,
23914,
422,
28034,
393,
1363,
12,
9727,
198,
37811,
198,
198,
11748,
4866,
198,
198,
6738,
28034,
10178,
1330,
31408,
198,
198,
... | 2.691139 | 395 |
from django.contrib import admin
from .models.fakeauth import FakeAuthMail
@admin.register(FakeAuthMail)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
764,
27530,
13,
30706,
18439,
1330,
33482,
30515,
25804,
628,
198,
31,
28482,
13,
30238,
7,
49233,
30515,
25804,
8,
198
] | 3.375 | 32 |
#!/usr/bin/python3
"""
ssh cvteam1@134.173.43.20
cd compData
python startServer.py
"""
from http.server import HTTPServer, SimpleHTTPRequestHandler
from os import curdir
import json
from copy import deepcopy
if __name__ == '__main__':
# i.e. if this file is being run directly, not as imported module
main()... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
37811,
198,
45824,
269,
85,
15097,
16,
31,
19880,
13,
25399,
13,
3559,
13,
1238,
198,
10210,
552,
6601,
198,
29412,
923,
10697,
13,
9078,
198,
37811,
198,
198,
6738,
2638,
13,
15388,
13... | 3.028302 | 106 |
from extractor.models import Extractor
from rest_framework import serializers
from datetime import datetime
from .tasks import extractor_job
from .models import Extractor
from django.utils import timezone
import pytz | [
6738,
7925,
273,
13,
27530,
1330,
29677,
273,
198,
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
764,
83,
6791,
1330,
7925,
273,
62,
21858,
198,
6738,
764,
27530,
1330,
29677,
273,
198,
... | 4.075472 | 53 |
"""
LeetCode Problem: 392. Is Subsequence
Link: https://leetcode.com/problems/is-subsequence/
Written by: Mostofa Adib Shakib
Language: Python
"""
"""
Recursion + Memoization[Built-in function]
Time Complexity: O(n*m)
Space Complexity: O(n*m)
"""
from functools import lru_cache
"""
Dynamic Programming
Time Complexi... | [
37811,
198,
3123,
316,
10669,
20647,
25,
48207,
13,
1148,
3834,
43167,
198,
11280,
25,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
271,
12,
7266,
43167,
14,
198,
25354,
416,
25,
4042,
1659,
64,
1215,
571,
35274,
571,
1... | 2.686131 | 137 |
# Licensed under the BSD 3-Clause License
# Copyright (C) 2021 GeospaceLab (geospacelab)
# Author: Lei Cai, Space Physics and Astronomy, University of Oulu
import netCDF4
import datetime
import numpy as np
import geospacelab.toolbox.utilities.pydatetime as dttool
if __name__ == "__main__":
import pathlib
fp... | [
2,
49962,
739,
262,
347,
10305,
513,
12,
2601,
682,
13789,
198,
2,
15069,
357,
34,
8,
33448,
2269,
24912,
17822,
357,
469,
2117,
330,
417,
397,
8,
198,
2,
6434,
25,
48579,
327,
1872,
11,
4687,
23123,
290,
25398,
9145,
11,
2059,
28... | 2.19863 | 292 |
""" My init to load all main process around my ML project """
from .spark_manage import spark_start
from .data_processing import dataset_train_transpose | [
37811,
2011,
2315,
284,
3440,
477,
1388,
1429,
1088,
616,
10373,
1628,
37227,
198,
198,
6738,
764,
2777,
668,
62,
805,
496,
1330,
9009,
62,
9688,
198,
6738,
764,
7890,
62,
36948,
1330,
27039,
62,
27432,
62,
7645,
3455
] | 3.923077 | 39 |
# coding=utf-8
import os
import unittest
import six
from conans.errors import ConanException
from conans.model.build_info import CppInfo, DepsCppInfo, DepCppInfo
from conans.test.utils.test_files import temp_folder
from conans.util.files import save
| [
2,
19617,
28,
40477,
12,
23,
198,
11748,
28686,
198,
11748,
555,
715,
395,
198,
198,
11748,
2237,
198,
198,
6738,
369,
504,
13,
48277,
1330,
31634,
16922,
198,
6738,
369,
504,
13,
19849,
13,
11249,
62,
10951,
1330,
327,
381,
12360,
... | 3.1625 | 80 |
# encoding: utf-8
# module Wms.RemotingImplementation.Activities.Renderers calls itself Renderers
# from Wms.RemotingImplementation,Version=1.23.1.0,Culture=neutral,PublicKeyToken=null
# by generator 1.145
# no doc
# no important
from __init__ import *
# no functions
# classes
class MobileProgressBarRender... | [
2,
21004,
25,
3384,
69,
12,
23,
201,
198,
2,
8265,
370,
907,
13,
8413,
10720,
3546,
32851,
13,
25526,
871,
13,
49,
437,
19288,
3848,
2346,
28703,
19288,
201,
198,
2,
422,
370,
907,
13,
8413,
10720,
3546,
32851,
11,
14815,
28,
16,
... | 2.930023 | 886 |
# Copyright 2015 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
import os, shutil, logging, subprocess, sys, stat
TAG = 'version_4'
... | [
2,
15069,
1853,
383,
412,
907,
6519,
268,
46665,
13,
220,
1439,
2489,
10395,
13,
198,
2,
412,
907,
6519,
268,
318,
1695,
739,
734,
4553,
16625,
11,
262,
17168,
5964,
290,
262,
198,
2,
2059,
286,
9486,
14,
7792,
4090,
4946,
8090,
1... | 3.681818 | 88 |
from requests import Session
from models.vendor import Vendor
from bs4 import BeautifulSoup
from io_utils.csv_exporter import save_scraped_vendor
| [
6738,
7007,
1330,
23575,
198,
6738,
4981,
13,
85,
18738,
1330,
39896,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
6738,
33245,
62,
26791,
13,
40664,
62,
1069,
26634,
1330,
3613,
62,
1416,
31951,
62,
85,
18738,
628,
198
] | 3.609756 | 41 |
"""
Common test tools.
"""
from os import environ
from semver import compare
from unittest import skipIf
import requests
import subprocess
import time
TEST_GOLANG_VERSION = environ.get("TEST_GOLANG_VERSION", False)
DOCKER_VERSION = environ.get("DOCKER_VERSION", "")
skip_if_go_version = skipIf(
TEST_GOLANG_VERSIO... | [
37811,
198,
17227,
1332,
4899,
13,
198,
37811,
198,
198,
6738,
28686,
1330,
551,
2268,
198,
6738,
5026,
332,
1330,
8996,
198,
6738,
555,
715,
395,
1330,
14267,
1532,
198,
11748,
7007,
198,
11748,
850,
14681,
198,
11748,
640,
198,
198,
... | 2.419231 | 780 |
#!/bin/py
#
# interpolate over data field with 2d polynomial fit
#
# fit a 2D, 3rd order polynomial to data
# estimate the 16 coefficients using all of your data points.
#
# http://stackoverflow.com/questions/18832763/drawing-directions-fields
#
#
import numpy as np
import matplotlib
matplotlib.use('Agg')
import iter... | [
2,
48443,
8800,
14,
9078,
198,
2,
198,
2,
39555,
378,
625,
1366,
2214,
351,
362,
67,
745,
6213,
49070,
4197,
198,
2,
198,
2,
220,
4197,
257,
362,
35,
11,
513,
4372,
1502,
745,
6213,
49070,
284,
1366,
198,
2,
220,
8636,
262,
1467... | 2.567347 | 245 |
import cv2
from matplotlib import pyplot as plt
img = cv2.imread('galaxy.jpg', 0)
img = cv2.resize(img, (int(img.shape[1]/2), int(img.shape[0]/2)))
cv2.imwrite('GlaxyResized.jpg', img)
plt.imshow(img)
plt.show()
| [
11748,
269,
85,
17,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
198,
9600,
796,
269,
85,
17,
13,
320,
961,
10786,
13528,
6969,
13,
9479,
3256,
657,
8,
198,
9600,
796,
269,
85,
17,
13,
411,
1096,
7,
9600,
... | 2.118812 | 101 |
import os
import re
from pathlib import Path
from typing import Dict
from typing import Optional
from typing import Union
from urllib.request import urlopen
from xsdata.codegen.parsers import DefinitionsParser
from xsdata.codegen.parsers import SchemaParser
from xsdata.logger import logger
from xsdata.models.wsdl impo... | [
11748,
28686,
198,
11748,
302,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
360,
713,
198,
6738,
19720,
1330,
32233,
198,
6738,
19720,
1330,
4479,
198,
6738,
2956,
297,
571,
13,
25927,
1330,
19016,
9654,
198,
198,
6738,
2... | 2.413237 | 1,798 |
from setuptools import setup, find_packages
import sys, os
version = '0.2.2'
setup(name = 'eclipseprofileselector',
version = version,
description = 'Manage separate Eclipse profiles and workspaces with a nice graphical user interface.',
long_description = open('README.rst', 'r').read(),
keywords = 'eclipse profi... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
11748,
25064,
11,
28686,
198,
198,
9641,
796,
705,
15,
13,
17,
13,
17,
6,
198,
198,
40406,
7,
3672,
796,
705,
68,
17043,
5577,
346,
2771,
801,
273,
3256,
198,
197,
964... | 2.922222 | 360 |
from django.contrib import admin
from .models import Contributor
admin.site.register(Contributor)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
764,
27530,
1330,
25767,
273,
198,
198,
28482,
13,
15654,
13,
30238,
7,
37146,
273,
8,
198
] | 3.571429 | 28 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
4818,
8079,
198,
6738,
5366,
13,
9945,
1330,
20613,
198,
6738,
5366,
13,
85,
17,
1330,
10011,
2611,
44,
4254,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
628
] | 2.977273 | 44 |
from sqlalchemy.orm.exc import NoResultFound
from porthole.app import Session
from .logger import PortholeLogger
from porthole.models import AutomatedReport, AutomatedReportContact, AutomatedReportRecipient
| [
6738,
44161,
282,
26599,
13,
579,
13,
41194,
1330,
1400,
23004,
21077,
198,
6738,
279,
1506,
2305,
13,
1324,
1330,
23575,
198,
6738,
764,
6404,
1362,
1330,
350,
1506,
2305,
11187,
1362,
198,
6738,
279,
1506,
2305,
13,
27530,
1330,
17406... | 3.781818 | 55 |
from __future__ import print_function
import kwfile_dict
import glob, os, sys
import numpy as N
from astropy.io import fits as pyfits
import pylab as P
import matplotlib
from pysynphot.compat import ASTROPY_LT_1_3
def reverse(d):
"""Return a reverse lookup dictionary for the input dictionary"""
r={}
for ... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
479,
86,
7753,
62,
11600,
198,
11748,
15095,
11,
28686,
11,
25064,
198,
11748,
299,
32152,
355,
399,
198,
6738,
6468,
28338,
13,
952,
1330,
11414,
355,
12972,
21013,
198,
11748,... | 2.355932 | 236 |
"""
Usage
-----
CUDA_VISIBLE_DEVICES=0 python app.py
"""
import os
from time import time
# from neuspell import AspellChecker, JamspellChecker
from neuspell import BertsclstmChecker, CnnlstmChecker, ElmosclstmChecker, NestedlstmChecker
from neuspell import SclstmChecker, SclstmbertChecker, SclstmelmoChecke... | [
37811,
201,
198,
28350,
201,
198,
30934,
201,
198,
43633,
5631,
62,
29817,
34563,
62,
39345,
34444,
28,
15,
21015,
598,
13,
9078,
201,
198,
37811,
201,
198,
201,
198,
11748,
28686,
201,
198,
6738,
640,
1330,
640,
201,
198,
201,
198,
... | 2.359343 | 487 |
# Released under the MIT License. See LICENSE for details.
#
"""Provides help related ui."""
from __future__ import annotations
from typing import TYPE_CHECKING
import _ba
import ba
if TYPE_CHECKING:
from typing import Optional
class HelpWindow(ba.Window):
"""A window providing help on how to play."""
| [
2,
28728,
739,
262,
17168,
13789,
13,
4091,
38559,
24290,
329,
3307,
13,
198,
2,
198,
37811,
15946,
1460,
1037,
3519,
334,
72,
526,
15931,
198,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
19720,
1330,
41876,
62,
50084,
... | 3.445652 | 92 |
# -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Utils to handle Switcher elements.
"""
# Standard library imports
import os
import os.path as osp
import sys
# Local imports
from spyder.config.base import _
fr... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
10673,
23688,
1082,
4935,
25767,
669,
198,
2,
49962,
739,
262,
2846,
286,
262,
17168,
13789,
198,
2,
357,
3826,
13997,
1082,
14,
834,
15003,
834,
13,... | 2.466597 | 958 |
import os
import logging
from src.trainer import train_by_config
logging.basicConfig(format='%(asctime)s - %(message)s', level=logging.INFO)
directory = 'train_settings/'
for filename in os.listdir(directory):
config_path = os.path.join(directory, filename)
logging.info(f'Training model in accordance w... | [
11748,
28686,
201,
198,
11748,
18931,
201,
198,
6738,
12351,
13,
2213,
10613,
1330,
4512,
62,
1525,
62,
11250,
201,
198,
201,
198,
6404,
2667,
13,
35487,
16934,
7,
18982,
11639,
4,
7,
292,
310,
524,
8,
82,
532,
4064,
7,
20500,
8,
... | 2.650888 | 169 |
"""
Simple utility to get random names. I think it uses data from a US census, located in the words folder.
"""
import random
import os.path
__author__ = "Matt Fister"
maleFirsts = [line.rstrip('\n').title() for line in open(os.path.join(os.path.dirname(__file__), (os.path.join('words', 'maleFirstNames.txt'))))]
fem... | [
37811,
198,
26437,
10361,
284,
651,
4738,
3891,
13,
314,
892,
340,
3544,
1366,
422,
257,
1294,
21649,
11,
5140,
287,
262,
2456,
9483,
13,
198,
37811,
198,
198,
11748,
4738,
198,
11748,
28686,
13,
6978,
198,
198,
834,
9800,
834,
796,
... | 2.767068 | 249 |
from django.conf import settings
from core.utils import ensure_user_group_membership
from .models import SlackAccess
def invite_to_slack(privilege, person):
"""
Invites the user to Slack.
"""
privilege.slack_access.grant(person)
def add_to_group(privilege, person):
"""
Generic "add person... | [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
198,
6738,
4755,
13,
26791,
1330,
4155,
62,
7220,
62,
8094,
62,
30814,
1056,
198,
198,
6738,
764,
27530,
1330,
36256,
15457,
628,
198,
198,
4299,
14037,
62,
1462,
62,
6649,
441,
7,
13776... | 2.949153 | 177 |
from django.contrib import admin
from .models import Transaction, Header, Ticker
# Register your models here.
admin.site.register(Transaction)
admin.site.register(Header)
admin.site.register(Ticker)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
764,
27530,
1330,
45389,
11,
48900,
11,
309,
15799,
198,
198,
2,
17296,
534,
4981,
994,
13,
198,
28482,
13,
15654,
13,
30238,
7,
48720,
8,
198,
28482,
13,
15654,
13,
30... | 3.526316 | 57 |
# Copyright 2019 Huawei Technologies Co., Ltd
#
# 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 a... | [
2,
15069,
13130,
43208,
21852,
1766,
1539,
12052,
201,
198,
2,
201,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
201,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,... | 3.175772 | 421 |
import cfnresponse, logging, traceback, boto3
from random import choice
from string import ascii_uppercase, ascii_lowercase, digits
| [
11748,
269,
22184,
26209,
11,
18931,
11,
12854,
1891,
11,
275,
2069,
18,
198,
6738,
4738,
1330,
3572,
198,
6738,
4731,
1330,
355,
979,
72,
62,
7211,
2798,
589,
11,
355,
979,
72,
62,
21037,
7442,
11,
19561,
628,
198
] | 3.35 | 40 |
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from rest_framework_bulk.routes import BulkRouter
from supplier import views
router = DefaultRouter()
bulk_router = BulkRouter()
bulk_router.register("receives", views.ReceiveViewSet)
bulk_router.register("suppliers", views.Suppl... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
2291,
198,
6738,
1334,
62,
30604,
13,
472,
1010,
1330,
15161,
49,
39605,
198,
6738,
1334,
62,
30604,
62,
65,
12171,
13,
81,
448,
274,
1330,
47900,
49,
39605,
198,
198,
6738,
22693,
1... | 2.899441 | 179 |
'''
A pangram is a sentence where every letter of the English alphabet appears at least once.
Given a string sentence containing only lowercase English letters, return true if sentence is a pangram, or false otherwise.
Example 1:
Input: sentence = "thequickbrownfoxjumpsoverthelazydog"
Output: true
Explanation: sente... | [
7061,
6,
198,
32,
279,
648,
859,
318,
257,
6827,
810,
790,
3850,
286,
262,
3594,
24830,
3568,
379,
1551,
1752,
13,
198,
15056,
257,
4731,
6827,
7268,
691,
2793,
7442,
3594,
7475,
11,
1441,
2081,
611,
6827,
318,
257,
279,
648,
859,
... | 3.779661 | 118 |
import matplotlib.pyplot as plt
import numpy as np
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QCursor
from PyQt5.QtWidgets import QApplication
from draw_binary_image import plot_binary_image
if __name__ == "__main__":
main() | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
14055,
1330,
33734,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
8205,
72,
1330,
36070,
21471,
198,
... | 2.7 | 90 |
from PolyAModel import *
import re
import os, sys, copy, getopt, re, argparse
import random
import pandas as pd
import numpy as np
from Bio.Seq import Seq
from TrimmedMean import TrimmedMean
import gc
#from extract_coverage_from_scanGenome import check
#def dataProcessing(scan_file,window,rst):
... | [
6738,
12280,
2390,
375,
417,
1330,
1635,
201,
198,
11748,
302,
201,
198,
11748,
28686,
11,
25064,
11,
4866,
11,
651,
8738,
11,
302,
11,
1822,
29572,
201,
198,
11748,
4738,
201,
198,
11748,
19798,
292,
355,
279,
67,
220,
201,
198,
11... | 2.386503 | 163 |
import sys
import os
from jinja2 import Template
# Apply environment variables to a Jinga2 Template file
# Save the results into an output file specified by the caller
if __name__ == "__main__":
if len(sys.argv) != 3:
print("usage: python apply_env.py input_file output_file")
sys.exit(1)
with ... | [
11748,
25064,
198,
11748,
28686,
198,
6738,
474,
259,
6592,
17,
1330,
37350,
198,
198,
2,
27967,
2858,
9633,
284,
257,
42279,
64,
17,
37350,
2393,
198,
2,
12793,
262,
2482,
656,
281,
5072,
2393,
7368,
416,
262,
24955,
198,
361,
11593,... | 2.489474 | 190 |
#!/usr/bin/env python
import os
import argparse
import PIL.Image
import PIL.ExifTags
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
28686,
198,
11748,
1822,
29572,
198,
198,
11748,
350,
4146,
13,
5159,
198,
11748,
350,
4146,
13,
3109,
361,
36142,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
124... | 2.529412 | 51 |
###
# Copyright (c) 2004-2005, Jeremiah Fincher
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of co... | [
21017,
198,
2,
15069,
357,
66,
8,
5472,
12,
14315,
11,
40192,
376,
1939,
372,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
198,
2,
17613,
11,
389,
104... | 3.449814 | 538 |
#
# Fusion Pickles Probability 3 Parts
#
# Peter Turney, July 14, 2021
#
# From the 20 runs, extract all of the pickled three-part seeds
# that are stored in the 20 "fusion_storage.bin" pickle files.
# Read the pickles and run each pickle, recording the results in
# a numpy tensor:
#
# tensor = num_seeds x nu... | [
2,
201,
198,
2,
21278,
12346,
829,
30873,
1799,
513,
22349,
201,
198,
2,
201,
198,
2,
5613,
6756,
2959,
11,
2901,
1478,
11,
33448,
201,
198,
2,
201,
198,
2,
3574,
262,
1160,
4539,
11,
7925,
477,
286,
262,
2298,
992,
1115,
12,
39... | 2.514269 | 1,682 |
#!/usr/bin/env python3
# Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# 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,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
15069,
33160,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,... | 2.578066 | 2,927 |