content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import logging
import requests
from geocodio.data import Address
from geocodio.data import Location
from geocodio.data import LocationCollection
from geocodio import exceptions
logger = logging.getLogger(__name__)
ALLOWED_FIELDS = [
"acs-demographics",... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
628,
198,
11748,
33918,
198,
11748,
18931,
198,
198,
11748,
7007,
198,
198,
6738,
4903,
420,
375,
952,
13,
7890,
1330,
17917... | 2.131098 | 3,669 |
# encoding:utf-8
__author__ = 'shiliang'
__date__ = '2019/5/13 23:41'
from gensim.models.ldamodel import LdaModel
from gensim.models.ldaseqmodel import LdaSeqModel
from gensim import corpora
import xlrd
import nltk
# nltk.download('wordnet')
from nltk.corpus import stopwords
from nltk.stem.wordnet import W... | [
171,
119,
123,
2,
21004,
25,
40477,
12,
23,
201,
198,
834,
9800,
834,
796,
705,
1477,
2403,
648,
6,
201,
198,
834,
4475,
834,
796,
705,
23344,
14,
20,
14,
1485,
2242,
25,
3901,
6,
201,
198,
201,
198,
6738,
308,
641,
320,
13,
2... | 1.578451 | 2,441 |
# -*- coding: utf-8 -*-
#@+leo-ver=5-thin
#@+node:ekr.20181202062518.1: * @file leoFastRedraw.py
#@@first
'''
Gui-independent fast-redraw code.
For an explanation, see this thread:
https://groups.google.com/forum/#!topic/leo-editor/hpHyHU2sWtM
'''
import leo.core.leoGlobals as g
import difflib
import re
import time
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
31,
10,
293,
78,
12,
332,
28,
20,
12,
40871,
198,
2,
31,
10,
17440,
25,
988,
81,
13,
7908,
10232,
22136,
1495,
1507,
13,
16,
25,
1635,
2488,
7753,
443,
78,
22... | 2.29878 | 164 |
from core.advbase import *
from slot.a import *
from slot.d import *
galex_conf = {
'x1.dmg': 82 / 100.0,
'x1.startup': 8 / 60.0,
'x1.recovery': 34 / 60.0,
'x1.hit': 1,
'x2.dmg': 88 / 100.0,
'x2.startup': 0,
'x2.recovery': 28 / 60.0,
'x2.hit': 1,
'x3.dmg': 104 / 100.0,
'x3.star... | [
6738,
4755,
13,
32225,
8692,
1330,
1635,
198,
6738,
10852,
13,
64,
1330,
1635,
198,
6738,
10852,
13,
67,
1330,
1635,
198,
70,
1000,
87,
62,
10414,
796,
1391,
198,
220,
220,
220,
705,
87,
16,
13,
67,
11296,
10354,
9415,
1220,
1802,
... | 1.774869 | 382 |
if __name__ == '__main__':
print("?", replace_question_marks("?"))
print("??", replace_question_marks("??"))
print("???", replace_question_marks("???"))
print("?a?", replace_question_marks("?a?"))
print("a?a", replace_question_marks("a?a"))
print("abc??cba?a", replace_question_marks("abc??cba?a... | [
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
3601,
7203,
35379,
6330,
62,
25652,
62,
14306,
7203,
1701,
4008,
198,
220,
220,
220,
3601,
7203,
3548,
1600,
6330,
62,
25652,
62,
14306,
7203,
30,
1701... | 2.477612 | 134 |
#!/usr/bin/python
# cd /home/tegwyn/ultrasonic_classifier/ && sudo python3 test.py
# cd /home/tegwyn/ultrasonic_classifier/ && chmod 775 test.py
import time
import busio
import digitalio
import board
import adafruit_si7021
from adafruit_tinylora.adafruit_tinylora import TTN, TinyLoRa
print("Hello blinka!")
# Try t... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
2,
22927,
1220,
11195,
14,
660,
70,
27612,
14,
586,
81,
30189,
62,
4871,
7483,
14,
11405,
21061,
21015,
18,
1332,
13,
9078,
198,
2,
22927,
1220,
11195,
14,
660,
70,
27612,
14,
586,
8... | 2.109968 | 1,555 |
from snake import Game_Snake
| [
6738,
17522,
1330,
3776,
62,
49795,
198
] | 4.142857 | 7 |
import wx
from src.wx.player import VideoPlayerPanel
| [
11748,
266,
87,
198,
198,
6738,
12351,
13,
49345,
13,
7829,
1330,
7623,
14140,
26639,
198,
220,
220,
220,
220,
220,
220,
220,
220
] | 2.583333 | 24 |
import jsii
import pytest
from aviv_cdk.cicd import (
stack
)
from aws_cdk import (
aws_codepipeline,
aws_codepipeline_actions,
pipelines,
core
)
import jsii.errors
@pytest.fixture(scope="class")
| [
11748,
44804,
4178,
198,
11748,
12972,
9288,
198,
6738,
1196,
452,
62,
10210,
74,
13,
66,
291,
67,
1330,
357,
198,
220,
220,
220,
8931,
198,
8,
198,
6738,
3253,
82,
62,
10210,
74,
1330,
357,
198,
220,
220,
220,
3253,
82,
62,
19815... | 2.294737 | 95 |
#
# Autogenerated by Thrift Compiler (0.12.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
from thrift.TRecursive impo... | [
2,
198,
2,
5231,
519,
877,
515,
416,
16283,
2135,
3082,
5329,
357,
15,
13,
1065,
13,
15,
8,
198,
2,
198,
2,
8410,
5626,
48483,
4725,
48481,
7013,
15986,
311,
11335,
14603,
7013,
35876,
25003,
7013,
15986,
8410,
2751,
198,
2,
198,
... | 2.457645 | 968 |
import unittest
from subprocess import Popen, PIPE, STDOUT
import string
import random
import os
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
6738,
850,
14681,
1330,
8099,
268,
11,
350,
4061,
36,
11,
48571,
12425,
198,
11748,
4731,
198,
11748,
4738,
198,
11748,
28686,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
22... | 2.9 | 50 |
# Generated by Django 3.1.3 on 2020-12-04 11:23
import datetime
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
18,
319,
12131,
12,
1065,
12,
3023,
1367,
25,
1954,
198,
198,
11748,
4818,
8079,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.972222 | 36 |
"""
Generate performance report from a completed campaign.
This module parses all run directories in all sweep groups to aggregate
information.
Runs sosflow analysis to collect data.
All parameters specified in the spec file must be used as column headers in
an output csv file.
"""
import os
import sys
from pathlib i... | [
37811,
198,
8645,
378,
2854,
989,
422,
257,
5668,
1923,
13,
198,
1212,
8265,
13544,
274,
477,
1057,
29196,
287,
477,
16085,
2628,
284,
19406,
198,
17018,
13,
198,
10987,
82,
264,
418,
11125,
3781,
284,
2824,
1366,
13,
198,
198,
3237,
... | 2.357194 | 2,808 |
from rest_framework import serializers
from .models import BlogPost
import os
from users.serializers import UserPublicSerializer
| [
6738,
1334,
62,
30604,
1330,
11389,
11341,
220,
198,
6738,
764,
27530,
1330,
14001,
6307,
198,
11748,
28686,
198,
6738,
2985,
13,
46911,
11341,
1330,
11787,
15202,
32634,
7509,
628,
220,
220,
220,
220,
220,
220,
220,
220,
628,
220,
220,... | 2.924528 | 53 |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import logging
import numpy as np
from typing import Optional, Tuple
import torch
from torch import nn
from functools import partial
from torch.nn import functional as F
from torch.autograd import Variable
import cv2
import random
import copy
from ... | [
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
1439,
6923,
33876,
198,
11748,
18931,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
19720,
1330,
32233,
11,
309,
29291,
198,
11748,
28034,
198,
6738,
28034,
1330,
299,
77... | 2.353115 | 5,763 |
import keras
from keras.datasets import mnist
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential, load_model, Model
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Conv2D, MaxPooling2D
from keras.optimizers import SGD, Adam
from kera... | [
11748,
41927,
292,
201,
198,
6738,
41927,
292,
13,
19608,
292,
1039,
1330,
285,
77,
396,
201,
198,
6738,
41927,
292,
13,
3866,
36948,
13,
9060,
1330,
7412,
6601,
8645,
1352,
201,
198,
6738,
41927,
292,
13,
27530,
1330,
24604,
1843,
11... | 3.18543 | 151 |
from flask import (
Blueprint, flash, g, redirect, render_template, request, url_for
)
from werkzeug.exceptions import abort
from sgb import db
from sgb.controllers.funcionario import login_required
bp = Blueprint('autor', __name__)
@bp.route('/autor', defaults={'page': 1}, methods=('GET', 'POST'))
@bp.route('/... | [
6738,
42903,
1330,
357,
198,
220,
220,
220,
39932,
11,
7644,
11,
308,
11,
18941,
11,
8543,
62,
28243,
11,
2581,
11,
19016,
62,
1640,
198,
8,
198,
198,
6738,
266,
9587,
2736,
1018,
13,
1069,
11755,
1330,
15614,
198,
6738,
264,
22296,... | 2.103964 | 1,539 |
"""
My own hand rolled HTTP Server
This was created as a learning exercise.
DO NOT EVER DO THIS!
DO NOT EVER USE THIS OUTSIDE A CLASSROOM!
Python already has a built in mini http framework
https://docs.python.org/3/library/http.server.html
"""
import socket
import re
import logging
import traceback
import urllib.pars... | [
37811,
198,
3666,
898,
1021,
11686,
14626,
9652,
198,
1212,
373,
2727,
355,
257,
4673,
5517,
13,
198,
18227,
5626,
20498,
8410,
12680,
0,
198,
18227,
5626,
20498,
23210,
12680,
16289,
50,
14114,
317,
42715,
13252,
2662,
0,
198,
198,
379... | 2.329879 | 1,737 |
import xarray as xr
import numpy as np
import scipy.optimize as opt
import sys
import statsmodels.api as sm
# various linear regression functions
# linfit_lonlat = calculating the trend for a lat,lon array
# linfit_xy = using ordinary least squares fit
# multi_ols = multiple linear regression using OLS
# tls = total ... | [
11748,
2124,
18747,
355,
2124,
81,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
13,
40085,
1096,
355,
2172,
220,
198,
11748,
25064,
198,
11748,
9756,
27530,
13,
15042,
355,
895,
198,
198,
2,
2972,
14174,
20683,
5499,
... | 2.0081 | 4,568 |
# Aggregate all `rust` rules to one loadable file
load(":rust_proto_compile.bzl", _rust_proto_compile="rust_proto_compile")
load(":rust_grpc_compile.bzl", _rust_grpc_compile="rust_grpc_compile")
load(":rust_proto_library.bzl", _rust_proto_library="rust_proto_library")
load(":rust_grpc_library.bzl", _rust_grpc_library="... | [
2,
19015,
49373,
477,
4600,
11469,
63,
3173,
284,
530,
3440,
540,
2393,
198,
2220,
7,
1298,
11469,
62,
1676,
1462,
62,
5589,
576,
13,
65,
48274,
1600,
4808,
11469,
62,
1676,
1462,
62,
5589,
576,
2625,
11469,
62,
1676,
1462,
62,
5589... | 2.492537 | 201 |
from __future__ import print_function
import time
import sys
from multiprocessing import Queue
sys.path.append('..')
from openbci import wifi as bci
import numpy as np
from paint.interface.interface import Interface
from collections import deque
import matplotlib.pyplot as plt
from multiprocessing import Process
q = ... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
640,
198,
11748,
25064,
198,
6738,
18540,
305,
919,
278,
1330,
4670,
518,
198,
198,
17597,
13,
6978,
13,
33295,
10786,
492,
11537,
198,
6738,
1280,
65,
979,
1330,
43121,
355,
... | 2.686667 | 300 |
import pytest
import sys
from lessql.expr.base import Associativity, Precedence, State, state_factory
| [
11748,
12972,
9288,
198,
11748,
25064,
198,
198,
6738,
1342,
13976,
13,
31937,
13,
8692,
1330,
3928,
22055,
11,
3771,
771,
594,
11,
1812,
11,
1181,
62,
69,
9548,
628,
628,
628,
628,
628,
628,
628,
628,
628,
198
] | 3.102564 | 39 |
import os
from setuptools import setup
from setuptools import find_packages
NAME = 'PluggableAuthService'
here = os.path.abspath(os.path.dirname(__file__))
_boundary = '\n\n'
with open('README.rst') as f:
README = f.read()
with open('CHANGES.rst') as f:
CHANGES = f.read()
README = (README + _boundary + ... | [
11748,
28686,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
6738,
900,
37623,
10141,
1330,
1064,
62,
43789,
198,
198,
20608,
796,
705,
3646,
6837,
540,
30515,
16177,
6,
198,
198,
1456,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418... | 2.337853 | 885 |
# Generated by Django 2.1.4 on 2018-12-13 18:20
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
19,
319,
2864,
12,
1065,
12,
1485,
1248,
25,
1238,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
s = Solution()
# print(s.minKnightMoves(1, 2))
# print(s.minKnightMoves(2, 1))
print(s.nextEight(0, 0))
| [
198,
198,
82,
796,
28186,
3419,
198,
2,
3601,
7,
82,
13,
1084,
44242,
44,
5241,
7,
16,
11,
362,
4008,
198,
2,
3601,
7,
82,
13,
1084,
44242,
44,
5241,
7,
17,
11,
352,
4008,
198,
4798,
7,
82,
13,
19545,
29571,
7,
15,
11,
657,
... | 2.163265 | 49 |
import numpy as np
import math
import re, os, traceback, sys, json
import pytest
import argparse
import tensorflow as tf
import timeit
from tensorflow.python.framework import ops
ops.reset_default_graph()
from desidlas.training.model import build_model
from tensorflow.compat.v1 import ConfigProto
from tensorflow.com... | [
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
11748,
302,
11,
28686,
11,
12854,
1891,
11,
25064,
11,
33918,
198,
11748,
12972,
9288,
198,
11748,
1822,
29572,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
640,
270,
198,
... | 2.898701 | 385 |
# Copyright 2022 The Flax 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 applicable law or agreed to in wri... | [
2,
15069,
33160,
383,
1610,
897,
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,
11846,
351,
262,
13789,
13,
198,
2,... | 3.466102 | 236 |
def Menu():
"""Funcion que Muestra el Menu"""
print """************
Calculadora
************
Menu
1) Suma
2) Resta
3) Multiplicacion
4) Division
5) Salir"""
def Calculadora():
"""Funcion Para Calcular Operaciones Aritmeticas"""
Menu()
opc = int(input("Selecione Opcion\n"))
while (... | [
4299,
21860,
33529,
628,
220,
220,
220,
37227,
37,
19524,
295,
8358,
8252,
395,
430,
1288,
21860,
37811,
628,
220,
220,
220,
3601,
37227,
46068,
198,
198,
9771,
3129,
324,
5799,
198,
198,
46068,
198,
198,
23381,
198,
198,
16,
8,
5060,... | 1.944345 | 557 |
#!/usr/bin/env python
import time
import pigpio
import scrollphathd
print("""
Scroll pHAT HD: Hello World
Scrolls "Hello World" across the screen
using the default 5x7 pixel large font.
Press Ctrl+C to exit!
""")
scrollphathd.setup(i2c_dev=I2C_PIGPIO())
# Uncomment the below if your display is upside down
# (e... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
640,
198,
198,
11748,
12967,
79,
952,
198,
11748,
10743,
746,
776,
67,
198,
198,
4798,
7203,
15931,
198,
29261,
22918,
1404,
5572,
25,
18435,
2159,
198,
198,
29261,
82,
366... | 2.87037 | 270 |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
2,
15069,
12131,
3012,
11419,
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,
921,
743,
733... | 3.431373 | 306 |
from suzieq.poller.services.service import Service
from suzieq.utils import expand_nxos_ifname
class MlagService(Service):
"""MLAG service. Different class because output needs to be munged"""
def clean_json_input(self, data):
"""FRR JSON data needs some work"""
devtype = data.get("devtype",... | [
6738,
424,
49746,
80,
13,
30393,
263,
13,
30416,
13,
15271,
1330,
4809,
198,
6738,
424,
49746,
80,
13,
26791,
1330,
4292,
62,
77,
87,
418,
62,
361,
3672,
628,
198,
4871,
337,
30909,
16177,
7,
16177,
2599,
198,
220,
220,
220,
37227,
... | 1.935192 | 2,654 |
from database import mushilogger
import subprocess
import re
from arsenal import mynmap
| [
6738,
6831,
1330,
15026,
346,
519,
1362,
198,
11748,
850,
14681,
198,
11748,
302,
198,
6738,
24375,
1330,
616,
77,
8899,
628,
628
] | 3.956522 | 23 |
from django.db import models
# Create your models here.
# 用户表
# 主机表 | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
2,
13610,
534,
4981,
994,
13,
198,
2,
13328,
242,
101,
22755,
115,
26193,
101,
628,
198,
2,
220,
10310,
119,
17312,
118,
26193,
101
] | 2.058824 | 34 |
# Copyright 2019, The Jelly Bean World Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | [
2,
15069,
13130,
11,
383,
37152,
26510,
2159,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
407,
198,
2,
779,
428,
2393,
2845,
287,
... | 2.985849 | 636 |
from django.conf import settings
DEFAULT_MEDIA_FILTERS = getattr(settings, 'DEFAULT_MEDIA_FILTERS', {
'ccss': 'mediagenerator.filters.clever.CleverCSS',
'coffee': 'mediagenerator.filters.coffeescript.CoffeeScript',
'css': (
'mediagenerator.filters.urlfix.UrlFixFilter',
'mediagenerator.filte... | [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
198,
7206,
38865,
62,
30733,
3539,
62,
46700,
51,
4877,
796,
651,
35226,
7,
33692,
11,
705,
7206,
38865,
62,
30733,
3539,
62,
46700,
51,
4877,
3256,
1391,
198,
220,
220,
220,
705,
535,
... | 2.341026 | 1,170 |
from __future__ import print_function
| [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
628,
198
] | 4 | 10 |
import json
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Flatting a JSON-list to TXT.")
parser.add_argument("-i", type=str, default="no", help="Path to input file")
parser.add_argument("-o", type=str, default="bblist.txt", help="Output of BB list.")
args = pa... | [
11748,
33918,
198,
11748,
1822,
29572,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
30751,
796,
1822,
29572,
13,
28100,
1713,
46677,
7,
11213,
2625,
7414,
265,
889,
257,
19449,
12,
4868,
284,
... | 2.784615 | 130 |
from snakemake import shell
input, output, params, threads, w, config = snakemake.input, snakemake.output, snakemake.params, snakemake.threads, snakemake.wildcards, snakemake.config
shell("""
mkdir -p {params.odir}
cd {params.odir}
ln -sf {input.tgt_faa} t.pep
ln -sf {input.qry_faa} q.pep
ln -sf {i... | [
6738,
17522,
15883,
1330,
7582,
198,
15414,
11,
5072,
11,
42287,
11,
14390,
11,
266,
11,
4566,
796,
17522,
15883,
13,
15414,
11,
17522,
15883,
13,
22915,
11,
17522,
15883,
13,
37266,
11,
17522,
15883,
13,
16663,
82,
11,
17522,
15883,
... | 1.979046 | 1,384 |
#! /usr/bin/env python3
import argparse
import os
from glob import glob
from sdir import File, Folder
from filegroups import typeGroups
| [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
6738,
15095,
1330,
15095,
198,
6738,
264,
15908,
1330,
9220,
11,
48107,
198,
6738,
2393,
24432,
1330,
2099,
38,
14459,
628,
628,
... | 3.357143 | 42 |
# _ __
# | |/ /___ ___ _ __ ___ _ _ ®
# | ' </ -_) -_) '_ \/ -_) '_|
# |_|\_\___\___| .__/\___|_|
# |_|
#
# Keeper Secrets Manager
# Copyright 2021 Keeper Security Inc.
# Contact: ops@keepersecurity.com
#
from ansible.plugins.action import ActionBase
from ansible.errors import AnsibleError
from keeper_... | [
2,
220,
4808,
220,
11593,
198,
2,
930,
930,
14,
1220,
17569,
46444,
4808,
11593,
220,
46444,
4808,
4808,
38852,
198,
2,
930,
705,
7359,
532,
62,
8,
532,
62,
8,
705,
62,
3467,
14,
532,
62,
8,
705,
62,
91,
198,
2,
930,
62,
91,
... | 2.268836 | 2,336 |
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.linalg import lu_factor, lu_solve
from scipy.sparse import issparse, csc_matrix, eye
from scipy.sparse.linalg import splu
from scipy.optimize._numdiff import group_columns
from .common import (validate_max_step, validate_tol,... | [
6738,
11593,
37443,
834,
1330,
7297,
11,
3601,
62,
8818,
11,
4112,
62,
11748,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
75,
1292,
70,
1330,
300,
84,
62,
31412,
11,
300,
84,
62,
82,
6442,
198,
6738,
629,
541,... | 2.586231 | 2,905 |
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 22 15:20:04 2021
@author: zhou1281
"""
##check label integrety
labels = []
count = 0
with open('train.txt') as f:
lines = f.readlines()
for i in lines:
count += 1
if i == "\n":
pass
else:
line = i.s... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
26223,
2758,
2534,
1315,
25,
1238,
25,
3023,
33448,
201,
198,
201,
198,
31,
9800,
25,
1976,
15710,
1065,
6659,
201,
198,
37811,
201,
... | 1.629657 | 1,369 |
from __future__ import absolute_import
from . import misc
from . import signal
from . import special
from . import stats | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
764,
1330,
12747,
198,
6738,
764,
1330,
6737,
198,
6738,
764,
1330,
2041,
198,
6738,
764,
1330,
9756
] | 4.285714 | 28 |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and its affiliates. All Rights Reserved
import math
from typing import Optional, Tuple
import torch
import torch.nn as nn
Past = Tuple[torch.Tensor, torch.Tensor]
class BaseAttention(nn.Module):
"""
Tensor Type Shape
======... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
15069,
357,
66,
8,
30277,
19193,
82,
11,
3457,
13,
290,
663,
29116,
13,
1439,
6923,
33876,
198,
198,
11748,
10688,
198,
6738,
19720,
1330,
32233,
11,
309,
29291,
198,
198,
117... | 2.315471 | 1,157 |
from rest_framework import routers
from django.urls import path, include
from .viewsets import UserViewSet
router = routers.DefaultRouter()
main_router = routers.DefaultRouter()
main_router.register('users', UserViewSet)
urlpatterns = [
path('', include(router.urls)),
path('main/', include(main_router.urls))... | [
6738,
1334,
62,
30604,
1330,
41144,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
2291,
198,
6738,
764,
1177,
28709,
1330,
11787,
7680,
7248,
198,
198,
472,
353,
796,
41144,
13,
19463,
49,
39605,
3419,
198,
198,
12417,
62,
47... | 2.973333 | 150 |
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 19 10:19:03 2018
@author: Bea
"""
'''Script for generating neuronal traces and plot them against behaviour background'''
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.patches as patches
"""
Function that selects diff... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
26223,
2758,
678,
838,
25,
1129,
25,
3070,
2864,
201,
198,
31,
9800,
25,
1355,
64,
201,
198,
37811,
201,
198,
7061,
6,
7391,
329,
1... | 2.576046 | 526 |
from django.db import models
from companies.models import Division
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
6738,
2706,
13,
27530,
1330,
7458,
628
] | 4.3125 | 16 |
x = True
x = 1
x = 2
print(x) | [
87,
796,
6407,
198,
87,
796,
352,
198,
87,
796,
362,
198,
4798,
7,
87,
8
] | 1.8125 | 16 |
from __future__ import annotations
from itertools import islice
import re
from pathlib import Path
from typing import Optional, Set, Union, Iterator, List, TYPE_CHECKING, Tuple, Type
from logging import getLogger
from .base import HConfigBase
from .child import HConfigChild
if TYPE_CHECKING:
from .host import Hos... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
6738,
340,
861,
10141,
1330,
318,
75,
501,
198,
11748,
302,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
32233,
11,
5345,
11,
4479,
11,
40806,
1352,
11,
7343,
11,
41876,
62,
50... | 2.299478 | 4,982 |
from django.shortcuts import render,HttpResponse
from .models import UserTitle,UserVideo,UserPhoto
from .tools import start_data
from .mytools import getUserIDRandom
from ksDjango.settings import currentData
import json
# getUserRandomResult = []
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
43481,
31077,
198,
6738,
764,
27530,
1330,
11787,
19160,
11,
12982,
10798,
11,
12982,
6191,
198,
6738,
764,
31391,
1330,
923,
62,
7890,
198,
6738,
764,
1820,
31391,
1330,
651,
12982,
... | 3.716418 | 67 |
"""config URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | [
37811,
11250,
10289,
28373,
198,
198,
464,
4600,
6371,
33279,
82,
63,
1351,
11926,
32336,
284,
5009,
13,
1114,
517,
1321,
3387,
766,
25,
198,
220,
220,
220,
3740,
1378,
31628,
13,
28241,
648,
404,
305,
752,
13,
785,
14,
268,
14,
17,... | 2.929412 | 510 |
"""
Functions with multiple returns
"""
import matlab2cpp
from .function import type_string
from .variables import Get
def Func(node):
"""Function declaration
Contains: Declares Returns Params Block
Property: name (of function)
Examples:
>>> print(matlab2cpp.qscript("function f()"))
void f()
{
... | [
37811,
198,
24629,
2733,
351,
3294,
5860,
198,
37811,
198,
198,
11748,
2603,
23912,
17,
20322,
198,
6738,
764,
8818,
1330,
2099,
62,
8841,
198,
6738,
764,
25641,
2977,
1330,
3497,
628,
198,
4299,
11138,
66,
7,
17440,
2599,
198,
220,
2... | 2.19923 | 2,339 |
#!/usr/bin/env python
import logging
import tornado.escape
import tornado.ioloop
import tornado.options
import tornado.web
import tornado.websocket
import tornado.gen
import os.path
import uuid
import time
import json
from tornado.options import define, options
define("port", default=8888, help="run on the given por... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
18931,
198,
11748,
33718,
13,
41915,
198,
11748,
33718,
13,
1669,
11224,
198,
11748,
33718,
13,
25811,
198,
11748,
33718,
13,
12384,
198,
11748,
33718,
13,
732,
1443,
5459,
1... | 3.318584 | 113 |
yaml.dump(..., default_flow_style=False)
| [
198,
88,
43695,
13,
39455,
7,
986,
11,
4277,
62,
11125,
62,
7635,
28,
25101,
8,
198
] | 2.470588 | 17 |
#!/usr/bin/env python3
import pandas as pd
import mtga
CARDS_SQL="""
select cards.name, cards.rarity, sum(collection.count) as n
from collection
join cards on collection.mtga_id = cards.mtga_id
where cards.rarity != 'Basic'
group by cards.name
having n > 4
order by n desc, cards.name
"""
if __name__ == '__main__':
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
11748,
45079,
4908,
198,
198,
20034,
5258,
62,
17861,
2625,
15931,
198,
19738,
4116,
13,
3672,
11,
4116,
13,
81,
6806,
11,
2160,
7... | 2.758333 | 120 |
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from typing import TYPE_CHECKING
from harbor import conf
if TYPE_CHECKING:
from sqlalchemy.orm import Session as SqlSession
engine = create_engine(conf.DB_CONNECTION_STRING)
Base ... | [
6738,
44161,
282,
26599,
1330,
2251,
62,
18392,
198,
6738,
44161,
282,
26599,
13,
2302,
13,
32446,
283,
876,
1330,
2377,
283,
876,
62,
8692,
198,
6738,
44161,
282,
26599,
13,
579,
1330,
6246,
10297,
198,
6738,
19720,
1330,
41876,
62,
... | 3.307692 | 104 |
from datetime import date
import pytest
from freezegun import freeze_time
from report_creator import get_pre_month_range
| [
6738,
4818,
8079,
1330,
3128,
198,
198,
11748,
12972,
9288,
198,
6738,
1479,
89,
1533,
403,
1330,
16611,
62,
2435,
198,
198,
6738,
989,
62,
45382,
1330,
651,
62,
3866,
62,
8424,
62,
9521,
628
] | 3.542857 | 35 |
import librosa
import numpy as np
from getlist import get_list
from python_speech_features import mfcc,delta
if __name__ == "__main__":
wavlist, train, test = get_list('new_data')
feats = get_mfcc(wavlist[-1])
print(feats.shape)
| [
11748,
9195,
4951,
64,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
6738,
651,
4868,
1330,
651,
62,
4868,
201,
198,
6738,
21015,
62,
45862,
62,
40890,
1330,
285,
69,
535,
11,
67,
12514,
201,
198,
201,
198,
361,
11593,
3672,
83... | 2.409524 | 105 |
#! -*- coding: utf-8 -*-
# @author: xueyong.zxy
# @date: 2020年02月24日18:07:55
import sys
import requests
import socket
import time
import os
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
handler = logging.StreamHandler(sys.stdout)
handler.setLevel(logging.INFO)
formatter = logging.Formatte... | [
2,
0,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
9800,
25,
2124,
518,
88,
506,
13,
89,
5431,
198,
2,
2488,
4475,
25,
12131,
33176,
112,
2999,
17312,
230,
1731,
33768,
98,
1507,
25,
2998,
25,
2816,
198,
... | 2.285372 | 417 |
"""
0475. Heaters
Winter is coming! Your first job during the contest is to design a standard heater with fixed warm radius to warm all the houses.
Now, you are given positions of houses and heaters on a horizontal line, find out minimum radius of heaters so that all houses could be covered by those heaters.
So, your... | [
37811,
198,
3023,
2425,
13,
679,
8605,
198,
35376,
318,
2406,
0,
3406,
717,
1693,
1141,
262,
8414,
318,
284,
1486,
257,
3210,
39844,
351,
5969,
5814,
16874,
284,
5814,
477,
262,
7777,
13,
198,
198,
3844,
11,
345,
389,
1813,
6116,
28... | 3.713826 | 311 |
#
# Credit model class test file.
#
# @author Matthew Casey
#
# (c) Digital Content Analysis Technology Ltd 2022
#
import json
import pytest
import requests
import requests_mock
from tests.custom_test_case import CustomTestCase
from fusion_platform.common.utilities import json_default
from fusion_platform.models.mod... | [
2,
198,
2,
10504,
2746,
1398,
1332,
2393,
13,
198,
2,
198,
2,
2488,
9800,
9308,
21097,
198,
2,
198,
2,
357,
66,
8,
10231,
14041,
14691,
8987,
12052,
33160,
198,
2,
198,
198,
11748,
33918,
198,
11748,
12972,
9288,
198,
11748,
7007,
... | 2.338346 | 1,862 |
from aou_workbench_client.cohorts import get_cohort_annotations, get_data_table_query
from aou_workbench_client.swagger_client.models.annotation_query import \
AnnotationQuery
from aou_workbench_client.swagger_client.models.cohort_annotations_request import \
CohortAnnotationsRequest
from aou_workbench_client.s... | [
6738,
257,
280,
62,
1818,
26968,
62,
16366,
13,
1073,
71,
2096,
1330,
651,
62,
1073,
71,
419,
62,
34574,
602,
11,
651,
62,
7890,
62,
11487,
62,
22766,
198,
6738,
257,
280,
62,
1818,
26968,
62,
16366,
13,
2032,
7928,
62,
16366,
13,... | 3.614067 | 1,635 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
from... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
1946,
41689,
1628,
20420,
357,
3826,
27342,
9865,
3843,
20673,
13,
9132,
737,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
3826,
38559,
24290,
737,
198,
198,
6738,
1... | 3.457014 | 221 |
#!/usr/bin/env python
#
# Copyright 2016 BloomReach, Inc.
# Copyright 2016 Ronak Kothari <ronak.kothari@gmail.com>.
# 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.or... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
15069,
1584,
11891,
3041,
620,
11,
3457,
13,
198,
2,
15069,
1584,
6575,
461,
509,
849,
2743,
1279,
1313,
461,
13,
74,
849,
2743,
31,
14816,
13,
785,
28401,
198,
198,
2,
... | 2.446269 | 2,010 |
from django.contrib import admin
from broadcasts.models import BroadcastMessage
from broadcasts.forms import BroadcastMessageForm
class BroadcastAdmin(admin.ModelAdmin):
"""Admin class for the broadcast messages"""
form = BroadcastMessageForm
list_display = ('message', 'start_time', 'end_time', 'is_publi... | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
30423,
13,
27530,
1330,
44244,
12837,
198,
6738,
30423,
13,
23914,
1330,
44244,
12837,
8479,
628,
198,
4871,
44244,
46787,
7,
28482,
13,
17633,
46787,
2599,
198,
220,
220,
... | 3.608 | 125 |
# -*- coding: utf-8 -*-
import numpy as np
import tensorflow as tf
import yolo_v4
from PIL import Image, ImageDraw
from utils import load_weights, load_coco_names, detections_boxes, freeze_graph
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_string(
'class_names', 'coco.names', 'File with class names')
tf.app.f... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
331,
14057,
62,
85,
19,
198,
6738,
350,
4146,
1330,
7412,
11,
7412,
25302,
198... | 2.549488 | 293 |
import logging
from sklearn.base import BaseEstimator
from keras.models import Model
from mgc.experiments.base import Evaluator
from mgc.metrics import MetricsLogger
from mgc import audioset
| [
11748,
18931,
198,
6738,
1341,
35720,
13,
8692,
1330,
7308,
22362,
320,
1352,
198,
6738,
41927,
292,
13,
27530,
1330,
9104,
198,
6738,
10527,
66,
13,
23100,
6800,
13,
8692,
1330,
26439,
84,
1352,
198,
6738,
10527,
66,
13,
4164,
10466,
... | 3.446429 | 56 |
import json
from flask import Response
from api.controllers.base_controller import BaseController
| [
11748,
33918,
198,
198,
6738,
42903,
1330,
18261,
198,
198,
6738,
40391,
13,
3642,
36667,
13,
8692,
62,
36500,
1330,
7308,
22130,
628
] | 4.391304 | 23 |
"""
Client and process monitor for the java socket server.
"""
from __future__ import division
import subprocess, tempfile, time, os, logging, re, struct, socket, atexit, \
glob, itertools, codecs
from copy import copy,deepcopy
from pprint import pprint
try:
import ujson as json
except ImportError:
import ... | [
37811,
198,
11792,
290,
1429,
5671,
329,
262,
20129,
17802,
4382,
13,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
11748,
850,
14681,
11,
20218,
7753,
11,
640,
11,
28686,
11,
18931,
11,
302,
11,
2878,
11,
17802,
11,... | 2.572447 | 842 |
__all__ = ('GestureDatabase', 'GestureDatabaseItem')
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import NumericProperty, StringProperty
from kivy.properties import ListProperty, ObjectProperty
from kivy.uix.gridlayout import GridLayout
from kivy.uix.floatlayout import FloatLayout
fr... | [
834,
439,
834,
796,
19203,
38,
395,
495,
38105,
3256,
705,
38,
395,
495,
38105,
7449,
11537,
198,
198,
6738,
479,
452,
88,
13,
15750,
1330,
21328,
198,
6738,
479,
452,
88,
13,
17204,
1330,
35869,
198,
6738,
479,
452,
88,
13,
48310,
... | 3.308642 | 162 |
import matplotlib.pyplot as plt
import pytest
import olanalytics.plotting.setters as lib
| [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
12972,
9288,
198,
198,
11748,
267,
9620,
3400,
14094,
13,
29487,
889,
13,
2617,
1010,
355,
9195,
628,
628
] | 3 | 31 |
# pylint: disable=missing-function-docstring,too-many-arguments
import math
import re
MODIFIER_WORDS = [
'not',
'wasnt',
]
POSITIVE_WORDS = [
'good',
'helpful',
'comfortable',
'pleasant',
'easy',
'excellent',
'friendly',
'fast',
'happy',
'thank',
'nice',
'amazin... | [
2,
279,
2645,
600,
25,
15560,
28,
45688,
12,
8818,
12,
15390,
8841,
11,
18820,
12,
21834,
12,
853,
2886,
198,
198,
11748,
10688,
198,
11748,
302,
198,
198,
33365,
5064,
38311,
62,
45359,
5258,
796,
685,
198,
220,
220,
220,
705,
1662... | 2.179878 | 328 |
# Import Modules
from pathlib import Path
from wordcloud import WordCloud
import matplotlib.pyplot as plt
import pandas as pd
import json
# Initialize
DATA_DIR = Path('')
csv_name = 'pred_camscon.csv'
# Load Label Descriptions to label_descriptions
with open(DATA_DIR / "label_descriptions.json") as f:
label_descr... | [
2,
17267,
3401,
5028,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
1573,
17721,
1330,
9678,
18839,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
33918,
198,
198,
2,
2... | 2.59434 | 636 |
from django.urls import re_path
from ai_solutions import consumer
websocket_urlpatterns = [
re_path(r'ws/solve/(?P<method>\w+)/$', consumer.SolverConsumer.as_asgi()),
] | [
6738,
42625,
14208,
13,
6371,
82,
1330,
302,
62,
6978,
198,
198,
6738,
257,
72,
62,
82,
14191,
1330,
7172,
198,
198,
732,
1443,
5459,
62,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
302,
62,
6978,
7,
81,
6,
18504,
14,
82,
644... | 2.450704 | 71 |
import json
import requests
from tabulate import tabulate
| [
11748,
33918,
198,
11748,
7007,
198,
6738,
7400,
5039,
1330,
7400,
5039,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198
] | 2.730769 | 26 |
import torch.cuda
import psutil
import matplotlib.pyplot as plt
| [
11748,
28034,
13,
66,
15339,
198,
11748,
26692,
22602,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
220,
628,
198
] | 2.913043 | 23 |
from .resources import register_swaggerui_app, StaticSinkAdapter
| [
6738,
764,
37540,
1330,
7881,
62,
2032,
7928,
9019,
62,
1324,
11,
36125,
50,
676,
47307,
198
] | 3.823529 | 17 |
from user import User
import json
| [
6738,
2836,
1330,
11787,
201,
198,
11748,
33918,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198
] | 1.590909 | 44 |
import tensorflow as tf | [
11748,
11192,
273,
11125,
355,
48700
] | 3.833333 | 6 |
from datetime import datetime
from django.conf import settings
from django.urls import reverse
from django.utils.timezone import get_current_timezone
from giscube.models import DBConnection
from layerserver.model_legacy import ModelFactory, create_dblayer_model
from layerserver.models import DataBaseLayer, DataBaseLa... | [
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
6738,
42625,
14208,
13,
26791,
13,
2435,
11340,
1330,
651,
62,
14421,
62,
2435,
11340,
198,... | 3.714286 | 98 |
from datetime import date
# Exercício Python 54: Crie um programa que leia o ano de nascimento de sete pessoas. No final, mostre quantas pessoas ainda não atingiram a maioridade e quantas já são maiores.
atual = date.today()
print(atual)
anoatual = atual.year
count = 0
for i in range(1,8):
data = int(input('Ano de ... | [
6738,
4818,
8079,
1330,
3128,
198,
2,
1475,
2798,
8836,
66,
952,
11361,
7175,
25,
327,
5034,
23781,
1430,
64,
8358,
443,
544,
267,
281,
78,
390,
299,
3372,
3681,
78,
390,
900,
68,
279,
408,
78,
292,
13,
1400,
2457,
11,
749,
260,
... | 2.469945 | 183 |
from .source import Source
from .connector import *
class DoccanoSource(Source,APIConnector):
"""
Connection to DoccanoClient
This code is largely inspired of https://github.com/doccano/doccano-client.git work
"""
def __init__(self, baseurl, username, password):
"""Initialize a Doccano C... | [
6738,
764,
10459,
1330,
8090,
198,
6738,
764,
8443,
273,
1330,
1635,
198,
198,
4871,
14432,
35490,
7416,
7,
7416,
11,
2969,
2149,
261,
1606,
273,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
26923,
284,
14432,
35490,
11792,
62... | 1.872418 | 9,100 |
from django.shortcuts import redirect
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
18941,
198
] | 4.222222 | 9 |
"""Library implementing pooling.
Authors
* Titouan Parcollet 2020
* Mirco Ravanelli 2020
* Nauman Dawalatabad 2020
* Jianyuan Zhong 2020
"""
import torch
import logging
import torch.nn as nn
logger = logging.getLogger(__name__)
class Pooling1d(nn.Module):
"""This function implements 1d pooling of the input... | [
37811,
23377,
15427,
5933,
278,
13,
198,
198,
30515,
669,
198,
1635,
7659,
280,
272,
2547,
4033,
1616,
12131,
198,
1635,
7381,
1073,
371,
12421,
23225,
12131,
198,
1635,
11013,
3778,
17552,
282,
265,
17325,
12131,
198,
1635,
40922,
88,
... | 2.268103 | 2,320 |
# -*- coding: utf-8 -*-
import smtplib
from email.mime.text import MIMEText
from email.header import Header
from email.utils import formatdate
if __name__ == '__main__':
to_address = "xxx@xxx.xxx"
subject = u"メールの件名です"
text = u"メールの本文です"
smtp(subject,text,to_address)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
220,
198,
11748,
895,
83,
489,
571,
198,
6738,
3053,
13,
76,
524,
13,
5239,
1330,
337,
3955,
2767,
2302,
220,
198,
6738,
3053,
13,
25677,
1330,
48900,
198,
6738,
3053,... | 2.195489 | 133 |
import unittest
from pandas.testing import assert_frame_equal
import pandas as pd
from zipline.research import run_pipeline
from zipline.pipeline import Fundamentals
from zipline.pipeline import Pipeline
from zipline.pipeline.filters import StaticSids
from ..utils import select_by_sid
if __name__ == '__main__':
... | [
11748,
555,
715,
395,
198,
6738,
19798,
292,
13,
33407,
1330,
6818,
62,
14535,
62,
40496,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
1976,
24705,
500,
13,
34033,
1330,
1057,
62,
79,
541,
4470,
198,
6738,
1976,
24705,
... | 3.017857 | 112 |
# Copyright 2017 ProjectQ-Framework (www.projectq.ch)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
2,
220,
220,
15069,
2177,
4935,
48,
12,
21055,
6433,
357,
2503,
13,
16302,
80,
13,
354,
8,
198,
2,
198,
2,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
220,
345,
743... | 3.261111 | 360 |
import os
from typing import NewType
import torch
from injector import Injector, Module, inject, provider, singleton
from mcp.config.dataset import Source
from mcp.config.model import ModelArchitecture
from mcp.config.parser import ExperimentConfig
from mcp.context.optimizer import (
OptimizerModule,
Optimize... | [
11748,
28686,
198,
6738,
19720,
1330,
968,
6030,
198,
198,
11748,
28034,
198,
6738,
8677,
273,
1330,
554,
752,
273,
11,
19937,
11,
8677,
11,
10131,
11,
2060,
1122,
198,
198,
6738,
285,
13155,
13,
11250,
13,
19608,
292,
316,
1330,
8090... | 3.099822 | 561 |
from datetime import datetime
current_date_and_time = datetime.now()
print(f'{current_date_and_time:%d-%m-%y}')
model = 'GMC Acadia'
length = 193
width = 75
height = 67
with open('dimensions.txt', 'at') as dimens_file:
print(model, file = dimens_file)
print(f'{length}, {width}, {height}, {current_date_and_... | [
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
14421,
62,
4475,
62,
392,
62,
2435,
796,
4818,
8079,
13,
2197,
3419,
198,
198,
4798,
7,
69,
6,
90,
14421,
62,
4475,
62,
392,
62,
2435,
25,
4,
67,
12,
4,
76,
12,
4,
88,
92,
11537,
... | 2.414966 | 147 |
from selenium import webdriver
import time
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
import traceback
| [
6738,
384,
11925,
1505,
1330,
3992,
26230,
220,
220,
198,
11748,
640,
220,
220,
220,
220,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11284,
13,
9019,
1330,
5313,
32103,
21321,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
... | 3.397059 | 68 |
#!/usr/bin/env python
#A script to test threading concepts/implementations
from __future__ import print_function
import threading,time,sys
#The following used from past bad experience with multithreading in Python
#Define the "thread" class, of which each thread is a instance
#Constructor with 2 arguments
#Act... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
32,
4226,
284,
1332,
4704,
278,
10838,
14,
320,
26908,
602,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
4704,
278,
11,
2435,
11,
17597,
198,
2,
464,
1708,
973,... | 3.726368 | 201 |
from multiprocessing import Process
import subprocess
import os
def start_dev_backend_server():
"""
Start backend server
"""
subprocess.run(["python", "manage.py", "runserver"], check=True)
def start_background_tasks():
"""
Run periodic background tasks
"""
subprocess.run(["python", ... | [
6738,
18540,
305,
919,
278,
1330,
10854,
198,
11748,
850,
14681,
198,
11748,
28686,
628,
198,
4299,
923,
62,
7959,
62,
1891,
437,
62,
15388,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7253,
30203,
4382,
198,
220,
220,
220,
... | 2.743119 | 327 |
{'application':{'type':'Application',
'name':'Template',
'backgrounds': [
{'type':'Background',
'name':'Sudoku',
'title':'Standard Template with full menus',
'size':(565, 647),
'statusBar':1,
'style':['resizeable'],
'menubar': {'type':'MenuBar... | [
90,
6,
31438,
10354,
90,
6,
4906,
10354,
6,
23416,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
3672,
10354,
6,
30800,
3256,
198,
220,
220,
220,
705,
25249,
82,
10354,
685,
198,
220,
220,
220,
1391,
6,
4906,
10354,... | 1.718103 | 12,274 |
# -*- coding: utf-8 -*-
import argparse
import csv
import inspect
import json
import math
from multiprocessing import Pool
from multiprocessing.dummy import Pool as ThreadPool
import os
from pprint import pprint
import sys
import time
# add parent directory to sys path to import relative modules
currentdir = os.path.... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
1822,
29572,
198,
11748,
269,
21370,
198,
11748,
10104,
198,
11748,
33918,
198,
11748,
10688,
198,
6738,
18540,
305,
919,
278,
1330,
19850,
198,
6738,
18540,
3... | 3.03055 | 491 |
windows_mode = False
stdout = -11
try:
import ctypes
from ctypes import LibraryLoader
windll = LibraryLoader(ctypes.WinDLL)
from ctypes import wintypes
windows_mode = True
except (AttributeError, ImportError):
windows_mode = False # Just to be sure, I guess...
if windows_mode:
windows_GetSt... | [
28457,
62,
14171,
796,
10352,
198,
19282,
448,
796,
532,
1157,
198,
28311,
25,
198,
220,
220,
220,
1330,
269,
19199,
198,
220,
220,
220,
422,
269,
19199,
1330,
10074,
17401,
198,
220,
220,
220,
2344,
297,
796,
10074,
17401,
7,
310,
... | 2.494891 | 685 |
from numpy import ones, pi, array, zeros, linspace, cos
from os.path import join
import matplotlib.pyplot as plt
from Tests import save_validation_path as save_path
from pyleecan.Classes.Simu1 import Simu1
from Tests.Validation.Machine.SynRM_001 import SynRM_001
from pyleecan.Classes.InputCurrent import InputCurrent
... | [
6738,
299,
32152,
1330,
3392,
11,
31028,
11,
7177,
11,
1976,
27498,
11,
300,
1040,
10223,
11,
8615,
198,
6738,
28686,
13,
6978,
1330,
4654,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
30307,
1330,
3613,
62... | 1.985859 | 1,980 |
from inquiry.models import Inquiry
from django.contrib import admin
class InqueiryAdmin(admin.ModelAdmin):
"""Customize inquiry for the admin page display"""
list_display = ("id", "name", "car", "created_at")
list_display_links = ("id", "name", "car")
search_fields = ("name",)
list_per_page = 25
... | [
6738,
12069,
13,
27530,
1330,
39138,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
628,
198,
4871,
554,
4188,
9045,
46787,
7,
28482,
13,
17633,
46787,
2599,
198,
220,
220,
220,
37227,
15022,
1096,
12069,
329,
262,
13169,
2443,
33... | 2.897059 | 136 |
import io
import json
import os
import shutil
import subprocess
import urllib.request
from zipfile import ZipFile
temp_path = './files'
output = './assets/models'
pokemon_data_path = './pokemon_data.json'
converters = [{"formatter": convert_from_fbx, "extension": ('.fbx', '.FBX')},
{"formatter": ... | [
11748,
33245,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
850,
14681,
198,
11748,
2956,
297,
571,
13,
25927,
198,
6738,
19974,
7753,
1330,
38636,
8979,
198,
198,
29510,
62,
6978,
796,
705,
19571,
16624,
6,
1... | 2.469697 | 198 |
# Generated by Django 2.1.14 on 2019-11-11 22:48
from django.conf import settings
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
1415,
319,
13130,
12,
1157,
12,
1157,
2534,
25,
2780,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 3.078947 | 38 |
# A class that makes each part of a multipart message "feel" like an
# ordinary file, as long as you use fp.readline(). Allows recursive
# use, for nested multipart messages. Probably best used together
# with module mimetools.
#
# Suggested use:
#
# real_fp = open(...)
# fp = MultiFile(real_fp)
#
# "read some lines ... | [
2,
317,
1398,
326,
1838,
1123,
636,
286,
257,
18540,
433,
3275,
366,
36410,
1,
588,
281,
198,
2,
8850,
2393,
11,
355,
890,
355,
345,
779,
277,
79,
13,
961,
1370,
22446,
220,
40402,
45115,
198,
2,
779,
11,
329,
28376,
18540,
433,
... | 3.019934 | 301 |