content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# THIS FILE WAS AUTOMATICALLY GENERATED BY deprecated_modules.py
import sys
from . import _locally_linear
from ..externals._pep562 import Pep562
from ..utils.deprecation import _raise_dep_warning_if_not_pytest
deprecated_path = 'sklearn.manifold.locally_linear'
correct_import_path = 'sklearn.manifold'
_raise_dep_war... | [
198,
2,
12680,
45811,
21725,
47044,
2662,
1404,
2149,
19807,
24700,
1137,
11617,
11050,
39224,
62,
18170,
13,
9078,
198,
11748,
25064,
198,
6738,
764,
1330,
4808,
17946,
453,
62,
29127,
198,
6738,
11485,
1069,
759,
874,
13557,
431,
79,
... | 2.8 | 155 |
import unittest
import pygame as pg
import numpy as np
from square import Square
from pathfinder import PathFinder
from utils import Dimension
if __name__ == "__main__":
unittest.main() | [
11748,
555,
715,
395,
198,
11748,
12972,
6057,
355,
23241,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
6616,
1330,
9276,
198,
6738,
3108,
22805,
1330,
10644,
37,
5540,
198,
6738,
3384,
4487,
1330,
34024,
628,
198,
198,
361,
1159... | 3.271186 | 59 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Examples for the NURBS-Python Package
Released under MIT License
Developed by Onur Rauf Bingol (c) 2019
Exporting a NURBS surface in VTK Polydata format
"""
from geomdl.shapes import surface
from geomdl import exchange_vtk
# Create a cylindrical surf... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
220,
220,
220,
21066,
329,
262,
399,
4261,
4462,
12,
37906,
15717,
198,
220,
220,
220,
28728,
739,
1... | 2.845283 | 265 |
# Generated by Django 3.0.10 on 2020-09-23 00:28
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
940,
319,
12131,
12,
2931,
12,
1954,
3571,
25,
2078,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.8 | 30 |
import os
import random
import cv2
import numpy as np
import pickle
try:
from .utility_functions import pre_process_image_for_vgg
from .utility_functions import get_conversions_between_input_and_feature
from .utility_functions import get_input_coordinates_of_anchor_points
from .utility_functions import ... | [
11748,
28686,
198,
11748,
4738,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2298,
293,
198,
28311,
25,
198,
220,
220,
220,
422,
764,
315,
879,
62,
12543,
2733,
1330,
662,
62,
14681,
62,
9060,
62,
1640,
6... | 2.34392 | 8,816 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 3/14/2019 4:04 PM
# @Author : chinshin
# @FileName: dist_mult.py
import numpy
import chainer
from chainer import link
from chainer import links
from chainer import variable
from chainer import initializers
from chainer.functions import relu
from ch... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
201,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
2,
2488,
7575,
220,
220,
220,
1058,
513,
14,
1415,
14,
23344,
604,
25,
3023,
3122,
201,
198,
2,
2488,
138... | 2.75 | 148 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render
# Create your views here.
from django.http import HttpResponse
from django.template import loader
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
198,
2,
13610,
534,
5009,
994,
13,
198,
6738... | 3.278689 | 61 |
from . import errors
| [
6738,
764,
1330,
8563,
198
] | 4.2 | 5 |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | [
2,
198,
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
9387,
351,
428,
670,
329,
3224,
1321,
198,
2,
5115,
6634,
9238,
13,
220,
... | 2.327057 | 3,877 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pickle
import numpy
from scipy.stats.mstats import kendalltau_seasonal
# set up input parameters
filename_ts = "/home2/hilboll/data/pickle/20100920_trends_levelshift_cityzen/Pearl River Delta_seas-const.pkl"
with open(filename_ts, 'rb') as _fd:
ts = pickle.lo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
2298,
293,
198,
198,
11748,
299,
32152,
198,
6738,
629,
541,
88,
13,
34242,
13,
76,
34242,
1330,
479,
437... | 2.710084 | 476 |
#!/usr/bin/env python3
"""
Parse a JUnit XML format test output file and print useful info
"""
import argparse
from collections import defaultdict
import os
import sys
import xml.sax
import xml.sax.handler
if __name__ == "__main__":
sys.exit(main())
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
10044,
325,
257,
449,
26453,
23735,
5794,
1332,
5072,
2393,
290,
3601,
4465,
7508,
198,
37811,
198,
11748,
1822,
29572,
198,
6738,
17268,
1330,
4277,
11600,
198,
11748,
2... | 3.146341 | 82 |
"""Collection of layers."""
from .collapse import (AttentionCollapse, AverageCollapse, ElementCollapse, ExponentialCollapse,
MaxCollapse, SumCollapse)
from .allocate import (AnalyticalMarkowitz, NCO, NumericalMarkowitz, Resample, SoftmaxAllocator,
SparsemaxAllocator, Weigh... | [
37811,
36307,
286,
11685,
526,
15931,
198,
198,
6738,
764,
26000,
7512,
1330,
357,
8086,
1463,
22667,
7512,
11,
13475,
22667,
7512,
11,
11703,
22667,
7512,
11,
5518,
35470,
22667,
7512,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
... | 1.98419 | 506 |
from pulsar.api import get_actor, arbiter
from pulsar.apps import wsgi
from pulsar.utils.log import clear_logger
from lux.core import LuxCommand, Setting
nominify = Setting('nominify',
['--nominify'],
action="store_true",
default=False,
desc... | [
6738,
22271,
283,
13,
15042,
1330,
651,
62,
11218,
11,
9277,
263,
198,
6738,
22271,
283,
13,
18211,
1330,
266,
82,
12397,
198,
6738,
22271,
283,
13,
26791,
13,
6404,
1330,
1598,
62,
6404,
1362,
198,
198,
6738,
10632,
13,
7295,
1330,
... | 2.197531 | 162 |
# =============================================================================
#
# EZID :: datacite_xml.py
#
# Allows processing a form with form elements named with simple XPATH
# expressions
# 1) Generates form fields for use with Django form model.
# 2) Creates an XML document for attaching Datacite XML metadata.
#... | [
2,
38093,
25609,
198,
2,
198,
2,
412,
57,
2389,
7904,
4818,
330,
578,
62,
19875,
13,
9078,
198,
2,
198,
2,
40402,
7587,
257,
1296,
351,
1296,
4847,
3706,
351,
2829,
11961,
12599,
198,
2,
14700,
198,
2,
352,
8,
2980,
689,
1296,
7... | 2.40675 | 3,437 |
'''
Generates the image stream resource definitions.
'''
import powershift.resources as resources
image_stream = resources.v1_ImageStream(
metadata = resources.v1_ObjectMeta(
name = 'jupyter-notebook',
annotations = {
'openshift.io/display-name': 'Jupyter Notebook'
}
),
... | [
7061,
6,
198,
8645,
689,
262,
2939,
4269,
8271,
17336,
13,
198,
198,
7061,
6,
198,
198,
11748,
5635,
29323,
13,
37540,
355,
4133,
198,
198,
9060,
62,
5532,
796,
4133,
13,
85,
16,
62,
5159,
12124,
7,
198,
220,
220,
220,
20150,
796,... | 2.140399 | 1,104 |
# load libraries
import trimesh
import torch
import json
import os
from tqdm import tqdm as tqdm
import matplotlib.pyplot as plt
import numpy as np
from types import SimpleNamespace
from utils import render
from shapenet_dataloader import ShapeNetMesh, FixedPointsCachedDataset
from shapeflow.layers.deforma... | [
2,
3440,
12782,
201,
198,
11748,
491,
999,
71,
201,
198,
11748,
28034,
201,
198,
11748,
33918,
201,
198,
11748,
28686,
201,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
355,
256,
80,
36020,
201,
198,
11748,
2603,
29487,
8019,
13,
... | 2.114694 | 4,342 |
l = int(input())
n = int(input())
q = 0
c = 0
for i in range(n):
r = int(input())
if r == 1 and q == 0:
c += 1
q = l
if q > 0:
q -= 1
print(c)
| [
75,
796,
493,
7,
15414,
28955,
198,
77,
796,
493,
7,
15414,
28955,
198,
80,
796,
657,
198,
66,
796,
657,
198,
1640,
1312,
287,
2837,
7,
77,
2599,
198,
220,
220,
220,
374,
796,
493,
7,
15414,
28955,
198,
220,
220,
220,
611,
374,
... | 1.79 | 100 |
"""
Overview
========
Extra mode for cplusplus programming language.
Key-Commands
============
Namespace: cplusplus-mode
Mode: NORMAL
Event: <Key-exclam>
Description: Switch to C++ mode.
"""
| [
37811,
198,
29064,
198,
2559,
198,
198,
27726,
4235,
329,
269,
9541,
9541,
8300,
3303,
13,
198,
198,
9218,
12,
6935,
1746,
198,
25609,
198,
198,
36690,
10223,
25,
269,
9541,
9541,
12,
14171,
198,
198,
19076,
25,
25273,
42126,
198,
923... | 3.142857 | 63 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import logging
from gmprocess.subcommands.lazy_loader import LazyLoader
arg_dicts = LazyLoader("arg_dicts", globals(), "gmprocess.subcommands.arg_dicts")
base = LazyLoader("base", globals(), "gmprocess.subcommands.base")
ws = LazyLoader("ws", globals(), "gmproc... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
198,
11748,
18931,
198,
198,
6738,
308,
76,
14681,
13,
7266,
9503,
1746,
13,
75,
12582,
62,
29356,
... | 2.120295 | 1,355 |
# Generated by Django 2.1.2 on 2018-10-20 13:08
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
17,
319,
2864,
12,
940,
12,
1238,
1511,
25,
2919,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
1420... | 3.017857 | 56 |
#!/usr/bin/env python3
#
# Copyright 2019-2020 Internet Corporation for Assigned Names and Numbers.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# Developed by S... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
198,
2,
15069,
13130,
12,
42334,
4455,
10501,
329,
2195,
3916,
28531,
290,
27797,
13,
198,
2,
198,
2,
770,
8090,
6127,
5178,
318,
2426,
284,
262,
2846,
286,
262,
29258,
5094,
... | 3.628676 | 272 |
# coding=utf-8
# Copyright 2018 The Batfish Open Source Project
#
# 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 requi... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
220,
220,
15069,
2864,
383,
6577,
11084,
4946,
8090,
4935,
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,
... | 2.756489 | 809 |
from aiohttp import ClientResponseError
from aiohttp_retry import RetryClient, RetryOptions
from tests.app import App
| [
6738,
257,
952,
4023,
1330,
20985,
31077,
12331,
198,
198,
6738,
257,
952,
4023,
62,
1186,
563,
1330,
4990,
563,
11792,
11,
4990,
563,
29046,
198,
6738,
5254,
13,
1324,
1330,
2034,
628,
628,
628,
628
] | 3.5 | 36 |
__load()
del __load
| [
834,
2220,
3419,
198,
12381,
11593,
2220,
198
] | 2.5 | 8 |
"""Support for an Environment resource in Skytap.
In nearly every case, you'll access an Environment via the
:class:`~skytap.Environments` object::
envs = skytap.Environments()
for environment in envs:
print (environment.name)
You can access anything from an environment that Skytap includes in their
... | [
37811,
15514,
329,
281,
9344,
8271,
287,
5274,
44335,
13,
198,
198,
818,
3016,
790,
1339,
11,
345,
1183,
1895,
281,
9344,
2884,
262,
198,
25,
4871,
25,
63,
93,
15688,
44335,
13,
4834,
12103,
63,
2134,
3712,
628,
220,
220,
220,
551,
... | 2.699586 | 1,691 |
import helper
import blargh
helper.greeting("Hello")
blargh.nein() | [
11748,
31904,
198,
11748,
698,
283,
456,
198,
198,
2978,
525,
13,
70,
2871,
278,
7203,
15496,
4943,
198,
2436,
283,
456,
13,
710,
259,
3419
] | 2.576923 | 26 |
#!/usr/bin/env python
# encoding: utf-8
# Only enabled on windows
import sys
import os
import shutil
from zipfile import ZipFile
from common.utils import MSTypes
if sys.platform == "win32":
# Download and install pywin32 from https://sourceforge.net/projects/pywin32/files/pywin32/
import win32com.client # @Unr... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
2,
5514,
9343,
319,
9168,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
6738,
19974,
7753,
1330,
38636,
8979,
198,
6738,
... | 2.77193 | 228 |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | [
2,
198,
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
9387,
351,
428,
670,
329,
3224,
1321,
198,
2,
5115,
6634,
9238,
13,
220,
... | 3.619048 | 315 |
"""
bulb
=====
Simulates a light switch, given a device which has a longitude and latitude (therefore a time of day and therefore an external light level)
Reacts appropriately to location on Earth, time-of-day and season-of-year.
Configurable parameters::
{
"power" : (optional) number (or list to pick ... | [
37811,
198,
15065,
65,
198,
1421,
28,
198,
8890,
15968,
257,
1657,
5078,
11,
1813,
257,
3335,
543,
468,
257,
890,
3984,
290,
32477,
357,
8117,
754,
257,
640,
286,
1110,
290,
4361,
281,
7097,
1657,
1241,
8,
198,
3041,
8656,
20431,
28... | 2.827869 | 244 |
"""empty message
Revision ID: 9d05939446cd
Revises: 1d39fb6ab24a
Create Date: 2018-07-24 20:12:53.214761
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9d05939446cd'
down_revision = '1d39fb6ab24a'
branch_labels = None
depends_on = None
| [
37811,
28920,
3275,
198,
198,
18009,
1166,
4522,
25,
860,
67,
46712,
2670,
27260,
10210,
198,
18009,
2696,
25,
352,
67,
2670,
21855,
21,
397,
1731,
64,
198,
16447,
7536,
25,
2864,
12,
2998,
12,
1731,
1160,
25,
1065,
25,
4310,
13,
22... | 2.512605 | 119 |
from django.core.urlresolvers import reverse
from django.test import TestCase
# FIXME(willkg): add test for authenticated and staff
| [
6738,
42625,
14208,
13,
7295,
13,
6371,
411,
349,
690,
1330,
9575,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
628,
198,
220,
220,
220,
1303,
44855,
11682,
7,
10594,
10025,
2599,
751,
1332,
329,
44529,
290,
3085,
198
] | 3.45 | 40 |
"""Debugging/cleanup checks."""
import itertools
import chen_2009_original_sbml
model = chen_2009_original_sbml.load_model()
# determine redundant species (same name)
sa = sorted(model.species, key=lambda s: (s.label, s.compartment))
rs = [x
for x in ((n, map(lambda s: s.compartment, it))
for n, it i... | [
37811,
27509,
2667,
14,
27773,
929,
8794,
526,
15931,
198,
198,
11748,
340,
861,
10141,
198,
11748,
269,
831,
62,
10531,
62,
14986,
62,
36299,
4029,
198,
198,
19849,
796,
269,
831,
62,
10531,
62,
14986,
62,
36299,
4029,
13,
2220,
62,
... | 2.394541 | 403 |
"""Exceptions module.
Custom exceptions used by Realtime Stock package.
"""
from __future__ import unicode_literals
class RequestError(Exception):
"""Class for request exception."""
pass
| [
37811,
3109,
11755,
8265,
13,
198,
198,
15022,
13269,
973,
416,
6416,
2435,
10500,
5301,
13,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
628,
198,
4871,
19390,
12331,
7,
16922,
2599,
198,
220,
220,
... | 3.636364 | 55 |
# Copyright [2017-2021] [IBM Corporation]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writ... | [
2,
15069,
685,
5539,
12,
1238,
2481,
60,
685,
9865,
44,
10501,
60,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
... | 2.434019 | 4,956 |
# -*- coding: utf-8 -*-
import json
from dataclasses import dataclass
from contextlib import contextmanager
from typing import Optional
from src.commands.enums import WebServer, Database, Deployment
from src.constants import CONFIG_FILE_NAME, SHARED_GROUP, HOME_BASE_PATH
@dataclass
@contextmanager
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
33918,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
198,
6738,
4732,
8019,
1330,
4732,
37153,
198,
6738,
19720,
1330,
32233,
198,
198,
6738,
12351... | 3.252632 | 95 |
MORSE = {'A': '.-', 'B': '-...', 'C': '-.-.',
'D': '-..', 'E': '.', 'F': '..-.',
'G': '--.', 'H': '....', 'I': '..',
'J': '.---', 'K': '-.-', 'L': '.-..',
'M': '--', 'N': '-.', 'O': '---',
'P': '.--.', 'Q': '--.-', 'R': '.-.',
'S': '...... | [
44,
1581,
5188,
796,
1391,
6,
32,
10354,
705,
7874,
3256,
220,
220,
220,
705,
33,
10354,
705,
12,
986,
3256,
220,
220,
705,
34,
10354,
705,
12,
7874,
2637,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
705,
35,
10354,
705,
12... | 1.920749 | 694 |
import sys
import socket
from comgames.play.game import Game
from comgames.AI.env import Env
from comgames.AI.agent import agent_list
from comgames.AI.train import Trainer
from comgames.utils import *
| [
11748,
25064,
198,
11748,
17802,
198,
198,
6738,
401,
19966,
13,
1759,
13,
6057,
1330,
3776,
198,
6738,
401,
19966,
13,
20185,
13,
24330,
1330,
2039,
85,
198,
6738,
401,
19966,
13,
20185,
13,
25781,
1330,
5797,
62,
4868,
198,
6738,
40... | 3.433333 | 60 |
#!/usr/bin/python
'''
This file is part of SNC
Copyright (c) 2014-2021, Richard Barnett
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 limitati... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
7061,
6,
628,
220,
770,
2393,
318,
636,
286,
311,
7792,
628,
220,
15069,
357,
66,
8,
1946,
12,
1238,
2481,
11,
6219,
38174,
628,
220,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
387... | 2.158252 | 1,327 |
"""Functions for working with model data from keras
"""
from __future__ import absolute_import
from __future__ import print_function
from sklearn import model_selection
import numpy as np
def test_len(train):
"""Test if all the elements in `train=(x,y)` the same `shape[0]`
"""
l = train[1].shape[0]
if... | [
37811,
24629,
2733,
329,
1762,
351,
2746,
1366,
422,
41927,
292,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
1341,
35720,
1330,
2746,
62,
49283,
198,
11... | 2.250537 | 1,397 |
import bpy
import math
import mathutils
import bmesh
import time
from bpy.props import *
from bpy.types import Operator
from bpy_extras import view3d_utils
from .properties import *
from .functions_general import *
from .functions_drawing import *
from .functions_modal import *
from .functions_keymaps impor... | [
11748,
275,
9078,
201,
198,
11748,
10688,
201,
198,
11748,
10688,
26791,
201,
198,
11748,
275,
76,
5069,
201,
198,
11748,
640,
201,
198,
6738,
275,
9078,
13,
1676,
862,
1330,
1635,
201,
198,
6738,
275,
9078,
13,
19199,
1330,
35946,
20... | 2.958042 | 143 |
# Print Nodes in Top View of Binary Tree
from collections import deque
if __name__ == '__main__':
root = Node(1)
root.left = Node(2)
root.right = Node(3)
root.left.right = Node(4)
root.left.right.right = Node(5)
root.left.right.right.right = Node(6)
for i in top_view(root):
prin... | [
2,
12578,
399,
4147,
287,
5849,
3582,
286,
45755,
12200,
198,
6738,
17268,
1330,
390,
4188,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
6808,
796,
19081,
7,
16,
8,
198,
220,
220,
220,... | 2.356643 | 143 |
from __future__ import division
import os, cv2, sys, math,random
import numpy as np
import hdf5storage as h5io
import keras.backend as K
from zk_config import *
from zk_utilities import *
from zk_models import *
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
if __name__ == '__main__':
camera_number = 0
cap = cv2.... | [
6738,
11593,
37443,
834,
1330,
7297,
198,
11748,
28686,
11,
269,
85,
17,
11,
25064,
11,
10688,
11,
25120,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
289,
7568,
20,
35350,
355,
289,
20,
952,
198,
11748,
41927,
292,
13,
1891,
437,
... | 2.103376 | 948 |
from math import log, sqrt
from typing import List
from .exceptions import NilListException, MissMatchedLengthException, ZeroHedgeRatioException
L2ZeroValException = Exception("a zero value in l2")
BetaHatLTEZeroException = Exception("beta hat is negative")
def calcSigmaHat(l1: List[float], l2: List[float], betaHat: ... | [
6738,
10688,
1330,
2604,
11,
19862,
17034,
198,
6738,
19720,
1330,
7343,
198,
6738,
764,
1069,
11755,
1330,
29213,
8053,
16922,
11,
4544,
44,
14265,
24539,
16922,
11,
12169,
39,
14907,
29665,
952,
16922,
198,
198,
43,
17,
28667,
7762,
1... | 2.552913 | 841 |
from typing import Union
from copy import deepcopy
import urllib.parse
import urllib.request
import pathlib
import sys
import sevenbridges as sbg
from .version import __version__
from ruamel.yaml.parser import ParserError
from ruamel.yaml.scanner import ScannerError
from ruamel.yaml import YAML
fast_yaml = YAML(typ=... | [
6738,
19720,
1330,
4479,
198,
6738,
4866,
1330,
2769,
30073,
198,
11748,
2956,
297,
571,
13,
29572,
198,
11748,
2956,
297,
571,
13,
25927,
198,
11748,
3108,
8019,
198,
11748,
25064,
198,
198,
11748,
3598,
10236,
3212,
355,
264,
35904,
1... | 2.53072 | 944 |
# coding=utf-8
# Copyright 2019 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
13130,
383,
3012,
4992,
46665,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
... | 3.552381 | 210 |
import paddle
from .builder import SAMPLINGS
@SAMPLINGS.register()
class SamplingLangevin(SamplingBase):
""" This class implements the Langevin Dynamic.
Gradient clipping and noise decay is supported.
TODO: logger, warm start etc.
""" | [
11748,
39517,
198,
6738,
764,
38272,
1330,
28844,
6489,
20754,
198,
198,
31,
49302,
6489,
20754,
13,
30238,
3419,
198,
4871,
3409,
11347,
43,
858,
7114,
7,
16305,
11347,
14881,
2599,
198,
220,
220,
220,
37227,
770,
1398,
23986,
262,
475... | 3.095238 | 84 |
# Run with Python 2.7
##
import zipfile
import shutil
import numpy
import os
import sys
import datetime
import getopt
#### Set this variable to True if only a tabulated summary output is *NOT* required #####
bIsShort = True
currentTriggerVal = 0
## Calculate square of a number
####################... | [
2,
5660,
351,
11361,
362,
13,
22,
198,
2235,
628,
198,
11748,
19974,
7753,
198,
11748,
4423,
346,
198,
11748,
299,
32152,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
4818,
8079,
198,
11748,
651,
8738,
628,
198,
198,
4242,
5345,
... | 4.075949 | 158 |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
2,
15069,
12131,
43208,
21852,
1766,
1539,
12052,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198... | 2.300747 | 4,552 |
# BSD 2-CLAUSE LICENSE
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions i... | [
2,
347,
10305,
362,
12,
16827,
19108,
38559,
24290,
198,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
17613,
11,
198,
2,
389,
10431,
2810,
326,
262,
1708,
3403,
389,
1138,
25,
198,
198,
2,
22... | 2.743601 | 2,383 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | [
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,... | 3.021538 | 325 |
from slugify import slugify as _slugify
| [
6738,
31065,
1958,
1330,
31065,
1958,
355,
4808,
6649,
1018,
1958,
628
] | 3.416667 | 12 |
import pandas as pd
import seaborn as sns
import json
import matplotlib.pyplot as plt
import sys
from sklearn.feature_selection import SelectKBest
from sklearn.feature_selection import chi2
from sklearn.preprocessing import StandardScaler, LabelEncoder
from sklearn.model_selection import train_test_split
from sklearn.e... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,
11748,
33918,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
25064,
198,
6738,
1341,
35720,
13,
30053,
62,
49283,
1330,
9683,
... | 3.110244 | 1,025 |
"""
init file
"""
from .turbine import Turbine
| [
37811,
198,
15003,
220,
2393,
198,
37811,
198,
198,
6738,
764,
83,
5945,
500,
1330,
3831,
65,
500,
198
] | 2.578947 | 19 |
from typing import List, Tuple
import numpy as np
import tensorflow as tf
from lrgwd.config import NON_ZERO_GWD_PLEVELS
from lrgwd.models.config import BLOCK_PARAMS, LOSS_ARRAY
from tensorflow.keras import regularizers
from tensorflow.keras.layers import Dense, BatchNormalization
tf.autograph.set_verbosity(3, True)
#... | [
6738,
19720,
1330,
7343,
11,
309,
29291,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
300,
41345,
16993,
13,
11250,
1330,
44521,
62,
57,
34812,
62,
38,
22332,
62,
16437,
18697,
50,
198,
... | 2.84375 | 128 |
#!/usr/bin/env python
import time
from tornado.testing import AsyncTestCase
import tornadoredis
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
640,
198,
198,
6738,
33718,
13,
33407,
1330,
1081,
13361,
14402,
20448,
198,
198,
11748,
12445,
324,
1850,
271,
628,
628,
628
] | 3.21875 | 32 |
### BEGIN LICENSE ###
### Use of the triage tools and related source code is subject to the terms
### of the license below.
###
### ------------------------------------------------------------------------
### Copyright (C) 2011 Carnegie Mellon University. All Rights Reserved.
### ---------------------------------------... | [
21017,
347,
43312,
38559,
24290,
44386,
198,
21017,
5765,
286,
262,
1333,
496,
4899,
290,
3519,
2723,
2438,
318,
2426,
284,
262,
2846,
198,
21017,
286,
262,
5964,
2174,
13,
198,
21017,
198,
21017,
16529,
982,
198,
21017,
15069,
357,
34,... | 3.648521 | 845 |
import os
import jieba
from tfidf_calc import calc_tfidf
if __name__ == "__main__":
main()
| [
11748,
28686,
198,
11748,
474,
494,
7012,
198,
6738,
48700,
312,
69,
62,
9948,
66,
1330,
42302,
62,
27110,
312,
69,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 2.414634 | 41 |
import pickle
import argparse
import pandas as pd
from tqdm import tqdm
import numpy as np
import helper
import scipy.io
from scipy.stats import linregress, ttest_1samp, ttest_ind
from statsmodels.stats.anova import AnovaRM
import matplotlib.pyplot as plt
import seaborn as sns
import helper
plt.switch_backend('agg')... | [
11748,
2298,
293,
198,
11748,
1822,
29572,
198,
11748,
19798,
292,
355,
279,
67,
220,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
299,
32152,
355,
45941,
220,
198,
11748,
31904,
198,
11748,
629,
541,
88,
13,
952,
198,... | 2.556561 | 221 |
# add codes
| [
2,
751,
12416,
198
] | 3 | 4 |
print('Работа на 20_11_29')
| [
4798,
10786,
140,
254,
16142,
140,
109,
15166,
20375,
16142,
12466,
121,
16142,
1160,
62,
1157,
62,
1959,
11537,
198
] | 1.4 | 20 |
from monotonic_binning.monotonic_woe_binning import Binning | [
6738,
937,
313,
9229,
62,
8800,
768,
13,
2144,
313,
9229,
62,
86,
2577,
62,
8800,
768,
1330,
20828,
768
] | 2.95 | 20 |
fn = Solution().licenseKeyFormatting
print(fn("5F3Z-2e-9-w", K=4))
print(fn("2-5g-3-J", K=2))
| [
198,
198,
22184,
796,
28186,
22446,
43085,
9218,
26227,
889,
198,
198,
4798,
7,
22184,
7203,
20,
37,
18,
57,
12,
17,
68,
12,
24,
12,
86,
1600,
509,
28,
19,
4008,
198,
4798,
7,
22184,
7203,
17,
12,
20,
70,
12,
18,
12,
41,
1600,... | 1.901961 | 51 |
list1 = map(int,input().split())
int_arr_list = map(int,input().split())
set_A = set(map(int,input().split()))
set_B = set(map(int,input().split()))
happiness = 0
for i in int_arr_list:
if i in set_A:
happiness+=1
elif i in set_B:
happiness-=1
print(happiness)
| [
4868,
16,
796,
3975,
7,
600,
11,
15414,
22446,
35312,
28955,
198,
600,
62,
3258,
62,
4868,
796,
3975,
7,
600,
11,
15414,
22446,
35312,
28955,
198,
2617,
62,
32,
796,
900,
7,
8899,
7,
600,
11,
15414,
22446,
35312,
3419,
4008,
198,
... | 2.242188 | 128 |
#!/usr/bin/python
import os
import requests
import json
import subprocess
import time
config_file = open('config.json', 'r')
config = json.load(config_file)
invalid_properties = [k for k, v in config.items() if v == ""]
print "current configuration:", json.dumps(config, indent=2)
if len(invalid_properties) > 0:
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
11748,
28686,
198,
11748,
7007,
198,
11748,
33918,
198,
11748,
850,
14681,
198,
11748,
640,
198,
198,
11250,
62,
7753,
796,
1280,
10786,
11250,
13,
17752,
3256,
705,
81,
11537,
220,
220,
220,
... | 2.600493 | 811 |
import re
import time
import sys
DATE_TIME_FORMAT = '%d %b %Y'
FIELD_TAG_PATTERN = 'PO %s %s\n'
FIELD_ERROR = 'XXXXX'
PATTERN_ERROR = '== Error in line %d (%s,%s) =='
STORE_PI_ENABLE = 1
STORE_PI_DISABLE = 0
count_wo = 0
def makePPList(lstPP, count):
'''
Funtio to organize the array acc... | [
11748,
302,
201,
198,
11748,
640,
201,
198,
11748,
25064,
201,
198,
201,
198,
201,
198,
35,
6158,
62,
34694,
62,
21389,
1404,
796,
705,
4,
67,
4064,
65,
4064,
56,
6,
201,
198,
44603,
62,
42197,
62,
47,
1404,
31800,
796,
705,
16402... | 1.976217 | 883 |
"""
This is a file to describe the Python module distribution and
helps with installation.
More info on various arguments here:
https://setuptools.readthedocs.io/en/latest/setuptools.html
"""
from setuptools import setup, find_packages
{%- if cookiecutter.package_type == 'Library' %}
from subprocess import check_outpu... | [
37811,
198,
1212,
318,
257,
2393,
284,
6901,
262,
11361,
8265,
6082,
290,
198,
35194,
351,
9988,
13,
198,
198,
5167,
7508,
319,
2972,
7159,
994,
25,
198,
5450,
1378,
2617,
37623,
10141,
13,
961,
83,
704,
420,
82,
13,
952,
14,
268,
... | 2.900369 | 271 |
import matplotlib.pyplot as plt
import networkx as nx
from matplotlib.animation import FuncAnimation
import numpy as np
import time
import os
__author__ = 'Rainer.Kujala@aalto.fi'
def visualize_si(infection_times,
viz_start_time=1229231100,
viz_end_time=1230128400,
... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
3127,
87,
355,
299,
87,
198,
6738,
2603,
29487,
8019,
13,
11227,
341,
1330,
11138,
66,
39520,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
640,
198,
11748,
28686,
... | 2.165887 | 1,923 |
from csv import DictReader
import logging
import os
from datetime import datetime
from pathlib import Path
from shutil import rmtree
from airflow import DAG
from airflow.exceptions import AirflowSkipException
from airflow.operators.python import PythonOperator
from airflow.models import Param, Variable
from airflow.ti... | [
6738,
269,
21370,
1330,
360,
713,
33634,
198,
11748,
18931,
198,
11748,
28686,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
4423,
346,
1330,
374,
16762,
631,
198,
198,
6738,
45771,
1330,
360,
4... | 2.023015 | 2,998 |
import time
from sklearn import preprocessing
from io_utils import append_write, out_time
| [
11748,
640,
198,
6738,
1341,
35720,
1330,
662,
36948,
198,
6738,
33245,
62,
26791,
1330,
24443,
62,
13564,
11,
503,
62,
2435,
198
] | 3.913043 | 23 |
from .modes import (ElectricityData,
RetailData) | [
6738,
764,
76,
4147,
1330,
357,
44132,
414,
6601,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26702,
6601,
8
] | 2.060606 | 33 |
from django.conf import settings
from django.conf.urls import handler404,handler500,handler403,handler400
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.flatpages import views as flats
from django.contrib.flatpages.sitemaps import FlatPageSitemap
from django.contrib.site... | [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
21360,
26429,
11,
30281,
4059,
11,
30281,
31552,
11,
30281,
7029,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
13,
12708,
1330,
9037... | 2.989205 | 1,019 |
import re
# Done By Mohammed Hamada , student ID : 120201362 , to be deliverd to Dr.Ayman Abu samra
# Original Text
originalText = 'The emergence of COVID-19 we have seen instances of public stigmatization among specific populations, and the rise of harmful stereotypes. Stigmatization could potentially contribu... | [
11748,
302,
201,
198,
201,
198,
2,
24429,
2750,
19773,
4345,
4763,
837,
3710,
4522,
1058,
7982,
1264,
35667,
837,
284,
307,
5203,
67,
284,
1583,
13,
42012,
805,
13098,
6072,
430,
201,
198,
201,
198,
2,
13745,
8255,
220,
201,
198,
14... | 3.669014 | 426 |
from FBCCA_IT import filter_bank_cca_it
import numpy as np
import json
from scipy.signal import filtfilt, cheby1
if __name__ == '__main__':
predict_letter(np.random.rand(1000, 8))
| [
6738,
376,
2749,
8141,
62,
2043,
1330,
8106,
62,
17796,
62,
13227,
62,
270,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
33918,
198,
6738,
629,
541,
88,
13,
12683,
282,
1330,
1226,
27110,
2326,
11,
1125,
1525,
16,
628,
198,
198,
... | 2.633803 | 71 |
# -*- coding: utf-8 -*-
"""
Evaluate a BVQA model/features on a given dataset trained with support
vector machine trained for 100 iterations of train-test (80%-20%) split.
SVR hyperparameters were selected by a grid-search tuning on a random 20%
of the training set.
Input:
- feature matrix:
eg, features/KONVI... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
36,
2100,
4985,
257,
347,
53,
48,
32,
2746,
14,
40890,
319,
257,
1813,
27039,
8776,
351,
1104,
220,
198,
31364,
4572,
8776,
329,
1802,
34820,
286,
4512,
12... | 2.290369 | 5,524 |
from os import O_TRUNC
import random
from random import randint
from django.db import models
from dndusers.models import DnDUser
from django.db.models.enums import IntegerChoices
from django.db.models.fields import DecimalField, IntegerField
# Create your models here.
from django.db import models
#dndCharCom is meant t... | [
6738,
28686,
1330,
440,
62,
5446,
4944,
34,
198,
11748,
4738,
198,
6738,
4738,
1330,
43720,
600,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
288,
358,
18417,
13,
27530,
1330,
360,
77,
35,
12982,
198,
6738,
42625,
14208,
... | 2.958528 | 1,712 |
from typing import Tuple
import grpc
from powergate.user.v1 import user_pb2, user_pb2_grpc
from pygate_grpc.admin import AdminClient
from pygate_grpc.config import ConfigClient
from pygate_grpc.data import DataClient
from pygate_grpc.deals import DealsClient
from pygate_grpc.decorators import unmarshal_with
from pyga... | [
6738,
19720,
1330,
309,
29291,
198,
198,
11748,
1036,
14751,
198,
6738,
1176,
10494,
13,
7220,
13,
85,
16,
1330,
2836,
62,
40842,
17,
11,
2836,
62,
40842,
17,
62,
2164,
14751,
198,
198,
6738,
12972,
10494,
62,
2164,
14751,
13,
28482,
... | 3.079602 | 201 |
word = input("Give me a word: ")
wrong = True
while wrong:
if word == "banana":
wrong = False
print("END GAME")
else:
print("WRONG")
word = input("Give me a word: ") | [
4775,
796,
5128,
7203,
23318,
502,
257,
1573,
25,
366,
8,
201,
198,
36460,
796,
6407,
201,
198,
201,
198,
4514,
2642,
25,
201,
198,
220,
220,
220,
611,
1573,
6624,
366,
3820,
2271,
1298,
201,
198,
220,
220,
220,
220,
220,
220,
220... | 2.107843 | 102 |
#!/usr/bin/env python3
import numpy as np
from mpi4py import MPI
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
size = comm.Get_size()
root = 0
matrix = None # matriz n*n vacía
bufferReceptor = np.zeros((1, size), dtype=np.int) # vector columna vacío
vectorResultOfProduct = np.zeros((size, 1), dtype=np.int) # vector r... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
285,
14415,
19,
9078,
1330,
4904,
40,
198,
198,
9503,
796,
4904,
40,
13,
9858,
44,
62,
45359,
11163,
198,
43027,
796,
725,
13,
3855... | 2.717949 | 468 |
"""Implementation of an ensemble of classification predictors trained
using the AdaBoost.M1 algorithm."""
import math
import operator
import random
def increment_counter(dictionary, key, value=1):
"""Increments the counter for a given key in the given dictionary or
sets the counter to 1 if it does not yet ex... | [
37811,
3546,
32851,
286,
281,
34549,
286,
17923,
4331,
669,
8776,
198,
3500,
262,
47395,
45686,
13,
44,
16,
11862,
526,
15931,
198,
198,
11748,
10688,
198,
11748,
10088,
198,
11748,
4738,
628,
198,
4299,
18703,
62,
24588,
7,
67,
14188,
... | 2.627792 | 2,015 |
"""
Copyright 2019 EUROCONTROL
==========================================
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions an... | [
37811,
198,
15269,
13130,
27526,
4503,
1340,
5446,
3535,
198,
10052,
2559,
855,
198,
198,
7738,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
17613,
11,
389,
10431,
2810,
326,
262,
220,
198,
27780,
278,
3403,
3... | 1.88086 | 6,186 |
import torch.optim as optim
from tqdm import tqdm
import numpy as np
from model import *
from utils import *
from config import *
'''
'''
def train(train_data, val_data, vocab, config, clip=5):
''' Training a network
Arguments
---------
:param clip:
:param config:
:para... | [
11748,
28034,
13,
40085,
355,
6436,
198,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
2746,
1330,
1635,
198,
6738,
3384,
4487,
1330,
1635,
198,
6738,
4566,
1330,
1635,
198,
198,
... | 2.024625 | 2,599 |
"""Define a v3 (new) SimpliSafe sensor."""
from __future__ import annotations
from typing import Any, cast
from simplipy.device import DeviceTypes, DeviceV3
class SensorV3(DeviceV3):
"""A V3 (new) sensor.
Note that this class shouldn't be instantiated directly; it will be
instantiated as appropriate vi... | [
37811,
7469,
500,
257,
410,
18,
357,
3605,
8,
45157,
72,
31511,
12694,
526,
15931,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
19720,
1330,
4377,
11,
3350,
198,
198,
6738,
7106,
541,
88,
13,
25202,
1330,
16232,
31431,
1... | 2.186139 | 1,010 |
import json
import os
from getpass import getpass as gp
from plumbum import cli, colors
from avdlogger import lpl
if __name__ == "__main__":
AVDApp.run()
| [
11748,
33918,
198,
11748,
28686,
198,
198,
6738,
651,
6603,
1330,
651,
6603,
355,
27809,
198,
6738,
458,
2178,
388,
1330,
537,
72,
11,
7577,
198,
198,
6738,
1196,
67,
6404,
1362,
1330,
300,
489,
628,
198,
198,
361,
11593,
3672,
834,
... | 2.762712 | 59 |
from contextlib import contextmanager
import concurrent.futures
import sys
import time
import pytest
from tail_recursive import tail_recursive, FeatureSet
ALL_FEATURE_SETS = [
FeatureSet.BASE,
FeatureSet.NESTED_CALLS,
FeatureSet.FULL
]
@pytest.mark.parametrize("feature_set_str", [feature_set.name.... | [
6738,
4732,
8019,
1330,
4732,
37153,
198,
11748,
24580,
13,
69,
315,
942,
198,
11748,
25064,
198,
11748,
640,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
7894,
62,
8344,
30753,
1330,
7894,
62,
8344,
30753,
11,
27018,
7248,
628,
198,
... | 2.451045 | 909 |
"""
This example generates random data and plots a graph in the browser.
Run it using Gevent directly using:
$ python plot_grapg.py
Or with an Gunicorn wrapper:
$ gunicorn -k "geventwebsocket.gunicorn.workers.GeventWebSocketWorker" \
plot_graph:app
"""
import gevent
import os
import random
from geve... | [
37811,
198,
1212,
1672,
18616,
4738,
1366,
290,
21528,
257,
4823,
287,
262,
6444,
13,
198,
198,
10987,
340,
1262,
2269,
1151,
3264,
1262,
25,
198,
220,
220,
220,
720,
21015,
7110,
62,
70,
2416,
70,
13,
9078,
198,
198,
5574,
351,
281... | 2.313397 | 418 |
import numpy as np
import game, time
from nn import NN
env = game.Game(500, 500)
n_state = len(env.reset())
n_actions = env.n_actions
agent = NN(n_state, n_actions)
import matplotlib.pyplot as plt
n_sessions = 100
percentile = 50
log = []
for i in range(50):
#generate new sessions
print(i... | [
11748,
299,
32152,
355,
45941,
201,
198,
11748,
983,
11,
640,
201,
198,
6738,
299,
77,
1330,
399,
45,
201,
198,
201,
198,
24330,
796,
983,
13,
8777,
7,
4059,
11,
5323,
8,
201,
198,
77,
62,
5219,
796,
18896,
7,
24330,
13,
42503,
... | 2.313589 | 574 |
from mock import patch
import os
from django.contrib.auth.models import User
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.urlresolvers import reverse
from django.test import TestCase, override_settings
from django.utils.timezone import now
from myhpom.models import AdvanceDirective
fr... | [
6738,
15290,
1330,
8529,
198,
11748,
28686,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
7295,
13,
16624,
13,
25850,
276,
7753,
1330,
17427,
41592,
276,
8979,
198,
6738,
42625,
... | 3.282609 | 138 |
#coding=utf-8
from util.Match import *
from datatype import *
from env import *
from parse import *
print( dir() )
# eopl page 80
# value_of : Exp * Env -> ExpVal
@matcher(Const_exp,False)
@matcher(Var_exp,False)
@matcher(Diff_exp,False)
@matcher(Zerop_exp,False)
@matcher(If_exp,False)
@matcher(Let_exp,False)
@matcher(... | [
2,
66,
7656,
28,
40477,
12,
23,
198,
6738,
7736,
13,
23850,
1330,
1635,
198,
6738,
4818,
265,
2981,
1330,
1635,
198,
6738,
17365,
1330,
1635,
198,
6738,
21136,
1330,
1635,
198,
4798,
7,
26672,
3419,
1267,
198,
2,
304,
20106,
2443,
4... | 2.397661 | 171 |
# coding: utf-8
import enum
from sqlalchemy import Boolean
from sqlalchemy import Column
from sqlalchemy import Enum
from sqlalchemy import Integer
from sqlalchemy.ext.declarative import declared_attr
from rolling.server.extension import ServerSideDocument as Document
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
11748,
33829,
198,
6738,
44161,
282,
26599,
1330,
41146,
198,
6738,
44161,
282,
26599,
1330,
29201,
198,
6738,
44161,
282,
26599,
1330,
2039,
388,
198,
6738,
44161,
282,
26599,
1330,
34142,
198,
6738... | 3.84507 | 71 |
import requests
import json
import time
'''
r = requests.post("http://127.0.0.1:5000/commands",
json={'message':'arm'})
print(r.json())
print(r.status_code, r.reason)
'''
while True:
r = requests.get("http://127.0.0.1:5000/status")
print(r.json())
print(r.status_code, r.reason)
tim... | [
198,
11748,
7007,
198,
11748,
33918,
198,
11748,
640,
198,
198,
7061,
6,
198,
81,
796,
7007,
13,
7353,
7203,
4023,
1378,
16799,
13,
15,
13,
15,
13,
16,
25,
27641,
14,
9503,
1746,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.085784 | 408 |
from django.db import models
from django.utils import timezone
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
628,
198
] | 3.611111 | 18 |
from enum import Enum
from typing import Dict, Set
CLASS_TO_SPECS: Dict[APLClass, Set[APLSpec]] = {
APLClass.WARRIOR: {
APLSpec.WARRIOR_ARMS,
APLSpec.WARRIOR_FURY,
APLSpec.WARRIOR_PROTECTION,
},
APLClass.PALADIN: {
APLSpec.PALADIN_HOLY,
APLSpec.PALADIN_PROTECTION,
APLSpec.PALADIN_RETRIBU... | [
6738,
33829,
1330,
2039,
388,
198,
6738,
19720,
1330,
360,
713,
11,
5345,
628,
198,
31631,
62,
10468,
62,
48451,
50,
25,
360,
713,
58,
2969,
43,
9487,
11,
5345,
58,
2969,
43,
22882,
11907,
796,
1391,
198,
220,
3486,
43,
9487,
13,
... | 1.855721 | 804 |
import json
d = []
with open('truncated.json') as json_file:
data = json.load(json_file)
for row in data:
d.append([row["text"], row["user"]["followers_count"]])
print(d[109])
assert False
print(data[0]["user"]["friends_count"])
print(data[3]["user"]["followers_count"])
print(data[1]["user"]["favou... | [
11748,
33918,
628,
198,
67,
796,
17635,
198,
4480,
1280,
10786,
2213,
19524,
515,
13,
17752,
11537,
355,
33918,
62,
7753,
25,
220,
220,
198,
220,
220,
220,
1366,
796,
33918,
13,
2220,
7,
17752,
62,
7753,
8,
198,
220,
220,
220,
329,
... | 2.365079 | 189 |
import numpy as np
import pytest
import sympy
from zquantum.core.circuits._builtin_gates import (
CNOT,
CPHASE,
CZ,
ISWAP,
PHASE,
RX,
RY,
RZ,
SWAP,
XX,
YY,
ZZ,
H,
I,
T,
X,
Y,
Z,
)
from zquantum.core.circuits._circuit import Circuit
RNG = np.random... | [
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
9288,
198,
11748,
10558,
88,
198,
6738,
1976,
40972,
388,
13,
7295,
13,
21170,
15379,
13557,
18780,
259,
62,
70,
689,
1330,
357,
198,
220,
220,
220,
327,
11929,
11,
198,
220,
220,
220,... | 1.66537 | 771 |
"""
Jahnke
kenny.jahnke@ndus.edu / greensaber77@gmail.com
CSCI 160 - Spring 2022
Program 05, Part B
Use SimpleGraphics to draw your initials. To ensure practice of loops,
only the point command can be used to draw.
"""
from simple_graphics.SimpleGraphics import *
setSize(400, 150)
setBackground("black")
setLineWidt... | [
37811,
198,
41,
15386,
365,
198,
74,
11870,
13,
73,
15386,
365,
31,
358,
385,
13,
15532,
1220,
30966,
27359,
3324,
31,
14816,
13,
785,
198,
34,
6173,
40,
13454,
532,
8225,
33160,
198,
15167,
8870,
11,
2142,
347,
198,
198,
11041,
174... | 2.021649 | 970 |
import keras
from keras.layers import Conv2D, MaxPooling2D, Lambda, Input, Dense, Flatten, BatchNormalization
from keras.models import Model
from keras.layers.core import Dropout
from keras import optimizers
import tensorflow as tf
from keras.callbacks import ReduceLROnPlateau,TensorBoard
from sklearn.metrics ... | [
11748,
41927,
292,
201,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
34872,
17,
35,
11,
5436,
27201,
278,
17,
35,
11,
21114,
6814,
11,
23412,
11,
360,
1072,
11,
1610,
41769,
11,
347,
963,
26447,
1634,
201,
198,
6738,
41927,
292,
13,
... | 2.218536 | 1,899 |
"""
Project: Project FandRec
Programmed by: David Williams
Last Modified: 11/21/2017
Description: Takes in a frame and finds faces in the picture. If the frame contains a face that has been registered,
it will also check next to the face for fingers held up. If the number of fingers is mapped to action to be
t... | [
37811,
198,
16775,
25,
4935,
376,
392,
6690,
198,
15167,
1150,
416,
25,
3271,
6484,
198,
5956,
40499,
25,
1367,
14,
2481,
14,
5539,
198,
11828,
25,
33687,
287,
257,
5739,
290,
7228,
6698,
287,
262,
4286,
13,
1002,
262,
5739,
4909,
2... | 2.871492 | 5,844 |
import os
import pymysql
from dotenv import load_dotenv
load_dotenv()
# Connect to the database
connection = pymysql.connect(db=os.getenv('DB_NAME'),
host=os.getenv('DB_HOST'),
port=int(os.getenv('DB_PORT')),
user=os.getenv('DB_USE... | [
11748,
28686,
198,
11748,
279,
4948,
893,
13976,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
198,
2220,
62,
26518,
24330,
3419,
198,
198,
2,
8113,
284,
262,
6831,
198,
38659,
796,
279,
4948,
893,
13976,
13,
8443,
7,
99... | 1.878788 | 264 |
import sys
import gzip
import argparse
import logging
from typing import Dict, List, Union, TextIO, Generator
import pyngs.vcf as vcf
from pyngs import open_stream
from pyngs.vcf.tools import FilterAlt
def allele_filter(args):
"""Run the script."""
fltalleles = FilterAlleles(
samples=ar... | [
11748,
25064,
201,
198,
11748,
308,
13344,
201,
198,
11748,
1822,
29572,
201,
198,
11748,
18931,
201,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
11,
4479,
11,
8255,
9399,
11,
35986,
201,
198,
11748,
12972,
782,
82,
13,
85,
12993,
355... | 2.267717 | 889 |
from django.shortcuts import render
# Create your views here.
from django.http import HttpResponse
from GT_app.models import Topic,Webpage,AccessRecord
# Create your views here.
#def index(request):
# return HttpResponse(' Hello World')
# pass
#def index_withTemplate(request):
# insert_dict= {'insert_m... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
198,
2,
13610,
534,
5009,
994,
13,
198,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6738,
7963,
62,
1324,
13,
27530,
1330,
47373,
11,
13908,
7700,
11,
15457,
... | 3.022059 | 136 |