content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import unittest
import qupulse.pulses.plotting
import qupulse._program.waveforms
import qupulse.utils.sympy
from qupulse.pulses import TablePT, FunctionPT, AtomicMultiChannelPT, MappingPT
from qupulse.pulses.plotting import plot
from qupulse.pulses.sequence_pulse_template import SequencePulseTemplate
from qupulse._pro... | [
11748,
555,
715,
395,
198,
198,
11748,
627,
79,
9615,
13,
79,
5753,
274,
13,
29487,
889,
198,
11748,
627,
79,
9615,
13557,
23065,
13,
19204,
23914,
198,
11748,
627,
79,
9615,
13,
26791,
13,
1837,
3149,
88,
198,
6738,
627,
79,
9615,
... | 3.201493 | 134 |
if __name__ == '__main__':
print_rangoli(5)
| [
201,
198,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
201,
198,
220,
220,
220,
3601,
62,
36985,
11106,
7,
20,
8,
201,
198
] | 1.866667 | 30 |
"""The main script for development testing."""
from nes_py.app.cli import main
# execute the main entry point of the CLI
main()
| [
37811,
464,
1388,
4226,
329,
2478,
4856,
526,
15931,
198,
6738,
299,
274,
62,
9078,
13,
1324,
13,
44506,
1330,
1388,
628,
198,
2,
12260,
262,
1388,
5726,
966,
286,
262,
43749,
198,
12417,
3419,
198
] | 3.611111 | 36 |
# https://leetcode.com/problems/closest-binary-search-tree-value
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
| [
2,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
565,
418,
395,
12,
39491,
12,
12947,
12,
21048,
12,
8367,
198,
198,
2,
30396,
329,
257,
13934,
5509,
10139,
13,
198,
2,
1398,
12200,
19667,
25,
198,
2,
220,
220,
220,
... | 2.354545 | 110 |
from django import urls
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import mixins as auth_mixins
from django.contrib.auth.decorators import login_required
from django.contrib.sites.shortcuts import get_current_site
from django.core.mail import send_mail
from django.shor... | [
6738,
42625,
14208,
1330,
2956,
7278,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
6218,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
5022,
1040,
355,
6284,
62,
19816,
1040,
1... | 3.542373 | 236 |
import unittest
from Gatekeeper import Mutator
| [
11748,
555,
715,
395,
198,
6738,
12816,
13884,
1330,
13859,
1352,
628,
198
] | 3.769231 | 13 |
import torch
from torchvision.utils import save_image
| [
11748,
28034,
198,
198,
6738,
28034,
10178,
13,
26791,
1330,
3613,
62,
9060,
628
] | 4 | 14 |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis <michael.aivazis@para-sim.com>
# (c) 1998-2022 all rights reserved
def test():
"""
Verify that classes can intercept registry creation
"""
# access
from pyre.patterns.Unique import Unique
# make a class to serve as a reg... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
285,
40302,
257,
13,
70,
13,
257,
26884,
85,
6557,
89,
271,
1279,
76,
40302,
13,
64,
452,
1031,
... | 2.717868 | 319 |
import asyncio
import json
import os
import cv2
import platform
import sys
from time import sleep
import time
from aiohttp import web
from av import VideoFrame
from aiortc import RTCPeerConnection, RTCSessionDescription, VideoStreamTrack, RTCIceServer, RTCConfiguration
from aiohttp_basicauth import BasicAuthMiddleware
... | [
11748,
30351,
952,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
269,
85,
17,
198,
11748,
3859,
198,
11748,
25064,
198,
6738,
640,
1330,
3993,
198,
11748,
640,
198,
6738,
257,
952,
4023,
1330,
3992,
198,
6738,
1196,
1330,
7623,
1977... | 2.700717 | 1,116 |
from channelsmultiplexer.demultiplexer import AsyncJsonWebsocketDemultiplexer
__all__ = [
AsyncJsonWebsocketDemultiplexer
] | [
6738,
9619,
48101,
87,
263,
13,
9536,
586,
2480,
87,
263,
1330,
1081,
13361,
41,
1559,
1135,
1443,
5459,
11522,
586,
2480,
87,
263,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
1081,
13361,
41,
1559,
1135,
1443,
5459,
1152... | 2.612245 | 49 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/10/22 16:29
# @Author : Coodyz
# @Site : https://github.com/coolbreeze2
# @File : settings.py
# @Software: PyCharm
import os
import sys
basedir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
# SQLite URI compatible
WIN = sys.platfor... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
7575,
220,
220,
220,
1058,
12131,
14,
940,
14,
1828,
1467,
25,
1959,
198,
2,
2488,
13838,
220,
1058,
327,
... | 2.375691 | 181 |
#!/usr/bin/env python
#
# Copyright (C) 2013-2015 Russell Poldrack <poldrack@stanford.edu>
#
# Some portions were borrowed from:
# https://github.com/mwaskom/lyman/blob/master/setup.py
# and:
# https://chriswarrick.com/blog/2014/09/15/python-apps-the-right-way-entry_points-and-scripts/
import os
from setuptools import... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
15069,
357,
34,
8,
2211,
12,
4626,
11563,
350,
727,
39638,
1279,
79,
727,
39638,
31,
14192,
3841,
13,
15532,
29,
198,
2,
198,
2,
2773,
16690,
547,
22546,
422,
25,
198,
... | 2.181189 | 723 |
from __future__ import print_function
import argparse
import json
import os
from datetime import datetime
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.utils.data as data
from model.models import MODELS
from road_dataset import DeepGlobe... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
1822,
29572,
198,
11748,
33918,
198,
11748,
28686,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
28034,
13,... | 2.695652 | 2,162 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plot one example with generated data
"""
from vrmslearn.ModelParameters import ModelParameters
from vrmslearn.SeismicGenerator import SeismicGenerator, mute_direct, random_time_scaling, random_noise, random_static
import argparse
import matplotlib.pyplot as plt
import... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
43328,
530,
1672,
351,
7560,
1366,
198,
37811,
198,
198,
6738,
410,
81,
907,
35720,
13,
17633,
48944,
... | 2.081549 | 2,428 |
#!/usr/bin/env python3
import os
import sys
import argparse
import datetime
import textwrap
import requests
import json
import csv
import urllib
from pprint import pprint
from settings import OMICSDI, OMICSDI_HEADERS, PATHS
DATA = []
def request_url(URL):
"""Request URL and return JSON payload"""
r = requests.g... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
1822,
29572,
198,
11748,
4818,
8079,
198,
11748,
2420,
37150,
198,
11748,
7007,
198,
11748,
33918,
198,
11748,
269,
21370,
198,
11748,... | 2.369465 | 1,513 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 2.911765 | 34 |
# Aminoacidos
AMINOACIDS = {
"AAA": "lisina",
"AAC": "asparagina",
"AGC": "serina"
}
# Codons
CODONS = list(AMINOACIDS.keys()) | [
2,
39869,
78,
46309,
418,
198,
2390,
46016,
2246,
14255,
796,
1391,
198,
220,
220,
220,
366,
29697,
1298,
366,
27999,
1437,
1600,
198,
220,
220,
220,
366,
32,
2246,
1298,
366,
292,
1845,
363,
1437,
1600,
198,
220,
220,
220,
366,
476... | 1.985714 | 70 |
# Copyright (c) 2017 Sony Corporation. 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 applicabl... | [
2,
15069,
357,
66,
8,
2177,
10184,
10501,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351... | 3.349711 | 346 |
import sys
# Whether "import asyncio" works
has_asyncio = (sys.version_info[0] == 3 and sys.version_info[1] >= 4)
# Whether the async and await keywords work
has_async_await = (sys.version_info[0] == 3 and sys.version_info[1] >= 5)
print("conftest.py", has_asyncio, has_async_await)
collect_ignore = []
if not ha... | [
198,
11748,
25064,
198,
198,
2,
10127,
366,
11748,
30351,
952,
1,
2499,
198,
10134,
62,
292,
13361,
952,
796,
357,
17597,
13,
9641,
62,
10951,
58,
15,
60,
6624,
513,
290,
25064,
13,
9641,
62,
10951,
58,
16,
60,
18189,
604,
8,
198,... | 2.620321 | 187 |
from django.db import models
from django.utils import timezone
from sellshop.utils.base_models import BaseModel
from django.utils.translation import ugettext_lazy as _
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
198,
6738,
3677,
24643,
13,
26791,
13,
8692,
62,
27530,
1330,
7308,
17633,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5... | 3.541667 | 48 |
# -*- encoding: utf-8 -*-
#
# Grasso - a FAT filesystem parser
#
# Copyright 2011 Emanuele Aina <em@nerd.ocracy.org>
#
# Released under the term of a MIT-style license, see LICENSE
# for details.
from struct import unpack
| [
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
19062,
78,
532,
257,
47200,
29905,
30751,
198,
2,
198,
2,
15069,
2813,
412,
805,
518,
293,
317,
1437,
1279,
368,
31,
1008,
67,
13,
17818,
13,
2398,
29,
... | 2.896104 | 77 |
from sqlalchemy import create_engine
import logging
logger = logging.getLogger('client.py')
class Client:
"""
Connection to the database.
The current implementation only refers to the PostgreSQL
database, however, this could be easily enhanced to any
database at all, including cloud.
"""
... | [
6738,
44161,
282,
26599,
1330,
2251,
62,
18392,
198,
11748,
18931,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
10786,
16366,
13,
9078,
11537,
628,
198,
4871,
20985,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
26923,
... | 2.680233 | 344 |
# Crie um programa que leia um número real qualquer pelo teclado e mostre na tela a sua porção inteira
# Ex.:
# Digite um número: 6.127
# O número 6.127 tem a parte inteira 6
from math import trunc
num = float(input('Digite um número: '))
print('O número {} tem a parte inteira {}'.format(num, trunc(num)))
'''
-> ou... | [
2,
327,
5034,
23781,
1430,
64,
8358,
443,
544,
23781,
299,
21356,
647,
78,
1103,
4140,
10819,
16176,
78,
573,
565,
4533,
304,
749,
260,
12385,
256,
10304,
257,
424,
64,
16964,
16175,
28749,
493,
68,
8704,
198,
198,
2,
1475,
11207,
1... | 2.433155 | 187 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
33918,
198,
198,
6738,
435,
541,
323,
13,
64,
404,
13,
15042,
13,
9979,
415,
13,
22973,
34184,
1187,
1330,
163... | 2.446809 | 47 |
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from mytravelblog.accounts.models import *
UserModel = get_user_model()
@admin.register(Profile)
admin.site.unregister(UserModel)
@admin.register(UserModel)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
28482,
1330,
11787,
46787,
198,
198,
6738,
616,
35927,
14036,
13,
23317,
82,
13,
27530,
1330,
1635,
198,
198,
12982,
17633,
796,
651,... | 3.126582 | 79 |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Monogramm and contributors
# For license information, please see license.txt
import frappe
from frappe import _
from frappe.model.document import Document
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
12131,
11,
2892,
21857,
76,
290,
20420,
198,
2,
1114,
5964,
1321,
11,
3387,
766,
5964,
13,
14116,
198,
198,
11748,
5306,
27768,
198,
6738,
5306,
... | 3.440678 | 59 |
import numpy as np
import math
# lambda.py, by Tisajokt (james.and.tisa@gmail.com)
# Version 2 (Version 1 was the competition version)
# An OmegaTFT variant (see https://arxiv.org/ftp/cs/papers/0609/0609017.pdf), with improvements:
# - joss detection
# - extortionate ZD detection
# - extra random handling
# - extra a... | [
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
198,
2,
37456,
13,
9078,
11,
416,
309,
271,
1228,
482,
83,
357,
73,
1047,
13,
392,
13,
83,
9160,
31,
14816,
13,
785,
8,
198,
2,
10628,
362,
357,
14815,
352,
373,
262,
5449,
... | 3.213382 | 553 |
# Generated by Django 3.2.4 on 2021-06-26 00:17
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
19,
319,
33448,
12,
3312,
12,
2075,
3571,
25,
1558,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import pandas as pd
from sklearn.model_selection import train_test_split
df = pd.read_csv('imbd/data/imbd_orig.csv')
df = df.rename(columns={'review': 'text', 'sentiment':'label'})
"""Truncating"""
var1 = list(df["text"])
var = []
for i in var1:
if len(i) > 900:
var.append(i[:900])
else:
var... | [
11748,
19798,
292,
355,
279,
67,
220,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
4512,
62,
9288,
62,
35312,
198,
198,
7568,
796,
279,
67,
13,
961,
62,
40664,
10786,
14107,
67,
14,
7890,
14,
14107,
67,
62,
11612,
13,
40664,
... | 2.391304 | 552 |
from django_extensions.tests.utils import UTILS_TESTS
__test__ = {
'UTILS_TESTS': UTILS_TESTS,
}
| [
6738,
42625,
14208,
62,
2302,
5736,
13,
41989,
13,
26791,
1330,
19255,
45484,
62,
51,
1546,
4694,
198,
198,
834,
9288,
834,
796,
1391,
198,
220,
220,
220,
705,
3843,
45484,
62,
51,
1546,
4694,
10354,
19255,
45484,
62,
51,
1546,
4694,
... | 2.217391 | 46 |
instructions = [line.rstrip("\n") for line in open("input", "r")]
valids = []
for instr in instructions:
x = instr.split(" ")
y = [int(z) for z in x if z != '']
if valid(y) == True and y not in valids:
valids.append(y)
print "Valid triangles: ", len(valids)
| [
259,
7249,
507,
796,
685,
1370,
13,
81,
36311,
7203,
59,
77,
4943,
329,
1627,
287,
1280,
7203,
15414,
1600,
366,
81,
4943,
60,
198,
198,
2100,
2340,
796,
17635,
198,
198,
1640,
6480,
287,
7729,
25,
198,
220,
220,
220,
2124,
796,
6... | 2.431034 | 116 |
import numpy as np
from config import cfg
import cv2
from numba import jit
@jit | [
11748,
299,
32152,
355,
45941,
198,
6738,
4566,
1330,
30218,
70,
198,
11748,
269,
85,
17,
198,
6738,
997,
7012,
1330,
474,
270,
198,
31,
45051
] | 3.038462 | 26 |
import socket
#from threading import *
HOST = '10.1.121.102'
PORT = 65432
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.bind((HOST, PORT))
s.listen()
conn, addr = s.accept()
with conn:
print('connected by', addr)
while True:
... | [
11748,
17802,
198,
2,
6738,
4704,
278,
1330,
1635,
198,
198,
39,
10892,
796,
705,
940,
13,
16,
13,
19244,
13,
15377,
6,
198,
15490,
796,
718,
4051,
2624,
198,
198,
4480,
17802,
13,
44971,
7,
44971,
13,
8579,
62,
1268,
2767,
11,
17... | 1.658065 | 310 |
#
# PySNMP MIB module CISCO-POP-MGMT-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-POP-MGMT-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:09:39 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, ... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
36159,
8220,
12,
47,
3185,
12,
20474,
13752,
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.795025 | 26,613 |
# code adapted from https://github.com/google-research/bert
# modification of tokenization.py for GEC
"""Tokenization classes."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import unicodedata
import six
import tensorflow as tf
fro... | [
2,
2438,
16573,
422,
3740,
1378,
12567,
13,
785,
14,
13297,
12,
34033,
14,
4835,
198,
198,
2,
17613,
286,
11241,
1634,
13,
9078,
329,
402,
2943,
198,
198,
37811,
30642,
1634,
6097,
526,
15931,
198,
198,
6738,
11593,
37443,
834,
1330,
... | 2.555497 | 3,820 |
'''
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by more than 1.
Example:
Given the sorted array: [-10,-3,0,5,9],
One poss... | [
7061,
6,
198,
15056,
281,
7177,
810,
4847,
389,
23243,
287,
41988,
1502,
11,
10385,
340,
284,
257,
6001,
12974,
44992,
13,
198,
198,
1890,
428,
1917,
11,
257,
6001,
12,
27753,
13934,
5509,
318,
5447,
355,
257,
13934,
5509,
287,
543,
... | 2.823529 | 221 |
"""
Generic functionality for processing emails from a mail server.
This is used by datahub.interaction.email_processors for creating DIT interactions from
calendar invitations.
"""
from datahub.email_ingestion.mailbox import MailboxHandler
default_app_config = 'datahub.email_ingestion.apps.EmailIngestionConfig'
mai... | [
37811,
198,
46189,
11244,
329,
7587,
7237,
422,
257,
6920,
4382,
13,
198,
198,
1212,
318,
973,
416,
4818,
993,
549,
13,
3849,
2673,
13,
12888,
62,
14681,
669,
329,
4441,
360,
2043,
12213,
422,
198,
9948,
9239,
42851,
13,
198,
37811,
... | 3.555556 | 99 |
import config
import envs
import agents
import stats
if __name__ == '__main__':
config = config.get_config()
demo(config)
| [
11748,
4566,
198,
11748,
551,
14259,
198,
11748,
6554,
198,
11748,
9756,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
4566,
796,
4566,
13,
1136,
62,
11250,
3419,
198,
220,
220,
220,
1360... | 2.891304 | 46 |
# -*- coding: utf-8 -*-
#
# This file is execfile()d with the current directory set to its containing dir.
import re, os, sys, time, cgi
sys.path.append(os.path.abspath(".."))
from get_version import __version__ as hy_version
# Read the Docs might dirty its checkout, so strip the dirty flag.
hy_version = re.sub('[+.]... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
770,
2393,
318,
2452,
7753,
3419,
67,
351,
262,
1459,
8619,
900,
284,
663,
7268,
26672,
13,
198,
198,
11748,
302,
11,
28686,
11,
25064,
11,
640,
11,
269,
... | 2.99434 | 530 |
from enancement_model import ImageEnhancer
import cv2
import numpy
import os
import sys
import tensorflow as tf
a = ImageLoader(image="path/to/your/image")
a.process_images(crop_only_images=True)
| [
6738,
551,
590,
434,
62,
19849,
1330,
7412,
35476,
8250,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
220,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
11192,
273,
11125,
355,
48700,
628,
198,
64,
796,
7412,
17401,
7,
9060,
2... | 3.030303 | 66 |
import numpy as np
import pytest
from forecaster.mr_forecast import load_file
NSAMPLES = 100
@pytest.mark.linearbench
@pytest.mark.linearbench
@pytest.mark.probrbench
@pytest.mark.probrbench | [
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
9288,
198,
6738,
1674,
17970,
13,
43395,
62,
754,
2701,
1330,
3440,
62,
7753,
198,
198,
8035,
2390,
6489,
1546,
796,
1802,
198,
198,
31,
9078,
9288,
13,
4102,
13,
29127,
26968,
198,
19... | 2.708333 | 72 |
# coding:utf-8
u"""テンプレートエンジンの構築を行うモジュール。
テンプレートエンジンを単体で動作させる場合に使うコンビニエンスな関数を提供する。
"""
from caty.template.core.template import Template
from caty.template.core.loader import BytecodeLoader, TextBytecodePersister
def build_template(compiler, resource_io):
u"""Template オブジェクトの構築を行う。
compiler と resource_io はそれぞれ ... | [
2,
19617,
25,
40477,
12,
23,
198,
84,
37811,
24336,
6527,
30965,
24186,
12045,
230,
23544,
45823,
6527,
27032,
100,
233,
163,
107,
231,
31758,
26193,
234,
29557,
40361,
21091,
24440,
43353,
16764,
198,
24336,
6527,
30965,
24186,
12045,
23... | 1.912088 | 273 |
AWS_SECRET_ACCESS_KEY = r'A8+6AN5TSUZ3vysJg68Rt\A9E7duMlfKODwb3ZD8'
| [
198,
12298,
50,
62,
23683,
26087,
62,
26861,
7597,
62,
20373,
796,
374,
6,
32,
23,
10,
21,
1565,
20,
4694,
52,
57,
18,
85,
893,
41,
70,
3104,
49,
83,
59,
32,
24,
36,
22,
646,
44,
1652,
42,
3727,
39346,
18,
57,
35,
23,
6,
1... | 1.4375 | 48 |
'''
Understanding optimization with tf.gradients using linear regression
Author: Steven Spielberg Pon Kumar
'''
import tensorflow as tf
import numpy
import matplotlib.pyplot as plt
rng = numpy.random
# Parameters
learning_rate = 0.01
training_epochs = 1000
display_step = 50
# Training Data
train_X = numpy.asarray(... | [
7061,
6,
198,
43467,
23989,
351,
48700,
13,
9744,
2334,
1262,
14174,
20683,
198,
198,
13838,
25,
8239,
41151,
50210,
26105,
198,
198,
7061,
6,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
198,
11748,
2603,
294... | 2.183333 | 840 |
import sys
import signal
from clint.textui import colored, puts
from downloader import Downloader
from extractor import Extractor
signal.signal(signal.SIGINT, lambda x, y: sys.exit(0))
if __name__ == "__main__":
main()
| [
11748,
25064,
198,
11748,
6737,
198,
6738,
537,
600,
13,
5239,
9019,
1330,
16396,
11,
7584,
198,
6738,
4321,
263,
1330,
10472,
263,
198,
6738,
7925,
273,
1330,
29677,
273,
198,
198,
12683,
282,
13,
12683,
282,
7,
12683,
282,
13,
50,
... | 2.986842 | 76 |
"""Package providing Stylesheet classes."""
import os
from stylesheet.stylesheet_image import (LocalStylesheetImage,
RemoteStylesheetImage,
StoredStylesheetImage,
StylesheetImage)
from stylesheet.... | [
37811,
27813,
4955,
44963,
25473,
6097,
526,
15931,
198,
11748,
28686,
198,
198,
6738,
12186,
25473,
13,
47720,
25473,
62,
9060,
1330,
357,
14565,
18716,
829,
25473,
5159,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.684028 | 288 |
from aws_cdk import (
Stack,
aws_batch_alpha as batch,
aws_ecr as ecr,
aws_ec2 as ec2,
aws_ecs as ecs,
aws_iam as iam,
aws_ssm as ssm,
aws_lambda,
aws_s3_assets as assets,
Fn,
Duration
)
from constructs import Construct
from pathlib import Path
from typing import Dict
... | [
6738,
3253,
82,
62,
10210,
74,
1330,
357,
198,
220,
220,
220,
23881,
11,
198,
220,
220,
220,
3253,
82,
62,
43501,
62,
26591,
355,
15458,
11,
198,
220,
220,
220,
3253,
82,
62,
721,
81,
355,
304,
6098,
11,
198,
220,
220,
220,
3253... | 2.146667 | 150 |
import string
from partial_date import PartialDate
from django.contrib.admin import site
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser
from django.urls import reverse
from django.test import Client, RequestFactory, TestCase
from assignments.tests.factories import... | [
11748,
4731,
198,
198,
6738,
13027,
62,
4475,
1330,
43689,
10430,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
28482,
1330,
2524,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
651,
62,
7220,
62,
19849,
198,
6738,
42625,
... | 2.741737 | 1,301 |
from gilded_rose import GildedRose, Item
| [
6738,
308,
46158,
62,
13698,
1330,
402,
46158,
31087,
11,
9097,
628,
628,
628
] | 3.285714 | 14 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of the Eye Of Characteristics Analyzer.
# Copyright (C) 2019 IBM Deutschland
# Author: Lars Dittert <lars.dittert@de.ibm.com>
#
# This file is the main file to analyze images and predict them.
#
import dlib
import numpy as np
import cv2
import os
imp... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
262,
14144,
3226,
15684,
3969,
16213,
9107,
13,
198,
2,
15069,
357,
34,
8,
131... | 2.738562 | 153 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import cv2
import imageio
from kivy.app import App
from kivy.clock import Clock
from kivy.config import Config
from kivy.core.window import Window
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.dropdo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
269,
85,
17,
198,
11748,
2939,
952,
198,
6738,
479,
452,
88,
13,
1324,
1330,
2034,
198,
6738,
479,
452,
... | 2.147059 | 782 |
__author__ = 'mangalbhaskar'
__version__ = '1.0'
"""
## Description:
# --------------------------------------------------------
# Annotation Parser Interface for Annotation work flow.
# Upload the MS COCO dataset to MongoDB in Annon DB specification
#
# --------------------------------------------------------
# Copyrig... | [
834,
9800,
834,
796,
705,
76,
648,
282,
34369,
2093,
283,
6,
198,
834,
9641,
834,
796,
705,
16,
13,
15,
6,
198,
37811,
198,
2235,
12489,
25,
198,
2,
20368,
22369,
198,
2,
1052,
38983,
23042,
263,
26491,
329,
1052,
38983,
670,
5202... | 2.557887 | 3,861 |
dimensions = int(input())
matrix = read_matrix()
alice_row, alice_col = get_alice_coordinates()
rabbit_row, rabbit_col = get_rabbit_hole_coordinates()
tea_bags = 0
in_wonderland = True
while in_wonderland and tea_bags < 10:
direction = input()
if direction == 'up':
if 0 > alice_row - 1:
... | [
628,
198,
198,
27740,
5736,
796,
493,
7,
15414,
28955,
198,
6759,
8609,
796,
1100,
62,
6759,
8609,
3419,
198,
198,
282,
501,
62,
808,
11,
435,
501,
62,
4033,
796,
651,
62,
282,
501,
62,
37652,
17540,
3419,
198,
81,
14229,
62,
808,... | 1.979213 | 1,347 |
<<<<<<< HEAD
from sklearn.metrics import confusion_matrix
from sklearn.metrics import accuracy_score
from sklearn.metrics import average_precision_score
from sklearn.metrics import roc_auc_score
from sklearn.tree import DecisionTreeClassifier
=======
from sklearn.metrics import confusion_matrix
from sklearn.metrics imp... | [
16791,
16791,
16791,
27,
39837,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
10802,
62,
6759,
8609,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
9922,
62,
26675,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
2811,
62,
3866,
16005,
... | 3.208092 | 173 |
from couchdbkit.ext.django.schema import *
class WisePillDeviceEvent(Document):
"""
One DeviceEvent is created each time a device sends data that is
forwarded to the CommCareHQ WisePill API (/wisepill/device/).
"""
domain = StringProperty()
data = StringProperty()
received_on = DateTimePro... | [
6738,
18507,
9945,
15813,
13,
2302,
13,
28241,
14208,
13,
15952,
2611,
1330,
1635,
198,
198,
4871,
28908,
47,
359,
24728,
9237,
7,
24941,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1881,
16232,
9237,
318,
2727,
1123,
640,
25... | 3.295775 | 142 |
# coding: utf-8
from .pdf import FitzPdfDocument
from .epub import EpubDocument
from .mobi import MobiDocument
from .plain_text import PlainTextDocument
from .html import FileSystemHtmlDocument, WebHtmlDocument
from .markdown import MarkdownDocument
from .word import WordDocument
from .powerpoint import PowerpointPres... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
6738,
764,
12315,
1330,
16703,
47,
7568,
24941,
198,
6738,
764,
538,
549,
1330,
4551,
549,
24941,
198,
6738,
764,
43549,
1330,
337,
13411,
24941,
198,
6738,
764,
25638,
62,
5239,
1330,
28847,
... | 3.770833 | 96 |
"""
Redis Backend
"""
from __future__ import annotations
from typing import Any, Dict, Iterable, Optional, Union, cast
import dill
from redis import ConnectionPool, Redis
from alsek._defaults import DEFAULT_NAMESPACE
from alsek._utils.aggregation import gather_init_params
from alsek._utils.printing import auto... | [
37811,
628,
220,
220,
220,
2297,
271,
5157,
437,
198,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
40806,
540,
11,
32233,
11,
4479,
11,
3350,
198,
198,
11748,
288,
359,
... | 2.272897 | 1,605 |
'''Rocket League data processing.'''
from utils import Car, Ball, BoostPad, a3l, a3r, a3v, orient_matrix, turn_r
def setup(s, p):
"""Sets up the variables and classes for the hivemind.
Arguments:
s {BaseAgent} -- The hivemind bot helper process.
p {GameTickPacket} -- Information about the... | [
7061,
6,
50218,
4041,
1366,
7587,
2637,
7061,
198,
198,
6738,
3384,
4487,
1330,
1879,
11,
6932,
11,
19835,
26114,
11,
257,
18,
75,
11,
257,
18,
81,
11,
257,
18,
85,
11,
11367,
62,
6759,
8609,
11,
1210,
62,
81,
198,
198,
4299,
90... | 2.102427 | 2,060 |
#!/usr/bin/env python
'''Provides a common logging set up for all scripts'''
#===============================================================================
# Import modules
#===============================================================================
import logging
import logging.handlers
import time
#=======... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
7061,
6,
15946,
1460,
257,
2219,
18931,
900,
510,
329,
477,
14750,
7061,
6,
628,
198,
2,
23926,
25609,
18604,
198,
2,
17267,
13103,
198,
2,
23926,
25609,
18604,
198,
11748,
18931,... | 7.313433 | 67 |
UDP_THIS = "0.0.0.0", 5225
#UDP_OTHER = "127.0.0.1", 5005
UDP_OTHER = "192.168.4.1", 5005
import socket
sock = socket.socket(socket.AF_INET,
socket.SOCK_DGRAM)
sock.setblocking(False)
sock.bind(UDP_THIS)
sock_iterator = sock_generator()
| [
52,
6322,
62,
43559,
796,
366,
15,
13,
15,
13,
15,
13,
15,
1600,
6740,
1495,
198,
2,
52,
6322,
62,
31858,
796,
366,
16799,
13,
15,
13,
15,
13,
16,
1600,
5323,
20,
198,
52,
6322,
62,
31858,
796,
366,
17477,
13,
14656,
13,
19,
... | 1.947761 | 134 |
import config
from digitalio import DigitalInOut, Direction, Pull
| [
11748,
4566,
198,
198,
6738,
4875,
952,
1330,
10231,
818,
7975,
11,
41837,
11,
21429,
628
] | 4.25 | 16 |
import inspect
import warnings
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union, get_type_hints
from pydantic import BaseModel
from pydantic.fields import Undefined
from typing_extensions import TypedDict
from pait.field import BaseField, Depends
from pait.model.core import PaitCoreMode... | [
11748,
10104,
198,
11748,
14601,
198,
6738,
19720,
1330,
4377,
11,
4889,
540,
11,
360,
713,
11,
7343,
11,
32233,
11,
5345,
11,
309,
29291,
11,
5994,
11,
4479,
11,
651,
62,
4906,
62,
71,
29503,
198,
198,
6738,
279,
5173,
5109,
1330,
... | 3.147436 | 156 |
# -*- coding: utf-8 -*-
"""Tests for processing.caching.retrieving module."""
from itertools import product
from nose.tools import assert_equal, assert_true
import numpy as np
from os.path import expanduser
import pandas as pd
from pybliometrics.scopus import ScopusSearch, AuthorSearch
from pandas.testing import asse... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
51,
3558,
329,
7587,
13,
66,
8103,
13,
1186,
37418,
8265,
526,
15931,
198,
198,
6738,
340,
861,
10141,
1330,
1720,
198,
6738,
9686,
13,
31391,
1330,
6818,
62,
4... | 3.151961 | 204 |
import theano
import theano.tensor as T
from project3.module6.deeplearning.layer import HiddenLayer
| [
11748,
262,
5733,
198,
11748,
262,
5733,
13,
83,
22854,
355,
309,
198,
198,
6738,
1628,
18,
13,
21412,
21,
13,
22089,
40684,
13,
29289,
1330,
20458,
49925,
198
] | 3.482759 | 29 |
# ========== Status Bar ===========
from tkinter import *
root = Tk()
root.geometry('500x300')
root.title('status bar')
statusvar = StringVar()
statusvar.set('Ready') # first setting statusbar as ready
sbar = Label(root, textvariable=statusvar, relief=RIDGE, anchor='w')
sbar.pack(side=BOTTOM, fill=X)
Butto... | [
2,
796,
2559,
28,
12678,
2409,
796,
2559,
855,
198,
6738,
256,
74,
3849,
1330,
1635,
198,
15763,
796,
309,
74,
3419,
198,
15763,
13,
469,
15748,
10786,
4059,
87,
6200,
11537,
198,
15763,
13,
7839,
10786,
13376,
2318,
11537,
198,
198,
... | 2.775362 | 138 |
import frappe
from datetime import date, datetime
class PrintFormat:
"""
Print format class
"""
def sic_attendance_absent_present(self, doc):
"""
Print format for absent/present in sales invoice
for Contracts
"""
# print format
template, context = sic_at... | [
11748,
5306,
27768,
198,
6738,
4818,
8079,
1330,
3128,
11,
4818,
8079,
198,
198,
4871,
12578,
26227,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
12578,
5794,
1398,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
264,
291,
... | 2.286765 | 408 |
#!/usr/bin/python3
# Copyright (c) 2021-2022 by Fred Morris Tacoma WA
#
# 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,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
15069,
357,
66,
8,
33448,
12,
1238,
1828,
416,
8559,
14433,
45132,
16400,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
... | 2.121586 | 7,945 |
#imports
#global variables
#classes
from tkinter import N
#functions
#main code
| [
198,
2,
320,
3742,
198,
2,
20541,
9633,
198,
2,
37724,
628,
198,
198,
6738,
256,
74,
3849,
1330,
399,
628,
220,
220,
220,
220,
198,
2,
12543,
2733,
198,
2,
12417,
2438,
628,
628,
628
] | 2.638889 | 36 |
TITLE_TEXT_SIZE=30
NEXT_TRAIN_TEXT_SIZE=36
GREEN="#3ab54a"
TRANSIT_API_ENDPOINT="https://www.mbta.com" | [
49560,
2538,
62,
32541,
62,
33489,
28,
1270,
198,
45,
13918,
62,
51,
3861,
1268,
62,
32541,
62,
33489,
28,
2623,
198,
43016,
25698,
18,
397,
4051,
64,
1,
198,
5446,
15037,
2043,
62,
17614,
62,
1677,
6322,
46,
12394,
2625,
5450,
1378... | 2.04 | 50 |
'''
Created on 17 May 2021
@author: julianporter
'''
from .numeric import HexConverter,IntConverter
from .text import String8Converter,String16Converter
HEXConv = HexConverter()
BYTEConv = IntConverter(1)
WORDConv = IntConverter(2)
DWORDConv = IntConverter(4)
STR8Conv = String8Converter()
STR16Conv = String16... | [
7061,
6,
198,
41972,
319,
1596,
1737,
33448,
198,
198,
31,
9800,
25,
474,
377,
666,
26634,
198,
7061,
6,
198,
198,
6738,
764,
77,
39223,
1330,
22212,
3103,
332,
353,
11,
5317,
3103,
332,
353,
220,
198,
6738,
764,
5239,
1330,
10903,
... | 2.459259 | 135 |
import slither
i = 0
slither.setup("")
slither.runMainLoop(run_a_frame)
| [
11748,
1017,
1555,
198,
198,
72,
796,
657,
198,
198,
6649,
1555,
13,
40406,
7203,
4943,
198,
198,
6649,
1555,
13,
5143,
13383,
39516,
7,
5143,
62,
64,
62,
14535,
8,
198
] | 2.34375 | 32 |
from fractions import Fraction
import matplotlib.pyplot as plt
import mpltern
import pandas as pd
import numpy as np
if __name__ == "__main__":
df_path = '/Users/simons/PycharmProjects/MT-VAEs-TDA/output/eval/WCAE/metrics_selected_processed.csv'
# get df with cols: eval metrics (tbd), uid, k, bs, mu_push
... | [
6738,
49876,
1330,
376,
7861,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
285,
489,
759,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
198,
361,
11593,
3672,
834,
662... | 1.980427 | 1,124 |
default_app_config = "liked.app.LikedAppConfig"
| [
12286,
62,
1324,
62,
11250,
796,
366,
75,
17951,
13,
1324,
13,
43,
17951,
4677,
16934,
1,
198
] | 2.666667 | 18 |
from django.urls import path
from leads.views import (
LeadListView,
LeadDetailView,
LeadDeleteView,
LeadCreateView,
LeadUpdateView,
lead_delete, lead_list, lead_detail, lead_create, lead_update
)
app_name = "leads"
urlpatterns = [
path('', LeadListView.as_view(), name='lead-list'),
pa... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
5983,
13,
33571,
1330,
357,
198,
220,
220,
220,
20116,
8053,
7680,
11,
198,
220,
220,
220,
20116,
11242,
603,
7680,
11,
198,
220,
220,
220,
20116,
38727,
7680,
11,
198,
220,
2... | 2.587983 | 233 |
#!/usr/bin/python3
# vim: ts=4 expandtab
from __future__ import annotations
from typing import Optional, Set, TextIO
from os.path import exists as path_exists
from .datastore import DataStore, RaiseType
class FileStore(DataStore):
"""A datastore of names of people who can save Eorzea, written to a file
wit... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
43907,
25,
40379,
28,
19,
4292,
8658,
198,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
19720,
1330,
32233,
11,
5345,
11,
8255,
9399,
198,
6738,
28686,
13,
6978,
1330,
... | 2.772532 | 466 |
import os
import matplotlib.pyplot as plot
import numpy as np
from sklearn import decomposition
from sklearn.svm import SVC
from analysis import DocumentAnalysis, WordIterator
from utils import list_files, PROJECT_PATH
WORD2VEC_ANALYSER = DocumentAnalysis(model_file_name=os.path.join(PROJECT_PATH, "models", "all.mod... | [
11748,
28686,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
7110,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
1330,
26969,
9150,
198,
6738,
1341,
35720,
13,
82,
14761,
1330,
311,
15922,
198,
198,
6738,
3781,
... | 2.433084 | 1,741 |
# Python does not have a random() function to make a random number,
# but Python has a built-in module called random that can be used to make random numbers:
import random
print(random.randrange(1, 10))
| [
2,
11361,
857,
407,
423,
257,
4738,
3419,
2163,
284,
787,
257,
4738,
1271,
11,
198,
2,
475,
11361,
468,
257,
3170,
12,
259,
8265,
1444,
4738,
326,
460,
307,
973,
284,
787,
4738,
3146,
25,
198,
198,
11748,
4738,
198,
198,
4798,
7,
... | 3.796296 | 54 |
"""
Classes for Repo providers
Subclass the base class, ``RepoProvider``, to support different version
control services and providers.
"""
from datetime import timedelta
import json
import os
import time
from prometheus_client import Gauge
from tornado import gen
from tornado.httpclient import AsyncHTTPClient, HTTP... | [
37811,
198,
9487,
274,
329,
1432,
78,
9549,
198,
198,
7004,
4871,
262,
2779,
1398,
11,
7559,
6207,
78,
29495,
15506,
11,
284,
1104,
1180,
2196,
198,
13716,
2594,
290,
9549,
13,
198,
198,
37811,
198,
6738,
4818,
8079,
1330,
28805,
1251... | 2.754923 | 914 |
import os
from django.conf import settings
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
from shop.models import Product
from shop.models import ProductGroup
from .helper import create_user
from .helper impor... | [
11748,
28686,
201,
198,
201,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
201,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
201,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
201,
198,
201,
198,
6738,
1334,
62,
30604,
... | 3.378378 | 111 |
# They are actually grouped into three
# list comprehension
# Set Comprehension
# dictionary compresension
# They are aquick way for creating list or sets or dictionsary instead of looping or appending to a bunch of list
# format [param for param in "list"]
# add all letters in a string
# using comprehension to ge... | [
2,
1119,
389,
1682,
32824,
656,
1115,
198,
2,
1351,
35915,
198,
2,
5345,
3082,
7345,
295,
198,
2,
22155,
552,
411,
3004,
628,
198,
2,
1119,
389,
14839,
624,
835,
329,
4441,
1351,
393,
5621,
393,
8633,
507,
560,
2427,
286,
9052,
27... | 3.440367 | 218 |
# -*- coding: utf-8 -*-
""" Views for the notifications application. """
# standard library
# django
from django.views.generic.base import TemplateView
# models
from .models import Notification
# views
from base.views import BaseListView
# forms
class NotificationListView(BaseListView):
"""
View for displ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
29978,
329,
262,
19605,
3586,
13,
37227,
198,
2,
3210,
5888,
198,
198,
2,
42625,
14208,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
13,
8692,
1330,
37350,
7680... | 3.25 | 140 |
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
from keras.models import Sequential
from keras.utils import to_categorical
from keras.layers import Dense, Dropout, Activation, Flatten, BatchNormalization
from keras.layers import Conv2D, MaxPooling2D
from keras.optimizers import Adam
... | [
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
13,
1069,
12629,
13,
83,
44917,
82,
13,
10295,
396,
1330,
5128,
62,
7890,
198,
198,
6738,
41927,
292,
13,
27530,
1330,
24604,
1843,
198,
6738,
41927,
292,
13,
26791,
... | 2.714789 | 852 |
# @Author: Manish Bhattarai, Erik Skau
from .utils import *
class custom_clustering():
r"""
Greedy algorithm to approximate a quadratic assignment problem to cluster vectors. Given p groups of k vectors, construct k clusters, each cluster containing a single vector from each of the p groups. This clustering a... | [
2,
2488,
13838,
25,
1869,
680,
347,
11653,
283,
1872,
11,
22722,
3661,
559,
198,
6738,
764,
26791,
1330,
1635,
628,
198,
4871,
2183,
62,
565,
436,
1586,
33529,
198,
220,
220,
220,
374,
37811,
198,
220,
220,
220,
11955,
4716,
11862,
... | 2.10124 | 3,467 |
# -*- coding: utf-8 -*-
from celery_app import app
@app.task
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
18725,
1924,
62,
1324,
1330,
598,
628,
198,
31,
1324,
13,
35943,
198
] | 2.25 | 28 |
import logging
from ..account.clients import IAccountClient
from ..deals.models import DealRequest, DealResult
from ..orders.manual.clients import IManualOrderClient
from ..orders.market.clients import IMarketOrderClient
from ..orders.market.errors import MarketClosedError, MarketOrderLiveQuoteError
from ..orders.mode... | [
11748,
18931,
198,
198,
6738,
11485,
23317,
13,
565,
2334,
1330,
314,
30116,
11792,
198,
6738,
11485,
14302,
13,
27530,
1330,
15138,
18453,
11,
15138,
23004,
198,
6738,
11485,
6361,
13,
805,
723,
13,
565,
2334,
1330,
314,
5124,
723,
187... | 3.912409 | 137 |
# -*- coding: utf-8 -*-
# Copyright (c) 2013-2018 Will Thames <will@thames.id.au>
# Copyright (c) 2018 Ansible by Red Hat
# Modified work Copyright (c) 2019 Jeffrey Bouter
import unittest
from saltlint.linter import RulesCollection
from saltlint.rules.JinjaPillarGrainsGetFormatRule import JinjaPillarGrainsGetFormatRu... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
2211,
12,
7908,
2561,
42521,
1279,
10594,
31,
400,
1047,
13,
312,
13,
559,
29,
198,
2,
15069,
357,
66,
8,
2864,
28038,
856,
416,
2297,
10983,
... | 2.623053 | 321 |
from crispy_forms.bootstrap import (Accordion, AccordionGroup, FieldWithButtons,
StrictButton, Tab)
from crispy_forms.layout import Field, HTML, Layout, Submit
from crispy_forms.helper import FormHelper
from django.utils.translation import ugettext_lazy as _
from haystack.forms imp... | [
198,
198,
6738,
42807,
62,
23914,
13,
18769,
26418,
1330,
357,
17320,
585,
295,
11,
46562,
295,
13247,
11,
7663,
3152,
1537,
27288,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.841667 | 120 |
import cv2 | [
11748,
269,
85,
17
] | 2.5 | 4 |
# AVL Mode Package
# Released under MIT License
# Copyright (c) 2020 TytusDb Team
# Developers: SG#16
import os
from storage.AVL.DataAccessLayer.handler import Handler
from storage.AVL.DataAccessLayer.tree_graph import TreeGraph
| [
2,
14661,
43,
10363,
15717,
198,
2,
28728,
739,
17168,
13789,
198,
2,
15069,
357,
66,
8,
12131,
7039,
83,
385,
43832,
4816,
198,
2,
34152,
25,
26147,
2,
1433,
628,
198,
11748,
28686,
198,
6738,
6143,
13,
10116,
43,
13,
6601,
15457,
... | 3.455882 | 68 |
import testing_constants as global_settings
# from . import settings as global_settings
#
# class Settings:
#
# def __init__(self):
# for setting in dir(global_settings):
# if setting.isupper():
# setattr(self, setting, getattr(global_settings, setting))
#
# def __setattr__(self, attr, value)... | [
11748,
4856,
62,
9979,
1187,
355,
3298,
62,
33692,
628,
198,
198,
2,
422,
764,
1330,
6460,
355,
3298,
62,
33692,
198,
2,
198,
2,
1398,
16163,
25,
198,
2,
198,
2,
825,
11593,
15003,
834,
7,
944,
2599,
198,
2,
220,
220,
220,
220,
... | 2.672727 | 330 |
import subprocess
import os
import sys
import psutil
import datetime
def check_dependencies():
"""Checks for dependencies
Mandatory dependencies are - mysqldump,mysqlshow,find,mkdir
Non-mandatory - gzip"""
try:
if subprocess.call('/usr/bin/mysqldump > /dev/null 2>&1', shell=True) == 127... | [
11748,
850,
14681,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
26692,
22602,
198,
11748,
4818,
8079,
628,
198,
4299,
2198,
62,
45841,
3976,
33529,
198,
220,
220,
220,
37227,
7376,
4657,
329,
20086,
198,
220,
220,
220,
220,
220,
22... | 2.014443 | 1,731 |
from django import forms
| [
6738,
42625,
14208,
1330,
5107,
628
] | 4.333333 | 6 |
from django.contrib import admin
from .models import memeData
# Register your models here.
@admin.register(memeData)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
27530,
1330,
25336,
6601,
198,
198,
2,
17296,
534,
4981,
994,
13,
198,
198,
31,
28482,
13,
30238,
7,
11883,
68,
6601,
8,
198,
220,
220,
220,
220
] | 3.153846 | 39 |
import datetime
import flask
import logging
from flask import Flask, jsonify
import requests
from flask_session import Session
from flask_pyoidc import OIDCAuthentication
from flask_pyoidc.provider_configuration import ProviderConfiguration, ClientMetadata
from flask_pyoidc.user_session import UserSession
app = Flas... | [
11748,
4818,
8079,
198,
11748,
42903,
198,
11748,
18931,
198,
6738,
42903,
1330,
46947,
11,
33918,
1958,
198,
11748,
7007,
198,
198,
6738,
42903,
62,
29891,
1330,
23575,
198,
198,
6738,
42903,
62,
9078,
1868,
66,
1330,
440,
2389,
8141,
... | 2.53286 | 563 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
11,
15720,
602,
198,
6738,
42625,
14208,
13,
10414,
1330,
... | 3.111111 | 45 |
# 章节列表
# 序列化 ...
# 章节序列化
# 章节反序列化
| [
2,
13328,
104,
254,
164,
232,
224,
26344,
245,
26193,
101,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
2,
10263,
118,
237,
26344,
245,
44293,
244,
2644,
201,
198,
201,
198,
201,
198,
2,
13328,
104,
254,
164,
232,
224,
41753,... | 0.75 | 72 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 25 08:41:10 2017
@author: Yann Roussel and Tuan Bui
Edited by: Emine Topcu on Sep 2021
"""
from Single_coiling_model import Single_coil_base
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
19480,
2447,
1679,
8487,
25,
3901,
25,
940,
2177,
198,
198,
31,
9800,
25,
575,
1236,
371,... | 2.597561 | 82 |
# -*- coding:utf-8 -*-
"""
发送邮件
"""
import email
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
if __name__ == "__main__":
test()
| [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
20998,
239,
34460,
223,
165,
224,
106,
20015,
114,
198,
37811,
198,
198,
11748,
3053,
198,
11748,
895,
83,
489,
571,
198,
6738,
3053,
13,
76,
524,
13,
52... | 2.206897 | 87 |
import pytest
from bugs.cisco import CSCvg76186
from devices.cisco import CiscoIOS
unaffected_output1 = "Role: Client (SmartInstall Disabled)"
unaffected_output2 = "Capability: Client\nOper Mode: Disabled\nRole: NA"
affected_output1 = "Role: Client (SmartInstall enabled)"
affected_output2 = "Capability: Client\nOper... | [
11748,
12972,
9288,
198,
198,
6738,
11316,
13,
66,
4861,
1330,
327,
6173,
45119,
4304,
25096,
198,
6738,
4410,
13,
66,
4861,
1330,
28289,
40,
2640,
198,
198,
403,
43958,
62,
22915,
16,
796,
366,
47445,
25,
20985,
357,
25610,
15798,
43... | 3.217391 | 138 |
import pamela
from jupyterhub.auth import PAMAuthenticator
from jupyterhub.handlers.login import LoginHandler
from tornado.concurrent import run_on_executor
from tornado.escape import url_escape
from tornado.httputil import url_concat
| [
11748,
279,
321,
10304,
198,
198,
6738,
474,
929,
88,
353,
40140,
13,
18439,
1330,
350,
2390,
47649,
26407,
198,
6738,
474,
929,
88,
353,
40140,
13,
4993,
8116,
13,
38235,
1330,
23093,
25060,
198,
6738,
33718,
13,
1102,
14421,
1330,
1... | 3.42029 | 69 |