content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
"""
Find (old) loanwords between two languages
"""
from ast import literal_eval
from functools import partial
from logging import getLogger
from pandas import DataFrame, Series, concat, read_csv
from tqdm import tqdm
from panphon.distance import Distance
from loanpy.helpers import gensim_multiword
from loanpy.adrc ... | [
37811,
198,
16742,
357,
727,
8,
8063,
10879,
1022,
734,
8950,
198,
198,
37811,
198,
198,
6738,
6468,
1330,
18875,
62,
18206,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
6738,
18931,
1330,
651,
11187,
1362,
198,
198,
6738,
19798,
292,... | 2.86983 | 822 |
import scipy
from scipy.io import loadmat
import random
import numpy as np
from sklearn.metrics import zero_one_loss
from sklearn.naive_bayes import BernoulliNB,MultinomialNB,GaussianNB
import matplotlib.pyplot as plt
from sklearn.feature_selection import mutual_info_classif
import os
data = loadmat('../data/Xwindo... | [
198,
11748,
629,
541,
88,
198,
6738,
629,
541,
88,
13,
952,
1330,
3440,
6759,
198,
11748,
4738,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
6632,
62,
505,
62,
22462,
198,
6738,
1341,
35720,
13,
... | 2.367677 | 495 |
# Copyright 2020 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
2,
15069,
12131,
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,
733... | 3.319672 | 366 |
"""
bluey_beacon.py
This program connects to the bluey 1.1 Nordic nRF52 dev board
made by Electronut Labs. The firmware on Bluey has to be running the
"bluey beacon" example.
This code is expected to be run on a Raspverry Pi 3.
It assumes that you have bluez installed - it uses hcidump and hcitool.
The code rea... | [
37811,
198,
198,
17585,
88,
62,
1350,
7807,
13,
9078,
198,
198,
1212,
1430,
20417,
284,
262,
4171,
88,
352,
13,
16,
35834,
299,
32754,
4309,
1614,
3096,
220,
198,
9727,
416,
5903,
1313,
315,
23500,
13,
383,
18779,
319,
4518,
88,
468... | 1.862898 | 1,415 |
# -*- coding: utf-8 -*-
"""
Created on Wed May 8 12:43:42 2019
@author: solale
In this version I will try to shrink the network and reduce the tensorization
"""
# Multilayer Perceptron
import pandas
import numpy
# fix random seed for reproducibility
seed = 7
numpy.random.seed(seed)
# from tensorflow import set_rando... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
3300,
1737,
220,
807,
1105,
25,
3559,
25,
3682,
13130,
198,
198,
31,
9800,
25,
1540,
1000,
198,
818,
428,
2196,
314,
481,
1949,
284,
22085,
262... | 2.347569 | 7,610 |
#!/usr/bin/env python3
#
# Calculates sentiment polarity scores over the progression of a speech
# and writes them to STDOUT. The output can be parsed by gnuplot.
#
# Original author: Bastian Rieck
from textblob import TextBlob
import os
import sys
"""
Calculates sentiments over the progression of a given speech. Th... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
198,
2,
27131,
689,
15598,
755,
6806,
8198,
625,
262,
17085,
286,
257,
4046,
198,
2,
290,
6797,
606,
284,
48571,
12425,
13,
383,
5072,
460,
307,
44267,
416,
19967,
84,
29487,
... | 2.855513 | 263 |
import numpy as np
import matplotlib.pyplot as plt
import warnings
import pandas as pd
import scipy.stats as st
import statsmodels as sm
import seaborn as sns
import math
import collections
from collections import Counter
import statistics
import matplotlib
# By state level - Fuels emission factors - 1999 t... | [
11748,
299,
32152,
355,
45941,
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
11748,
14601,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,
11748,
629,
541,
88,
13,
34242,
355,
336,
201,
198,
11748,
... | 2.770016 | 1,274 |
import os #tools for working with the CLI
import logging #needed for logging
import pigpio #needed for GPIO control
import time #needed for function timing
import threading #needed for OLED data continuous updating
import csv #needed for temporary data logging
import config as global_vars #import global variable initia... | [
11748,
28686,
1303,
31391,
329,
1762,
351,
262,
43749,
198,
11748,
18931,
1303,
27938,
329,
18931,
198,
11748,
12967,
79,
952,
1303,
27938,
329,
50143,
1630,
198,
11748,
640,
1303,
27938,
329,
2163,
10576,
198,
11748,
4704,
278,
1303,
279... | 4.663265 | 196 |
nums = list(map(int,input().split(" ")))
list = []
for j in range(0,5):
sum = 0
for i in range(0,4):
sum += nums[i]
list.append(sum)
temp = nums[0]
del nums[0]
nums.append(temp)
print("{} {}".format(min(list), max(list)))
| [
77,
5700,
796,
1351,
7,
8899,
7,
600,
11,
15414,
22446,
35312,
7203,
366,
22305,
198,
4868,
796,
17635,
198,
1640,
474,
287,
2837,
7,
15,
11,
20,
2599,
198,
220,
220,
220,
2160,
796,
657,
198,
220,
220,
220,
329,
1312,
287,
2837,
... | 2.056 | 125 |
import instrumenter
import unittest
if __name__ == '__main__':
unittest.main() | [
11748,
8875,
263,
198,
11748,
555,
715,
395,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
197,
403,
715,
395,
13,
12417,
3419
] | 2.857143 | 28 |
"""
This module provides Run.SummaryList data access object
"""
from WMCore.Database.DBFormatter import DBFormatter
from dbs.utils.dbsExceptionHandler import dbsExceptionHandler
| [
37811,
198,
1212,
8265,
3769,
5660,
13,
22093,
8053,
1366,
1895,
2134,
198,
37811,
198,
198,
6738,
370,
9655,
382,
13,
38105,
13,
11012,
8479,
1436,
1330,
20137,
8479,
1436,
198,
6738,
288,
1443,
13,
26791,
13,
67,
1443,
16922,
25060,
... | 3.829787 | 47 |
from rewx.core import *
| [
6738,
302,
49345,
13,
7295,
1330,
1635,
628
] | 3.125 | 8 |
import pytest
| [
11748,
12972,
9288,
628,
198
] | 3.2 | 5 |
from ..protocol import Proto
import abc
from typing import Any
| [
6738,
11485,
11235,
4668,
1330,
45783,
198,
11748,
450,
66,
198,
6738,
19720,
1330,
4377,
628
] | 4 | 16 |
import pygame
import time
import random
pygame.init()
# display
display_width = 1024
display_height = 768
gameDisplay = pygame.display.set_mode((display_width,display_height))
pygame.display.set_caption('Relmpago Marquinhos')
# colors
black = (0,0,0)
white = (255,255,255)
red = (255,0,0)
# car
car... | [
11748,
12972,
6057,
201,
198,
11748,
640,
201,
198,
11748,
4738,
201,
198,
201,
198,
9078,
6057,
13,
15003,
3419,
201,
198,
201,
198,
2,
3359,
201,
198,
13812,
62,
10394,
796,
28119,
201,
198,
13812,
62,
17015,
796,
46720,
201,
198,
... | 2.497942 | 243 |
"""Base classes to be used in FSM."""
import copy
from datetime import datetime
from typing import Dict, Iterator, List, Tuple, Type # noqa
import pytz
from tuco.exceptions import (
TucoAlreadyLockedError,
TucoEventNotFoundError,
TucoInvalidStateChangeError,
TucoInvalidStateHolderError,
)
from tuco.l... | [
37811,
14881,
6097,
284,
307,
973,
287,
376,
12310,
526,
15931,
198,
11748,
4866,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
19720,
1330,
360,
713,
11,
40806,
1352,
11,
7343,
11,
309,
29291,
11,
5994,
220,
1303,
645,
20402,
1... | 2.327848 | 1,580 |
from PIL import Image
import torch
import numpy as np
cityscapes_palette = [128, 64, 128, 244, 35, 232, 70, 70, 70, 102, 102, 156, 190, 153, 153, 153, 153, 153, 250, 170, 30,
220, 220, 0, 107, 142, 35, 152, 251, 152, 70, 130, 180, 220, 20, 60, 255, 0, 0, 0, 0, 142, 0, 0,
70,... | [
6738,
350,
4146,
1330,
7412,
198,
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
198,
19205,
1416,
7916,
62,
18596,
5857,
796,
685,
12762,
11,
5598,
11,
13108,
11,
35264,
11,
3439,
11,
31773,
11,
4317,
11,
4317,
11,
4317,
11,
... | 1.794856 | 3,188 |
from django.conf import settings
from rest_framework.settings import import_from_string
from .mixins import FileContentMixin, DocStringContentMixin, MarkupProcessMixin, NoProcessMixin, SafeProcessMixin
APIDOC_DEFAULT_DOCUMENTER_CLASSES = getattr(
settings,
'APIDOC_DEFAULT_DOCUMENTER_CLASSES',
['rest_fra... | [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
198,
6738,
1334,
62,
30604,
13,
33692,
1330,
1330,
62,
6738,
62,
8841,
198,
198,
6738,
764,
19816,
1040,
1330,
9220,
19746,
35608,
259,
11,
14432,
10100,
19746,
35608,
259,
11,
2940,
929,
... | 2.857143 | 133 |
from malcolm.modules.ADCore.parts import ExposureDetectorDriverPart
| [
6738,
6428,
18414,
13,
18170,
13,
2885,
14055,
13,
42632,
1330,
39090,
11242,
9250,
32103,
7841,
628
] | 4.058824 | 17 |
import json
from typing import Callable, TypeVar, cast
from .constants import CUSTOM_LOG_FORMAT, CUSTOM_EVENT_NAME_MAP, CUSTOM_PAGE_NAME_MAP
from datetime import datetime
import logging
from airflow.settings import TIMEZONE
from airflow.utils.session import create_session
import functools
T = TypeVar("T", bound=Calla... | [
11748,
33918,
198,
6738,
19720,
1330,
4889,
540,
11,
5994,
19852,
11,
3350,
198,
198,
6738,
764,
9979,
1187,
1330,
327,
7759,
2662,
62,
25294,
62,
21389,
1404,
11,
327,
7759,
2662,
62,
20114,
3525,
62,
20608,
62,
33767,
11,
327,
7759,... | 2.782123 | 179 |
import os
import re
from setuptools import setup
currentPath = os.path.abspath(os.path.dirname(__file__))
# Get the long description from the README file
with open(os.path.join(currentPath, 'README.md'), 'r') as f:
longDescription = f.read()
longDescription = '\n' + longDescription
REQUIREMENTS = {
'core... | [
11748,
28686,
198,
11748,
302,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
14421,
15235,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
4008,
628,
198,
198,
2,
3497,
262,... | 2.340748 | 989 |
from setuptools import setup
setup(
name='pydale',
version='0.1.0a1',
description='A Transfer Learning Python package',
url='https://github.com/sz144/TPy',
author='Shuo Zhou',
author_email='szhou20@sheffield.ac.uk',
license='MIT License',
packages=['pydale'],
install_requires=['nump... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
79,
5173,
1000,
3256,
198,
220,
220,
220,
2196,
11639,
15,
13,
16,
13,
15,
64,
16,
3256,
198,
220,
220,
220,
6764,
11639,
32,
20558,
18252,
... | 2.315942 | 345 |
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.stats import kendalltau,chi2_contingency, pearsonr
import pandas as pd
def plot_var_num(dataset,variabile):
""" Plot delle variabili numeriche
--------------
Parametri:
dataset: dataset di riferimento
variabile: variabile da plott... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
220,
198,
11748,
384,
397,
1211,
355,
3013,
82,
220,
198,
6738,
629,
541,
88,
13,
34242,
1330,
479,
437,
439,
83,
559,
11,
11072,
17,
62,
3642,
278,
1387,
11,
25286,
1559,
8... | 2.242806 | 3,892 |
from django.urls import path
from . import views
urlpatterns = [
path("login", views.login_view, name="login"),
path("logout", views.logout_view, name="logout"),
path("register", views.register, name="register"),
path("", views.index, name="index"),
path("open", views.openPage, name="openPage"),
... | [
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
6738,
764,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
7203,
38235,
1600,
5009,
13,
38235,
62,
1177,
11,
1438,
2625,
38235,
12340,
198,
220,
... | 2.786026 | 229 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
11,
15720,
602,
628
] | 2.891892 | 37 |
# Collections namedTuple nr7
import collections
from collections import namedtuple
Point = namedtuple("Point", {"x": 0, "y": 0, "z": 0})
newP = Point(3, 4, 5)
print(newP.x, newP.y, newP.z)
print(newP._fields)
newP = newP._replace(x=6)
print(newP)
p2 = Point._make(["a", "b", "c"])
print(p2)
| [
2,
50004,
3706,
51,
29291,
299,
81,
22,
198,
11748,
17268,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
198,
12727,
796,
3706,
83,
29291,
7203,
12727,
1600,
19779,
87,
1298,
657,
11,
366,
88,
1298,
657,
11,
366,
89,
1298,
657,
3007... | 2.304688 | 128 |
import os
from pathlib import Path
import argparse
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from jive.AJIVE import AJIVE
from jive.PCA import PCA
import warnings
import time, datetime
from random import shuffle
warnings.filterwarnings(action='once')
parser = argpars... | [
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
1822,
29572,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
384,
397,
121... | 2.512141 | 906 |
from ..limit import *
__all__ = [
'Any'
]
| [
6738,
11485,
32374,
1330,
1635,
628,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
705,
7149,
6,
198,
60,
198
] | 2.130435 | 23 |
print('-=-' * 15)
print('Analisador de Tringulos')
print('-=-' * 15)
sega = float(input('Primeiro Segmento: '))
segb = float(input('Segundo Segmento: '))
segc = float(input('Terceiro Segmento: '))
if sega < segb + segc and segb < sega + segc and segc < sega + segb:
print('Os segmentos acima PODEM FORMAR um tringulo... | [
4798,
10786,
12,
10779,
6,
1635,
1315,
8,
198,
4798,
10786,
2025,
27315,
7079,
390,
833,
278,
377,
418,
11537,
198,
4798,
10786,
12,
10779,
6,
1635,
1315,
8,
198,
325,
4908,
796,
12178,
7,
15414,
10786,
26405,
7058,
1001,
5154,
78,
... | 2.465409 | 159 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from django.urls import include, path
from django.contrib.auth import views as auth_views
urlpatterns = [
path('login', auth_views.LoginView.as_view(), name='vcn-account-login'),
path('logout', auth_views.LogoutView.as_view(), {... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
11,
4112,
62,
11748,
198,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
2291,
11,
3108,
198,
6738,
42625,
1420... | 2.713415 | 164 |
# /bin/hacken GameJam 2019, f0wL
"""This example lights up the third NeoPixel while button A is being pressed, and lights up the
eighth NeoPixel while button B is being pressed."""
from adafruit_circuitplayground.express import cpx
import random
import time
import math
cpx.pixels.brightness = 0.1
while True:
... | [
2,
1220,
8800,
14,
31153,
268,
3776,
30380,
13130,
11,
277,
15,
86,
43,
198,
198,
37811,
1212,
1672,
7588,
510,
262,
2368,
21227,
40809,
981,
4936,
317,
318,
852,
12070,
11,
290,
7588,
510,
262,
198,
68,
10887,
21227,
40809,
981,
49... | 2.044444 | 360 |
'''
For testing with the text version
'''
b = [
[1, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0,... | [
7061,
6,
201,
198,
1890,
4856,
351,
262,
2420,
2196,
201,
198,
7061,
6,
201,
198,
201,
198,
65,
796,
685,
201,
198,
220,
220,
220,
685,
16,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
4357,
201,
1... | 1.485944 | 249 |
from .context import Context as _Context
from .user import User
from .document import Document
from .order import Order
from .order_fulfillment import OrderFulfillment
from .prices import public as prices
from .catalog import public as catalog
from .taxes import public as tax
from .core.enums import DocumentStatus as ... | [
6738,
764,
22866,
1330,
30532,
355,
4808,
21947,
198,
6738,
764,
7220,
1330,
11787,
198,
6738,
764,
22897,
1330,
16854,
198,
6738,
764,
2875,
1330,
8284,
198,
6738,
764,
2875,
62,
913,
20797,
434,
1330,
8284,
37,
4754,
359,
434,
198,
... | 2.96908 | 1,326 |
"""
Parse, diff, and upload sample manifests.
Manifests are listings of known samples with associated barcodes and other,
minimal metadata. They are usually produced by the lab processing collection
tubes and contain the link between encounter survey data and molecular biology
results.
The workflow for processing ne... | [
37811,
198,
10044,
325,
11,
814,
11,
290,
9516,
6291,
42190,
13,
198,
198,
5124,
361,
3558,
389,
26890,
286,
1900,
8405,
351,
3917,
2318,
40148,
290,
584,
11,
198,
1084,
4402,
20150,
13,
220,
1119,
389,
3221,
4635,
416,
262,
2248,
7... | 2.625253 | 4,443 |
# Generated by Django 3.0.4 on 2020-04-12 14:28
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
19,
319,
12131,
12,
3023,
12,
1065,
1478,
25,
2078,
201,
198,
201,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
201,
198,
201,
198
] | 2.567568 | 37 |
import logging
from typing import Optional, Dict, Any, List, Tuple, NamedTuple
import torch
from data.edits import Edit
from dpu_utils.ptutils import BaseComponent
from mlcomponents.seqdecoding import SeqDecoder
from mlcomponents.seqencoder import SequenceEncoder
TensorizedData = NamedTuple('EncoderD... | [
11748,
18931,
201,
198,
6738,
19720,
1330,
32233,
11,
360,
713,
11,
4377,
11,
7343,
11,
309,
29291,
11,
34441,
51,
29291,
201,
198,
201,
198,
11748,
28034,
201,
198,
201,
198,
6738,
1366,
13,
276,
896,
1330,
5312,
201,
198,
6738,
28... | 2.81457 | 151 |
#===========================================================================
#
# Copyright (c) 2014, California Institute of Technology.
# U.S. Government Sponsorship under NASA Contract NAS7-03001 is
# acknowledged. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modific... | [
2,
23926,
2559,
18604,
198,
2,
198,
2,
15069,
357,
66,
8,
1946,
11,
3442,
5136,
286,
8987,
13,
198,
2,
471,
13,
50,
13,
5070,
18972,
11094,
739,
8884,
17453,
7210,
22,
12,
3070,
8298,
318,
198,
2,
10810,
13,
220,
1439,
2489,
103... | 4.050967 | 569 |
#!/usr/bin/env python3
# encoding: utf-8
"""
tests.test_path_newsonkrumm2009
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Based on the data available at:
https://www.microsoft.com/en-us/research/publication/hidden-markov-map-matching-noise-sparseness/
Notes:
* There is a 'bug' in the map available from the website.
Multiple se... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
37811,
198,
41989,
13,
9288,
62,
6978,
62,
3605,
1559,
74,
6582,
76,
10531,
198,
27156,
15116,
8728,
4907,
93,
198,
198,
15001,
319,
262,
1... | 2.965432 | 810 |
# Generated by Django 2.0.1 on 2019-06-07 01:57
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
13,
16,
319,
13130,
12,
3312,
12,
2998,
5534,
25,
3553,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
... | 2.818182 | 44 |
from janus.qm_wrapper.qm_wrapper import QMWrapper
from janus.qm_wrapper.psi4_wrapper import Psi4Wrapper
| [
6738,
474,
41141,
13,
80,
76,
62,
48553,
13,
80,
76,
62,
48553,
1330,
1195,
14326,
430,
2848,
198,
6738,
474,
41141,
13,
80,
76,
62,
48553,
13,
862,
72,
19,
62,
48553,
1330,
350,
13396,
19,
36918,
2848,
198
] | 2.6 | 40 |
import urllib
import urllib2
import sys
import batch_interface
import json
if len(sys.argv) == 1:
print 'Usage: python %s <command> [parameter=value] ...' % sys.argv[0]
print 'Try python %s batch/help to see list of functions' % sys.argv[0]
print '\tor pythor %s batch/reload to reload functions' % sys.arg... | [
11748,
2956,
297,
571,
198,
11748,
2956,
297,
571,
17,
198,
11748,
25064,
198,
11748,
15458,
62,
39994,
198,
11748,
33918,
628,
198,
361,
18896,
7,
17597,
13,
853,
85,
8,
6624,
352,
25,
198,
220,
220,
220,
3601,
705,
28350,
25,
2101... | 2.479592 | 294 |
#-------------------------------------------------------------------------------
# Name: cache.py
# Purpose:
#
# Author: xuming
#
# Created: 23-01-2011
# Copyright: (c) xuming 2011
# Licence: GPL
#-------------------------------------------------------------------------------
#!/usr/bin/env python... | [
2,
10097,
24305,
198,
2,
6530,
25,
220,
220,
220,
220,
220,
220,
220,
12940,
13,
9078,
198,
2,
32039,
25,
198,
2,
198,
2,
6434,
25,
220,
220,
220,
220,
220,
2124,
12595,
198,
2,
198,
2,
15622,
25,
220,
220,
220,
220,
2242,
12,... | 2.957576 | 495 |
from typing import Optional
from fastapi import FastAPI
import redis
import json
from models.team_member import Team_Member
app = FastAPI()
r = redis.StrictRedis(host='localhost', port=6379, db=0, password="sOmE_sEcUrE_pAsS", socket_timeout=None, connection_pool=None, charset='utf-8', errors='strict', unix_so... | [
6738,
19720,
1330,
32233,
201,
198,
6738,
3049,
15042,
1330,
12549,
17614,
201,
198,
201,
198,
11748,
2266,
271,
201,
198,
11748,
33918,
201,
198,
6738,
4981,
13,
15097,
62,
19522,
1330,
4816,
62,
27608,
201,
198,
201,
198,
1324,
796,
... | 2.823529 | 119 |
'''
the number numbers are not always the same length
23
* 4
4 * 3 + 20 * 4
'''
| [
7061,
6,
198,
1169,
1271,
3146,
389,
407,
1464,
262,
976,
4129,
628,
220,
220,
220,
220,
2242,
198,
9,
220,
220,
220,
220,
604,
198,
19,
1635,
513,
1343,
1160,
1635,
604,
198,
198,
7061,
6,
628,
220,
220,
220,
220,
220,
220,
220... | 2.173913 | 46 |
import pygame as pg
| [
11748,
12972,
6057,
355,
23241,
198
] | 3.333333 | 6 |
from . import serialize_parameters
from SmartFramework.string.encodings import ascii_printables
from SmartFramework.tools.dictionaries import sorted_dict, sorted_filtered # ,filtered
from SmartFramework.tools.objects import (
isInstance,
class_has_method,
ismethod_methoddescriptor_or_function,
) # ,hasMet... | [
6738,
764,
1330,
11389,
1096,
62,
17143,
7307,
198,
6738,
10880,
21055,
6433,
13,
8841,
13,
12685,
375,
654,
1330,
355,
979,
72,
62,
4798,
2977,
198,
6738,
10880,
21055,
6433,
13,
31391,
13,
67,
2867,
3166,
1330,
23243,
62,
11600,
11,... | 2.106232 | 21,519 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""=================================================================
@Project : Algorithm_YuweiYin/LeetCode-All-Solution/Python3
@File : LC-0189-Rotate-Array.py
@Author : [YuweiYin](https://github.com/YuweiYin)
@Date : 2022-01-02
======================================... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
37811,
23926,
28,
198,
31,
16775,
1058,
978,
42289,
62,
40728,
42990,
56,
259,
14,
3123,
316,
10669,
12,
3237,
12,
46344,
... | 2.508167 | 551 |
'''
One fcn returns the first nonrepeated character from string, s.
The other returns the first repeated character from the string.
'''
#s = 'Where have I heard that?'
#s = 'Wherefore art thou Romeo?'
s = 'Grilled cheeses are great with mustard.'
s = s.lower()
d = char_count_dict(s)
print('\n string: ', s)
print('\... | [
7061,
6,
198,
3198,
277,
31522,
5860,
262,
717,
1729,
45956,
515,
2095,
422,
4731,
11,
264,
13,
198,
464,
584,
5860,
262,
717,
5100,
2095,
422,
262,
4731,
13,
198,
7061,
6,
628,
198,
2,
82,
796,
705,
8496,
423,
314,
2982,
326,
8... | 2.921053 | 152 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
33918,
198,
198,
6738,
435,
541,
323,
13,
64,
404,
13,
15042,
13,
9979,
415,
13,
22973,
34184,
1187,
1330,
163... | 2.446809 | 47 |
from django.contrib import admin
# Register your models here.
from user_manager_app.models import Attendance, Support
admin.site.register(Attendance)
admin.site.register(Support)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
2,
17296,
534,
4981,
994,
13,
198,
6738,
2836,
62,
37153,
62,
1324,
13,
27530,
1330,
46502,
590,
11,
7929,
198,
198,
28482,
13,
15654,
13,
30238,
7,
8086,
437,
590,
8,
198,
... | 3.480769 | 52 |
import torch
import torchvision
import torchvision.transforms as transforms
import albumentations
import numpy as np
# from __future__ import print_function
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets , transforms
import torchvision
fr... | [
11748,
28034,
201,
198,
11748,
28034,
10178,
201,
198,
11748,
28034,
10178,
13,
7645,
23914,
355,
31408,
201,
198,
11748,
435,
65,
1713,
602,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
2,
422,
11593,
37443,
834,
1330,
3601,
62,
... | 2.784314 | 255 |
"""CveDetail Class"""
from .halo_endpoint import HaloEndpoint
from .http_helper import HttpHelper
| [
37811,
34,
303,
11242,
603,
5016,
37811,
198,
198,
6738,
764,
71,
7335,
62,
437,
4122,
1330,
18597,
12915,
4122,
198,
6738,
764,
4023,
62,
2978,
525,
1330,
367,
29281,
47429,
628
] | 3.125 | 32 |
import pytest
import tempfile
import shutil
from baldir_markdown_lib import read_source_file, parse_source_listing_start, import_code_snippet, format_markdown_snippet, split_against_source_listing_tags, pre_process_markdown_file_in_place, pre_process_markdown_text, pre_process_markdown_file_to_string, verify
... | [
11748,
12972,
9288,
198,
11748,
20218,
7753,
198,
11748,
4423,
346,
198,
6738,
28273,
343,
62,
4102,
2902,
62,
8019,
1330,
1100,
62,
10459,
62,
7753,
11,
21136,
62,
10459,
62,
4868,
278,
62,
9688,
11,
1330,
62,
8189,
62,
16184,
3974,
... | 3.009346 | 107 |
"""Automated task runner"""
from typing import Any, Callable, Dict, Optional
from loguru import logger
from shadow.clone import ShadowClone
from shadow.helpers.state import ShadowState
| [
37811,
38062,
515,
4876,
17490,
37811,
198,
198,
6738,
19720,
1330,
4377,
11,
4889,
540,
11,
360,
713,
11,
32233,
198,
198,
6738,
2604,
14717,
1330,
49706,
198,
198,
6738,
9082,
13,
21018,
1330,
8843,
2601,
505,
198,
6738,
9082,
13,
1... | 3.857143 | 49 |
from dataclasses import dataclass
from typing import List, Optional, Union
| [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
19720,
1330,
7343,
11,
32233,
11,
4479,
628,
628,
628,
628,
628,
628
] | 3.73913 | 23 |
# Copyright 2020 Google Inc. 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.0
#
# Unless required by applicable law or agree... | [
2,
15069,
12131,
3012,
3457,
13,
1439,
6923,
33876,
13,
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,
... | 4.122449 | 196 |
# AUTOGENERATED! DO NOT EDIT! File to edit: 01_swin.ipynb (unless otherwise specified).
__all__ = ['SwinT']
# Cell
#hide
import timm
from nbdev.showdoc import *
from fastai.vision.all import *
# Cell | [
2,
47044,
7730,
1677,
1137,
11617,
0,
8410,
5626,
48483,
0,
9220,
284,
4370,
25,
5534,
62,
2032,
259,
13,
541,
2047,
65,
357,
25252,
4306,
7368,
737,
198,
198,
834,
439,
834,
796,
37250,
50,
5404,
51,
20520,
198,
198,
2,
12440,
19... | 2.72973 | 74 |
import colander
from authorize.exceptions import AuthorizeInvalidError
| [
11748,
951,
4066,
198,
198,
6738,
29145,
13,
1069,
11755,
1330,
6434,
1096,
44651,
12331,
628
] | 4.5625 | 16 |
import stable_baselines.common.tf_util as tf_util
from mpi4py import MPI
from stable_baselines import logger
from stable_baselines.common.cmd_util import make_mujoco_env, mujoco_arg_parser
from stable_baselines.common.policies import MlpPolicy
from stable_baselines.trpo_mpi import TRPO
if __name__ == '__main__':
... | [
11748,
8245,
62,
12093,
20655,
13,
11321,
13,
27110,
62,
22602,
355,
48700,
62,
22602,
198,
6738,
285,
14415,
19,
9078,
1330,
4904,
40,
198,
6738,
8245,
62,
12093,
20655,
1330,
49706,
198,
6738,
8245,
62,
12093,
20655,
13,
11321,
13,
... | 2.963964 | 111 |
import sys
sys.path.append("..")
from common import *
data = aoci(parse);
p(data[0]);
count = 0
error_rate = 0
for tic in data[2]:
for val in tic:
flag = False
for field in data[0]:
c = data[0][field]
if bi(val,c[0][0],c[0][1]) or bi(val,c[1][0],c[1][1]):
fl... | [
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
7203,
492,
4943,
198,
6738,
2219,
1330,
1635,
198,
198,
7890,
796,
257,
1733,
7,
29572,
1776,
198,
79,
7,
7890,
58,
15,
36563,
198,
198,
9127,
796,
657,
198,
18224,
62,
4873,
796,
657,
... | 1.886957 | 230 |
import time
import json
import datetime
from flask import request
from flask import render_template
from flask_restful import Resource
from . import buyer, apibuyer
from AppStore.models import Class_Info
| [
11748,
640,
198,
11748,
33918,
198,
11748,
4818,
8079,
198,
198,
6738,
42903,
1330,
2581,
198,
6738,
42903,
1330,
8543,
62,
28243,
198,
6738,
42903,
62,
2118,
913,
1330,
20857,
198,
198,
6738,
764,
1330,
17872,
11,
2471,
571,
4669,
263,... | 3.888889 | 54 |
from flask_restful import Api
import info
| [
6738,
42903,
62,
2118,
913,
1330,
5949,
72,
201,
198,
11748,
7508,
201,
198
] | 3.142857 | 14 |
from integrations.github.resources.base import GitHubListResource
| [
6738,
4132,
9143,
13,
12567,
13,
37540,
13,
8692,
1330,
21722,
8053,
26198,
628
] | 4.785714 | 14 |
# tests/test_provider_unicell_kind.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:20:21 UTC)
# TODO: Shortcut imports without namespace for official and supported providers.
# TODO: This has to be moved into a required_providers block.
# def test_version_source():
#
# import terrascript.pro... | [
2,
5254,
14,
9288,
62,
15234,
1304,
62,
403,
501,
297,
62,
11031,
13,
9078,
198,
2,
17406,
4142,
7560,
416,
4899,
14,
15883,
8189,
13,
9078,
357,
1731,
12,
19117,
12,
1238,
2481,
1315,
25,
1238,
25,
2481,
18119,
8,
628,
628,
198,
... | 2.58794 | 199 |
import queryCiteFile
import librarybase
import pywikibot
from epmclib.getPMCID import getPMCID
from epmclib.exceptions import IDNotResolvedException
import queue
import threading
import time
q=queue.Queue()
rununthreaded() | [
11748,
12405,
34,
578,
8979,
201,
198,
11748,
5888,
8692,
201,
198,
11748,
12972,
20763,
571,
313,
201,
198,
6738,
2462,
76,
565,
571,
13,
1136,
5868,
34,
2389,
1330,
651,
5868,
34,
2389,
201,
198,
6738,
2462,
76,
565,
571,
13,
1069... | 2.821429 | 84 |
from day18.script1 import parse_matrix, read_char_matrix, alpha_lower, solve_world
# We could use the same logic as part 1 with a state made of a distance and 4 (x, y) pairs (one for each bot)
# This works with examples, but there are too many combinations for the real input so it runs for very long
#
# To get it qui... | [
6738,
1110,
1507,
13,
12048,
16,
1330,
21136,
62,
6759,
8609,
11,
1100,
62,
10641,
62,
6759,
8609,
11,
17130,
62,
21037,
11,
8494,
62,
6894,
628,
198,
2,
775,
714,
779,
262,
976,
9156,
355,
636,
352,
351,
257,
1181,
925,
286,
257,... | 3.708696 | 230 |
import numpy as np
from igakit.cad import circle, Pi
if __name__ == '__main__':
test_clamp()
| [
11748,
299,
32152,
355,
45941,
198,
6738,
45329,
461,
270,
13,
66,
324,
1330,
9197,
11,
13993,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1332,
62,
565,
696,
3419,
198
] | 2.512821 | 39 |
import vim
_BOOL_OPTS = set(('allowrevins', 'altkeymap', 'antialias', 'autochdir', 'arabic', 'arabicshape',
'autoindent', 'autoread', 'autowrite', 'backup', 'ballooneval', 'binary',
'bioskey', 'bomb', 'buflisted', 'buftype', 'cindent', 'compatible', 'confirm',
'con... | [
11748,
43907,
198,
198,
62,
8202,
3535,
62,
3185,
4694,
796,
900,
7,
10786,
12154,
18218,
1040,
3256,
705,
2501,
2539,
8899,
3256,
705,
415,
498,
4448,
3256,
705,
2306,
5374,
15908,
3256,
705,
283,
397,
291,
3256,
705,
283,
397,
873,
... | 2.110092 | 1,744 |
#!/bin/python
# coding=utf-8
import schedule
import time
from subprocess import call
# Referncias:
# https://pypi.org/project/schedule/
# https://stackoverflow.com/questions/373335/how-do-i-get-a-cron-like-scheduler-in-python
# https://www.geeksforgeeks.org/python-schedule-library/
if __name__ == "__main__":
p... | [
2,
48443,
8800,
14,
29412,
198,
2,
19617,
28,
40477,
12,
23,
198,
198,
11748,
7269,
198,
11748,
640,
198,
6738,
850,
14681,
1330,
869,
628,
198,
2,
6524,
1142,
979,
292,
25,
198,
2,
3740,
1378,
79,
4464,
72,
13,
2398,
14,
16302,
... | 2.526316 | 228 |
# -*- coding: utf-8 -*-
# Copyright (c) 2017 - for information on the respective copyright owner
# see the NOTICE file and/or the repository https://github.com/boschresearch/statestream
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
2177,
532,
329,
1321,
319,
262,
11756,
6634,
4870,
198,
2,
766,
262,
28536,
2393,
290,
14,
273,
262,
16099,
3740,
1378,
12567,
13,
785,
14,
395... | 2.184035 | 1,353 |
from distutils.core import setup
setup(
name='Geometry2D',
version='0.7.1',
author='Luis Da Costa',
author_email='dacosta.le@gmail.com',
packages=['geometry'],
scripts=[],
url='https://github.com/ldacosta/geometry2D/',
license='LICENSE.txt',
long_description=open('README.txt').read(... | [
6738,
1233,
26791,
13,
7295,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
10082,
15748,
17,
35,
3256,
198,
220,
220,
220,
2196,
11639,
15,
13,
22,
13,
16,
3256,
198,
220,
220,
220,
1772,
11639,
25596,
271,
9637,
... | 2.301205 | 166 |
from unittest import TestCase
import numpy as np
import matplotlib.pyplot as plt
from .plot import rainbowplot
| [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
6738,
764,
29487,
1330,
27223,
29487,
628,
198
] | 3.285714 | 35 |
from django.db.models import Count, Q
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.shortcuts import render, get_object_or_404
from .models import NewsItem, SignUp, Artist, Athlete,Category
# Create your views here.
| [
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
2764,
11,
1195,
198,
6738,
42625,
14208,
13,
7295,
13,
79,
363,
20900,
1330,
31525,
20900,
11,
33523,
9876,
11,
7873,
3673,
2025,
46541,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
854... | 3.394737 | 76 |
import datetime
import glob
import sys
import requests
from defusedxml import ElementTree as ET
sys.path.append("..")
from llama.alma import Alma_API_Client
import llama.config as config
TODAY = datetime.date.today()
count_total_invoices = 0
count_invoices_updated = 0
count_invoice_errors = 0
# Update empty invoice... | [
11748,
4818,
8079,
198,
11748,
15095,
198,
11748,
25064,
198,
198,
11748,
7007,
198,
6738,
825,
1484,
19875,
1330,
11703,
27660,
355,
12152,
198,
198,
17597,
13,
6978,
13,
33295,
7203,
492,
4943,
198,
6738,
32660,
1689,
13,
282,
2611,
1... | 2.548387 | 837 |
import argparse
from pathlib import Path
import tensorflow as tf
import torch
from models.net import SPPNet
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('ckpt_path')
parser.add_argument('num_classes', type=int)
parser.add_argument('output_path')
args = parser... | [
11748,
1822,
29572,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
28034,
198,
6738,
4981,
13,
3262,
1330,
6226,
47,
7934,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834... | 2.688372 | 215 |
#!/usr/bin/env python
import ec2
security_group = ec2.DrupalSecurityGroup()
print("Created new Drupal Security Group Object:{}".format(security_group))
if security_group.exists():
print("Security Group Exists")
exit(1)
security_group_id = security_group.create()
print("Created new EC2 Security Group ID:{}".... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
9940,
17,
198,
198,
12961,
62,
8094,
796,
9940,
17,
13,
35,
34585,
24074,
13247,
3419,
198,
4798,
7203,
41972,
649,
40452,
4765,
4912,
9515,
29164,
92,
1911,
18982,
7,
1296... | 3.154545 | 110 |
# script for extracting patches from video frames suitable for neural network
# training
from keras.preprocessing.image import ImageDataGenerator, load_img, img_to_array, array_to_img
from PIL import Image
import sys
import os
import glob
from PIL import Image
from os.path import basename, splitext
import numpy as n... | [
2,
4226,
329,
37895,
16082,
422,
2008,
13431,
11080,
329,
17019,
3127,
198,
2,
3047,
198,
198,
6738,
41927,
292,
13,
3866,
36948,
13,
9060,
1330,
7412,
6601,
8645,
1352,
11,
3440,
62,
9600,
11,
33705,
62,
1462,
62,
18747,
11,
7177,
... | 2.065253 | 1,226 |
side = [
[ "Y", "O", "W" ],
[ "R", "G", "O" ],
[ "O", "O", "B" ]
]
new_side = [ [ 'X' for i in range(3) ] for i in range(3) ]
for row_idx, row in enumerate(side):
for unit_idx, unit in enumerate(row):
new_side[2-unit_idx][row_idx] = unit
print(new_side) | [
1589,
796,
685,
198,
220,
220,
220,
685,
366,
56,
1600,
366,
46,
1600,
366,
54,
1,
16589,
198,
220,
220,
220,
685,
366,
49,
1600,
366,
38,
1600,
366,
46,
1,
16589,
198,
220,
220,
220,
685,
366,
46,
1600,
366,
46,
1600,
366,
33... | 2.007463 | 134 |
import os
import time
import json
from random import random
from datetime import datetime
import pandas as pd
import seaborn as sns
import requests
| [
11748,
28686,
198,
11748,
640,
198,
11748,
33918,
198,
6738,
4738,
1330,
4738,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,
11748,
7007,
628
] | 3.75 | 40 |
"""
Assign geographically density value to a points.
"""
from scipy.spatial import KDTree
from scipy.spatial.distance import cdist
from scipy.stats import norm
from scipy.optimize import minimize
import numpy as np
def general_density_assignation(locs, parameters, values=None, locs2=None):
"Density assignation ... | [
198,
37811,
198,
8021,
570,
45703,
12109,
1988,
284,
257,
2173,
13,
198,
37811,
198,
198,
6738,
629,
541,
88,
13,
2777,
34961,
1330,
509,
24544,
631,
198,
6738,
629,
541,
88,
13,
2777,
34961,
13,
30246,
1330,
269,
17080,
198,
6738,
... | 2.381897 | 3,933 |
from typing import AsyncIterable
from nexus.pylon.sources.base import (
DoiSource,
PreparedRequest,
)
| [
6738,
19720,
1330,
1081,
13361,
29993,
540,
198,
198,
6738,
45770,
13,
79,
15158,
13,
82,
2203,
13,
8692,
1330,
357,
198,
220,
220,
220,
2141,
72,
7416,
11,
198,
220,
220,
220,
19141,
1144,
18453,
11,
198,
8,
628
] | 2.8 | 40 |
# -*- coding: utf-8 -*-
import argparse
from difflib import SequenceMatcher
import os
from pprint import pprint
import sys
import lib.eac_utils as eac
import lib.io_utils as io
# input
parser = argparse.ArgumentParser()
parser.add_argument('-in', dest="INPUT_FILE", default="data/eac_dates.csv", help="File with EAC d... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
1822,
29572,
198,
6738,
814,
8019,
1330,
45835,
19044,
2044,
198,
11748,
28686,
198,
6738,
279,
4798,
1330,
279,
4798,
198,
11748,
25064,
198,
198,
11748,
9195... | 2.444717 | 814 |
# Script: MovingPen.py
# Description: This program uses python's turtle graphics module to draw shapes,lines,
# circles and text.
# Programmer: William Kpabitey Kwabla.
# Date: 27.05.17
# Importing the turtle module.
import turtle
# It moves the pen to (0, 50) from (0, 0).
turtle.goto(0, 50)
# It move... | [
2,
12327,
25,
26768,
25553,
13,
9078,
198,
2,
12489,
25,
770,
1430,
3544,
21015,
338,
28699,
9382,
8265,
284,
3197,
15268,
11,
6615,
11,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13332,
290,
2420,
13... | 2.698925 | 186 |
# Project Euler Problem 7
# Created on: 2012-06-13
# Created by: William McDonald
import math
import time
# Short list of prime numbers under 20
primeList = [2, 3, 5, 7, 9, 11, 13, 17, 19]
# Returns True if n is prime, otherwise False
# Returns the nth prime number
start = time.time()
ans = getPrime... | [
2,
4935,
412,
18173,
20647,
767,
201,
198,
2,
15622,
319,
25,
2321,
12,
3312,
12,
1485,
201,
198,
2,
15622,
416,
25,
3977,
14115,
201,
198,
201,
198,
11748,
10688,
201,
198,
11748,
640,
201,
198,
201,
198,
2,
10073,
1351,
286,
699... | 2.770833 | 144 |
import discord
from discord.ext import commands
from QuentiumBot import HandleData, get_translations
# Basic command configs
cmd_name = "ban"
tran = get_translations()
aliases = [] if not tran[cmd_name]["fr"]["aliases"] else tran[cmd_name]["fr"]["aliases"].split("/")
| [
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
6738,
2264,
298,
1505,
20630,
1330,
33141,
6601,
11,
651,
62,
7645,
49905,
198,
198,
2,
14392,
3141,
4566,
82,
198,
28758,
62,
3672,
796,
366,
3820,
1,
198,
2213,
272,
796,
... | 2.956044 | 91 |
from tensorflow.keras import Model, layers, regularizers
| [
6738,
11192,
273,
11125,
13,
6122,
292,
1330,
9104,
11,
11685,
11,
3218,
11341,
628
] | 3.866667 | 15 |
# Testing for neo4j query functions
from neo4j import GraphDatabase, basic_auth
# setup neo4j database connection
driver = GraphDatabase.driver("bolt://13.58.54.49:7687", auth=basic_auth("neo4j", "goSEAKers!"))
session = driver.session()
# Function that can take the intersection of multiple symptom queries
# Fabricat... | [
2,
23983,
329,
19102,
19,
73,
12405,
5499,
198,
6738,
19102,
19,
73,
1330,
29681,
38105,
11,
4096,
62,
18439,
198,
198,
2,
9058,
19102,
19,
73,
6831,
4637,
198,
26230,
796,
29681,
38105,
13,
26230,
7203,
25593,
1378,
1485,
13,
3365,
... | 3.202439 | 410 |
import datetime
import math
import os
import sys
import PyQt5
import dotenv
from PyInstaller.archive.pyz_crypto import PyiBlockCipher
from PyInstaller.building.api import PYZ, EXE, COLLECT
from PyInstaller.building.build_main import Analysis
from app import version
from app.core.utils import OsUtils, PathUtils
APP_N... | [
11748,
4818,
8079,
198,
11748,
10688,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
9485,
48,
83,
20,
198,
11748,
16605,
24330,
198,
6738,
9485,
15798,
263,
13,
17474,
13,
9078,
89,
62,
29609,
78,
1330,
9485,
72,
12235,
34,
1... | 2.298684 | 2,280 |
"""App constants"""
import os
STUDENT_ROLE = 'student'
GRADER_ROLE = 'grader'
STAFF_ROLE = 'staff'
INSTRUCTOR_ROLE = 'instructor'
LAB_ASSISTANT_ROLE = 'lab assistant'
ROLE_DISPLAY_NAMES = {
STUDENT_ROLE: 'Student',
GRADER_ROLE: 'Reader',
STAFF_ROLE: 'Teaching Assistant',
INSTRUCTOR_ROLE: 'Instructor',
... | [
37811,
4677,
38491,
37811,
198,
11748,
28686,
198,
198,
2257,
8322,
3525,
62,
13252,
2538,
796,
705,
50139,
6,
198,
10761,
2885,
1137,
62,
13252,
2538,
796,
705,
2164,
5067,
6,
198,
2257,
32,
5777,
62,
13252,
2538,
796,
705,
28120,
6,... | 2.164063 | 896 |
# Copyright (c) 2017 - 2020 Kiriti Nagesh Gowda, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to ... | [
2,
15069,
357,
66,
8,
2177,
532,
12131,
509,
3276,
72,
399,
1095,
71,
41396,
6814,
11,
3457,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
... | 2.443272 | 12,983 |
import sys
import warnings
if not sys.warnoptions:
warnings.simplefilter('ignore')
import json
import os
import pickle
from ._utils import check_file, load_graph, check_available, generate_session
from ..stem import _classification_textcleaning_stemmer
from .._models._sklearn_model import (
BINARY_XGB,
BI... | [
11748,
25064,
198,
11748,
14601,
198,
198,
361,
407,
25064,
13,
40539,
25811,
25,
198,
220,
220,
220,
14601,
13,
36439,
24455,
10786,
46430,
11537,
198,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
6738,
47540,
26791,... | 2.474178 | 213 |
from oidctest.op import func
from oidctest.op import oper
from oidctest.op.client import Client
from oidctest.session import SessionHandler
from otest.aus.handling_ph import WebIh
from otest.conf_setup import OP_ORDER
from otest.conversation import Conversation
from otest.events import Events
from otest.flow import Fl... | [
6738,
267,
312,
310,
395,
13,
404,
1330,
25439,
198,
6738,
267,
312,
310,
395,
13,
404,
1330,
1515,
198,
6738,
267,
312,
310,
395,
13,
404,
13,
16366,
1330,
20985,
198,
6738,
267,
312,
310,
395,
13,
29891,
1330,
23575,
25060,
198,
... | 3.38961 | 154 |
#Criado para randomizar uma lsita de 20mil Colaboradores retornando apenas 1000 colaboradores vrios cargos distintos.
import pandas as pd
import random
base = pd.read_excel("usuarios - energisa.xlsx", encoding="ISO-8859-1",error_bad_lines=False)
sort1 = base.sample(15000)
sort2 = sort1.sample(10000)
sort3 = sort2.... | [
2,
34,
380,
4533,
31215,
4738,
528,
283,
334,
2611,
43979,
5350,
390,
1160,
25433,
1623,
4820,
324,
2850,
1005,
1211,
25440,
2471,
268,
292,
8576,
951,
4820,
324,
2850,
410,
380,
418,
269,
853,
418,
1233,
600,
418,
13,
198,
11748,
1... | 2.486631 | 187 |
# -*- coding: utf-8 -*-
# https://towardsdatascience.com/build-a-machine-learning-simulation-tool-with-dash-b3f6fd512ad6
# We start with the import of standard ML librairies
import pandas as pd
import numpy as np
from sklearn.datasets import make_regression
from sklearn.ensemble import RandomForestRegressor
# We ad... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
3740,
1378,
83,
322,
1371,
19608,
292,
4234,
13,
785,
14,
11249,
12,
64,
12,
30243,
12,
40684,
12,
14323,
1741,
12,
25981,
12,
4480,
12,
42460,
12,
65,
18,
... | 2.104528 | 2,937 |
# try openning a file for reading
try: f = open("file.txt", "r")
except IOError:
print "I/O Error"
# undefined variable
x = 1.0
try: x + y
except NameError:
print "undefined variable"
# example from tutorial
try:
this_fails()
except ZeroDivisionError as detail:
print 'Handling run-time error:', de... | [
2,
1949,
1280,
768,
257,
2393,
329,
3555,
198,
28311,
25,
277,
796,
1280,
7203,
7753,
13,
14116,
1600,
366,
81,
4943,
198,
16341,
24418,
12331,
25,
198,
220,
220,
220,
3601,
366,
40,
14,
46,
13047,
1,
628,
198,
2,
28721,
7885,
198... | 2.834783 | 115 |
# coding=utf-8
# Copyright 2022 The Balloon Learning Environment Authors.
#
# 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 require... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
33160,
383,
47821,
18252,
9344,
46665,
13,
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,
284... | 3.610101 | 495 |
"""
MTTR Multimodal Transformer class.
Modified from DETR https://github.com/facebookresearch/detr
"""
import copy
import os
from typing import Optional
import torch
import torch.nn.functional as F
from torch import nn, Tensor
from einops import rearrange, repeat
from transformers import RobertaModel, RobertaTokenizerF... | [
37811,
198,
13752,
5446,
7854,
320,
375,
282,
3602,
16354,
1398,
13,
198,
5841,
1431,
422,
38267,
49,
3740,
1378,
12567,
13,
785,
14,
19024,
34033,
14,
15255,
81,
198,
37811,
198,
11748,
4866,
198,
11748,
28686,
198,
6738,
19720,
1330,
... | 3.006452 | 310 |
import os
from typing import Dict
| [
11748,
28686,
198,
6738,
19720,
1330,
360,
713,
628
] | 3.888889 | 9 |
from django.core.mail import EmailMessage
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from accounting.models import Attendance, Result
from accounting.templatetags import my_tags
from class_book import settings
from groups.models import Group, Student
from subjects.mo... | [
6738,
42625,
14208,
13,
7295,
13,
4529,
1330,
9570,
12837,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
11,
367,
29281,
31077,
7738,
1060,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
198,
6738,
14317,
13,
... | 3.892473 | 93 |
"""
66. How to replace both the diagonals of dataframe with 0?
"""
"""
Difficulty Level: L2
"""
"""
Replace both values in both diagonals of df with 0.
"""
"""
Input
"""
"""
df = pd.DataFrame(np.random.randint(1,100, 100).reshape(10, -1))
df
# 0 1 2 3 4 5 6 7 8 9
# 0 11 46 26 44 11 62 18 7... | [
37811,
198,
2791,
13,
1374,
284,
6330,
1111,
262,
2566,
1840,
874,
286,
1366,
14535,
351,
657,
30,
198,
37811,
198,
37811,
198,
28813,
22402,
5684,
25,
406,
17,
198,
37811,
198,
37811,
198,
3041,
5372,
1111,
3815,
287,
1111,
2566,
184... | 1.874172 | 755 |