content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License'). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the 'license' file acc... | [
2,
15069,
13130,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
705,
34156,
27691,
921,
198,
2,
743,
407,
779,
428,
2393,
... | 3.532787 | 244 |
# This file is part of the Reproducible and Reusable Data Analysis Workflow
# Server (flowServ).
#
# Copyright (C) 2019-2021 NYU.
#
# flowServ is free software; you can redistribute it and/or modify it under the
# terms of the MIT License; see LICENSE file for more details.
"""Unit test for creating workflow runs."""
... | [
2,
770,
2393,
318,
636,
286,
262,
36551,
37369,
290,
797,
31979,
6060,
14691,
5521,
11125,
198,
2,
9652,
357,
11125,
11838,
737,
198,
2,
198,
2,
15069,
357,
34,
8,
13130,
12,
1238,
2481,
48166,
13,
198,
2,
198,
2,
5202,
11838,
318... | 2.524178 | 1,034 |
import glob
import os
import shutil
import pytest
from eva_vcf_merge.merge import VCFMerger
tests_dir = os.path.dirname(__file__)
resources_dir = os.path.join(tests_dir, 'resources')
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.fixture
| [
11748,
15095,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
819,
64,
62,
85,
12993,
62,
647,
469,
13,
647,
469,
1330,
569,
22495,
13102,
1362,
198,
198,
41989,
62,
15908,
796,
28686,
13,
6978,... | 2.512821 | 117 |
"""Support for LaMetric time."""
import logging
import voluptuous as vol
from homeassistant.helpers import config_validation as cv, discovery
_LOGGER = logging.getLogger(__name__)
from homeassistant.const import CONF_NAME
DOMAIN = "lametric_local"
LAMETRIC_DEVICES = "LAMETRIC_LOCAL_DEVICES"
CONF_IP_ADDRESS = "ip_... | [
37811,
15514,
329,
4689,
9171,
1173,
640,
526,
15931,
198,
11748,
18931,
198,
198,
11748,
2322,
37623,
5623,
355,
2322,
198,
6738,
1363,
562,
10167,
13,
16794,
364,
1330,
4566,
62,
12102,
341,
355,
269,
85,
11,
9412,
198,
198,
62,
252... | 1.923417 | 679 |
# -*- coding: utf-8 -*-
"""
Francisco Hernán Ortega Culaciati
ortega.francisco@uchile.cl
frortega@gmail.com
Departamento de Geofísica - FCFM
Universidad de Chile
2020
Modifications:
October 2021 - Adds non negative least squares
"""
from .LeastSquares import least_squares, least_squares_cov, least_squares_weights
f... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
42885,
4861,
367,
1142,
21162,
1471,
660,
4908,
32559,
330,
5375,
72,
198,
419,
26470,
13,
8310,
1192,
4861,
31,
794,
576,
13,
565,
198,
8310,
419,
26470,
... | 2.341379 | 290 |
from optimism.JaxConfig import *
from optimism import TensorMath
MatProps = namedtuple('MatProps', ['props','num_props','num_states'])
MaterialModel = namedtuple('MaterialModel',
['compute_energy_density', 'compute_output_energy_density',
'compute_initial_state',... | [
6738,
24323,
13,
41,
897,
16934,
1330,
1635,
198,
6738,
24323,
1330,
309,
22854,
37372,
198,
198,
19044,
2964,
862,
796,
3706,
83,
29291,
10786,
19044,
2964,
862,
3256,
37250,
1676,
862,
41707,
22510,
62,
1676,
862,
41707,
22510,
62,
27... | 2.349315 | 146 |
from collections import namedtuple, defaultdict
from defoe import query_utils
WordLocation = namedtuple('WordLocation', "word position path ")
MatchedWords = namedtuple('MatchedWords', 'target keyword distance words preprocessed')
| [
6738,
17268,
1330,
3706,
83,
29291,
11,
4277,
11600,
198,
198,
6738,
825,
2577,
1330,
12405,
62,
26791,
198,
198,
26449,
14749,
796,
3706,
83,
29291,
10786,
26449,
14749,
3256,
366,
4775,
2292,
3108,
366,
8,
198,
44,
14265,
37117,
796,
... | 3.885246 | 61 |
from celery import shared_task
from .utils import sync_events_from_msl
@shared_task
| [
6738,
18725,
1924,
1330,
4888,
62,
35943,
198,
6738,
764,
26791,
1330,
17510,
62,
31534,
62,
6738,
62,
907,
75,
628,
198,
31,
28710,
62,
35943,
198
] | 3.185185 | 27 |
# Create class named Music that receives title (string), artist (string) and lyrics (string) upon initialization.
# The class should also have methods print_info() and play():
# • The print_info() method should return the following: 'This is "{title}" from "{artist}"'
# • The play() method should return the lyrics.
# S... | [
2,
13610,
1398,
3706,
7849,
326,
11583,
3670,
357,
8841,
828,
6802,
357,
8841,
8,
290,
15844,
357,
8841,
8,
2402,
37588,
13,
198,
2,
383,
1398,
815,
635,
423,
5050,
3601,
62,
10951,
3419,
290,
711,
33529,
198,
2,
5595,
197,
464,
3... | 4.14433 | 97 |
import logging
from crhelper import CfnResource
from time import sleep
import json
import boto3
from semantic_version import Version
from random import choice
execution_trust_policy = {
'Version': '2012-10-17',
'Statement': [
{
'Effect': 'Allow',
'Principal': {
'... | [
11748,
18931,
198,
6738,
1067,
2978,
525,
1330,
327,
22184,
26198,
198,
6738,
640,
1330,
3993,
198,
11748,
33918,
198,
11748,
275,
2069,
18,
198,
6738,
37865,
62,
9641,
1330,
10628,
198,
6738,
4738,
1330,
3572,
198,
198,
18558,
1009,
62... | 2.329114 | 316 |
"""
BSD 3-Clause License
Copyright (c) 2018, Jesus Llorente Santos, Aalto University, Finland
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copy... | [
37811,
198,
21800,
513,
12,
2601,
682,
13789,
198,
198,
15269,
357,
66,
8,
2864,
11,
5803,
18315,
382,
429,
68,
28458,
11,
317,
282,
1462,
2059,
11,
17837,
198,
3237,
2489,
10395,
13,
198,
198,
7738,
396,
3890,
290,
779,
287,
2723,
... | 3.110022 | 918 |
# Copyright (c) 2021 @Bruh_0x
import heroku3
import os
import asyncio
from pyrogram import Client, filters
from pyrogram.types import Dialog, Chat, Message
from Music import BOT_USERNAME
from Music import client as ZAIDUB
# To Block a PM'ed User
@ZAIDUB.on_message(filters.private & filters.command("block", [".", "/"... | [
2,
15069,
357,
66,
8,
33448,
2488,
33,
622,
71,
62,
15,
87,
198,
198,
11748,
4293,
23063,
18,
198,
11748,
28686,
198,
11748,
30351,
952,
198,
6738,
12972,
39529,
1330,
20985,
11,
16628,
198,
6738,
12972,
39529,
13,
19199,
1330,
21269,... | 2.93266 | 297 |
import FWCore.ParameterSet.Config as cms
from DQMOffline.Trigger.HLTEGTnPMonitor_cfi import egmGsfElectronIDsForDQM,egHLTDQMOfflineTnPSource,egmPhotonIDSequenceForDQM,egHLTElePhoDQMOfflineTnPSource,egHLTElePhoHighEtaDQMOfflineTnPSource,photonIDValueMapProducer,egmPhotonIDsForDQM
egammaMonitorHLT = cms.Sequence(
e... | [
11748,
48849,
14055,
13,
36301,
7248,
13,
16934,
355,
269,
907,
198,
198,
6738,
360,
48,
44,
28657,
13,
48344,
13,
6581,
51,
7156,
51,
77,
5868,
261,
2072,
62,
66,
12463,
1330,
29206,
76,
38,
28202,
19453,
1313,
47954,
1890,
35,
48,... | 2.174888 | 223 |
from autorecon.plugins import ServiceScan
| [
6738,
1960,
382,
1102,
13,
37390,
1330,
4809,
33351,
198
] | 4.2 | 10 |
#Copyright 2007-2009 WebDriver committers
#Copyright 2007-2009 Google Inc.
#
#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 b... | [
2,
15269,
4343,
12,
10531,
5313,
32103,
4589,
1010,
198,
2,
15269,
4343,
12,
10531,
3012,
3457,
13,
198,
2,
198,
2,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
5832,
743,
407,
... | 2.66055 | 872 |
import django_on_heroku # put this at the top of the file
import os
from pathlib import Path
from dotenv import load_dotenv
import dj_database_url
load_dotenv()
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - un... | [
11748,
42625,
14208,
62,
261,
62,
11718,
23063,
220,
1303,
1234,
428,
379,
262,
1353,
286,
262,
2393,
198,
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
11748,
42625,
62,
4... | 2.355942 | 1,666 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-23 15:55
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import django_resized.forms
import phoenix.custom_storages
import pyot... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
940,
13,
20,
319,
2177,
12,
486,
12,
1954,
1315,
25,
2816,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
1... | 2.938596 | 114 |
from pyomo.environ import *
model = ConcreteModel()
model.x = Var()
model.o = Objective(expr=model.x)
model.c = Constraint(expr=model.x >= 1)
solver = SolverFactory("glpk")
results = solver.solve(model)
print(results)
print(model.x.value)
| [
6738,
12972,
17902,
13,
268,
2268,
1330,
1635,
198,
198,
19849,
796,
1482,
38669,
17633,
3419,
198,
19849,
13,
87,
796,
12372,
3419,
198,
19849,
13,
78,
796,
37092,
7,
31937,
28,
19849,
13,
87,
8,
198,
19849,
13,
66,
796,
1482,
2536... | 2.602151 | 93 |
"""NUI Galway CT5132/CT5148 Programming and Tools for AI (James McDermott)
Solution for Assignment 3: File ed36ccf7.json
Student name(s): Ian Matthews
Student ID(s): 12100610
"""
import numpy as np
import sys
from common_utils import load_file, print_grid
def solve(grid):
"""
Given the input grid from an... | [
37811,
45,
10080,
5027,
1014,
16356,
20,
19924,
14,
4177,
20,
18294,
30297,
290,
20003,
329,
9552,
357,
14731,
23394,
46187,
8,
198,
198,
46344,
329,
50144,
513,
25,
9220,
1225,
2623,
535,
69,
22,
13,
17752,
198,
198,
38778,
1438,
7,
... | 2.651007 | 447 |
import os
import sys
from distutils.extension import Extension
C_BSPLINE_PKGDIR = os.path.relpath(os.path.dirname(__file__))
SRC_FILES = [os.path.join(C_BSPLINE_PKGDIR, filename)
for filename in ['src/build.c']]
extra_compile_args=['-UNDEBUG']
if not sys.platform.startswith('win'):
extra_compile_ar... | [
11748,
28686,
198,
11748,
25064,
198,
6738,
1233,
26791,
13,
2302,
3004,
1330,
27995,
198,
198,
34,
62,
33,
4303,
24027,
62,
40492,
38,
34720,
796,
28686,
13,
6978,
13,
2411,
6978,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
83... | 2.377622 | 143 |
f = open("demo.txt","w")
mugsNames = []
mugsLinks = []
#load mugs defs and mug names into memory
with open("mugs.txt") as mugs:
line = mugs.readline()
while line:
mug = line.split(",")
mugsNames.append(mug[0])
mugsLinks.append(mug[1].rstrip("\n"))
line = mugs.readline()
info = d... | [
198,
69,
796,
1280,
7203,
9536,
78,
13,
14116,
2430,
86,
4943,
198,
76,
10339,
36690,
796,
17635,
198,
76,
10339,
31815,
796,
17635,
198,
2,
2220,
285,
10339,
825,
82,
290,
25152,
3891,
656,
4088,
198,
4480,
1280,
7203,
76,
10339,
1... | 2.269811 | 530 |
import os
import copy
import pickle
from tqdm import tqdm, trange
from collections import defaultdict, OrderedDict
import numpy as np
import torch
from utils import data_cuda
import gc
| [
11748,
28686,
198,
11748,
4866,
198,
11748,
2298,
293,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
11,
491,
858,
198,
6738,
17268,
1330,
4277,
11600,
11,
14230,
1068,
35,
713,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
... | 3.339286 | 56 |
#!/usr/bin/python3
from argparse import ArgumentParser
import sys
import gzip
import json
import urllib
from urllib.parse import urlparse
import mime_counter
# CDX(J) formats supported
FORMAT_UNKNOWN = 0
FORMAT_CDX7 = 1
FORMAT_CDXJ = 2
# Used to filter out invalid dates
MIN_YEAR = 1991
MAX_YEAR = 2021
# Dictionary to... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
6738,
1822,
29572,
1330,
45751,
46677,
198,
11748,
25064,
198,
11748,
308,
13344,
198,
11748,
33918,
198,
11748,
2956,
297,
571,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
19016,
29572,
19... | 3.21865 | 311 |
# This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/python/tools/api/generator/create_python_api.py script.
"""Public API for tf.estimator.experimental namespace.
"""
from __future__ import print_function as _print_function
import sys as _sys
from tensorflow_estimator.python.estimator.canned.li... | [
2,
770,
2393,
318,
337,
16219,
8881,
24700,
1137,
11617,
0,
2141,
407,
4370,
13,
198,
2,
2980,
515,
416,
25,
11192,
273,
11125,
14,
29412,
14,
31391,
14,
15042,
14,
8612,
1352,
14,
17953,
62,
29412,
62,
15042,
13,
9078,
4226,
13,
... | 2.947559 | 553 |
#!/usr/bin/env python3
from typing import Union
import sys
inputFile = getArg(1, "input")
# print(f'{inputFile = }')
c2i = {".": 0, "#": 1}
decoder: list[int] = []
rawMap: dict[tuple[int, int], int] = {}
with open(inputFile) as fin:
decoder = [c2i[c] for c in fin.read(512)]
fin.read(2)
y = 0
whil... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
6738,
19720,
1330,
4479,
198,
198,
11748,
25064,
628,
198,
198,
15414,
8979,
796,
651,
28100,
7,
16,
11,
366,
15414,
4943,
198,
2,
3601,
7,
69,
6,
90,
15414,
8979,
796,
17... | 2.122302 | 278 |
import os
import time
main()
| [
11748,
28686,
198,
11748,
640,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
12417,
3419,
198
] | 1.954545 | 22 |
import Demo
import pygame
from pygame.sprite import Group
from demo_sprite02 import Sprite02
from random import randint
| [
11748,
34588,
198,
11748,
12972,
6057,
198,
6738,
12972,
6057,
13,
34975,
578,
1330,
4912,
198,
6738,
13605,
62,
34975,
578,
2999,
1330,
33132,
2999,
198,
6738,
4738,
1330,
43720,
600,
198
] | 3.75 | 32 |
import Ngl, Nio
import sys, argparse
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument('--data-file-SSTAYYC', dest='SSTAYYC_file')
parser.add_argument('--data-file-SSTAVAR', dest='SSTAVAR_file')
parser.add_argument('--domain-file', dest='domain_file')
parser.add_argument('--output-dir',... | [
11748,
399,
4743,
11,
399,
952,
198,
11748,
25064,
11,
1822,
29572,
198,
11748,
299,
32152,
355,
45941,
628,
220,
198,
220,
220,
220,
220,
198,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
198,
48610,
13,
2860,
62,
4914... | 2.29859 | 1,631 |
#!/bin/python
import numpy as np
import matplotlib.pyplot as plt
import Ngl,Nio
import sys
lat_min=0.0
lat_max=55.0
lon_min=-100.0
lon_max=10.0
s_years=[1213,1258,1274,1284,1452,1600,1641,1761,1809,1815]
e_years=[1223,1274,1283,1294,1461,1609,1650,1770,1818,1825]
years=[]
for i in range((1849-850)+1):
years.ap... | [
2,
48443,
8800,
14,
29412,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
399,
4743,
11,
45,
952,
198,
11748,
25064,
628,
198,
15460,
62,
1084,
28,
15,
13,
15,
198,... | 1.903564 | 954 |
import uuid
import django.core.files.storage
from django.db import migrations, models
from django.utils.encoding import force_text
| [
11748,
334,
27112,
198,
198,
11748,
42625,
14208,
13,
7295,
13,
16624,
13,
35350,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
6738,
42625,
14208,
13,
26791,
13,
12685,
7656,
1330,
2700,
62,
5239,
628
] | 3.410256 | 39 |
import mysql.connector
from sqlquery import SqlQuery
connection = openConnection(userid='spring', password='spring', instance='python')
sql = SqlQuery("SELECT * FROM SAMPLE",connection)
sql.addConstraint("idsample", "=", 4, 3)
sql.prepare()
for result in sql.query():
print(result)
#connection = openConnection(use... | [
11748,
48761,
13,
8443,
273,
198,
6738,
44161,
22766,
1330,
311,
13976,
20746,
198,
198,
38659,
796,
1280,
32048,
7,
7220,
312,
11639,
16469,
3256,
9206,
11639,
16469,
3256,
4554,
11639,
29412,
11537,
198,
25410,
796,
311,
13976,
20746,
7... | 3.033333 | 180 |
from path import Path
import numpy as np
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("dataset_dir", metavar='DIR', help='path to processed datasets')
parser.add_argument("--dump-root", type=str, default='splits', help="Where to create splits list")
parser.add_argument("--rgbd-step", type=int... | [
6738,
3108,
1330,
10644,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
1822,
29572,
198,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
198,
48610,
13,
2860,
62,
49140,
7203,
19608,
292,
316,
62,
15908,
1600,
1138,
615,
2... | 3.070423 | 213 |
# windows-headset-buttons
# Copyright (C) 2019 jack01. Released under the MIT License (see LICENSE for details).
import sounddevice, struct, win32api, signal, threading
VK_MEDIA_NEXT_TRACK = 0xB0;
VK_MEDIA_PLAY_PAUSE = 0xB3;
VK_MEDIA_PREV_TRACK = 0xB1;
sample_rate = 1024
stream_block_size = 64
press_amplitude_thresh... | [
2,
9168,
12,
2256,
2617,
12,
4360,
27288,
198,
2,
15069,
357,
34,
8,
13130,
14509,
486,
13,
28728,
739,
262,
17168,
13789,
357,
3826,
38559,
24290,
329,
3307,
737,
198,
198,
11748,
2128,
25202,
11,
2878,
11,
1592,
2624,
15042,
11,
6... | 2.793427 | 213 |
import os
f = open('lat_long.csv', 'r')
count = 1
data = {}
for line in f:
if line[0] == "-":
parse_lat_long(line)
else:
parse_markers(line)
keys = sorted(data)
for key in keys:
d = data[key]
if "title" in d:
print("{0}|{1}|{2}|{3}|{4}|{5}".format(key, d["lat"], d["long"], d[... | [
11748,
28686,
198,
198,
69,
796,
1280,
10786,
15460,
62,
6511,
13,
40664,
3256,
705,
81,
11537,
198,
9127,
796,
352,
198,
7890,
796,
23884,
628,
198,
198,
1640,
1627,
287,
277,
25,
198,
220,
220,
220,
611,
1627,
58,
15,
60,
6624,
... | 1.990783 | 217 |
import pytest
# from app import application as flask_app
from app.application import app as flask_app
@pytest.fixture
@pytest.fixture | [
11748,
12972,
9288,
198,
198,
2,
422,
598,
1330,
3586,
355,
42903,
62,
1324,
198,
6738,
598,
13,
31438,
1330,
598,
355,
42903,
62,
1324,
198,
198,
31,
9078,
9288,
13,
69,
9602,
198,
198,
31,
9078,
9288,
13,
69,
9602
] | 3.317073 | 41 |
#!/usr/bin/env python
import xml.etree.ElementTree as ET
import six
from leather.data_types import Text
from leather.series import CategorySeries
from leather.shapes.base import Shape
from leather import theme
from leather.utils import X, Y
class Line(Shape):
"""
Render a series of data as a line.
:pa... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
198,
198,
11748,
2237,
198,
198,
6738,
11620,
13,
7890,
62,
19199,
1330,
8255,
198,
6738,
11620,
13,
25076,
1330,
21743,
... | 2.06563 | 1,158 |
from rest_framework import viewsets, mixins, status
from rest_framework.response import Response
from rest_framework.filters import SearchFilter
from rest_framework.permissions import IsAuthenticated
from rest_framework.decorators import action
from .models import Store
from .serializers import StoreSerializer, StoreI... | [
6738,
1334,
62,
30604,
1330,
5009,
1039,
11,
5022,
1040,
11,
3722,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
198,
6738,
1334,
62,
30604,
13,
10379,
1010,
1330,
11140,
22417,
198,
6738,
1334,
62,
30604,
13,
525,
8481,
1330,
1... | 2.37642 | 704 |
# This file is covered by the BSD license. See LICENSE in the root directory.
from django import forms
from django.utils.safestring import mark_safe
from materials import models
class AutoCharField(forms.CharField):
"""Like regular CharField but max_length is automatically determined."""
class AddDataForm(... | [
2,
770,
2393,
318,
5017,
416,
262,
347,
10305,
5964,
13,
4091,
38559,
24290,
287,
262,
6808,
8619,
13,
198,
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
26791,
13,
49585,
395,
1806,
1330,
1317,
62,
21230,
198,
198,
673... | 2.256608 | 11,161 |
'''
Simple subclass wrapper around `threading.Thread` to get the return value
from a thread in python. Exact same interface as `threading.Thread`!
🌟 Star this repo if you found this useful! 🌟
https://github.com/slow-but-steady/save-thread-result
'''
import time
import threading
from datetime import datetime
__versi... | [
7061,
6,
198,
26437,
47611,
29908,
1088,
4600,
16663,
278,
13,
16818,
63,
284,
651,
262,
1441,
1988,
198,
6738,
257,
4704,
287,
21015,
13,
1475,
529,
976,
7071,
355,
4600,
16663,
278,
13,
16818,
63,
0,
198,
8582,
234,
253,
2907,
428... | 3.007242 | 3,176 |
from math import sqrt
from mat import coldict2mat
from mat import rowdict2mat
from mat import mat2coldict
from mat import mat2rowdict
from mat import transpose
from orthogonalization import orthogonalize
from orthogonalization import aug_orthogonalize
from vec import Vec
def orthonormalize(L):
'''
Input: a lis... | [
6738,
10688,
1330,
19862,
17034,
198,
6738,
2603,
1330,
4692,
713,
17,
6759,
198,
6738,
2603,
1330,
5752,
11600,
17,
6759,
198,
6738,
2603,
1330,
2603,
17,
36673,
713,
198,
6738,
2603,
1330,
2603,
17,
3986,
713,
198,
6738,
2603,
1330,
... | 2.299424 | 521 |
from future.utils import PY3
if not PY3:
__future_module__ = True
| [
6738,
2003,
13,
26791,
1330,
350,
56,
18,
198,
198,
361,
407,
350,
56,
18,
25,
198,
220,
220,
220,
11593,
37443,
62,
21412,
834,
796,
6407,
198
] | 2.535714 | 28 |
from django.db import models
from djmoney.models.fields import MoneyField
from django_enum_choices.fields import EnumChoiceField
from django.contrib.auth import get_user_model
from apps.types import OrderStatus
User = get_user_model()
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
26316,
13,
27530,
13,
25747,
1330,
12911,
15878,
198,
6738,
42625,
14208,
62,
44709,
62,
6679,
1063,
13,
25747,
1330,
2039,
388,
46770,
15878,
198,
6738,
42625,
14208,
13,
3642,
... | 3.463768 | 69 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Tests for food2fork
'''
# import os
# import sys
import unittest
import requests
import food2fork
class TestAPIKey(unittest.TestCase):
'''Class to test if API key works
'''
def test_food2fork_recipe_request(self):
'''Testing if food2fork API key... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
7061,
6,
198,
51,
3558,
329,
2057,
17,
32523,
198,
7061,
6,
198,
2,
1330,
28686,
198,
2,
1330,
25064,
198,
117... | 2.139925 | 536 |
from dataclasses import asdict, is_dataclass
from typing import Any, Dict, Generic, List, Optional, Tuple, TypeVar, Union, cast
from pydantic import BaseConfig, BaseModel, create_model
from pydantic.fields import SHAPE_SINGLETON, ModelField, Undefined
from pydantic.generics import GenericModel
from typing_extensions i... | [
6738,
4818,
330,
28958,
1330,
355,
11600,
11,
318,
62,
19608,
330,
31172,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
42044,
11,
7343,
11,
32233,
11,
309,
29291,
11,
5994,
19852,
11,
4479,
11,
3350,
198,
198,
6738,
279,
5173,
51... | 3.127036 | 307 |
import numpy
import pylab
import tables
import optparse
pylab.rc('text', usetex=True)
if __name__ == '__main__': main()
| [
11748,
299,
32152,
198,
11748,
279,
2645,
397,
198,
11748,
8893,
198,
11748,
2172,
29572,
198,
198,
79,
2645,
397,
13,
6015,
10786,
5239,
3256,
514,
316,
1069,
28,
17821,
8,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,... | 2.652174 | 46 |
'''Cavity_build_specs
Authour: Tim Hucko
Used to calculate optical cavity parameters.
'''
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from cmath import *
c = 3e10 # speed of light in cm/s
L = 5.748*2.54 # length of cavity
R1 = 100.0 # Radius of curvature of M1 in cm
R... | [
7061,
6,
34,
615,
414,
62,
11249,
62,
4125,
6359,
198,
30515,
454,
25,
5045,
33703,
78,
198,
38052,
284,
15284,
18480,
31643,
10007,
13,
198,
7061,
6,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
... | 1.904008 | 1,896 |
import numpy as np
import torch
import tqdm
from deep_privacy import torch_utils
from .infer import truncated_z
| [
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
256,
80,
36020,
198,
6738,
2769,
62,
13776,
1590,
1330,
28034,
62,
26791,
198,
6738,
764,
259,
2232,
1330,
40122,
515,
62,
89,
628,
198
] | 3.257143 | 35 |
__all__ = [
'base_controller',
'simple_calculator_controller',
] | [
834,
439,
834,
796,
685,
198,
220,
220,
220,
705,
8692,
62,
36500,
3256,
198,
220,
220,
220,
705,
36439,
62,
9948,
3129,
1352,
62,
36500,
3256,
198,
60
] | 2.482759 | 29 |
#!/usr/bin/env python
# Copyright (c) 2019, IRIS-HEP
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list o... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
357,
66,
8,
13130,
11,
14826,
1797,
12,
39,
8905,
198,
2,
1439,
2489,
10395,
13,
198,
2,
220,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
3... | 3.44908 | 815 |
import os
| [
11748,
28686,
198
] | 3.333333 | 3 |
from scipy.cluster.hierarchy import dendrogram
import matplotlib.pyplot as plt
import numpy as np
from functools import partial
import cppimport
import pandas as pd
from bhclust.Bayesian_hclust import *
from bhclust.Bayesian_hclust_cpp import *
from bhclust.Bayesian_hclust_cpp_fast import *
from bhclust.Bayesian_hclus... | [
6738,
629,
541,
88,
13,
565,
5819,
13,
71,
959,
9282,
1330,
288,
437,
39529,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
11748,
269,
... | 2.787879 | 132 |
import pytest
from log_retention_compliance.entrypoint import retention_name, main, LogManager
__author__ = "Steve Mactaggart"
__copyright__ = "Steve Mactaggart"
__license__ = "MIT"
def test_retention_name():
"""API Tests"""
assert retention_name(None) == "blart"
assert retention_name(2) == "bling"
de... | [
11748,
12972,
9288,
198,
198,
6738,
2604,
62,
1186,
1463,
62,
47587,
13,
13000,
4122,
1330,
21545,
62,
3672,
11,
1388,
11,
5972,
13511,
198,
198,
834,
9800,
834,
796,
366,
19206,
337,
529,
9460,
433,
1,
198,
834,
22163,
4766,
834,
7... | 2.777778 | 216 |
import standard_play
import behavior
import tactics.positions.defender
import skills.mark
import main
| [
11748,
3210,
62,
1759,
198,
11748,
4069,
198,
11748,
10815,
13,
1930,
1756,
13,
4299,
2194,
198,
11748,
4678,
13,
4102,
198,
11748,
1388,
628
] | 4.12 | 25 |
"""Featurfy package initializer."""
import flask
# app is a single object used by all the code modules in this package
app = flask.Flask(__name__) # pylint: disable=invalid-name
# Read settings from config module (featurfy/config.py)
app.config.from_object('featurfy.config')
# Overlay settings read from file specif... | [
37811,
14304,
2541,
24928,
5301,
4238,
7509,
526,
15931,
198,
11748,
42903,
198,
198,
2,
598,
318,
257,
2060,
2134,
973,
416,
477,
262,
2438,
13103,
287,
428,
5301,
198,
1324,
796,
42903,
13,
7414,
2093,
7,
834,
3672,
834,
8,
220,
1... | 3.342949 | 312 |
"""External Domain Views."""
# Third-Party Libraries
from flask import jsonify, request
from flask.views import MethodView
from pymongo import errors
# cisagov Libraries
from api.manager import ExternalManager
from utils.categorization.categorize import (
delete_domain_proxies,
get_domain_proxies,
post_cat... | [
37811,
41506,
20021,
29978,
526,
15931,
198,
2,
10467,
12,
33553,
46267,
198,
6738,
42903,
1330,
33918,
1958,
11,
2581,
198,
6738,
42903,
13,
33571,
1330,
11789,
7680,
198,
6738,
279,
4948,
25162,
1330,
8563,
198,
198,
2,
33325,
363,
70... | 2.534772 | 1,251 |
import pan.xapi
import xml.etree.ElementTree as ET
from getpass import getpass
from datetime import datetime
# Variables to authenticate
cred = {}
cred['api_username'] = input("User: ")
cred['api_password'] = getpass("Password: ")
cred['hostname'] = input("Palo Alto Hostname or IP Address: ")
# Threat Prevention Poli... | [
11748,
3425,
13,
87,
15042,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
198,
6738,
651,
6603,
1330,
651,
6603,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
2,
15965,
2977,
284,
8323,
5344,
198,
66,
445,
796,
... | 2.12993 | 2,840 |
# -*- coding: utf-8 -*-
import pytest
import numpy as np
import zfit
import os
from zfit.loss import ExtendedUnbinnedNLL
from zfit.minimize import Minuit
import hepstats
from hepstats.hypotests.calculators.basecalculator import BaseCalculator
from hepstats.hypotests.calculators import AsymptoticCalculator, Frequentist... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
12972,
9288,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
1976,
11147,
198,
11748,
28686,
198,
6738,
1976,
11147,
13,
22462,
1330,
24204,
3118,
8800,
2817,
45,
3... | 2.930876 | 217 |
# Copyright 2016 The TensorFlow 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 applica... | [
2,
15069,
1584,
383,
309,
22854,
37535,
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,
2393,
2845,
287,
11846,
... | 1.978884 | 6,630 |
# -*- coding: utf-8 -*-
from nltk import RegexpTagger
from pythainlp.tokenize import word_tokenize
dict_word={
"NUM":open_dict("NUM"),
"PART":open_dict("part"),
"DET":open_dict("det"),
"PROPN":open_dict("PROPN"),
"ADJ":open_dict("ADJ"),
"NOUN":open_dict("NOUN"),
"NOTKNOW":[".*"]
}
regexp_ta... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
299,
2528,
74,
1330,
797,
25636,
79,
51,
7928,
198,
6738,
279,
5272,
391,
34431,
13,
30001,
1096,
1330,
1573,
62,
30001,
1096,
198,
11600,
62,
4775,
34758,
198,
... | 2.179941 | 339 |
from allennlp.data.dataset_readers.dataset_utils.span_utils import enumerate_spans
from allennlp.data.dataset_readers.dataset_utils.span_utils import bio_tags_to_spans
from allennlp.data.dataset_readers.dataset_utils.span_utils import to_bioul, iob1_to_bioul
from allennlp.data.dataset_readers.dataset_utils.span_utils i... | [
6738,
477,
1697,
34431,
13,
7890,
13,
19608,
292,
316,
62,
961,
364,
13,
19608,
292,
316,
62,
26791,
13,
12626,
62,
26791,
1330,
27056,
378,
62,
2777,
504,
198,
6738,
477,
1697,
34431,
13,
7890,
13,
19608,
292,
316,
62,
961,
364,
... | 2.562963 | 135 |
"""
The mysql integration instruments the mysql library to trace MySQL queries.
Enabling
~~~~~~~~
The mysql integration is enabled automatically when using
:ref:`ddtrace-run<ddtracerun>` or :ref:`patch_all()<patch_all>`.
Or use :ref:`patch()<patch>` to manually enable the integration::
from ddtrace import patc... | [
37811,
198,
464,
48761,
11812,
12834,
262,
48761,
5888,
284,
12854,
33476,
20743,
13,
628,
198,
4834,
11716,
198,
15116,
198,
198,
464,
48761,
11812,
318,
9343,
6338,
618,
1262,
198,
25,
5420,
25,
63,
1860,
40546,
12,
5143,
27,
1860,
... | 3.324421 | 561 |
from __future__ import annotations
from math import radians, sin, cos, sqrt, atan2, asin, pi, fabs, copysign
from geometry.vector import Vector
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
10688,
1330,
2511,
1547,
11,
7813,
11,
8615,
11,
19862,
17034,
11,
379,
272,
17,
11,
355,
259,
11,
31028,
11,
7843,
82,
11,
2243,
893,
570,
198,
198,
6738,
22939,
13,
31364,
1330... | 3.266667 | 45 |
from rest_framework import status
from rest_framework.decorators import api_view, permission_classes
from rest_framework.response import Response
from rest_framework.permissions import AllowAny
from django.views.decorators.csrf import ensure_csrf_cookie, csrf_protect
from django.contrib.auth.models import User
from dj... | [
6738,
1334,
62,
30604,
1330,
3722,
198,
6738,
1334,
62,
30604,
13,
12501,
273,
2024,
1330,
40391,
62,
1177,
11,
7170,
62,
37724,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
198,
6738,
1334,
62,
30604,
13,
525,
8481,
1330,
2250... | 3.215447 | 246 |
#!/usr/bin/env python
'''
# Kory Kraft
# Visits a list of locations from the positions.csv file in the extra folder.
# Starts a thread for keyboard input.
# Starts a thread for publishing location markers.
# Returns turtlebot to its "home" when the 'h' key is pressed
# Randomizes list when 'r' is pressed.
# Exits out ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
7061,
6,
220,
198,
2,
509,
652,
41828,
198,
2,
6911,
896,
257,
1351,
286,
7064,
422,
262,
6116,
13,
40664,
2393,
287,
262,
3131,
9483,
13,
198,
2,
50181,
257,
4704,
329,
10586,
512... | 3.231383 | 376 |
main()
| [
198,
12417,
3419,
628
] | 2.25 | 4 |
# Generated by Django 2.2.26 on 2022-02-23 18:18
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
2075,
319,
33160,
12,
2999,
12,
1954,
1248,
25,
1507,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.875 | 32 |
from collections import OrderedDict
from collections.abc import Iterable, Mapping, MutableMapping, MutableSequence
from typing import Any
def rec_avro_schema(namespace='rec_avro'):
"""
Generates an avro schema (as python object) suitable for storing arbitrary
python nested data structure.
For fastavr... | [
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
6738,
17268,
13,
39305,
1330,
40806,
540,
11,
337,
5912,
11,
13859,
540,
44,
5912,
11,
13859,
540,
44015,
594,
198,
6738,
19720,
1330,
4377,
628,
198,
4299,
664,
62,
615,
305,
62,
15952,
... | 2.213583 | 2,032 |
import hashlib
from sqlalchemy.sql import func
from scytale.models import db
| [
11748,
12234,
8019,
198,
198,
6738,
44161,
282,
26599,
13,
25410,
1330,
25439,
198,
198,
6738,
629,
20760,
1000,
13,
27530,
1330,
20613,
628
] | 3.333333 | 24 |
import argparse
from pytorch_transformers import BertForMaskedLM, BertTokenizer
import torch
from multiprobe.model import SingleInputBundle, predict_top_k
if __name__ == '__main__':
main()
| [
11748,
1822,
29572,
198,
198,
6738,
12972,
13165,
354,
62,
35636,
364,
1330,
22108,
1890,
45195,
276,
31288,
11,
22108,
30642,
7509,
198,
11748,
28034,
198,
198,
6738,
18540,
25481,
13,
19849,
1330,
14206,
20560,
33,
31249,
11,
4331,
62,
... | 3.142857 | 63 |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.ensemble import RandomForestRegressor
dataset = pd.read_csv("./Position_Salaries.csv")
x = dataset.iloc[:, 1:2].values
y = dataset.iloc[:, 2].values
regressor = RandomForestRegressor(n_estimators=10, random_state=0)
regressor.fit(x, y... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
1341,
35720,
13,
1072,
11306,
1330,
14534,
34605,
8081,
44292,
628,
198,
19608,
292,
316,
796,... | 2.470356 | 253 |
# Copyright 2022 Filip Strajnar
#
# 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 ... | [
2,
220,
220,
15069,
33160,
24600,
15195,
73,
23955,
198,
2,
198,
2,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
220,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
... | 2.827902 | 982 |
#http://nbviewer.ipython.org/gist/harrism/f5707335f40af9463c43
import numpy as np
from pylab import imshow, show
from timeit import default_timer as timer
def mandel(x, y, max_iters):
"""
Given the real and imaginary parts of a complex number,
determine if it is a candidate for membership in the Mandelbrot
... | [
2,
4023,
1378,
46803,
1177,
263,
13,
541,
7535,
13,
2398,
14,
70,
396,
14,
71,
3258,
1042,
14,
69,
20,
24038,
27326,
69,
1821,
1878,
24,
38380,
66,
3559,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
279,
2645,
397,
1330,
545,
12... | 2.472603 | 292 |
#!/usr/bin/env python
import math
from time import sleep
import pyexotica as exo
from numpy import array, matrix
from pyexotica.publish_trajectory import *
exo.Setup.initRos()
(sol, prob) = exo.Initializers.loadXMLFull('{exotica_examples}/resources/configs/ik_quasistatic_valkyrie.xml')
problem = exo.Setup.createPr... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
10688,
198,
6738,
640,
1330,
3993,
198,
198,
11748,
12972,
1069,
313,
3970,
355,
409,
78,
198,
6738,
299,
32152,
1330,
7177,
11,
17593,
198,
6738,
12972,
1069,
313,
3970,
1... | 2.381048 | 496 |
#!/usr/bin/env python
"""
@package mi.dataset.parser.phsen
@file marine-integrations/mi/dataset/parser/phsen.py
@author Emily Hahn
@brief Parser for the mflm_phsen dataset driver
Release notes:
initial release
"""
__author__ = 'Emily Hahn'
__license__ = 'Apache 2.0'
import re
import ntplib
import time
from datetime... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
31,
26495,
21504,
13,
19608,
292,
316,
13,
48610,
13,
746,
6248,
198,
31,
7753,
16050,
12,
18908,
9143,
14,
11632,
14,
19608,
292,
316,
14,
48610,
14,
746,
6248,
13,... | 1.89817 | 9,506 |
"""
Estimate task complexity
"""
import pandas as pd
import numpy as np
import pickle
from sklearn.model_selection import StratifiedKFold
from sklearn.cluster import KMeans
from sklearn.pipeline import Pipeline, make_pipeline
from sklearn.preprocessing import Normalizer
from sklearn.feature_extraction.text import Tfid... | [
37811,
198,
22362,
1920,
4876,
13357,
198,
198,
37811,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2298,
293,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
29186,
1431,
42,
37,
727,
198,
... | 2.671626 | 941 |
import hashlib
import os
import io
import pathlib
import shutil
from .. import core
resource_manager = ResourceManager(core.create_flask_application().config)
| [
11748,
12234,
8019,
198,
11748,
28686,
198,
11748,
33245,
198,
11748,
3108,
8019,
198,
11748,
4423,
346,
198,
198,
6738,
11485,
1330,
4755,
628,
198,
31092,
62,
37153,
796,
20857,
13511,
7,
7295,
13,
17953,
62,
2704,
2093,
62,
31438,
22... | 3.681818 | 44 |
"""
sheet.py – The canvas is drawn on this instance of sheet
"""
from sqlalchemy import select
from flatland.flatland_exceptions import UnknownSheetSize, UnknownSheetGroup
from flatland.database.flatlanddb import FlatlandDB as fdb
from flatland.datatypes.geometry_types import Rect_Size
from enum import Enum
class S... | [
37811,
198,
21760,
13,
9078,
784,
383,
21978,
318,
7428,
319,
428,
4554,
286,
9629,
198,
37811,
198,
198,
6738,
44161,
282,
26599,
1330,
2922,
198,
6738,
6228,
1044,
13,
38568,
1044,
62,
1069,
11755,
1330,
16185,
3347,
316,
10699,
11,
... | 2.472269 | 595 |
#
# Copyright 2019 The FATE 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 appli... | [
2,
198,
2,
220,
15069,
13130,
383,
376,
6158,
46665,
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,
428,
2393,
... | 3.484496 | 258 |
# * Standard Library Imports -->
import os
import asyncio
import platform
import subprocess
from io import BytesIO, StringIO
from datetime import datetime
from tempfile import TemporaryDirectory
from functools import partial
from pprint import pformat
# * Third Party Imports -->
import discord
from PIL import Image, Im... | [
2,
1635,
8997,
10074,
1846,
3742,
14610,
198,
11748,
28686,
198,
11748,
30351,
952,
198,
11748,
3859,
198,
11748,
850,
14681,
198,
6738,
33245,
1330,
2750,
4879,
9399,
11,
10903,
9399,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
... | 3.390117 | 769 |
"""Stub for argparse2tool"""
import sys
try:
from builtins import range
except Exception:
pass
__version__ = '0.4.5'
def load_conflicting_package(name, not_name, module_number):
"""Load a conflicting package
Some assumptions are made, namely that your package includes the "official"
one as part... | [
37811,
1273,
549,
329,
1822,
29572,
17,
25981,
37811,
198,
11748,
25064,
198,
28311,
25,
198,
220,
220,
220,
422,
3170,
1040,
1330,
2837,
198,
16341,
35528,
25,
198,
220,
220,
220,
1208,
628,
198,
834,
9641,
834,
796,
705,
15,
13,
1... | 2.481752 | 548 |
# -*- coding: utf-8 -*-
import torch
from torch import nn
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198
] | 2.521739 | 23 |
# Usage: specify params (time interval, instance types, avail zones)
# Does: Looks up from cache 1st; fetches results that aren't in the cache
# Check if instance type is present
# Gets present time range: have latest early time thru earliest late time; assumes present time ranges are contiguous
import os
import bo... | [
2,
29566,
25,
11986,
42287,
357,
2435,
16654,
11,
4554,
3858,
11,
29107,
14123,
8,
198,
2,
8314,
25,
29403,
510,
422,
12940,
352,
301,
26,
11351,
2052,
2482,
326,
3588,
470,
287,
262,
12940,
198,
2,
220,
220,
6822,
611,
4554,
2099,
... | 2.82265 | 468 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jeremie Decock (http://www.jdhp.org)
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
357,
66,
8,
1853,
10272,
44871,
4280,
735,
357,
4023,
1378,
2503,
13,
73,
67,
24831,
13,
2398,
8... | 3.156757 | 370 |
import pygame as pg
class Base(pg.sprite.Sprite):
'''The ground of the game'''
TOPLEFT = (-96, 800) | [
11748,
12972,
6057,
355,
23241,
198,
198,
4871,
7308,
7,
6024,
13,
34975,
578,
13,
38454,
578,
2599,
198,
220,
220,
220,
705,
7061,
464,
2323,
286,
262,
983,
7061,
6,
198,
220,
220,
220,
28662,
2538,
9792,
796,
13841,
4846,
11,
1046... | 2.454545 | 44 |
""" Test the display of two different scenes using the same camera.
This can for instance be useful to view two representations
of the same data (e.g. an image and its segmentation).
This example illustrates:
* Having two viewboxes that show different scenes
* Using the same camera in both scenes, via multiple par... | [
37811,
6208,
262,
3359,
286,
734,
1180,
8188,
1262,
262,
976,
4676,
13,
198,
1212,
460,
329,
4554,
307,
4465,
284,
1570,
734,
24612,
198,
1659,
262,
976,
1366,
357,
68,
13,
70,
13,
281,
2939,
290,
663,
10618,
341,
737,
198,
198,
1... | 3.03202 | 406 |
"""Normalize URL for http, https and file scheme (RFC 3986)."""
import re
import urllib.parse
_UNRESERVED = (
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~')
_RESERVED = "!#$&'()*+,/:;=?@[]"
_HEXDIGIT = '0123456789ABCDEFabcdef'
_unquote_table = {a + b: '%' + (a + b).upper()
for a in _H... | [
198,
37811,
26447,
1096,
10289,
329,
2638,
11,
3740,
290,
2393,
7791,
357,
41150,
39260,
21,
21387,
15931,
198,
198,
11748,
302,
198,
11748,
2956,
297,
571,
13,
29572,
198,
198,
62,
4944,
19535,
1137,
53,
1961,
796,
357,
198,
220,
220... | 2.284279 | 1,393 |
numbers = [True] * 2000000
numbers[0] = False
numbers[1] = False
for i in range(len(numbers)):
if numbers[i]:
for x in range(2*i, 2000000, i):
numbers[x] = False
sum = 0
for i, b in enumerate(numbers):
if b:
sum += i
print(sum)
| [
198,
77,
17024,
796,
685,
17821,
60,
1635,
939,
2388,
198,
77,
17024,
58,
15,
60,
796,
10352,
198,
77,
17024,
58,
16,
60,
796,
10352,
198,
198,
1640,
1312,
287,
2837,
7,
11925,
7,
77,
17024,
8,
2599,
198,
220,
220,
220,
611,
314... | 2.061538 | 130 |
'''
Authentication demo example for Jeeves with confidentiality policies.
'''
#from macropy.case_classes import macros, case
import JeevesLib
| [
7061,
6,
198,
47649,
3299,
13605,
1672,
329,
449,
1453,
1158,
351,
32554,
4788,
13,
198,
7061,
6,
198,
2,
6738,
8352,
28338,
13,
7442,
62,
37724,
1330,
34749,
11,
1339,
198,
11748,
449,
1453,
1158,
25835,
198
] | 3.736842 | 38 |
# package NLP_ITB.POSTagger.HMM
from copy import deepcopy
import re
import math
def readWordTagFreq(reader, tagNumbers):
"""
Returns WordFreq
Parameters:
reader: file object
tagNumbers: Map<String, Integer>
"""
# Map<String, Map<Integer, Integer>>
wordTagFreq = {}
for line i... | [
2,
5301,
399,
19930,
62,
2043,
33,
13,
32782,
7928,
13,
39,
12038,
198,
6738,
4866,
1330,
2769,
30073,
198,
11748,
302,
198,
11748,
10688,
198,
198,
4299,
1100,
26449,
24835,
20366,
80,
7,
46862,
11,
7621,
49601,
2599,
198,
220,
220,
... | 1.820266 | 3,533 |
import os
from invoke import run
| [
11748,
28686,
198,
198,
6738,
26342,
1330,
1057,
628
] | 3.888889 | 9 |
#python detect_faces_cmd.py -p Detection_models/deploy.prototxt.txt -d Detection_models/ResNet_300x300.caffemodel
import sys,os
sys.path.append(os.getcwd())
from imutils.video import VideoStream
import numpy as np
import argparse
import time
import cv2
# Required arguments are paths to prototxt, detection model and cl... | [
2,
29412,
4886,
62,
32186,
62,
28758,
13,
9078,
532,
79,
46254,
62,
27530,
14,
2934,
1420,
13,
11235,
313,
742,
13,
14116,
532,
67,
46254,
62,
27530,
14,
4965,
7934,
62,
6200,
87,
6200,
13,
66,
2001,
368,
375,
417,
198,
11748,
250... | 2.528112 | 996 |
"""
pid_control
- Beard & McLain, PUP, 2012
- Last Update:
2/6/2019 - RWB
"""
import sys
import numpy as np
sys.path.append('..')
| [
37811,
198,
35317,
62,
13716,
198,
220,
220,
220,
532,
41698,
1222,
18365,
391,
11,
350,
8577,
11,
2321,
198,
220,
220,
220,
532,
4586,
10133,
25,
198,
220,
220,
220,
220,
220,
220,
220,
362,
14,
21,
14,
23344,
532,
33212,
33,
198... | 2.28125 | 64 |
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 19 18:57:40 2019
@author: twshe
"""
from sijuiacion_lang.lowering import sij, lower
code = lower(
"mod",
"f.txt",
1,
"aa",
[],
[
sij.Defun("hh",
"f.txt",
[],
"lam",
["y"],
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
26223,
4280,
678,
1248,
25,
3553,
25,
1821,
13130,
198,
198,
31,
9800,
25,
665,
7091,
198,
37811,
198,
198,
6738,
264,
2926,
9019,
49443,
62,
1... | 1.508235 | 425 |
from op_graph import graph
from op_graph import graph_to_cc
from op_graph.code import CodeGraph
from op_graph import groups
from op_graph.cc_types import HeaderMapping, header_dep, sys_header_dep
HeaderMapping.set_header_mapping({
'SO3': header_dep('third_party/experiments/sophus.hh'),
'SE3': header_dep('third... | [
6738,
1034,
62,
34960,
1330,
4823,
198,
6738,
1034,
62,
34960,
1330,
4823,
62,
1462,
62,
535,
198,
6738,
1034,
62,
34960,
13,
8189,
1330,
6127,
37065,
198,
6738,
1034,
62,
34960,
1330,
2628,
198,
198,
6738,
1034,
62,
34960,
13,
535,
... | 2.608541 | 281 |
#!/pxrpythonsubst
#
# Copyright 2017 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
... | [
2,
48443,
8416,
81,
79,
5272,
684,
549,
301,
198,
2,
198,
2,
15069,
2177,
46706,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
25189,
4891,
13789,
4943,
198,
2,
351,
262,
1708,
17613,
26,
... | 3.54818 | 467 |
# -*- coding: utf-8 -*-
import os
# This settings will override settings in static.py
STATIC_ROOT = 'test_folder'
class TestingConfiguration(object):
"""Test class."""
def __init__(self, testing_dir):
"""Public constructor."""
self.test_path = os.path.join(testing_dir, STATIC_ROOT)
def... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
198,
198,
2,
770,
6460,
481,
20957,
6460,
287,
9037,
13,
9078,
198,
35744,
2149,
62,
13252,
2394,
796,
705,
9288,
62,
43551,
6,
628,
198,
4871,
2398... | 2.548387 | 155 |
from utilities.testing import ViewTestCases
from utilities.testing import create_tags
from netbox_dns.tests.custom import ModelViewTestCase
from netbox_dns.models import View, Zone, NameServer, Record, RecordTypeChoices
| [
6738,
20081,
13,
33407,
1330,
3582,
14402,
34,
1386,
198,
6738,
20081,
13,
33407,
1330,
2251,
62,
31499,
198,
198,
6738,
2010,
3524,
62,
67,
5907,
13,
41989,
13,
23144,
1330,
9104,
7680,
14402,
20448,
198,
6738,
2010,
3524,
62,
67,
59... | 3.762712 | 59 |
# terrascript/provider/paultyng/git.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:17:00 UTC)
import terrascript
class git(terrascript.Provider):
""""""
__description__ = ""
__namespace__ = "paultyng"
__name__ = "git"
__source__ = "https://github.com/paultyng/terraform-provide... | [
2,
8812,
15961,
14,
15234,
1304,
14,
79,
1721,
88,
782,
14,
18300,
13,
9078,
198,
2,
17406,
4142,
7560,
416,
4899,
14,
15883,
8189,
13,
9078,
357,
1731,
12,
19117,
12,
1238,
2481,
1315,
25,
1558,
25,
405,
18119,
8,
198,
198,
11748... | 2.38172 | 186 |
# Generated by Django 3.2.2 on 2021-05-12 03:26
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
17,
319,
33448,
12,
2713,
12,
1065,
7643,
25,
2075,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import struct
from bitstring import BitArray
#bf32test()
print "\nNumbers:"
print "Smallest fp (denormalized) dec.: " + '{0}'.format(abf32([0],[]))
print "Smallest fp (denormalized) bin.: " + '{0}'.format(f32b(abf32([0],[])))
print "Double smallest fp (denormalized) dec.: " + '{0}'.format(abf32([],[... | [
11748,
2878,
201,
198,
6738,
1643,
8841,
1330,
4722,
19182,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
2,
19881,
2624,
9288,
3419,
201,
198,
4798,
37082,
77,
49601,
11097,
201,
198,
4798,
366,
18712,
395,
... | 1.938298 | 940 |