content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from util.query import LogEntryQuery
import pandas as pd
| [
6738,
7736,
13,
22766,
1330,
5972,
30150,
20746,
198,
11748,
19798,
292,
355,
279,
67,
628
] | 3.625 | 16 |
# --------------
import pandas as pd
from sklearn.model_selection import train_test_split
#path - Path of file
df=pd.read_csv(path)
# Code starts here
X=df.iloc[:,1:-1]
y=df.iloc[:,-1]
X_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.3,random_state=0)
# --------------
import numpy as np
from sklearn... | [
2,
220,
26171,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
4512,
62,
9288,
62,
35312,
198,
2,
6978,
532,
10644,
286,
2393,
220,
198,
7568,
28,
30094,
13,
961,
62,
40664,
7,
6978,
8,
19... | 2.413357 | 1,108 |
# -*- encoding: utf-8 -*-
import os, sys
from .soxtypes import *
from .process import QueuedPopen
from subprocess import TimeoutExpired
__all__ = [ 'SoxProcess', 'Soxi', 'Play', 'Rec', 'SoxSource', 'SoxSink' ]
SOXPATH = os.environ.get('SOXPATH', os.path.dirname(sys.executable))
if sys.platform == 'win32' :
os... | [
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
11,
25064,
198,
198,
6738,
764,
568,
742,
9497,
1330,
1635,
198,
6738,
764,
14681,
1330,
4670,
1739,
47,
9654,
198,
6738,
850,
14681,
1330,
3862,
448,... | 2.176871 | 294 |
from .video_renderer import video_renderer_from_csv_files
from .config import read_configs
| [
6738,
764,
15588,
62,
10920,
11882,
1330,
2008,
62,
10920,
11882,
62,
6738,
62,
40664,
62,
16624,
198,
6738,
764,
11250,
1330,
1100,
62,
11250,
82,
198
] | 3.37037 | 27 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import time
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
7007,
198,
11748,
640,
628
] | 2.533333 | 30 |
"""
This module implements the univariate B-Spline basis class.
"""
import matplotlib.pyplot as plt
from scipy.interpolate import BSpline
import scipy.interpolate
import numpy as np
| [
37811,
198,
1212,
8265,
23986,
262,
555,
42524,
347,
12,
26568,
500,
4308,
1398,
13,
198,
198,
37811,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
629,
541,
88,
13,
3849,
16104,
378,
1330,
24218,
489,
500,
... | 3.172414 | 58 |
# Copyright (c) 2021 PaddlePaddle Authors. 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 app... | [
2,
220,
220,
15069,
357,
66,
8,
33448,
350,
37382,
47,
37382,
46665,
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,
... | 3.273885 | 314 |
# -*- coding: utf-8 -*-
# -*- author: GXR -*-
import json
from cookiespool.db import RedisClient
from login.sili.cookies import SiliCookies
if __name__ == '__main__':
generator = SiliCookiesGenerator()
generator.run()
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
532,
9,
12,
1772,
25,
402,
55,
49,
532,
9,
12,
198,
198,
11748,
33918,
198,
6738,
14746,
7742,
13,
9945,
1330,
2297,
271,
11792,
198,
6738,
17594,
13,
82,
2403,
... | 2.595506 | 89 |
# Class => Library
# Layers of abstraction => display available books, to lend a book, to add a book
# Class => Customer
# Layers of abstraction => request for a book, return a book
if __name__ == "__main__":
library = Library(['Think and grow rich', 'Who will cry when you die', 'For one more day'])
customer... | [
2,
5016,
5218,
10074,
198,
2,
406,
6962,
286,
34651,
5218,
3359,
1695,
3835,
11,
284,
22096,
257,
1492,
11,
284,
751,
257,
1492,
198,
198,
2,
5016,
5218,
22092,
198,
2,
406,
6962,
286,
34651,
5218,
2581,
329,
257,
1492,
11,
1441,
... | 2.460938 | 384 |
import re
from collections import namedtuple
from shoedog.consts import array_only_selectors, valid_ops, valid_selectors, integer_only_ops, array_only_ops
regexes = {
LineToks.RootQueryLine: re.compile(r'^query (?P<query_model>[A-Za-z]\w*) {$'),
LineToks.OpenObjectLine: re.compile(r'^(?P<rel>[A-Za-z]\w*)( \... | [
11748,
302,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
6738,
7354,
276,
519,
13,
1102,
6448,
1330,
7177,
62,
8807,
62,
19738,
669,
11,
4938,
62,
2840,
11,
4938,
62,
19738,
669,
11,
18253,
62,
8807,
62,
2840,
11,
7177,
62,
8807,
... | 2.295923 | 2,281 |
"""
Visualizing the Output of LDA Models
************************************
Functions and classes of this module are for visualizing LDA models. This is, \
except one function (:func:`plot_wordcloud`), based on the document-topics \
distribution DataFrame.
Contents
********
* :func:`plot_wordcloud` plots the to... | [
37811,
198,
36259,
2890,
262,
25235,
286,
406,
5631,
32329,
198,
17174,
2466,
198,
198,
24629,
2733,
290,
6097,
286,
428,
8265,
389,
329,
5874,
2890,
406,
5631,
4981,
13,
770,
318,
11,
3467,
198,
16341,
530,
2163,
357,
25,
20786,
25,
... | 2.209226 | 11,576 |
from setuptools import setup, find_packages
setup(
name='mimic',
version="0.0.1",
packages=find_packages(),
install_requires=['docutils'],
entry_points={
'console_scripts': [
'mimic=mimic:main',
],
},
)
| [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
76,
320,
291,
3256,
198,
220,
220,
220,
2196,
2625,
15,
13,
15,
13,
16,
1600,
198,
220,
220,
220,
10392,
28,
19796,
62,
4378... | 2.125 | 120 |
# def HasNewHeader(self):
# return self.hasNewHeader
# def ResourcesCount(self):
# return self.resourcesCount
# def Unknown(self):
# return self.unknown
# def Version(self):
# return self.version
| [
198,
220,
220,
220,
1303,
825,
7875,
3791,
39681,
7,
944,
2599,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
1441,
2116,
13,
10134,
3791,
39681,
628,
220,
220,
220,
1303,
825,
13864,
12332,
7,
944,
2599,
198,
220,
220,
220,
1303,
... | 2.505051 | 99 |
from airflow.operators.bash_operator import BaseOperator
from airflow.utils.decorators import apply_defaults
from hooks.neo4j_hook import Neo4jHook
from airflow.hooks.S3_hook import S3Hook
from tempfile import NamedTemporaryFile
import logging, csv, io
logger = logging.getLogger(__name__)
| [
6738,
45771,
13,
3575,
2024,
13,
41757,
62,
46616,
1330,
7308,
18843,
1352,
198,
6738,
45771,
13,
26791,
13,
12501,
273,
2024,
1330,
4174,
62,
12286,
82,
198,
6738,
26569,
13,
710,
78,
19,
73,
62,
25480,
1330,
21227,
19,
73,
39,
566... | 3.163043 | 92 |
'''
The MIT License (MIT)
Copyright (c) 2013 ImmobilienScout24
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 use, copy, modify, m... | [
7061,
6,
198,
464,
17168,
13789,
357,
36393,
8,
198,
198,
15269,
357,
66,
8,
2211,
9543,
25898,
2013,
3351,
448,
1731,
198,
198,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
1659,
428... | 3.882775 | 418 |
from ..models import swap_channel, leak_channel, get_flux_noise
import numpy as np
import math, random
| [
6738,
11485,
27530,
1330,
16075,
62,
17620,
11,
13044,
62,
17620,
11,
651,
62,
69,
22564,
62,
3919,
786,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
11,
4738,
198
] | 3.322581 | 31 |
from django.db import models
from django.utils import timezone
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
628,
628
] | 3.666667 | 18 |
def synapse_columns(table_meta, index_col):
"""map arrow types to synapse types"""
mapping = {
"string": "varchar(100)",
"double": "float",
"int64": "bigint",
"timestamp[ns]": "datetime",
"date32[day]": "date",
"bool": "bit",
}
result = ""
for col in ... | [
4299,
6171,
7512,
62,
28665,
82,
7,
11487,
62,
28961,
11,
6376,
62,
4033,
2599,
198,
220,
220,
220,
37227,
8899,
15452,
3858,
284,
6171,
7512,
3858,
37811,
198,
220,
220,
220,
16855,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220... | 2.081081 | 629 |
from .losses import *
from .scheduler import * | [
6738,
764,
22462,
274,
1330,
1635,
198,
6738,
764,
1416,
704,
18173,
1330,
1635
] | 3.285714 | 14 |
from docs_snippets_crag.concepts.io_management.load_from_config import execute_with_config
| [
6738,
34165,
62,
16184,
3974,
1039,
62,
6098,
363,
13,
43169,
82,
13,
952,
62,
27604,
13,
2220,
62,
6738,
62,
11250,
1330,
12260,
62,
4480,
62,
11250,
628
] | 3.172414 | 29 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###########################################################
# WARNING: Generated code! #
# ************************** #
# Manual changes may get lost if file is generated again. #
# Only code inside the [MANUAL] ta... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
29113,
14468,
7804,
21017,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
39410,
25,
... | 3.038071 | 394 |
while True:
try:
b = raw_input()
a = list(b)
a.reverse()
print ''.join(a)
except EOFError:
break
| [
4514,
6407,
25,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
275,
796,
8246,
62,
15414,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
257,
796,
1351,
7,
65,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2... | 1.673913 | 92 |
# Copyright (c) 2019 Andres Gomez Ramirez.
# All Rights Reserved.
from sklearn.linear_model import SGDClassifier
import pyprind
from sklearn import metrics
import numpy as np
import time
from arhuaco.analysis.features.data_helpers import DataHelpers
from arhuaco.analysis.features.w2v import W2V
from arhuaco.analysis.... | [
2,
15069,
357,
66,
8,
13130,
843,
411,
33231,
34783,
13,
198,
2,
1439,
6923,
33876,
13,
198,
198,
6738,
1341,
35720,
13,
29127,
62,
19849,
1330,
26147,
35,
9487,
7483,
198,
11748,
12972,
1050,
521,
198,
6738,
1341,
35720,
1330,
20731,... | 3.013333 | 150 |
#
# Example file for parsing and processing HTML
# (For Python 3.x, be sure to use the ExampleSnippets3.txt file)
from html.parser import HTMLParser
metacount = 0
if __name__ == "__main__":
main();
| [
2,
220,
198,
2,
17934,
2393,
329,
32096,
290,
7587,
11532,
198,
2,
357,
1890,
11361,
513,
13,
87,
11,
307,
1654,
284,
779,
262,
17934,
16501,
3974,
1039,
18,
13,
14116,
2393,
8,
198,
6738,
27711,
13,
48610,
1330,
11532,
46677,
198,
... | 2.890411 | 73 |
#
# BitBake Graphical GTK based Dependency Explorer
#
# Copyright (C) 2007 Ross Burton
# Copyright (C) 2007 - 2008 Richard Purdie
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundatio... | [
2,
198,
2,
4722,
33,
539,
29681,
605,
7963,
42,
1912,
37947,
1387,
19142,
198,
2,
198,
2,
15069,
357,
34,
8,
4343,
220,
220,
220,
220,
220,
220,
220,
9847,
27209,
198,
2,
15069,
357,
34,
8,
4343,
532,
3648,
6219,
350,
2799,
494,... | 3.314381 | 299 |
"""Toio as a mouse
Move - move
Tap - click
Rotate - scroll
Note:
- Install pyuserinput (pip install pyuserinput) before running.
- Be careful, it may move when you don't want!
"""
import logging as log
from functools import partial
from random import randint, random
from time import sleep, time
from typing import Opt... | [
37811,
2514,
952,
355,
257,
10211,
198,
198,
21774,
532,
1445,
198,
45081,
532,
3904,
198,
24864,
378,
532,
10743,
198,
198,
6425,
25,
198,
12,
15545,
12972,
7220,
15414,
357,
79,
541,
2721,
12972,
7220,
15414,
8,
878,
2491,
13,
198,
... | 2.762295 | 366 |
import tkinter as tk
# --- main ---
root = tk.Tk()
cal = Calc(root)
root.mainloop()
| [
11748,
256,
74,
3849,
355,
256,
74,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
2,
11420,
1388,
11420,
198,
198,
15763,
796,
256,
74,
13,
51,
74,
3419,
198,
9948,
796,
2199,
66,
7,
15763,
8,
198,
15763,... | 1.96 | 50 |
from utils import Utils
from articlereader import ArticleReader
import listener
| [
6738,
3384,
4487,
1330,
7273,
4487,
198,
6738,
2708,
46862,
1330,
10172,
33634,
198,
11748,
24783,
198
] | 4.705882 | 17 |
from turtle import *
LONGUEUR = 100
LARGEUR = 20
class Rectangle:
"""Classe modélisant un rectangle"""
compteur = 0
# Constructeur
def __init__(self, l, h, a, o, c):
"""Initialise les valeurs des attributs"""
self.largeur = l
self.hauteur = h
self.abscisse = a... | [
6738,
28699,
1330,
1635,
198,
198,
43,
18494,
8924,
4261,
796,
1802,
198,
43,
1503,
8264,
4261,
796,
1160,
198,
198,
4871,
48599,
9248,
25,
198,
220,
220,
220,
37227,
2601,
21612,
953,
2634,
27999,
415,
555,
35991,
37811,
198,
220,
22... | 2.194444 | 396 |
import aerosandbox.numpy as np
import pytest
if __name__ == '__main__':
pytest.main()
| [
11748,
41376,
392,
3524,
13,
77,
32152,
355,
45941,
198,
11748,
12972,
9288,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
12972,
9288,
13,
12417,
3419,
198
] | 2.611111 | 36 |
import torch
from torch import nn
class CBOWClassifier(nn.Module):
"""
Continuous bag of words classifier.
"""
def __init__(self, hidden_size, input_size, max_pool, dropout=0.5):
"""
:param hidden_size:
:param input_size:
:param max_pool: if true then max pool over word ... | [
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
198,
4871,
10078,
3913,
9487,
7483,
7,
20471,
13,
26796,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
45012,
6131,
286,
2456,
1398,
7483,
13,
198,
220,
220,
220,
37227,
198,
... | 2.094595 | 370 |
# -*- coding: utf-8 -*-
# Originally written by Kevin Breen (@KevTheHermit):
# https://github.com/kevthehermit/RATDecoders/blob/master/Bozok.py
import pefile
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
19486,
3194,
416,
7939,
347,
1361,
4275,
42,
1990,
464,
9360,
2781,
2599,
198,
2,
3740,
1378,
12567,
13,
785,
14,
365,
85,
1169,
372,
2781,
14,
49,
1404,
10707,
3... | 2.476923 | 65 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
import asyncore
import logging
import sys
logging.basicConfig(level=logging.DEBUG,
format='[*] %(name)s - %(funcName)16s - %(message)s')
class ConsoleHandler(asyncore.file_dispatcher):
"""Enable console interactive for socket read/write.
"""
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
23,
532,
9,
12,
198,
198,
11748,
355,
2047,
7295,
198,
11748,
18931,
198,
11748,
25064,
628,
198,
6404,
2667,
13,
35487,
16934,
7,
5715,
28,
640... | 2.554878 | 820 |
import os
import sys
import re
import logging
from git import Repo, GitConfigParser
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.INFO)
if __name__ == '__main__':
logging.info("Locating git repo...")
repo = Repo(os.getcwd())
rc = 1
if not check_local_user(repo):
i... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
302,
198,
11748,
18931,
198,
198,
6738,
17606,
1330,
1432,
78,
11,
15151,
16934,
46677,
198,
198,
6404,
2667,
13,
35487,
16934,
7,
18982,
11639,
4,
7,
5715,
3672,
8,
82,
25,
4,
7,
20500,
... | 2.244526 | 274 |
"""
generate_model_v_slices.py: generate the vertical slices for the model.
"""
from os.path import basename, dirname, join
import click
import numpy as np
import pygmt
import sh
import tqdm
import xarray as xr
from PyPDF2 import PdfFileMerger
from ... import get_data
from .generate_model_h_slices import plot_single_f... | [
37811,
198,
8612,
378,
62,
19849,
62,
85,
62,
82,
677,
274,
13,
9078,
25,
7716,
262,
11723,
24314,
329,
262,
2746,
13,
198,
37811,
198,
6738,
28686,
13,
6978,
1330,
1615,
12453,
11,
26672,
3672,
11,
4654,
198,
198,
11748,
3904,
198,... | 2.688917 | 794 |
#!/usr/bin/env python
"""This script generates personal info for mocking purpose"""
import uuid
import argparse
from mimesis import Personal
def parse_args():
"""Configure parser and parse command line arguments"""
parser = argparse.ArgumentParser(description='Generate mock data.')
parser.add_argument('fi... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
1212,
4226,
18616,
2614,
7508,
329,
31202,
4007,
37811,
198,
198,
11748,
334,
27112,
198,
11748,
1822,
29572,
198,
6738,
285,
999,
271,
1330,
15644,
198,
198,
4299,
21136,
62,
220... | 2.495012 | 802 |
#!/usr/bin/env python
from argparse import Action, _copy, _ensure_value, ArgumentParser
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
1822,
29572,
1330,
7561,
11,
4808,
30073,
11,
4808,
641,
495,
62,
8367,
11,
45751,
46677,
198
] | 3.178571 | 28 |
#!/usr/bin/env python
from distutils.core import setup
from Kirss.kirss import VERSION
setup(name="kirss",
version=VERSION,
license="BSD",
description="A simple RSS aggregator.",
long_description="A simple RSS aggregator that outputs a HTML file.",
author="Nathan Jones",
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
1233,
26791,
13,
7295,
1330,
9058,
198,
6738,
7385,
824,
13,
74,
343,
824,
1330,
44156,
2849,
198,
198,
40406,
7,
3672,
2625,
74,
343,
824,
1600,
198,
220,
220,
220,
220,
... | 2.216393 | 305 |
# Generated by Django 3.2.6 on 2021-08-06 23:57
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
21,
319,
33448,
12,
2919,
12,
3312,
2242,
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 |
# Code generated by lark_sdk_gen. DO NOT EDIT.
from pylark.lark_request import RawRequestReq, _new_method_option
from pylark import lark_type, lark_type_sheet, lark_type_approval
import attr
import typing
import io
@attr.s
@attr.s
| [
2,
6127,
7560,
416,
300,
668,
62,
21282,
74,
62,
5235,
13,
8410,
5626,
48483,
13,
198,
198,
6738,
279,
2645,
668,
13,
75,
668,
62,
25927,
1330,
16089,
18453,
3041,
80,
11,
4808,
3605,
62,
24396,
62,
18076,
198,
6738,
279,
2645,
66... | 2.724138 | 87 |
from google.appengine.ext import ndb
__author__ = 'Bodil'
| [
6738,
23645,
13,
1324,
18392,
13,
2302,
1330,
299,
9945,
198,
198,
834,
9800,
834,
796,
705,
33,
375,
346,
6,
628,
198
] | 2.652174 | 23 |
from os import makedirs
from os.path import dirname, exists
import sys
import json
import argparse
import numpy as np
import bpy
from mathutils import Matrix
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--anno_idx', type=int, default=0,
help='... | [
6738,
28686,
1330,
285,
4335,
17062,
198,
6738,
28686,
13,
6978,
1330,
26672,
3672,
11,
7160,
198,
11748,
25064,
198,
11748,
33918,
198,
11748,
1822,
29572,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
275,
9078,
198,
6738,
10688,
2679... | 2.32 | 350 |
#!/usr/bin/env python3
"""
Tests for reStructuredText translator and writer
"""
import locale
import unittest
from docutils import nodes
from kiroku import rest
class Mock(object):
"""Simple class for creating mocks"""
class MockDocument(object):
"""Mock the document"""
def walkabout(self, visitor):
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
51,
3558,
329,
302,
44909,
1522,
8206,
33417,
290,
6260,
198,
37811,
198,
11748,
36693,
198,
11748,
555,
715,
395,
198,
198,
6738,
2205,
26791,
1330,
13760,
198,
198,
6... | 2.261945 | 3,516 |
"""Tests code snippets from example folder"""
import pytest # noqa
import os
import sys
import glob
import importlib as imp
| [
37811,
51,
3558,
2438,
45114,
422,
1672,
9483,
37811,
198,
198,
11748,
12972,
9288,
220,
220,
1303,
645,
20402,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
15095,
198,
11748,
1330,
8019,
355,
848,
198
] | 3.628571 | 35 |
"""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
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... | [
37811,
15269,
12131,
3012,
11419,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
5832,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
1639,
743,
7330,
... | 4.5875 | 240 |
from abc import ABC
from typing import Any, Dict, List, Tuple
import gym.spaces
from pettingzoo.utils.env import AECEnv
from pettingzoo.utils.wrappers import BaseWrapper
class PettingZooEnv(AECEnv, ABC):
"""The interface for petting zoo environments.
Multi-agent environments must be wrapped as
:class:`~... | [
6738,
450,
66,
1330,
9738,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
7343,
11,
309,
29291,
198,
198,
11748,
11550,
13,
2777,
2114,
198,
6738,
4273,
889,
89,
2238,
13,
26791,
13,
24330,
1330,
317,
2943,
4834,
85,
198,
6738,
427... | 2.636691 | 278 |
from __future__ import print_function, absolute_import, division # makes KratosMultiphysics backward compatible with python 2.6 and 2.7
#import kratos core and applications
import KratosMultiphysics
import KratosMultiphysics.PfemApplication as KratosPfem
## All the processes python should be derived from "Process"
| [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
4112,
62,
11748,
11,
7297,
220,
1303,
1838,
509,
10366,
418,
15205,
13323,
23154,
19528,
11670,
351,
21015,
362,
13,
21,
290,
362,
13,
22,
198,
2,
11748,
479,
10366,
418,
4755,
290,
... | 3.697674 | 86 |
import numpy as np
import cv2
from matplotlib import pyplot as plt
img_idx = 0
img_idx = str(img_idx).zfill(10)
imgL = cv2.imread(f'left/{img_idx}.png',0)
imgR = cv2.imread(f'right/{img_idx}.png',0)
stereo = cv2.StereoBM_create(numDisparities=64, blockSize=15)
disparity = stereo.compute(imgL,imgR)
print(disparity.sh... | [
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
198,
9600,
62,
312,
87,
796,
657,
198,
9600,
62,
312,
87,
796,
965,
7,
9600,
62,
312,
87,
737,
89,
20797,... | 2.153846 | 169 |
import logging
import requests
import os
from bs4 import BeautifulSoup
from mailingshark.datacollection.common import find_month_were_mailing_list_was_last_parsed
from mailingshark.datacollection.basedatacollector import BaseDataCollector
logger = logging.getLogger('backend')
COMPRESSED_TYPES = ['.gz', '.bz2', '.z... | [
11748,
18931,
198,
198,
11748,
7007,
198,
11748,
28686,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
198,
6738,
6920,
654,
71,
668,
13,
19608,
330,
349,
1564,
13,
11321,
1330,
1064,
62,
8424,
62,
22474,
62,
4529,
278,
62,
48... | 2.256679 | 2,096 |
# Copyright (c) ZenML GmbH 2021. 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:
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | [
2,
220,
15069,
357,
66,
8,
14760,
5805,
402,
2022,
39,
33448,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
345,
743,
407,
779,
... | 2.551146 | 1,789 |
if __name__ == "__main__":
main()
| [
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 2.105263 | 19 |
from pyspark.sql import SparkSession
from pyspark.sql.types import *
from mine import killer
def main():
"""
Fill in this function.
1. Write a function in a separate file that will be used in a DataFrame map operation.
2. Create a dataframe with words.
3. Use function for map operation.
NOTE: Use Lambdas... | [
6738,
279,
893,
20928,
13,
25410,
1330,
17732,
36044,
198,
6738,
279,
893,
20928,
13,
25410,
13,
19199,
1330,
1635,
198,
6738,
6164,
1330,
11868,
198,
198,
4299,
1388,
33529,
198,
220,
37227,
198,
220,
27845,
287,
428,
2163,
13,
628,
... | 2.903537 | 311 |
"""Dataverse data model tests."""
from pyDataverse.models import DVObject
class TestDVObject(object):
"""Tests for :class:DVObject()."""
def test_dataverse_init(self):
"""Test Dataverse.__init__()."""
obj = DVObject()
assert not hasattr(obj, "default_json_format")
assert not ... | [
37811,
6601,
4399,
1366,
2746,
5254,
526,
15931,
198,
6738,
12972,
6601,
4399,
13,
27530,
1330,
29854,
10267,
628,
198,
4871,
6208,
35,
53,
10267,
7,
15252,
2599,
198,
220,
220,
220,
37227,
51,
3558,
329,
1058,
4871,
25,
35,
53,
10267... | 2.582888 | 187 |
SPACE='darts'
DATASET='cifar10'
TASK1='psd5000'
TASK2='cls'
input_dir=f'configs/sample_based/{SPACE}/{DATASET}/{TASK1}/'
T1_dir=f'results/sample_based/{SPACE}/{DATASET}/{TASK1}/'
T2_dir=f'results/sample_based/{SPACE}/{DATASET}/{TASK2}/'
import numpy as np
import os,sys
import scipy.stats
file_list=np.load(f'c... | [
4303,
11598,
11639,
67,
5889,
6,
201,
198,
35,
1404,
1921,
2767,
11639,
66,
361,
283,
940,
6,
201,
198,
51,
1921,
42,
16,
11639,
862,
67,
27641,
6,
201,
198,
51,
1921,
42,
17,
11639,
565,
82,
6,
201,
198,
15414,
62,
15908,
28,
... | 1.774092 | 633 |
import uuid
from flask import request
from sqlalchemy.exc import IntegrityError
from werkzeug.exceptions import BadRequest, Forbidden
from werkzeug.security import generate_password_hash, check_password_hash
from db import db
from managers.auth import auth, AuthManager
from models import SecretModel
from schemas.resp... | [
11748,
334,
27112,
198,
198,
6738,
42903,
1330,
2581,
198,
6738,
44161,
282,
26599,
13,
41194,
1330,
39348,
12331,
198,
6738,
266,
9587,
2736,
1018,
13,
1069,
11755,
1330,
7772,
18453,
11,
46014,
198,
6738,
266,
9587,
2736,
1018,
13,
12... | 2.414141 | 1,485 |
import unittest
from textmagic.rest import TextmagicRestClient
from textmagic.rest.models import User, SpendingStat, MessagingStat, Invoice, Number, Senderid, Source
from textmagic import TextmagicException
import time
| [
11748,
555,
715,
395,
198,
6738,
2420,
32707,
13,
2118,
1330,
8255,
32707,
19452,
11792,
198,
6738,
2420,
32707,
13,
2118,
13,
27530,
1330,
11787,
11,
43902,
17126,
11,
10626,
3039,
17126,
11,
10001,
2942,
11,
7913,
11,
311,
2194,
312,
... | 3.946429 | 56 |
import esphome.codegen as cg
from esphome.components import media_player
import esphome.config_validation as cv
from esphome import pins
from esphome.const import CONF_ID, CONF_MODE
from esphome.core import CORE
CODEOWNERS = ["@jesserockz"]
DEPENDENCIES = ["esp32"]
i2s_audio_ns = cg.esphome_ns.namespace("i2s_audio"... | [
11748,
1658,
746,
462,
13,
8189,
5235,
355,
269,
70,
198,
6738,
1658,
746,
462,
13,
5589,
3906,
1330,
2056,
62,
7829,
198,
11748,
1658,
746,
462,
13,
11250,
62,
12102,
341,
355,
269,
85,
198,
198,
6738,
1658,
746,
462,
1330,
20567,
... | 1.663736 | 1,365 |
#!/usr/bin/env python
""" Plot package for the jet-hadron correlation analysis.
.. codeauthor:: Raymond Ehlers <raymond.ehlers@cern.ch>, Yale University
"""
__all__ = [
"base",
"correlations",
"extracted",
"fit",
"general",
"generic_hist",
"highlight_RPF",
"root_base",
]
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
28114,
5301,
329,
262,
12644,
12,
18108,
1313,
16096,
3781,
13,
198,
198,
492,
2438,
9800,
3712,
24238,
31480,
8116,
1279,
2433,
6327,
13,
17231,
8116,
31,
30903,
13,
354,
... | 2.516393 | 122 |
import os
import geopandas as gpd
import pytest
import xarray
from dateutil.parser import parse
from numpy.testing import assert_array_equal
from geocube.xarray_extensions import vectorxarray
from test.conftest import TEST_INPUT_DATA_DIR
| [
11748,
28686,
198,
198,
11748,
30324,
392,
292,
355,
27809,
67,
198,
11748,
12972,
9288,
198,
11748,
2124,
18747,
198,
6738,
3128,
22602,
13,
48610,
1330,
21136,
198,
6738,
299,
32152,
13,
33407,
1330,
6818,
62,
18747,
62,
40496,
198,
1... | 3.310811 | 74 |
import argparse
import datetime
import itertools
import math
import sys
import tornado
from six import print_
import six
from . import Client, Pipeline, PubSubClient
if __name__ == '__main__':
main()
| [
11748,
1822,
29572,
198,
11748,
4818,
8079,
198,
11748,
340,
861,
10141,
198,
11748,
10688,
198,
11748,
25064,
198,
11748,
33718,
198,
6738,
2237,
1330,
3601,
62,
198,
11748,
2237,
198,
198,
6738,
764,
1330,
20985,
11,
37709,
11,
8525,
... | 3.349206 | 63 |
"""
xarray-simlab.
"""
# flake8: noqa
from .hook import RuntimeHook, runtime_hook
from .model import Model
from .process import (
filter_variables,
process,
process_info,
runtime,
RuntimeSignal,
variable_info,
)
from .variable import (
any_object,
variable,
index,
on_demand,
... | [
37811,
198,
87,
18747,
12,
14323,
23912,
13,
198,
198,
37811,
198,
2,
781,
539,
23,
25,
645,
20402,
198,
198,
6738,
764,
25480,
1330,
43160,
39,
566,
11,
19124,
62,
25480,
198,
6738,
764,
19849,
1330,
9104,
198,
6738,
764,
14681,
13... | 2.767932 | 237 |
"""
Projects v3
"""
from typing import List, Dict
from ..api_base import ApiBase
class Projects(ApiBase):
"""Class for Projects APIs."""
POST_PROJECTS = '/v3/projects'
GET_PROJECTS = '/v3/projects'
def get(self, limit: int = None, offset: int = None, **kwargs) -> Dict:
"""
Get Proje... | [
37811,
198,
16775,
82,
410,
18,
198,
37811,
198,
6738,
19720,
1330,
7343,
11,
360,
713,
198,
198,
6738,
11485,
15042,
62,
8692,
1330,
5949,
72,
14881,
628,
198,
4871,
29898,
7,
32,
14415,
14881,
2599,
198,
220,
220,
220,
37227,
9487,
... | 2.255507 | 454 |
import scrapy
import traceback
from hpoi.items import MetaDataItem
| [
11748,
15881,
88,
198,
11748,
12854,
1891,
198,
6738,
289,
7501,
72,
13,
23814,
1330,
30277,
6601,
7449,
628
] | 3.578947 | 19 |
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.nn.utils.rnn import pad_packed_sequence as unpack
from torch.nn.utils.rnn import pack_padded_sequence as pack
import math
from vgg import *
from resnet import *
class CharModel(nn.Module):
"""
This is used for L-Char-LSTM and L-W... | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
35748,
198,
6738,
28034,
13,
20471,
13,
26791,
13,
81,
20471,
1330,
14841,
62,
34860,
62,
43167,
355,
555,
8002,
198,
6738,
28034,
... | 2.889831 | 118 |
#!/usr/bin/env python2
#Ping alert code by Jeff to play a sound when the sub appears
import datetime
import os
import socket
import sys
import time
import pygame
if len(sys.argv) > 1 and sys.argv[1] == "mini":
subaddress = "192.168.0.91"
else:
subaddress = "192.168.0.93"
s = socket.socket()
s.settimeout(0.... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
198,
2,
49806,
7995,
2438,
416,
5502,
284,
711,
257,
2128,
618,
262,
850,
3568,
198,
198,
11748,
4818,
8079,
198,
11748,
28686,
198,
11748,
17802,
198,
11748,
25064,
198,
11748,
64... | 2.291498 | 247 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import getopt, sys
import optparse
import psycopg2
import shlex, subprocess
import time
from random import randint
import json
connstr_pipedb = "host=localhost port=5433 dbname={0}"
if __name__ == "__main__":
import sys
main(sys.argv[1:])
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
651,
8738,
11,
25064,
198,
11748,
2172,
29572,
198,
11748,
17331,
22163,
70,
17,
198,
11748,
427,
2588,
11,... | 2.622807 | 114 |
from django.contrib import admin
from .models import Owner, Auto, Drivel, Possession
# Register your models here.
admin.site.register(Owner)
admin.site.register(Auto)
admin.site.register(Drivel)
admin.site.register(Possession)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
27530,
1330,
23853,
11,
11160,
11,
5809,
626,
11,
29265,
2521,
198,
198,
2,
17296,
534,
4981,
994,
13,
198,
28482,
13,
15654,
13,
30238,
7,
42419,
8,
198,
28482,
13,
15... | 3.285714 | 70 |
#!/usr/bin/env python3
# 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 itertools
import os
import stat
from typing import Iterable, NamedTuple, Optional, Union
from antlir.compiler.r... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
198,
2,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
17168,
5964,
1043,
287,
262,
198,
2,
38559,
24290,
2393,
... | 2.429955 | 1,342 |
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils.dates import MONTHS
from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.db.models import (
Model,
CASCAD... | [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
12582,
355,
4808,
198,
6738,
42625,
14208,
13,
26791,
13,
19581,
1330,
25000,
4221,
50,
198,
6738,
42625,
14208,
13... | 2.509878 | 1,063 |
import calendar
from itertools import izip_longest
import json
from kivy.clock import Clock
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.spinner import Spinner
import os
import time
from graph import Graph, MeshLinePlot, MeshStemPlot, SmoothLinePlot
from kivy.uix.boxlayout i... | [
11748,
11845,
198,
6738,
340,
861,
10141,
1330,
220,
528,
541,
62,
6511,
395,
198,
11748,
33918,
198,
6738,
479,
452,
88,
13,
15750,
1330,
21328,
198,
6738,
479,
452,
88,
13,
84,
844,
13,
25928,
39786,
1330,
24846,
32517,
198,
6738,
... | 3.191388 | 209 |
"""
A 2d grid map of m rows and n columns is initially filled with water.
We may perform an addLand operation which turns the water at position
(row, col) into a land. Given a list of positions to operate,
count the number of islands after each addLand operation.
An island is surrounded by water and is formed by connec... | [
37811,
198,
32,
362,
67,
10706,
3975,
286,
285,
15274,
290,
299,
15180,
318,
7317,
5901,
351,
1660,
13,
198,
1135,
743,
1620,
281,
751,
22342,
4905,
543,
4962,
262,
1660,
379,
2292,
198,
7,
808,
11,
951,
8,
656,
257,
1956,
13,
112... | 3.027933 | 358 |
# -*- coding: utf-8 -*-
from datetime import datetime
from odoo import models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
16298,
2238,
1330,
4981,
198
] | 2.888889 | 27 |
# Practica de listas 2
print("Please enter the items of the shopping list (type: Quit to finish):")
shopping_list = []
item = None
while item != "Quit":
item = input("Item: ")
if item != "Quit":
shopping_list.append(item)
print("The shopping list is: ")
for item in shopping_list:
print(item)
pr... | [
2,
13672,
3970,
390,
1351,
292,
362,
198,
198,
4798,
7203,
5492,
3802,
262,
3709,
286,
262,
9735,
1351,
357,
4906,
25,
48887,
284,
5461,
2599,
4943,
198,
198,
1477,
33307,
62,
4868,
796,
17635,
198,
9186,
796,
6045,
628,
198,
4514,
... | 2.828125 | 256 |
from django import template
from ..models import Category
register = template.Library()
@register.simple_tag | [
6738,
42625,
14208,
1330,
11055,
198,
6738,
11485,
27530,
1330,
21743,
198,
198,
30238,
796,
11055,
13,
23377,
3419,
198,
198,
31,
30238,
13,
36439,
62,
12985
] | 4.074074 | 27 |
from common_utils.misc import find_registered
registered_commands, registered_steps = find_registered(__file__, 'zci_bio.ncbi')
| [
6738,
2219,
62,
26791,
13,
44374,
1330,
1064,
62,
33736,
198,
33736,
62,
9503,
1746,
11,
6823,
62,
20214,
796,
1064,
62,
33736,
7,
834,
7753,
834,
11,
705,
89,
979,
62,
65,
952,
13,
10782,
8482,
11537,
198
] | 3.282051 | 39 |
##USAGE: python -m start_main_controller.py
from TapGameController.TapGameFSM import TapGameFSM
from TapGameController.TapGamePosttestFSM import TapGamePosttestFSM
from TapGameController.TapGamePracticeFSM import TapGamePracticeFSM
from unity_game_msgs.msg import TapGameCommand
import rospy
import time
import signal
i... | [
2235,
2937,
11879,
25,
21015,
532,
76,
923,
62,
12417,
62,
36500,
13,
9078,
198,
198,
6738,
16880,
8777,
22130,
13,
45081,
8777,
10652,
44,
1330,
16880,
8777,
10652,
44,
198,
6738,
16880,
8777,
22130,
13,
45081,
8777,
6307,
9288,
10652,... | 2.691964 | 224 |
"""
Support for Harmony Hub devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/remote.harmony/
"""
import asyncio
import json
import logging
import voluptuous as vol
from homeassistant.components import remote
from homeassistant.components.remote ... | [
37811,
198,
15514,
329,
35088,
14699,
4410,
13,
198,
198,
1890,
517,
3307,
546,
428,
3859,
11,
3387,
3522,
284,
262,
10314,
379,
198,
5450,
1378,
11195,
12,
562,
10167,
13,
952,
14,
5589,
3906,
14,
47960,
13,
29155,
1647,
14,
198,
3... | 2.158151 | 6,576 |
import contextlib
@contextlib.contextmanager
with logentrance():
print('This is inside')
@contextlib.contextmanager
with logentrance():
raise Exception('This is an error')
| [
11748,
4732,
8019,
198,
198,
31,
22866,
8019,
13,
22866,
37153,
628,
198,
4480,
2604,
298,
8132,
33529,
198,
220,
220,
3601,
10786,
1212,
318,
2641,
11537,
628,
198,
31,
22866,
8019,
13,
22866,
37153,
628,
198,
4480,
2604,
298,
8132,
... | 3.4 | 55 |
from os import device_encoding
import cv2 # OpenCV
import matplotlib as mtplb
import numpy as np
import argparse as ap
import pathlib
from matplotlib import pyplot as plt
import os
import sys
sys.path.append(".")
from tools.utils.process_text_file import ProcessTextFile
from tools.algo.perspective_projection import Pe... | [
6738,
28686,
1330,
3335,
62,
12685,
7656,
198,
11748,
269,
85,
17,
1303,
4946,
33538,
198,
11748,
2603,
29487,
8019,
355,
45079,
489,
65,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
1822,
29572,
355,
2471,
198,
11748,
3108,
8019,
19... | 2.578749 | 1,327 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
import sys
from notmuchtask.messages.eml_parser import get_email_parser
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
6738,
407,
29482,
35943,
13,
37348,
1095,
13,
368,
7... | 2.740741 | 54 |
from flask import Flask
import os
from flask_cors import CORS
from pathlib import Path
from Code.Users import Users
__CWD__ = os.getcwd()
UPLOAD_FOLDER = str(Path.cwd() / "uploads")
CODE_FOLDER = str(Path.cwd() / "Code")
ETK_PATH = str(Path.cwd().parent / "etk")
DOWNLOAD_FOLDER = str(Path.cwd() / "downloads")
__users__... | [
6738,
42903,
1330,
46947,
198,
11748,
28686,
198,
6738,
42903,
62,
66,
669,
1330,
327,
20673,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
6127,
13,
14490,
1330,
18987,
198,
834,
34,
22332,
834,
796,
28686,
13,
1136,
66,
16993,
3419,
... | 2.588652 | 282 |
"""
Interface to the NumPyro team model in bpl-next:
https://github.com/anguswilliams91/bpl-next
"""
import numpy as np
import pandas as pd
from bpl import ExtendedDixonColesMatchPredictor
from airsenal.framework.schema import FifaTeamRating, Result, session
from airsenal.framework.season import CURRENT_SEASON, get_te... | [
37811,
198,
39317,
284,
262,
31835,
20519,
305,
1074,
2746,
287,
275,
489,
12,
19545,
25,
198,
5450,
1378,
12567,
13,
785,
14,
648,
385,
10594,
1789,
82,
6420,
14,
65,
489,
12,
19545,
198,
37811,
198,
11748,
299,
32152,
355,
45941,
... | 2.427599 | 2,203 |
# Generated by Django 2.2.24 on 2021-08-16 14:48
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
1731,
319,
33448,
12,
2919,
12,
1433,
1478,
25,
2780,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.875 | 32 |
import argparse
import configparser
import errno
import logging
import os
import psutil
import re
import sys
import time
from pprint import pprint
from train import train
def maybe_restart(args):
"""Restarts the current program, with file objects and descriptors
cleanup
"""
env = os.environ
ar... | [
11748,
1822,
29572,
198,
11748,
4566,
48610,
198,
11748,
11454,
3919,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
26692,
22602,
198,
11748,
302,
198,
11748,
25064,
198,
11748,
640,
198,
198,
6738,
279,
4798,
1330,
279,
4798,
198,
67... | 2.187209 | 860 |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019-2020 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of th... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
6738,
11593,
37443,
834,
1330,
357,
48546,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
8,
198,
2,
15069,
13130,
12,
42334,
6401,
42504,
11,
3457,
13,
198,
2,
198,
2,
770,
1430,
318,
1479,
37... | 1.249095 | 256,505 |
"""
转换Excel中列的名字为数字。
比如 A = 1,AA=27等等
A, B, C ... X, Y, Z, AA, AB, AC ... AY, AZ, BA, BB ... BZ ... ZY, ZZ, AAA ...
(26 进制转为 10 进制)
"""
| [
37811,
198,
164,
121,
105,
162,
235,
95,
3109,
5276,
40792,
26344,
245,
21410,
28938,
235,
27764,
245,
10310,
118,
46763,
108,
27764,
245,
16764,
198,
162,
107,
242,
36685,
224,
317,
796,
352,
171,
120,
234,
3838,
28,
1983,
163,
255,
... | 1.268519 | 108 |
from itertools import combinations
s, k = input().split()
for i in range(int(k)):
for j in combinations(sorted(s), i+1):
print (''.join(j))
#https://www.hackerrank.com/challenges/itertools-combinations/problem?isFullScreen=true | [
6738,
340,
861,
10141,
1330,
17790,
198,
82,
11,
479,
796,
5128,
22446,
35312,
3419,
220,
198,
1640,
1312,
287,
2837,
7,
600,
7,
74,
8,
2599,
198,
220,
220,
220,
329,
474,
287,
17790,
7,
82,
9741,
7,
82,
828,
1312,
10,
16,
2599,... | 2.623656 | 93 |
import os
import psutil
import sys
import pynvml as nv # nvidia-ml-py3
from collections import namedtuple
from contextlib import contextmanager
from pathlib import Path
from typing import Sequence, List, Optional, Dict, Union
from colored import fg, bg, attr, names # https://gitlab.com/dslackw/colored
from .gpu_print... | [
11748,
28686,
198,
11748,
26692,
22602,
198,
11748,
25064,
198,
11748,
279,
2047,
85,
4029,
355,
299,
85,
220,
1303,
299,
21744,
12,
4029,
12,
9078,
18,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
6738,
4732,
8019,
1330,
4732,
37153,
... | 2.41365 | 2,652 |
from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals
from random import randint #, shuffle, sample
import numpy as np
import pytest
from mmgroup import MM0, MMSpace, Cocode, MMV
from mmgroup.clifford12 import leech2matrix_eval_A_odd_mod15_aux
from mmgroup.mm im... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
220,
28000,
1098,
62,
17201,
874,
628,
198,
198,
6738,
4738,
1330,
43720,
600,
1303,
11,
36273,
11,
6291,
628,
198,
1174... | 1.456729 | 3,455 |
# n : the length in input string
## Time Complexity: O( n )
#
# The overhead in time is the for loop itertaions, which is of O( n )
## Space Complexity: O( 1 )
#
# The oberhead in space is to maintain variable for counter, which is of O( 1 )
if __name__ == '__main__':
test_bench() | [
198,
198,
2,
299,
1058,
262,
4129,
287,
5128,
4731,
198,
198,
2235,
3862,
19157,
414,
25,
440,
7,
299,
1267,
198,
2,
198,
2,
383,
16965,
287,
640,
318,
262,
329,
9052,
340,
861,
64,
507,
11,
543,
318,
286,
440,
7,
299,
1267,
1... | 2.910891 | 101 |
from States import State
from util.sequence import Sequence, ControlStep
from util.vec import Vec3
from util.orientation import Orientation
from rlbot.agents.base_agent import BaseAgent, SimpleControllerState
from rlbot.utils.structures.game_data_struct import BoostPadState
| [
6738,
1829,
1330,
1812,
198,
6738,
7736,
13,
43167,
1330,
45835,
11,
6779,
8600,
198,
6738,
7736,
13,
35138,
1330,
38692,
18,
198,
6738,
7736,
13,
13989,
341,
1330,
35275,
341,
198,
6738,
374,
75,
13645,
13,
49638,
13,
8692,
62,
25781... | 3.942857 | 70 |
from django.db import models
from django.contrib.auth.models import User
import datetime as dt
from tinymce.models import HTMLField
from django.db.models.signals import post_save,post_delete
from django.dispatch import receiver
# Create your models here. | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
11748,
4818,
8079,
355,
288,
83,
198,
6738,
7009,
76,
344,
13,
27530,
1330,
11532,
15878,
198,
6738,
42625,
14208,... | 3.493151 | 73 |
import os
import os.path
from multiprocessing import Pool
import time
import numpy as np
import cv2
if __name__=='__main__':
main()
| [
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
6738,
18540,
305,
919,
278,
1330,
19850,
198,
11748,
640,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
628,
198,
361,
11593,
3672,
834,
855,
6,
834,
12417,
834,
10354,
19... | 2.875 | 48 |
from selenium import webdriver
from pyvirtualdisplay import Display
display = Display(visible=0, size=(1000, 1000))
display.start()
browser = webdriver.Firefox()
browser.get('http://torypeterschild.io/')
browser.save_screenshot('screenie.png')
browser.quit()
display.stop() | [
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
12972,
32844,
13812,
1330,
16531,
198,
198,
13812,
796,
16531,
7,
23504,
28,
15,
11,
2546,
16193,
12825,
11,
8576,
4008,
198,
13812,
13,
9688,
3419,
198,
198,
40259,
796,
3992,
26230... | 3.247059 | 85 |
# -*- coding: utf-8 -*-
"""
.. created on Wed Feb 14 19:42:43 2018
.. author: PE LLC peswin@mindspring.com
.. copyright: 2018, Howard Dunn. Apache 2.0 v2 licensed.
"""
from version import __version__
import os
import json
from build import genOutFilePath, StartBuild
from makedefault import defaultconfig, ndcDict
from ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
492,
2727,
319,
3300,
3158,
1478,
678,
25,
3682,
25,
3559,
2864,
198,
492,
1772,
25,
18468,
11419,
32317,
5404,
31,
10155,
16469,
13,
785,
198,
492,
6634,
... | 2.263636 | 1,210 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from typing import List, Dict, Any
import warnings
from aws_lambda_powertools import Logger, Metrics, Tracer
from aws_lambda_powertools.utilities.typing import LambdaContext
import boto3
from organizations import Organizations
from sts import STS
from securityh... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
198,
6738,
19720,
1330,
7343,
11,
360,
713,
11,
4377,
198,
11748,
14601,
198,
198,
6738,
3253,
82,
... | 2.452906 | 499 |
import unittest
import yaml
import pathlib
import os
from confignest.confignest import Config
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
11748,
331,
43695,
198,
11748,
3108,
8019,
198,
11748,
28686,
198,
6738,
1013,
570,
395,
13,
10414,
570,
395,
1330,
17056,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
2... | 2.88 | 50 |
from flask import Flask, request
from flask_restful import Resource, Api
from detect import detectColors, get_color_dict
app = Flask(__name__)
api = Api(app)
colorDict = get_color_dict()
api.add_resource(ColorRecognizer, "/recognize-color")
if __name__ == "__main__":
port = 5004
app.run(port=port)
| [
6738,
42903,
1330,
46947,
11,
2581,
198,
6738,
42903,
62,
2118,
913,
1330,
20857,
11,
5949,
72,
198,
6738,
4886,
1330,
4886,
5216,
669,
11,
651,
62,
8043,
62,
11600,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
15042,
796,... | 2.785714 | 112 |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
### BEGIN LICENSE
# Copyright (C) 2013 Dieter Konrad dkotrada@gmail.com# This file is distributed under the license LGPL version 2 or later
### END LICENSE
from gi.repository import Gio, Gtk # pylint: disable=E0611
import logging
logger = loggi... | [
2,
532,
9,
12,
10363,
25,
11361,
26,
19617,
25,
3384,
69,
12,
23,
26,
33793,
12,
8658,
82,
12,
14171,
25,
18038,
26,
7400,
12,
10394,
25,
604,
532,
9,
12,
198,
21017,
347,
43312,
38559,
24290,
198,
2,
15069,
357,
34,
8,
2211,
... | 3.035088 | 171 |
import sys
n = int(input())
for i in range(1, n):
if checkGen(i, n):
print(i)
sys.exit(0)
print(0)
| [
11748,
25064,
198,
77,
796,
493,
7,
15414,
28955,
198,
198,
1640,
1312,
287,
2837,
7,
16,
11,
299,
2599,
198,
220,
220,
220,
611,
2198,
13746,
7,
72,
11,
299,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
72,
8,
198,
... | 1.861538 | 65 |