content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
"""This module creates a Pygame surface from a source surface that
has "end caps" on its corners. The caps remain unscaled in the
destination surface and the rest is scaled/tiled.
This was inspired by Android's NinePatch and iOS'
resizableImageWithCapInsets
"""
import pygame
AUTHOR = 'Brian Hammond <brian@fictori... | [
37811,
1212,
8265,
8075,
257,
9485,
6057,
4417,
422,
257,
2723,
4417,
326,
198,
10134,
366,
437,
11022,
1,
319,
663,
14371,
13,
383,
11022,
3520,
28594,
3021,
287,
262,
220,
198,
16520,
1883,
4417,
290,
262,
1334,
318,
27464,
14,
83,
... | 2.147221 | 2,717 |
import psycopg2
#insert("Water Glass", 10, 5)
#delete("Wine Glass")
#update(12,6,"Water Glass")
#print(view())
#create_table()
#insert("Orange",10,15)
delete("Orange")
print(view()) | [
11748,
17331,
22163,
70,
17,
198,
198,
2,
28463,
7203,
19184,
12158,
1600,
838,
11,
642,
8,
628,
198,
2,
33678,
7203,
54,
500,
12158,
4943,
198,
198,
2,
19119,
7,
1065,
11,
21,
553,
19184,
12158,
4943,
198,
2,
4798,
7,
1177,
28955... | 2.619718 | 71 |
# nuScenes dev-kit.
# Code written by Holger Caesar, 2018.
from typing import List, Dict, Any
import numpy as np
from pyquaternion import Quaternion
from nuscenes.eval.common.data_classes import EvalBox
from nuscenes.utils.data_classes import Box
DetectionBox = Any # Workaround as direct imports lead to cyclic dep... | [
2,
14364,
3351,
18719,
1614,
12,
15813,
13,
198,
2,
6127,
3194,
416,
6479,
1362,
24088,
11,
2864,
13,
198,
198,
6738,
19720,
1330,
7343,
11,
360,
713,
11,
4377,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
12972,
421,
9205,
2... | 2.80307 | 2,280 |
# parsetab.py
# This file is automatically generated. Do not edit.
_tabversion = '3.2'
_lr_method = 'LALR'
_lr_signature = 'l\x16\x9efz%\xc1\x8b\xa8O\x02{\x0b\xd1qJ'
_lr_action_items = {'PEEK':([179,247,248,253,293,299,321,345,352,355,366,368,369,370,372,375,376,],[242,242,-95,-80,-79,-86,-94,-87,-92,-96,-88,-9... | [
198,
2,
13544,
316,
397,
13,
9078,
198,
2,
770,
2393,
318,
6338,
7560,
13,
2141,
407,
4370,
13,
198,
62,
8658,
9641,
796,
705,
18,
13,
17,
6,
198,
198,
62,
14050,
62,
24396,
796,
705,
43,
1847,
49,
6,
198,
198,
62,
14050,
62,
... | 2.017526 | 23,051 |
from pdb import set_trace
import json
import itertools
# import pygments
import random
import csv
# from pygments.token import Comment, Text, Keyword, Name
# from bpe import Encoder
# from nltk import everygrams, ngrams
# from nltk.tokenize import word_tokenize
# from lexer import build_lexer
if __... | [
6738,
279,
9945,
1330,
900,
62,
40546,
198,
11748,
33918,
198,
11748,
340,
861,
10141,
198,
2,
1330,
12972,
11726,
198,
11748,
4738,
198,
11748,
269,
21370,
198,
2,
422,
12972,
11726,
13,
30001,
1330,
18957,
11,
8255,
11,
7383,
4775,
... | 2.897143 | 175 |
from django.db import models
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
628
] | 3.75 | 8 |
from pyawx.models._mixins import DataModelMixin
from pyawx.models.utils import set_changes, types
from pyawx.exceptions import ValueReadOnly
| [
6738,
12972,
707,
87,
13,
27530,
13557,
19816,
1040,
1330,
6060,
17633,
35608,
259,
198,
6738,
12972,
707,
87,
13,
27530,
13,
26791,
1330,
900,
62,
36653,
11,
3858,
198,
6738,
12972,
707,
87,
13,
1069,
11755,
1330,
11052,
5569,
10049,
... | 3.325581 | 43 |
#!/usr/bin/env python3
# Copyright (c) 2015 The Bitcoin Core developers
# Copyright (c) 2015-2017 The Bitcoin Unlimited developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test ZMQ interface
#
import time
import test_f... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
15069,
357,
66,
8,
1853,
383,
6185,
7231,
6505,
198,
2,
15069,
357,
66,
8,
1853,
12,
5539,
383,
6185,
26774,
6505,
198,
2,
4307,
6169,
739,
262,
17168,
3788,
5964,
11,
766,
... | 3.404908 | 163 |
#!/usr/bin/env pipenv-shebang
import csv
import time
import yaml
import configReader
from datetime import datetime
from miio import AirPurifierMiot
configFile = "config.yaml"
ip = configReader.fetchIpAddress(configFile,"airpurifier")
token = configReader.fetchToken(configFile,"airpurifier")
air = AirPurifierMiot(ip,t... | [
2,
48443,
14629,
14,
8800,
14,
24330,
7347,
24330,
12,
7091,
36668,
198,
11748,
269,
21370,
198,
11748,
640,
198,
11748,
331,
43695,
198,
11748,
4566,
33634,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
21504,
952,
1330,
3701,
30... | 2.023529 | 595 |
import os
import sys
from numpy.distutils.exec_command import exec_command
if '--install' in sys.argv[1:]:
print('Building and installing local dev version via conda')
installing()
elif '--remove' in sys.argv[1:]:
print('Removing local dev package')
remove()
elif '--update' in sys.argv[1:]:
print('... | [
11748,
28686,
198,
11748,
25064,
198,
6738,
299,
32152,
13,
17080,
26791,
13,
18558,
62,
21812,
1330,
2452,
62,
21812,
198,
198,
361,
705,
438,
17350,
6,
287,
25064,
13,
853,
85,
58,
16,
25,
5974,
198,
220,
220,
220,
3601,
10786,
25... | 2.850394 | 127 |
import os
from io import open
from setuptools import setup, find_packages
setup(
name="apichanges",
version='0.0.1',
description="AWS API Changes",
long_description=read('readme.md'),
long_description_content_type='text/markdown',
license="Apache-2.0",
packages=find_packages(),
entry_... | [
11748,
28686,
198,
6738,
33245,
1330,
1280,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
628,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
2625,
499,
488,
6231,
1600,
198,
220,
220,
220,
2196,
11639,
15,
13,
15,
1... | 1.88729 | 417 |
# utils.py
import asyncio
import aiohttp
import discord
import math
import os
import psutil
import re
import socket
import subprocess
import psycopg2
import xmltodict
from core import const
from datetime import datetime, timedelta
from configparser import ConfigParser
from contextlib import closing, suppress
from disco... | [
2,
3384,
4487,
13,
9078,
198,
11748,
30351,
952,
198,
11748,
257,
952,
4023,
198,
11748,
36446,
198,
11748,
10688,
198,
11748,
28686,
198,
11748,
26692,
22602,
198,
11748,
302,
198,
11748,
17802,
198,
11748,
850,
14681,
198,
11748,
17331,... | 2.983539 | 243 |
"""lab app URL configuration"""
from django.urls import path
from django.utils.translation import gettext_lazy as _
from .views import (SampleCreateView, SampleDeleteView, SampleListView,
SampleUpdateView)
urlpatterns = [
path(
_(''),
SampleListView.as_view(),
name='sa... | [
37811,
23912,
598,
10289,
8398,
37811,
198,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
651,
5239,
62,
75,
12582,
355,
4808,
198,
198,
6738,
764,
33571,
1330,
357,
36674,
16447... | 2.141479 | 311 |
from ..others_module import OthersModule
| [
6738,
11485,
847,
82,
62,
21412,
1330,
12691,
26796,
628
] | 4.2 | 10 |
#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 19.03.2019 12:21
:Licence MIT
Part of grammpy
"""
from string import ascii_lowercase
from grammpy import *
from grammpy.transforms import ContextFree, InverseContextFree, InverseCommon
from grammpy.parsers import cyk
g = Grammar(terminals=list(ascii... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
25,
13838,
9606,
74,
569,
971,
17215,
198,
25,
41972,
678,
13,
3070,
13,
23344,
1105,
25,
2481,
198,
25,
26656,
594,
17168,
198,
7841,
286,
14599,
3149,
88,
198,
198,
378... | 2.325688 | 436 |
from .. import usbhid
_BATTERY_CHARGING_FLAG = 0b10000000
profile = {
"name": "SteelSeries Aerox 3 Wireless",
"models": [
{
"name": "SteelSeries Aerox 3 Wireless (wired mode)",
"vendor_id": 0x1038,
"product_id": 0x183A,
"endpoint": 3,
},
],... | [
6738,
11485,
1330,
514,
34369,
312,
628,
198,
62,
47379,
5781,
56,
62,
38019,
38,
2751,
62,
38948,
796,
657,
65,
16,
24598,
628,
198,
13317,
796,
1391,
198,
220,
220,
220,
366,
3672,
1298,
366,
39807,
27996,
15781,
1140,
513,
24365,
... | 1.82393 | 3,084 |
from __future__ import unicode_literals
from django.test import TestCase
from wtl.wtlib.models import Library, LibraryVersion
from wtl.wtlib.tests.factories import (LibraryFactory, LibraryVersionFactory,
ProjectFactory)
| [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
198,
6738,
266,
28781,
13,
46569,
8019,
13,
27530,
1330,
10074,
11,
10074,
14815,
198,
6738,
266,
28781,
13,
465... | 2.64 | 100 |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="esp8266.py",
version="0.0.3",
author="letli",
author_email="letli@74ls74.org",
description="ESP8266 python library, a wrapper for AT commands (Hayes command set) using UART serial.",
l... | [
11748,
900,
37623,
10141,
198,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
1600,
366,
81,
4943,
355,
277,
71,
25,
198,
220,
220,
220,
890,
62,
11213,
796,
277,
71,
13,
961,
3419,
198,
198,
2617,
37623,
10141,
13,
40406,
7,
198,
... | 2.548077 | 312 |
sal = float ( input ('Saldo médio ? ' ))
if (sal <= 200) :
nsal1= (sal* 0.90)
print ('Valor do crédito 10% > R${}'.format(nsal1))
if (300 >= sal > 200) :
nsal2 = (sal* 0.80)
print ('Valor do crédito 20% > R${}'.format(nsal2))
if ( 400 >= sal > 300) :
nsal3= (sal* 0.85)
print ('Valor do crédito ... | [
21680,
796,
12178,
357,
5128,
19203,
50,
41476,
285,
2634,
67,
952,
5633,
705,
15306,
198,
198,
361,
357,
21680,
19841,
939,
8,
1058,
198,
220,
220,
220,
299,
21680,
16,
28,
357,
21680,
9,
657,
13,
3829,
8,
198,
220,
220,
220,
360... | 2.050926 | 216 |
import os
import numpy as np
from sklearn.feature_extraction.text import TfidfTransformer
from tqdm import tqdm
from utils.file import loadJson, dumpJson
##############################################
# 根据序列数据集(ngram,api),先统计元素的样本内频率,
# 然后计算各个特征的TF-IDF值
##############################################
if __name__ == ... | [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
13,
30053,
62,
2302,
7861,
13,
5239,
1330,
309,
69,
312,
69,
8291,
16354,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
198,
6738,
3384,
4487,
13,
7753,... | 1.982759 | 290 |
import datetime
import json
import os
import time
import paho.mqtt.client as mqtt
from pijuice import PiJuice
from balena import Balena
from datetime import datetime, timedelta
from dateutil.tz import tzutc
from time import sleep
from w1thermsensor import W1ThermSensor
WAKEALARM = '/sys/class/rtc/rtc0/wakealarm'
BR... | [
11748,
4818,
8079,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
640,
198,
198,
11748,
279,
17108,
13,
76,
80,
926,
13,
16366,
355,
285,
80,
926,
198,
198,
6738,
279,
2926,
84,
501,
1330,
13993,
33018,
501,
198,
6738,
3652,
8107,
... | 2.365731 | 1,996 |
'''
Created on May 9, 2017
@author: yingziwu
'''
import feedparser
import time
import re
import requests
from redis import Redis
from rq import Queue
import json
import os
import logging
from v2ex_spider import topic_spider
from v2ex_base.v2_sql import SQL
import settings
class Rss_spider(object):
'''
A Spi... | [
7061,
6,
198,
41972,
319,
1737,
860,
11,
2177,
198,
198,
31,
9800,
25,
331,
278,
89,
14246,
84,
198,
7061,
6,
198,
11748,
3745,
48610,
198,
11748,
640,
198,
11748,
302,
198,
11748,
7007,
198,
6738,
2266,
271,
1330,
2297,
271,
198,
... | 1.98337 | 902 |
from typing import List
from . import langs
__all__: List[str] = [
"langs",
]
| [
6738,
19720,
1330,
7343,
198,
6738,
764,
1330,
300,
27725,
628,
198,
834,
439,
834,
25,
7343,
58,
2536,
60,
796,
685,
198,
220,
220,
220,
366,
17204,
82,
1600,
198,
60,
198
] | 2.545455 | 33 |
from lxmls.sequences.id_feature import IDFeatures
# ----------
# Feature Class
# Extracts features from a labeled corpus (only supported features are extracted
# ----------
| [
6738,
300,
19875,
82,
13,
3107,
3007,
13,
312,
62,
30053,
1330,
4522,
23595,
628,
198,
2,
24200,
438,
198,
2,
27018,
5016,
198,
2,
29677,
82,
3033,
422,
257,
15494,
35789,
357,
8807,
4855,
3033,
389,
21242,
198,
2,
24200,
438,
198
] | 4.069767 | 43 |
import os
import sys
from random import random, sample
import argparse
from tqdm import tqdm
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image, ImageDraw, ImageFile
from imutils import video
import cv2
ImageFile.LOAD_TRUNCATED_IMAGES = True
allowable_actions = ['none', 'quantize', 'trace', 'hed'... | [
11748,
28686,
198,
11748,
25064,
198,
6738,
4738,
1330,
4738,
11,
6291,
198,
11748,
1822,
29572,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,... | 3.144399 | 1,482 |
# to decrypt a msg
msg = input("Enter the encrypted message :")
en_msg = msg.upper()
#print(en_msg)
key = 1
for i in range(27):
str1 = ""
#key = 1
for letter in en_msg:
l = ord(letter) + key
if l > 90:
l = l - 90 + 64
str1 = str1 + chr(l)
key = key + 1
print(str1)
key = 1
'''for i in range(27):
str1 =... | [
2,
284,
42797,
257,
31456,
198,
198,
19662,
796,
5128,
7203,
17469,
262,
19365,
3275,
1058,
4943,
198,
198,
268,
62,
19662,
796,
31456,
13,
45828,
3419,
198,
2,
4798,
7,
268,
62,
19662,
8,
198,
2539,
796,
352,
198,
1640,
1312,
287,
... | 2.077922 | 231 |
from dataclasses import dataclass
from .base_entity import BaseClass
@dataclass
| [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
764,
8692,
62,
26858,
1330,
7308,
9487,
198,
198,
31,
19608,
330,
31172,
198
] | 3.375 | 24 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created Jul 2020
@author: TheDrDOS
"""
# # Clear the Spyder console and variables
# try:
# from IPython import get_ipython
# get_ipython().magic('clear')
# get_ipython().magic('reset -f')
# except:
# pass
from bokeh.io import show, save, output_file
... | [
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,
5979,
12131,
198,
198,
31,
9800,
25,
383,
6187,
35178,
198,
37811,
198,
2,
1303,
11459,
262,
2... | 2.476331 | 8,830 |
from django.conf.urls import url
from . import views
app_name = 'blog'
urlpatterns=[
url(r'^$',views.index,name='index'),
url(r'^post/(?P<pk>[0-9]+)/$',views.detail,name='detail'),
]
| [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
198,
198,
6738,
764,
1330,
5009,
198,
198,
1324,
62,
3672,
796,
705,
14036,
6,
198,
6371,
33279,
82,
41888,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
3,
3256,
33571,
13,
963... | 2.297619 | 84 |
"""Selector
"""
from reversi.strategies.common import AbstractSelector
class Selector(AbstractSelector):
"""Selector
"""
def select_moves(self, color, board, moves, scores, depth):
"""select_moves
"""
return moves
class Selector_W(Selector):
"""Selector_W
ワースト値に基... | [
37811,
17563,
273,
198,
37811,
198,
198,
6738,
10372,
72,
13,
2536,
2397,
444,
13,
11321,
1330,
27741,
17563,
273,
628,
198,
4871,
9683,
273,
7,
23839,
17563,
273,
2599,
198,
220,
220,
220,
37227,
17563,
273,
198,
220,
220,
220,
37227... | 1.960251 | 478 |
"""Video output tools for turnovertools."""
import ffmpeg
from timecode import Timecode
class VideoFile(object):
"""A videofile which can either be imported or exported from."""
| [
37811,
10798,
5072,
4899,
329,
1210,
78,
1851,
10141,
526,
15931,
198,
198,
11748,
31246,
43913,
198,
6738,
640,
8189,
1330,
3862,
8189,
198,
198,
4871,
7623,
8979,
7,
15252,
2599,
198,
220,
220,
220,
37227,
32,
2008,
7753,
543,
460,
... | 3.7 | 50 |
# Generated by Django 2.2.2 on 2019-06-22 20:32
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
17,
319,
13130,
12,
3312,
12,
1828,
1160,
25,
2624,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
from flask import Blueprint, render_template, request
from webapp.methods import get_news
blueprint = Blueprint('news', __name__, url_prefix='/news')
@blueprint.route('/news', methods=['GET'])
@blueprint.route('/news/<int:id>', methods=['GET'])
| [
6738,
42903,
1330,
39932,
11,
8543,
62,
28243,
11,
2581,
198,
6738,
3992,
1324,
13,
24396,
82,
1330,
651,
62,
10827,
198,
198,
17585,
4798,
796,
39932,
10786,
10827,
3256,
11593,
3672,
834,
11,
19016,
62,
40290,
11639,
14,
10827,
11537,... | 3.061728 | 81 |
from typing import Any, Dict, Tuple
from eth_typing.evm import ChecksumAddress
from trezorlib import ethereum # type: ignore
from trezorlib.client import get_default_client # type: ignore
from trezorlib.exceptions import PinException, TrezorFailure # type: ignore
from trezorlib.messages import TransactionType # ty... | [
6738,
19720,
1330,
4377,
11,
360,
713,
11,
309,
29291,
198,
198,
6738,
4555,
62,
774,
13886,
13,
1990,
76,
1330,
47719,
388,
20231,
198,
6738,
2054,
89,
273,
8019,
1330,
304,
17733,
220,
1303,
2099,
25,
8856,
198,
6738,
2054,
89,
27... | 2.734444 | 900 |
"""
"""
# Full imports
import json
import pulp
import logging as log
import time
# Imports from environment
from cornflow_client import CornFlowApiError
from cornflow_client.constants import INSTANCE_SCHEMA, SOLUTION_SCHEMA
# Import internal modules
from cornflow.app import create_app
from cornflow.shared.const impo... | [
37811,
198,
198,
37811,
198,
2,
6462,
17944,
198,
11748,
33918,
198,
11748,
38341,
198,
11748,
18931,
355,
2604,
198,
11748,
640,
198,
198,
2,
1846,
3742,
422,
2858,
198,
6738,
11676,
11125,
62,
16366,
1330,
11424,
37535,
32,
14415,
123... | 2.84 | 375 |
from torchvision.models import resnet
from .DirectionNet import DirectionNet
from .DiResNet import FCN_Ref
import torch
import torch.nn as nn | [
6738,
28034,
10178,
13,
27530,
1330,
581,
3262,
198,
6738,
764,
35,
4154,
7934,
1330,
41837,
7934,
198,
6738,
764,
18683,
4965,
7934,
1330,
10029,
45,
62,
8134,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77
] | 3.615385 | 39 |
import requests
from bs4 import BeautifulSoup
| [
11748,
7007,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
628
] | 3.916667 | 12 |
#
# PySNMP MIB module INTEL-IP-MULTICAST-ROUTER-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/INTEL-IP-MULTICAST-ROUTER-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:43:05 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python ve... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
17828,
3698,
12,
4061,
12,
44,
16724,
2149,
11262,
12,
49,
2606,
5781,
12,
8895,
33,
357,
4023,
1378,
16184,
76,
489,
8937,
13,
785,
14,
79,
893,
11632,
8,
198,
2,
7054,
45,
13,
16,... | 2.597663 | 1,797 |
import io
from collections.abc import Iterable
from typing import Optional
EXAMPLE = """7,4,9,5,11,17,23,2,0,14,21,24,10,16,13,6,15,25,12,22,18,20,8,19,3,26,1
22 13 17 11 0
8 2 23 4 24
21 9 14 16 7
6 10 3 18 5
1 12 20 15 19
3 15 0 2 22
9 18 13 17 5
19 8 7 25 23
20 11 10 24 4
14 21 16 12 6
14 21 1... | [
11748,
33245,
198,
6738,
17268,
13,
39305,
1330,
40806,
540,
198,
6738,
19720,
1330,
32233,
198,
198,
6369,
2390,
16437,
796,
37227,
22,
11,
19,
11,
24,
11,
20,
11,
1157,
11,
1558,
11,
1954,
11,
17,
11,
15,
11,
1415,
11,
2481,
11,... | 2.136364 | 242 |
"""
Copyright (c) 2020 VMware, Inc.
This product is licensed to you under the Apache License, Version 2.0 (the "License").
You may not use this product except in compliance with the License.
This product may include a number of subcomponents with separate copyright notices
and license terms. Your use of these subcomp... | [
37811,
198,
15269,
357,
66,
8,
12131,
37754,
11,
3457,
13,
198,
198,
1212,
1720,
318,
11971,
284,
345,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
11074,
198,
1639,
743,
407,
779,
428,
1720,
2845,
287,
118... | 3.171315 | 251 |
import django_filters
from rest_framework import filters
from app.finance.models import Transaction
| [
11748,
42625,
14208,
62,
10379,
1010,
198,
6738,
1334,
62,
30604,
1330,
16628,
198,
198,
6738,
598,
13,
69,
14149,
13,
27530,
1330,
45389,
198
] | 4.04 | 25 |
"""
"""
from RPi._SPI import *
VERSION = '0.6.2'
| [
37811,
198,
37811,
198,
198,
6738,
25812,
72,
13557,
4303,
40,
1330,
1635,
198,
198,
43717,
796,
705,
15,
13,
21,
13,
17,
6,
198
] | 2.04 | 25 |
import datetime
import json
import pytest
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser
from django.contrib.sessions.middleware import SessionMiddleware
from django.core.exceptions import ValidationError
from django.test import TestCase, RequestFactory
from django.... | [
11748,
4818,
8079,
198,
11748,
33918,
198,
11748,
12972,
9288,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
651,
62,
7220,
62,
19849,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
19200,
12982,
198... | 3.229682 | 283 |
# ======================================================================
# Copyright CERFACS (October 2018)
# Contributor: Adrien Suau (adrien.suau@cerfacs.fr)
#
# This software is governed by the CeCILL-B license under French law and
# abiding by the rules of distribution of free software. You can use,
# modify an... | [
2,
38093,
1421,
28,
198,
2,
15069,
327,
1137,
37,
2246,
50,
357,
18517,
2864,
8,
198,
2,
25767,
273,
25,
1215,
15355,
1778,
559,
357,
324,
15355,
13,
2385,
559,
31,
2189,
69,
16436,
13,
8310,
8,
198,
2,
198,
2,
770,
3788,
318,
... | 3.79062 | 597 |
import PIL
from PIL import Image, ImageFont, ImageDraw
import math, sys
#This script converts 1bit image to special byte file and code for using in your projects.
png = "pinkie_pie_by_cellularsp-d4j7sj2.gif" #Image file
out_f = png[:-4] + ".img"
print(out_f)
max_ll = 8
im = Image.open(png)
if im.width > 255 or im... | [
11748,
350,
4146,
198,
6738,
350,
4146,
1330,
7412,
11,
7412,
23252,
11,
7412,
25302,
198,
11748,
10688,
11,
25064,
198,
198,
2,
1212,
4226,
26161,
352,
2545,
2939,
284,
2041,
18022,
2393,
290,
2438,
329,
1262,
287,
534,
4493,
13,
198... | 2.306641 | 512 |
base_dir = './resultsMCM/prompted/gpt2mcm-k50-keepmin5-t00'
base_path = base_dir+'/{}-{}/generations.jsonl'
outfile = base_dir+'/all/generations.jsonl'
batch_size = 4000
filenames = [(i*batch_size, i*batch_size+batch_size) for i in range(25)]
print(filenames)
cnt = 0
with open(outfile, 'w') as outfile:
for i, fna... | [
198,
8692,
62,
15908,
796,
705,
19571,
43420,
9655,
44,
14,
16963,
457,
276,
14,
70,
457,
17,
76,
11215,
12,
74,
1120,
12,
14894,
1084,
20,
12,
83,
405,
6,
198,
8692,
62,
6978,
796,
2779,
62,
15908,
10,
26488,
90,
92,
12,
90,
... | 2.053731 | 335 |
import numpy
from dexp.utils.backends import Backend
def get_array_for_cairo_surface(surface: "ImageSurface"): # noqa: F821
"""
Returns an array given a ImageSurface from PyCairo.
Parameters
----------
surface : surface
Returns
-------
RGBA numpy array of shape: (...,4)
"""
... | [
11748,
299,
32152,
198,
198,
6738,
36017,
79,
13,
26791,
13,
1891,
2412,
1330,
5157,
437,
628,
198,
4299,
651,
62,
18747,
62,
1640,
62,
66,
18131,
62,
42029,
7,
42029,
25,
366,
5159,
14214,
2550,
1,
2599,
220,
1303,
645,
20402,
25,
... | 2.721228 | 391 |
#!/usr/bin/env python3
import numpy as np
import h5py
import matplotlib as mp
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from mpl_toolkits import mplot3d
from mpl_toolkits.axes_grid1 import make_axes_locatable
import argparse
import os
# import plotly.graph_objects as go
#========= Config... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
289,
20,
9078,
198,
11748,
2603,
29487,
8019,
355,
29034,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
... | 2.319273 | 1,375 |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
33448,
383,
3012,
4992,
46665,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
... | 3.572864 | 199 |
#!/usr/bin/env python3
"""
This files has the NGram class.
"""
import pickle
from os.path import join
import numpy as np
import re
from tqdm import tqdm
if __name__ == '__main__':
with open(join('corpus', 'poems.pkl'), 'rb') as handle:
poems = pickle.load(handle)
unigram = NGram(poems, n=1)
#b... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
37811,
198,
1212,
3696,
468,
262,
39058,
859,
1398,
13,
198,
37811,
198,
198,
11748,
2298,
293,
198,
6738,
28686,
13,
6978,
1330,
4654,
198,
11748,
299,
32152,
355,
45941,
198... | 2.25 | 232 |
"""
Generate each script with customs variables by client
"""
import os
import glob
import json
import argparse
from pathlib import Path
# paths
path_cloud = str(Path(__file__).absolute().parent.parent)
# path: scripts powershell
path_ori_runbooks = '/scripts/runbooks/'
path_dest_runbooks = '/azure_automatiom_account... | [
37811,
198,
8645,
378,
1123,
4226,
351,
17112,
9633,
416,
5456,
198,
37811,
198,
11748,
28686,
198,
11748,
15095,
198,
11748,
33918,
198,
11748,
1822,
29572,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
2,
13532,
198,
6978,
62,
17721,
... | 2.029952 | 3,973 |
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from ...dataloading import SequenceWrapper
| [
6738,
11192,
273,
11125,
13,
6122,
292,
13,
3866,
36948,
13,
9060,
1330,
7412,
6601,
8645,
1352,
198,
198,
6738,
2644,
67,
10254,
1170,
278,
1330,
45835,
36918,
2848,
628
] | 3.766667 | 30 |
#!/usr/bin/env python
import re
from pathlib import Path
import luigi
from .core import FtarcTask
if __name__ == '__main__':
luigi.run()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
302,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
300,
84,
25754,
198,
198,
6738,
764,
7295,
1330,
45231,
5605,
25714,
628,
198,
198,
361,
11593,
3672,
834,
6624,
7... | 2.578947 | 57 |
#!/usr/bin/env python3
# date: 2020.01.17
# https://stackoverflow.com/questions/59780007/ajax-with-flask-for-real-time-esque-updates-of-sensor-data-on-webpage/
from flask import Flask, request, render_template_string, jsonify
import datetime
import time
import threading
app = Flask(__name__)
running = False # to co... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
3128,
25,
12131,
13,
486,
13,
1558,
198,
2,
3740,
1378,
25558,
2502,
11125,
13,
785,
14,
6138,
507,
14,
3270,
3695,
830,
22,
14,
1228,
897,
12,
4480,
12,
2704,
2093,
... | 2.544974 | 189 |
def test_constructed_account_added_to_database(db_session):
"""Test adding a complete stock entry."""
from ..models import Account
assert len(db_session.query(Account).all()) == 0
account = Account(
username='TEST',
password='1234',
email='some@email.com',
)
db_session.a... | [
4299,
1332,
62,
1102,
16242,
62,
23317,
62,
29373,
62,
1462,
62,
48806,
7,
9945,
62,
29891,
2599,
198,
220,
220,
220,
37227,
14402,
4375,
257,
1844,
4283,
5726,
526,
15931,
198,
220,
220,
220,
422,
11485,
27530,
1330,
10781,
628,
220,... | 2.630952 | 336 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pathlib_mate provide extensive methods, attributes for pathlib.
"""
__version__ = "0.0.6"
__short_description__ = "An extended and more powerful pathlib."
__license__ = "MIT"
__author__ = "Sanhe Hu"
from .pathlib import Path | [
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,
6978,
8019,
62,
9830,
2148,
7667,
5050,
11,
12608,
329,
3108,
8019,
13,
198,
37811,
198,
198,
834,
9... | 2.82 | 100 |
import numpy as np
import torch.nn as nn
import torch
upsampler = nn.Upsample(scale_factor=4, mode='bilinear')
| [
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
198,
198,
4739,
321,
20053,
796,
299,
77,
13,
52,
862,
1403,
7,
9888,
62,
31412,
28,
19,
11,
4235,
11639,
33473,
259,
451,
11537,
628
] | 2.690476 | 42 |
if __name__ == '__main__':
p = Pessoa()
print(Pessoa.comprimentar(p))
print(id(p))
print(p.comprimentar()) | [
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
279,
796,
350,
408,
12162,
3419,
198,
220,
220,
220,
3601,
7,
47,
408,
12162,
13,
785,
1050,
3681,
283,
7,
79,
4008,
198,
220,
220,
220,
3601,... | 2 | 62 |
# The MIT License
#
# Copyright (c) 2008 James Piechota
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy,... | [
2,
383,
17168,
13789,
201,
198,
2,
197,
201,
198,
2,
15069,
357,
66,
8,
3648,
3700,
21690,
354,
4265,
201,
198,
2,
197,
201,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
201,
1... | 3.405594 | 429 |
import json
import logging
import socket
import falcon
from . import db
"""
Server:
uwsgi --module "microWsgi.uwsgiTestApp:assemble()" --http :5050 --stats stats.socket
Client:
curl -s 'http://localhost:5050?test=potatoes' | python -m 'json.tool'
Stats:
nc -U stats.socket | python -m 'json.tool'
"""
logging.basicCo... | [
11748,
33918,
198,
11748,
18931,
198,
11748,
17802,
198,
11748,
24215,
1102,
198,
6738,
764,
1330,
20613,
198,
198,
37811,
198,
10697,
25,
198,
84,
18504,
12397,
1377,
21412,
366,
24055,
46456,
12397,
13,
84,
18504,
12397,
14402,
4677,
25... | 2.458015 | 393 |
# -*- coding: utf-8 -*-
"""Mixins to be implemented by user."""
import pyecore.ecore as ecore
from pyecore.ecore import EDerivedCollection
from pyecore.valuecontainer import EcoreUtils, BadValueError
from pyecore.innerutils import ignored
class ActivityContentMixin(object):
"""User defined mixin class for Activ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
35608,
1040,
284,
307,
9177,
416,
2836,
526,
15931,
198,
198,
11748,
12972,
721,
382,
13,
721,
382,
355,
304,
7295,
198,
6738,
12972,
721,
382,
13,
721,
382,
13... | 3.023129 | 104,762 |
__all__ = ["Nation", "Region", "Telegrams", "WorldAssembly", "World", "TradingCards", "APICall"]
| [
834,
439,
834,
796,
14631,
46108,
1600,
366,
47371,
1600,
366,
6767,
1455,
9474,
1600,
366,
10603,
49670,
1600,
366,
10603,
1600,
366,
2898,
4980,
34,
1371,
1600,
366,
2969,
2149,
439,
8973,
198
] | 2.852941 | 34 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
12131,
3012,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
4... | 2.423958 | 11,829 |
from rest_framework import generics, permissions
from TvFY.account.serializers import AccountSerializer, CreateAccountSerializer
| [
6738,
1334,
62,
30604,
1330,
1152,
873,
11,
21627,
198,
198,
6738,
309,
85,
43833,
13,
23317,
13,
46911,
11341,
1330,
10781,
32634,
7509,
11,
13610,
30116,
32634,
7509,
628,
198
] | 4.258065 | 31 |
#!/usr/bin/python3
import chainer
import numpy as np
import onnx_chainer
import large_models
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
11748,
6333,
263,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
319,
77,
87,
62,
7983,
263,
198,
198,
11748,
1588,
62,
27530,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705... | 2.555556 | 54 |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
INSTALL_REQUIRES = ['neo4j-driver>=4.1.1',
'tqdm==4.48.2']
setuptools.setup(
name="pedgraph",
version="0.0.1",
author="Ólavur Mortensen",
author_email="olavurmortensen@gmail.com",
description... | [
11748,
900,
37623,
10141,
198,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
1600,
366,
81,
4943,
355,
277,
71,
25,
198,
220,
220,
220,
890,
62,
11213,
796,
277,
71,
13,
961,
3419,
198,
198,
38604,
7036,
62,
2200,
10917,
4663,
1546... | 2.445283 | 265 |
"""
Q380
Insert Delete GetRandom O(1)
Medium
Array; Hash Table; Design.
Design a data structure that supports all following operations in average O(1) time.
1. insert(val): Inserts an item val to the set if not already present.
2. remove(val): Removes an item val from the set if present.
3. getRandom: Returns a rand... | [
37811,
198,
48,
23734,
198,
44402,
23520,
3497,
29531,
440,
7,
16,
8,
198,
31205,
198,
198,
19182,
26,
21059,
8655,
26,
8495,
13,
198,
198,
23067,
257,
1366,
4645,
326,
6971,
477,
1708,
4560,
287,
2811,
440,
7,
16,
8,
640,
13,
198... | 3.338776 | 245 |
#!/usr/bin/python
#coding = utf-8
from RiskQuantLib.Security.base import base
from RiskQuantLib.Set.Security.Stock.stock import setStock
class stock(base,setStock):
"""
stock is one of the five basic classes.
"""
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
66,
7656,
796,
3384,
69,
12,
23,
198,
198,
6738,
19602,
24915,
25835,
13,
24074,
13,
8692,
1330,
2779,
198,
6738,
19602,
24915,
25835,
13,
7248,
13,
24074,
13,
26207,
13,
13578,
1330,
90... | 2.876543 | 81 |
import tropo_mods.auto_sns as auto_sns
from troposphere import Template
test_sns_yaml = """\
Resources:
SNSTopic1:
Properties:
TopicName: my_new_topic
Type: AWS::SNS::Topic
"""
t = Template()
topic = auto_sns.AutoSNS(t, topic_name="my_new_topic", email="test@me.com")
assert test_sns_yaml == topic.pri... | [
11748,
14673,
78,
62,
24122,
13,
23736,
62,
82,
5907,
355,
8295,
62,
82,
5907,
198,
6738,
14673,
22829,
1330,
37350,
198,
198,
9288,
62,
82,
5907,
62,
88,
43695,
796,
37227,
59,
198,
33236,
25,
198,
220,
11346,
2257,
16603,
16,
25,
... | 2.448529 | 136 |
#!/usr/bin/python
#Author: Jared Adolf-Bryfogle
import sys
from collections import defaultdict
from jade2.basic.path import *
from jade2.basic.threading.Threader import Threader
from jade2.basic.structure import Structure
from jade2.basic.path import *
#from jade2.antibody import util as ab_util
class PyMolScriptWr... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
13838,
25,
19116,
35333,
12,
33,
563,
69,
2467,
198,
198,
11748,
25064,
198,
6738,
17268,
1330,
4277,
11600,
198,
198,
6738,
474,
671,
17,
13,
35487,
13,
6978,
1330,
1635,
198,
6738,
474... | 2.226863 | 9,433 |
"""This module alters the testing system path to provide access to app."""
| [
37811,
1212,
8265,
40866,
262,
4856,
1080,
3108,
284,
2148,
1895,
284,
598,
526,
15931,
198
] | 4.6875 | 16 |
import os
import sys
import gridfs
from sleeplearning.lib.models.single_chan_expert import SingleChanExpert
root_dir = os.path.abspath(os.path.join(os.path.dirname('__file__'), '..'))
sys.path.insert(0, root_dir)
from pymongo import MongoClient
from torch import nn
from torch.nn.init import xavier_normal_ as xavier_... | [
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
10706,
9501,
198,
198,
6738,
3993,
40684,
13,
8019,
13,
27530,
13,
29762,
62,
3147,
62,
1069,
11766,
1330,
14206,
48407,
3109,
11766,
198,
198,
15763,
62,
15908,
796,
28686,
13,
6978,
13... | 3.015957 | 188 |
import os
import sys
import boto3
from linebot import LineBotApi, WebhookHandler
| [
11748,
28686,
198,
11748,
25064,
198,
11748,
275,
2069,
18,
198,
198,
6738,
1627,
13645,
1330,
6910,
20630,
32,
14415,
11,
5313,
25480,
25060,
628,
198
] | 3.230769 | 26 |
from bokeh.plotting import figure, show, output_file
from bokeh.models import ColumnDataSource, Range1d, LabelSet, Label
output_file("label.html", title="label.py example")
source = ColumnDataSource(data=dict(height=[66, 71, 72, 68, 58, 62],
weight=[165, 189, 220, 141, 260, 174],
... | [
6738,
1489,
365,
71,
13,
29487,
889,
1330,
3785,
11,
905,
11,
5072,
62,
7753,
198,
6738,
1489,
365,
71,
13,
27530,
1330,
29201,
6601,
7416,
11,
13667,
16,
67,
11,
36052,
7248,
11,
36052,
198,
198,
22915,
62,
7753,
7203,
18242,
13,
... | 2.125 | 552 |
import os
from os.path import basename
import sys
import json
import requests
import matplotlib.pyplot as plt
from PIL import Image
from io import BytesIO
# import cv2
import numpy as np
# import config_own
import logging
########## To-Do ##########
### optimization ### warping ###
### the shot-raw-img is needed to b... | [
11748,
28686,
198,
6738,
28686,
13,
6978,
1330,
1615,
12453,
198,
11748,
25064,
198,
11748,
33918,
198,
11748,
7007,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
33245,
1330,
... | 2.832432 | 370 |
'''
Created on 2018. 4. 26.
@author: lsm
'''
name = ["이상면", "Tom", "Jerry", "Mike", "이상면", "Tom"]
print(find_same_name(name))
name = ["이상면", "Tom", "Jerry", "Mike", "이상면", "Mike"]
print(find_same_name(name))
name = ["이상면", "Tom", "Jerry", "Mike", "Mike", "Jerry", "tom"]
print(find_same_name(name))
| [
7061,
6,
198,
41972,
319,
2864,
13,
604,
13,
2608,
13,
198,
198,
31,
9800,
25,
300,
5796,
198,
7061,
6,
198,
198,
3672,
796,
14631,
35975,
112,
168,
225,
223,
167,
102,
112,
1600,
366,
13787,
1600,
366,
43462,
1600,
366,
16073,
16... | 1.90566 | 159 |
"""
To easily reproduce experiments, and avoid passing several command line arguments, we implemented
a curriculum utility. Parameters can be set in a curriculum dictionary.
Curriculum Schema:
Numerical keys in the curriculum specify an upsample step. When the current step matches the upsample step,
the value... | [
37811,
198,
2514,
3538,
22919,
10256,
11,
290,
3368,
6427,
1811,
3141,
1627,
7159,
11,
356,
9177,
198,
64,
20583,
10361,
13,
40117,
460,
307,
900,
287,
257,
20583,
22155,
13,
198,
198,
26628,
1173,
14452,
10011,
2611,
25,
628,
220,
22... | 2.306595 | 2,593 |
#!/usr/bin/python3
# -*- encoding: utf-8 -*-
#
from sys import argv
import random
import os.path
import hashlib
import time
import stolas.stolas
import stolas.protocol
from stolas.betterui import pprint as print
from network import manual_stolas_prompt
from common import network_collapse, mean
if __name__ == '__mai... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
198,
6738,
25064,
1330,
1822,
85,
198,
11748,
4738,
198,
11748,
28686,
13,
6978,
198,
11748,
12234,
8019,
198,
1... | 2.504132 | 242 |
'''
Comparing single layer MLP with deep MLP (using TensorFlow)
'''
import tensorflow as tf
import numpy as np
import pickle
import timeit
start = timeit.default_timer()
# Create model
# Add more hidden layers to create deeper networks
# Remember to connect the final hidden layer to the out_layer
# Do not change thi... | [
7061,
6,
198,
7293,
1723,
2060,
7679,
10373,
47,
351,
2769,
10373,
47,
357,
3500,
309,
22854,
37535,
8,
198,
7061,
6,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2298,
293,
198,
1174... | 2.617198 | 721 |
import torch.nn as nn | [
11748,
28034,
13,
20471,
355,
299,
77
] | 3 | 7 |
if __name__ == '__main__':
keys = [
'she',
'sells',
'seashells',
'by',
'the',
'seashore',
'the',
'shells',
'she',
'sells',
'are',
'surely',
'seashells',
]
expected = sorted(keys[:])
assert keys !... | [
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
8251,
796,
685,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7091,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7255,
82,
3256,
198... | 1.729358 | 218 |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2019 Malcolm Ramsay <malramsay64@gmail.com>
#
# Distributed under terms of the MIT license.
"""Module for reading and processing input files."""
from ._util import TrackedMotion
from .dynamics import Dynamics
from .relaxations import La... | [
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,
43907,
25,
69,
12685,
28,
40477,
12,
23,
198,
2,
198,
2,
15069,
10673,
13130,
20002,
47959,
1279,
7617,
94... | 2.821229 | 179 |
import json
import logging
import os
logger = logging.getLogger(__name__)
| [
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628
] | 3.166667 | 24 |
import click
import string
import random
import time
import pandas as pd
from faker import Faker
fake = Faker('en')
class anon(object):
'''Initialize a df as an anon object.
Args:
df: pandas dataframe
Returns:
anon object
'''
def anon_name(self, col):
''' Replace entries... | [
11748,
3904,
198,
11748,
4731,
198,
11748,
4738,
198,
11748,
640,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
277,
3110,
1330,
376,
3110,
628,
198,
30706,
796,
376,
3110,
10786,
268,
11537,
628,
198,
4871,
281,
261,
7,
15252,
259... | 2.150953 | 1,888 |
import gym
import numpy as np
import operator
env = gym.make('MountainCar-v0')
possible_actions = env.action_space.n
print 'Possible actions are {}'.format(possible_actions)
epsilonlearn = EpsilonGreedy()
for episode in xrange(epsilonlearn.episodes):
observation = env.reset()
while True:
env.render(... | [
11748,
11550,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10088,
198,
198,
24330,
796,
11550,
13,
15883,
10786,
44,
18635,
9914,
12,
85,
15,
11537,
198,
79,
4733,
62,
4658,
796,
17365,
13,
2673,
62,
13200,
13,
77,
198,
4798,
705,
... | 2.495726 | 234 |
# vim: set fileencoding=utf-8
import unittest
import decimal
from eactivities import utils as utils
| [
2,
43907,
25,
900,
2393,
12685,
7656,
28,
40477,
12,
23,
198,
198,
11748,
555,
715,
395,
198,
11748,
32465,
198,
198,
6738,
304,
15791,
871,
1330,
3384,
4487,
355,
3384,
4487,
628,
628,
628,
198
] | 3 | 36 |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | [
2,
15069,
12131,
43208,
21852,
1766,
1539,
12052,
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... | 4.073892 | 203 |
from datetime import datetime
from Training_Raw_data_validation.rawValidation import Raw_Data_validation
from DataTransform_Training.DataTransformation import dataTransform
from application_logging import logger | [
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
13614,
62,
27369,
62,
7890,
62,
12102,
341,
13,
1831,
7762,
24765,
1330,
16089,
62,
6601,
62,
12102,
341,
198,
6738,
6060,
41762,
62,
44357,
13,
6601,
8291,
1161,
1330,
1366,
41762,
198,
... | 4.395833 | 48 |
from django.shortcuts import render
import json | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
11748,
33918
] | 4.272727 | 11 |
from models.net import Pipeline, full_loss | [
6738,
4981,
13,
3262,
1330,
37709,
11,
1336,
62,
22462
] | 4.2 | 10 |
# SPDX-License-Identifier: Apache-2.0
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np # type: ignore
import onnx
from ..base import Base
from . import expect
| [
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
... | 3.463415 | 82 |
import functools
from collections import OrderedDict
from typing import Callable, Dict, List, Optional, Union
import gorilla
import torch
import torch.nn as nn
try:
import spconv
from spconv.modules import SparseModule
except:
pass
from .block import ResidualBlock, VGGBlock, AsymResidualBlock
| [
11748,
1257,
310,
10141,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
6738,
19720,
1330,
4889,
540,
11,
360,
713,
11,
7343,
11,
32233,
11,
4479,
198,
198,
11748,
45314,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
... | 3.229167 | 96 |
import falcon
import skyline
import outlier
import backend
api = falcon.API()
# Skyline Resources
skyline_MedianAbsoluteDeviation = skyline.MedianAbsoluteDeviation()
skyline_Grubbs = skyline.Grubbs()
skyline_FirstHourAverage = skyline.FirstHourAverage()
skyline_HistogramBins = skyline.HistogramBins()
skyline_LeastSqu... | [
11748,
24215,
1102,
198,
11748,
47566,
198,
11748,
503,
2505,
198,
11748,
30203,
198,
198,
15042,
796,
24215,
1102,
13,
17614,
3419,
198,
198,
2,
5274,
1370,
13864,
198,
15688,
1370,
62,
9921,
666,
24849,
3552,
13603,
3920,
796,
47566,
... | 2.49922 | 641 |
# Generated by Django 2.1.5 on 2019-03-05 07:35
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
20,
319,
13130,
12,
3070,
12,
2713,
8753,
25,
2327,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import json
from pathlib import Path
from typing import Dict, List, NewType, Tuple
ZoneKey = NewType("ZoneKey", str)
Point = NewType("Point", Tuple[float, float])
BoundingBox = NewType("BoundingBox", List[Point])
CONFIG_DIR = Path(__file__).parent.parent.parent.parent.joinpath("config").resolve()
# Read JOSN files
Z... | [
11748,
33918,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
11,
968,
6030,
11,
309,
29291,
198,
198,
26961,
9218,
796,
968,
6030,
7203,
26961,
9218,
1600,
965,
8,
198,
12727,
796,
968,
6030,
7203,
127... | 2.376569 | 717 |
"""
This module contains shared fixtures.
"""
import json
from pathlib import Path
# pip installed
import pytest # installed with webdriver_manager
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.firefox import GeckoDriverManager
# scope="session" mean... | [
37811,
198,
1212,
8265,
4909,
4888,
34609,
13,
198,
37811,
198,
198,
11748,
33918,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
2,
7347,
6589,
198,
11748,
12972,
9288,
220,
1303,
6589,
351,
3992,
26230,
62,
37153,
198,
6738,
384,
11925... | 3.216374 | 684 |
# coding: utf-8
"""
FlashBlade REST API
A lightweight client for FlashBlade REST API 2.2, developed by Pure Storage, Inc. (http://www.purestorage.com/).
OpenAPI spec version: 2.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
220,
220,
220,
9973,
47520,
30617,
7824,
628,
220,
220,
220,
317,
18700,
5456,
329,
9973,
47520,
30617,
7824,
362,
13,
17,
11,
4166,
416,
17129,
20514,
11,
3457,
13,
357,
4023,
... | 3.181159 | 138 |
# coding=utf-8
import logging
from cwharaj.items import Ad, CacheItem, City, Member, OpensooqPhone
from cwharaj.parser.base_parser import BaseParser
from cwharaj.parser.utils.harajs_comments import HarajsComments
from cwharaj.parser.utils.harajs_section import HarajsSection
from cwharaj.parser.utils.timer_opensooq_com... | [
2,
19617,
28,
40477,
12,
23,
198,
11748,
18931,
198,
198,
6738,
269,
1929,
283,
1228,
13,
23814,
1330,
1215,
11,
34088,
7449,
11,
2254,
11,
10239,
11,
4946,
568,
78,
80,
6132,
198,
6738,
269,
1929,
283,
1228,
13,
48610,
13,
8692,
... | 2.98374 | 123 |
# VXT
# Developed by Christian Visintin
#
# MIT License
# Copyright (c) 2021 Christian Visintin
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitati... | [
2,
569,
25010,
198,
2,
6013,
276,
416,
4302,
6911,
600,
259,
198,
2,
198,
2,
17168,
13789,
198,
2,
15069,
357,
66,
8,
33448,
4302,
6911,
600,
259,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16... | 2.650602 | 1,411 |
from __future__ import absolute_import, division, print_function
import os
import re
import socket
import sys
from itertools import count
from functools import partial
from subprocess import Popen
from subprocess import PIPE
from time import sleep
import click
from distutils.spawn import find_executable
from comp... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
628,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
17802,
198,
11748,
25064,
198,
198,
6738,
340,
861,
10141,
1330,
954,
198,
6738,
1257,
310,
10141,
1330,
... | 3.326797 | 153 |