content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
#!/usr/bin/env python3
import os
import shutil
from pathlib import Path
from subprocess import run
from typing import List, Any, Union
if __name__ == "__main__":
generate_icons(Path.cwd().joinpath('icon.svg'), Path.cwd())
generate_pdf(Path.cwd().joinpath('icon.svg'), Path.cwd())
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
850,
14681,
1330,
1057,
198,
6738,
19720,
1330,
7343,
11,
4377,
11,
4479,
628,
628,
198,
361,
11... | 2.834951 | 103 |
"""Click (CLI) Util
methods:
command_collection: Create <click> Command-Line-Interface by grouping all commands.
is_crud: Check if value is a subclass ot <CRUD>.
"""
import click
TITLE = "Fastberry"
HELP_TEXT = f"""
Welcome to { TITLE }
"""
def is_click(module):
"""Check if is <click>"""
return is... | [
37811,
8164,
357,
5097,
40,
8,
7273,
346,
198,
198,
24396,
82,
25,
198,
220,
220,
220,
3141,
62,
43681,
25,
13610,
1279,
12976,
29,
9455,
12,
13949,
12,
39317,
416,
36115,
477,
9729,
13,
198,
220,
220,
220,
318,
62,
6098,
463,
25,... | 2.890052 | 191 |
# Generated by Django 2.1.11 on 2020-08-13 16:56
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
1157,
319,
12131,
12,
2919,
12,
1485,
1467,
25,
3980,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.875 | 32 |
# python3
# Copyright 2021 InstaDeep Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | [
2,
21015,
18,
198,
2,
15069,
33448,
2262,
64,
29744,
12052,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
284... | 2.827183 | 1,111 |
from interface import * #Importa funções do arquivo "interface.py"
from random import choice #Importa função "choice" da biblioteca "random"
from time import sleep #Importa função "sleep" da biblioteca "time"
senha = [] #Lista da senha
#Checa se o número inteiro digitado é válido
#Input da quantidade de senhas
#Inp... | [
6738,
7071,
1330,
1635,
1303,
20939,
64,
1257,
16175,
127,
113,
274,
466,
610,
421,
23593,
366,
39994,
13,
9078,
1,
198,
6738,
4738,
1330,
3572,
1303,
20939,
64,
1257,
16175,
28749,
366,
25541,
1,
12379,
275,
29142,
313,
31047,
366,
2... | 2.807692 | 130 |
# Conversion from Mathlab to Python:
# http://www2.meteo.uni-bonn.de/staff/venema/themes/surrogates/pmodel/pmodel.m
# *** function varargout = pmodel(noValues, p, slope) ***
# This function generates a multifractal time series using the p-model.
# Optionally you can also filter the result from the p-model in Fourier
#... | [
2,
44101,
422,
16320,
23912,
284,
11361,
25,
198,
2,
2638,
1378,
2503,
17,
13,
4164,
68,
78,
13,
35657,
12,
4189,
77,
13,
2934,
14,
28120,
14,
574,
19687,
14,
1169,
6880,
14,
11793,
3828,
689,
14,
4426,
375,
417,
14,
4426,
375,
... | 3.30076 | 921 |
from django.urls import path, include
from django.views.generic import TemplateView
from rest_framework.schemas import get_schema_view
from rest_framework.routers import DefaultRouter
from . import views
from scraping.xe import PropertyType, Xe
router = DefaultRouter()
router.register(r'load_config', views.LoadConfig... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
2291,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
37350,
7680,
198,
6738,
1334,
62,
30604,
13,
1416,
4411,
292,
1330,
651,
62,
15952,
2611,
62,
1177,
198,
6738,
1334,
62,
3060... | 3.183824 | 136 |
"""
socket server request handlers leveraged by core servers.
"""
import logging
import os
import shlex
import shutil
import socketserver
import sys
import threading
import time
from itertools import repeat
from queue import Empty, Queue
from typing import Optional
from core import utils
from core.api.tlv import core... | [
37811,
198,
44971,
4382,
2581,
32847,
17124,
1886,
416,
4755,
9597,
13,
198,
37811,
198,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
427,
2588,
198,
11748,
4423,
346,
198,
11748,
37037,
18497,
198,
11748,
25064,
198,
11748,
4704,
27... | 2.014256 | 30,022 |
from coagg import create_app
app = create_app('config')
app.run()
| [
6738,
763,
9460,
1330,
2251,
62,
1324,
198,
198,
1324,
796,
2251,
62,
1324,
10786,
11250,
11537,
198,
198,
1324,
13,
5143,
3419,
198
] | 2.833333 | 24 |
from datetime import datetime, timedelta
import github3
import jwt
import os
import re
import requests
import time
# Used by both the GithubApp and GithubAppInstall classes for pagination.
# Store login tokens, including expiration, for reuse.
tokens = {}
| [
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
11748,
33084,
18,
198,
11748,
474,
46569,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
7007,
198,
11748,
640,
628,
198,
2,
16718,
416,
1111,
262,
38994,
4677,
290,
38994,
467... | 3.852941 | 68 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
from cli import option,options
import random
THE = options(
"""
ETHEL v0.1.0 multi-objective rule generator
(c) 2018: Tim Menzies timm@ieee.org, BSD 2-Clause License
""",
"""
Copyright (c) 2018, Tim Menzies
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permi... | [
6738,
537,
72,
1330,
3038,
11,
25811,
198,
11748,
4738,
198,
198,
10970,
796,
3689,
7,
198,
37811,
198,
20702,
3698,
410,
15,
13,
16,
13,
15,
5021,
12,
15252,
425,
3896,
17301,
198,
7,
66,
8,
2864,
25,
5045,
6065,
89,
444,
4628,
... | 2.66 | 1,000 |
""""
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES ... | [
15931,
15931,
198,
15269,
12131,
383,
2944,
2611,
46665,
13,
198,
198,
1212,
2723,
2438,
318,
11971,
739,
262,
347,
10305,
12,
7635,
5964,
1043,
287,
262,
198,
43,
2149,
24290,
2393,
287,
262,
6808,
8619,
286,
428,
2723,
5509,
13,
198... | 2.340094 | 4,487 |
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 2 17:27:32 2021
@author: wangh0m
"""
import numpy as np
def osculating_circle(V0,V1,V3):
""" Frenet frame
inscribed circle of three points
t = l1**2*(V3-V0) - l3**2*(V1-V0)
"""
if V0.reshape(-1,3).shape[0] ==1:
l1 = np.linalg.norm(V1-V0)
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
2892,
2447,
220,
362,
1596,
25,
1983,
25,
2624,
33448,
198,
198,
31,
9800,
25,
266,
272,
456,
15,
76,
198,
37811,
198,
198,
11748,
299,
32152,
... | 1.647727 | 4,224 |
# coding: utf-8
#
import adbutils
import pytest
from adbutils import adb
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
198,
11748,
512,
4360,
4487,
198,
11748,
12972,
9288,
198,
6738,
512,
4360,
4487,
1330,
512,
65,
628,
198
] | 2.678571 | 28 |
# work-arounds on micropython unix
# Copyright © 2020 by Thorsten von Eicken.
STA_IF = __interface()
| [
2,
670,
12,
283,
3733,
319,
12314,
1773,
7535,
555,
844,
198,
2,
15069,
10673,
12131,
416,
13002,
26400,
18042,
412,
5973,
13,
198,
2257,
32,
62,
5064,
796,
11593,
39994,
3419,
198
] | 3.060606 | 33 |
'''A set of strategies for retaining peaks following deconvolution to
recover from low quality spectra. These methods are not recommended for
use on spectra where most ions are multiply charged.
These objects are meant to be provided to :func:`~.deconvolut_peaks`'s
`retention_strategy` argument, which will take care o... | [
7061,
6,
32,
900,
286,
10064,
329,
26645,
25740,
1708,
37431,
85,
2122,
284,
198,
260,
9631,
422,
1877,
3081,
5444,
430,
13,
2312,
5050,
389,
407,
7151,
329,
198,
1904,
319,
5444,
430,
810,
749,
39270,
389,
29162,
5047,
13,
198,
198... | 2.801805 | 2,437 |
import subprocess
import discord
import asyncio
import configparser
cfg = configparser.ConfigParser()
cfg.read('auth.ini')
TOKEN = cfg.get('discord', 'token')
POLLING = {
"command": cfg.get('polling', 'command'),
"interval": float(cfg.get('polling', 'interval')),
"channel": cfg.get('polling', 'channel')... | [
11748,
850,
14681,
198,
11748,
36446,
198,
11748,
30351,
952,
198,
11748,
4566,
48610,
628,
198,
37581,
796,
4566,
48610,
13,
16934,
46677,
3419,
198,
37581,
13,
961,
10786,
18439,
13,
5362,
11537,
628,
198,
10468,
43959,
796,
30218,
70,
... | 2.7 | 160 |
#!/usr/bin/env python3
import os
import pickle
from video_datasets_api.cater.definitions import NUM_CLASSES_TASK2
from video_datasets_api.cater.cut_scenes import generate_task2_dataset_cut_two_time_slots
from video_datasets_api.cater.generate_labels_from_scenes import generate_task2_labels_from_all_actions, class_key... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
198,
6738,
2008,
62,
19608,
292,
1039,
62,
15042,
13,
66,
729,
13,
4299,
50101,
1330,
36871,
62,
31631,
1546,
62,
51,
1921,
42,
17,... | 2.126139 | 1,427 |
# This sample tests the type checker's ability to determine which
# symbols are potentially unbound.
if True:
# This should generate an error because 'X' is not yet declared.
a: X
| [
2,
770,
6291,
5254,
262,
2099,
2198,
263,
338,
2694,
284,
5004,
543,
198,
2,
14354,
389,
6196,
555,
7784,
13,
198,
198,
361,
6407,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
770,
815,
7716,
281,
4049,
780,
705,
55,
6,
318... | 3.403509 | 57 |
from typing import Sequence
from snuba.clickhouse.columns import Column, DateTime, UInt
from snuba.clusters.storage_sets import StorageSetKey
from snuba.migrations import migration, operations, table_engines
from snuba.migrations.columns import MigrationModifiers as Modifiers
columns = [
# Kafka topic offset
... | [
6738,
19720,
1330,
45835,
198,
198,
6738,
3013,
22013,
13,
12976,
4803,
13,
28665,
82,
1330,
29201,
11,
7536,
7575,
11,
471,
5317,
198,
6738,
3013,
22013,
13,
565,
13654,
13,
35350,
62,
28709,
1330,
20514,
7248,
9218,
198,
6738,
3013,
... | 3.127168 | 346 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
d = {'Michael':95, 'Henry':96, 'Emily':97}
d['Lucy'] = 94
d['Lucy'] = 91
key = (1, 2, 3)
d[key] = 98
print(d['Michael'])
d.pop('Michael')
print(d)
print('Tom' in d)
print(d.get('Tom'))
print(d.get('Tom'), -1)
s1 = set([1, 2, 2, 3, 3])
s2 = set([2, 3, 4])
s3 = set((1, 2))... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
67,
796,
1391,
6,
13256,
10354,
3865,
11,
705,
32476,
10354,
4846,
11,
705,
48640,
10354,
5607,
92,
198,
67,... | 1.828194 | 227 |
# 2.7 Specifying Additional Variable Information
import os
import settings as st
from revoscalepy import rx_import, rx_get_info
# Importing Delimited Text Data
inFileAddVars = os.path.join(st.SAMPLE_DATA_DIR,'claims.txt')
## REM: Our RxOptions.set_option("OutDataPath", [RESULTS_LOCATION])
## is not taken into account... | [
2,
362,
13,
22,
18291,
4035,
15891,
35748,
6188,
198,
11748,
28686,
198,
11748,
6460,
355,
336,
198,
6738,
2710,
418,
9948,
538,
88,
1330,
374,
87,
62,
11748,
11,
374,
87,
62,
1136,
62,
10951,
198,
198,
2,
17267,
278,
4216,
320,
8... | 2.791845 | 466 |
#!/usr/bin/env python
# created by BBruceyuan on 18-4-27
__verison__ = '0.0.3'
__author__ = 'BBruceyuan'
from bugfreepy.CommentWrite import CommentWrite
from bugfreepy.main import main
__all__ = [
CommentWrite,
main
]
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
2727,
416,
12597,
26524,
88,
7258,
319,
1248,
12,
19,
12,
1983,
198,
198,
834,
332,
1653,
834,
796,
705,
15,
13,
15,
13,
18,
6,
198,
834,
9800,
834,
796,
705,
15199,
26524,
88... | 2.5 | 92 |
# Third-party libraries
import numpy as np
from tensorflow.contrib.learn.python.learn.datasets import base
from tensorflow.python.framework import random_seed
# DataSet class
# Read the data
| [
2,
10467,
12,
10608,
12782,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
6738,
11192,
273,
11125,
13,
3642,
822,
13,
35720,
13,
29412,
13,
35720,
13,
19608,
292,
1039,
1330,
2779,
201,
198,
6738,
11192,
273,
11125,
13,
29412,
13... | 3.092308 | 65 |
#!/usr/bin/env python3
from pyrobot import Robot
bot = Robot('locobot')
bot.camera.reset()
camera_pose = [0, 0.7]
bot.camera.set_pan_tilt(camera_pose[0], camera_pose[1], wait=True)
camera_pose = [-0.4, 0.7]
bot.camera.set_pan_tilt(camera_pose[0], camera_pose[1], wait=True)
camera_pose = [0.4, 0.7]
bot.camera.set_... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
6738,
12972,
305,
13645,
1330,
16071,
198,
198,
13645,
796,
16071,
10786,
17946,
672,
313,
11537,
198,
198,
13645,
13,
25695,
13,
42503,
3419,
198,
198,
25695,
62,
3455,
796,
... | 2.227723 | 303 |
import os
import time
import smtplib
from email import encoders
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.application import MIMEApplication
from getpass import getpass
import config
from receivers import get_receivers
# ==... | [
11748,
28686,
198,
11748,
640,
198,
11748,
895,
83,
489,
571,
198,
6738,
3053,
1330,
2207,
375,
364,
198,
6738,
3053,
13,
76,
524,
13,
8692,
1330,
337,
12789,
14881,
198,
6738,
3053,
13,
76,
524,
13,
5239,
1330,
337,
3955,
2767,
230... | 2.553273 | 779 |
from .timeseries import Timeseries | [
6738,
764,
22355,
10640,
1330,
3782,
10640
] | 4.857143 | 7 |
# Copyright 2021 Google Research.
#
# 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 writ... | [
2,
15069,
33448,
3012,
4992,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
... | 2.914176 | 1,037 |
import unittest
import pygrading as gg
from pygrading import Job
from pygrading import TestCases
| [
11748,
555,
715,
395,
198,
11748,
12972,
29247,
355,
308,
70,
198,
198,
6738,
12972,
29247,
1330,
15768,
198,
6738,
12972,
29247,
1330,
6208,
34,
1386,
628
] | 3.666667 | 27 |
import pickle
import os
import numpy as np
import torch
from .model import TD3Network
from typing import NamedTuple
from .utils import write_gif
import gym
| [
11748,
2298,
293,
198,
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
764,
19849,
1330,
13320,
18,
26245,
198,
6738,
19720,
1330,
34441,
51,
29291,
198,
6738,
764,
26791,
1330,
3551,
62,
27908,
198,
11748,... | 3.697674 | 43 |
import calendar
import datetime
import re
from django import forms
from django.utils.translation import ugettext_lazy as _
from auth.models import User
from sell.forms import ShippingDataForm
from core.thumbs import ImageWithThumbsField
from django.contrib.localflavor.us.forms import USStateField, USStateSelect
MONTH... | [
11748,
11845,
198,
11748,
4818,
8079,
198,
11748,
302,
198,
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
12582,
355,
4808,
198,
198,
6738,
6284,
13,
27530,
1330,
11787,
19... | 2.373942 | 591 |
""" Module to automate message deletion. """
from asyncio import sleep
from os import path, remove
from os.path import exists
from PIL import Image, UnidentifiedImageError
from pagermaid import redis, log, redis_status
from pagermaid.listener import listener
from pagermaid.utils import alias_command
@listener(is_plug... | [
37811,
19937,
284,
43511,
3275,
39948,
13,
37227,
198,
6738,
30351,
952,
1330,
3993,
198,
6738,
28686,
1330,
3108,
11,
4781,
198,
6738,
28686,
13,
6978,
1330,
7160,
198,
6738,
350,
4146,
1330,
7412,
11,
791,
19107,
5159,
12331,
198,
673... | 1.740514 | 2,451 |
from bottle import run, get, post, request
import requests
# Get user form submission (email, name, password)
# Creates an XML form out of the user input
# Sends XML form to a specified url
# Creates a user signup form and sends it to Server 2
@get("/signup")
# Receives the signup form as CSV
@post("/signup")
@... | [
6738,
9294,
1330,
1057,
11,
651,
11,
1281,
11,
2581,
198,
11748,
7007,
628,
198,
2,
3497,
2836,
1296,
14498,
357,
12888,
11,
1438,
11,
9206,
8,
198,
198,
2,
7921,
274,
281,
23735,
1296,
503,
286,
262,
2836,
5128,
628,
198,
2,
311,... | 3.169118 | 136 |
#!/usr/bin/env python
"""
CREATED AT: 2021/9/2
Des:
https://leetcode.com/problems/unique-binary-search-trees-ii/
https://leetcode.com/explore/item/3961
GITHUB: https://github.com/Jiezhi/myleetcode
Difficulty: 1
"""
import itertools
from typing import List, Optional
from tool import print_results
from tree_node impor... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
43387,
11617,
5161,
25,
33448,
14,
24,
14,
17,
198,
5960,
25,
198,
5450,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
34642,
12,
39491,
12,
12947,
12,
83,
6037,
... | 2.673469 | 147 |
# -*- coding: utf-8 -*-
##
# \file miki_imp_model.py
# \title Definition of Miki's impedance model that return the characteristic
# surface impedance used in the analytic models.
# \author Pierre Chobeau
# \version 0.1
# \license BSD 3-Clause License
# \inst UMRAE (Ifsttar Nantes), LAUM... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
2235,
201,
198,
2,
3467,
7753,
220,
220,
220,
220,
285,
5580,
62,
11011,
62,
19849,
13,
9078,
201,
198,
2,
3467,
7839,
220,
220,
220,
30396,
286,
337,
5580,
338... | 1.892857 | 1,316 |
from pathlib import Path
import pytest
from odinapi.views.read_mipas import read_mipas_file
from .partiallistmatch import PartialListMatch
@pytest.fixture
| [
6738,
3108,
8019,
1330,
10644,
198,
11748,
12972,
9288,
198,
198,
6738,
16298,
259,
15042,
13,
33571,
13,
961,
62,
76,
541,
292,
1330,
1100,
62,
76,
541,
292,
62,
7753,
198,
198,
6738,
764,
3911,
72,
439,
396,
15699,
1330,
43689,
80... | 3.018868 | 53 |
import sys
import gdal
from gdalconst import *
import os
import numpy as np
from subprocess import call
def reproject_rasters(path, ras, outpath, env_path, output_ras_proj=None, input_ras_proj=None, resample=None, pixel_size=None):
"""
Reprojects the rasters based on coord system given.
:param path:
... | [
11748,
25064,
198,
11748,
308,
31748,
198,
6738,
308,
31748,
9979,
1330,
1635,
198,
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
850,
14681,
1330,
869,
628,
198,
4299,
43969,
752,
62,
81,
7060,
7,
6978,
11,
374,
2... | 2.091153 | 2,984 |
# Generated by Django 3.2.7 on 2021-12-09 11:49
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
22,
319,
33448,
12,
1065,
12,
2931,
1367,
25,
2920,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import os
import socket
import unittest
from meddlr.utils.cluster import Cluster
from ..util import temp_env
| [
11748,
28686,
198,
11748,
17802,
198,
11748,
555,
715,
395,
198,
198,
6738,
26551,
14050,
13,
26791,
13,
565,
5819,
1330,
38279,
198,
198,
6738,
11485,
22602,
1330,
20218,
62,
24330,
628
] | 3.5 | 32 |
#!/usr/bin/env python3
islower = __import__('7-islower').islower
print("z is {}".format("lower" if islower("z") else "upper"))
print("Z is {}".format("lower" if islower("Z") else "upper"))
print("A is {}".format("lower" if islower("A") else "upper"))
print("3 is {}".format("lower" if islower("3") else "upper"))
print(... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
3044,
789,
796,
11593,
11748,
834,
10786,
22,
12,
3044,
789,
27691,
3044,
789,
198,
198,
4798,
7203,
89,
318,
23884,
1911,
18982,
7203,
21037,
1,
611,
318,
21037,
7203,
89,
4943,
... | 2.870229 | 131 |
'''
Author: Hao-Ting Wang
Date: 23-01-2021
Generate Markdown table from csv / tsv file and
append to an existing markdown file containing
page header and other free text paragraph for
acknowledgements and contributors page.
Usage:
>> python brainhack_book/mdtable.py acknowledgements
>> python brainhack_book/mdtable.p... | [
7061,
6,
198,
13838,
25,
367,
5488,
12,
51,
278,
15233,
198,
10430,
25,
2242,
12,
486,
12,
1238,
2481,
198,
198,
8645,
378,
2940,
2902,
3084,
422,
269,
21370,
1220,
256,
21370,
2393,
290,
198,
33295,
284,
281,
4683,
1317,
2902,
2393... | 2.386215 | 2,597 |
"""
5-fold CV - log loss 0.463244260386
"""
import numpy as np
import os
from sklearn import ensemble, feature_extraction, preprocessing
from sklearn.calibration import CalibratedClassifierCV
from sklearn.svm import LinearSVC
from otto_utils import consts, utils
MODEL_NAME = 'model_16_random_forest_calibrated_featu... | [
37811,
198,
20,
12,
11379,
26196,
532,
2604,
2994,
657,
13,
3510,
33916,
3682,
1899,
21734,
198,
37811,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
198,
6738,
1341,
35720,
1330,
34549,
11,
3895,
62,
2302,
7861,
11,
662,
... | 2.562982 | 778 |
from random import shuffle
from components.display import display_player, display_dealer
from components.bet.bet import player_bet
from components.deal import deal_player, deal_dealer
from components.options import player_options, player_stay
from components.decks import create_deck
def start_game():
"""
Thi... | [
6738,
4738,
1330,
36273,
198,
6738,
6805,
13,
13812,
1330,
3359,
62,
7829,
11,
3359,
62,
31769,
263,
220,
198,
6738,
6805,
13,
11181,
13,
11181,
1330,
2137,
62,
11181,
198,
6738,
6805,
13,
31769,
1330,
1730,
62,
7829,
11,
1730,
62,
... | 2.677656 | 546 |
# Birden yüze kadar sayıların karelerinin toplamı ile toplamlarının karelerinin farkı
toplam, karetoplami=0,0
for i in range(1,101):
toplam += i
karetoplami += i**2
print("Farklari = {}".format(toplam**2 - karetoplami)) | [
2,
14506,
268,
331,
9116,
2736,
479,
324,
283,
910,
30102,
21681,
30102,
77,
479,
533,
1754,
259,
259,
284,
489,
321,
30102,
220,
576,
284,
489,
321,
21681,
30102,
77,
30102,
77,
479,
533,
1754,
259,
259,
277,
668,
30102,
198,
198,
... | 2.053571 | 112 |
"""
network.py
----------
A module to implement the stochastic gradient descent learning algorithm for a feedforward neural network. Gradients
are calculated using backpropagation.
"""
# Import libraries
import numpy as np
import random
def sigmoid(z):
"""The sigmoid function"""
return 1 / (1 + np.exp(-z)... | [
37811,
198,
27349,
13,
9078,
198,
35937,
198,
198,
32,
8265,
284,
3494,
262,
3995,
354,
3477,
31312,
18598,
4673,
11862,
329,
257,
3745,
11813,
17019,
3127,
13,
17701,
2334,
198,
533,
10488,
1262,
736,
22930,
363,
341,
13,
198,
37811,
... | 3 | 153 |
from parser.base_parser import BaseParser
| [
6738,
30751,
13,
8692,
62,
48610,
1330,
7308,
46677,
628
] | 4.3 | 10 |
from UnivariateFeatureSelection import UnivariateFeatureSelection
| [
6738,
791,
42524,
38816,
4653,
1564,
1330,
791,
42524,
38816,
4653,
1564,
198
] | 5.076923 | 13 |
"""start file for flask app"""
# imports
from app import app
| [
37811,
9688,
2393,
329,
42903,
598,
37811,
198,
198,
2,
17944,
198,
6738,
598,
1330,
598,
198
] | 3.647059 | 17 |
import hashlib
import django.db.models as models
# tell south these things are okay to use
from south.modelsinspector import add_introspection_rules
add_introspection_rules([
(
[Sha256Field], # Class(es) these apply to
[], # Positional arguments (not used)
{ # Keyword argument
},
... | [
198,
11748,
12234,
8019,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
355,
4981,
628,
628,
198,
2,
1560,
5366,
777,
1243,
389,
8788,
284,
779,
198,
6738,
5366,
13,
27530,
1040,
806,
273,
1330,
751,
62,
600,
305,
31308,
62,
38785,
... | 2.37395 | 238 |
from typing import Dict
item_map: Dict[int, str] = {
0x01: 'Stick',
0x02: 'Iron Thorn',
0x03: 'Silver Spike',
0x04: 'Gold Fang',
0x05: 'Cacnea Spike',
0x06: 'Corsola Twig',
0x07: 'Gravelerock',
0x08: 'Geo Pebble',
0x09: 'Mobile Scarf',
0x0A: 'Heal Ribbon',
0x0B: 'Twist Band',
0x0C: 'Scope Lens'... | [
6738,
19720,
1330,
360,
713,
198,
198,
9186,
62,
8899,
25,
360,
713,
58,
600,
11,
965,
60,
796,
1391,
198,
220,
657,
87,
486,
25,
705,
1273,
624,
3256,
198,
220,
657,
87,
2999,
25,
705,
22797,
31422,
3256,
198,
220,
657,
87,
307... | 1.940065 | 2,753 |
"""
These are scripts that were run once that might be difficult to do as migrations (for example, they'd heavily
leverage the pickled values of Attributes, where class properties such as the automatic conversion of pickled
fields won't have access to. Although they only run once, they're useful as references, but shun... | [
37811,
198,
4711,
389,
14750,
326,
547,
1057,
1752,
326,
1244,
307,
2408,
284,
466,
355,
15720,
602,
357,
1640,
1672,
11,
484,
1549,
7272,
198,
293,
1857,
262,
2298,
992,
3815,
286,
49213,
11,
810,
1398,
6608,
884,
355,
262,
11353,
... | 4.609756 | 82 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
weblog.py
Created by Jacob C. on 2008-06-22.
Copyright (c) 2010 Spaceship No Future. All rights reserved.
"""
import config
import feedparser
import logging
import spider
from source import Source
from entries import AtomSource
from entries import Entry
from entries i... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
732,
14036,
13,
9078,
198,
198,
41972,
416,
12806,
327,
13,
319,
3648,
12,
3312,
12,
1828,
13,
198,
15269... | 3.254335 | 173 |
import json
import re
import requests
from localpackage.blob_helper_functions import initialize_blobs, read_blob, exists_blob, upload_blob
from localpackage.classes import Sigfox, Fragment, ReceiverAbort, ACK
from localpackage.functions import zfill, is_monochar, send_ack, replace_bit
# ====== GLOBAL VARIABLES =====... | [
11748,
33918,
198,
11748,
302,
198,
198,
11748,
7007,
198,
198,
6738,
1957,
26495,
13,
2436,
672,
62,
2978,
525,
62,
12543,
2733,
1330,
41216,
62,
2436,
8158,
11,
1100,
62,
2436,
672,
11,
7160,
62,
2436,
672,
11,
9516,
62,
2436,
672... | 1.96779 | 9,438 |
import click
import logging
import configfy
from pudb import set_trace as st
import marquant
single_process = False
@click.command()
@click.version_option(0.2)
@click.argument('image-folder')
@click.argument('config')
@click.option('-v', '--verbose', count=True)
@click.option('--single-process', 'run_single_process... | [
11748,
3904,
198,
11748,
18931,
198,
11748,
4566,
24928,
198,
198,
6738,
279,
463,
65,
1330,
900,
62,
40546,
355,
336,
198,
198,
11748,
1667,
40972,
198,
198,
29762,
62,
14681,
796,
10352,
198,
198,
31,
12976,
13,
21812,
3419,
198,
31... | 2.827839 | 546 |
#!/usr/bin/env python
import os
import re
import sys
import configparser
import click
import click_log
import stsauth
from stsauth import STSAuth
from stsauth import logger
click_log.basic_config(logger)
@click.group()
@click_log.simple_verbosity_option(logger)
@click.version_option()
@cli.command()
@click.opti... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
25064,
198,
11748,
4566,
48610,
198,
198,
11748,
3904,
198,
11748,
3904,
62,
6404,
198,
198,
11748,
336,
11400,
1071,
198,
6738,
336,
1140... | 2.545231 | 2,852 |
#!/usr/bin/env python
import rospy
import actionlib
import sys
import numpy as np
import math
import time
from geometry_msgs.msg import Pose, PoseWithCovarianceStamped, Point, Quaternion, Twist, PoseStamped
from std_msgs.msg import String, Bool
from kobuki_msgs.msg import Sound, Led
from move_base_msgs.msg import Move... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
686,
2777,
88,
198,
11748,
2223,
8019,
198,
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
11748,
640,
198,
6738,
22939,
62,
907,
14542,
13,
19662,... | 2.438586 | 1,669 |
import os
import shutil
import subprocess
# --------------------------------------------------
# --------------------------------------------------
# ==================================================
# ==================================================
# ==================================================
if __na... | [
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
850,
14681,
628,
198,
2,
20368,
1783,
438,
198,
2,
20368,
1783,
438,
628,
198,
2,
46111,
4770,
28,
198,
2,
46111,
4770,
28,
628,
198,
2,
46111,
4770,
28,
198,
361,
11593,
3672,
834,
... | 6.622951 | 61 |
import math
from fractions import Fraction
nu1, de1 = int(input("numerator: ")), int(input("denominator: "))
ls = []
egfrac(nu1, de1)
for x in ls:
print(x)
| [
11748,
10688,
198,
6738,
49876,
1330,
376,
7861,
198,
198,
28803,
16,
11,
390,
16,
796,
493,
7,
15414,
7203,
77,
6975,
1352,
25,
366,
36911,
493,
7,
15414,
7203,
6559,
6351,
1352,
25,
366,
4008,
198,
7278,
796,
17635,
628,
198,
198,... | 2.447761 | 67 |
# -*- coding: utf-8 -*
import bs4
import re
import requests
import lxml.html
import itertools
if __name__=="__main__":
file_path = './source/igeci_geci.txt'
# 清空数据
# geci_file = open(file_path, 'w')
# geci_file.truncate()
# geci_file.close()
geci_url = 'http://www.igeci.cn/denglijun/15149.htm... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
198,
198,
11748,
275,
82,
19,
198,
11748,
302,
198,
11748,
7007,
198,
11748,
300,
19875,
13,
6494,
198,
11748,
340,
861,
10141,
198,
198,
361,
11593,
3672,
834,
855,
1,
834,
12... | 1.927711 | 498 |
restaurant= Restaurante('Las Golondrinas','Mexicano', '5')
print("Nombre: " + str(restaurant.nombre))
print("Restaurante tipo: " + restaurant.tipo.title())
print(number_served.title())
| [
628,
198,
198,
2118,
2899,
415,
28,
22463,
12427,
10786,
46898,
26849,
623,
12769,
292,
41707,
24670,
291,
5733,
3256,
705,
20,
11537,
628,
198,
4798,
7203,
45,
2381,
260,
25,
366,
1343,
965,
7,
2118,
2899,
415,
13,
77,
2381,
260,
4... | 2.666667 | 72 |
#
# gdb helper commands and functions for Linux kernel debugging
#
# Kernel proc information reader
#
# Copyright (c) 2016 Linaro Ltd
#
# Authors:
# Kieran Bingham <kieran.bingham@linaro.org>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
from linux import constants
from linux impor... | [
2,
198,
2,
308,
9945,
31904,
9729,
290,
5499,
329,
7020,
9720,
28769,
198,
2,
198,
2,
220,
32169,
13834,
1321,
9173,
198,
2,
198,
2,
15069,
357,
66,
8,
1584,
5164,
12022,
12052,
198,
2,
198,
2,
46665,
25,
198,
2,
220,
39717,
272... | 2.71692 | 922 |
#!/usr/bin/env python3
import sys
CITIES = {
'A': {'B': 2, 'C': 4},
'B': {'A': 2, 'C': 4, 'D': 6},
'C': {'A': 4, 'B': 4, 'E': 6},
'D': {'B': 6, 'E': 2},
'E': {'C': 6, 'D': 2},
}
if __name__ == '__main__':
sys.exit(main())
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
25064,
198,
198,
34,
30383,
796,
1391,
198,
220,
220,
220,
705,
32,
10354,
1391,
6,
33,
10354,
362,
11,
705,
34,
10354,
604,
5512,
198,
220,
220,
220,
705,
33,
1035... | 1.72 | 150 |
"""
"""
import diamonds.store
import plotly
import plotly.graph_objs as go
import plotly.express as px
| [
37811,
198,
37811,
198,
198,
11748,
30984,
13,
8095,
198,
11748,
7110,
306,
198,
11748,
7110,
306,
13,
34960,
62,
672,
8457,
355,
467,
198,
11748,
7110,
306,
13,
42712,
355,
279,
87,
628,
628
] | 3.057143 | 35 |
# RealSeriesEvaluationRun.build_corpora()
# RealSeriesEvaluationRun.train_vecs()
import json
import os
from collections import defaultdict
import pandas as pd
from joblib import Parallel, delayed
from tqdm import tqdm
import numpy as np
from lib2vec.corpus_structure import Corpus, DataHandler, ConfigLoader, Preprocesse... | [
2,
6416,
27996,
36,
2100,
2288,
10987,
13,
11249,
62,
10215,
38851,
3419,
198,
2,
6416,
27996,
36,
2100,
2288,
10987,
13,
27432,
62,
303,
6359,
3419,
198,
11748,
33918,
198,
11748,
28686,
198,
6738,
17268,
1330,
4277,
11600,
198,
11748,... | 3.185 | 200 |
from typing import List
class RendezvousInfo:
"""
RendezvousInfo was machine identity information that is:
- configured as an environment variable in the rendezvous layer
- independent of the launch layer
- consumed by the launch layer
"""
def get_addrs(self) -> List[str]:
"""
... | [
6738,
19720,
1330,
7343,
628,
198,
4871,
28703,
50063,
12360,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
28703,
50063,
12360,
373,
4572,
5369,
1321,
326,
318,
25,
198,
220,
220,
220,
220,
532,
17839,
355,
281,
2858,
7885,
287,... | 2.624183 | 306 |
from django.test import TestCase
from myhpom.tests.factories import UserFactory
from myhpom.forms.profile import EditUserDetailsForm
from myhpom.models import State
from myhpom.models.user_details import GENDER_CHOICES
from datetime import date
class EditProfileUserDetailsFormTestCase(TestCase):
"""
* nothing... | [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
616,
24831,
296,
13,
41989,
13,
22584,
1749,
1330,
11787,
22810,
198,
6738,
616,
24831,
296,
13,
23914,
13,
13317,
1330,
5312,
12982,
24259,
8479,
198,
6738,
616,
24831,
296,
1... | 3.451977 | 177 |
from numpy.testing._private.utils import measure
import statsmodels.stats.outliers_influence as sso
import statsmodels.api as sm
import pandas as pd
import numpy as np
def seasonal_index(y_v, period: int, show=False, option='cma'):
"""
return seasonal index and a Series with all observations linked to its se... | [
6738,
299,
32152,
13,
33407,
13557,
19734,
13,
26791,
1330,
3953,
198,
11748,
9756,
27530,
13,
34242,
13,
448,
75,
3183,
62,
10745,
23079,
355,
264,
568,
198,
11748,
9756,
27530,
13,
15042,
355,
895,
198,
11748,
19798,
292,
355,
279,
... | 1.858471 | 3,766 |
from __future__ import annotations
from asyncio import CancelledError
from typing import (
TYPE_CHECKING,
Any,
List,
Optional,
Protocol,
Union,
cast,
runtime_checkable,
)
from ....jsonrpc2.protocol import rpc_method
from ....utils.async_event import async_tasking_event
from ....utils.l... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
30351,
952,
1330,
43780,
3353,
12331,
198,
6738,
19720,
1330,
357,
198,
220,
220,
220,
41876,
62,
50084,
2751,
11,
198,
220,
220,
220,
4377,
11,
198,
220,
220,
220,
7343,
11,
198,
... | 3.174825 | 286 |
from .get_menu import get_menu
| [
6738,
764,
1136,
62,
26272,
1330,
651,
62,
26272,
198
] | 3.1 | 10 |
from pomegranate import *
from nose.tools import with_setup
from nose.tools import assert_true
from nose.tools import assert_equal
from nose.tools import assert_greater
from nose.tools import assert_raises
from nose.tools import assert_not_equal
from numpy.testing import assert_almost_equal
from numpy.testing import as... | [
6738,
279,
462,
46324,
378,
1330,
1635,
198,
6738,
9686,
13,
31391,
1330,
351,
62,
40406,
198,
6738,
9686,
13,
31391,
1330,
6818,
62,
7942,
198,
6738,
9686,
13,
31391,
1330,
6818,
62,
40496,
198,
6738,
9686,
13,
31391,
1330,
6818,
62,... | 2.823261 | 877 |
from fastapi import APIRouter, status, Depends
from sqlalchemy.ext.asyncio import AsyncSession
from app.notification import views
from app.notification.schemas import GetNotification
from app.permission import is_active
from app.schemas import Message
from db import get_db
notification_router = APIRouter()
@notific... | [
6738,
3049,
15042,
1330,
3486,
4663,
39605,
11,
3722,
11,
2129,
2412,
198,
6738,
44161,
282,
26599,
13,
2302,
13,
292,
13361,
952,
1330,
1081,
13361,
36044,
198,
198,
6738,
598,
13,
1662,
2649,
1330,
5009,
198,
6738,
598,
13,
1662,
26... | 2.931973 | 441 |
#! /usr/bin/python3
import re
import os
import argparse
import logging
from typing import Optional, Pattern
from collections import namedtuple
Result = namedtuple('Result', ["name", "dev", "test"])
def tab(r: Result, num_tabs: int = 1) -> str:
"""
:param r:
:param num_tabs:
:return:
"""
... | [
2,
0,
1220,
14629,
14,
8800,
14,
29412,
18,
198,
198,
11748,
302,
198,
11748,
28686,
198,
198,
11748,
1822,
29572,
198,
11748,
18931,
198,
198,
6738,
19720,
1330,
32233,
11,
23939,
198,
6738,
17268,
1330,
3706,
83,
29291,
628,
198,
19... | 2.310427 | 422 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RAromaLight(RPackage):
"""Methods for microarray analysis that take basic data types such ... | [
2,
15069,
2211,
12,
1238,
2481,
13914,
45036,
3549,
2351,
4765,
11,
11419,
290,
584,
198,
2,
1338,
441,
4935,
34152,
13,
4091,
262,
1353,
12,
5715,
27975,
38162,
9947,
2393,
329,
3307,
13,
198,
2,
198,
2,
30628,
55,
12,
34156,
12,
... | 2.636364 | 363 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
"""
===========================================
Spectral clustering for image segmentation
===========================================
In this example, an image with connected circles is generated and
spectral clustering is used to separate the circles.
In these settings, the :ref:`spectral_clustering` approach solve... | [
37811,
198,
10052,
2559,
18604,
198,
49738,
1373,
32966,
1586,
329,
2939,
10618,
341,
198,
10052,
2559,
18604,
198,
198,
818,
428,
1672,
11,
281,
2939,
351,
5884,
13332,
318,
7560,
290,
198,
4443,
1373,
32966,
1586,
318,
973,
284,
4553,... | 3.246472 | 1,063 |
from osp.common.utils import query_bar
from osp.common.mixins.elasticsearch import Elasticsearch
from osp.corpus.models import Document_Text
| [
198,
198,
6738,
267,
2777,
13,
11321,
13,
26791,
1330,
12405,
62,
5657,
198,
6738,
267,
2777,
13,
11321,
13,
19816,
1040,
13,
417,
3477,
12947,
1330,
48567,
12947,
198,
6738,
267,
2777,
13,
10215,
79,
385,
13,
27530,
1330,
16854,
62,
... | 3.272727 | 44 |
#!/usr/local/bin/python3.4
import os, sys, logging, json, argparse, time, requests, uuid
from datetime import datetime
from orchestrator import orchestrator as orch
from database import database as db
from config_files import settings | [
2,
48443,
14629,
14,
12001,
14,
8800,
14,
29412,
18,
13,
19,
198,
198,
11748,
28686,
11,
25064,
11,
18931,
11,
33918,
11,
1822,
29572,
11,
640,
11,
7007,
11,
334,
27112,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
28127... | 3.6875 | 64 |
"""Table
"""
import random
import itertools
from reversi.strategies.common import AbstractStrategy
import reversi.strategies.TableMethods as TableMethods
class Table(AbstractStrategy):
"""select move by evaluation table
"""
def set_table(self, size):
"""set_table
"""
self.size =... | [
37811,
10962,
198,
37811,
198,
198,
11748,
4738,
198,
11748,
340,
861,
10141,
198,
198,
6738,
10372,
72,
13,
2536,
2397,
444,
13,
11321,
1330,
27741,
13290,
4338,
198,
11748,
10372,
72,
13,
2536,
2397,
444,
13,
10962,
46202,
355,
8655,
... | 1.758056 | 1,893 |
#!/usr/bin/env python
import click
import h5py
import numpy as np
import numpy.testing
import pandas as pd
import selene_sdk.sequences
@click.command()
@click.option('-i', '--input_file', 'input_file', type=str, required=True,
help='the location of the balanced sequences sets for classification')
@cli... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
3904,
198,
11748,
289,
20,
9078,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
299,
32152,
13,
33407,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
384,
29466,
62,
21... | 2.582902 | 772 |
"""
Test DOE Driver and Generators.
"""
import unittest
import os
import os.path
import glob
import csv
import numpy as np
import openmdao.api as om
from openmdao.test_suite.components.paraboloid import Paraboloid
from openmdao.test_suite.components.paraboloid_distributed import DistParab
from openmdao.test_suite.g... | [
37811,
198,
14402,
46984,
12434,
290,
2980,
2024,
13,
198,
37811,
198,
11748,
555,
715,
395,
198,
198,
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
11748,
15095,
198,
11748,
269,
21370,
198,
198,
11748,
299,
32152,
355,
45941,
198,
1... | 2.458054 | 596 |
#!/usr/bin/python
""" Program to receive HTTP request from server with JSON body which will
contain the data for the song to be played/paused/stopped. The program will
use three threads.
Thread 1 - This thread will be used for playback.
Thread 2 - This thread will be used to keep the connection with the Server open
a... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
37811,
6118,
284,
3328,
14626,
2581,
422,
4382,
351,
19449,
1767,
543,
481,
198,
3642,
391,
262,
1366,
329,
262,
3496,
284,
307,
2826,
14,
8957,
1484,
14,
301,
38333,
13,
383,
1430,
48... | 3.356984 | 902 |
# -*- coding: utf8 -*-
import arrow
import logging
import requests
from aliyunauth.sign_ver_1_0 import AuthBase
from datetime import datetime
from OpenSSL import crypto
__version__ = "0.1.0"
logger = logging.getLogger(__name__)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
23,
532,
9,
12,
198,
198,
11748,
15452,
198,
11748,
18931,
198,
11748,
7007,
198,
198,
6738,
435,
7745,
9613,
1071,
13,
12683,
62,
332,
62,
16,
62,
15,
1330,
26828,
14881,
198,
6738,
4818,
8079,... | 2.819277 | 83 |
from asyncio import subprocess
import pytest
from helpers import misc
from mock import call, patch
from i3pyblocks import types
from i3pyblocks.blocks import shell
@pytest.mark.asyncio
@pytest.mark.asyncio
@pytest.mark.asyncio
| [
6738,
30351,
952,
1330,
850,
14681,
198,
198,
11748,
12972,
9288,
198,
6738,
49385,
1330,
12747,
198,
6738,
15290,
1330,
869,
11,
8529,
198,
198,
6738,
1312,
18,
9078,
27372,
1330,
3858,
198,
6738,
1312,
18,
9078,
27372,
13,
27372,
1330... | 3.092105 | 76 |
# Copyright (C) 2010-2011 Richard Lincoln
#
# 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, modify, merge, publish... | [
2,
15069,
357,
34,
8,
3050,
12,
9804,
6219,
12406,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
2,
286,
428,
3788,
290,
3917,
10314,
3696,
357,
1169,
366,
25423,
123... | 3.172811 | 1,736 |
from .train import set_random_seed, train_model
from .test import multi_gpu_test, single_gpu_test
__all__ = [
'set_random_seed', 'train_model', 'multi_gpu_test', 'single_gpu_test'
]
| [
6738,
764,
27432,
1330,
900,
62,
25120,
62,
28826,
11,
4512,
62,
19849,
198,
6738,
764,
9288,
1330,
5021,
62,
46999,
62,
9288,
11,
2060,
62,
46999,
62,
9288,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
705,
2617,
62,
25... | 2.710145 | 69 |
from metasense.data import load
from metasense.models import *
from sklearn.metrics import mean_squared_error
from deepx import nn
import math
import numpy as np
import json
import joblib
PICKLE_PATH = '../../MyModels/NN4/alt_board18_co.pkl'
def main():
"""
Train a CO neural network model and save as a pickle fil... | [
6738,
1138,
292,
1072,
13,
7890,
1330,
3440,
198,
6738,
1138,
292,
1072,
13,
27530,
1330,
1635,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
1612,
62,
16485,
1144,
62,
18224,
198,
6738,
2769,
87,
1330,
299,
77,
198,
11748,
10688,
19... | 2.655431 | 534 |
# -*- coding: utf-8 -*-
import re
import requests
import xml.etree.ElementTree
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
302,
198,
11748,
7007,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
628
] | 2.7 | 30 |
import torch
import numpy as np
import os, errno
def mkdirs(*directories):
'''
Makes a directory if it does not exist
'''
for directory in list(directories):
try:
os.makedirs(directory)
except OSError as e:
if e.errno != errno.EEXIST:
raise
def t... | [
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
11,
11454,
3919,
198,
198,
4299,
33480,
15908,
82,
46491,
12942,
1749,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
27433,
257,
8619,
611,
340,
857,
407,
... | 2.164179 | 201 |
"""
Implementation of transfer specific HTTP service views.
"""
from redis import RedisError
from ichnaea.api.exceptions import (
ParseError,
ServiceUnavailable,
TransferSuccess,
)
from ichnaea.api.views import BaseAPIView
from ichnaea.api.transfer.schema import TRANSFER_V1_SCHEMA
class BaseTransferView... | [
37811,
198,
3546,
32851,
286,
4351,
2176,
14626,
2139,
5009,
13,
198,
37811,
198,
198,
6738,
2266,
271,
1330,
2297,
271,
12331,
198,
198,
6738,
220,
488,
2616,
18213,
13,
15042,
13,
1069,
11755,
1330,
357,
198,
220,
220,
220,
2547,
32... | 2.619423 | 381 |
import pygame
import math
import random
import os
from pygame.locals import *
# Define some colors
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
RED = (255, 0, 0)
BLUE = (0, 0, 255)
# Set the height and width of the screen
SCREEN_WIDTH = 900
SCREEN_HEIGHT = 700
| [
11748,
12972,
6057,
198,
11748,
10688,
198,
11748,
4738,
198,
11748,
28686,
198,
6738,
12972,
6057,
13,
17946,
874,
1330,
1635,
198,
198,
2,
2896,
500,
617,
7577,
198,
9148,
8120,
796,
357,
15,
11,
657,
11,
657,
8,
198,
12418,
12709,
... | 2.542857 | 105 |
#!/usr/bin/env python
import logging, os, sys, unittest
import Test_chaoxis, Test_others
#####################
# UNITTEST DRIVER #
#####################
#########################
# THREAD OF EXECUTION #
#########################
if __name__ == "__main__" :
logging.basicConfig( format='%(levelname)s:%(message)... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
18931,
11,
28686,
11,
25064,
11,
555,
715,
395,
198,
11748,
6208,
62,
11693,
1140,
271,
11,
6208,
62,
847,
82,
198,
198,
14468,
4242,
2,
198,
2,
220,
4725,
22470,
6465,
... | 2.873171 | 205 |
import os
import secrets
import pytest
from _pytest.monkeypatch import MonkeyPatch
from starlette.testclient import TestClient
from app.auth import security
@pytest.fixture
@pytest.fixture
@pytest.fixture
def test_register(
test_client: TestClient, user_data: dict, monkeypatch: MonkeyPatch, async_db, db
)... | [
11748,
28686,
198,
11748,
13141,
198,
198,
11748,
12972,
9288,
198,
6738,
4808,
9078,
9288,
13,
49572,
17147,
1330,
26997,
33952,
198,
6738,
3491,
21348,
13,
9288,
16366,
1330,
6208,
11792,
198,
198,
6738,
598,
13,
18439,
1330,
2324,
628,... | 2.919315 | 409 |
from __future__ import annotations
from typing import Any
from typing import List
from typing import Sequence
from typing import Tuple
import attr
import eth_abi
from brownie.network.state import Chain
from brownie.network.transaction import TransactionReceipt
from eth_typing import Address
from eth_typing import Has... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
19720,
1330,
4377,
198,
6738,
19720,
1330,
7343,
198,
6738,
19720,
1330,
45835,
198,
6738,
19720,
1330,
309,
29291,
198,
198,
11748,
708,
81,
198,
11748,
4555,
62,
17914,
198,
6738,
... | 2.668622 | 341 |
from pythonwarrior.floor import Floor
# These are used dynamically via unit_to_constant
from pythonwarrior.units.archer import Archer
from pythonwarrior.units.captive import Captive
from pythonwarrior.units.golem import Golem
from pythonwarrior.units.sludge import Sludge
from pythonwarrior.units.thick_sludge import Th... | [
6738,
21015,
5767,
7701,
13,
28300,
1330,
22343,
198,
198,
2,
2312,
389,
973,
32366,
2884,
4326,
62,
1462,
62,
9979,
415,
198,
6738,
21015,
5767,
7701,
13,
41667,
13,
283,
2044,
1330,
19333,
198,
6738,
21015,
5767,
7701,
13,
41667,
13... | 3.716535 | 127 |
from typing import Callable
import jax
import jax.numpy as jnp
import numpy as np
# local imports
from .bdf import bdf_solve
def lax_scan_to_end_time(
ode_fn: Callable,
jacobian_fn: Callable,
initial_state: jnp.ndarray,
ts: jnp.ndarray,
dt: float,
):
"""
Integrate a system to endtime using... | [
6738,
19720,
1330,
4889,
540,
198,
198,
11748,
474,
897,
198,
11748,
474,
897,
13,
77,
32152,
355,
474,
37659,
198,
11748,
299,
32152,
355,
45941,
198,
198,
2,
1957,
17944,
198,
6738,
764,
65,
7568,
1330,
275,
7568,
62,
82,
6442,
62... | 2.368 | 250 |
import copy
import os
from config.parse_console import parse_arguments
from config.defaults import _C
_C.__init__()
__all__ = ['parse_arguments', 'update_args']
| [
11748,
4866,
198,
11748,
28686,
198,
198,
6738,
4566,
13,
29572,
62,
41947,
1330,
21136,
62,
853,
2886,
198,
6738,
4566,
13,
12286,
82,
1330,
4808,
34,
628,
198,
62,
34,
13,
834,
15003,
834,
3419,
628,
198,
198,
834,
439,
834,
796,
... | 3.036364 | 55 |
"""
Freefall with air resistance:
m * (d^2y)/(dt^2) = -m*g + b * (dy/dt)^2
Initial Conditions y(0) = y0, v(0) = y'(0) = 0
m - mass, b - Stoke's constant, y0 - initial height, yFinal - final height, g = 9,81 m/s^2
"""
| [
37811,
198,
11146,
7207,
351,
1633,
6625,
25,
198,
220,
220,
220,
285,
1635,
357,
67,
61,
17,
88,
20679,
7,
28664,
61,
17,
8,
796,
532,
76,
9,
70,
1343,
275,
1635,
357,
9892,
14,
28664,
8,
61,
17,
198,
24243,
27617,
331,
7,
15... | 2.203883 | 103 |
from __future__ import print_function
import sys
import tempfile
import os
fd, path = tempfile.mkstemp(suffix='.py', prefix='trojan_stage2_')
print(path)
for line in reader():
if line.strip() == 'EOF':
break
os.write(fd, line.encode())
| [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
25064,
198,
11748,
20218,
7753,
198,
11748,
28686,
628,
198,
198,
16344,
11,
3108,
796,
20218,
7753,
13,
28015,
927,
79,
7,
37333,
844,
28,
4458,
9078,
3256,
21231,
11639,
23528... | 2.628866 | 97 |
import numpy as np
import matplotlib.pyplot as plt
from keras.layers import Dense, Flatten, Conv2D
from keras.layers import MaxPooling2D, Dropout
from keras.utils import np_utils
from keras.models import Sequential
from keras.callbacks import ModelCheckpoint
import pandas as pd
run()
| [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
220,
360,
1072,
11,
1610,
41769,
11,
34872,
17,
35,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
2... | 3.095745 | 94 |