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 python
from typing import Dict
from pathlib import Path
import nbformat
def nbraze(in_file: str, extension: str = "") -> Dict[str, str]:
"""Create markdown and code files from a Jupyter notebook.
:param in_file: The name of the input Jupyter notebook file.
:param extension: The extension... | [
2,
5145,
14,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
19720,
1330,
360,
713,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
299,
65,
18982,
628,
198,
4299,
299,
16057,
2736,
7,
259,
62,
7753,
25,
965,
11,
7552,
25,
965,
... | 2.234589 | 584 |
# print status FAIL
'''
print('[' + '█'*50 + ']')
input('press key')
import time
print(" Wryyyyyyyyyyyyyyyyyy", end="\r")
time.sleep(2)
print('zaworldo')
import sys,time
print("FAILED...")
print("FAILED...")
print("FAILED...")
sys.stdout.write("\033[F") #back to previous line
sys.stdout.write("\033[K") ... | [
2,
3601,
3722,
9677,
4146,
198,
7061,
6,
198,
4798,
10786,
17816,
1343,
705,
8115,
6,
9,
1120,
1343,
705,
60,
11537,
198,
15414,
10786,
8439,
1994,
11537,
198,
198,
11748,
640,
198,
198,
4798,
7203,
220,
220,
220,
220,
220,
220,
220... | 2.135299 | 1,153 |
import aiohttp
import asyncio
import logging
import time
from math import ceil
from json import loads
| [
11748,
257,
952,
4023,
198,
11748,
30351,
952,
198,
11748,
18931,
198,
11748,
640,
198,
6738,
10688,
1330,
2906,
346,
198,
6738,
33918,
1330,
15989,
628,
198
] | 3.851852 | 27 |
from pandas.tseries.frequencies import to_offset
from pandas import concat, DataFrame, Series
import statsmodels.api as sm
import logging
log = logging.getLogger(__name__)
# TODO: Implement some other smoothers. Linear trend, for example.
def stitch_series(series, boundaries, error_model='additive', window_size='1H'... | [
6738,
19798,
292,
13,
912,
10640,
13,
69,
8897,
3976,
1330,
284,
62,
28968,
198,
6738,
19798,
292,
1330,
1673,
265,
11,
6060,
19778,
11,
7171,
198,
11748,
9756,
27530,
13,
15042,
355,
895,
198,
11748,
18931,
198,
6404,
796,
18931,
13,... | 2.602399 | 1,167 |
#!/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import string
import random
import configparser
import numpy as np
from datetime import datetime
from PIL import Image
from logging import getLogger, FileHandler, Formatter
# torch
from torch.utils.data import Dataset, DataLoader
from torchvision import da... | [
2,
48443,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
4731,
198,
11748,
4738,
198,
11748,
4566,
48610,
198,
11748,
299,
32152,
355,
45941,
19... | 2.989189 | 925 |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | [
2,
15069,
2177,
3012,
3457,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
... | 3.290809 | 729 |
import torch.nn as nn
import torch
| [
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
628,
198
] | 3.083333 | 12 |
from abc import ABC
import math
# TODO move ANSI codes into a different folder
# ANSI Color codes
RESET_COLOR_CODE = "\u001b[0m"
GREEN_COLOR_CODE = "\u001b[32m"
WHITE_COLOR_CODE = "\u001b[37m"
| [
6738,
450,
66,
1330,
9738,
198,
11748,
10688,
198,
198,
2,
16926,
46,
1445,
3537,
11584,
12416,
656,
257,
1180,
9483,
198,
2,
3537,
11584,
5315,
12416,
198,
19535,
2767,
62,
46786,
62,
34,
16820,
796,
37082,
84,
8298,
65,
58,
15,
76... | 2.475 | 80 |
@ex.capture
| [
628,
198,
31,
1069,
13,
27144,
495,
198,
220,
220,
220,
220,
220,
220,
220,
220
] | 1.4375 | 16 |
import os
import json
import paho.mqtt.client as mqtt
from plants.flowersensor import FlowerSensor
| [
11748,
28686,
198,
11748,
33918,
198,
11748,
279,
17108,
13,
76,
80,
926,
13,
16366,
355,
285,
80,
926,
198,
6738,
6134,
13,
2704,
3618,
22854,
1330,
20025,
47864,
628,
220,
220,
220,
220
] | 3.058824 | 34 |
#!/usr/bin/env python
# coding: utf-8
#
# Copyright (c) 2020-2021 Arm Ltd.
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
"""s-LLGS basic examples"""
import sllgs_solver as sllg_solver
def current(t):
"""Current waveform."""
return -100e-6
def do_test(seed_0=100):
"""Simple s-LLGS te... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
198,
2,
15069,
357,
66,
8,
12131,
12,
1238,
2481,
7057,
12052,
13,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
30628,
55,
12,
34156,
... | 1.472279 | 1,461 |
from state import *
| [
6738,
1181,
1330,
1635,
198
] | 4 | 5 |
import os.path
import keras
import keras.optimizers
import scipy.io as sio
from keras.callbacks import EarlyStopping, ModelCheckpoint, ReduceLROnPlateau
from keras.layers.convolutional import Conv2D
from keras.layers.core import Dense, Activation, Flatten
from keras.models import Sequential
from keras.models import mo... | [
11748,
28686,
13,
6978,
198,
198,
11748,
41927,
292,
198,
11748,
41927,
292,
13,
40085,
11341,
198,
11748,
629,
541,
88,
13,
952,
355,
264,
952,
198,
6738,
41927,
292,
13,
13345,
10146,
1330,
12556,
1273,
33307,
11,
9104,
9787,
4122,
... | 3.177966 | 118 |
import sys
import tempfile
from pathlib import Path
import warnings
import math
from collections import OrderedDict
from itertools import chain, islice, cycle
import logging
import argparse
import dask
from dask.distributed import Client
import numpy as np
import xarray as xr
import xskillscore as xs
from src ... | [
11748,
25064,
198,
11748,
20218,
7753,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
14601,
198,
198,
11748,
10688,
198,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
198,
6738,
340,
861,
10141,
1330,
6333,
11,
318,
75,
501,... | 2.371574 | 14,339 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Simple utility functions used by Open Tree python code.
These function are used by packages that descend from peyotl, but
do not depend on any part of peyotl.
"""
from __future__ import absolute_import, print_function, division
__version__ = '0.0.4' # sync with setup.... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
26437,
10361,
5499,
973,
416,
4946,
12200,
21015,
2438,
13,
198,
198,
4711,
2163,
389,
973,
416,
10392,
326,
153... | 2.141431 | 2,404 |
import base64
from datetime import timedelta, datetime
import binascii
from Crypto.Cipher import XOR
from django.conf import settings
from django.utils import timezone, dateformat
| [
11748,
2779,
2414,
198,
6738,
4818,
8079,
1330,
28805,
12514,
11,
4818,
8079,
198,
198,
11748,
9874,
292,
979,
72,
198,
6738,
36579,
13,
34,
10803,
1330,
1395,
1581,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
1420... | 3.607843 | 51 |
import xlrd
from xlutils.copy import copy
#<basic-form table-name="basic-plan-basic-information" title="基本方案-基本信息" :pdf-id="pdfId"></basic-form>
readbook = xlrd.open_workbook('Data0325_translate.xls', formatting_info=True)
sheet = readbook.sheet_by_index(4) # 索引的方式,从0开始
nrows = sheet.nrows # 行
ncols = sheet.ncols ... | [
11748,
2124,
75,
4372,
198,
6738,
2124,
75,
26791,
13,
30073,
1330,
4866,
198,
198,
2,
27,
35487,
12,
687,
3084,
12,
3672,
2625,
35487,
12,
11578,
12,
35487,
12,
17018,
1,
3670,
2625,
161,
253,
118,
17312,
105,
43095,
162,
94,
230,
... | 2.2891 | 422 |
from setuptools import find_packages, setup
import codecs
import os
import re
with open("README.md", "r") as file:
long_description = file.read()
here = os.path.abspath(os.path.dirname(__file__))
setup(
name="wappsto",
version=find_version("wappsto", "__init__.py"),
author="Seluxit A/S",
aut... | [
6738,
900,
37623,
10141,
1330,
1064,
62,
43789,
11,
9058,
198,
198,
11748,
40481,
82,
198,
11748,
28686,
198,
11748,
302,
628,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
1600,
366,
81,
4943,
355,
2393,
25,
198,
220,
220,
220,
890,... | 2.461318 | 349 |
# Authors: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org>
# Olivier Grisel <olivier.grisel@ensta.org>
#
# License: BSD 3 clause
import matplotlib.pyplot as plt
from joblib import Memory
import numpy as np
import gc
import time
from sklearn.linear_model import LogisticRegression, SGDClassifier
from sklearn.dat... | [
2,
46665,
25,
4186,
37916,
260,
8591,
9852,
1279,
39532,
13,
646,
3866,
12,
5031,
12,
83,
454,
31,
76,
19,
87,
13,
2398,
29,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45674,
1902,
36811,
1279,
349,
452,
959,
13,
2164,... | 1.924552 | 2,346 |
# This is the main API that users interact with LEAP. Users
# will create an instance of the LEAP class and can either
# set their own user defined functions or use one of the func-
# tions available in LEAP
from abc import ABC, abstractmethod
import json
import grpc
import proto as pb
# An abstract class that repr... | [
2,
770,
318,
262,
1388,
7824,
326,
2985,
9427,
351,
12509,
2969,
13,
18987,
198,
2,
481,
2251,
281,
4554,
286,
262,
12509,
2969,
1398,
290,
460,
2035,
198,
2,
900,
511,
898,
2836,
5447,
5499,
393,
779,
530,
286,
262,
25439,
12,
19... | 3.526882 | 465 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# version 0.1
import requests
import discord
from discord.ext import commands
import datetime
import asyncio
import pytz
from termcolor import colored, cprint
'''Initial set-up done through console '''
cprint('Welcome to the initial set-up!','green',attrs... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
201,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
2,
2196,
657,
13,
16,
201,
198,
201,
198,
11748,
7007,
201,
198,
11748,
36446,
201,
198,
6738,
36446,
13,
... | 2.887248 | 745 |
from pkg_resources import DistributionNotFound
from pkg_resources import get_distribution
try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
pass
from .koopman import Koopman
from .koopman_continuous import KoopmanContinuous
__all__ = [
"Koopman",
"KoopmanContinuous",... | [
6738,
279,
10025,
62,
37540,
1330,
27484,
3673,
21077,
198,
6738,
279,
10025,
62,
37540,
1330,
651,
62,
17080,
3890,
198,
198,
28311,
25,
198,
220,
220,
220,
11593,
9641,
834,
796,
651,
62,
17080,
3890,
7,
834,
3672,
834,
737,
9641,
... | 2.815603 | 141 |
'''
Arbitrary style transfer in Real-time with Pytorch.
Run the script with:
```
python train.py -c path_to_your_content_dir \
-s path_to_your_style_dir
```
e.g.:
```
python train.py -c content -s style
```
Optional parameters:
```
--save_dir, The path to save your model(Default is "model/decode... | [
7061,
6,
201,
198,
201,
198,
3163,
2545,
11619,
3918,
4351,
287,
6416,
12,
2435,
351,
9485,
13165,
354,
13,
201,
198,
201,
198,
10987,
262,
4226,
351,
25,
201,
198,
15506,
63,
201,
198,
29412,
4512,
13,
9078,
532,
66,
3108,
62,
14... | 2.260057 | 1,765 |
from ramsey._src.neural_process.attention.multihead_attention import (
MultiHeadAttention,
)
__all__ = ["MultiHeadAttention"]
| [
6738,
15770,
4397,
13557,
10677,
13,
710,
1523,
62,
14681,
13,
1078,
1463,
13,
41684,
2256,
62,
1078,
1463,
1330,
357,
198,
220,
220,
220,
15237,
13847,
8086,
1463,
11,
198,
8,
198,
198,
834,
439,
834,
796,
14631,
29800,
13847,
8086,
... | 2.911111 | 45 |
from collections import OrderedDict
expected = [
OrderedDict(
[
("type", "report"),
("id", "bib37"),
("date", "1985"),
(
"authors",
[
OrderedDict(
[
("type... | [
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
198,
40319,
796,
685,
198,
220,
220,
220,
14230,
1068,
35,
713,
7,
198,
220,
220,
220,
220,
220,
220,
220,
685,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5855,
4906,
... | 1.296742 | 1,995 |
import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index('--'):]
bpy.context.scene.render.engine = 'CYCLES'
bpy.ops.import_scene.gltf(filepath=args[1])
obj = bpy.context.active_object
print("Duplicating object")
bpy.ops.object.duplicate()
new_obj = bpy.context.act... | [
11748,
25064,
198,
11748,
275,
9078,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
26498,
796,
25064,
13,
853,
85,
58,
17597,
13,
853,
85,
13,
9630,
10786,
438,
6,
2599,
60,
628,
220,
220,
... | 2.220363 | 717 |
# Generated by Django 3.1.2 on 2021-03-14 21:09
from django.db import migrations
import multiselectfield.db.fields
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
17,
319,
33448,
12,
3070,
12,
1415,
2310,
25,
2931,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
198,
11748,
1963,
786,
801,
3245,
13,
9945,
13,
25747,
628
] | 2.925 | 40 |
# coding: utf-8
"""
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environmen... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
37811,
198,
220,
220,
220,
28289,
554,
1010,
432,
628,
220,
220,
220,
28289,
554,
1010,
432,
318,
257,
4542,
3859,
6793,
355,
257,
2139,
351,
14553,
23696,
329,
534,
28289,
290,
513,
4372,
2151,
... | 2.459415 | 6,123 |
""" 查询价格
https://universalis.app/docs/index.html?urls.primaryName=Universalis%20v2
https://github.com/thewakingsands/cafemaker/wiki
"""
from datetime import datetime
from typing import Optional
import httpx
from pydantic import BaseModel
async def search_item_id_by_name(name: str) -> Optional[int]:
"""通过物... | [
37811,
10545,
253,
98,
46237,
95,
20015,
115,
43718,
120,
198,
198,
5450,
1378,
40082,
271,
13,
1324,
14,
31628,
14,
9630,
13,
6494,
30,
6371,
82,
13,
39754,
5376,
28,
38747,
271,
4,
1238,
85,
17,
198,
198,
5450,
1378,
12567,
13,
... | 1.744786 | 1,007 |
from flask_babelex import lazy_gettext
from flask_wtf import FlaskForm
from wtforms import DecimalField, FormField, StringField, SubmitField, TextAreaField
from wtforms.fields.html5 import URLField
from wtforms.validators import DataRequired, Optional
from project.forms.common import Base64ImageForm
from project.model... | [
6738,
42903,
62,
65,
11231,
2588,
1330,
16931,
62,
1136,
5239,
198,
6738,
42903,
62,
86,
27110,
1330,
46947,
8479,
198,
6738,
266,
83,
23914,
1330,
4280,
4402,
15878,
11,
5178,
15878,
11,
10903,
15878,
11,
39900,
15878,
11,
8255,
30547,... | 3.734043 | 94 |
from datetime import datetime
from random import randint
from typing import List
from sqlalchemy import UniqueConstraint
from sqlalchemy.orm import validates
from investing_algorithm_framework.core.exceptions import OperationalException
from investing_algorithm_framework.core.models import db, OrderSide, \
OrderS... | [
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
4738,
1330,
43720,
600,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
44161,
282,
26599,
1330,
30015,
3103,
2536,
2913,
198,
6738,
44161,
282,
26599,
13,
579,
1330,
4938,
689,
198,
198,
673... | 3.415771 | 279 |
from serial import Serial
bytesHasTwoArgs = False
try:
test = bytes("test", "ascii")
bytesHasTwoArgs = True
except:
pass
nixieCOM = Serial()
DOUBLE_CHARS = set([ord('N')])
| [
6738,
11389,
1330,
23283,
198,
198,
33661,
19242,
7571,
42035,
796,
10352,
198,
28311,
25,
198,
197,
9288,
796,
9881,
7203,
9288,
1600,
366,
292,
979,
72,
4943,
198,
197,
33661,
19242,
7571,
42035,
796,
6407,
198,
16341,
25,
198,
197,
... | 2.656716 | 67 |
import os
print(os.getlogin()) | [
11748,
28686,
198,
4798,
7,
418,
13,
1136,
38235,
28955
] | 3 | 10 |
from vgg import VGG
import os
model = VGG()
print(model.summary())
weights = './model/emotion_best_weights.h5'
if os.path.exists(weights):
print("Loading weight")
model.load_weights(weights)
print("Saving model")
model.save("./model/emotion_recognition.h5")
| [
6738,
410,
1130,
1330,
569,
11190,
198,
11748,
28686,
198,
198,
19849,
796,
569,
11190,
3419,
198,
4798,
7,
19849,
13,
49736,
28955,
198,
43775,
796,
705,
19571,
19849,
14,
368,
9650,
62,
13466,
62,
43775,
13,
71,
20,
6,
198,
361,
2... | 2.644231 | 104 |
from aws_lambda_typing.requests import SNSPublish, SNSPublishBatch
| [
6738,
3253,
82,
62,
50033,
62,
774,
13886,
13,
8897,
3558,
1330,
11346,
4303,
549,
1836,
11,
11346,
4303,
549,
1836,
33,
963,
628,
198
] | 2.76 | 25 |
from .default import *
# Template for deployment configuration
# Contains sensible default for production use
DEBUG = False
# TODO: Set this list to hosts/domains served by this app
# See https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-ALLOWED_HOSTS
ALLOWED_HOSTS = [ os.environ.get('lgrURL') ]
# Unc... | [
6738,
764,
12286,
1330,
1635,
198,
198,
2,
37350,
329,
14833,
8398,
198,
2,
49850,
20586,
4277,
329,
3227,
779,
198,
198,
30531,
796,
10352,
198,
198,
2,
16926,
46,
25,
5345,
428,
1351,
284,
11453,
14,
3438,
1299,
4983,
416,
428,
59... | 2.182994 | 2,705 |
import logging, requests, time
from src.config import Config
from datetime import datetime | [
11748,
18931,
11,
7007,
11,
640,
198,
6738,
12351,
13,
11250,
1330,
17056,
198,
6738,
4818,
8079,
1330,
4818,
8079
] | 4.5 | 20 |
import playsound
playsound.playsound('wh.mp3') | [
11748,
5341,
633,
198,
26024,
633,
13,
26024,
633,
10786,
1929,
13,
3149,
18,
11537
] | 3.066667 | 15 |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# Copyright 2020 Huawei Technologies Co., Ltd
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same ... | [
2,
15069,
357,
66,
8,
2177,
12,
25579,
11,
3203,
11,
3457,
13,
198,
2,
1439,
2489,
10395,
13,
198,
2,
15069,
12131,
43208,
21852,
1766,
1539,
12052,
198,
2,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
5964,
1043,
287,
262,
3855... | 3.038889 | 360 |
# CodeMirror, copyright (c) by Marijn Haverbeke and others
# Distributed under an MIT license: https://codemirror.net/LICENSE
# Author: Gk0Wk (nmg_wk@yeah.net)
# Licence: MIT
"""
Build TiddlyWiki Plugin to JSON & NodeJS format with build.json
"""
import re
import os
import json
import shutil
SRC_DIR = 'src'
DIST_DIR ... | [
2,
6127,
27453,
1472,
11,
6634,
357,
66,
8,
416,
1526,
48848,
367,
8770,
1350,
365,
290,
1854,
198,
2,
4307,
6169,
739,
281,
17168,
5964,
25,
3740,
1378,
19815,
368,
343,
1472,
13,
3262,
14,
43,
2149,
24290,
198,
2,
6434,
25,
402,... | 2.02449 | 2,695 |
"""
XING VBR Header parsing module.
"""
# Pylint disable settings:
# ------------------------
# ToDos, DocStrings:
# pylint: disable-msg=W0511,W0105
# Unused variable, argument:
# pylint: disable-msg=W0612,W0613
# Re-define built-in:
# pylint: disable-msg=W0622
from mpeg1audio import VBRHeader
imp... | [
37811,
201,
198,
55,
2751,
569,
11473,
48900,
32096,
8265,
13,
201,
198,
201,
198,
37811,
201,
198,
201,
198,
2,
350,
2645,
600,
15560,
6460,
25,
201,
198,
2,
220,
22369,
201,
198,
2,
1675,
35,
418,
11,
14432,
13290,
654,
25,
201,... | 2.081013 | 1,580 |
# -*- coding: utf-8 -*-
# !/bin/env python
import logging
import logging.config
import yaml
import options
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
5145,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
18931,
198,
11748,
18931,
13,
11250,
198,
198,
11748,
331,
43695,
198,
198,
11748,
3689,
628
] | 2.775 | 40 |
#!/usr/bin/python3
from validData import *
from command import *
import sys
# Expected Input
# 1: Key -> UP,DOWN,RIGHT,LEFT,A,B
if (
isValidKey(sys.argv[1])
):
command = ["keyPressed"]
command.append(sys.argv[1])
setNewCommand(command)
else:
f = open("/var/www/pixel/python/.error", "a")
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
6738,
4938,
6601,
1330,
1635,
198,
6738,
3141,
1330,
1635,
198,
11748,
25064,
198,
198,
2,
1475,
7254,
23412,
198,
2,
352,
25,
7383,
4613,
15958,
11,
41925,
11,
49,
9947,
11,
2538,... | 2.134409 | 186 |
#!/usr/bin/env python
'''
geocode-csv.py - batch geocode a csv file
'''
import csv, sys, geocoder, os
if 'GOOG_PLACE_KEY' in os.environ:
google_key = os.environ['GOOG_PLACE_KEY']
else:
sys.exit("Set Google API key in $GOOG_PLACE_KEY")
csv_delimiter = ","
if len(sys.argv) == 4:
in_file = sys.argv[1]
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
7061,
6,
198,
469,
420,
1098,
12,
40664,
13,
9078,
532,
15458,
4903,
420,
1098,
257,
269,
21370,
2393,
198,
7061,
6,
198,
198,
11748,
269,
21370,
11,
25064,
11,
4903,
420,
12342... | 2.126138 | 769 |
# -*- coding: utf-8 -*-
import timeit
import ModuloMapsBasemaps
import sys
import datetime
import logging
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable, axes_size
from scipy.misc import imread
import matplotlib.cbook as cbook
import M... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
640,
270,
198,
11748,
3401,
43348,
47010,
15522,
368,
1686,
198,
11748,
25064,
198,
11748,
4818,
8079,
198,
11748,
18931,
198,
11748,
299,
32152,
355,
45941,
198,
1... | 2.92517 | 147 |
import netifaces as ni
from CustomThreads.SocketThread import SocketThread
from CustomThreads.groups import parametres
# costanti/var globali
par = parametres()
INTERFACE = par.INTERFACE
PORT_TO_LISTEN = par.PORT_TO_LISTEN
if __name__ == "__main__":
ni.ifaddresses(INTERFACE)
ip = ni.ifaddresses(INTERFACE)[ni... | [
11748,
2010,
361,
2114,
355,
37628,
198,
6738,
8562,
16818,
82,
13,
39105,
16818,
1330,
47068,
16818,
198,
6738,
8562,
16818,
82,
13,
24432,
1330,
5772,
316,
411,
198,
198,
2,
1575,
17096,
14,
7785,
3298,
72,
198,
1845,
796,
5772,
316... | 2.638767 | 227 |
from rest_framework import serializers
from rest_framework.relations import SlugRelatedField
from rest_framework.validators import UniqueTogetherValidator
from .models import Company, Employee
| [
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
6738,
1334,
62,
30604,
13,
39468,
1330,
41635,
9819,
15878,
198,
6738,
1334,
62,
30604,
13,
12102,
2024,
1330,
30015,
41631,
47139,
1352,
198,
198,
6738,
764,
27530,
1330,
5834,
11,
36824,
... | 4.690476 | 42 |
import asyncio
import os
import random
import string
from unittest.mock import patch
import pytest
from requests import Response
from http_nudger.helpers import create_postgres_connection_pool
from http_nudger.monitor import monitor_loop
from http_nudger.persister import persister_loop
pytestmark = [pytest.mark.e2e]... | [
11748,
30351,
952,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
4731,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
198,
198,
11748,
12972,
9288,
198,
6738,
7007,
1330,
18261,
198,
198,
6738,
2638,
62,
77,
463,
1362,
13,
1679... | 3.08 | 125 |
#!/usr/bin/env python3
import csv
import logging
import multiprocessing.dummy
import urllib.parse
from OpenSSL.crypto import FILETYPE_PEM, load_certificate, X509
from pyasn1.codec.der.decoder import decode as asn1_decoder
from pyasn1_modules.rfc2459 import CRLDistPointsSyntax, AuthorityInfoAccessSyntax
from typing impo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
269,
21370,
198,
11748,
18931,
198,
11748,
18540,
305,
919,
278,
13,
67,
13513,
198,
11748,
2956,
297,
571,
13,
29572,
198,
6738,
4946,
31127,
13,
29609,
78,
1330,
45811,
25... | 2.909091 | 297 |
__author__ = 'josubg'
import csv
import collections
import logging
logging.basicConfig(level=logging.DEBUG)
threshold = 0.9
total = 0.0
reader = csv.reader(open("female_frequency.csv"))
female_data = [(x[1], int(x[2])) for x in reader]
female_counter = collections.Counter()
for entry in female_data:
female_cou... | [
834,
9800,
834,
796,
705,
73,
418,
549,
70,
6,
198,
198,
11748,
269,
21370,
198,
11748,
17268,
198,
198,
11748,
18931,
198,
6404,
2667,
13,
35487,
16934,
7,
5715,
28,
6404,
2667,
13,
30531,
8,
198,
198,
400,
10126,
796,
657,
13,
2... | 2.561798 | 534 |
#-------------------------------------------------------------------------------
# Copyright (C) 2021 DjAlex88 (https://github.com/djalex88/)
#
# 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 Softwar... | [
2,
10097,
24305,
198,
2,
15069,
357,
34,
8,
33448,
220,
19307,
15309,
3459,
357,
5450,
1378,
12567,
13,
785,
14,
28241,
1000,
87,
3459,
34729,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
... | 3.943182 | 440 |
#!/usr/bin/env python.
import os
from collections import Counter
import re
import numpy as np
import pandas as pd
from dotenv import load_dotenv
###### This script generates the following pickle files: ######
# /pickles/word_count_vectors_seen.pkl
# /pickles/word_count_vectors_unseen.pkl
load_dotenv()
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
13,
201,
198,
201,
198,
11748,
28686,
201,
198,
6738,
17268,
1330,
15034,
201,
198,
11748,
302,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,... | 2.780769 | 260 |
from BARTender import *
import sys
x = BARTender()
print ("\nTest 1a: Writing to FPGA Bar 0 Scratch\n")
tmp = x.fpgaRead64(8)
print ("(0x%04x): 0x%016x" % (0x8,tmp))
print ("Writing 0xa5a5a5a5cafecafe to Scratch...")
x.fpgaWrite64(8,0xa5a5a5a5cafecafe)
print ("(0x%04x): 0x%016x" % (0x8,x.fpgaRead64(8)))
print ("Rever... | [
6738,
42346,
2194,
1330,
1635,
198,
11748,
25064,
198,
198,
87,
796,
42346,
2194,
3419,
198,
198,
4798,
5855,
59,
77,
14402,
352,
64,
25,
22183,
284,
376,
6968,
32,
2409,
657,
1446,
36722,
59,
77,
4943,
198,
22065,
796,
2124,
13,
46... | 1.989779 | 587 |
# -*- 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 or... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
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,
428,
2... | 2.50684 | 2,924 |
import datetime
from dateutil.relativedelta import (MO, FR)
from dateutil.relativedelta import (TH)
from pandas import (DateOffset, Timestamp)
from pandas.tseries.holiday import (Holiday, Easter)
from pandas.tseries.holiday import (nearest_workday)
from pandas.tseries.offsets import (Day)
#########
# Martin Luther K... | [
11748,
4818,
8079,
198,
198,
6738,
3128,
22602,
13,
2411,
265,
1572,
12514,
1330,
357,
11770,
11,
8782,
8,
198,
6738,
3128,
22602,
13,
2411,
265,
1572,
12514,
1330,
357,
4221,
8,
198,
6738,
19798,
292,
1330,
357,
10430,
34519,
11,
504... | 2.441249 | 2,851 |
import socket
import math
import pyttsx
import datetime
# UDP_IP = "192.168.1.3"
# #UDP_IP = "10.27.176.183"
# #UDP_IP = "192.168.42.23"
# UDP_PORT = 5555
| [
11748,
17802,
201,
198,
11748,
10688,
201,
198,
11748,
12972,
83,
912,
87,
201,
198,
11748,
4818,
8079,
201,
198,
201,
198,
2,
36428,
62,
4061,
796,
366,
17477,
13,
14656,
13,
16,
13,
18,
1,
201,
198,
2,
1303,
52,
6322,
62,
4061,
... | 1.836735 | 98 |
from behave import *
@given('nothing special has happened')
@when('this test is run')
@then('the test should pass') | [
6738,
17438,
1330,
1635,
628,
198,
31,
35569,
10786,
22366,
2041,
468,
3022,
11537,
628,
198,
31,
12518,
10786,
5661,
1332,
318,
1057,
11537,
628,
198,
31,
8524,
10786,
1169,
1332,
815,
1208,
11537
] | 3.558824 | 34 |
num1 = input("Digite um número: ")
num2 = input("Digite outro número: ")
"""
# isnumeric isdigit isdecimal
if num1.isdigit() and num2.isdigit():
num1 = int(num1)
num2 = int(num2)
print(num1 + num2)
else:
print("Não puder converter os números para realizar contas.")
"""
try:
num1 = int(num1)
... | [
198,
22510,
16,
796,
5128,
7203,
19511,
578,
23781,
299,
21356,
647,
78,
25,
366,
8,
198,
22510,
17,
796,
5128,
7203,
19511,
578,
503,
305,
299,
21356,
647,
78,
25,
366,
8,
198,
198,
37811,
198,
2,
2125,
39223,
318,
27003,
318,
12... | 2.260417 | 192 |
from django.shortcuts import render
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
from plotly.offline import plot
from . import my_globals
###### K-means analysis
from sklearn.cluster import KMeans
from sklearn import preprocessing
from sklearn.decomposition import PCA
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
7110,
306,
13,
42712,
355,
279,
87,
198,
11748,
7110,
306,
13,
34960,
62,
48205,
355,
467,
198,
6738,
7110,
306,
13,
2364,
1370,
1330,... | 3.358696 | 92 |
import winbrew
| [
198,
11748,
1592,
11269,
198
] | 3.2 | 5 |
import pytest
import os
import reliquery.relic as relic
from reliquery.storage import FileStorage
@pytest.fixture
| [
11748,
12972,
9288,
198,
11748,
28686,
198,
11748,
823,
1557,
1924,
13,
260,
677,
355,
26341,
198,
6738,
823,
1557,
1924,
13,
35350,
1330,
9220,
31425,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
628
] | 3.305556 | 36 |
import torch
from torch import nn
from torch.distributions import MultivariateNormal, Beta
| [
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
28034,
13,
17080,
2455,
507,
1330,
7854,
42524,
26447,
11,
17993,
628,
628,
628,
628
] | 3.92 | 25 |
from flask import Blueprint, render_template
bp = Blueprint('QRcode', __name__, url_prefix="/QRcode",
template_folder="templates", static_folder="static", static_url_path='/static')
@bp.route("/", methods=['GET', 'POST'])
| [
6738,
42903,
1330,
39932,
11,
8543,
62,
28243,
198,
198,
46583,
796,
39932,
10786,
48,
49,
8189,
3256,
11593,
3672,
834,
11,
19016,
62,
40290,
35922,
48,
49,
8189,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22... | 2.790698 | 86 |
from django.contrib.auth.models import AbstractUser
from django.db import models
class CustomUser(AbstractUser):
"""
# Default provided User fields
# Also include hidden fields.
>>> User._meta.get_fields(include_hidden=True)
(<ManyToOneRel: auth.user_groups>,
<ManyToOneRel: auth.user_user_pe... | [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
27741,
12982,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
628,
198,
198,
4871,
8562,
12982,
7,
23839,
12982,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1303,
... | 2.774021 | 562 |
"""
Created on December 1 2018
@author: Philippe Delandmeter
Function creating the unbeach velocity for the CMEMS data (A-grid)
"""
import xarray as xr
import numpy as np
data_dir = '/Volumes/oceanparcels/input_data/CMEMS/GLOBAL_REANALYSIS_PHY_001_030/'
datasetM = xr.open_dataset(data_dir + 'mercatorglorys12v1_gl12_... | [
37811,
198,
41972,
319,
3426,
352,
2864,
198,
31,
9800,
25,
39393,
4216,
392,
27231,
198,
22203,
4441,
262,
555,
1350,
620,
15432,
329,
262,
16477,
39201,
1366,
357,
32,
12,
25928,
8,
198,
37811,
198,
198,
11748,
2124,
18747,
355,
212... | 1.844828 | 1,508 |
from django.shortcuts import render
from django.http import HttpResponse
from django.http import Http404
from django.views.decorators.csrf import csrf_exempt
import jwt
import json
import datetime
from .models import User, Location, History, Flight, Train, Hotel, Payment, Attraction, Review
json_file = open('databas... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
26429,
198,
6738,
42625,
14208,
13,
33571,
13,
12501,
273,
2024,
13,
6359,
... | 2.88024 | 167 |
import os
def print_fonts():
"""
Prints all available font names
"""
fonts = load_fonts()
print_num = 0
# for every 5 colours printed, the next colour will go to a new line.
print('\nAvailable fonts:')
for font in fonts:
font = font.split('/')[2][:-4]
p... | [
11748,
28686,
201,
198,
201,
198,
201,
198,
4299,
3601,
62,
10331,
82,
33529,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
12578,
82,
477,
1695,
10369,
3891,
201,
198,
220,
220,
220,
37227,
201,
198,
201,
198,
220,
220,
... | 1.990548 | 1,058 |
#!/usr/bin/python
#coding = utf-8
import os
def buildAttr(filePath:str, targetProjectPath:str = ''):
"""
buildAttr(filePath, targetProjectPath = '') is a function to automatically build attributes to instrument classes.
Parameters
----------
filePath : str
The excel file path that tells Ri... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
66,
7656,
796,
3384,
69,
12,
23,
198,
11748,
28686,
198,
198,
4299,
1382,
8086,
81,
7,
7753,
15235,
25,
2536,
11,
2496,
16775,
15235,
25,
2536,
796,
10148,
2599,
198,
220,
220,
220,
37... | 3.150278 | 2,156 |
import sys
import glob
from prefs import *
import appGlobal
| [
11748,
25064,
198,
11748,
15095,
198,
198,
6738,
7694,
82,
1330,
1635,
198,
11748,
598,
22289,
628
] | 3.647059 | 17 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
24118,
687,
10290,
357,
27110,
5235,
8,
16984,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760... | 3.368 | 125 |
from django.db import models
from django.utils.formats import date_format
from django.utils.translation import gettext_lazy as _
class Attendance(models.Model):
""" All days of the camp
Columns:
:date: a day of the camp
:is_main: day is part of the main camp (will be selected by default)
... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
26791,
13,
687,
1381,
1330,
3128,
62,
18982,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
651,
5239,
62,
75,
12582,
355,
4808,
628,
198,
4871,
46502,
590,
... | 2.907895 | 152 |
# Generated by Django 3.2.5 on 2021-07-20 15:51
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
20,
319,
33448,
12,
2998,
12,
1238,
1315,
25,
4349,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from KNN_Classifier_V2 import KNN_Classifier
from Test_Dataset_V2 import Test_Dataset_V2
classifier = KNN_Classifier(10)
test_set = Test_Dataset_V2()
outputs = classifier.classify_data(test_set.getData(), 150)
print('KNN Classifier V2 Accuracy: {:.2f}'.format(test_set.getAccuracy(outputs))) | [
6738,
509,
6144,
62,
9487,
7483,
62,
53,
17,
1330,
509,
6144,
62,
9487,
7483,
198,
6738,
6208,
62,
27354,
292,
316,
62,
53,
17,
1330,
6208,
62,
27354,
292,
316,
62,
53,
17,
198,
198,
4871,
7483,
796,
509,
6144,
62,
9487,
7483,
7... | 2.578947 | 114 |
from __future__ import print_function
import os
import fitsio
import numpy as np
from glob import glob
from collections import Counter
import matplotlib
#matplotlib.use('Agg')
#matplotlib.rc('text', usetex=True)
#matplotlib.rc('font', family='serif')
import pylab as plt
from astrometry.util.fits import fits_table
fro... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
28686,
198,
11748,
11414,
952,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
15095,
1330,
15095,
198,
6738,
17268,
1330,
15034,
198,
198,
11748,
2603,
29487,
8019,
198,
2,
6759,
... | 3.097436 | 195 |
import smtplib,ssl
from email.mime.text import MIMEText
import os.path as op
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email import encoders
from random import randint
import timekeep
from time import sleep
files = [] #"C:\\Users\\REDACTED\\Desktop\\epiphany.jpg"
nlist = ... | [
11748,
895,
83,
489,
571,
11,
45163,
198,
6738,
3053,
13,
76,
524,
13,
5239,
1330,
337,
3955,
2767,
2302,
198,
11748,
28686,
13,
6978,
355,
1034,
198,
6738,
3053,
13,
76,
524,
13,
16680,
541,
433,
1330,
337,
3955,
3620,
586,
541,
... | 2.542035 | 904 |
VOWELS = ("a" , "e" , "i" , "o", "u")
msg = raw_input("Enter your message: ") #var for holding user message
msg.replace (" ", "")
vowel_msg = ""
vowel_count = 0 #new var to hold result of program
con_msg = ""
con_count = 0 #var to hold cons
for letter in msg:
if letter not in VOWELS:
con_msg += letter
con_co... | [
53,
3913,
37142,
796,
5855,
64,
1,
837,
366,
68,
1,
837,
366,
72,
1,
837,
366,
78,
1600,
366,
84,
4943,
198,
198,
19662,
796,
8246,
62,
15414,
7203,
17469,
534,
3275,
25,
366,
8,
1303,
7785,
329,
4769,
2836,
3275,
198,
19662,
13... | 2.406699 | 209 |
#!pip install psycopg2-binary
# alternatively you can use in command line:
# conda install -c anaconda psycopg2
import psycopg2
import sqlite3
dir(psycopg2.connect)
help(psycopg2.connect)
# dont commit password,
dbname = ''
user = ''
password = '' # DONT COMMIT THIS
host = ''
pg_conn = psycopg2.connect(dbname = dbn... | [
2,
0,
79,
541,
2721,
17331,
22163,
70,
17,
12,
39491,
198,
2,
46596,
345,
460,
779,
287,
3141,
1627,
25,
198,
2,
1779,
64,
2721,
532,
66,
281,
330,
13533,
17331,
22163,
70,
17,
198,
11748,
17331,
22163,
70,
17,
198,
11748,
44161,
... | 3.048064 | 1,498 |
#! python3
# emailInFile.py - Finds email addresses in a given file and copies them to the clipboard
# Usage: call the program with a file path as the first argument
# Example: >>> emailInFile.py C:\\Users\\ExampleUser\\Documents\\addresses.txt
import email
import pyperclip
import sys
import os
if __name__ == "__ma... | [
2,
0,
21015,
18,
198,
2,
3053,
818,
8979,
13,
9078,
532,
9938,
82,
3053,
9405,
287,
257,
1813,
2393,
290,
9088,
606,
284,
262,
47999,
198,
2,
29566,
25,
869,
262,
1430,
351,
257,
2393,
3108,
355,
262,
717,
4578,
198,
2,
17934,
2... | 3.38 | 100 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#import sys, os
from logEmail import EmailLogger
import cgi, cgitb
import os
cgitb.enable()
if __name__=="__main__":
print "Content-type: text/html\n\n"
f = cgi.FieldStorage()
ip=None
#try:
ip = f["ip"].value
loggerPath = f["loggerPath"].value
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
11748,
25064,
11,
28686,
198,
6738,
2604,
15333,
1330,
9570,
11187,
1362,
198,
11748,
269,
12397,
11,
269,
1830... | 2.36255 | 251 |
# -*- coding: utf-8 -*-
# Copyright 2019 Spanish National Research Council (CSIC)
#
# 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
#
# Unle... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
13130,
7897,
2351,
4992,
4281,
357,
7902,
2149,
8,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
... | 3.273585 | 318 |
from keras.preprocessing.image import ImageDataGenerator
import numpy as np
import os
import glob
import skimage.io as io
from skimage.color import rgb2gray
import skimage.transform as trans
from train.utils import get_subfiles
# adjust data values according to model
# generate test data
# generate training dat... | [
6738,
41927,
292,
13,
3866,
36948,
13,
9060,
1330,
7412,
6601,
8645,
1352,
198,
11748,
299,
32152,
355,
45941,
220,
198,
11748,
28686,
198,
11748,
15095,
198,
11748,
1341,
9060,
13,
952,
355,
33245,
198,
6738,
1341,
9060,
13,
8043,
1330... | 3.797753 | 89 |
# -*- coding: utf-8 -*-
# Copyright (c) 2019 The Regents of the University of California.
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyr... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
13130,
383,
3310,
658,
286,
262,
2059,
286,
3442,
13,
198,
2,
1439,
2489,
10395,
13,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
... | 2.674761 | 2,718 |
from .fixtures import adata_ithgex
import pytest
import infercnvpy as cnv
| [
6738,
764,
69,
25506,
1330,
512,
1045,
62,
342,
25636,
198,
11748,
12972,
9288,
198,
11748,
1167,
2798,
48005,
9078,
355,
269,
48005,
628,
628
] | 3.08 | 25 |
from setuptools import setup
setup(name = 'puma_iar',
version = '0.1',
description = 'functions for Puma project',
packages = ['puma_iar'],
author = 'Carolina Negrelli',
author_email = 'caro.negrelli@gmail.com',
zip_safe = False)
| [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
3672,
796,
705,
79,
7487,
62,
12571,
3256,
198,
220,
220,
220,
220,
220,
2196,
796,
705,
15,
13,
16,
3256,
198,
220,
220,
220,
220,
220,
6764,
796,
705,
12543,
2733,
329,
35... | 2.383929 | 112 |
# coding=utf-8
# Copyright (C) 2020 NumS Development Team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
357,
34,
8,
12131,
31835,
50,
7712,
4816,
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... | 2.693401 | 985 |
buffets = ('Fat sheep', 'Fat cattle', 'Bacon', 'Mutton', 'Chicken')
for buffet in buffets:
print(buffet)
buffets = ('Fat sheep', 'Fat cattle', 'Bacon', 'Oysters', 'Drumsticks')
for buffet in buffets:
print(buffet)
| [
36873,
1039,
796,
19203,
33804,
15900,
3256,
705,
33804,
17025,
3256,
705,
33,
7807,
3256,
705,
44,
21115,
3256,
705,
45565,
11537,
198,
1640,
44703,
287,
6940,
1039,
25,
198,
220,
220,
220,
3601,
7,
36873,
316,
8,
198,
198,
36873,
10... | 2.719512 | 82 |
# -*- coding: utf-8 -*-
"""
Created on Sat May 25 10:25:07 2019
@author: gthangar
"""
import pandas as pd
#import re
import nltk
from sklearn.datasets import load_files
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClas... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
7031,
1737,
1679,
838,
25,
1495,
25,
2998,
13130,
198,
198,
31,
9800,
25,
308,
400,
648,
283,
198,
37811,
198,
11748,
19798,
292,
355,
279,
67,... | 2.525154 | 1,133 |
import os
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
import environment
from admin.urls import ADMIN_URLS
if __name__ == '__main__':
main() | [
11748,
28686,
198,
198,
6738,
23645,
13,
1324,
18392,
13,
2302,
1330,
3992,
1324,
198,
6738,
23645,
13,
1324,
18392,
13,
2302,
13,
12384,
1324,
13,
22602,
1330,
1057,
62,
18504,
12397,
62,
1324,
198,
198,
11748,
2858,
198,
6738,
13169,
... | 3.015152 | 66 |
# Copyright (c) 2019 Horizon Robotics. 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 applicab... | [
2,
15069,
357,
66,
8,
13130,
22776,
47061,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
35... | 2.506442 | 2,251 |
import compas
import compas_rhino
from compas_rhino.geometry import RhinoSurface
from compas.datastructures import Mesh
from compas_rhino.artists import MeshArtist
#Generate mesh from surface
guid = compas_rhino.select_surface("Select Surface")
surf = RhinoSurface.from_guid(guid)
mesh = surf.to_compas(facef... | [
11748,
552,
292,
201,
198,
11748,
552,
292,
62,
17179,
2879,
201,
198,
6738,
552,
292,
62,
17179,
2879,
13,
469,
15748,
1330,
47759,
14214,
2550,
201,
198,
6738,
552,
292,
13,
19608,
459,
1356,
942,
1330,
47529,
201,
198,
6738,
552,
... | 2.40038 | 527 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from Tkinter import *
import dataset
# connecting to a SQLite database
db = dataset.connect('sqlite:///sg1.db')
if __name__ == '__main__':
root = Tk()
root.bind_all("<Double-Button-1>", selected)
# create a menu
menu = MenuBar(root)
root.conf... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
309,
74,
3849,
1330,
1635,
198,
11748,
27039,
198,
198,
2,
14320,
284,
257,
16363,
578,
6831,
198,
9945,
7... | 2.335347 | 331 |
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
15069,
357,
66,
8,
1584,
11,
33160,
11,
18650,
290,
14,
273,
663,
29116,
13,
220,
1439,
2489,
10395,
13,
198,
2,
770,
3788,
318,
10668,
12,
36612,
284,
345,
739,
262,
14499,
2448,
33532,
1... | 2.552771 | 4,709 |
"""
Monkey Patching
===============
"""
import requests
import wrapt
from .. import wrappers
from ..utils import construct_user_agent
def patch_with_user_agent(user_agent=None):
"""Patch :meth:`requests.Session.request` with User-Agent.
In case `User-Agent` header has not been provided directly to request.... | [
37811,
198,
9069,
2539,
17106,
278,
198,
25609,
18604,
198,
37811,
198,
198,
11748,
7007,
198,
11748,
7917,
457,
198,
198,
6738,
11485,
1330,
7917,
11799,
198,
6738,
11485,
26791,
1330,
5678,
62,
7220,
62,
25781,
628,
198,
4299,
8529,
6... | 2.751889 | 794 |
import unittest
from . import puzzle
| [
11748,
555,
715,
395,
198,
6738,
764,
1330,
15027,
628
] | 3.8 | 10 |
from datadog_export.logger import log
from copy import deepcopy
from datetime import datetime
from typing import List, Optional
import click
import pytz
import requests
from re import Pattern, compile
from datadog_export import click_argument_types
from datadog_export.exporter import Exporter
from durations import Dur... | [
6738,
4818,
324,
519,
62,
39344,
13,
6404,
1362,
1330,
2604,
198,
6738,
4866,
1330,
2769,
30073,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
19720,
1330,
7343,
11,
32233,
198,
198,
11748,
3904,
198,
11748,
12972,
22877,
198,
117... | 2.759086 | 963 |
formatter = "%r %r %r %r"
print(formatter %(1,2,3,4))
print(formatter %('one','two','three','four'))
print(formatter %(True,False,False,True))
print(formatter %(formatter,formatter,formatter,formatter))
print(formatter %('I had this thing' ,'That you could type up right','But it didnt sing.','So I said GN'))
| [
687,
1436,
796,
36521,
81,
4064,
81,
4064,
81,
4064,
81,
1,
220,
198,
4798,
7,
687,
1436,
4064,
7,
16,
11,
17,
11,
18,
11,
19,
4008,
198,
4798,
7,
687,
1436,
4064,
10786,
505,
41707,
11545,
41707,
15542,
41707,
14337,
6,
4008,
1... | 2.776786 | 112 |
# -*- coding: utf-8 -*-
#
# test_csa.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
1332,
62,
6359,
64,
13,
9078,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
399,
6465,
13,
198,
2,
198,
2,
15069,
357,
34,
8,
5472,
383,
399,
6465,
18362,... | 2.369205 | 3,020 |
# -*- coding:utf-8 -*-
root = TreeNode(10)
root.left = TreeNode(6)
root.left.left = TreeNode(4)
root.left.right = TreeNode(8)
root.right = TreeNode(14)
root.right.left = TreeNode(12)
root.right.right = TreeNode(16)
s = Solution()
s.Convert(root) | [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
198,
15763,
796,
12200,
19667,
7,
940,
8,
198,
15763,
13,
9464,
796,
12200,
19667,
7,
21,
8,
198,
15763,
13,
9464,
13,
9464,
796,
12200,
19667,
7,
19,
8,
198,
15763,
13... | 2.398058 | 103 |
'''
api-tests.py
Written by Grace de Benedetti and Nick Pandelakis
19 Feb 2021
'''
from terrorism_api import app
import unittest
import responses
##### Setup #####
##### Tests #####
if __name__=='__main__':
unittest.main()
| [
7061,
6,
198,
220,
220,
220,
40391,
12,
41989,
13,
9078,
198,
220,
220,
220,
22503,
416,
16156,
390,
25660,
24851,
290,
8047,
16492,
417,
27321,
198,
220,
220,
220,
678,
3158,
33448,
198,
7061,
6,
198,
198,
6738,
8649,
62,
15042,
13... | 2.813187 | 91 |
from early_parser.test_module.test_grammar_module.tests import *
| [
6738,
1903,
62,
48610,
13,
9288,
62,
21412,
13,
9288,
62,
4546,
3876,
62,
21412,
13,
41989,
1330,
1635,
198
] | 3.25 | 20 |