content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
import calendar
import os
from datetime import datetime
from dateutil.parser import parse
# server side rendering related imports
from flask import render_template, url_for, flash, redirect, request, jsonify, send_from_directory
# login related imports
from flask_login import login_user, logout_user, login_required, c... | [
11748,
11845,
198,
11748,
28686,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
3128,
22602,
13,
48610,
1330,
21136,
198,
2,
4382,
1735,
14837,
3519,
17944,
198,
6738,
42903,
1330,
8543,
62,
28243,
11,
19016,
62,
1640,
11,
764... | 2.901709 | 702 |
import base64
import os
from cryptography.fernet import Fernet
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
#message = b"hello world"
#message = "hello world"
#password = b"password"
#salt = os.urandom(16)
#salt = b"hello"
#kdf ... | [
11748,
2779,
2414,
201,
198,
11748,
28686,
201,
198,
6738,
45898,
13,
69,
1142,
316,
1330,
38982,
316,
201,
198,
6738,
45898,
13,
71,
1031,
6759,
13,
19795,
20288,
1330,
46621,
201,
198,
6738,
45898,
13,
71,
1031,
6759,
13,
19795,
202... | 2.287719 | 285 |
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes, mark_inset
from math import pi
import numpy as np
import matplotlib.colors as colors
import matplotlib.patches as mpatches
df = pd.read_csv('all_analysis.csv')
# f, a = plt.su... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,
6738,
285,
489,
62,
25981,
74,
896,
13,
897,
274,
62,
25928,
16,
13,
1040,
316,
62,
179... | 2.270931 | 2,783 |
############Con una funcin##########################
print('Valor de M:')
M = int(input())
print('Valor de N:')
N = int(input())
print(M**N)
print(pow(M, N))
print(potencia(M,N))
#########################Con un listas comprimidas########################
print('Valor de M:')
M = int(input())
print('Valor de N:')
N = i... | [
7804,
4242,
3103,
555,
64,
1257,
17879,
14468,
7804,
2235,
198,
4798,
10786,
7762,
273,
390,
337,
25,
11537,
198,
44,
796,
493,
7,
15414,
28955,
198,
4798,
10786,
7762,
273,
390,
399,
25,
11537,
198,
45,
796,
493,
7,
15414,
28955,
1... | 2.712329 | 146 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Python packaging."""
import os
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
#: Absolute path to directory containing setup.py file.
here = os.path.abspath(os.path.dirname(__file__))
#: Boolean, ``True`` if environmen... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
37906,
16846,
526,
15931,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
198... | 2.366667 | 840 |
"""Plotting model results and storing as PDF to result folder
"""
import os
import logging
from energy_demand.technologies import tech_related
from energy_demand.plotting import plotting_styles
from energy_demand.plotting import fig_lad_related
from energy_demand.plotting import fig_one_fueltype_multiple_regions_peak... | [
37811,
43328,
889,
2746,
2482,
290,
23069,
355,
12960,
284,
1255,
9483,
198,
37811,
198,
11748,
28686,
198,
11748,
18931,
198,
198,
6738,
2568,
62,
28550,
13,
23873,
5823,
1330,
7261,
62,
5363,
198,
198,
6738,
2568,
62,
28550,
13,
29487... | 2.017022 | 6,051 |
from playhouse.sqlite_ext import *
from playhouse.migrate import *
from peewee import *
# The initialisation
db = SqliteDatabase('../cache/iconic.db', pragmas={
'journal_mode': 'wal',
'cache_size': '-2000',
'fullfsync': 'on',
'journal_size_limit': '-1',
'threads': '8',
'foreign_keys': 1, # Enf... | [
6738,
711,
4803,
13,
25410,
578,
62,
2302,
1330,
1635,
198,
6738,
711,
4803,
13,
76,
42175,
1330,
1635,
198,
6738,
613,
413,
1453,
1330,
1635,
198,
198,
2,
383,
4238,
5612,
198,
9945,
796,
311,
13976,
578,
38105,
10786,
40720,
23870,
... | 2.649895 | 477 |
import time
import serial
import binascii
from collections import namedtuple
import logging
from ublox.socket import UDPSocket
logger = logging.getLogger(__name__)
Stats = namedtuple('Stats', 'type name value')
| [
11748,
640,
198,
11748,
11389,
198,
11748,
9874,
292,
979,
72,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
11748,
18931,
198,
198,
6738,
334,
2436,
1140,
13,
44971,
1330,
43700,
3705,
5459,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
... | 3.283582 | 67 |
import pytest
from sto.distribution import read_csv
from sto.ethereum.issuance import contract_status
from sto.ethereum.status import update_status
from sto.ethereum.tokenscan import token_scan
from sto.generic.captable import generate_cap_table, print_cap_table
from sto.models.implementation import TokenScanStatus, T... | [
11748,
12972,
9288,
198,
198,
6738,
3995,
13,
17080,
3890,
1330,
1100,
62,
40664,
198,
6738,
3995,
13,
316,
1456,
388,
13,
747,
84,
590,
1330,
2775,
62,
13376,
198,
6738,
3995,
13,
316,
1456,
388,
13,
13376,
1330,
4296,
62,
13376,
1... | 2.514045 | 712 |
from __future__ import absolute_import
from __future__ import print_function
import six
import language_check
from tkinter import *
from tkinter import messagebox
import rake
import operator
import io
counter=1
file=open("questions.txt","r")
q=[line.rstrip('\n') for line in file]
totmark=[0,0,0,0,0,0]
r... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
2237,
198,
198,
11748,
3303,
62,
9122,
198,
198,
6738,
256,
74,
3849,
1330,
1635,
198,
6738,
256,
74,
3849,
1330,
3275,
35... | 2.482759 | 406 |
# Copyright (C) 2015-2018 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#... | [
2,
15069,
357,
34,
8,
1853,
12,
7908,
331,
28758,
20420,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
331,
28758,
13,
198,
2,
198,
2,
331,
28758,
318,
1479,
3788,
25,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
198,
2,
340,
... | 3.216346 | 416 |
"""
Demonstrating simple global variables
File: E5_global_variables_version_b.py
Author: Charles Stanier, charles-stanier@uiowa.edu
Date: August 14, 2019
Written/Tested In: Python 3.7.3
Program Objective: Demonstrate the use of global variable for constant
Modifications: none so far
"""
# these two li... | [
37811,
201,
198,
35477,
2536,
803,
2829,
3298,
9633,
201,
198,
8979,
25,
412,
20,
62,
20541,
62,
25641,
2977,
62,
9641,
62,
65,
13,
9078,
201,
198,
201,
198,
13838,
25,
7516,
7299,
959,
11,
1149,
829,
12,
14192,
959,
31,
9019,
845... | 2.977064 | 218 |
X_VAR = ["Tx", "Ty", "Wx", "Wy", "u_av", "v_av", "lon", "lat", "t"]
Y_VAR = ["u", "v"]
mpl_config = {
"text.usetex": True,
"font.size": 12,
"text.latex.preamble": r"\usepackage{amsmath}",
"font.family": "Times New Roman",
}
| [
55,
62,
53,
1503,
796,
14631,
46047,
1600,
366,
25492,
1600,
366,
54,
87,
1600,
366,
54,
88,
1600,
366,
84,
62,
615,
1600,
366,
85,
62,
615,
1600,
366,
14995,
1600,
366,
15460,
1600,
366,
83,
8973,
198,
56,
62,
53,
1503,
796,
14... | 1.967213 | 122 |
""" In this file, PyTorch modules are defined to be used in the Talking Heads model. """
import torch
import torch.nn as nn
from torch.nn import functional as F
# region General Blocks
# endregion
# region Non-Adaptive Residual Blocks
# endregion
# region Adaptive Residual Blocks
# endregion
| [
37811,
554,
428,
2393,
11,
9485,
15884,
354,
13103,
389,
5447,
284,
307,
973,
287,
262,
33445,
34838,
2746,
13,
37227,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
6738,
28034,
13,
20471,
1330,
10345,
355,
... | 3.444444 | 90 |
import botocore
import datetime
import re
import logging
import boto3
region='us-west-1'
db_instance_class='db.m4.large'
db_subnet='default'
instances = ['master']
print('Loading function') | [
11748,
10214,
420,
382,
220,
220,
198,
11748,
4818,
8079,
220,
220,
198,
11748,
302,
220,
220,
198,
11748,
18931,
198,
11748,
275,
2069,
18,
198,
220,
198,
36996,
11639,
385,
12,
7038,
12,
16,
6,
220,
220,
198,
9945,
62,
39098,
62,
... | 2.594937 | 79 |
'''
------------------------------------------------------------------------
This program runs the steady state solver as well as the time path
solver for the OG model with S-period lived agents, exogenous labor,
M industries, and I goods.
This Python script calls the following other file(s) with the associated... | [
7061,
6,
201,
198,
10097,
982,
201,
198,
1212,
1430,
4539,
262,
11831,
1181,
1540,
332,
355,
880,
355,
262,
640,
3108,
201,
198,
82,
14375,
329,
262,
34498,
2746,
351,
311,
12,
41007,
5615,
6554,
11,
409,
27897,
4827,
11,
220,
201,
... | 2.230838 | 10,033 |
from abc import ABC, abstractmethod
def client_code(comment: Component) -> None:
print("", end="\n")
print(comment.operation())
if __name__ == '__main__':
simple = ConcreteComponent()
client_code(simple)
ca = ConcreteDecoratorA(simple)
client_code(ca)
cb = ConcreteDecoratorB(ca)
... | [
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
628,
628,
628,
198,
198,
4299,
5456,
62,
8189,
7,
23893,
25,
35100,
8,
4613,
6045,
25,
198,
220,
220,
220,
3601,
7203,
1600,
886,
2625,
59,
77,
4943,
198,
220,
220,
220,
3601,
7,
23893,... | 2.224537 | 432 |
# -*- coding:utf-8 -*-
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
from keras.preprocessing import text, sequence
from keras.models import Model
from keras.layers import Input, Embedding
from keras.layers.core import Dropout
from keras.layers.convolutional import Conv1D, AveragePooling1D
from keras.layers impo... | [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
11748,
28686,
198,
198,
418,
13,
268,
2268,
14692,
43633,
5631,
62,
29817,
34563,
62,
39345,
34444,
8973,
796,
366,
15,
1,
198,
198,
6738,
41927,
292,
13,
3866,
36948,
1330... | 2.641337 | 329 |
"""769. Max Chunks To Make Sorted"""
| [
37811,
22,
3388,
13,
5436,
609,
14125,
1675,
6889,
311,
9741,
37811,
198
] | 2.846154 | 13 |
import torch
import torch.nn as nn
import torch.optim as optim
import torch.utils.data
import torch.nn.functional as F
import torchvision
import torchvision.models as models
from torchvision import transforms
from PIL import Image
from time import time
import matplotlib.pyplot as plt
import os
import numpy as np
import... | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
40085,
355,
6436,
198,
11748,
28034,
13,
26791,
13,
7890,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
11748,
28034,
10178,
198,
11748,
28034,
1... | 2.74382 | 890 |
from uuid import uuid4
from django.test import TestCase
from accounts.models import User
from articles.models import Article
from articles.testhelpers import create_user, create_mock_article, get_random_string | [
6738,
334,
27112,
1330,
334,
27112,
19,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
5504,
13,
27530,
1330,
11787,
198,
6738,
6685,
13,
27530,
1330,
10172,
198,
6738,
6685,
13,
9288,
16794,
364,
1330,
2251,
62,
7220,... | 3.87037 | 54 |
from matplotlib import rc
rc('text', usetex=True) # this is if you want to use latex to print text. If you do you can create strings that go on labels or titles like this for example (with an r in front): r"$n=$ " + str(int(n))
from numpy import *
from pylab import *
import random
from matplotlib.font_manager import Fo... | [
6738,
2603,
29487,
8019,
1330,
48321,
198,
6015,
10786,
5239,
3256,
514,
316,
1069,
28,
17821,
8,
1303,
428,
318,
611,
345,
765,
284,
779,
47038,
284,
3601,
2420,
13,
1002,
345,
466,
345,
460,
2251,
13042,
326,
467,
319,
14722,
393,
... | 2.533854 | 1,152 |
import datetime
import json
import calendar
from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.urls import reverse_lazy, reverse
from django.views.generic import FormView
from django.views.generic import ListView, CreateView, UpdateView, DeleteView, DetailView
from django.vi... | [
11748,
4818,
8079,
198,
11748,
33918,
198,
11748,
11845,
198,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,... | 3.111667 | 1,200 |
from abc import ABCMeta, abstractmethod
import collections
| [
6738,
450,
66,
1330,
9738,
48526,
11,
12531,
24396,
198,
11748,
17268,
628,
628
] | 4.428571 | 14 |
#!/usr/bin/env python
import sys
import rospy
from math import pi
import moveit_commander
from moveit_msgs.msg import DisplayTrajectory
from apriltag_ros.msg import AprilTagDetectionArray
# CONSTANTS
N_ROBOT_JOINTS = 6
POSE_TOLERANCE = 0.05
FRAMES_LIMIT = 25
ROTATION_DEGREE = -10
J1_LIMIT_DEGREE = -90
if __name__ ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
25064,
198,
11748,
686,
2777,
88,
198,
6738,
10688,
1330,
31028,
198,
11748,
1445,
270,
62,
9503,
4066,
198,
6738,
1445,
270,
62,
907,
14542,
13,
19662,
1330,
16531,
15721,
752,
... | 2.30137 | 292 |
from __future__ import (
unicode_literals,
absolute_import,
print_function,
division,
)
import os
import unittest
import avb
import avb.utils
test_file_01 = os.path.join(os.path.dirname(__file__), 'test_files', 'test_file_01.avb')
if __name__ == "__main__":
unittest.main()
| [
6738,
11593,
37443,
834,
1330,
357,
198,
220,
220,
220,
28000,
1098,
62,
17201,
874,
11,
198,
220,
220,
220,
4112,
62,
11748,
11,
198,
220,
220,
220,
3601,
62,
8818,
11,
198,
220,
220,
220,
7297,
11,
198,
220,
220,
220,
1267,
198,... | 2.416 | 125 |
import sys, pygame
from pygame.locals import *
import time
import pygame.freetype
pygame.init()
size = width, height = 800, 600
ball_speed = [3, 7]
black = 0, 0, 0
rod_speed = [5,0]
score = 1
green = (0, 255, 0)
blue = (0, 0, 128)
white = (255, 255, 255)
screen = pygame.display.set_mode(size)
#ball loading and sho... | [
11748,
25064,
11,
12972,
6057,
198,
6738,
12972,
6057,
13,
17946,
874,
1330,
1635,
198,
11748,
640,
198,
11748,
12972,
6057,
13,
69,
2871,
2981,
198,
198,
9078,
6057,
13,
15003,
3419,
198,
198,
7857,
796,
9647,
11,
6001,
796,
10460,
1... | 2.262165 | 1,007 |
import pyclipper
from shapely.geometry import Polygon
from typing import List
from oasis.util import clean_polygon, convert_to_clipper, convert_from_clipper | [
11748,
12972,
565,
14710,
198,
6738,
5485,
306,
13,
469,
15748,
1330,
12280,
14520,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
267,
17765,
13,
22602,
1330,
3424,
62,
35428,
14520,
11,
10385,
62,
1462,
62,
565,
14710,
11,
10385,
62,
... | 3.488889 | 45 |
from __future__ import absolute_import
from social_auth.middleware import SocialAuthExceptionMiddleware
from sentry.utils import auth
from sentry.utils.http import absolute_uri
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
1919,
62,
18439,
13,
27171,
1574,
1330,
5483,
30515,
16922,
34621,
1574,
198,
198,
6738,
1908,
563,
13,
26791,
1330,
6284,
198,
6738,
1908,
563,
13,
26791,
13,
4023,
1330,
... | 4 | 45 |
# Generated by Django 2.1.3 on 2018-11-27 09:55
import attrs.fields
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
18,
319,
2864,
12,
1157,
12,
1983,
7769,
25,
2816,
198,
198,
11748,
708,
3808,
13,
25747,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
... | 2.88 | 50 |
# -*-coding:utf-8-*-
"""
@author Myles Yang
"""
import argparse
import const_config as const
""" KEY """
#
ARG_KEY_RUN = ARG_RUN = '--run'
#
ARG_KEY_LOG = ARG_LOG = '--log'
#
ARG_KEY_LNK = ARG_LNK = '--lnk'
#
ARG_KEY_ENV = ARG_ENV = '--env'
#
ARG_KEY_CMD = ARG_CMD = '--cmd'
""" --run """
#
ARG_RUN_TYPE_CO... | [
2,
532,
9,
12,
66,
7656,
25,
40477,
12,
23,
12,
9,
12,
198,
198,
37811,
628,
198,
31,
9800,
2011,
829,
10998,
198,
37811,
198,
198,
11748,
1822,
29572,
198,
198,
11748,
1500,
62,
11250,
355,
1500,
198,
198,
37811,
35374,
37227,
19... | 1.615928 | 1,557 |
from puzzle.constraints import constraints, validator
from puzzle.puzzlepedia import annotation_widget
from spec.mamba import *
widget_patch = mock.patch('puzzle.puzzlepedia.annotation_widget.widgets')
with description('annotation_widget'):
with before.each:
self.mock_widgets = widget_patch.start()
with a... | [
6738,
15027,
13,
1102,
2536,
6003,
1330,
17778,
11,
4938,
1352,
198,
6738,
15027,
13,
79,
9625,
50235,
1330,
23025,
62,
42655,
198,
6738,
1020,
13,
76,
31842,
1330,
1635,
628,
198,
42655,
62,
17147,
796,
15290,
13,
17147,
10786,
79,
9... | 2.789238 | 223 |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
_EXCLUDED_PATHS = []
_LICENSE_HEADER = (
r".*? Copyright \(c\) 20\d\d The Chromium Authors\. All rights reserved\."
"\n"
r... | [
2,
15069,
357,
66,
8,
2321,
383,
18255,
1505,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
198,
2,
1043,
287,
262,
38559,
24290,
2393,
13,
1... | 2.814815 | 162 |
import FWCore.ParameterSet.Config as cms
# Ideal geometry, needed for simulation
from SLHCUpgradeSimulations.Geometry.Phase1_R30F12_cmsSimIdealGeometryXML_cff import *
from Geometry.TrackerNumberingBuilder.trackerNumbering2026Geometry_cfi import *
| [
11748,
48849,
14055,
13,
36301,
7248,
13,
16934,
355,
269,
907,
198,
198,
2,
41765,
22939,
11,
2622,
329,
18640,
198,
6738,
12419,
16045,
44948,
8890,
5768,
13,
10082,
15748,
13,
35645,
16,
62,
49,
1270,
37,
1065,
62,
46406,
8890,
739... | 3.276316 | 76 |
import os
import json
import base64
import sqlite3
import win32crypt
from Crypto.Cipher import AES
import shutil
from datetime import timezone, datetime, timedelta
if __name__ == "__main__":
main()
| [
11748,
28686,
198,
11748,
33918,
198,
11748,
2779,
2414,
198,
11748,
44161,
578,
18,
198,
11748,
1592,
2624,
29609,
198,
6738,
36579,
13,
34,
10803,
1330,
34329,
198,
11748,
4423,
346,
198,
6738,
4818,
8079,
1330,
640,
11340,
11,
4818,
... | 3.253968 | 63 |
import os
from flask import Flask, request, redirect, url_for, render_template, send_from_directory, jsonify
from werkzeug import secure_filename
import uuid
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = 'upload/'
app.config['REPLY_FOLDER'] = 'replies/'
app.config['CLIENT_FOLDER'] = 'client/'
if __name__ == ... | [
11748,
28686,
198,
6738,
42903,
1330,
46947,
11,
2581,
11,
18941,
11,
19016,
62,
1640,
11,
8543,
62,
28243,
11,
3758,
62,
6738,
62,
34945,
11,
33918,
1958,
198,
6738,
266,
9587,
2736,
1018,
1330,
5713,
62,
34345,
198,
11748,
334,
2711... | 2.678832 | 137 |
from tkinter import *
from tkinter import filedialog
import os
window = Tk()
button = Button(text="OpenFile",command=openFile)
button.pack()
window.mainloop() | [
6738,
256,
74,
3849,
1330,
1635,
201,
198,
6738,
256,
74,
3849,
1330,
5717,
498,
519,
201,
198,
11748,
28686,
201,
198,
201,
198,
17497,
796,
309,
74,
3419,
201,
198,
16539,
796,
20969,
7,
5239,
2625,
11505,
8979,
1600,
21812,
28,
9... | 2.862069 | 58 |
from django.conf.urls import patterns, include, url
from ats.views import *
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'bcauth_project.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^job/(?P<job_id>\d+)/', JobView.as_view(), name='ats_job'),
url(r'^jobs/', JobLis... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
7572,
11,
2291,
11,
19016,
198,
6738,
379,
82,
13,
33571,
1330,
1635,
198,
198,
6371,
33279,
82,
796,
7572,
10786,
3256,
198,
220,
220,
220,
1303,
21066,
25,
198,
220,
220,
220,
130... | 2.367003 | 297 |
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import argparse
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument(
"--T", type=int, default=46,
help="Time-horizon.")
args = parser.parse_args()
T = args.T
data_dir = 'dat... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
1822,
29572,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
7,
198,
220,
220,
220,
2... | 2.369369 | 222 |
import time
import datetime
import threading
from get_net_info import RaspberryMonitorNetSpeed as rmn
import subprocess
import Adafruit_SSD1306
import Adafruit_GPIO.SPI as SPI
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
# Raspberry Pi pin configuration:
RST = None # on the PiOLED... | [
198,
11748,
640,
198,
11748,
4818,
8079,
198,
11748,
4704,
278,
198,
6738,
651,
62,
3262,
62,
10951,
1330,
24244,
35479,
7934,
22785,
355,
374,
10295,
198,
198,
11748,
850,
14681,
198,
198,
11748,
1215,
1878,
4872,
62,
5432,
35,
12952,
... | 2.902287 | 481 |
# Rock, Paper, Scissors, Lizard, Spock - Advanced
# rpsls_adv.py for Python 3.4 | Written by Alex Vear
# Written: 19th December 2015 | Modified: 22nd December 2015
# Public domain. No rights reserved.
import random
playAgain='y'
while playAgain=='y' or playAgain=='Y':
win=0
print("\nScissors cuts Paper \nPape... | [
2,
4631,
11,
14962,
11,
1446,
32555,
11,
42452,
11,
37945,
532,
13435,
198,
2,
374,
862,
7278,
62,
32225,
13,
9078,
329,
11361,
513,
13,
19,
930,
22503,
416,
4422,
569,
451,
198,
2,
22503,
25,
678,
400,
3426,
1853,
930,
40499,
25,... | 2.140954 | 901 |
"""
==========================
FastICA on 2D point clouds
==========================
Illustrate visually the results of :ref:`ICA` vs :ref:`PCA` in the
feature space.
Representing ICA in the feature space gives the view of 'geometric ICA':
ICA is an algorithm that finds directions in the feature space
corresponding t... | [
37811,
198,
4770,
2559,
855,
198,
22968,
25241,
319,
362,
35,
966,
15114,
198,
4770,
2559,
855,
198,
198,
21478,
436,
4873,
22632,
262,
2482,
286,
1058,
5420,
25,
63,
25241,
63,
3691,
1058,
5420,
25,
63,
5662,
32,
63,
287,
262,
198,... | 3.146835 | 790 |
import os, sys
from PIL import Image
### TERMINAL ARGUMENTS ###
# -h := help
# -q := quiet
# -single := forced one page per slide
args = sys.argv[1:]
# -h, print README and quit
if "-h" in args:
with open('./README.md') as f:
print(f.read())
quit()
# -q, toggle print statem... | [
11748,
28686,
11,
25064,
201,
198,
6738,
350,
4146,
1330,
7412,
201,
198,
201,
198,
21017,
28994,
44,
17961,
5923,
38,
5883,
15365,
44386,
201,
198,
201,
198,
2,
532,
71,
220,
220,
220,
220,
220,
19039,
1037,
201,
198,
2,
532,
80,
... | 2.510638 | 329 |
'''
Parse coverage checker html files.
Write out data to a csv.
INPUT: html files in MY_DATA_FOLDERS
OUTPUT: csv file called OUTPUT_FILE
'''
from os import walk
import re
MY_DATA_FOLDERS = ["cov_checker"] # Folder to be processed
OUTPUT_FILE = "output.csv" # csv output result
DIGITAL_SEVICES = set()
CHA... | [
7061,
6,
628,
2547,
325,
5197,
2198,
263,
27711,
3696,
13,
220,
198,
19430,
503,
1366,
284,
257,
269,
21370,
13,
220,
198,
220,
198,
3268,
30076,
25,
27711,
3696,
287,
17615,
62,
26947,
62,
37,
15173,
4877,
198,
16289,
30076,
25,
26... | 2.568327 | 783 |
import glob
import sys
import os
sys.path.insert(0,os.path.abspath("../../../src/"))
import pyabf
if __name__=="__main__":
PATH=R"X:\Data\projects\2017-01-09 AT1-Cre mice\2017-01-09 global expression NTS\data"
for fname in sorted(glob.glob(PATH+"/*.abf")):
abf=pyabf.ABF(fname)
if not abf.commen... | [
11748,
15095,
198,
11748,
25064,
198,
11748,
28686,
198,
17597,
13,
6978,
13,
28463,
7,
15,
11,
418,
13,
6978,
13,
397,
2777,
776,
7203,
40720,
40720,
40720,
10677,
30487,
4008,
198,
11748,
12972,
397,
69,
198,
198,
361,
11593,
3672,
... | 2.131579 | 190 |
"""keywords""" | [
37811,
2539,
10879,
37811
] | 3.5 | 4 |
from flask import render_template
from flask_login import login_required
from imp_flask.blueprints import products
from imp_flask.models.imps import Product, Mod
from imp_flask.forms.product import Product as ProductForm
| [
6738,
42903,
1330,
8543,
62,
28243,
201,
198,
6738,
42903,
62,
38235,
1330,
17594,
62,
35827,
201,
198,
201,
198,
6738,
848,
62,
2704,
2093,
13,
17585,
17190,
1330,
3186,
201,
198,
6738,
848,
62,
2704,
2093,
13,
27530,
13,
320,
862,
... | 3.277778 | 72 |
#
# Example From:
# https://xrdocs.io/application-hosting/tutorials/2016-08-15-netmiko-and-napalm-with-ios-xr-quick-look/
#
from napalm import get_network_driver
import pprint
driver = get_network_driver('iosxr')
device = driver('172.16.1.13', 'cisco', 'cisco')
device.open()
pprint.pprint(device.get_facts())
pprin... | [
2,
198,
2,
17934,
3574,
25,
220,
198,
2,
3740,
1378,
87,
4372,
420,
82,
13,
952,
14,
31438,
12,
4774,
278,
14,
83,
44917,
82,
14,
5304,
12,
2919,
12,
1314,
12,
3262,
76,
12125,
12,
392,
12,
77,
499,
38182,
12,
4480,
12,
4267,
... | 2.534247 | 146 |
from .segmenter import Segmenter
| [
6738,
764,
325,
5154,
263,
1330,
1001,
5154,
263,
198
] | 3.3 | 10 |
import scrapy
| [
11748,
15881,
88,
198
] | 3.5 | 4 |
Engines = [
(1, "Diesel"),
(2, "Gasoline"),
(3, "Electric")
]
Luxuries = [
(1, "Cheap"),
(2, "Standard"),
(3, "Luxurious")
]
Companies = [
(1, 'Skoda'),
(2, 'Volvo'),
(3, 'Toyota'),
(4, 'Fiat')
]
for e in Engines:
for l in Luxuries:
for c in Companies:
... | [
7936,
1127,
796,
685,
198,
220,
220,
220,
357,
16,
11,
366,
35,
29893,
12340,
198,
220,
220,
220,
357,
17,
11,
366,
39699,
14453,
12340,
198,
220,
220,
220,
357,
18,
11,
366,
44132,
4943,
198,
60,
198,
198,
43,
2821,
4740,
796,
... | 1.719653 | 346 |
#
#
#
from __future__ import absolute_import, division, print_function, \
unicode_literals
from os.path import dirname, isfile, join
from unittest import TestCase
from yaml import safe_load
from yaml.constructor import ConstructorError
from octodns.record import Create
from octodns.provider.yaml import YamlProvi... | [
2,
198,
2,
198,
2,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
11,
3467,
198,
220,
220,
220,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
28686,
13,
6978,
1330,
26672,
3672,
11,
318,
775... | 3.491667 | 120 |
import unittest
import os
import io
import sys
from unittest.mock import patch
from fzfaws.route53 import Route53
from fzfaws.utils import Pyfzf, FileLoader
from botocore.paginate import Paginator
from pathlib import Path
| [
11748,
555,
715,
395,
198,
11748,
28686,
198,
11748,
33245,
198,
11748,
25064,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
198,
6738,
277,
89,
69,
8356,
13,
38629,
4310,
1330,
18956,
4310,
198,
6738,
277,
89,
69,
8356,
13,
26... | 3.185714 | 70 |
from abc import ABC, abstractmethod
from keras.models import model_from_json
| [
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
198,
6738,
41927,
292,
13,
27530,
1330,
2746,
62,
6738,
62,
17752,
628
] | 3.590909 | 22 |
# Copyright 2021-2022 Boris Shminke
#
# 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 wr... | [
2,
15069,
33448,
12,
1238,
1828,
25026,
911,
1084,
365,
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,
... | 2.495779 | 2,606 |
from unittest import TestCase
import numpy as np
import numpy.testing as npt
from cavsim.base.fluids.fluid import Fluid
| [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
299,
32152,
13,
33407,
355,
299,
457,
198,
6738,
22357,
14323,
13,
8692,
13,
35522,
2340,
13,
35522,
312,
1330,
1610,
27112,
628
] | 3.184211 | 38 |
#!/usr/bin/env python3
'''
Input is a group of one or more lines with letters.
Each letter = question to which the answer was 'yes'.
Each line represents survey answers by a person, contains one or more letter.
Adjacent lines are part of the same group.
For each group, count the number of questions to which all peo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
628,
198,
7061,
6,
198,
20560,
318,
257,
1448,
286,
530,
393,
517,
3951,
351,
7475,
13,
198,
198,
10871,
3850,
796,
1808,
284,
543,
262,
3280,
373,
705,
8505,
4458,
198,
10871,
1627,
... | 4.652174 | 115 |
import nni
h_conv1 = 1
nni.choice({'foo': foo, 'bar': bar})(1)
conv_size = nni.choice({2: 2, 3: 3, 5: 5, 7: 7}, name='conv_size')
abc = nni.choice({'2': '2', 3: 3, '(5 * 6)': 5 * 6, 7: 7}, name='abc')
h_pool1 = nni.function_choice({'max_pool': lambda : max_pool(h_conv1),
'h_conv1': lambda : h_conv1,
'avg_pool'... | [
11748,
299,
8461,
198,
198,
71,
62,
42946,
16,
796,
352,
198,
77,
8461,
13,
25541,
15090,
6,
21943,
10354,
22944,
11,
705,
5657,
10354,
2318,
92,
5769,
16,
8,
198,
42946,
62,
7857,
796,
299,
8461,
13,
25541,
15090,
17,
25,
362,
11... | 2.124069 | 403 |
from __future__ import annotations
import calendar
import logging
import os
from dataclasses import dataclass
from datetime import datetime
import dateparser
import requests
from markdown import markdown
em = tag("em")
time = tag("time")
h2 = tag("h2")
p = tag("p")
strong = tag("strong")
a = tag("a")
details = ta... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
11845,
198,
11748,
18931,
198,
11748,
28686,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
11748,
3128,
48610,
198,
11748,
70... | 2.798387 | 248 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__a... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
26144,
35986,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760,
644,
345,
389,
1804,
0,
17202,
... | 2.656951 | 446 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-11-07 19:24
from __future__ import unicode_literals
from django.db import migrations
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
16,
319,
2177,
12,
1157,
12,
2998,
678,
25,
1731,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.690909 | 55 |
# coding=utf-8
'''
Created on 2016-12-5
@author: Administrator
'''
from doraemon.ci.models import CITaskFlow, CIFlowSectionHistory, CITaskFlowHistory
from url_filter.filtersets.django import ModelFilterSet
| [
2,
19617,
28,
40477,
12,
23,
198,
7061,
6,
198,
41972,
319,
1584,
12,
1065,
12,
20,
198,
198,
31,
9800,
25,
22998,
198,
7061,
6,
198,
198,
6738,
288,
5799,
7966,
13,
979,
13,
27530,
1330,
327,
2043,
2093,
37535,
11,
327,
5064,
9... | 2.971831 | 71 |
#!/usr/bin/python
import sys
# input comes from STDIN (standard input)
for line in sys.stdin:
# remove leading and trailing whitespace
line = line.strip()
# split the line into words
element1 = line.split(',')
c = 0
for element in element1:
c += 1
if c == 1:
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
628,
198,
198,
11748,
25064,
198,
198,
2,
5128,
2058,
422,
48571,
1268,
357,
20307,
5128,
8,
628,
198,
1640,
1627,
287,
25064,
13,
19282,
259,
25,
198,
220,
220,
220,
1303,
4781,
3756,
290,
2546... | 2.186441 | 177 |
from alembic import util, command, config
import argparse
import inspect
if __name__ == '__main__':
cmdline = AlembicCommandLine()
cmdline.main()
| [
6738,
31341,
2022,
291,
1330,
7736,
11,
3141,
11,
4566,
198,
11748,
1822,
29572,
198,
11748,
10104,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
23991,
1370,
796,
9300,
2022,
291,
21575,
... | 2.962264 | 53 |
"""
Here we test `glamor.include_scope_in_title` and
`glamor.logging_allure_steps` functions.
"""
import io
import logging
from allure_commons_test.container import has_container
from allure_commons_test.report import has_test_case
from hamcrest import assert_that
from glamor.patches import PatchHelper, include_scope... | [
37811,
198,
4342,
356,
1332,
4600,
70,
2543,
273,
13,
17256,
62,
29982,
62,
259,
62,
7839,
63,
290,
198,
63,
70,
2543,
273,
13,
6404,
2667,
62,
439,
495,
62,
20214,
63,
5499,
13,
198,
37811,
198,
11748,
33245,
198,
11748,
18931,
1... | 3.149701 | 167 |
# proxy module
from pyface.message_dialog import *
| [
2,
15741,
8265,
198,
6738,
12972,
2550,
13,
20500,
62,
38969,
519,
1330,
1635,
198
] | 3.4 | 15 |
import requests
import pprint
import time
from datetime import datetime
send_push("Hello from python")
# Get info from https://gorzdrav.spb.ru/service-covid-vaccination-schedule
# Put your hospital number here
HOSPITAL_NAME_PATTERN = "78"
# District ID
DISTRIC_ID = 17
REFRESH_PERIOD = 10 * 60
RETRY_PERIOD = 5 * ... | [
11748,
7007,
198,
11748,
279,
4798,
198,
11748,
640,
198,
6738,
4818,
8079,
1330,
4818,
8079,
628,
628,
198,
21280,
62,
14689,
7203,
15496,
422,
21015,
4943,
628,
198,
2,
3497,
7508,
422,
3740,
1378,
7053,
89,
67,
4108,
13,
2777,
65,
... | 2.115315 | 555 |
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models.fields import BigIntegerField
from django.utils.translation import ugettext_lazy as _
from .bitcoin import Bitcoin
HEX_CHARS = "0123456789abcdefABCDEF"
| [
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
3254,
24765,
12331,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
25747,
1330,
4403,
46541,
15878,
198,
6738,
42625,
14208,
13,
26791,... | 3.291139 | 79 |
#
# @lc app=leetcode id=96 lang=python3
#
# [96] Unique Binary Search Trees
#
# @lc code=start
# @lc code=end
| [
2,
198,
2,
2488,
44601,
598,
28,
293,
316,
8189,
4686,
28,
4846,
42392,
28,
29412,
18,
198,
2,
198,
2,
685,
4846,
60,
30015,
45755,
11140,
34925,
198,
2,
198,
198,
2,
2488,
44601,
2438,
28,
9688,
198,
220,
220,
220,
220,
220,
22... | 2.046875 | 64 |
from typing import Callable, List
| [
6738,
19720,
1330,
4889,
540,
11,
7343,
198
] | 4.25 | 8 |
"""Tests for exporters.py"""
import pytest
import io
from deepcell_label import models
from deepcell_label import exporters
from deepcell_label.conftest import DummyLoader
class TestExporter():
class TestS3Exporter():
| [
37811,
51,
3558,
329,
1033,
3816,
13,
9078,
37811,
198,
198,
11748,
12972,
9288,
198,
11748,
33245,
198,
198,
6738,
2769,
3846,
62,
18242,
1330,
4981,
198,
6738,
2769,
3846,
62,
18242,
1330,
1033,
3816,
198,
6738,
2769,
3846,
62,
18242,... | 3.373134 | 67 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import csv
import logging
import os
import random
import re
from concurrent.futures import ThreadPoolExecutor
from typing import Dict
from urllib import request
from urllib.error import HTTPError
from bs4 import BeautifulSoup
DATA_DIR = 'data'
CSV_FILE_WHOLE = os.path.join(DA... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
269,
21370,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
302,
198,
6738,
24580,
13,
69,
315,
942... | 2.090603 | 2,373 |
from PyQt5 import QtGui
from PyQt5.QtWidgets import QApplication, QMainWindow
import sys
from PyQt5.QtGui import QPainter, QBrush, QPen, QLinearGradient
from PyQt5.QtCore import Qt
App = QApplication(sys.argv)
window = Window()
sys.exit(App.exec())
| [
6738,
9485,
48,
83,
20,
1330,
33734,
8205,
72,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
54,
312,
11407,
1330,
1195,
23416,
11,
1195,
13383,
27703,
198,
11748,
25064,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
8205,
72,
1330,
1195,
... | 2.545455 | 99 |
from quart import render_template, g
from lnbits.decorators import check_user_exists, validate_uuids
from . import lndhub_ext
| [
6738,
28176,
1330,
8543,
62,
28243,
11,
308,
201,
198,
201,
198,
6738,
300,
77,
9895,
13,
12501,
273,
2024,
1330,
2198,
62,
7220,
62,
1069,
1023,
11,
26571,
62,
12303,
2340,
201,
198,
6738,
764,
1330,
300,
358,
40140,
62,
2302,
201,... | 2.891304 | 46 |
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
12582,
355,
4808,
628
] | 3.529412 | 34 |
# Copyright 2021 Tianmian Tech. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | [
2,
15069,
33448,
20834,
76,
666,
9634,
13,
1439,
6923,
33876,
13,
198,
2,
220,
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,
3... | 3.628339 | 861 |
"""
Pytest common fixtures
"""
from __future__ import absolute_import, print_function
import os
import pytest
from pywbemtools._utils import CONNECTIONS_FILENAME, \
DEFAULT_CONNECTIONS_DIR, DEFAULT_CONNECTIONS_FILE
SCRIPT_DIR = os.path.dirname(__file__)
# Backup file of the default connections file
BAK_SUFFIX =... | [
37811,
198,
20519,
9288,
2219,
34609,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
3601,
62,
8818,
198,
11748,
28686,
198,
11748,
12972,
9288,
198,
198,
6738,
12972,
39346,
368,
31391,
13557,
26791,
1330,
7102... | 2.23956 | 455 |
import tensorflow as tf
from menpofit.visualize import plot_cumulative_error_distribution
from menpofit.error import compute_cumulative_error
from scipy.integrate import simps
from menpo_functions import load_menpo_image_list, load_bb_dictionary
from logging_functions import *
from data_loading_functions import *
from ... | [
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
1450,
79,
1659,
270,
13,
41464,
1096,
1330,
7110,
62,
36340,
13628,
62,
18224,
62,
17080,
3890,
198,
6738,
1450,
79,
1659,
270,
13,
18224,
1330,
24061,
62,
36340,
13628,
62,
18224,
198,
... | 3.2 | 130 |
#!/usr/bin/env python3
from DataBase_Manager.beta_manager import gather_data
import sys
experiment_path = sys.argv[1]
csv_path = sys.argv[2]
gather_data(experiment_path, save_file=csv_path) | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
6738,
6060,
14881,
62,
13511,
13,
31361,
62,
37153,
1330,
6431,
62,
7890,
198,
11748,
25064,
198,
198,
23100,
3681,
62,
6978,
796,
25064,
13,
853,
85,
58,
16,
60,
198,
40664,
62,... | 2.652778 | 72 |
import requests
| [
11748,
7007,
628
] | 5.666667 | 3 |
import unittest
import numpy as np
from cctpy.baseutils import Vectors, Equal, Stream
from cctpy.constant import M, MM, YI, XI, Protons, ZI, MRAD
from cctpy.particle import RunningParticle, ParticleFactory, PhaseSpaceParticle, ParticleRunner
from cctpy.qs_hard_edge_magnet import QsHardEdgeMagnet
from cctpy.abstract_c... | [
11748,
555,
715,
395,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
269,
310,
9078,
13,
8692,
26791,
1330,
569,
478,
669,
11,
28701,
11,
13860,
198,
6738,
269,
310,
9078,
13,
9979,
415,
1330,
337,
11,
20806,
11,
575,
40,
... | 2.907285 | 151 |
from __future__ import annotations
import os
import sys
if __name__ == '__main__':
# Ensure that the parent directory is not in sys.path.
norm = lambda x: os.path.normpath(os.path.abspath(x))
dirname = os.path.dirname(norm(__file__))
sys.path[:] = [x for x in sys.path if norm(x) != dirname]
del norm, dirna... | [
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
1303,
48987,
326,
262,
2560,
8619,
318,
407,
287,
25064,
13,
6978,
13,
... | 2.936605 | 489 |
"""
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
This file is part of the Smart Developer Hub Project:
http://www.smartdeveloperhub.org
Center for Open Middleware
http://www.centeropenmiddleware.com/
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=... | [
37811,
198,
2,
12,
46402,
46402,
46402,
46402,
27584,
46249,
198,
220,
770,
2393,
318,
636,
286,
262,
10880,
23836,
14699,
4935,
25,
198,
220,
220,
220,
2638,
1378,
2503,
13,
27004,
16244,
263,
40140,
13,
2398,
628,
220,
3337,
329,
49... | 3.833333 | 354 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-03-31 11:03
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
24,
319,
1584,
12,
3070,
12,
3132,
1367,
25,
3070,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
... | 2.781818 | 55 |
#----------------------------------------------------------------------
# Copyright (c) 2011-2016 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, including ... | [
2,
10097,
23031,
198,
2,
15069,
357,
66,
8,
2813,
12,
5304,
7760,
1169,
261,
12597,
45,
21852,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
198,
2,
257,
4866,
286,
428,
3788,
290,
... | 2.856485 | 1,519 |
import pygame
| [
11748,
12972,
6057,
628
] | 3.75 | 4 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2007-2012 Peter Kuma
import os
from datetime import date, datetime
import urllib.request, urllib.error, urllib.parse
import json
from django.utils import timezone
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.conf import setti... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
66,
8,
4343,
12,
6999,
5613,
509,
7487,
198,
198,
11748,
28686,
198,
6738,
4818,
8079,
1330,
3128,
11,
4818,
8079,
198,
11748,
2956,
297,
571,
... | 2.372579 | 2,582 |
'''Refactored tests from test_hal_nav.py'''
import json
import httpretty
import pytest
import conftest
import uritemplate
import restnavigator as RN
from restnavigator import exc
import restnavigator.halnav as HN
def uri_of(doc):
'''Pull out the url from a hal document'''
return doc['_links']['self']['hr... | [
7061,
6,
8134,
529,
1850,
5254,
422,
1332,
62,
14201,
62,
28341,
13,
9078,
7061,
6,
198,
198,
11748,
33918,
198,
198,
11748,
2638,
16100,
198,
11748,
12972,
9288,
198,
198,
11748,
369,
701,
395,
198,
198,
11748,
2956,
9186,
6816,
198,... | 2.429119 | 1,044 |
import os
import vonage
from dotenv import load_dotenv
dotenv_path = join(dirname(__file__), "../.env")
load_dotenv(dotenv_path)
VONAGE_APPLICATION_ID=os.environ.get("VONAGE_APPLICATION_ID")
VONAGE_APPLICATION_PRIVATE_KEY_PATH=os.environ.get("VONAGE_APPLICATION_PRIVATE_KEY_PATH")
client = vonage.Client(
applicat... | [
11748,
28686,
198,
11748,
18042,
496,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
198,
26518,
24330,
62,
6978,
796,
4654,
7,
15908,
3672,
7,
834,
7753,
834,
828,
366,
492,
11757,
24330,
4943,
198,
2220,
62,
26518,
24330,... | 2.382353 | 170 |
#!/usr/bin/bin/python
| [
2,
48443,
14629,
14,
8800,
14,
8800,
14,
29412,
198
] | 2.2 | 10 |
import sys
read('sample.in')
#read(sys.argv[1])
| [
11748,
25064,
628,
628,
198,
961,
10786,
39873,
13,
259,
11537,
198,
2,
961,
7,
17597,
13,
853,
85,
58,
16,
12962,
198
] | 2.26087 | 23 |
import django_filters
from .models import Product
| [
11748,
42625,
14208,
62,
10379,
1010,
198,
6738,
764,
27530,
1330,
8721,
628
] | 3.923077 | 13 |
import re
import os
import pickle
import sys
from math import log
DICT_NAME = "dict.txt"
BI_GRAM_FILE = "bi_gram.txt"
HMM_PROB = "hmm_prob"
SMALL_PROB = 1e-200
# +,#,&,.,%
re_ch = re.compile("([\u4E00-\u9FD5a-zA-Z0-9\uFF10-\uFF5A+#&\._%]+)", re.U)
re_stop = re.compile("([]+)", re.U)
# 2-gram
#
# HMM
if __name__... | [
11748,
302,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
11748,
25064,
198,
6738,
10688,
1330,
2604,
198,
198,
35,
18379,
62,
20608,
796,
366,
11600,
13,
14116,
1,
198,
3483,
62,
10761,
2390,
62,
25664,
796,
366,
8482,
62,
4546,
13,... | 1.824675 | 308 |
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from bs4 import BeautifulSoup
import requests
import time
import os
import csv
root_url = "https://seekingalpha.com"
query = "stock repurchase program"
url = "https://seekingalpha.com/search?q="+query.replcae(" ", "+")
chrome_driver_p... | [
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
46659,
13,
25811,
1330,
18634,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
7007,
198,
11748,
640,
198,
11748,
28686,
198,
1174... | 2.531088 | 772 |
import eval_utils
import json
from falx.eval_interface import FalxEvalInterface
from falx.utils import table_utils
from timeit import default_timer as timer
import numpy as np
from pprint import pprint
from falx.visualization.chart import VisDesign, LayeredChart
from falx.visualization.matplotlib_chart import Matpl... | [
11748,
5418,
62,
26791,
198,
11748,
33918,
198,
198,
6738,
24215,
87,
13,
18206,
62,
39994,
1330,
9596,
87,
36,
2100,
39317,
198,
6738,
220,
24215,
87,
13,
26791,
1330,
3084,
62,
26791,
198,
6738,
640,
270,
1330,
4277,
62,
45016,
355,... | 2.192 | 1,375 |
from collections import deque
dimensions = int(input())
matrix = read_matrix(dimensions)
bombs = deque([[int(y) for y in x.split(",")] for x in input().split(' ')])
for b in range(len(bombs)):
bomb_row, bomb_col = bombs.popleft()
damage = matrix[bomb_row][bomb_col]
if matrix[bomb_row][bomb_col] > 0:... | [
6738,
17268,
1330,
390,
4188,
628,
628,
198,
27740,
5736,
796,
493,
7,
15414,
28955,
198,
6759,
8609,
796,
1100,
62,
6759,
8609,
7,
27740,
5736,
8,
198,
198,
65,
33273,
796,
390,
4188,
26933,
58,
600,
7,
88,
8,
329,
331,
287,
2124... | 2.187151 | 358 |
"""
Contains class that runs inferencing
"""
import torch
import numpy as np
from networks.RecursiveUNet import UNet
from utils.utils import med_reshape
| [
37811,
198,
4264,
1299,
1398,
326,
4539,
1167,
14226,
2259,
198,
37811,
198,
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
7686,
13,
6690,
30753,
4944,
316,
1330,
4725,
316,
198,
198,
6738,
3384,
4487,
13,
26791,
133... | 3.369565 | 46 |
# Copyright (c) 2019 Cable Television Laboratories, 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 by applicable law ... | [
2,
15069,
357,
66,
8,
13130,
20249,
21516,
46779,
11,
3457,
13,
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,
... | 3.696581 | 234 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import ctypes
import numpy as np
import os
path = '/'.join(os.path.abspath(__file__).split('/')[:-1])
fftw_path = 'cpp_src/fftw-2.1.5/fftw/.libs/libfftw.so.2'
crv_path = 'cpp_src/curvelet.so'
ctypes.cdll.Load... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
269,
19199,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
198,
... | 2.491124 | 169 |
# -*- coding:utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from django.http import JsonResponse
| [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
4262... | 3.372549 | 51 |