content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# -*- coding: utf-8 -*-
"""
@inproceedings{DBLP:conf/nips/SnellSZ17,
author = {Jake Snell and
Kevin Swersky and
Richard S. Zemel},
title = {Prototypical Networks for Few-shot Learning},
booktitle = {Advances in Neural Information Processing Systems 30: Annual Conference
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
31,
259,
1676,
2707,
654,
90,
35,
9148,
47,
25,
10414,
14,
77,
2419,
14,
50,
10076,
50,
57,
1558,
11,
198,
220,
1772,
220,
220,
220,
796,
1391,
43930,
... | 2.460227 | 352 |
import discord, os, platform, asyncio, csv
from discord import channel
from discord.ext import commands
import re
import core.config
from apps.verizon.utils import verizon_csv, OUT_REPORTS
| [
11748,
36446,
11,
28686,
11,
3859,
11,
30351,
952,
11,
269,
21370,
198,
6738,
36446,
1330,
6518,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
11748,
302,
198,
198,
11748,
4755,
13,
11250,
198,
6738,
6725,
13,
332,
8637,
13,
26791,
133... | 3.653846 | 52 |
"""Provides an interface for determining how Python objects are serialized and de-serialized."""
import threading
from amfast import AmFastError
class ClassDefError(AmFastError):
"""ClassDef related errors."""
pass
class ClassDef(object):
"""Defines how objects of a given class are serialized and de-seri... | [
37811,
15946,
1460,
281,
7071,
329,
13213,
703,
11361,
5563,
389,
11389,
1143,
290,
390,
12,
46911,
1143,
526,
15931,
198,
11748,
4704,
278,
198,
198,
6738,
716,
7217,
1330,
1703,
22968,
12331,
198,
198,
4871,
5016,
7469,
12331,
7,
5840... | 2.521291 | 4,556 |
import os
from plot_testcase import plot_testcase
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if __name__ == "__main__":
run_testcase()
| [
11748,
28686,
198,
6738,
7110,
62,
9288,
7442,
1330,
7110,
62,
9288,
7442,
198,
198,
2,
10097,
24305,
198,
198,
2,
10097,
24305,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
628,
220,
220,
220,
1057,
62,
9288,
... | 5.822222 | 45 |
import os
import argparse
from pydub import AudioSegment
from pydub.silence import split_on_silence
if __name__ == "__main__":
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter, description="Split an audio file on silence.")
parser.add_argument('audio_file', help='the audio fi... | [
11748,
28686,
198,
11748,
1822,
29572,
198,
198,
6738,
279,
5173,
549,
1330,
13491,
41030,
434,
198,
6738,
279,
5173,
549,
13,
18217,
594,
1330,
6626,
62,
261,
62,
18217,
594,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
83... | 3.046154 | 260 |
from django import forms
from rest_framework_extras.tests import models
| [
6738,
42625,
14208,
1330,
5107,
198,
198,
6738,
1334,
62,
30604,
62,
2302,
8847,
13,
41989,
1330,
4981,
628,
628
] | 3.8 | 20 |
# Copyright (c) "Neo4j"
# Neo4j Sweden AB [http://neo4j.com]
#
# This file is part of Neo4j.
#
# 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... | [
2,
15069,
357,
66,
8,
366,
8199,
78,
19,
73,
1,
198,
2,
21227,
19,
73,
10710,
9564,
685,
4023,
1378,
710,
78,
19,
73,
13,
785,
60,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
21227,
19,
73,
13,
198,
2,
198,
2,
49962,
739,
26... | 2.459627 | 966 |
import importlib
import pytest
@pytest.fixture
@pytest.fixture
| [
198,
11748,
1330,
8019,
198,
198,
11748,
12972,
9288,
628,
198,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198,
31,
9078,
9288,
13,
69,
9602,
198
] | 2.592593 | 27 |
import logging
from aiosmtpd.smtp import MISSING, SMTP, Session, syntax
from .config import Config
from .handlers import AUTH_REQUIRED
log = logging.getLogger(__name__)
| [
11748,
18931,
201,
198,
201,
198,
6738,
257,
4267,
16762,
30094,
13,
5796,
34788,
1330,
49684,
2751,
11,
9447,
7250,
11,
23575,
11,
15582,
201,
198,
201,
198,
6738,
764,
11250,
1330,
17056,
201,
198,
6738,
764,
4993,
8116,
1330,
37195,
... | 2.746269 | 67 |
nfreq_bands = 7
win_length_sec = 120
stride_sec = 120
n_channels = 16
n_timesteps = (600-win_length_sec)/stride_sec + 1
global_pooling = 1
nkerns = [16, 32, 512]
recept_width = [1, 1]
stride = [1, 1]
pool_width = [1, 1]
n_params = 0
c1_input_width = n_timesteps
print('c1:', nkerns[0], '@', ((n_timeste... | [
77,
19503,
80,
62,
21397,
796,
767,
201,
198,
5404,
62,
13664,
62,
2363,
796,
7982,
201,
198,
2536,
485,
62,
2363,
796,
7982,
201,
198,
77,
62,
354,
8961,
796,
1467,
201,
198,
77,
62,
16514,
395,
25386,
796,
357,
8054,
12,
5404,
... | 2.047826 | 460 |
""" Default configuration and hyperparameter values for dynamics objects. """
# DynamicsPriorGMM
DYN_PRIOR_GMM = {
'min_samples_per_cluster': 20,
'max_clusters': 50,
'max_samples': 20,
'strength': 1.0,
}
| [
37811,
15161,
8398,
290,
8718,
17143,
2357,
3815,
329,
17262,
5563,
13,
37227,
198,
198,
2,
33806,
22442,
38,
12038,
198,
35,
40760,
62,
4805,
41254,
62,
38,
12038,
796,
1391,
198,
220,
220,
220,
705,
1084,
62,
82,
12629,
62,
525,
6... | 2.569767 | 86 |
from floodsystem.stationdata import build_station_list
from floodsystem.geo import stations_by_distance, stations_with_radius, rivers_with_stations, stations_by_river
import itertools
stations = build_station_list()
p = (52.2053, 0.1218) # coords of cambridge
print("closest 10 stations from cambridge: {}".format(sta... | [
6738,
6947,
10057,
13,
17529,
7890,
1330,
1382,
62,
17529,
62,
4868,
198,
6738,
6947,
10057,
13,
469,
78,
1330,
8985,
62,
1525,
62,
30246,
11,
8985,
62,
4480,
62,
42172,
11,
18180,
62,
4480,
62,
301,
602,
11,
8985,
62,
1525,
62,
3... | 3.095238 | 147 |
import matplotlib.pyplot as plt
from ann import attractor_network as AA
from ann import pattern as p
import numpy as np
N = 1024 # Number of neurons
K = 4 # Degree
a = 0.5 # Sparseness
T = 800 # Steps
# Create network with same parameters as above
activity_net = AA.SimpleAttractor(N, K, a, "ring")
print(activity_net... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
1529,
1330,
4729,
273,
62,
27349,
355,
15923,
198,
6738,
1529,
1330,
3912,
355,
279,
198,
11748,
299,
32152,
355,
45941,
198,
198,
45,
796,
28119,
1303,
7913,
286,
16... | 3.01487 | 269 |
'''This program contains the functions averageFinder and midpointFinder. AverageData calculates the averages of the
"columns" of a list of numbers (a list of lists of numbers) for real and fake samples (separately) and midpointFinder
finds the midpoint between the real and fake averages.
Data is either given from the t... | [
7061,
6,
1212,
1430,
4909,
262,
5499,
2811,
37,
5540,
290,
3095,
4122,
37,
5540,
13,
13475,
6601,
43707,
262,
25694,
286,
262,
198,
1,
28665,
82,
1,
286,
257,
1351,
286,
3146,
357,
64,
1351,
286,
8341,
286,
3146,
8,
329,
1103,
290... | 2.753996 | 1,439 |
#! /usr/bin/python3
# @Author: allen
# @Date: Nov 29 11:07 2019
import configparser
import json
import locale
import os
import re
import sys
from collections import OrderedDict
import click
from dialog import Dialog
__author__ = 'Allen Shaw'
__version__ = '0.1.1'
CONFIG = os.path.expanduser('~/.config/gitclk/config/c... | [
2,
0,
1220,
14629,
14,
8800,
14,
29412,
18,
198,
2,
2488,
13838,
25,
477,
268,
198,
2,
2488,
10430,
25,
5267,
2808,
1367,
25,
2998,
13130,
198,
11748,
4566,
48610,
198,
11748,
33918,
198,
11748,
36693,
198,
11748,
28686,
198,
11748,
... | 2.682135 | 431 |
import unittest
from src import validators
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
6738,
12351,
1330,
4938,
2024,
628,
628,
628,
628,
628,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 2.666667 | 39 |
from tvsched.application.models.schedule import EpisodeInSchedule, ShowInSchedule
class ShowAlreadyExistsInScheduleError(Exception):
"""Will be raised when trying to add already existed in schedule show to schedule"""
@property
class ShowOrScheduleNotFoundError(Exception):
"""Will be raised when trying... | [
6738,
31557,
1416,
704,
13,
31438,
13,
27530,
13,
15952,
5950,
1330,
7922,
818,
27054,
5950,
11,
5438,
818,
27054,
5950,
628,
198,
4871,
5438,
37447,
3109,
1023,
818,
27054,
5950,
12331,
7,
16922,
2599,
198,
220,
220,
220,
37227,
8743,
... | 3.629108 | 213 |
import os
from mock import patch
import json
from tests.unit.backend.corpora.api_server.base_api_test import BaseAuthAPITest
| [
11748,
28686,
198,
6738,
15290,
1330,
8529,
198,
11748,
33918,
198,
198,
6738,
5254,
13,
20850,
13,
1891,
437,
13,
10215,
38851,
13,
15042,
62,
15388,
13,
8692,
62,
15042,
62,
9288,
1330,
7308,
30515,
2969,
2043,
395,
628
] | 3.25641 | 39 |
from django.db import models
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
628
] | 3.75 | 8 |
from __future__ import print_function, absolute_import
from qtpy.QtCore import Qt, Slot, QRectF, QPointF
from qtpy.QtGui import QPen, QBrush, QColor
from qtpy.QtWidgets import QGraphicsObject, QGraphicsRectItem, QGraphicsItemGroup, \
QGraphicsSimpleTextItem, QGraphicsEllipseItem, QGraphicsLineItem
from .mapitems ... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
4112,
62,
11748,
198,
198,
6738,
10662,
83,
9078,
13,
48,
83,
14055,
1330,
33734,
11,
32026,
11,
42137,
478,
37,
11,
1195,
12727,
37,
198,
6738,
10662,
83,
9078,
13,
48,
83,
8205,
... | 3.043478 | 138 |
''' show_lisp.py
IOSXE parsers for the following show commands:
* show lisp session
* show lisp platform
* show lisp all extranet <extranet> instance-id <instance_id>
* show lisp all instance-id <instance_id> dynamic-eid detail
* show lisp all service ipv4
* show lisp all service ipv6
* sho... | [
7061,
6,
905,
62,
75,
8802,
13,
9078,
198,
198,
40,
2640,
55,
36,
13544,
364,
329,
262,
1708,
905,
9729,
25,
198,
220,
220,
220,
1635,
905,
300,
8802,
6246,
198,
220,
220,
220,
1635,
905,
300,
8802,
3859,
198,
220,
220,
220,
163... | 1.533033 | 28,214 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.EventInfo import EventInfo
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
2829,
17752,
355,
33918,
198,
198,
6738,
435,
541,
323,
13,
64,
404,
13,
15042,
13,
9979,
415,
13,
22973,
3418... | 2.691176 | 68 |
import copy
class Course:
"""
All information needed to be collected about a course
"""
def __init__(
self,
course_dict=None,
course=None,
):
"""
All None attributes must be provided
Can be constructed as empty, from a dictionary
"""
... | [
11748,
4866,
628,
198,
4871,
20537,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1439,
1321,
2622,
284,
307,
7723,
546,
257,
1781,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
198,
220,
220,
220,
... | 2.354898 | 541 |
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) Dou Du.
# Distributed under the terms of the Modified BSD License.
import pytest
from ..periodic_table import PTableWidget
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
15069,
357,
66,
8,
5728,
10343,
13,
198,
2,
4307,
6169,
739,
262,
2846,
286,
262,
40499,
347,
10305,
13789,
13,
198,
198,
11748,
12972,... | 3.12069 | 58 |
"""Groundtruth saved in XML, saved as compatible format in txt.
Author: Yuhuang Hu
Email : yuhuang.hu@ini.uch.ch
"""
import argparse
import os
import glob
import json
import xmltodict
from v2e_exps.utils import expandpath
parser = argparse.ArgumentParser()
parser.add_argument("--data_root", type=expandpath)
parser... | [
37811,
35539,
35310,
7448,
287,
23735,
11,
7448,
355,
11670,
5794,
287,
256,
742,
13,
198,
198,
13838,
25,
575,
7456,
84,
648,
11256,
198,
15333,
1058,
331,
7456,
84,
648,
13,
13415,
31,
5362,
13,
794,
13,
354,
198,
37811,
198,
198,... | 2.127604 | 768 |
# This code is a part of XMM: Generate and Analyse (XGA), a module designed for the XMM Cluster Survey (XCS).
# Last modified by David J Turner (david.turner@sussex.ac.uk) 08/03/2021, 17:29. Copyright (c) David J Turner
import inspect
from types import FunctionType
# Doing star imports just because its more conveni... | [
2,
220,
770,
2438,
318,
257,
636,
286,
1395,
12038,
25,
2980,
378,
290,
16213,
325,
357,
55,
9273,
828,
257,
8265,
3562,
329,
262,
1395,
12038,
38279,
13084,
357,
55,
7902,
737,
198,
2,
220,
4586,
9518,
416,
3271,
449,
15406,
357,
... | 2.954232 | 1,595 |
from logging import getLogger
from datetime import datetime
from os3_rll.models.challenge import Challenge, ChallengeException
from os3_rll.models.player import Player, PlayerException
from os3_rll.models.db import Database
logger = getLogger(__name__)
def do_challenge_sanity_check(p1, p2, may_already_by_challenged... | [
6738,
18931,
1330,
651,
11187,
1362,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
28686,
18,
62,
81,
297,
13,
27530,
13,
36747,
3540,
1330,
13879,
11,
13879,
16922,
198,
6738,
28686,
18,
62,
81,
297,
13,
27530,
13,
7829,
... | 2.631631 | 2,017 |
# -*- coding: utf-8 -*-
"""SUOD
"""
# Author: Yue Zhao <zhaoy@cmu.edu>
# License: BSD 2 clause
from __future__ import division
from __future__ import print_function
import numpy as np
from sklearn.utils import check_array
from sklearn.utils.validation import check_is_fitted
try:
import suod
except ImportError:
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
12564,
3727,
198,
37811,
198,
2,
6434,
25,
32854,
29436,
1279,
89,
3099,
726,
31,
11215,
84,
13,
15532,
29,
198,
2,
13789,
25,
347,
10305,
362,
13444,
198,
6738... | 2.730462 | 2,879 |
from jiwer import wer
import os
import sys
gt_file = sys.argv[1]
pred_file = sys.argv[2]
with open(gt_file) as f:
gt_lines = f.readlines()
gt_lines = [' '.join(x.strip().split()) for x in gt_lines]
print(len(gt_lines))
with open(pred_file) as f:
pred_lines = f.readlines()
pred_lines = [' '.join(x.strip... | [
6738,
474,
14246,
263,
1330,
266,
263,
628,
628,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
13655,
62,
7753,
796,
25064,
13,
853,
85,
58,
16,
60,
198,
28764,
62,
7753,
220,
796,
25064,
13,
853,
85,
58,
17,
60,
198,
198,
... | 2.361702 | 235 |
from pydantic import BaseModel
| [
6738,
279,
5173,
5109,
1330,
7308,
17633,
198
] | 3.875 | 8 |
import networkx as nx
import numpy as np
import math
import pandas as pd
from networkx.drawing.nx_agraph import graphviz_layout
import matplotlib
from time import gmtime, strftime
import scipy
margFeat=[]
| [
11748,
3127,
87,
355,
299,
87,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
3127,
87,
13,
19334,
278,
13,
77,
87,
62,
6111,
1330,
4823,
85,
528,
62,
39786,
198,
11748,
2603,... | 2.698795 | 83 |
class EstadBoton:
'''Esta clase maneja la configuracion del tablero,
ya sea el valor de las casillas, los colores, y el estado de los botones '''
| [
4871,
10062,
324,
33,
18970,
25,
201,
198,
197,
7061,
6,
22362,
64,
537,
589,
582,
68,
6592,
8591,
4566,
333,
49443,
1619,
7400,
1754,
78,
11,
201,
198,
197,
21349,
5417,
1288,
1188,
273,
390,
39990,
6124,
25314,
11,
22346,
951,
285... | 1.842105 | 114 |
"""
Linear regression objects for panel data
"""
# pylint: disable-msg=W0231
# pylint: disable-msg=E1101,E1103
from __future__ import division
from pandas.compat import range
from pandas import compat
import warnings
import numpy as np
from pandas.core.panel import Panel
from pandas.core.frame import DataFrame
from... | [
37811,
198,
14993,
451,
20683,
5563,
329,
6103,
1366,
198,
37811,
198,
198,
2,
279,
2645,
600,
25,
15560,
12,
19662,
28,
54,
15,
25667,
198,
2,
279,
2645,
600,
25,
15560,
12,
19662,
28,
36,
1157,
486,
11,
36,
11442,
18,
198,
198,
... | 2.089349 | 6,816 |
# Copyright 2020 The HuggingFace Team 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... | [
2,
15069,
12131,
383,
12905,
2667,
32388,
4816,
1439,
2489,
10395,
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... | 2.963415 | 820 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorboard/uploader/proto/server_info.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor a... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
262,
8435,
11876,
17050,
13,
220,
8410,
5626,
48483,
0,
198,
2,
2723,
25,
11192,
273,
3526,
14,
25850,
263,
14,
1676,
1462,
14,
15388,
62,
10951,
... | 2.493224 | 7,822 |
# Exercício Python #051 - Progressão Aritmética
#
# Desenvolva um programa que leia o PRIMEIRO TERMO e a RAZÃO de uma PA. No final, mostre os 10 primeiros termos dessa
# progressão.
#
# OBS: Eu tentei realizar esse exercicio, fiz o codígo mas ele apresentou ERRO DE LÓGICA! Estude mais P.A e
# esse conteudo!
print('\03... | [
2,
1475,
2798,
8836,
66,
952,
11361,
1303,
2713,
16,
532,
18387,
28749,
317,
799,
76,
25125,
3970,
198,
2,
198,
2,
2935,
268,
10396,
6862,
23781,
1430,
64,
8358,
443,
544,
267,
4810,
12789,
43708,
28994,
11770,
304,
257,
17926,
57,
... | 2.101732 | 462 |
import json
import binascii
import uuid
import os
import tempfile
import pathlib
import urllib.error
import urllib.request
import shutil
from flask import current_app as app
from sqlalchemy.orm.attributes import flag_modified
from sqlalchemy import text
import tenacity
import numpy as np
from sqlalchemy.orm.exc import ... | [
11748,
33918,
198,
11748,
9874,
292,
979,
72,
198,
11748,
334,
27112,
198,
11748,
28686,
198,
11748,
20218,
7753,
198,
11748,
3108,
8019,
198,
11748,
2956,
297,
571,
13,
18224,
198,
11748,
2956,
297,
571,
13,
25927,
198,
11748,
4423,
34... | 3.426471 | 136 |
import logging
import pandas as pd
from datetime import timedelta
from ..models import Index, Quote, Quote_CSI300, Ublb_cross, Rsi_predict_report
from ..utils.utils import gen_id
from stockstats import StockDataFrame
logger = logging.getLogger('main.ublb')
pd.set_option('mode.chained_assignment', None)
| [
11748,
18931,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
4818,
8079,
1330,
28805,
12514,
198,
6738,
11485,
27530,
1330,
12901,
11,
19879,
11,
19879,
62,
7902,
40,
6200,
11,
471,
2436,
65,
62,
19692,
11,
12820,
72,
62,
79,
17407,... | 3.177083 | 96 |
__version__ = '0.1.0'
default_app_config = 'wagtailrelevancy.apps.WagtailRelevancyConfig'
| [
834,
9641,
834,
796,
705,
15,
13,
16,
13,
15,
6,
198,
12286,
62,
1324,
62,
11250,
796,
705,
86,
363,
13199,
260,
2768,
3883,
13,
18211,
13,
54,
363,
13199,
3041,
2768,
3883,
16934,
6,
198
] | 2.432432 | 37 |
#
# PySNMP MIB module CISCO-BITS-CLOCK-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-BITS-CLOCK-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:34:03 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (defau... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
36159,
8220,
12,
26094,
50,
12,
5097,
11290,
12,
8895,
33,
357,
4023,
1378,
16184,
76,
489,
8937,
13,
785,
14,
79,
893,
11632,
8,
198,
2,
7054,
45,
13,
16,
2723,
2393,
1378,
14,
144... | 2.544774 | 3,071 |
#!/usr/bin/env python3
"""
Crabada script to send mining all available teams for
the given user.
Usage:
python3 -m bin.mining.sendTeamsMining <userAddress>
Author:
@coccoinomane (Twitter)
"""
from src.bot.mining.sendTeamsMining import sendTeamsMining
from src.helpers.general import secondOrNone
from src.mode... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
13916,
397,
4763,
4226,
284,
3758,
9691,
477,
1695,
3466,
329,
198,
1169,
1813,
2836,
13,
198,
198,
28350,
25,
198,
220,
220,
220,
21015,
18,
532,
76,
9874,
13,
45374... | 2.954315 | 197 |
from . import model as torchTensor
| [
6738,
764,
1330,
2746,
355,
28034,
51,
22854,
198
] | 3.888889 | 9 |
"""event_tweaks
Revision ID: e88bc62b6e4
Revises: 4d3c2b4ceacb
Create Date: 2015-03-17 14:04:09.394924
"""
# revision identifiers, used by Alembic.
revision = 'e88bc62b6e4'
down_revision = '4d3c2b4ceacb'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects i... | [
37811,
15596,
62,
83,
732,
4730,
198,
198,
18009,
1166,
4522,
25,
304,
3459,
15630,
5237,
65,
21,
68,
19,
198,
18009,
2696,
25,
604,
67,
18,
66,
17,
65,
19,
344,
330,
65,
198,
16447,
7536,
25,
1853,
12,
3070,
12,
1558,
1478,
25,... | 2.363636 | 143 |
# -*- coding: utf-8 -*-
import datetime
import decimal
from unittest import TestCase
from jukoro import arrow
from jukoro import json
from jukoro import pg
A = arrow.JuArrow
D = decimal.Decimal
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
4818,
8079,
198,
11748,
32465,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
6738,
474,
2724,
16522,
1330,
15452,
198,
6738,
474,
2724,
16522,
1330,
... | 2.926471 | 68 |
"""Information about the app."""
__version__ = '0.5.0'
__url__ = 'https://github.com/fennekki/cdparacord'
| [
37811,
21918,
546,
262,
598,
526,
15931,
198,
834,
9641,
834,
796,
705,
15,
13,
20,
13,
15,
6,
198,
834,
6371,
834,
796,
705,
5450,
1378,
12567,
13,
785,
14,
69,
29727,
74,
4106,
14,
10210,
1845,
330,
585,
6,
198
] | 2.52381 | 42 |
#!/usr/bin/python
import serial, time, sys, fileinput
#open and configure serial port
ser = serial.Serial(
port='/dev/ttyUSB0',
baudrate=19200,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
timeout = .1
)
#first, clear out 210 buffer
count = 0
while (co... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
11389,
11,
640,
11,
25064,
11,
2393,
15414,
198,
220,
198,
2,
9654,
290,
17425,
11389,
2493,
198,
2655,
796,
11389,
13,
32634,
7,
198,
220,
220,
220,
2493,
11639,
14,
7959,
14,
... | 2.502913 | 515 |
#!/usr/bin/env python3
#coding: utf-8
"""
pythonic way
"""
lst = ['aaabb', 'caca', 'dabc', 'acc', 'abbb']
res = ','.join(lst[1:-1])
print(res)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
66,
7656,
25,
3384,
69,
12,
23,
198,
37811,
198,
29412,
291,
835,
198,
37811,
198,
198,
75,
301,
796,
37250,
7252,
6485,
3256,
705,
66,
22260,
3256,
705,
67,
39305,
3256,
70... | 2.028169 | 71 |
"""A pre-commit hook dependency."""
from __future__ import annotations
from dataclasses import dataclass
from neophile.dependency.base import Dependency
__all__ = ["PreCommitDependency"]
@dataclass(frozen=True, order=True)
class PreCommitDependency(Dependency):
"""Represents a single pre-commit dependency."""... | [
37811,
32,
662,
12,
41509,
8011,
20203,
526,
15931,
198,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
198,
6738,
497,
37161,
13,
45841,
1387,
13,
8692,
1330,
37947,
1387,
198,... | 3.308081 | 198 |
#!/bin/python3
#
# Copyright (c) 2019 Joakim Eriksson
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list o... | [
2,
48443,
8800,
14,
29412,
18,
198,
2,
198,
2,
15069,
357,
66,
8,
13130,
5302,
461,
320,
412,
39370,
1559,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231... | 2.501941 | 1,803 |
from setuptools import setup, find_packages
from setuptools import setup
import os
import re
dependencies = [
'pandas>=0.16.0',
'numpy>=1.9.2',
'scipy>=1.6.0',
'statsmodels>=0.12.2',
'networkx>=2.5',
]
with open(os.path.join(os.path.dirname(__file__), "fixedeffect", "_version.py")) as file:
f... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
11748,
28686,
198,
11748,
302,
628,
198,
45841,
3976,
796,
685,
198,
220,
220,
220,
705,
79,
392,
292,
29,
28,
15,
13,
1433,
13... | 2.394525 | 621 |
import os
import pandas as pd
import matplotlib.pyplot as plt
if os.path.exists("datapoints.csv"):
data = pd.read_csv("datapoints.csv")
else:
print("File does not exist")
dataY = data['y'].copy()
dataX = data['x'].copy()
sumx = sum1(dataX)
sumy = sum1(dataY)
sumxy = sum2(dataX, dataY)
sumxx = sum2(dataX, dataX... | [
11748,
28686,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
361,
28686,
13,
6978,
13,
1069,
1023,
7203,
19608,
499,
1563,
82,
13,
40664,
1,
2599,
198,
220,
220,
220,
1366,
7... | 2.274194 | 186 |
import aspose.slides as slides
| [
11748,
355,
3455,
13,
6649,
1460,
355,
19392,
198
] | 3.444444 | 9 |
"""
Placeholders
"""
# You're writing a program, and you don't know what your starting value for your 'initial' variable is yet. The program won't run if you leave it blank, but you don't want to forget you need it! Make a workaround.
| [
37811,
198,
27271,
10476,
198,
37811,
198,
198,
2,
921,
821,
3597,
257,
1430,
11,
290,
345,
836,
470,
760,
644,
534,
3599,
1988,
329,
534,
705,
36733,
6,
7885,
318,
1865,
13,
383,
1430,
1839,
470,
1057,
611,
345,
2666,
340,
9178,
... | 3.95 | 60 |
import io
import os
import pathlib
import tempfile
from django.core.management import call_command
from django.core.management.base import CommandError
from django.test import TestCase
import oscar
from tests import _site
| [
11748,
33245,
198,
11748,
28686,
198,
11748,
3108,
8019,
198,
11748,
20218,
7753,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
1330,
869,
62,
21812,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
9455,
12331,
198,
6... | 3.75 | 60 |
from ctypes import *
"""
>>> p = parse_log_line('/plogger/ || 50.73.113.242 || - || 21/Mar/2013:13:22:13 +0000 || GET /plogger/?rand=1363872131875&idsite=deadspin.com&url=http%3A%2F%2Fdeadspin.com%2Frecommended&urlref=http%3A%2F%2Fdeadspin.com%2F&screen=1024x768%7C1024x738%7C24&data=%7B%22parsely_uuid%22%3A%22908932B... | [
6738,
269,
19199,
1330,
1635,
198,
198,
37811,
198,
33409,
279,
796,
21136,
62,
6404,
62,
1370,
10786,
14,
489,
519,
1362,
14,
8614,
2026,
13,
4790,
13,
16616,
13,
27877,
8614,
532,
8614,
2310,
14,
7676,
14,
6390,
25,
1485,
25,
1828... | 2.052161 | 1,342 |
import unittest
from typing import List
from decoder import Decoder
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
6738,
19720,
1330,
7343,
198,
6738,
875,
12342,
1330,
34580,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 3.025641 | 39 |
from abc import ABCMeta, abstractmethod
from pydantic import BaseModel
class ServiceInterface(metaclass=ABCMeta):
"""Class representing the service interface."""
@abstractmethod
async def create(self, schema_in: BaseModel):
"""
Create new entity and returns the saved instance.
""... | [
6738,
450,
66,
1330,
9738,
48526,
11,
12531,
24396,
198,
198,
6738,
279,
5173,
5109,
1330,
7308,
17633,
628,
198,
4871,
4809,
39317,
7,
4164,
330,
31172,
28,
24694,
48526,
2599,
198,
220,
220,
220,
37227,
9487,
10200,
262,
2139,
7071,
... | 2.859589 | 292 |
# ---------------------------------------------------------------------------------------------
# Copyright (c) Akash Nag. All rights reserved.
# Licensed under the MIT License. See LICENSE.md in the project root for license information.
# ------------------------------------------------------------------------------... | [
2,
16529,
1783,
32501,
198,
2,
220,
15069,
357,
66,
8,
9084,
1077,
15196,
13,
1439,
2489,
10395,
13,
198,
2,
220,
49962,
739,
262,
17168,
13789,
13,
4091,
38559,
24290,
13,
9132,
287,
262,
1628,
6808,
329,
5964,
1321,
13,
198,
2,
... | 5.030075 | 133 |
from {{cookiecutter.directory_name}} import models
import pytest
| [
6738,
22935,
44453,
8968,
353,
13,
34945,
62,
3672,
11709,
1330,
4981,
198,
11748,
12972,
9288,
198
] | 3.823529 | 17 |
import optparse
from des115.lib.interface import *
| [
11748,
2172,
29572,
198,
198,
6738,
748,
15363,
13,
8019,
13,
39994,
1330,
1635,
628,
628,
198
] | 3.294118 | 17 |
from flask_restplus import Resource
from flask_jwt_extended import jwt_required, get_jwt_identity, get_jwt_claims
from . import api_v1, fqdn_ns, fqdn_m, fqdn_mr
from ..data.fqdns import Fqdns, Fqdn
from ..helpers.helpers import Haproxy
@fqdn_ns.route('', endpoint='fqdn')
@fqdn_ns.response(401, "Token has expired, bad... | [
6738,
42903,
62,
2118,
9541,
1330,
20857,
198,
6738,
42903,
62,
73,
46569,
62,
2302,
1631,
1330,
474,
46569,
62,
35827,
11,
651,
62,
73,
46569,
62,
738,
414,
11,
651,
62,
73,
46569,
62,
6604,
82,
198,
6738,
764,
1330,
40391,
62,
8... | 2.188016 | 2,303 |
from peewee import DoubleField, CompositeKey
from wx.app import database
| [
6738,
613,
413,
1453,
1330,
11198,
15878,
11,
49355,
9218,
198,
198,
6738,
266,
87,
13,
1324,
1330,
6831,
628
] | 3.75 | 20 |
from flask import Flask, redirect,render_template, request
import json
import view_model as vm
app = Flask(__name__)
@app.route("/")
@app.route("/get_price",methods=['POST'])
if __name__ == "__main__":
app.run(debug=True) | [
6738,
42903,
1330,
46947,
11,
18941,
11,
13287,
62,
28243,
11,
2581,
198,
11748,
33918,
198,
11748,
1570,
62,
19849,
355,
45887,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
198,
31,
1324,
13,
38629,
7203,
14,
4943,
198,
1... | 2.72619 | 84 |
"""Add the staff columns to the feature and user tables.
Revision ID: ef3059e0396
Revises: 3bf1c2289e8d
Create Date: 2015-07-30 16:25:14.837823
"""
# revision identifiers, used by Alembic.
revision = 'ef3059e0396'
down_revision = '3bf1c2289e8d'
from alembic import op
import sqlalchemy as sa
| [
37811,
4550,
262,
3085,
15180,
284,
262,
3895,
290,
2836,
8893,
13,
198,
198,
18009,
1166,
4522,
25,
304,
69,
1270,
3270,
68,
15,
34107,
198,
18009,
2696,
25,
513,
19881,
16,
66,
1828,
4531,
68,
23,
67,
198,
16447,
7536,
25,
1853,
... | 2.547009 | 117 |
from unittest.mock import MagicMock
from tda.utils import AccountIdMismatchException, Utils
from tda.utils import UnsuccessfulOrderException
from tda.utils import EnumEnforcer
from .utils import no_duplicates, MockResponse
import enum
import unittest
| [
6738,
555,
715,
395,
13,
76,
735,
1330,
6139,
44,
735,
198,
6738,
256,
6814,
13,
26791,
1330,
10781,
7390,
44,
1042,
963,
16922,
11,
7273,
4487,
198,
6738,
256,
6814,
13,
26791,
1330,
791,
17212,
18743,
16922,
198,
6738,
256,
6814,
... | 3.479452 | 73 |
# -*- test-case-name: twistedcaldav.test.test_extensions -*-
##
# Copyright (c) 2005-2015 Apple Inc. 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... | [
2,
532,
9,
12,
1332,
12,
7442,
12,
3672,
25,
19074,
66,
1940,
615,
13,
9288,
13,
9288,
62,
2302,
5736,
532,
9,
12,
198,
2235,
198,
2,
15069,
357,
66,
8,
5075,
12,
4626,
4196,
3457,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
... | 2.635527 | 3,586 |
from django.conf.urls import url, include
from .views import ProductCreateView, ProductUpdateView, ProductIndexCreateView, upload_images, \
remove_uploaded_image, ProductDeleteView, change_publish_status, upload_images_product_update, \
delete_product_images, add_product_review, ProductListView, update_product... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
11,
2291,
198,
198,
6738,
764,
33571,
1330,
8721,
16447,
7680,
11,
8721,
10260,
7680,
11,
8721,
15732,
16447,
7680,
11,
9516,
62,
17566,
11,
3467,
198,
220,
220,
220,
4781,
62,... | 2.725191 | 524 |
#!/usr/bin/python3
from tornado import web
import random
| [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
6738,
33718,
1330,
3992,
198,
11748,
4738,
198
] | 3.222222 | 18 |
from django.urls import path
from .views import clients, edit_client, edit_client_plan
urlpatterns = [
path('clients', clients, name='clients'),
path('add_client', edit_client, name='add_client'),
path('add_client_plan', edit_client_plan, name='add_client_plan'),
path('edit_client/<id>', edit_client... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
764,
33571,
1330,
7534,
11,
4370,
62,
16366,
11,
4370,
62,
16366,
62,
11578,
198,
198,
6371,
33279,
82,
796,
685,
628,
220,
220,
220,
3108,
10786,
565,
2334,
3256,
7534,
11,
1... | 2.863636 | 176 |
from datetime import datetime
import github.Issue
from gh import HasLabel, AddLabel
from .policy import Policy
StaleIssuePolicy()
| [
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
11748,
33084,
13,
45147,
198,
198,
6738,
24997,
1330,
7875,
33986,
11,
3060,
33986,
198,
6738,
764,
30586,
1330,
7820,
628,
198,
1273,
1000,
45147,
36727,
3419,
198
] | 3.722222 | 36 |
from cogbot.cogs.robo_mod.robo_mod_condition import RoboModCondition
from cogbot.cogs.robo_mod.robo_mod_trigger import RoboModTrigger
| [
6738,
43072,
13645,
13,
66,
18463,
13,
305,
2127,
62,
4666,
13,
305,
2127,
62,
4666,
62,
31448,
1330,
39702,
5841,
48362,
198,
6738,
43072,
13645,
13,
66,
18463,
13,
305,
2127,
62,
4666,
13,
305,
2127,
62,
4666,
62,
46284,
1330,
397... | 2.934783 | 46 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'PLAFile.ui'
#
# Created: Fri Jun 10 09:11:23 2011
# by: PyQt4 UI code generator 4.8.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attribu... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
5178,
7822,
7560,
422,
3555,
334,
72,
2393,
705,
6489,
8579,
576,
13,
9019,
6,
198,
2,
198,
2,
15622,
25,
19480,
7653,
838,
7769,
25,
1157,
25,
1954,
2813,
... | 2.681818 | 154 |
import datetime
import unittest
from .EgyptianNationalId import EgyptianNationalId
VALID_ID = "30103211203135"
if __name__ == "__main__":
unittest.main()
| [
11748,
4818,
8079,
198,
11748,
555,
715,
395,
198,
198,
6738,
764,
39299,
666,
16186,
7390,
1330,
14075,
16186,
7390,
198,
198,
23428,
2389,
62,
2389,
796,
366,
18938,
3070,
2481,
1065,
3070,
17059,
1,
628,
198,
198,
361,
11593,
3672,
... | 2.762712 | 59 |
import numpy as np
import time
from common import get_args,experiment_setup
if __name__=='__main__':
args = get_args()
env, env_test, agent, buffer, learner, tester = experiment_setup(args)
args.logger.summary_init(agent.graph, agent.sess)
# Progress info
args.logger.add_item('Epoch')
args.logger.add_item('Cyc... | [
11748,
299,
32152,
355,
45941,
198,
11748,
640,
198,
6738,
2219,
1330,
651,
62,
22046,
11,
23100,
3681,
62,
40406,
198,
198,
361,
11593,
3672,
834,
855,
6,
834,
12417,
834,
10354,
198,
197,
22046,
796,
651,
62,
22046,
3419,
198,
197,
... | 2.505639 | 532 |
'''
Python code used in APS 2016 Python lecture 5
'''
import h5py
import lecture5_lib
f = h5py.File('writer_1_3.hdf5', 'r')
x = f['/Scan/data/two_theta']
y = f['/Scan/data/counts']
print 'file:', f.filename
print 'peak position:', lecture5_lib.peak_position(x, y)
print 'center-of-mass:', lecture5_lib.center_of_mass(x... | [
7061,
6,
198,
37906,
2438,
973,
287,
3486,
50,
1584,
11361,
19143,
642,
198,
7061,
6,
198,
198,
11748,
289,
20,
9078,
198,
11748,
19143,
20,
62,
8019,
198,
198,
69,
796,
289,
20,
9078,
13,
8979,
10786,
16002,
62,
16,
62,
18,
13,
... | 2.327485 | 171 |
import json
import pytest
import requests
@pytest.mark.parametrize("userid, firstname", [(1,"George"),(2,"Janet")])
| [
11748,
33918,
198,
11748,
12972,
9288,
198,
11748,
7007,
198,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7203,
7220,
312,
11,
717,
3672,
1600,
47527,
16,
553,
20191,
12340,
7,
17,
553,
12128,
316,
4943,
12962,
198
] | 2.853659 | 41 |
__author__ = "ujjwal"
import os
import json
import requests
import urllib
import xmltodict
from priceprobi.utils import get_env
from priceprobi.config import get_config
from priceprobi.db.mongo_helper import MongoHelper
from priceprobi.config import NOMINATIM, CSIS
from priceprobi import logger
if __name__ == "__mai... | [
834,
9800,
834,
796,
366,
23577,
73,
16783,
1,
198,
11748,
28686,
198,
11748,
33918,
198,
11748,
7007,
198,
11748,
2956,
297,
571,
198,
11748,
2124,
76,
2528,
375,
713,
198,
6738,
2756,
1676,
8482,
13,
26791,
1330,
651,
62,
24330,
198... | 2.838323 | 167 |
from django.contrib import admin
from .models import *
admin.site.register(Book)
admin.site.register(Booking)
admin.site.register(Achievement)
admin.site.register(AboutUs)
admin.site.register(Card)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
27530,
1330,
1635,
628,
198,
28482,
13,
15654,
13,
30238,
7,
10482,
8,
198,
28482,
13,
15654,
13,
30238,
7,
10482,
278,
8,
198,
28482,
13,
15654,
13,
30238,
7,
32,
2495... | 3.075758 | 66 |
from rosalind import parse_fasta
from rosalind import translate
from rosalind import transcribe
if(__name__=='__main__'):
main() | [
6738,
686,
21680,
521,
1330,
21136,
62,
7217,
64,
198,
6738,
686,
21680,
521,
1330,
15772,
198,
6738,
686,
21680,
521,
1330,
23589,
4892,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
361,
7,
834,
3672,
834,
855,
6,
834,
12417,
... | 2.711538 | 52 |
#! /usr/bin/env python3
"""Setup script
run "./setup.py --help-commands" for help.
"""
from datetime import datetime
from os.path import abspath, dirname, join
PACKAGE_INFO = dict(
name="compilertools",
description="A library for helping optimizing Python extensions compilation.",
long_description_content... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
40786,
4226,
198,
198,
5143,
366,
19571,
40406,
13,
9078,
1377,
16794,
12,
9503,
1746,
1,
329,
1037,
13,
198,
37811,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
... | 2.538682 | 1,047 |
import os
import h5py
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
def load_h5_data_label(h5_filename):
""" load the data from the hdf5 files """
f = h5py.File(h5_filename)
data = f['data'][:]
labels = f['label'][:]
... | [
11748,
28686,
201,
198,
11748,
289,
20,
9078,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
6738,
285,
489,
62,
25981,
74,
896,
13,
76,
29487,
18,
67,
1330,
121... | 2.016906 | 2,721 |
'''
File: canvas.py
Description:
Implements the custom GlyphyType canvas widget
for drawing characters/glyphs.
'''
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from tools import brush, line | [
7061,
6,
198,
8979,
25,
220,
220,
220,
220,
220,
220,
21978,
13,
9078,
198,
11828,
25,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1846,
1154,
902,
262,
2183,
27949,
6883,
6030,
21978,
26295,
198,
220,
220,
22... | 2.357143 | 98 |
from django.contrib.postgres.fields import ArrayField
from django.db import models
__all__ = (
'Doll',
'Status',
)
| [
6738,
42625,
14208,
13,
3642,
822,
13,
7353,
34239,
13,
25747,
1330,
15690,
15878,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
834,
439,
834,
796,
357,
198,
220,
220,
220,
705,
35,
692,
3256,
198,
220,
220,
220,
705,
19... | 2.625 | 48 |
#!/usr/bin/env python
import argparse
import os
import re
import json
def version_increased(former_version, current_version):
"""Check that version in the package is greater than version_master
and that only one int has increased of 1.
Args:
version_master (str): former version
"""
curr... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
33918,
628,
198,
198,
4299,
2196,
62,
24988,
839,
7,
16354,
62,
9641,
11,
1459,
62,
9641,
2599,
198,
220,
220,
... | 2.951009 | 347 |
import json
import os
from os import path | [
11748,
33918,
198,
11748,
28686,
198,
6738,
28686,
1330,
3108
] | 4.1 | 10 |
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""
from django.contrib import admin
from django.urls import path, include # add this
from testing import views
urlpatterns = [
path('', views.index, name='tester'),
path('/take', views.tester, name='tester1'),
# add thi... | [
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
34156,
25,
17168,
198,
15269,
357,
66,
8,
13130,
532,
1944,
2034,
50,
2308,
13,
385,
198,
37811,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
... | 2.722689 | 119 |
# from django.shortcuts import render
from django.http import HttpResponse
| [
2,
422,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
628
] | 3.666667 | 21 |
from typing import Iterable, Union, List
from pathlib import Path
import json
import torch
import torch.distributed as dist
from torch.utils.data import TensorDataset
class PretrainInputExample:
"""A single example for unsupervised pre-training.
"""
class ClsInputExample:
"""A single example for supervis... | [
6738,
19720,
1330,
40806,
540,
11,
4479,
11,
7343,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
33918,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
17080,
6169,
355,
1233,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
309,
22854,
27... | 3.363636 | 165 |
# Copyright 2016 Mirantis, 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 or agr... | [
2,
15069,
1584,
7381,
20836,
11,
3457,
13,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
220,
220,
407,
779,
428,
2393,
2845,
287,
11846,... | 3.335849 | 265 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
# Copyright (c) 2015-2020 by Rocky Bernstein
# This program 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 2
# of the License, or (at your option) any later version.
#
# This program is di... | [
2,
15069,
357,
66,
8,
1853,
12,
42334,
416,
24534,
37584,
198,
2,
220,
770,
1430,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
340,
290,
14,
273,
198,
2,
220,
13096,
340,
739,
262,
2846,
286,
262,
22961,
3611,
5094,
13789,
198,
2,
... | 2.033301 | 5,165 |
# Generated by Django 3.2.6 on 2021-08-26 14:49
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
21,
319,
33448,
12,
2919,
12,
2075,
1478,
25,
2920,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from gensim.models import word2vec
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-word', required=True,help="word file")
parser.add_argument('-iter', default=3)
parser.add_argument('-sg', default=0)
parser.add_argument('-hs', default=1)
p... | [
198,
6738,
308,
641,
320,
13,
27530,
1330,
1573,
17,
35138,
628,
198,
198,
11748,
1822,
29572,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
628,
220,
220,
220,
30751,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
1... | 2.645933 | 209 |
import json
from azure.core.exceptions import ClientAuthenticationError
from cloudshell.shell.core.resource_driver_interface import ResourceDriverInterface
from cloudshell.shell.core.driver_context import AutoLoadDetails
from cloudshell.shell.core.session.cloudshell_session import CloudShellSessionContext
from cloudsh... | [
11748,
33918,
198,
198,
6738,
35560,
495,
13,
7295,
13,
1069,
11755,
1330,
20985,
47649,
3299,
12331,
198,
6738,
6279,
29149,
13,
29149,
13,
7295,
13,
31092,
62,
26230,
62,
39994,
1330,
20857,
32103,
39317,
198,
6738,
6279,
29149,
13,
2... | 3.876471 | 170 |
from unittest import TestCase
import numpy as np
import unittest
import placentagen
import os
if __name__ == '__main__':
unittest.main()
| [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
555,
715,
395,
198,
11748,
458,
12643,
11286,
198,
11748,
28686,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
... | 2.88 | 50 |
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' ##This is used to suppress the warnings given by tensorflow
import tensorflow as tf
#Comment the above lines if there's an error and the code isn't working as expected
from deepface import DeepFace
import pandas as pd
# Add photos to the photos folder in order to ana... | [
11748,
28686,
198,
418,
13,
268,
2268,
17816,
10234,
62,
8697,
47,
62,
23678,
62,
25294,
62,
2538,
18697,
20520,
796,
705,
18,
6,
22492,
1212,
318,
973,
284,
18175,
262,
14601,
1813,
416,
11192,
273,
11125,
198,
11748,
11192,
273,
111... | 4.128814 | 295 |
"""Basic message."""
from datetime import datetime
from typing import Union
from marshmallow import fields
from ...agent_message import AgentMessage, AgentMessageSchema
from ...util import datetime_now, datetime_to_str
from ...valid import INDY_ISO8601_DATETIME
from ..message_types import FEDERATEDLEARNING_MESSAGE
... | [
37811,
26416,
3275,
526,
15931,
198,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
19720,
1330,
4479,
198,
198,
6738,
22397,
42725,
1330,
7032,
198,
198,
6738,
2644,
25781,
62,
20500,
1330,
15906,
12837,
11,
15906,
12837,
27054,
261... | 2.566265 | 830 |
# Generated by Django 3.1.2 on 2020-11-25 12:47
from django.db import migrations, models
import wagtail.core.fields
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
17,
319,
12131,
12,
1157,
12,
1495,
1105,
25,
2857,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
266,
363,
13199,
13,
7295,
13,
25747,
628
] | 2.878049 | 41 |
# import the necessary packages
from keras.applications import ResNet50
from keras.applications import MobileNet
import matplotlib.pyplot as plt
import numpy as np
import cv2
import dlv
if __name__ == "__main__":
test = np.random.rand(500,300)
cv2.imshow('img',test)
cv2.waitKey(0)
resnet50Model = MobileNet(... | [
2,
1330,
262,
3306,
10392,
198,
6738,
41927,
292,
13,
1324,
677,
602,
1330,
1874,
7934,
1120,
198,
6738,
41927,
292,
13,
1324,
677,
602,
1330,
12173,
7934,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
11748,... | 2.253435 | 655 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: onos/uenib/ran.proto, onos/uenib/uenib.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import AsyncIterator, Dict, List
import betterproto
import grpclib
@dataclass(eq=False, repr=False)
class CellConnection(bette... | [
2,
2980,
515,
416,
262,
8435,
11876,
17050,
13,
220,
8410,
5626,
48483,
0,
198,
2,
4237,
25,
319,
418,
14,
84,
268,
571,
14,
2596,
13,
1676,
1462,
11,
319,
418,
14,
84,
268,
571,
14,
84,
268,
571,
13,
1676,
1462,
198,
2,
13877... | 2.771757 | 609 |