content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
if __name__ == '__main__':
Generator().create_statements('many_to_many.yaml', 'schema.sql')
| [
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
35986,
22446,
17953,
62,
14269,
3196,
10786,
21834,
62,
1462,
62,
21834,
13,
88,
43695,
3256,
705,
15952,
2611,
13,
25410,
11537,
198
] | 2.552632 | 38 |
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# TH... | [
29113,
29113,
7804,
4242,
2235,
198,
2,
198,
2,
15069,
357,
66,
8,
5878,
11,
6244,
1168,
3008,
5693,
290,
25767,
669,
13,
198,
2,
1439,
6923,
33876,
13,
198,
2,
198,
2,
770,
3788,
318,
2426,
284,
262,
8617,
286,
262,
1168,
3008,
... | 4.164835 | 182 |
import os
import ConfigParser
mu0 = 1.25663706e-6
| [
11748,
28686,
198,
11748,
17056,
46677,
198,
198,
30300,
15,
796,
352,
13,
1495,
2791,
20167,
21,
68,
12,
21,
198
] | 2.428571 | 21 |
from django.contrib.gis.db import models
from django.db.models import Q
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
# Create your models here.
| [
6738,
42625,
14208,
13,
3642,
822,
13,
70,
271,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
1195,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
3254,
24765,
12331,
198,
6738,
42625,
14208,
13,
... | 3.393443 | 61 |
"""Module configures project's main logger."""
import logging
from loguru import logger
def disable_usp_logging() -> None:
"""Disable logging of ultimate-sitemap-parser (usp) library.
Usp package initializes default logging.Logger() each time it
imports something from its core submodules.
Therefor... | [
37811,
26796,
4566,
942,
1628,
338,
1388,
49706,
526,
15931,
198,
198,
11748,
18931,
198,
198,
6738,
2604,
14717,
1330,
49706,
628,
198,
4299,
15560,
62,
17723,
62,
6404,
2667,
3419,
4613,
6045,
25,
198,
220,
220,
220,
37227,
48893,
189... | 2.863946 | 294 |
from __future__ import annotations
import warnings
from typing import Any, List, Callable, Tuple, Union, Collection, FrozenSet, Optional, Iterable, Set
from .base import DependencyBase, dataclass
from .tag import Tag
ExtractorFunc = Callable[[Any], Optional[dict]]
class InvalidateAll(Tag):
""" A custom ta... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
14601,
198,
6738,
19720,
1330,
4377,
11,
7343,
11,
4889,
540,
11,
309,
29291,
11,
4479,
11,
12251,
11,
23673,
7248,
11,
32233,
11,
40806,
540,
11,
5345,
198,
198,
6738,
764,
8692,... | 3.520468 | 171 |
import logging
import requests
import requests_cache
from django.conf import settings
from django.http import HttpResponse, HttpRequest
try:
from django.utils.deprecation import MiddlewareMixin
except ImportError:
MiddlewareMixin = object
from .api import usergroups
from .models import DataportenUser
# Cach... | [
11748,
18931,
198,
198,
11748,
7007,
198,
11748,
7007,
62,
23870,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
11,
367,
29281,
18453,
198,
28311,
25,
198,
220,
220,
220... | 2.737557 | 221 |
# -*-coding:utf-8-*-
import base64
import copy
from .func import xor, rotl, get_uint32_be, put_uint32_be, bytes_to_list, list_to_bytes, padding, un_padding
BOXES_TABLE = [
0xd6,
0x90,
0xe9,
0xfe,
0xcc,
0xe1,
0x3d,
0xb7,
0x16,
0xb6,
0x14,
0xc2,
0x28,
0xfb,
0x2c,
0x05,
0x2b,
0x67,
0x9a,
0x76,
0x2a,... | [
2,
532,
9,
12,
66,
7656,
25,
40477,
12,
23,
12,
9,
12,
198,
11748,
2779,
2414,
198,
11748,
4866,
198,
198,
6738,
764,
20786,
1330,
2124,
273,
11,
5724,
75,
11,
651,
62,
28611,
2624,
62,
1350,
11,
1234,
62,
28611,
2624,
62,
1350,... | 1.32654 | 2,257 |
# -*- coding: utf-8 -*-
# @Author : LG
"""
40 ms, Python3 74.47%
13.8 MB, Python3 7.95%
+
dp[i][j] = dp[i-1][j] + dp[i][j-1]
1 1 1 1 1 1
1 2 3 4 5 6
1 3 6 10 15 21
1 4 10 20 35 56
"""
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
13838,
220,
1058,
17370,
198,
198,
37811,
198,
1821,
13845,
11,
220,
11361,
18,
8915,
13,
2857,
4,
220,
198,
1485,
13,
23,
10771,
11,
220,
11361,
18,
767,
1... | 1.463158 | 190 |
import sys
import structlog
from osrest import Tcpml
import services_component
if __name__ == "__main__":
main()
| [
11748,
25064,
198,
11748,
2878,
6404,
198,
198,
6738,
28686,
2118,
1330,
309,
13155,
4029,
198,
11748,
2594,
62,
42895,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 3.051282 | 39 |
version https://git-lfs.github.com/spec/v1
oid sha256:b28da294230f24c172729139b1988b8008f6fb2c259b1c3425772b2c80cfb9dd
size 2688
| [
9641,
3740,
1378,
18300,
12,
1652,
82,
13,
12567,
13,
785,
14,
16684,
14,
85,
16,
198,
1868,
427,
64,
11645,
25,
65,
2078,
6814,
1959,
3682,
1270,
69,
1731,
66,
1558,
1983,
1959,
20219,
65,
26709,
65,
7410,
23,
69,
21,
21855,
17,
... | 1.984615 | 65 |
#!/usr/bin/env python3
import sys
import xml.etree.ElementTree as ET
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
25064,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
198,
198,
12417,
3419,
198
] | 2.75 | 28 |
"""panamsquad URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | [
37811,
6839,
4105,
47003,
10289,
28373,
198,
198,
464,
4600,
6371,
33279,
82,
63,
1351,
11926,
32336,
284,
5009,
13,
1114,
517,
1321,
3387,
766,
25,
198,
220,
220,
220,
3740,
1378,
31628,
13,
28241,
648,
404,
305,
752,
13,
785,
14,
... | 2.678788 | 660 |
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='sphinx-git-lowdown',
version='0.0.1',
url='https://github.com/yamahigashi/sphinx-git-lowdown',
# download_url='http://pypi.python.org/pypi/sphinx-git-lowdown',
license='Apache',
author='yamahigashi',
author_email='yamahigas... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
628,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
82,
746,
28413,
12,
18300,
12,
9319,
2902,
3256,
198,
220,
220,
220,
219... | 2.457627 | 413 |
from .device import Device | [
6738,
764,
25202,
1330,
16232
] | 5.2 | 5 |
from rfim2d import param_dict
key_dict = {
'A': ['Sigma', 'a', 'b'],
'dMdh': ['hMax', 'eta', 'a', 'b', 'c'],
'joint': ['rScale', 'rc', 'sScale', 'etaScale', 'df',
'lambdaH', 'B', 'C', 'F'],
'Sigma': ['rScale', 'rc', 'sScale', 'df', 'B', 'C'],
'eta': ['rScale', 'rc', 'etaScale', 'lambd... | [
6738,
374,
69,
320,
17,
67,
1330,
5772,
62,
11600,
198,
198,
2539,
62,
11600,
796,
1391,
198,
220,
220,
220,
705,
32,
10354,
37250,
50,
13495,
3256,
705,
64,
3256,
705,
65,
6,
4357,
198,
220,
220,
220,
705,
67,
44,
34985,
10354,
... | 2.041199 | 267 |
print('hi all')
print('hii')
print('hello world')
print('hi')
print('hello')
| [
4798,
10786,
5303,
477,
11537,
198,
198,
4798,
10786,
71,
4178,
11537,
198,
4798,
10786,
31373,
995,
11537,
198,
198,
4798,
10786,
5303,
11537,
198,
198,
4798,
10786,
31373,
11537,
198
] | 2.580645 | 31 |
#!/usr/bin/python
# Copyright (c) 2015 Aaron Soto
# Released under the MIT license
# Incorporates libraries from AdaFruit, also released under the MIT license
# TODO functions:
# display_progress(percentage,[title]) - display a progress bar (0-1,1-100) / check for float
# display_error(message,[ti... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
15069,
357,
66,
8,
1853,
12139,
311,
2069,
198,
2,
220,
220,
28728,
739,
262,
17168,
5964,
198,
2,
220,
220,
3457,
31150,
689,
12782,
422,
47395,
37,
4872,
11,
635,
2716,
739,
262,
171... | 2.990654 | 321 |
# Upper-lower splitter for the exercise list
import sys
import exercise_populator_config as conf
print('Enter the file name: ')
filename = sys.stdin.readline()
filename = filename[0:len(filename)-1]
f = open(filename, 'r')
upper = conf.CONST_MUSCLES['upper']
lower = conf.CONST_MUSCLES['lower']
uex = []
lex = []
fo... | [
2,
20390,
12,
21037,
4328,
1967,
329,
262,
5517,
1351,
198,
198,
11748,
25064,
198,
11748,
5517,
62,
12924,
8927,
62,
11250,
355,
1013,
198,
198,
4798,
10786,
17469,
262,
2393,
1438,
25,
705,
8,
198,
34345,
796,
25064,
13,
19282,
259,... | 2.324074 | 324 |
#!/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 asyncio
import logging
import os
import pathlib
import shutil
from typing import Dict, List
from fbpmp.pcf impo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
14,
29412,
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,
2... | 2.930502 | 259 |
import matplotlib.font_manager as font_manager
import matplotlib.pyplot as plt
import pandas as pd
import os
# Read the data
path = os.path.join(os.getcwd(), "results")
df = pd.read_csv(os.path.join(path, "tracker_AND_cookies.csv"))
x = df["day"]
y1 = df["total_tracker"]
y2 = df["tracker_distinct"]
y3 = df["is_sessio... | [
11748,
2603,
29487,
8019,
13,
10331,
62,
37153,
355,
10369,
62,
37153,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
28686,
198,
198,
2,
4149,
262,
1366,
198,
6978,
796... | 2.452489 | 884 |
import asyncio
coroutine = long_task(Writer())
asyncio.ensure_future(coroutine)
asyncio.get_event_loop()run_forever()
| [
11748,
30351,
952,
628,
628,
198,
10215,
28399,
796,
890,
62,
35943,
7,
34379,
28955,
198,
292,
13361,
952,
13,
641,
495,
62,
37443,
7,
10215,
28399,
8,
198,
292,
13361,
952,
13,
1136,
62,
15596,
62,
26268,
3419,
5143,
62,
754,
332,... | 2.711111 | 45 |
# -*- coding: utf-8 -*-
Group_Key_To_Dimension = dict(
c_ip = 'ip',
uid = 'user',
page = 'page',
did = 'did',
# c_ipc = 'ipc',
)
Avail_Dimensions = tuple(Group_Key_To_Dimension.values())
# dimension : variable_name()
Click_Variable_Names = dict(
ip='ip__visit__dynamic_count__1h__slot',
did... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
13247,
62,
9218,
62,
2514,
62,
29271,
3004,
796,
8633,
7,
198,
220,
220,
220,
269,
62,
541,
796,
705,
541,
3256,
198,
220,
220,
220,
334,
312,
796,
705,
7220,
... | 2.003864 | 1,294 |
from pyhdf.SD import SD, SDC
from pathlib import Path
import numpy as np
import a301
m5_file = a301.data_dir / Path('myd05_l2_10_7.hdf')
the_file = SD(str(m5_file), SDC.READ)
wv_nearir_data = the_file.select('Water_Vapor_Near_Infrared').get()
the_file.end
positive = wv_nearir_data > 0.
print(f'found {np.sum(positive.f... | [
6738,
12972,
71,
7568,
13,
10305,
1330,
9834,
11,
311,
9697,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
257,
18938,
198,
198,
76,
20,
62,
7753,
796,
257,
18938,
13,
7890,
62,
15908,
1220,
10644... | 2.43662 | 142 |
# Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from course_grader.dao import current_datetime, display_datetime
from course_grader.dao.term import (
next_gradable_term, previous_gradable_term, submission_deadline_warning,
is_grading_period_open)
from persistent_message.m... | [
2,
15069,
33448,
33436,
12,
2043,
11,
2059,
286,
2669,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
198,
6738,
1781,
62,
2164,
5067,
13,
67,
5488,
1330,
1459,
62,
19608,
8079,
11,
3359,
62,
19608,... | 3.224299 | 107 |
"""File reading/writing helpers."""
__all__ = ["topnet2ts", "gdf_to_shapefile"]
import geopandas
import pandas as pd
from swn.logger import get_logger, logging
def topnet2ts(nc_path, varname, mult=None, log_level=logging.INFO):
"""Read TopNet data from a netCDF file into a pandas.DataFrame timeseries.
Use... | [
37811,
8979,
3555,
14,
16502,
49385,
526,
15931,
198,
198,
834,
439,
834,
796,
14631,
4852,
3262,
17,
912,
1600,
366,
70,
7568,
62,
1462,
62,
43358,
7753,
8973,
198,
198,
11748,
30324,
392,
292,
198,
11748,
19798,
292,
355,
279,
67,
... | 2.173767 | 2,089 |
#!/usr/bin/env python3
"""
data clean for books (clean_documents.py)
note - this is the same as in assignment 1 for the most part
"""
import re
from ast import literal_eval
from os.path import basename, splitext, exists
from typing import Optional, List
from utils import get_glob, file_path_relative
from variables im... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
7890,
3424,
329,
3835,
357,
27773,
62,
15390,
2886,
13,
9078,
8,
198,
198,
11295,
532,
428,
318,
262,
976,
355,
287,
16237,
352,
329,
262,
749,
636,
198,
37811,
198,
... | 2.172205 | 2,648 |
from django.shortcuts import render
from rest_framework.generics import RetrieveAPIView,CreateAPIView
from rest_framework.permissions import AllowAny
from rest_framework.response import Response
from rest_framework.status import HTTP_200_OK, HTTP_400_BAD_REQUEST,HTTP_201_CREATED
from rest_framework.views import APIView... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
1334,
62,
30604,
13,
8612,
873,
1330,
4990,
30227,
2969,
3824,
769,
11,
16447,
2969,
3824,
769,
198,
6738,
1334,
62,
30604,
13,
525,
8481,
1330,
22507,
7149,
198,
6738,
1334,
... | 4.037037 | 135 |
# Copyright (c) 2014 Evalf
#
# 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, merge, publish, distribute, s... | [
2,
15069,
357,
66,
8,
1946,
4319,
1604,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
2,
286,
428,
3788,
290,
3917,
10314,
3696,
357,
1169,
366,
25423,
12340,
284,
17... | 2.402212 | 3,165 |
"""
This script analyses optimal alphas for each class and draws them in a box and whisker plot
"""
import pandas as pd
import argparse
import seaborn as sns
import matplotlib.pyplot as plt
import itertools
def analyse_alpha_for_all(falpha, classes, draw_fname, midalpha):
"""
:param fmeta: path to the meta ... | [
37811,
198,
1212,
4226,
13523,
16586,
435,
5902,
329,
1123,
1398,
290,
14293,
606,
287,
257,
3091,
290,
21060,
263,
7110,
198,
37811,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
1822,
29572,
198,
11748,
384,
397,
1211,
355,
3013,
... | 2.400735 | 1,088 |
from typing import List
# TESTS
tests = [
([2, 3, 6, 7], 7, [[2, 2, 3], [7]]),
([2, 3, 5], 8, [[2, 2, 2, 2], [2, 3, 3], [3, 5]]),
([2], 1, []),
([1], 1, [[1]]),
([1], 2, [[1, 1]]),
]
for candidates, target, expected in tests:
sol = Solution()
actual = sol.combinationSum(candidates, target... | [
6738,
19720,
1330,
7343,
628,
198,
198,
2,
309,
1546,
4694,
198,
41989,
796,
685,
198,
220,
220,
220,
29565,
17,
11,
513,
11,
718,
11,
767,
4357,
767,
11,
16410,
17,
11,
362,
11,
513,
4357,
685,
22,
11907,
828,
198,
220,
220,
22... | 2.309783 | 184 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilitie... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
24118,
687,
10290,
357,
27110,
5235,
8,
16984,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760... | 3.630631 | 111 |
#!/usr/bin/python3
import pytest
from hypothesis import settings
# derandomizing prevents flaky test outcomes
# we are testing hypothesis itself, not testing with hypothesis
settings.register_profile("derandomize", derandomize=True)
| [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
11748,
12972,
9288,
198,
6738,
14078,
1330,
6460,
198,
198,
2,
4587,
3749,
2890,
15174,
781,
15492,
1332,
10906,
198,
2,
356,
389,
4856,
14078,
2346,
11,
407,
4856,
351,
14078,
198,
... | 4 | 59 |
from logging import getLevelName
import numpy as np
import os
import tensorflow as tf
import pathlib
import pandas as pd
import re
import matplotlib.pyplot as plt
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers im... | [
6738,
18931,
1330,
651,
4971,
5376,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
3108,
8019,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
302,
198,
11748,
2603,
29487,
... | 2.927419 | 372 |
import datetime
from django.db import models
from django.utils import timezone
# from .backends import update_data
| [
11748,
4818,
8079,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
198,
198,
2,
422,
764,
1891,
2412,
1330,
4296,
62,
7890,
628,
198
] | 3.5 | 34 |
from django.db import models
from django.utils import timezone
from gentry.utils import make_absolute_uri
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
198,
198,
6738,
308,
13000,
13,
26791,
1330,
787,
62,
48546,
62,
9900,
628
] | 3.6 | 30 |
import os
from datetime import datetime, timedelta
from behave import given, when, then
from hamcrest import (
assert_that, equal_to, has_item, is_, is_not, greater_than, less_than
)
from StringIO import StringIO
from pptx import packaging
from pptx import Presentation
from pptx.constants import MSO_AUTO_SHAPE_T... | [
11748,
28686,
198,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
198,
6738,
17438,
1330,
1813,
11,
618,
11,
788,
198,
6738,
8891,
66,
2118,
1330,
357,
198,
220,
220,
220,
6818,
62,
5562,
11,
4961,
62,
1462,
11,
468... | 2.903141 | 382 |
"""
[2016-08-18] Challenge #279 [Intermediate] Text Reflow
https://www.reddit.com/r/dailyprogrammer/comments/4ybbcz/20160818_challenge_279_intermediate_text_reflow/
#Description:
Text reflow means to break up lines of text so that they fit within a certain width. It is useful in e.g. mobile
browsers. When you zoom in... | [
37811,
198,
58,
5304,
12,
2919,
12,
1507,
60,
13879,
1303,
26050,
685,
9492,
13857,
60,
8255,
797,
11125,
198,
198,
5450,
1378,
2503,
13,
10748,
13,
785,
14,
81,
14,
29468,
23065,
647,
14,
15944,
14,
19,
88,
11848,
26691,
14,
1264,
... | 3.335917 | 774 |
from time import time, sleep
from math import floor
import argparse
import csv
import datetime
# Constants
TIME_WORK = 25
TIME_REST = 5
TIME_REST_LONG = 30
ONE_MINUTE = 60
SESSIONS_WORK_MAX = 4
LOOP_LIMIT = 9999
# Console
parser = argparse.ArgumentParser(description='===== Pomodoro timer CLI =====')
parser.add_argume... | [
6738,
640,
1330,
640,
11,
3993,
198,
6738,
10688,
1330,
4314,
198,
11748,
1822,
29572,
198,
11748,
269,
21370,
198,
11748,
4818,
8079,
198,
198,
2,
4757,
1187,
198,
34694,
62,
33249,
796,
1679,
198,
34694,
62,
49,
6465,
796,
642,
198,... | 2.432432 | 666 |
#!/usr/bin/env python
import signal
import click
from .client import Client
from .utils import Utils
utils = Utils()
signal.signal(signal.SIGINT, utils.signal_handler)
pass_config = click.make_pass_decorator(Config, ensure=True)
if __name__ == "__main__":
cli()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
6737,
198,
198,
11748,
3904,
198,
198,
6738,
764,
16366,
1330,
20985,
198,
6738,
764,
26791,
1330,
7273,
4487,
198,
198,
26791,
796,
7273,
4487,
3419,
198,
12683,
282,
13,
12683,
... | 2.67619 | 105 |
from itertools import count
from string import ascii_lowercase
plain_text = 'july'
results_file = open('results.txt', 'w')
letters_to_numbers = dict(zip(ascii_lowercase, count(0)))
numbers_to_letters = dict(zip(count(0), ascii_lowercase))
plain_text_numbers = [letters_to_numbers[letter] for letter in plain_text]
for i... | [
6738,
340,
861,
10141,
1330,
954,
198,
6738,
4731,
1330,
355,
979,
72,
62,
21037,
7442,
198,
198,
25638,
62,
5239,
796,
705,
73,
2062,
6,
198,
43420,
62,
7753,
796,
1280,
10786,
43420,
13,
14116,
3256,
705,
86,
11537,
198,
15653,
62... | 2.787709 | 358 |
import os, pickle
import numpy as np
import tensorflow as tf
if __name__ == "__main__":
train_generator = Generator('datasets/train')
val_generator = Generator('datasets/val')
print(len(train_generator))
print(len(val_generator))
data_batch, target_batch = train_generator.__getitem__(0)
print(... | [
11748,
28686,
11,
2298,
293,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
628,
220,
220,
220,
4512,
62,
8612,
1352,
796,
35986,
10786,
... | 2.601399 | 143 |
from mlb.models.game_detail import GameDetail
import time
import board
import displayio
from adafruit_display_text import label
from adafruit_display_shapes.roundrect import RoundRect
import fonts.fonts as FONTS
from mlb.schedule.schedule_view_model import ScheduleViewModel
from time_utils import day_of_week, month_nam... | [
6738,
285,
23160,
13,
27530,
13,
6057,
62,
49170,
1330,
3776,
11242,
603,
198,
11748,
640,
198,
11748,
3096,
198,
11748,
3359,
952,
198,
6738,
512,
1878,
4872,
62,
13812,
62,
5239,
1330,
6167,
198,
6738,
512,
1878,
4872,
62,
13812,
62... | 3.264957 | 117 |
# Strings are used in Python to record text information, such as names.
# Strings in Python are actually a sequence, which basically means Python keeps track
# of every element in the string as a sequence.
# For example, Python understands the string "hello' to be a sequence of letters in a specific order.
# This me... | [
2,
4285,
654,
389,
973,
287,
11361,
284,
1700,
2420,
1321,
11,
884,
355,
3891,
13,
198,
2,
4285,
654,
287,
11361,
389,
1682,
257,
8379,
11,
543,
6209,
1724,
11361,
7622,
2610,
220,
198,
2,
286,
790,
5002,
287,
262,
4731,
355,
257,... | 3.17233 | 412 |
# This code finds the Fourier Tranform of a signal and the Nyquist frequency
import matplotlib.pyplot as plt
import numpy as np
import librosa
import librosa as lr
from scipy import signal
from scipy.fft import fft, ifft
import math
import matplotlib.pyplot as plt
if __name__ == "__main__":
# Read the audio ... | [
2,
770,
2438,
7228,
262,
34296,
5277,
833,
272,
687,
286,
257,
6737,
290,
262,
17735,
30062,
8373,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
9195,
4951,
64,
198,... | 2.313008 | 492 |
#!/usr/bin/env python
import rospy
import actionlib
from control_msgs.msg import *
from std_msgs.msg import Float64
from sensor_msgs.msg import JointState
PI = 3.14159265359
if __name__=='__main__':
main()
exit()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
686,
2777,
88,
198,
11748,
2223,
8019,
198,
6738,
1630,
62,
907,
14542,
13,
19662,
1330,
1635,
198,
6738,
14367,
62,
907,
14542,
13,
19662,
1330,
48436,
2414,
198,
6738,
12694,
... | 2.716049 | 81 |
from ast import Lambda
from enum import IntEnum
from typing import Any
from Ast import Stmt
from Ast import Expr
from Token import Token, TokenType
from Utils import Assert
from Ast import AstType, ArrayExpr, BoolExpr, ExprStmt, FunctionCallExpr, FunctionStmt, GroupExpr, IdentifierExpr, IfStmt, IndexExpr, InfixExpr, ... | [
6738,
6468,
1330,
21114,
6814,
198,
6738,
33829,
1330,
2558,
4834,
388,
198,
6738,
19720,
1330,
4377,
198,
198,
6738,
8304,
1330,
520,
16762,
198,
6738,
8304,
1330,
1475,
1050,
198,
198,
6738,
29130,
1330,
29130,
11,
29130,
6030,
198,
6... | 2.986755 | 151 |
# COLORS
black = "\033[30m"
red = "\033[31m"
green = "\033[32m"
yellow = "\033[33m"
blue = "\033[34m"
magenta = "\033[35m"
cyan = "\033[36m"
white = "\033[37m"
nc = "\n"
# COLOR TESTING
| [
2,
20444,
20673,
198,
13424,
796,
37082,
44427,
58,
1270,
76,
1,
198,
445,
796,
37082,
44427,
58,
3132,
76,
1,
198,
14809,
796,
37082,
44427,
58,
2624,
76,
1,
198,
36022,
796,
37082,
44427,
58,
2091,
76,
1,
198,
17585,
796,
37082,
... | 2.054945 | 91 |
from django.urls import path
from . import views
app_name = 'database'
urlpatterns = [
path('update/', views.update),
path('update2/', views.update2),
path('update3/', views.update3),
path('upload-user/', views.create_user_dataset)
]
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
764,
1330,
5009,
198,
198,
1324,
62,
3672,
796,
705,
48806,
6,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
19119,
14,
3256,
5009,
13,
19119,
828,
198... | 2.635417 | 96 |
from datetime import datetime | [
6738,
4818,
8079,
1330,
4818,
8079
] | 4.833333 | 6 |
from werkzeug.exceptions import HTTPException
errors = {
"InternalServerError": {
"message": "Oops something wrong",
"status": 500
},
"SchemaValidationError": {
"message": "Required fields missing",
"status": 400
},
"UserNotFoundError": {
"message": "User no... | [
6738,
266,
9587,
2736,
1018,
13,
1069,
11755,
1330,
14626,
16922,
198,
198,
48277,
796,
1391,
198,
197,
1,
37693,
10697,
12331,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
366,
20500,
1298,
366,
46,
2840,
1223,
2642,
1600,
198... | 2.470874 | 206 |
from raincoat.radarFunctions import getVarTimeRange, getRadarVar
import pandas as pd
data = getRadarVar('../samplefiles/radar/181202_000000_P09_ZEN_compact.nc',
'2001.01.01. 00:00:00',
'Ze')
start = pd.to_datetime('2018-12-02 00:00:00', format='%Y-%m-%d %H:%M:%S')
stop = pd.to_datetime... | [
6738,
6290,
31434,
13,
6335,
283,
24629,
2733,
1330,
651,
19852,
7575,
17257,
11,
651,
15546,
283,
19852,
198,
11748,
19798,
292,
355,
279,
67,
628,
198,
7890,
796,
651,
15546,
283,
19852,
10786,
40720,
39873,
16624,
14,
6335,
283,
14,
... | 2.033816 | 207 |
""" Gecko REQRM/RMREQ handlers """
import logging
import struct
from .packet import GeckoPacketProtocolHandler
REQRM_VERB = b"REQRM"
RMREQ_VERB = b"RMREQ"
_LOGGER = logging.getLogger(__name__)
| [
37811,
2269,
37549,
4526,
48,
29138,
14,
29138,
2200,
48,
32847,
37227,
198,
198,
11748,
18931,
198,
11748,
2878,
198,
198,
6738,
764,
8002,
316,
1330,
2269,
37549,
47,
8317,
19703,
4668,
25060,
198,
198,
2200,
48,
29138,
62,
5959,
33,
... | 2.506329 | 79 |
# Generated by Django 2.2.13 on 2021-02-09 12:44
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
1485,
319,
33448,
12,
2999,
12,
2931,
1105,
25,
2598,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.8 | 30 |
# encoding: utf-8
__version__ = "1.0.1"
try:
import pygame
from pygame import mixer
except ImportError:
raise ImportError("\n<pygame> library is missing on your system."
"\nTry: \n C:\\pip install pygame on a window command prompt.")
from time import time
| [
2,
21004,
25,
3384,
69,
12,
23,
201,
198,
201,
198,
201,
198,
834,
9641,
834,
796,
366,
16,
13,
15,
13,
16,
1,
201,
198,
201,
198,
201,
198,
28311,
25,
201,
198,
220,
220,
220,
1330,
12972,
6057,
201,
198,
220,
220,
220,
422,
... | 2.358779 | 131 |
#!/usr/bin/env python
import os
import sys
import getopt
TESTNAME = "extmethods"
# generate bindings in this folder
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "k", ["keepfiles"])
except getopt.GetoptError as e:
sys.exit(127)
k = False
for o, a in opts:
if o in ["-k", "--keepfile... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
651,
8738,
198,
198,
51,
6465,
20608,
796,
366,
2302,
24396,
82,
1,
628,
198,
198,
2,
7716,
34111,
287,
428,
9483,
198,
4299,
1388,
... | 2.231846 | 1,143 |
# https://rosalind.info/problems/tran/
file = "data/tran.txt"
def read_fasta(file: str):
"""
Args
file: path of fasta file
"""
with open(file) as f:
fa = f.read().splitlines()
prev = True
header = []
seq = []
for f in fa:
if ">" in f:
header.append(f[1:... | [
2,
3740,
1378,
4951,
282,
521,
13,
10951,
14,
1676,
22143,
14,
2213,
272,
14,
198,
198,
7753,
796,
366,
7890,
14,
2213,
272,
13,
14116,
1,
628,
198,
4299,
1100,
62,
7217,
64,
7,
7753,
25,
965,
2599,
198,
220,
220,
220,
37227,
19... | 1.945813 | 406 |
# -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
import re
import time
import MySQLdb
s = requests.Session()
login_url = "http://www.trueworldagency.com/member/login_ok.asp"
login_data = {'upw': '07092519', 'uid': '07092519'}
s.post(login_url, login_data)
counter = 0
trip_bookingID = []
trip_perio... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
7007,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
302,
198,
11748,
640,
198,
11748,
33476,
9945,
198,
198,
82,
796,
7007,
13,
36044,
3419,
198,
... | 2.141256 | 2,676 |
# Code for extract the information from the web
# with the <id> information into the bolivia_power_1.csv file
# input: bolivia_power_1.id.csv
# output 6x.npy array file:
# <nodes_ids.lat,lon> <node.tags>
# <way.ids> <way.ref> <way.tags>
# ...
# v. 1.1
#import pandas as pd
import numpy as np... | [
201,
198,
201,
198,
2,
6127,
329,
7925,
262,
1321,
422,
262,
3992,
201,
198,
2,
351,
262,
1279,
312,
29,
1321,
656,
262,
11572,
20817,
62,
6477,
62,
16,
13,
40664,
2393,
201,
198,
201,
198,
201,
198,
2,
5128,
25,
11572,
20817,
6... | 2.541842 | 1,661 |
from api.utils.config import settings
| [
6738,
40391,
13,
26791,
13,
11250,
1330,
6460,
628
] | 4.333333 | 9 |
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the maximizingXor function below.
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
l = int(input())
r = int(input())
result = maximizingXor(l, r)
fptr.write(str(result) + '\n')... | [
2,
48443,
8800,
14,
29412,
18,
198,
198,
11748,
10688,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
302,
198,
11748,
25064,
198,
198,
2,
13248,
262,
48350,
55,
273,
2163,
2174,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
22... | 2.370629 | 143 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License,... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
3050,
3517,
32250,
10501,
290,
509,
1689,
25418,
25767,
669,
7,
16,
8,
198,
2,
198,
2,
357,
16,
8,
... | 3.837037 | 270 |
# Copyright 2020 by Spectrico
# Licensed under the MIT License
model_file = "model-weights-spectrico-car-colors-recognition-mobilenet_v3-224x224-180420.pb" # path to the car color classifier
label_file = "labelsC.txt" # path to the text file, containing list with the supported makes and models
input_layer = "input... | [
2,
15069,
220,
12131,
416,
13058,
1173,
78,
198,
2,
49962,
739,
262,
17168,
13789,
198,
198,
19849,
62,
7753,
796,
366,
19849,
12,
43775,
12,
4443,
1173,
78,
12,
7718,
12,
4033,
669,
12,
26243,
653,
12,
76,
25898,
268,
316,
62,
85... | 3.107143 | 140 |
#! /usr/bin/env python
"""Exploring Genie's ability to gather details and write to CSV
This script is meant to be run line by line interactively in a Python
interpretor (such as iPython) to learn how the Genie and csv libraries work.
This script assumes you have a virl simulation running and a testbed file
created.
... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
18438,
3255,
49405,
338,
2694,
284,
6431,
3307,
290,
3551,
284,
44189,
198,
198,
1212,
4226,
318,
4001,
284,
307,
1057,
1627,
416,
1627,
9427,
2280,
287,
257,
11361,
198,
2738... | 3.037827 | 1,454 |
import os, sys
import json as _json
from flask import Flask, Response, request
app = Flask(__name__)
app.debug = True
import lib
if __name__ == "__main__":
try:
app.config['ALLOWED_USER'] = os.environ['USER']
except KeyError:
sys.stdout.write("""Error: Configuration environment variable USER... | [
11748,
28686,
11,
25064,
198,
198,
11748,
33918,
355,
4808,
17752,
198,
198,
6738,
42903,
1330,
46947,
11,
18261,
11,
2581,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
1324,
13,
24442,
796,
6407,
198,
198,
11748,
9195,
198,
198,... | 2.818182 | 187 |
# Copyright (C) 2019 by eHealth Africa : http://www.eHealthAfrica.org
#
# See the NOTICE file distributed with this work for additional information
# regarding copyright ownership.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with
# the License. Y... | [
2,
15069,
357,
34,
8,
13130,
416,
304,
18081,
5478,
1058,
2638,
1378,
2503,
13,
68,
18081,
17584,
30997,
13,
2398,
198,
2,
198,
2,
4091,
262,
28536,
2393,
9387,
351,
428,
670,
329,
3224,
1321,
198,
2,
5115,
6634,
9238,
13,
198,
2,... | 3.663968 | 247 |
n = int(input())
for _ in range(n):
line = input()
prev = ''
counter = 0
for char in line:
if char != prev:
if prev != '':
print(counter, prev, end = ' ')
prev = char
counter = 1
else:
counter += 1
print(counter, prev) | [
77,
796,
493,
7,
15414,
28955,
198,
198,
1640,
4808,
287,
2837,
7,
77,
2599,
198,
220,
1627,
796,
5128,
3419,
628,
220,
8654,
796,
10148,
198,
220,
3753,
796,
657,
198,
220,
329,
1149,
287,
1627,
25,
198,
220,
220,
220,
611,
1149,... | 2.1875 | 128 |
# built-in
import os
import logging
# installed
import pandas as pd
import seaborn as sns
from matplotlib import pylab
# custom
import src.settings
from src.utils.log_utils import setup_logging, LogLevel
from src.utils.config_loader import ConfigLoader, Config
def setup_jupyter(
root_dir: str, config_path: s... | [
2,
3170,
12,
259,
198,
11748,
28686,
198,
11748,
18931,
198,
198,
2,
6589,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,
6738,
2603,
29487,
8019,
1330,
279,
2645,
397,
198,
198,
2,
2183,
198,
... | 2.414673 | 627 |
from django.db import models
from django.contrib.auth.models import User
from core.models import Profile
from array import *
from datetime import datetime
from django.utils import timezone
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
4755,
13,
27530,
1330,
13118,
198,
6738,
7177,
1330,
1635,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
673... | 3.877551 | 49 |
# -*- coding: utf-8 -*-
"""
Special compiler-recognized numba functions and attributes.
"""
from __future__ import print_function, division, absolute_import
__all__ = ['NULL', 'typeof', 'python', 'nopython', 'addressof', 'prange']
import ctypes
from numba import error
#--------------------------------------------... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
13409,
17050,
12,
26243,
1143,
997,
7012,
5499,
290,
12608,
13,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
7297,
11,
4112,... | 3.541997 | 631 |
"""
Base class for renderers.
"""
from itertools import chain
import re
import sys
from typing import Optional
from mistletoe import block_tokens, block_tokens_ext, span_tokens, span_tokens_ext
from mistletoe.parse_context import ParseContext, set_parse_context
def render_setext_heading(self, token):
""... | [
37811,
198,
14881,
1398,
329,
9851,
19288,
13,
198,
37811,
198,
198,
6738,
340,
861,
10141,
1330,
6333,
198,
11748,
302,
198,
11748,
25064,
198,
6738,
19720,
1330,
32233,
198,
198,
6738,
4020,
293,
44579,
1330,
2512,
62,
83,
482,
641,
... | 2.564955 | 331 |
if '__file__' in globals():
import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import math
import numpy as np
import matplotlib.pyplot as plt
import dezero
from dezero import optimizers
import dezero.functions as F
import dezero.datasets as datasets
from dezero.models import MLP
from ... | [
361,
705,
834,
7753,
834,
6,
287,
15095,
874,
33529,
198,
220,
220,
220,
1330,
28686,
11,
25064,
198,
220,
220,
220,
25064,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
... | 2.122807 | 855 |
#!/usr/bin/env python
'''
Plots velocity profiles for a diagnostic solve for a range of resolutions, with and without GLP.
'''
import numpy as np
import netCDF4
#import datetime
# import math
# from pylab import *
from optparse import OptionParser
import matplotlib.pyplot as plt
from matplotlib import cm
# from matplot... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
7061,
6,
198,
3646,
1747,
15432,
16545,
329,
257,
23584,
8494,
329,
257,
2837,
286,
21811,
11,
351,
290,
1231,
10188,
47,
13,
198,
7061,
6,
198,
11748,
299,
32152,
355,
45941,
198,
1... | 2.707975 | 815 |
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
"""
from .exclude import ExcludeSchema, rating_indices
from .spec import SpecSchema, loadspec, savespec
from .tags import BoldTagsSchema, FuncTagsSchema, entities, entity_long... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
795,
16436,
25,
532,
9,
12,
4235,
25,
21015,
26,
12972,
12,
521,
298,
12,
28968,
25,
604,
26,
33793,
12,
8658,
82,
12,
14171,
25,
18038,
532,
9,
12,
198,
2,
2... | 2.452984 | 1,106 |
#!/usr/bin/env python3
from game import World
from game.creatures import Humanoid, Unit
from game.creatures.adventurers import Adventurer, Party
from game.objects.containers import Container
from game.places.underground import Dungeon
from game.dice import d4
from pathlib import Path
import pickle
import sys
import u... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
6738,
983,
1330,
2159,
198,
6738,
983,
13,
20123,
942,
1330,
5524,
1868,
11,
11801,
198,
6738,
983,
13,
20123,
942,
13,
324,
5388,
3808,
1330,
9553,
81,
11,
3615,
198,
6738,... | 2.003675 | 2,177 |
HelloPy().hello() | [
198,
198,
15496,
20519,
22446,
31373,
3419
] | 2.714286 | 7 |
from cx_Freeze import setup, Executable
import requests.certs
# Dependencies are automatically detected, but it might need
# fine tuning.
buildOptions = dict(packages = [], excludes = [], include_msvcr=True,
include_files=[(requests.certs.where(),'cacert.pem')])
import sys
base = 'Win32GUI' if sys.... | [
6738,
43213,
62,
11146,
2736,
1330,
9058,
11,
8393,
18187,
198,
11748,
7007,
13,
22583,
82,
198,
198,
2,
37947,
3976,
389,
6338,
12326,
11,
475,
340,
1244,
761,
198,
2,
3734,
24549,
13,
198,
11249,
29046,
796,
8633,
7,
43789,
796,
6... | 2.669683 | 221 |
print(greeting("John")) # "Hello, John"
| [
198,
198,
4798,
7,
70,
2871,
278,
7203,
7554,
48774,
220,
1303,
366,
15496,
11,
1757,
1,
198
] | 2.388889 | 18 |
# Import elasticsearch module
from elasticsearch import Elasticsearch,ImproperlyConfigured,TransportError
import json | [
2,
17267,
27468,
12947,
8265,
198,
6738,
27468,
12947,
1330,
48567,
12947,
11,
23028,
525,
306,
16934,
1522,
11,
8291,
634,
12331,
198,
11748,
33918
] | 4.68 | 25 |
from numpy import *
from scipy.signal import correlate2d
from numpy.random import randint,choice,uniform
from matplotlib.pyplot import *
import matplotlib.pyplot as plt
from os import system
system('rm animation.gif')
# example of how code should work
model = LatticeGas(1024,0.3)
print mode... | [
201,
201,
198,
6738,
299,
32152,
1330,
1635,
201,
201,
198,
6738,
629,
541,
88,
13,
12683,
282,
1330,
39684,
17,
67,
201,
201,
198,
6738,
299,
32152,
13,
25120,
1330,
43720,
600,
11,
25541,
11,
403,
6933,
201,
201,
198,
6738,
2603,
... | 2.173913 | 414 |
import time
import cv2
import numpy as np
from ..openvino_base.base_model import Base
| [
11748,
640,
198,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
11485,
9654,
85,
2879,
62,
8692,
13,
8692,
62,
19849,
1330,
7308,
628
] | 2.966667 | 30 |
import warnings
import matplotlib.pyplot as plt
import pandas as pd
import pytask
import seaborn as sns
from src.config import BLD
from src.config import PLOT_END_DATE
from src.config import PLOT_SIZE
from src.config import PLOT_START_DATE
from src.config import SRC
from src.plotting.plotting import style_plot
from s... | [
11748,
14601,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
12972,
35943,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,
198,
6738,
12351,
13,
11250,
1330,
9878,
... | 3.201681 | 119 |
from typing import Optional
from pydantic import BaseModel, Field
| [
6738,
19720,
1330,
32233,
198,
6738,
279,
5173,
5109,
1330,
7308,
17633,
11,
7663,
628,
198
] | 4.25 | 16 |
# thanks to Francis Song for this function
# source: http://www.nervouscomputer.com/hfs/cmdscale-in-python/
from __future__ import division
import numpy as np
def cmdscale(D):
"""
Classical multidimensional scaling (MDS) ... | [
2,
5176,
284,
12155,
10940,
329,
428,
2163,
198,
2,
2723,
25,
2638,
1378,
2503,
13,
77,
712,
516,
33215,
13,
785,
14,
71,
9501,
14,
28758,
9888,
12,
259,
12,
29412,
14,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
220,
198,
1174... | 1.322902 | 2,205 |
from flask import Flask
from flask import Flask, flash, redirect, render_template, request, session, abort
import os
import newtrain
app = Flask(__name__)
if __name__ == "__main__":
app.secret_key = os.urandom(12)
app.run(debug=True) | [
198,
6738,
42903,
1330,
46947,
198,
6738,
42903,
1330,
46947,
11,
7644,
11,
18941,
11,
8543,
62,
28243,
11,
2581,
11,
6246,
11,
15614,
198,
11748,
28686,
198,
11748,
649,
27432,
198,
220,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
... | 2.820225 | 89 |
from os.path import abspath, dirname
with open(dirname(abspath(__file__))+'/../VERSION', 'r') as version_file:
__version__ = version_file.read().replace('\n', '').strip()
| [
198,
6738,
28686,
13,
6978,
1330,
2352,
6978,
11,
26672,
3672,
198,
198,
4480,
1280,
7,
15908,
3672,
7,
397,
2777,
776,
7,
834,
7753,
834,
4008,
10,
26488,
40720,
43717,
3256,
705,
81,
11537,
355,
2196,
62,
7753,
25,
198,
220,
220,
... | 2.78125 | 64 |
from __future__ import division
import numpy as np
import numpy.testing.decorators as dec
import nose.tools as nt
import statsmodels as sm
import matplotlib.pyplot as plt
from selection.algorithms.sqrt_lasso import (sqrt_lasso, choose_lambda,
estimate_sigma, data_carving, split_model)... | [
6738,
11593,
37443,
834,
1330,
7297,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
299,
32152,
13,
33407,
13,
12501,
273,
2024,
355,
875,
198,
11748,
9686,
13,
31391,
355,
299,
83,
198,
11748,
9756,
27530,
355,
895,
198,
11748,
2603,
... | 2.207827 | 741 |
"""
Train a noised image classifier on ImageNet.
"""
import os
import blobfile as bf
import torch as th
import torch.distributed as dist
import torch.nn.functional as F
from torch.nn.parallel.distributed import DistributedDataParallel as DDP
from torch.optim import AdamW
import torch
from pathlib import Path
import s... | [
37811,
198,
44077,
257,
645,
1417,
2939,
1398,
7483,
319,
7412,
7934,
13,
198,
37811,
198,
198,
11748,
28686,
198,
11748,
44812,
7753,
355,
275,
69,
198,
11748,
28034,
355,
294,
198,
11748,
28034,
13,
17080,
6169,
355,
1233,
198,
11748,... | 2.93597 | 531 |
#!/usr/bin/python3 -u
import threading
import time
import queue
import socket
import grpc
import karmen.karmen_pb2 as pb
import karmen.karmen_pb2_grpc as pb_grpc
if __name__ == "__main__":
k = Karmen(name="bob")
print(k.ping())
k.addAction(sleep, "sleep")
k.register()
print(k.runEvent("pleaseS... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
532,
84,
198,
198,
11748,
4704,
278,
198,
11748,
640,
198,
11748,
16834,
198,
11748,
17802,
198,
11748,
1036,
14751,
198,
198,
11748,
479,
1670,
268,
13,
74,
1670,
268,
62,
40842,
17,
355,
2... | 2.342857 | 140 |
fun('Emma')
| [
198,
12543,
10786,
10161,
2611,
11537,
198
] | 1.857143 | 7 |
import socket
import threading
import signal
import sys
import fnmatch
import utils
from time import gmtime, strftime, localtime
import logging
config = {
"HOST_NAME" : "192.168.0.136",
"BIND_PORT" : 12345,
"MAX_REQUEST_LEN" : 1024,
"CONNECTION_TIMEOUT" : 5,
... | [
11748,
17802,
198,
11748,
4704,
278,
198,
11748,
6737,
198,
11748,
25064,
198,
11748,
24714,
15699,
198,
11748,
3384,
4487,
198,
6738,
640,
1330,
308,
76,
2435,
11,
965,
31387,
11,
1957,
2435,
198,
11748,
18931,
628,
198,
11250,
796,
22... | 2.072961 | 2,563 |
''' xbox.py
Responsible for getting information directly from controller
Courtesy Aaron Schif, former member
Don't touch this file, it's perfect.
'''
from math import isclose
from collections import namedtuple
import sdl2
from sdl2 import ext
ButtonEvent = namedtuple('ButtonEvent', ['time', 'state'])
Ax... | [
7061,
6,
2124,
3524,
13,
9078,
628,
220,
220,
220,
20549,
856,
329,
1972,
1321,
3264,
422,
10444,
198,
220,
220,
220,
22984,
12139,
3059,
361,
11,
1966,
2888,
198,
220,
220,
220,
2094,
470,
3638,
428,
2393,
11,
340,
338,
2818,
13,
... | 2.313205 | 1,242 |
from openrec.legacy.recommenders import VisualPMF
from openrec.legacy.modules.interactions import PointwiseGeCE
| [
6738,
1280,
8344,
13,
1455,
1590,
13,
47335,
7338,
1330,
15612,
5868,
37,
198,
6738,
1280,
8344,
13,
1455,
1590,
13,
18170,
13,
3849,
4658,
1330,
6252,
3083,
10082,
5222,
628
] | 3.645161 | 31 |
from xml.etree import ElementTree as ET
from explorecourses import *
| [
6738,
35555,
13,
316,
631,
1330,
11703,
27660,
355,
12152,
198,
198,
6738,
7301,
66,
39975,
1330,
1635,
198
] | 3.684211 | 19 |
from flask import Flask
import easyWik
app = Flask(__name__)
if __name__ == "__main__":
context = ('yourserver.crt','yourserver.key')
app.run(host='0.0.0.0',port='5000',ssl_context=context)
| [
6738,
42903,
1330,
46947,
198,
11748,
2562,
33010,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
4732,
796,
19203,
14108,
15388,
13,
6098,
83,
... | 2.597403 | 77 |
"""
Link extraction for auto scraping
"""
from scrapy.link import Link
from scrapy.selector import Selector
from slybot.linkextractor.base import BaseLinkExtractor
| [
37811,
198,
11280,
22236,
329,
8295,
46743,
198,
37811,
198,
6738,
15881,
88,
13,
8726,
1330,
7502,
198,
6738,
15881,
88,
13,
19738,
273,
1330,
9683,
273,
198,
198,
6738,
49822,
13645,
13,
2815,
365,
742,
40450,
13,
8692,
1330,
7308,
... | 3.666667 | 45 |
TITLE = 'Knight of Valhalla'
SCREEN_ROWS = 9
SCREEN_COLUMNS = 16
SIZE = screen_width, screen_height = 64 * 16, 64 * 9
FPS = 60
tile_size = 64
## Speeds
WORLD_SPEED = 1
DEFAULT_PLAYER_SPEED = 5
ASPHALT_SPEED = 1 * DEFAULT_PLAYER_SPEED
GRASS_SPEED = 1 * DEFAULT_PLAYER_SPEED
DIRT_SPEED = 0.6 * DEFAULT_PLAYER_SPEED
WATER_... | [
49560,
2538,
796,
705,
44242,
286,
48762,
6,
198,
6173,
2200,
1677,
62,
49,
22845,
796,
860,
198,
6173,
2200,
1677,
62,
25154,
5883,
8035,
796,
1467,
198,
33489,
796,
3159,
62,
10394,
11,
3159,
62,
17015,
796,
5598,
1635,
1467,
11,
... | 2.232639 | 288 |
"""
A web developer needs to know how to design a web page's size. So, given a specific rectangular web pages area, your job by now is to design a rectangular web page, whose length L and width W satisfy the following requirements:
The area of the rectangular web page you designed must equal to the given target area.... | [
37811,
198,
198,
32,
3992,
8517,
2476,
284,
760,
703,
284,
1486,
257,
3992,
2443,
338,
2546,
13,
1406,
11,
1813,
257,
2176,
36954,
3992,
5468,
1989,
11,
534,
1693,
416,
783,
318,
284,
1486,
257,
36954,
3992,
2443,
11,
3025,
4129,
40... | 3.427609 | 297 |
from flask_restful import Resource, marshal
from flask_pdv.ext.api import requests
from flask_pdv.ext.db.models import TransacaoModel
from flask_pdv.ext.db.schemas import transacao_field
from flask_pdv.ext.db import db
| [
6738,
42903,
62,
2118,
913,
1330,
20857,
11,
22397,
282,
198,
6738,
42903,
62,
30094,
85,
13,
2302,
13,
15042,
1330,
7007,
198,
6738,
42903,
62,
30094,
85,
13,
2302,
13,
9945,
13,
27530,
1330,
3602,
330,
5488,
17633,
198,
6738,
42903,... | 3.027397 | 73 |
from functools import wraps
from time import sleep
from typing import List
from .rate_limit import RateLimit
from .exceptions import RateLimitHit
| [
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
640,
1330,
3993,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
764,
4873,
62,
32374,
1330,
14806,
39184,
198,
6738,
764,
1069,
11755,
1330,
14806,
39184,
17889,
628,
198
] | 4.027027 | 37 |