content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
SEAL_CHECKER = 9300535
SEAL_OF_TIME = 2159367
if not sm.hasQuest(25672):
sm.createQuestWithQRValue(25672, "1")
sm.showFieldEffect("lightning/screenMsg/6", 0) | [
5188,
1847,
62,
50084,
1137,
796,
860,
6200,
44465,
198,
5188,
1847,
62,
19238,
62,
34694,
796,
362,
19707,
27824,
198,
198,
361,
407,
895,
13,
10134,
12166,
7,
1495,
43864,
2599,
198,
220,
220,
220,
895,
13,
17953,
12166,
3152,
48,
... | 2.338028 | 71 |
import discord #Libreria de discord
client = discord.Client()
# Evento que se llama cuando el bot inicia sesión
@client.event
# Evento que se llama cuando se recibe un mensaje
@client.event
client.run("Tu token aqui") | [
11748,
36446,
1303,
25835,
260,
7496,
390,
36446,
198,
198,
16366,
796,
36446,
13,
11792,
3419,
198,
198,
2,
8558,
78,
8358,
384,
32660,
1689,
18912,
25440,
1288,
10214,
287,
33577,
264,
46551,
18840,
198,
31,
16366,
13,
15596,
198,
198... | 2.986486 | 74 |
# Divisas
if __name__ == '__main__':
run() | [
2,
4777,
271,
292,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1057,
3419
] | 2.130435 | 23 |
# __author__ = 'WeiFu'
from __future__ import print_function, division
import sys, pdb, random
from ruler import *
from Abcd import *
import numpy as np
import matplotlib.pyplot as plt
from sklearn.tree import DecisionTreeRegressor
from tuner import *
from processarff import *
from sk import rdivDemo
import weka.core.j... | [
2,
11593,
9800,
834,
796,
705,
1135,
72,
41133,
6,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
7297,
198,
11748,
25064,
11,
279,
9945,
11,
4738,
198,
6738,
22740,
1330,
1635,
198,
6738,
2275,
10210,
1330,
1635,
198,
11748,... | 2.543634 | 699 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 kalaksi@users.noreply.github.com
# ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,... | 1.960952 | 1,050 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
tests.context
~~~~~~~~~~~~~~~~~~~~~~
Add the ygoprodeck module to the tests context.
"""
import sys
from settings import settings
sys.path.append(settings.base_dir)
import ygoprodeck
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
41989,
13,
22866,
198,
27156,
8728,
4907,
198,
198,
4550,
262,
331,
70,
404,
305,
35875,
8265,
284,
... | 2.891566 | 83 |
from ...bh_trees import Task
| [
6738,
2644,
34369,
62,
83,
6037,
1330,
15941,
628,
198
] | 3.1 | 10 |
from ctpbee.json.pollen import Pollen
loads = Pollen.loads
dumps = Pollen.dumps
if __name__ == '__main__':
from ctpbee.constant import *
t = SubscribeRequest(symbol='1', exchange=Status.ALLTRADED, datetime=datetime.now())
tick = {'float2': 53.12321,
'int': (123, "123", t, Status.ALLTRADED, 2... | [
6738,
269,
34788,
20963,
13,
17752,
13,
79,
29952,
1330,
12868,
268,
198,
198,
46030,
796,
12868,
268,
13,
46030,
198,
67,
8142,
796,
12868,
268,
13,
67,
8142,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
... | 1.897129 | 418 |
#!/usr/bin/env python
# Copyright 2016 Vimal Manohar
# 2016 Johns Hopkins University (author: Daniel Povey)
# Apache 2.0
from __future__ import print_function
import argparse
import logging
import sys
from collections import defaultdict
"""
This script reads and writes the 'ctm-edits' file that is
prod... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
1584,
220,
220,
569,
4402,
1869,
1219,
283,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1584,
220,
220,
25824,
21183,
2059,
357,
9800,
25,
7806,
350,
6... | 2.786148 | 2,469 |
from twisted.internet import defer
from cube2common.constants import INTERMISSIONLEN
from spyd.game.client.exceptions import GenericError
from spyd.game.gamemode import gamemodes
from spyd.game.map.map_rotation import MapRotation
from spyd.protocol import swh
| [
6738,
19074,
13,
37675,
1330,
29135,
198,
198,
6738,
23441,
17,
11321,
13,
9979,
1187,
1330,
23255,
44,
40373,
43,
1677,
198,
6738,
599,
5173,
13,
6057,
13,
16366,
13,
1069,
11755,
1330,
42044,
12331,
198,
6738,
599,
5173,
13,
6057,
1... | 3.402597 | 77 |
from django.contrib import admin
from django.contrib import admin
from xiaoaiskill.models import *
admin.site.register(MI_Log, MI_Whereis_LogAdmin)
admin.site.register(MI_Device)
admin.site.register(MI_DeviceOwner) | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
2124,
544,
12162,
1984,
359,
13,
27530,
1330,
1635,
628,
198,
198,
28482,
13,
15654,
13,
30238,
7,
8895,
62,
11187,
1... | 2.986301 | 73 |
# Generated by Django 3.2.11 on 2022-01-07 22:05
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
1157,
319,
33160,
12,
486,
12,
2998,
2534,
25,
2713,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.8 | 30 |
class DeviceData:
"""
This class represents the CSP master as functional device. It mainly comprise the data common
across various functions of a CSP master.
"""
__instance = None
def __init__(self):
"""Private constructor of the class"""
if DeviceData.__instance != None:
... | [
4871,
16232,
6601,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
1398,
6870,
262,
327,
4303,
4958,
355,
10345,
3335,
13,
632,
8384,
28889,
262,
1366,
2219,
198,
220,
220,
220,
1973,
2972,
5499,
286,
257,
327,
4303,
4958,
1... | 2.418118 | 287 |
from typing import List, Union
from cgcrepair.utils.parse.cwe import cwe_from_info, main_cwe, get_name, top_parent
| [
6738,
19720,
1330,
7343,
11,
4479,
198,
6738,
269,
70,
7513,
24874,
13,
26791,
13,
29572,
13,
66,
732,
1330,
269,
732,
62,
6738,
62,
10951,
11,
1388,
62,
66,
732,
11,
651,
62,
3672,
11,
1353,
62,
8000,
628
] | 2.9 | 40 |
import base64
| [
11748,
2779,
2414,
628
] | 3.75 | 4 |
import numpy as np
import pytest
import quflow as qf
@pytest.mark.parametrize("f", [get_fun(), get_fun(N=128), get_fun(N=256)[:128, :255]])
@pytest.mark.parametrize("omega_real", [get_random_omega_real(), get_random_omega_real(128)])
@pytest.mark.parametrize("omega_complex", [get_random_omega_complex(), get_ra... | [
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
9288,
198,
11748,
627,
11125,
355,
10662,
69,
628,
628,
198,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7203,
69,
1600,
685,
1136,
62,
12543,
22784,
651,
62,
12543,
7,
... | 2.43662 | 142 |
import sys
from copy import deepcopy
from PyQt5 import QtWidgets
from PyQt5 import uic
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from funcs import *
from simple_cut import simple_cut
# Класс главного окна
# Отслеживание передвижения мыши
if __name__ == '__main__':
... | [
11748,
25064,
198,
198,
6738,
4866,
1330,
2769,
30073,
198,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
54,
312,
11407,
198,
6738,
9485,
48,
83,
20,
1330,
334,
291,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
14055,
1330,
1635,
198,
67... | 2.120603 | 199 |
from django.contrib.auth.views import LogoutView
from django.urls import path
from . import views
urlpatterns = [
path('logout/', LogoutView.as_view(template_name='users/logged_out.html'),
name='logout'),
path('signup/', views.SignUp.as_view(), name='signup')
]
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
33571,
1330,
5972,
448,
7680,
198,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
6738,
764,
1330,
5009,
628,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
... | 2.59633 | 109 |
from tastypie import http, fields
from tastypie.exceptions import ImmediateHttpResponse
from tastypie.resources import ModelResource, ALL, ALL_WITH_RELATIONS
from ..core.api import (ProductVersionResource, ProductResource,
UserResource)
from .models import CaseVersion, Case, Suite, CaseStep, Su... | [
6738,
14854,
4464,
494,
1330,
2638,
11,
7032,
198,
6738,
14854,
4464,
494,
13,
1069,
11755,
1330,
1846,
13857,
43481,
31077,
198,
6738,
14854,
4464,
494,
13,
37540,
1330,
9104,
26198,
11,
11096,
11,
11096,
62,
54,
10554,
62,
16448,
1842... | 2.535741 | 4,015 |
import os
import shutil
import sys
dirr = sys.argv[1] # this should be the path for a common folder from forms
flags = sys.argv[2]
print(dirr)
def folders_target():
"""
Make multiple target folders for receptor
"""
if not os.path.exists('{}/ensembles'.format(dirr)):
os.path.join(os.mkdir... | [
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
25064,
198,
198,
15908,
81,
796,
25064,
13,
853,
85,
58,
16,
60,
1303,
428,
815,
307,
262,
3108,
329,
257,
2219,
9483,
422,
5107,
198,
33152,
796,
25064,
13,
853,
85,
58,
17,
60,
19... | 2.093168 | 644 |
import paddle
import time
import os
import sys
import json
from opts import parse_opts
from model import generate_model
from mean import get_mean, get_std
from spatial_transforms import (
Compose, Normalize, Scale, CenterCrop, CornerCrop, MultiScaleCornerCrop,
MultiScaleRandomCrop, RandomHorizontalFlip, ToTens... | [
11748,
39517,
198,
11748,
640,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
33918,
198,
198,
6738,
2172,
82,
1330,
21136,
62,
404,
912,
198,
6738,
2746,
1330,
7716,
62,
19849,
198,
6738,
1612,
1330,
651,
62,
32604,
11,
651,
62,
1... | 3.365482 | 197 |
from .main import main #首页蓝本
from .user import user #用户处理的蓝本对象
from .posts import posts
from .owncenter import center
blueprintConfig = [
(main,''),
(user,''),
(posts,''),
(center,''),
]
#注册蓝本 | [
6738,
764,
12417,
1330,
1388,
1303,
165,
99,
244,
165,
94,
113,
164,
241,
251,
17312,
105,
198,
6738,
764,
7220,
1330,
2836,
1303,
18796,
101,
22755,
115,
13783,
226,
49426,
228,
21410,
164,
241,
251,
17312,
105,
43380,
117,
164,
109,... | 1.927273 | 110 |
from gpiozero import LED
from gpiozero.pins.pigpio import PiGPIOFactory
from time import sleep
# Change localhost to Raspberry Pi host and run
# this program on a remote computer
factory = PiGPIOFactory(host='localhost')
led = LED(21, pin_factory=factory)
try:
# toggle the led forever
while True:
led.... | [
6738,
27809,
952,
22570,
1330,
12365,
198,
6738,
27809,
952,
22570,
13,
49556,
13,
79,
328,
79,
952,
1330,
13993,
16960,
9399,
22810,
198,
6738,
640,
1330,
3993,
198,
198,
2,
9794,
1957,
4774,
284,
24244,
13993,
2583,
290,
1057,
198,
... | 2.804762 | 210 |
import json
import logging
import os
import shlex
import subprocess
from itertools import dropwhile
from pathlib import Path
from clint.textui import colored, indent, puts
def load_application_data(location=None):
"""Return the stored application data on where templates live"""
if not location:
loc... | [
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
427,
2588,
198,
11748,
850,
14681,
198,
6738,
340,
861,
10141,
1330,
4268,
4514,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
537,
600,
13,
5239,
9019,
1330,
16... | 2.837153 | 829 |
import re
import gfapy
class CIGAR(list):
"""
Representation of the contents of a CIGAR string.
Each operation is represented by a
:class:`CIGAR.Operation <gfapy.alignment.cigar.CIGAR.Operation>`,
which specifies an operation length and operation symbol.
Instances are usually created from their string re... | [
11748,
302,
198,
11748,
308,
69,
12826,
198,
198,
4871,
327,
3528,
1503,
7,
4868,
2599,
198,
220,
37227,
198,
220,
10858,
341,
286,
262,
10154,
286,
257,
327,
3528,
1503,
4731,
13,
628,
220,
5501,
4905,
318,
7997,
416,
257,
198,
220... | 2.398844 | 2,249 |
import tensorflow as tf
import numpy as np
import time
import board3d as go_board
import matplotlib.pyplot as plt
import global_vars_go as gvg
import models.cnn
batch_size = gvg.process_batch_size # How many board states (not full games) to send to GPU at once, about 200 is the limit of this GPU's RAM
# Source: https... | [
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
640,
198,
11748,
3096,
18,
67,
355,
467,
62,
3526,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
3298,
62,
85,
945,
62,
... | 3.090226 | 133 |
import json
import logging
try:
from urllib2 import HTTPError
except ImportError:
from urllib.error import HTTPError
from django.conf import settings
from django.contrib.auth import login, logout
from django.shortcuts import redirect, render
from django.contrib import messages
from django.utils.safestring impo... | [
11748,
33918,
198,
11748,
18931,
198,
28311,
25,
198,
220,
220,
220,
422,
2956,
297,
571,
17,
1330,
14626,
12331,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
422,
2956,
297,
571,
13,
18224,
1330,
14626,
12331,
198,
198,
6738,
42... | 2.349328 | 2,751 |
import os
import unittest
from unittest import mock
from alligator.gator import Gator
from alligator.workers import Worker
ALLOW_SLOW = bool(os.environ.get("ALLIGATOR_SLOW", False))
CONN_STRING = os.environ.get("ALLIGATOR_CONN")
FILENAME = "/tmp/alligator_test_workers.txt"
@unittest.skipIf(not ALLOW_SLOW, "Sk... | [
11748,
28686,
198,
11748,
555,
715,
395,
198,
6738,
555,
715,
395,
1330,
15290,
198,
198,
6738,
477,
23823,
13,
70,
1352,
1330,
402,
1352,
198,
6738,
477,
23823,
13,
22896,
1330,
35412,
628,
198,
7036,
3913,
62,
8634,
3913,
796,
20512... | 2.753968 | 126 |
from django.conf.urls import url
from django.conf.urls import include
from rest_framework import routers
from webmarks.bookmarks import viewsets
apiRouter = routers.DefaultRouter()
apiRouter.register(r'upload', viewsets.FileUploaderViewSet)
urlpatterns = [
# API V1
url(r'v1/', include(apiRouter.urls, namesp... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
2291,
198,
6738,
1334,
62,
30604,
1330,
41144,
198,
6738,
3992,
14306,
13,
2070,
14306,
1330,
5009,
1039,
628,
198,
15042,... | 2.948718 | 117 |
import numpy as np
import corner
import warnings
import itertools
import astropy.units as u
import astropy.constants as consts
from astropy.time import Time
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection
import matplotlib.colors as colors
from erfa import E... | [
11748,
299,
32152,
355,
45941,
198,
11748,
5228,
198,
11748,
14601,
198,
11748,
340,
861,
10141,
198,
198,
11748,
6468,
28338,
13,
41667,
355,
334,
198,
11748,
6468,
28338,
13,
9979,
1187,
355,
1500,
82,
198,
6738,
6468,
28338,
13,
2435... | 1.964824 | 13,731 |
import console
x = console.get_value("x")
y = console.get_value("y")
if x >= 0:
console.set_value("c", x + y)
else:
console.set_value("c", x * y) | [
11748,
8624,
198,
198,
87,
796,
8624,
13,
1136,
62,
8367,
7203,
87,
4943,
198,
88,
796,
8624,
13,
1136,
62,
8367,
7203,
88,
4943,
198,
198,
361,
2124,
18189,
657,
25,
198,
220,
220,
220,
8624,
13,
2617,
62,
8367,
7203,
66,
1600,
... | 2.313433 | 67 |
from setuptools import setup, find_packages
from mol2html.__version__ import __version__
setup(
name='mol2html',
version=__version__,
pacakges=find_packages(),
author='David Meijer',
author_email='david.meijer@wur.nl'
) | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
6738,
18605,
17,
6494,
13,
834,
9641,
834,
1330,
11593,
9641,
834,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
43132,
17,
6494,
3256,
198,
220,
220,
220,
2196,
... | 2.608696 | 92 |
# 设置类
class Settings():
'''存储外星人入侵所有的设置的类 '''
def __init__(self):
""" 初始化游戏的设置 """
# 屏幕设置
self.screen_width = 600
self.screen_height = 600
self.bg_color = (230, 230, 230)
# 飞船移动的速度设置
self.ship_speed_factor = 1.5
self.ship_limit = 3
#子弹设置... | [
2,
5525,
106,
122,
163,
121,
106,
163,
109,
119,
198,
4871,
16163,
33529,
198,
220,
220,
220,
705,
7061,
27764,
246,
43636,
101,
13783,
244,
23626,
253,
21689,
17739,
98,
160,
122,
113,
33699,
222,
17312,
231,
21410,
164,
106,
122,
... | 1.577778 | 855 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# filename: app/lib/qiniu/auth.py
import time
import simplejson as json
import hmac
from hashlib import sha1
from urllib.parse import urlparse
from requests.auth import AuthBase
try:
from .util import to_bytes, urlsafe_base64_encode
except (ImportError,SystemError,... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
29472,
25,
598,
14,
8019,
14,
80,
5362,
84,
14,
18439,
13,
9078,
628,
198,
11748,
640,
198,
11748,
2829,
177... | 2.818841 | 138 |
import uuid
from fastapi import status, HTTPException
from sqlalchemy.ext.asyncio import AsyncSession
from app import requests
from app.crud import payment_crud, user_crud
from app.models import User
from config import PUBLIC_QIWI_KEY
async def pay(db: AsyncSession, user: User, amount: int) -> dict[str, str]:
"... | [
11748,
334,
27112,
198,
198,
6738,
3049,
15042,
1330,
3722,
11,
14626,
16922,
198,
6738,
44161,
282,
26599,
13,
2302,
13,
292,
13361,
952,
1330,
1081,
13361,
36044,
198,
198,
6738,
598,
1330,
7007,
198,
6738,
598,
13,
6098,
463,
1330,
... | 2.48768 | 974 |
#! /usr/bin/python
import pygame
from pygame import *
WIN_WIDTH = 800
WIN_HEIGHT = 640
HALF_WIDTH = int(WIN_WIDTH / 2)
HALF_HEIGHT = int(WIN_HEIGHT / 2)
DISPLAY = (WIN_WIDTH, WIN_HEIGHT)
DEPTH = 32
FLAGS = 0
CAMERA_SLACK = 30
if __name__ == "__main__":
main()
| [
2,
0,
1220,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
12972,
6057,
198,
6738,
12972,
6057,
1330,
1635,
198,
198,
37620,
62,
54,
2389,
4221,
796,
10460,
198,
37620,
62,
13909,
9947,
796,
33759,
198,
39,
1847,
37,
62,
54,
2389,
422... | 2.134921 | 126 |
# Copyright 2020 Optimizely 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 l... | [
2,
220,
220,
220,
220,
15069,
12131,
30011,
1096,
306,
3457,
13,
198,
2,
198,
2,
220,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
220,
220,
220,
345,
743,
407,
... | 2.696113 | 566 |
from tkinter import *
from tkinter import filedialog
# from tkinter.filedialog import FileDialog
from traceback import *
from win32com.client import Dispatch
import time,eyed3,threading
name = []
root =Tk()
root.geometry("1000x385")
root.title('本地音乐播放器')
wmp = Dispatch("WMPlayer.OCX")
canvas = Canvas(root,width =20... | [
6738,
256,
74,
3849,
1330,
1635,
198,
6738,
256,
74,
3849,
1330,
5717,
498,
519,
198,
2,
422,
256,
74,
3849,
13,
69,
3902,
498,
519,
1330,
9220,
44204,
198,
6738,
12854,
1891,
1330,
1635,
198,
6738,
1592,
2624,
785,
13,
16366,
1330,... | 2.170797 | 1,856 |
from consolemenu.items import MenuItem
class SubmenuItem(MenuItem):
"""
A menu item to open a submenu
"""
def __init__(self, text, submenu, menu=None, should_exit=False):
"""
:ivar str text: The text shown for this menu item
:ivar ConsoleMenu submenu: The submenu to be opened ... | [
6738,
8624,
26272,
13,
23814,
1330,
21860,
7449,
628,
198,
4871,
3834,
26272,
7449,
7,
23381,
7449,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
317,
6859,
2378,
284,
1280,
257,
850,
26272,
198,
220,
220,
220,
37227,
628,
220,... | 2.405797 | 759 |
import os
import torch
import torchvision.transforms as transforms
from PIL import Image
import pandas as pd
from skimage import io, transform
import numpy as np
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
from torch.utils.data.sampler import WeightedRandomSampler
# f... | [
11748,
28686,
198,
11748,
28034,
198,
11748,
28034,
10178,
13,
7645,
23914,
355,
31408,
198,
6738,
350,
4146,
1330,
7412,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
1341,
9060,
1330,
33245,
11,
6121,
198,
11748,
299,
32152,
3... | 2.321321 | 333 |
import pymysql
import dbExe
a="*"
b="kg.validRelationship"
db=dbExe.db()
# db.add(Table="validRelationship",names="(valid)",values=r'("父子4")')
# db.delete(Table="validRelationship",name="valid",value=r'"父子4"')
print(db.select(a,b)) | [
11748,
279,
4948,
893,
13976,
198,
198,
11748,
20613,
3109,
68,
198,
198,
64,
2625,
9,
1,
198,
65,
2625,
10025,
13,
12102,
47117,
1056,
1,
198,
9945,
28,
9945,
3109,
68,
13,
9945,
3419,
198,
2,
20613,
13,
2860,
7,
10962,
2625,
121... | 2.284314 | 102 |
# Advent of Code 2020
# Day 01
# Author: irobin591
import os
import doctest
with open(os.path.join(os.path.dirname(__file__), "input.txt"), 'r') as input_file:
input_data = input_file.read()
# Prep Input
input_data = list(map(int, input_data.strip().split('\n')))
# print(input_data)
def part1(input_data):
... | [
2,
33732,
286,
6127,
12131,
198,
2,
3596,
5534,
198,
2,
6434,
25,
1312,
305,
8800,
48952,
198,
198,
11748,
28686,
198,
11748,
10412,
395,
198,
198,
4480,
1280,
7,
418,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834... | 2.234122 | 803 |
import pygame
import os
version = '2.0 (Beta)'
update = 'March 6th, 2018'
playlist()
os.system("pause")
| [
11748,
12972,
6057,
198,
11748,
28686,
198,
198,
9641,
796,
705,
17,
13,
15,
357,
43303,
33047,
198,
19119,
796,
705,
16192,
718,
400,
11,
2864,
6,
628,
198,
198,
1759,
4868,
3419,
198,
198,
418,
13,
10057,
7203,
32125,
4943,
198
] | 2.595238 | 42 |
"""
Parses https://clubhouse.io/api/rest/v2/ and generates a JSON payload
of their resources that can be used as basis of a client library.
"""
import argparse
import logging
import sys
import re
from typing import Dict
from collections import OrderedDict, deque
from lxml import html
from unidecode import unidecode
f... | [
37811,
198,
47,
945,
274,
3740,
1378,
18664,
4803,
13,
952,
14,
15042,
14,
2118,
14,
85,
17,
14,
290,
18616,
257,
19449,
21437,
198,
1659,
511,
4133,
326,
460,
307,
973,
355,
4308,
286,
257,
5456,
5888,
13,
198,
198,
37811,
198,
1... | 2.873874 | 222 |
import pathlib
from os import listdir
from os.path import isfile, join | [
11748,
3108,
8019,
198,
6738,
28686,
1330,
1351,
15908,
198,
6738,
28686,
13,
6978,
1330,
318,
7753,
11,
4654
] | 3.684211 | 19 |
#!/usr/bin/env python3
from aws_cdk import core
import os
from serverless_pipeline.serverless_pipeline_stack import ServerlessPipelineStack
app = core.App()
ServerlessPipelineStack(app, "serverless-pipeline", env=core.Environment(
account=os.getenv('AWS_CDK_DEFAULT_ACCOUNT'),
region=os.getenv('AWS_CDK_DEFAU... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
6738,
3253,
82,
62,
10210,
74,
1330,
4755,
198,
11748,
28686,
198,
198,
6738,
4382,
1203,
62,
79,
541,
4470,
13,
15388,
1203,
62,
79,
541,
4470,
62,
25558,
1330,
9652,
1203,... | 2.585185 | 135 |
from cat.log.log import enable_logging
| [
6738,
3797,
13,
6404,
13,
6404,
1330,
7139,
62,
6404,
2667,
198
] | 3.25 | 12 |
r1=float(input('primeiro segmento'))
r2=float(input('segundo segmento'))
r3=float(input('terceiro segmento'))
if r1 < r2 + r3 and r2 < r1 + r3 and r3 < r1 + r2:
print('os segmentos acima podem formar um triangulo ' ,end='')
if r1 == r2 and r2 == r3:
print('EQUILATERO')
elif r1 != r2 != r3 != r1:
... | [
81,
16,
28,
22468,
7,
15414,
10786,
35505,
7058,
10618,
78,
6,
4008,
198,
81,
17,
28,
22468,
7,
15414,
10786,
325,
70,
41204,
10618,
78,
6,
4008,
198,
81,
18,
28,
22468,
7,
15414,
10786,
353,
344,
7058,
10618,
78,
6,
4008,
198,
... | 2.103774 | 212 |
__________________________________________________________________________________________________
sample 72 ms submission
__________________________________________________________________________________________________
sample 136 ms submission
_________________________________________________________________________... | [
27193,
10221,
834,
198,
39873,
7724,
13845,
14498,
198,
27193,
10221,
834,
198,
39873,
21056,
13845,
14498,
198,
27193,
10221,
834,
198
] | 15.727273 | 22 |
from __future__ import unicode_literals
from django.contrib import admin
from .article.admin import ArticleAdmin
from .category.admin import CategoryAdmin
from .vote.admin import VoteAdmin
from .models import Article, Category, Vote
admin.site.register(Article, ArticleAdmin)
admin.site.register(Category, CategoryAd... | [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
764,
20205,
13,
28482,
1330,
10172,
46787,
198,
6738,
764,
22872,
13,
28482,
1330,
21743,
46787,
198,
... | 3.731959 | 97 |
from os import sep
from pathlib import Path
import json
import pandas as pd
from adie.nback import (
read_log,
compile_performance,
compile_probes,
compile_ses,
)
bids_dir = Path("__file__").parent # this file is in BIDS_data/code
sub_probes = []
sub_beh = []
sub_ses = []
for p in bids_dir.glob("su... | [
6738,
28686,
1330,
41767,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
33918,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
512,
494,
13,
77,
1891,
1330,
357,
198,
220,
220,
220,
1100,
62,
6404,
11,
198,
220,
22... | 2.265376 | 878 |
"""
This script attempts to generate a complete autoconf/automake/libtool-based
build system for any project that wants to use the Chombo library. To use it,
type
python make_example_metamakefiles.py <rootdir>
where rootdir is the root directory of your project.
Your project can contain C++ sources (with suffixes .... | [
37811,
198,
1212,
4226,
6370,
284,
7716,
257,
1844,
1960,
36221,
69,
14,
2306,
296,
539,
14,
8019,
25981,
12,
3106,
198,
11249,
1080,
329,
597,
1628,
326,
3382,
284,
779,
262,
609,
47265,
5888,
13,
220,
1675,
779,
340,
11,
198,
4906... | 2.533146 | 4,993 |
# Generated by Django 3.2.1 on 2021-05-05 18:16
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
16,
319,
33448,
12,
2713,
12,
2713,
1248,
25,
1433,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
"""
Copyright 2017 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... | [
37811,
198,
15269,
2177,
20359,
15302,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
5832,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
1639,
743,
7330,
... | 3.792135 | 178 |
# Copyright 2021 riceball-k
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | [
2,
15069,
33448,
11464,
1894,
12,
74,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
... | 1.89415 | 3,316 |
# Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | [
2,
15069,
357,
34,
8,
2813,
3012,
3457,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
198,
2,
17613,
11,
389,
10431,
2810,
326,
262,
1708,
3403,
389,
198,
... | 3.610994 | 473 |
# Lattice path through 20 * 20 grids
print solve(20, 20)
| [
2,
406,
1078,
501,
3108,
832,
1160,
1635,
1160,
50000,
628,
198,
198,
4798,
8494,
7,
1238,
11,
1160,
8,
198
] | 2.857143 | 21 |
# -*- coding: utf-8 -*-
# Copyright 2021 - 2021, Sean Mooney and the arbiterd contributors
# SPDX-License-Identifier: Apache-2.0
import configparser
import typing as ty
from arbiterd.common import cpu
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
33448,
532,
33448,
11,
11465,
4270,
1419,
290,
262,
9277,
45744,
20420,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
11748,... | 3.21875 | 64 |
##########
##
## SPDX-License-Identifier: MIT
##
## Copyright (c) 2017-2022 James M. Putnam <putnamjm.design@gmail.com>
##
##########
##########
##
## gra-afch controller
##
###########
"""Manage GRA-AFCH NCS31X hardware
See module ncs31x for display/clock interface.
Classes:
GraAfch
Functions:
dump(obje... | [
7804,
2235,
198,
2235,
198,
2235,
220,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
17168,
198,
2235,
198,
2235,
220,
15069,
357,
66,
8,
2177,
12,
1238,
1828,
3700,
337,
13,
5930,
7402,
1279,
1996,
7402,
73,
76,
13,
26124,
31,
14816,
... | 1.898409 | 3,268 |
"""
.@@#
(@&*%@@@/,%@@@# #&@@@@&. .@@# /&@@@@&* /&@@@@&* (@&*%@@@( *%@@@@&/ .@@&*&@.
(@@&((&@@@(/&@@, #@@#/(&@@. .@@# #@@(///(, .@@%////, (@@&(/#@@# #@@&//#@@( .@@@@@%.
(@@. /@@* ,@@/ .&@@%%%&@@* .@@# ... | [
37811,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
764,
12404,
2,
628,
220,
... | 2.298861 | 1,141 |
#!/usr/bin/env python
# -*- coding: latin-1 -*-
# ____ ____ ____ ______ ______ ____ ______ ____ __ ____
# /\ _`\ /\ _`\ /\ _`\ /\__ _/\__ _\/\ _`\ /\ _ \/\ _`\ /\ \ /\ _`\
# \ \ \/\_\ \ \L\_\ \ \L\ \/_/\ \\/_/\ \/\ \ \L\_\ \ \L\ \ \ \L\ \ \ \ \ \ \L\_\
# \ \ \/_/\ \ _\L\ \ , ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3042,
259,
12,
16,
532,
9,
12,
198,
2,
220,
220,
220,
1427,
220,
220,
220,
220,
1427,
220,
220,
220,
220,
1427,
220,
220,
220,
44435,
44435,
220,
220,
... | 2.178363 | 1,026 |
from dynaconf import LazySettings
settings = LazySettings(
DYNACONF_NAMESPACE='FOO',
DYNACONF_SETTINGS_MODULE='foo.py',
PROJECT_ROOT='/tmp',
DYNACONF_SILENT_ERRORS=True,
DYNACONF_ALWAYS_FRESH_VARS=['BAR']
)
assert settings.ENV_FOR_DYNACONF == 'FOO'
assert settings.SETTINGS_MODULE_FOR_DYNACONF == ... | [
6738,
37860,
7807,
69,
1330,
406,
12582,
26232,
198,
198,
33692,
796,
406,
12582,
26232,
7,
198,
220,
220,
220,
360,
40760,
2246,
1340,
37,
62,
45,
29559,
47,
11598,
11639,
6080,
46,
3256,
198,
220,
220,
220,
360,
40760,
2246,
1340,
... | 2.158909 | 623 |
"""
Generates the input file to the MIST isochrone code.
Use in either the eep or iso mode.
Args:
runname: the name of the grid
mode: determine if the the file is to make isochrones or eeps
Returns:
None
Example:
>>> make_iso_input_file('MIST_v0.1', 'eeps')
"""
import glob
import os
im... | [
37811,
198,
198,
8645,
689,
262,
5128,
2393,
284,
262,
337,
8808,
318,
5374,
33171,
2438,
13,
198,
11041,
287,
2035,
262,
304,
538,
393,
47279,
4235,
13,
198,
198,
42035,
25,
198,
220,
220,
220,
1057,
3672,
25,
262,
1438,
286,
262,
... | 2.572519 | 131 |
import wx
from ..wallet import Wallet
SPACER = (0, 0)
| [
11748,
266,
87,
198,
198,
6738,
11485,
44623,
1330,
37249,
198,
198,
4303,
2246,
1137,
796,
357,
15,
11,
657,
8,
628
] | 2.590909 | 22 |
"Rewrite spec/functional_specs/policies/default_credentials_spec.rb"
import pytest
from threescale_api.resources import Service
from testsuite import rawobj
from testsuite.utils import blame
@pytest.fixture(scope="module")
def application(application, service):
"Application with default_credentials policy conf... | [
1,
30003,
6525,
1020,
14,
45124,
62,
4125,
6359,
14,
79,
4160,
444,
14,
12286,
62,
66,
445,
14817,
62,
16684,
13,
26145,
1,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
294,
260,
3798,
1000,
62,
15042,
13,
37540,
1330,
4809,
198,
... | 2.861032 | 698 |
#!/usr/bin/env python
# Copyright 2014 Open Connectome Project (http://openconnecto.me)
#
# 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,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
1946,
4946,
8113,
462,
4935,
357,
4023,
1378,
9654,
8443,
78,
13,
1326,
8,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
341... | 2.824399 | 541 |
import sys
import numpy as np
sys.path.append("../")
from utils import *
print(find_closest([1, 24, 12, 13, 14], 10)) | [
11748,
25064,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
17597,
13,
6978,
13,
33295,
7203,
40720,
4943,
198,
6738,
3384,
4487,
1330,
1635,
628,
628,
198,
4798,
7,
19796,
62,
565,
418,
395,
26933,
16,
11,
1987,
11,
1105,
11,
... | 2.5625 | 48 |
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
"""add unique constraint for user roles
Revision ID: 27432edbe6d4
Revises: 3bb... | [
2,
15069,
357,
34,
8,
1853,
3012,
3457,
1539,
7035,
11,
290,
20420,
1279,
3826,
37195,
20673,
2393,
29,
198,
2,
49962,
739,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
1279,
3826,
385... | 2.743455 | 191 |
import unittest
import postcodes_io_api
import random
| [
11748,
555,
715,
395,
198,
198,
11748,
1281,
40148,
62,
952,
62,
15042,
198,
11748,
4738,
628
] | 3.294118 | 17 |
# __init__.py
import subprocess
__version__ = '0.2.0'
def vcs_release(version: str):
"""
If in git repo, get git version
"""
try:
git_hash = subprocess.check_output(
['git', 'rev-parse', '--short', 'HEAD'],
universal_newlines=True, stderr=subprocess.PIPE)
except s... | [
2,
11593,
15003,
834,
13,
9078,
198,
198,
11748,
850,
14681,
198,
198,
834,
9641,
834,
796,
705,
15,
13,
17,
13,
15,
6,
628,
198,
4299,
410,
6359,
62,
20979,
7,
9641,
25,
965,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,... | 2.372283 | 368 |
"""Functions for constructing the helicity amplitudes"""
from flavio.physics.bdecays.common import lambda_K, beta_l
from math import sqrt, pi
from flavio.physics.bdecays.wilsoncoefficients import wctot_dict, get_wceff
from flavio.physics.running import running
from flavio.config import config
from flavio.physics.bdeca... | [
37811,
24629,
2733,
329,
30580,
262,
11573,
414,
12306,
10455,
37811,
198,
198,
6738,
10525,
952,
13,
746,
23154,
13,
65,
12501,
592,
13,
11321,
1330,
37456,
62,
42,
11,
12159,
62,
75,
198,
6738,
10688,
1330,
19862,
17034,
11,
31028,
... | 3.231441 | 229 |
"""
Test code used for unit tests lives here.
Do not put production code here.
"""
| [
37811,
198,
14402,
2438,
973,
329,
4326,
5254,
3160,
994,
13,
198,
5211,
407,
1234,
3227,
2438,
994,
13,
198,
37811,
628
] | 3.818182 | 22 |
"""Phoenix Utilities.
Some functions to deal with phoenix models
i.e. searching for models with certain parameters
Jason Neal, January 2017
"""
import glob
import itertools
import logging
import os
import warnings
import Starfish
import numpy as np
from Starfish.grid_tools import HDF5Interface
from astropy.io import... | [
37811,
36422,
41086,
13,
198,
198,
4366,
5499,
284,
1730,
351,
872,
8538,
4981,
198,
72,
13,
68,
13,
10342,
329,
4981,
351,
1728,
10007,
198,
198,
26497,
29189,
11,
3269,
2177,
198,
37811,
198,
11748,
15095,
198,
11748,
340,
861,
1014... | 2.361859 | 6,906 |
# encoding: utf-8
"""Experimental Solr Grouping / Field Collapsing backend for Haystack 2.0"""
# NOTE: You must be running the latest Pysolr master - no PyPI release yet!
# See https://gist.github.com/3750774 for the current version of this code
# See http://wiki.apache.org/solr/FieldCollapsing for the Solr feature doc... | [
2,
21004,
25,
3384,
69,
12,
23,
198,
37811,
20468,
9134,
4294,
81,
4912,
278,
1220,
7663,
7778,
1686,
278,
30203,
329,
9075,
25558,
362,
13,
15,
37811,
198,
2,
24550,
25,
921,
1276,
307,
2491,
262,
3452,
350,
893,
349,
81,
4958,
5... | 3.146429 | 280 |
## 这里我们用K-近邻估计来判断手写数字的扫描图像来判断数字是多少。
from sklearn import datasets
from sklearn.neighbors import KNeighborsClassifier
## 导入数据
digits = datasets.load_digits()
X_digits = digits.data
y_digits = digits.target
n_samples = len(X_digits)
## 拆分训练集和测试集
#X_train = X_digits[:.9 * n_samples]
#y_train = y_digits[:.9 * n_samples... | [
198,
2235,
5525,
123,
247,
34932,
234,
22755,
239,
20015,
105,
18796,
101,
42,
12,
32573,
239,
165,
224,
119,
27670,
108,
164,
106,
94,
30266,
98,
26344,
97,
23877,
255,
33699,
233,
37863,
247,
46763,
108,
27764,
245,
21410,
33699,
10... | 1.574153 | 472 |
import os
import sqlite3
import unicodedata
import tarfile
import json
import shutil
from .. import Environ as ENV
from abc import ABCMeta, abstractmethod
from itertools import chain
from pprint import pprint
################################################################################
###########################... | [
11748,
28686,
198,
11748,
44161,
578,
18,
198,
11748,
28000,
9043,
1045,
198,
11748,
13422,
7753,
198,
11748,
33918,
198,
11748,
4423,
346,
198,
198,
6738,
11485,
1330,
2039,
2268,
355,
12964,
53,
198,
198,
6738,
450,
66,
1330,
9738,
48... | 4.506329 | 237 |
p = (input('Digite algo: '))
print('A variável ', p, ' é alfabética? ', (p.isalpha()))
print('A variável ', p, ' é numérica? ', (p.isnumeric()))
print('A variável ', p, ' é alfanumérica? ', (p.isalnum()))
print('A variável ', p, ' é dígito? ', (p.isdigit()))
print('A variável ', p, ' é minúscula? ', (p.islower()))
prin... | [
79,
796,
357,
15414,
10786,
19511,
578,
435,
2188,
25,
705,
4008,
198,
4798,
10786,
32,
5553,
6557,
626,
46083,
279,
11,
705,
38251,
435,
36434,
25125,
3970,
30,
46083,
357,
79,
13,
271,
26591,
3419,
4008,
198,
4798,
10786,
32,
5553,
... | 2.307958 | 289 |
# coding: utf-8
# 2次方程式の解を求める
import math
print("2次方程式の係数を入れてください")
a = float(input("a = "))
b = float(input("b = "))
c = float(input("c = "))
d = math.sqrt((b * b) - (4 * a * c))
x1 = (- b + d) / (2 * a)
x2 = (- b - d) / (2 * a)
print("解は %6.2f と %6.2f です。" %(x1, x2))
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
362,
162,
105,
94,
43095,
163,
101,
233,
28156,
237,
5641,
164,
100,
96,
31758,
162,
109,
224,
1792,
223,
25748,
198,
11748,
10688,
198,
198,
4798,
7203,
17,
162,
105,
94,
43095,
163,
101,
... | 1.522222 | 180 |
"""
ResNet50 CNN model for 244x244x3 image classification
"""
from typing import Optional
import tensorflow as tf
from art.classifiers import KerasClassifier
from tensorflow.keras.applications.resnet50 import ResNet50
from tensorflow.keras.layers import Lambda
from tensorflow.keras.models import Model
IMAGENET_MEANS... | [
37811,
198,
4965,
7934,
1120,
8100,
2746,
329,
35264,
87,
25707,
87,
18,
2939,
17923,
198,
37811,
198,
6738,
19720,
1330,
32233,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
1242,
13,
4871,
13350,
1330,
17337,
292,
9487,
7... | 2.80754 | 504 |
# Copyright 2016 by Raytheon BBN Technologies Corp. All Rights Reserved.
# Note: This code is QGL not QGL2
# This file contains code to replace Barrier instructions with appropriate Id()
# pulses to make channels line up without using a Wait where possible.
# Where not possible, it replaces the Barrier with Sync the... | [
2,
15069,
1584,
416,
7760,
1169,
261,
12597,
45,
21852,
11421,
13,
220,
1439,
6923,
33876,
13,
198,
198,
2,
5740,
25,
770,
2438,
318,
1195,
8763,
407,
1195,
8763,
17,
198,
198,
2,
770,
2393,
4909,
2438,
284,
6330,
32804,
7729,
351,
... | 2.441148 | 31,783 |
import torch
from torch import nn
import numpy as np
import cv2
from rlpyt.utils.tensor import infer_leading_dims, restore_leading_dims, valid_mean
from rlpyt.models.curiosity.encoders import *
from rlpyt.models.curiosity.forward_models import *
class Disagreement(nn.Module):
"""Curiosity model for intrinsically... | [
198,
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
198,
6738,
374,
75,
9078,
83,
13,
26791,
13,
83,
22854,
1330,
13249,
62,
12294,
62,
67,
12078,
11,
11169,
62,
1229... | 3.409091 | 154 |
#
# ppjson.py - Pretty Print JSON
#
import sys
level = 0
write = sys.stdout.write
if __name__ == '__main__':
main()
| [
2,
198,
2,
9788,
17752,
13,
9078,
532,
20090,
12578,
19449,
198,
2,
198,
11748,
25064,
198,
198,
5715,
796,
657,
198,
13564,
796,
25064,
13,
19282,
448,
13,
13564,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
... | 2.531915 | 47 |
"""
Partial info extraction and generation
Partial boundary information containing node level info on boundary degree
"""
import random
import networkx as nx
import numpy as np
from src.cnrg.src.LightMultiGraph import LightMultiGraph
from src.cnrg.src.globals import find_boundary_edges
def set_boundary_degrees_o... | [
37811,
198,
7841,
498,
7508,
22236,
290,
5270,
198,
198,
7841,
498,
18645,
1321,
7268,
10139,
1241,
7508,
319,
18645,
4922,
198,
37811,
198,
198,
11748,
4738,
198,
198,
11748,
3127,
87,
355,
299,
87,
198,
11748,
299,
32152,
355,
45941,
... | 2.276229 | 1,973 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_files/config.ui'
#
# Created by: PyQt5 UI code generator 5.13.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
| [
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,
9019,
62,
16624,
14,
11250,
13,
9019,
6,
198,
2,
198,
2,
15622,
416,
25,
9485,
48,
83,
20,
12454,
2438,
17... | 2.829545 | 88 |
#!/usr/bin/python3
"""
Set of functions used to call a series of algorithms used to visualize the object localization of a pre-trained
network in PyTorch. The different algorithms are discussed in several papers, while the implementation is based,
roughly, on work in the following repository (https://github.com/sar-... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
37811,
198,
7248,
286,
5499,
973,
284,
869,
257,
2168,
286,
16113,
973,
284,
38350,
262,
2134,
42842,
286,
257,
662,
12,
35311,
220,
198,
27349,
287,
9485,
15884,
354,
13,
220,
383,
118... | 2.402743 | 3,208 |
#!/usr/bin/env python
from __future__ import print_function
from __future__ import unicode_literals
import time
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
640,
198
] | 3.352941 | 34 |
from .submission import make_agent | [
6738,
764,
7266,
3411,
1330,
787,
62,
25781
] | 4.25 | 8 |
import io
import lldb
import debugger
import base64
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
| [
11748,
33245,
198,
11748,
32660,
9945,
198,
11748,
49518,
198,
11748,
2779,
2414,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198
] | 3.361111 | 36 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
# Copyright 2008-2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
# http://aws.amazon.com/apache2.0/
# or in the "license" file accompanying... | [
2,
15069,
3648,
12,
7908,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
11074,
921,
743,
407,
779,
428,
2393,
2845,
2... | 3.036949 | 839 |
'''
strates how to use `CNN` model from
`speechemotionrecognition` package
'''
from keras.utils import np_utils
import pulsectl
import serial
import time
import os
import sys
import collections
import webrtcvad
import signal
import subprocess
import socket as sk
import numpy as np
from common import e... | [
7061,
6,
201,
198,
2536,
689,
703,
284,
779,
4600,
18474,
63,
2746,
422,
201,
198,
63,
4125,
721,
4411,
9650,
26243,
653,
63,
5301,
201,
198,
7061,
6,
201,
198,
6738,
41927,
292,
13,
26791,
1330,
45941,
62,
26791,
201,
198,
201,
1... | 2.75 | 244 |
# coding=utf-8
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
from pants.backend.native.config.environment import create_native_environment_rules
from ... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
2864,
41689,
1628,
20420,
357,
3826,
27342,
9865,
3843,
20673,
13,
9132,
737,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
3826,
38559,
24290,
737,
198,
198,
6738,
1... | 3.088398 | 543 |
import itertools
import petools
def Part(full, segs):
"""full: sorted digit string; segs: list of sorted digit strings."""
if full in segs:
yield [full]
for i in range(len(segs)):
seg = segs[i]
if Contains(full, seg):
for p in Part(Diff(full, seg), segs[i+1:]):
yield [seg] + p
d... | [
11748,
340,
861,
10141,
198,
198,
11748,
4273,
10141,
628,
628,
628,
198,
4299,
2142,
7,
12853,
11,
384,
14542,
2599,
198,
220,
37227,
12853,
25,
23243,
16839,
4731,
26,
384,
14542,
25,
1351,
286,
23243,
16839,
13042,
526,
15931,
198,
... | 2.288809 | 277 |
import logging
import threading
import pythoncom
import win32com.client
import time
from vspax import *
| [
11748,
18931,
198,
11748,
4704,
278,
198,
11748,
21015,
785,
198,
11748,
1592,
2624,
785,
13,
16366,
198,
11748,
640,
198,
6738,
410,
2777,
897,
1330,
1635,
628
] | 3.75 | 28 |
import httplib # Used only for handling httplib.HTTPException (case #26701)
import os
import sys
import platform
import re
import urllib
import urllib2
import traceback
import time
from StringIO import StringIO
from kunai.log import logger
from kunai.collector import Collector
| [
11748,
1841,
489,
571,
1303,
16718,
691,
329,
9041,
1841,
489,
571,
13,
40717,
16922,
357,
7442,
1303,
25674,
486,
8,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
3859,
198,
11748,
302,
198,
11748,
2956,
297,
571,
198,
11748,
2956,... | 3.556962 | 79 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
# ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
29113,
29113,
7804,
4242,
21017,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.092017 | 8,042 |
# encoding:utf-8
"""
requests 的POST方法
注意post方式中传递的参数是data,而get 是params
"""
import requests
data = {"user":"admin","pwd":"admin"}
headers = {"User-Agent": "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0);"}
url = "https://httpbin.org/post"
req = requests.post(url,data=data,headers=headers)
print(req.co... | [
2,
21004,
25,
40477,
12,
23,
198,
198,
37811,
198,
8897,
3558,
13328,
248,
226,
32782,
43095,
37345,
243,
198,
37345,
101,
35707,
237,
7353,
43095,
28156,
237,
40792,
27670,
254,
34460,
240,
21410,
20998,
224,
46763,
108,
42468,
7890,
1... | 2.333333 | 150 |
# A non-empty array A consisting of N integers is given. Array A represents numbers on a tape.
# Any integer P, such that 0 < P < N, splits this tape into two non-empty parts:
# A[0], A[1], ..., A[P − 1] and A[P], A[P + 1], ..., A[N − 1].
# The difference between the two parts is the value of: |(A[0] + A[1] + ... + A[P... | [
2,
317,
1729,
12,
28920,
7177,
317,
17747,
286,
399,
37014,
318,
1813,
13,
15690,
317,
6870,
3146,
319,
257,
9154,
13,
198,
2,
4377,
18253,
350,
11,
884,
326,
657,
1279,
350,
1279,
399,
11,
30778,
428,
9154,
656,
734,
1729,
12,
28... | 2.664723 | 343 |
import unittest
import os
import json
from ridt.config import ConfigFileParser
from ridt.config.ridtconfig import ConsistencyError
from ridt.config.configfileparser import ConfigFileParserValidationError
class ST02(unittest.TestCase):
"""System Test 02. The objective is to able to parse monitor
points/... | [
11748,
555,
715,
395,
198,
198,
11748,
28686,
198,
198,
11748,
33918,
198,
198,
6738,
5755,
83,
13,
11250,
1330,
17056,
8979,
46677,
198,
6738,
5755,
83,
13,
11250,
13,
6058,
83,
11250,
1330,
3515,
396,
1387,
12331,
198,
6738,
5755,
8... | 2.304572 | 2,712 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
author="Jean-Philippe Fortin, Nick Cullen, Tim Robert-Fitzgerald",
author_email='fortin946@gmail.com,',
classifiers=[
'License :: OSI Approved :: MIT Lice... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
900,
37623,
10141,
198,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
1600,
366,
81,
4943,
355,
277,
71,
25,
... | 2.675676 | 259 |