content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# *****************************************************************************
# *****************************************************************************
#
# Name: bresenham.py
# Purpose: Bresenham type Line Algorithm test
# Created: 8th March 2020
# Author: Paul Robson (paul@robsons.org.uk)
#
# ***********... | [
2,
41906,
17174,
4557,
35625,
198,
2,
41906,
17174,
4557,
35625,
198,
2,
198,
2,
197,
197,
5376,
25,
197,
197,
65,
411,
268,
2763,
13,
9078,
198,
2,
197,
197,
30026,
3455,
25,
197,
33,
411,
268,
2763,
2099,
6910,
978,
42289,
1332,... | 3.692308 | 221 |
import os
from typing import Optional, List
from aws_cdk import (
core,
custom_resources as acr,
aws_iam as iam,
aws_lambda as _lambda,
aws_lambda_python as lambda_python,
aws_route53 as route53,
)
from acru_l.resources.custom_resources import PythonCustomResource
dirname = os.path.dirname(... | [
11748,
28686,
198,
198,
6738,
19720,
1330,
32233,
11,
7343,
198,
198,
6738,
3253,
82,
62,
10210,
74,
1330,
357,
198,
220,
220,
220,
4755,
11,
198,
220,
220,
220,
2183,
62,
37540,
355,
936,
81,
11,
198,
220,
220,
220,
3253,
82,
62,... | 2.648 | 125 |
'''
ÁRVORE BINÁRIA DE BUSCA
'''
'''
Trabalho para dia 12/04
=|=|= *** Sistemas *** =|=|=
- Classificação de cerveja
- Cadastro de clientes
- Classificação de personagens de jogos
- Classificação de cinema
- Jogo da memória
'''
# Sub-árvores vázias é onde será inseridos elementos
'''
VERIFICAR NA REMOÇÃO
* fil... | [
7061,
6,
198,
127,
223,
49,
53,
6965,
347,
1268,
127,
223,
49,
3539,
5550,
43949,
8141,
198,
7061,
6,
198,
198,
7061,
6,
198,
2898,
44349,
8873,
31215,
288,
544,
1105,
14,
3023,
628,
796,
91,
28,
91,
28,
17202,
311,
396,
368,
29... | 2.121827 | 394 |
#!/usr/bin/env pybricks-micropython
from spockbots.output import PRINT
from spockbots.gyro import SpockbotsGyro as Gyro
# from spockbots.systemgyro import Gyro
"""GYRO-ANG GYRO-RATE GYRO-FAS GYRO-G&A GYRO-CAL TILT-RATE TILT-ANG"""
gyro = Gyro(1)
# gyro.connect()
gyro.reset()
if gyro.still():
PRINT("ROBOT STILL")... | [
2,
48443,
14629,
14,
8800,
14,
24330,
12972,
65,
23706,
12,
9383,
1773,
7535,
198,
198,
6738,
599,
735,
42478,
13,
22915,
1330,
4810,
12394,
198,
6738,
599,
735,
42478,
13,
1360,
305,
1330,
37945,
42478,
44802,
305,
355,
18488,
305,
1... | 2.051793 | 251 |
"""
setup for nsupdate package
"""
import sys
PY2 = sys.version_info[0] == 2
from setuptools import setup, find_packages
from nsupdate import version
with open('README.rst') as f:
readme_content = f.read()
if PY2:
install_requires = ['dnspython', ]
else:
install_requires = ['dnspython3', ]
setup(
... | [
37811,
198,
40406,
329,
36545,
19119,
5301,
198,
37811,
198,
198,
11748,
25064,
198,
47,
56,
17,
796,
25064,
13,
9641,
62,
10951,
58,
15,
60,
6624,
362,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
6... | 2.227989 | 1,079 |
"""
This file contains classes and methods to define the geometry of the ME-SXR detector, define and
interpret lines of sight, and related convert between various coordinate systems.
"""
from __future__ import division
import numpy as np
import scipy as sp
import scipy.constants
# Module-wide constants
MST_MINOR_RADIU... | [
37811,
198,
1212,
2393,
4909,
6097,
290,
5050,
284,
8160,
262,
22939,
286,
262,
11948,
12,
50,
55,
49,
31029,
11,
8160,
290,
198,
27381,
3951,
286,
6504,
11,
290,
3519,
10385,
1022,
2972,
20435,
3341,
13,
198,
37811,
198,
6738,
11593,... | 2.421536 | 2,721 |
from onpolicy.envs.highway.highway_env.envs.highway_env import *
from onpolicy.envs.highway.highway_env.envs.merge_env import *
from onpolicy.envs.highway.highway_env.envs.parking_env import *
from onpolicy.envs.highway.highway_env.envs.summon_env import *
from onpolicy.envs.highway.highway_env.envs.roundabout_env impo... | [
6738,
319,
30586,
13,
268,
14259,
13,
8929,
1014,
13,
8929,
1014,
62,
24330,
13,
268,
14259,
13,
8929,
1014,
62,
24330,
1330,
1635,
198,
6738,
319,
30586,
13,
268,
14259,
13,
8929,
1014,
13,
8929,
1014,
62,
24330,
13,
268,
14259,
13... | 2.623762 | 202 |
from evolution.agent import Agent
from grove import config
import evolution.selection as selection
config.load_config('evolution/test/grove-config.json')
| [
6738,
6954,
13,
25781,
1330,
15906,
198,
6738,
7128,
303,
1330,
4566,
198,
198,
11748,
6954,
13,
49283,
355,
6356,
628,
198,
11250,
13,
2220,
62,
11250,
10786,
1990,
2122,
14,
9288,
14,
27333,
303,
12,
11250,
13,
17752,
11537,
628,
62... | 3.809524 | 42 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from django.views import defaults as default_views
from gr... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
... | 2.673484 | 1,369 |
import matplotlib.pyplot as plt
import numpy as np
import torch
from torch import nn
from torch import optim
import torch.nn.functional as F
from torchvision import datasets, transforms, models
data_dir = '/mnt/gunkaynar/project/beegees/data/train'
trainloader, validationloader,testloader = load_split_train_test(data_... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
28034,
1330,
6436,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,... | 2.217223 | 1,289 |
#Nested Loops
#Coordinates
for x in range(4):
for y in range(3):
print(f'({x}, {y})')
#Challenge
numbers = [5, 2, 5, 2, 2]
for x_count in numbers:
output = ''
for count in range(x_count):
output += 'x'
print(output)
| [
2,
45,
7287,
6706,
2840,
201,
198,
2,
7222,
585,
17540,
201,
198,
1640,
2124,
287,
2837,
7,
19,
2599,
201,
198,
220,
220,
220,
329,
331,
287,
2837,
7,
18,
2599,
201,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
69,
6,
1509... | 1.97037 | 135 |
# coding: utf-8
"""
Blackfynn Swagger
Swagger documentation for the Blackfynn api # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class AnnotationResults(object):
"""NOTE: This class is auto generated... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
220,
220,
220,
2619,
69,
2047,
77,
2451,
7928,
628,
220,
220,
220,
2451,
7928,
10314,
329,
262,
2619,
69,
2047,
77,
40391,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,... | 2.343198 | 2,095 |
import sys
import os
if len(sys.argv) < 2:
print(f'usage: {os.path.basename(sys.argv[1])} <input.txt>')
exit(1)
with open(sys.argv[1], 'r') as f:
orig_mem = list(map(int, f.readline().split(',')))
for noun in range(0, 100):
for verb in range(0, 100):
mem = orig_mem.copy()
mem[1] = noun
mem[2] = verb
for ... | [
11748,
25064,
198,
11748,
28686,
198,
198,
361,
18896,
7,
17597,
13,
853,
85,
8,
1279,
362,
25,
198,
197,
4798,
7,
69,
6,
26060,
25,
1391,
418,
13,
6978,
13,
12093,
12453,
7,
17597,
13,
853,
85,
58,
16,
12962,
92,
1279,
15414,
1... | 1.942197 | 346 |
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import List, Mapping, Sequence
from snuba.clickhouse.columns import ColumnSet, ColumnType
from snuba.query.data_source import DataSource
from snuba.query.expressions import FunctionCall
class RelationalSource(DataSource, ABC):
""... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
19720,
1330,
7343,
11,
337,
5912,
11,
45835,
198,
198,
6738,
3013,
22013,
13,
12976,
4803,
13,
28665,
82,
1330,
29201,
7248,
11,
2... | 2.848465 | 1,531 |
import pickle
import os
import nltk
import re
from ClassifierBasedGermanTagger.ClassifierBasedGermanTagger import ClassifierBasedGermanTagger
stripge = re.compile(r"^ge(.{4,})")
replxx = re.compile(r"(.)\1")
replxxback = re.compile(r"(.)\*")
stripemr = re.compile(r"e[mr]$")
stripnd = re.compile(r"nd$")
stript = re.co... | [
11748,
2298,
293,
198,
11748,
28686,
198,
11748,
299,
2528,
74,
198,
11748,
302,
198,
198,
6738,
5016,
7483,
15001,
16010,
51,
7928,
13,
9487,
7483,
15001,
16010,
51,
7928,
1330,
5016,
7483,
15001,
16010,
51,
7928,
198,
198,
36311,
469,... | 3.22449 | 343 |
# File name: exercise7.py
# Author: Steve Hommy
# Description: Arithmetic progression with a common difference of 3
# Defining function
# Calling the function
arithmetic_progression()
| [
2,
9220,
1438,
25,
5517,
22,
13,
9078,
198,
2,
6434,
25,
6542,
8074,
1820,
198,
2,
12489,
25,
943,
29848,
17085,
351,
257,
2219,
3580,
286,
513,
198,
198,
2,
2896,
3191,
2163,
628,
198,
2,
32677,
262,
2163,
198,
283,
29848,
62,
... | 3.895833 | 48 |
from __future__ import annotations
import hashlib
from neo3 import vm, contracts, settings
from neo3.network import payloads
from neo3.core import cryptography
from neo3.contracts.interop import register
from typing import cast, List
@register("Neo.Crypto.RIPEMD160", 1 << 15, contracts.CallFlags.NONE)
@register("N... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
11748,
12234,
8019,
198,
6738,
19102,
18,
1330,
45887,
11,
8592,
11,
6460,
198,
6738,
19102,
18,
13,
27349,
1330,
21437,
82,
198,
6738,
19102,
18,
13,
7295,
1330,
45898,
198,
6738,
19102,
18,
... | 2.895582 | 249 |
import numpy as np
from load_auto import load_auto
import matplotlib.pyplot as plt
import math
PATH_DATASET = '/Users/marcellovendruscolo/Documents/vscode-workspace/DeepLearningForImageAnalysis/linearRegression_gradientDescent/Auto.csv'
train_dataset, train_labels = load_auto(PATH_DATASET)
train_dataset = np.array(tra... | [
11748,
299,
32152,
355,
45941,
198,
6738,
3440,
62,
23736,
1330,
3440,
62,
23736,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
10688,
198,
198,
34219,
62,
35,
1404,
1921,
2767,
796,
31051,
14490,
14,
3876,
... | 2.764432 | 1,074 |
#!/usr/bin/env python3
'''
Copyright 2018, VDMS
Licensed under the terms of the BSD 2-clause license. See LICENSE file for terms.
'''
# Run through Analysis
import os
import ast
import argparse
from configparser import ConfigParser
import pprint
import pymysql
import json
import re
#import apt_pkg
from copy import d... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
7061,
6,
198,
15269,
2864,
11,
569,
35,
5653,
198,
26656,
15385,
739,
262,
2846,
286,
262,
347,
10305,
362,
12,
565,
682,
5964,
13,
4091,
38559,
24290,
2393,
329,
2846,
13,
... | 3.470588 | 136 |
import tensorflow as tf
import keras
from keras import backend as K
from keras.datasets import mnist
from keras.layers.core import Dense, Dropout, Activation
from keras.layers import BatchNormalization, Conv2D, Flatten
from keras.layers import Input, Convolution2D, MaxPooling2D, Activation, concatenate, Dropout, warni... | [
11748,
11192,
273,
11125,
355,
48700,
198,
198,
11748,
41927,
292,
198,
6738,
41927,
292,
1330,
30203,
355,
509,
198,
6738,
41927,
292,
13,
19608,
292,
1039,
1330,
285,
77,
396,
198,
6738,
41927,
292,
13,
75,
6962,
13,
7295,
1330,
360... | 3.368421 | 171 |
import argparse
import tensorflow as tf
import numpy as np
from tfbldr.datasets import fetch_mnist
from collections import namedtuple
import sys
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
from tfbldr.datasets import fetch_norvig_words
from tfbldr.datasets import list_iterator
parser = ar... | [
11748,
1822,
29572,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
256,
21855,
335,
81,
13,
19608,
292,
1039,
1330,
21207,
62,
10295,
396,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
11748,
2... | 2.066783 | 2,291 |
from datetime import timedelta
from django.utils import timezone
NOW = timezone.now()
TOMORROW = NOW + timedelta(days=1)
YESTERDAY = NOW - timedelta(days=1)
| [
6738,
4818,
8079,
1330,
28805,
12514,
198,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
198,
198,
45669,
796,
640,
11340,
13,
2197,
3419,
198,
51,
2662,
1581,
49,
3913,
796,
20229,
1343,
28805,
12514,
7,
12545,
28,
16,
8,
198... | 2.839286 | 56 |
from django import forms
| [
6738,
42625,
14208,
1330,
5107,
628
] | 4.333333 | 6 |
# sys imports
import os,sys
sys.path.append('/home/ryan/github/prosodic')
import warnings
warnings.filterwarnings('ignore')
import prosodic as p
from tqdm import tqdm
import pandas as pd,numpy as np,random,json,pickle,shutil
from collections import defaultdict,Counter
import subprocess,multiprocessing as mp
mp.set_s... | [
198,
198,
2,
25064,
17944,
198,
11748,
28686,
11,
17597,
198,
17597,
13,
6978,
13,
33295,
10786,
14,
11195,
14,
29038,
14,
12567,
14,
1676,
82,
29512,
11537,
198,
11748,
14601,
198,
40539,
654,
13,
24455,
40539,
654,
10786,
46430,
11537... | 2.24613 | 1,292 |
is_it_monday = False
is_today_wednesday = True
default = {'name': 'Brian'}
cecil = {'name': 'Cecil'}
apples_i_really_want = {}
result = get_apples()
print(result)
| [
271,
62,
270,
62,
76,
3204,
796,
10352,
198,
271,
62,
40838,
62,
19103,
3462,
796,
220,
6407,
198,
198,
12286,
796,
1391,
6,
3672,
10354,
705,
24761,
6,
92,
198,
344,
2856,
796,
1391,
6,
3672,
10354,
705,
34,
721,
346,
6,
92,
19... | 2.366197 | 71 |
from unittest.mock import Mock
from src.bp import GetAllTypeGamesUseCase
from src.bp import ParamsGetAllTypeGames
| [
6738,
555,
715,
395,
13,
76,
735,
1330,
44123,
198,
198,
6738,
12351,
13,
46583,
1330,
3497,
3237,
6030,
24474,
11041,
20448,
198,
6738,
12351,
13,
46583,
1330,
2547,
4105,
3855,
3237,
6030,
24474,
628
] | 3.314286 | 35 |
#!/usr/bin/env python
from __future__ import print_function
from sys import version
if version[0] == "2":
from urllib import urlopen
else:
from urllib.request import urlopen
if __name__ == "__main__":
print(get_ubuntu_ami())
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
6738,
25064,
1330,
2196,
198,
198,
361,
2196,
58,
15,
60,
6624,
366,
17,
1298,
198,
220,
220,
220,
422,
2956,
297,
571,
... | 2.761364 | 88 |
#!/usr/bin/env python
# -- coding: utf-8 --
#==========================
#= Gomoku Game =
#==========================
from __future__ import print_function, division
import os, sys, time, collections
from functools import update_wrapper
import pickle, h5py
import numpy as np
def decorator(d):
"Make fun... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
1377,
19617,
25,
3384,
69,
12,
23,
1377,
198,
198,
2,
4770,
2559,
855,
198,
2,
28,
220,
220,
220,
220,
220,
402,
296,
11601,
3776,
220,
220,
220,
220,
220,
220,
796,
198,
2,
... | 2.731638 | 354 |
# Web Scraping #
import requests
from requests import get
from requests.exceptions import RequestException
from bs4 import BeautifulSoup
# Web Scraping #
# GUI Interface #
import tkinter as tk
from tkinter import *
from tkinter import font
import requests
from PIL import ImageTk, Image
# GUI Interface #
from tkinter i... | [
2,
5313,
1446,
2416,
278,
1303,
198,
11748,
7007,
198,
6738,
7007,
1330,
651,
198,
6738,
7007,
13,
1069,
11755,
1330,
19390,
16922,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
2,
5313,
1446,
2416,
278,
1303,
198,
198,
2,
25... | 3.560976 | 123 |
fig, ax = plt.subplots(2, sharex='all', figsize=(10, 5))
fig.savefig("two-subplots.png") | [
5647,
11,
7877,
796,
458,
83,
13,
7266,
489,
1747,
7,
17,
11,
2648,
87,
11639,
439,
3256,
2336,
7857,
16193,
940,
11,
642,
4008,
198,
198,
5647,
13,
21928,
5647,
7203,
11545,
12,
7266,
489,
1747,
13,
11134,
4943
] | 2.225 | 40 |
from tests import ScraperTest
from recipe_scrapers.epicurious import Epicurious
| [
6738,
5254,
1330,
1446,
38545,
14402,
198,
198,
6738,
8364,
62,
1416,
2416,
364,
13,
538,
291,
16421,
1330,
16781,
16421,
628
] | 3.727273 | 22 |
from django.shortcuts import render
from django.http import HttpResponse
from django.http import JsonResponse
import requests
import os
# Create your views here. | [
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,
449,
1559,
31077,
198,
11748,
7007,
198,
11748,
28686,
198,
198,
2,
13610,
534,
5009,
... | 3.857143 | 42 |
# -*- coding: utf-8 -*-
#
# Project name: flask-restfull-example
# File name: urls
# Created: 2019-05-08
#
# Author: Liubov M. <liubov.mikhailova@gmail.com>
"""
Metrics urls
"""
from api.metrics.views import MetricsView
METRIC_URLS = [
('/metrics', MetricsView.as_view('metrics'))
]
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
4935,
1438,
25,
42903,
12,
2118,
12853,
12,
20688,
198,
2,
9220,
1438,
25,
2956,
7278,
198,
2,
15622,
25,
13130,
12,
2713,
12,
2919,
198,
2,
198,
2,
643... | 2.4 | 120 |
import requests
# second_first_url = 'https://huobi.vn' #需要科学上网
huobi_url = 'https://api.huobi.br.com' #不用翻墙
parse ='/v1/common/symbols'
urls = huobi_url+parse
print(urls)
response = requests.get(urls)
print(response.status_code)
print(response.text)
huobi = GetRequests()
text = huobi.get_text(urls)
print(... | [
11748,
7007,
198,
198,
2,
1218,
62,
11085,
62,
6371,
796,
705,
5450,
1378,
13415,
13411,
13,
85,
77,
6,
220,
220,
220,
1303,
165,
250,
222,
17358,
223,
163,
100,
239,
27764,
99,
41468,
163,
121,
239,
198,
13415,
13411,
62,
6371,
7... | 2.096774 | 155 |
class InvalidRequestMethod(Exception):
"""Raise an invalid request method """
class TintriError(Exception):
"""Raise an invalid filter message""" | [
198,
198,
4871,
17665,
18453,
17410,
7,
16922,
2599,
198,
220,
220,
220,
37227,
21762,
786,
281,
12515,
2581,
2446,
37227,
198,
198,
4871,
309,
600,
380,
12331,
7,
16922,
2599,
198,
220,
220,
220,
37227,
21762,
786,
281,
12515,
8106,
... | 3.627907 | 43 |
# This challenge use a disjoint set with set size tracking.
# In addition to the basic disjoint set operations, we keep
# track of the total elements in a set with (#1), and add a
# method (#2) to get the set size.
#
# The find method is just plain path compression but written
# in a more verbose manner to eliminate re... | [
2,
770,
4427,
779,
257,
595,
73,
1563,
900,
351,
900,
2546,
9646,
13,
198,
2,
554,
3090,
284,
262,
4096,
595,
73,
1563,
900,
4560,
11,
356,
1394,
198,
2,
2610,
286,
262,
2472,
4847,
287,
257,
900,
351,
17426,
16,
828,
290,
751,
... | 2.862944 | 197 |
# coding=utf-8
from OTLMOW.OTLModel.BaseClasses.OTLAttribuut import OTLAttribuut
from OTLMOW.OTLModel.Classes.AIMObject import AIMObject
from OTLMOW.OTLModel.Datatypes.DtcDocument import DtcDocument
from OTLMOW.GeometrieArtefact.VlakGeometrie import VlakGeometrie
# Generated with OTLClassCreator. To modify: extend, d... | [
2,
19617,
28,
40477,
12,
23,
198,
6738,
440,
14990,
44,
3913,
13,
2394,
43,
17633,
13,
14881,
9487,
274,
13,
2394,
43,
8086,
822,
84,
315,
1330,
440,
14990,
8086,
822,
84,
315,
198,
6738,
440,
14990,
44,
3913,
13,
2394,
43,
17633,... | 2.495627 | 343 |
# coding: utf8
"""
Check the absence of data leakage
1) Baseline datasets contain only one scan per subject
2) No intersection between train and test sets
3) Absence of MCI train subjects in test sets of subcategories of MCI
"""
import argparse
import pandas as pd
import os
from os import path
if __... | [
2,
19617,
25,
3384,
69,
23,
198,
198,
37811,
198,
9787,
262,
8889,
286,
1366,
47988,
198,
220,
220,
220,
352,
8,
6455,
4470,
40522,
3994,
691,
530,
9367,
583,
2426,
198,
220,
220,
220,
362,
8,
1400,
16246,
1022,
4512,
290,
1332,
5... | 2.747159 | 352 |
from .categories import Category
from .config_map import ConfigMap
from .output import render
__version__ = '0.2.1' | [
6738,
764,
66,
26129,
1330,
21743,
198,
6738,
764,
11250,
62,
8899,
1330,
17056,
13912,
198,
6738,
764,
22915,
1330,
8543,
198,
198,
834,
9641,
834,
796,
705,
15,
13,
17,
13,
16,
6
] | 3.411765 | 34 |
try:
import capstone
except ImportError as e:
capstone = None
import pytest
import windows.native_exec.simple_x64 as x64
from windows.native_exec.simple_x64 import *
del Test # Prevent pytest warning
from windows.pycompat import int_types
if capstone:
disassembleur = capstone.Cs(capstone.CS_ARCH_X86, cap... | [
28311,
25,
198,
220,
220,
220,
1330,
1451,
6440,
198,
16341,
17267,
12331,
355,
304,
25,
198,
220,
220,
220,
1451,
6440,
796,
6045,
198,
11748,
12972,
9288,
198,
198,
11748,
9168,
13,
30191,
62,
18558,
13,
36439,
62,
87,
2414,
355,
... | 2.681592 | 201 |
# coding: utf-8
from __future__ import absolute_import
import unittest
class TestBody41(unittest.TestCase):
"""Body41 unit test stubs"""
def testBody41(self):
"""Test Body41"""
# FIXME: construct object with mandatory attributes with example values
# model = gitee.models.body41.Bod... | [
2,
19617,
25,
3384,
69,
12,
23,
628,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
11748,
555,
715,
395,
628,
198,
4871,
6208,
25842,
3901,
7,
403,
715,
395,
13,
14402,
20448,
2599,
198,
220,
220,
220,
37227,
25842,... | 2.593548 | 155 |
import machine
import ntptime
import network
import time
import config
| [
11748,
4572,
198,
11748,
299,
83,
457,
524,
198,
11748,
3127,
198,
11748,
640,
198,
11748,
4566,
628,
628,
198
] | 3.75 | 20 |
from django import forms
from django.forms import ModelForm
from .models import PlantSpecies, \
Plant, \
PlantSource
| [
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
23914,
1330,
9104,
8479,
198,
198,
6738,
764,
27530,
1330,
16561,
5248,
3171,
11,
3467,
198,
197,
197,
197,
197,
197,
3646,
415,
11,
3467,
198,
197,
197,
197,
197,
197,
3646... | 2.844444 | 45 |
task = '''
Реализовать функцию my_func(), которая принимает три позиционных аргумента,
и возвращает сумму наибольших двух аргументов.
'''
if __name__ == '__main__':
print(task)
print(my_func(1, 2, 3))
| [
35943,
796,
705,
7061,
198,
140,
254,
16843,
16142,
30143,
18849,
140,
115,
25443,
110,
16142,
20375,
45367,
220,
141,
226,
35072,
22177,
31583,
141,
228,
18849,
141,
236,
616,
62,
20786,
22784,
12466,
118,
15166,
20375,
15166,
21169,
161... | 1.206897 | 174 |
from django import template
from django.db.models import Count
from django.utils.safestring import mark_safe
from ..models import Post
import markdown
register = template.Library()
@register.simple_tag(name='my_post_count')
def total_posts():
"""
Simply two parts (at least for now :P)
... | [
6738,
42625,
14208,
1330,
11055,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
2764,
198,
6738,
42625,
14208,
13,
26791,
13,
49585,
395,
1806,
1330,
1317,
62,
21230,
198,
198,
6738,
11485,
27530,
1330,
2947,
198,
198,
11748,
1317,
... | 2.317256 | 933 |
#!/usr/bin/env python
"""Create all html, css, js content for displaying power rankings on a website"""
import os
import logging
import shutil
from distutils.dir_util import copy_tree
import pkg_resources
import numpy as np
import pandas as pd
from ..history import scrape_history
__author__ = 'Ryne Carbone'
logger ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
16447,
477,
27711,
11,
269,
824,
11,
44804,
2695,
329,
19407,
1176,
16905,
319,
257,
3052,
37811,
198,
198,
11748,
28686,
198,
11748,
18931,
198,
11748,
4423,
346,
198,
6738,... | 2.28942 | 9,291 |
# Exercise 4: Apply different configuration to different switches
from netmiko import ConnectHandler
CoreSW = {
'device_type': 'cisco_ios',
'ip': '192.168.100.20',
'username': 'admin',
'password': 'cisco',
'secret' : 'cisco'
}
SW1 = {
'device_type': 'cisco_ios',
'ip': '192.168.100.21',
'username': 'admin',
'pa... | [
2,
32900,
604,
25,
27967,
1180,
8398,
284,
1180,
18225,
198,
6738,
2010,
76,
12125,
1330,
8113,
25060,
198,
14055,
17887,
796,
1391,
198,
705,
25202,
62,
4906,
10354,
705,
66,
4861,
62,
4267,
3256,
198,
705,
541,
10354,
705,
17477,
13... | 2.661972 | 355 |
#####################################################################
#
# metro.py
#
# Copyright (c) 2015, Eran Egozy
#
# Released under the MIT License (http://opensource.org/licenses/MIT)
#
#####################################################################
from song import Track
from clock import kTicksPerQuarter... | [
29113,
29113,
4242,
2,
198,
2,
198,
2,
24536,
13,
9078,
198,
2,
198,
2,
15069,
357,
66,
8,
1853,
11,
412,
2596,
412,
2188,
7357,
198,
2,
198,
2,
28728,
739,
262,
17168,
13789,
357,
4023,
1378,
44813,
1668,
13,
2398,
14,
677,
454... | 4.458333 | 72 |
import numpy as np
from typing import Tuple, List, Union
from src.feed_forward.layers import CrossEntropyLoss, ParamLayer, Layer
from tqdm import tqdm
import math
| [
11748,
299,
32152,
355,
45941,
198,
6738,
19720,
1330,
309,
29291,
11,
7343,
11,
4479,
198,
6738,
12351,
13,
12363,
62,
11813,
13,
75,
6962,
1330,
6372,
14539,
28338,
43,
793,
11,
25139,
49925,
11,
34398,
198,
6738,
256,
80,
36020,
13... | 3.32 | 50 |
import sys
from cvtools import SelectionWindow, CompTracker, CompFilter, Processing, Vid
if __name__ == '__main__':
example()
# 'lower_color_bound': [0.0, 0.0, 20.0],
# 'upper_color_bound': [255.0, 2.0, 70.0],
# 'color_channel': [2],
# 'channel_range': [0, 255],
# 'bin_nb': [20]
# 'lower_color_bound': [0.0,... | [
11748,
25064,
198,
198,
6738,
269,
85,
31391,
1330,
29538,
27703,
11,
3082,
35694,
11,
3082,
22417,
11,
28403,
11,
38965,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1672,
3419,
628,
19... | 2.215054 | 279 |
import torch
## extract residual components and projection operator
# @profile()
## project C to residual space
def indirect_ged(A, B, gamma=1e-9):
'''
Reduce GED to two SVD
'''
Vb, db, _ = torch.linalg.svd(B)
db += gamma
Vb_ = Vb / (db**0.5)
A_ = Vb_.T @ A @ Vb_
Va, d, _ = torch... | [
11748,
28034,
220,
628,
198,
198,
2235,
7925,
29598,
6805,
290,
20128,
10088,
198,
2,
2488,
13317,
3419,
198,
198,
2235,
1628,
327,
284,
29598,
2272,
198,
198,
4299,
12913,
62,
2004,
7,
32,
11,
347,
11,
34236,
28,
16,
68,
12,
24,
... | 2.223043 | 677 |
import tensorflow as tf
from GrowingNeuralGas import GrowingNeuralGas
# Model
from GrowingNeuralGasPlotter import GrowingNeuralGasPlotter
epochs = 10
eta = 25
# Test set
standard_deviation = .1
test() | [
11748,
11192,
273,
11125,
355,
48700,
201,
198,
201,
198,
6738,
37487,
8199,
1523,
39699,
1330,
37487,
8199,
1523,
39699,
201,
198,
201,
198,
2,
9104,
201,
198,
6738,
37487,
8199,
1523,
39699,
43328,
353,
1330,
37487,
8199,
1523,
39699,
... | 2.75 | 80 |
a = 4*100-54
input("Enter your answer: ")
print("Right answer: {0}". format(a))
| [
64,
796,
604,
9,
3064,
12,
4051,
198,
15414,
7203,
17469,
534,
3280,
25,
366,
8,
198,
4798,
7203,
11028,
3280,
25,
1391,
15,
92,
1911,
5794,
7,
64,
4008,
198
] | 2.580645 | 31 |
# AUTOGENERATED FILE - DO NOT MODIFY!
# This file generated by Djinni from extended_record.djinni
from djinni.support import MultiSet # default imported in all files
from djinni.exception import CPyException # default imported in all files
from djinni.pycffi_marshal import CPyRecord
from extended_record import Extend... | [
2,
47044,
7730,
1677,
1137,
11617,
45811,
532,
8410,
5626,
19164,
5064,
56,
0,
198,
2,
770,
2393,
7560,
416,
19307,
3732,
72,
422,
7083,
62,
22105,
13,
28241,
3732,
72,
198,
198,
6738,
42625,
3732,
72,
13,
11284,
1330,
15237,
7248,
... | 3.502203 | 227 |
# Generated by Django 2.0.4 on 2018-08-27 08:20
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
13,
19,
319,
2864,
12,
2919,
12,
1983,
8487,
25,
1238,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import os
import sys
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
parent_dir_name = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(parent_dir_name)
from utils.iwe import purge_unfeasible, get_interpolation, interpolate
class EventWarping(nn.Mod... | [
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
198,
8000,
62,
15908,
62,
3672,
796,
28686,... | 2.022184 | 5,229 |
from __future__ import print_function
import numpy as np
np.random.seed(1337) # for reproducibility
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # see issue #152
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
from keras.datasets import mnist
from keras.models import Sequential, Model, load_model
from keras.lay... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
299,
32152,
355,
45941,
198,
37659,
13,
25120,
13,
28826,
7,
1485,
2718,
8,
220,
1303,
329,
8186,
66,
2247,
198,
11748,
28686,
198,
418,
13,
268,
2268,
14692,
43633,
5631,
62,... | 2.355831 | 2,341 |
import PhysicsNum as pn
import numpy as np
import os, sys
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
import math
try:
PATH1 = os.path.join("/Users/andreasevensen/Desktop/XrayDiffraction", "AG.xyd")
PATH2 = os.path.join("/Users/andreasevensen/Desktop/XrayDiffraction", "Al2O3.xyd")
P... | [
11748,
23123,
33111,
355,
279,
77,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
11,
25064,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
629,
541,
88,
13,
40085,
1096,
1330,
12133,
62,
11147,
198,
... | 2.300072 | 1,383 |
from pathlib import Path
from typing import List, Optional
from pipx import constants
from pipx.commands.common import package_name_from_spec, run_post_install_actions
from pipx.constants import EXIT_CODE_INSTALL_VENV_EXISTS, EXIT_CODE_OK, ExitCode
from pipx.util import pipx_wrap
from pipx.venv import Venv, VenvContai... | [
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
7343,
11,
32233,
198,
198,
6738,
7347,
87,
1330,
38491,
198,
6738,
7347,
87,
13,
9503,
1746,
13,
11321,
1330,
5301,
62,
3672,
62,
6738,
62,
16684,
11,
1057,
62,
7353,
62,
17350,
... | 2.080365 | 1,207 |
#!/usr/bin/env python
#-------------------------------------------------------------------------------
import weakref
from xml.etree.ElementTree import TreeBuilder, tostring, fromstring
#-------------------------------------------------------------------------------
__all__ = ["XMLBuilder"]
__doc__ = """
XMLBuilder is... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
10097,
24305,
198,
11748,
4939,
5420,
198,
6738,
35555,
13,
316,
631,
13,
20180,
27660,
1330,
12200,
32875,
11,
284,
8841,
11,
422,
8841,
198,
2,
10097,
24305,
198,
834,
439,
834,
... | 2.673056 | 939 |
from math import ceil, sqrt
from projectq.ops import Swap
from src.topology.general.circuit import Circuit, LongDistanceAlgorithm, Statistics, Restrictions, Node
from src.topology.general.qubit import QubitHandler, QubitType
| [
6738,
10688,
1330,
2906,
346,
11,
19862,
17034,
201,
198,
201,
198,
6738,
1628,
80,
13,
2840,
1330,
48408,
201,
198,
201,
198,
6738,
12351,
13,
4852,
1435,
13,
24622,
13,
21170,
5013,
1330,
13588,
11,
5882,
45767,
2348,
42289,
11,
143... | 3.16 | 75 |
# Napoleon-Christos Oikonomou, AEM: 16
# Maria Kouvela, AEM: 9
# Script that iterates through tweets, creates a list of all tokens that appeared (a. in all tweets and b. in tweets with
# a specific emotion) and then uses the wordcloud library to create a word-cloud of the 200 most common phrases (words and bigrams)
im... | [
2,
28283,
12,
10684,
418,
440,
1134,
6326,
280,
11,
317,
3620,
25,
1467,
198,
2,
14200,
30559,
626,
64,
11,
317,
3620,
25,
860,
198,
2,
12327,
326,
11629,
689,
832,
12665,
11,
8075,
257,
1351,
286,
477,
16326,
326,
4120,
357,
64,
... | 3.122378 | 572 |
import csv
import itertools
import os
from demands import HTTPServiceError
from django.core.management import BaseCommand, CommandError
from django.core.validators import URLValidator
from requests import exceptions
from seed_services_client import HubApiClient, IdentityStoreApiClient
from structlog import get_logger
... | [
11748,
269,
21370,
198,
11748,
340,
861,
10141,
198,
11748,
28686,
198,
198,
6738,
8665,
1330,
38288,
712,
501,
12331,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
1330,
7308,
21575,
11,
9455,
12331,
198,
6738,
42625,
14208,
13,
7295,
... | 3.975309 | 81 |
import json
import copy
import numpy
from numpy import ndarray
from netCDF4 import num2date
import regionmask
from siphon.catalog import TDSCatalog
from siphon.http_util import session_manager
from datetime import datetime, timedelta
from EDR.provider.metadata import MetadataProvider
from EDR.provider.base import BaseP... | [
11748,
33918,
198,
11748,
4866,
198,
11748,
299,
32152,
198,
6738,
299,
32152,
1330,
299,
67,
18747,
198,
6738,
2010,
34,
8068,
19,
1330,
997,
17,
4475,
198,
11748,
3814,
27932,
198,
6738,
44105,
261,
13,
9246,
11794,
1330,
309,
5258,
... | 3.733333 | 135 |
"""
Python compatibility functions.
"""
import sys
import os
import warnings
from typing import Any, Callable
# ------------------------------------------------------------------------------
# Python 2/3 compatibility
fs_encoding = sys.getfilesystemencoding() or sys.getdefaultencoding()
def relpath(path: str, start:... | [
37811,
198,
37906,
17764,
5499,
13,
198,
37811,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
14601,
198,
6738,
19720,
1330,
4377,
11,
4889,
540,
198,
198,
2,
16529,
26171,
198,
2,
11361,
362,
14,
18,
17764,
198,
9501,
62,
12685,
... | 3.450617 | 162 |
"""
Created on Thu Sep 13 00:32:57 2018
@author: pablosanchez
"""
import tensorflow as tf
from networks.dense_net import DenseNet
# filetrs == num_channels
# padding == 'SAME' 'VALID'
| [
201,
198,
37811,
201,
198,
41972,
319,
26223,
8621,
1511,
3571,
25,
2624,
25,
3553,
2864,
201,
198,
201,
198,
31,
9800,
25,
279,
23117,
418,
20364,
201,
198,
37811,
201,
198,
11748,
11192,
273,
11125,
355,
48700,
201,
198,
6738,
7686,... | 2.141509 | 106 |
from django.shortcuts import get_object_or_404
from rest_framework import viewsets
from rest_framework.response import Response
from ..models.sponsorship import Sponsorship, SponsorshipSerializer
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
651,
62,
15252,
62,
273,
62,
26429,
198,
6738,
1334,
62,
30604,
1330,
5009,
1039,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
198,
198,
6738,
11485,
27530,
13,
20587,
11094,
1330,
1897... | 4.125 | 48 |
import matplotlib.pyplot as plt
import networkx as nx
parseOutput = [
('172.16.254.128', '216.58.208.206'),
('216.58.208.206', '172.16.254.128'),
('172.16.254.128', '216.58.208.226'),
('216.58.208.226', '172.16.254.128'),
('172.16.254.128', '8.8.8.8'),
('8.8.8.8', '172.16.254.128'),
('172.16.254.128', '216.58.208.227'... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
3127,
87,
355,
299,
87,
198,
198,
29572,
26410,
796,
685,
198,
10786,
23628,
13,
1433,
13,
24970,
13,
12762,
3256,
705,
20666,
13,
3365,
13,
21315,
13,
22136,
33809,... | 2.084691 | 307 |
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# 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 Licen... | [
2,
19604,
1565,
4825,
1340,
48842,
13,
9858,
532,
9755,
2890,
15007,
11,
2295,
6477,
278,
34884,
13,
198,
2,
45661,
978,
7727,
9383,
25469,
7117,
410,
17,
13,
15,
13,
15069,
1946,
16972,
13313,
10501,
13,
198,
2,
198,
2,
49962,
739,... | 3.979933 | 299 |
# (C) Copyright 2021 Hewlett Packard Enterprise Development LP.
# Generic Device Images classes
import classes.classes
import requests
import os
from jinja2 import Template, Environment
sessionid = requests.Session()
import urllib3
import json
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
| [
2,
357,
34,
8,
15069,
33448,
30446,
15503,
6400,
446,
14973,
7712,
18470,
13,
198,
2,
42044,
16232,
5382,
6097,
198,
198,
11748,
6097,
13,
37724,
198,
11748,
7007,
198,
11748,
28686,
198,
6738,
474,
259,
6592,
17,
1330,
37350,
11,
934... | 3.694118 | 85 |
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 17 14:49:50 2017
@author: wired_000
"""
import pydotplus
from sklearn.datasets import load_iris
from sklearn import tree
iris = load_iris()
clf = tree.DecisionTreeClassifier()
clf.min_samples_leaf = 5
clf.fit(iris.data, iris.target)
print (clf.predict([[5.1, 3.5, 1.4, 0... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
2892,
5979,
1596,
1478,
25,
2920,
25,
1120,
2177,
198,
198,
31,
9800,
25,
28217,
62,
830,
198,
37811,
198,
198,
11748,
279,
5173,
313,
9541,
19... | 2.271111 | 225 |
# encoding: utf-8
import os
import sys
import platform
import logging_helper
from future.builtins import str
from uiutil.tk_names import NSEW, FALSE
from ..mixin.var import VarMixIn
from ..mixin.frames import FramesMixIn
from ..frame.frame import BaseFrame
from ..mixin.layout import LayoutMixIn
logging = logging_help... | [
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
3859,
198,
11748,
18931,
62,
2978,
525,
198,
6738,
2003,
13,
18780,
1040,
1330,
965,
198,
6738,
334,
72,
22602,
13,
30488,
62,
14933,
1330,
399,
... | 3.247619 | 105 |
# -*- coding: utf8 -*-
"""
List of audio file extensions.
Author: Eduardo Ferreira
License: MIT (see LICENSE for details)
"""
from enum import Enum
class AudioFile(Enum):
"""
Audio file types.
"""
FLAC = '.flac'
MP3 = '.mp3'
WAV = '.wav'
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
23,
532,
9,
12,
201,
198,
201,
198,
37811,
201,
198,
8053,
286,
6597,
2393,
18366,
13,
201,
198,
201,
198,
13838,
25,
40766,
13109,
12880,
260,
8704,
201,
198,
34156,
25,
17168,
357,
3826,
38559... | 2.20155 | 129 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os
import time
import pandas as pd
from pandas import DataFrame
from base import BaseObject
class InvertCollectionVectorSpace(BaseObject):
"""
Purpose:
Invert the Vector Space by Term
Implementation:
- The output is keyed by Term
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
628,
198,
11748,
28686,
198,
11748,
640,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
19798,
292,
1330,
6060,
19778,
1... | 1.931897 | 1,439 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Project1.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
5178,
7822,
7560,
422,
3555,
334,
72,
2393,
705,
16775,
16,
13,
9019,
6,
198,
2,
198,
2,
15622,
416,
25,
9485,
48,
83,
20,
12454,
2438,
17301,
642,
13,
24,... | 2.823529 | 85 |
import unittest
import gfapy
| [
11748,
555,
715,
395,
198,
11748,
308,
69,
12826,
198
] | 2.9 | 10 |
import os
import requests
import json
from pprint import pprint
from get_api import *
# output = str(os.system('cleos -u https://api.eossweden.org system listproducers -l 100 > bp_list.txt'))
with open('bp_list.txt','r') as f:
data = f.readlines()
# create a row entry for each BP
bps = [ row.strip().split() for ro... | [
11748,
28686,
198,
11748,
7007,
198,
11748,
33918,
198,
6738,
279,
4798,
1330,
279,
4798,
198,
198,
6738,
651,
62,
15042,
1330,
1635,
198,
198,
2,
5072,
796,
965,
7,
418,
13,
10057,
10786,
2375,
418,
532,
84,
3740,
1378,
15042,
13,
... | 2.319196 | 448 |
from lavendeux import Types, Errors
import re
| [
6738,
21606,
38396,
2821,
1330,
24897,
11,
44225,
201,
198,
11748,
302,
201
] | 3.615385 | 13 |
#!/usr/bin/env python3
"""
Author : Ken Youens-Clark <kyclark@gmail.com>
Date : 2021-09-08
Purpose: Load concepts into SQLite
"""
import argparse
import csv
import os
from typing import NamedTuple, TextIO
from pprint import pprint
from concepts import SnomedConcept
class Args(NamedTuple):
""" Command-line argu... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
13838,
1058,
7148,
921,
641,
12,
43250,
1279,
2584,
565,
668,
31,
14816,
13,
785,
29,
198,
10430,
220,
220,
1058,
33448,
12,
2931,
12,
2919,
198,
30026,
3455,
25,
877... | 2.376642 | 685 |
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
labels = ['Odometry Multiplier', 'Correction', 'Path Error', 'Image Error']
data1 = [
[1.0, True, 70, 0],
[1.0, True, 65, 0],
[1.0, True, 50, 0],
[1.0, False, 140, 0],
[1.25, True, 100, 0],
[1.25, True, 180,... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2603,
29487,
8019,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
23912,
1424,
796,
37250,
46,
67,
15748,
15237,
489,
959,
3256,
... | 2.01281 | 1,171 |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="devolearn",
version="0.2.0",
author="Mayukh Deb, Ujjwal Singh, Bradly Alicea",
author_email="mayukhmainak2000@gmail.com, ujjwal18113@iiitd.ac.in, balicea@openworm.org", #Subject to c... | [
11748,
900,
37623,
10141,
201,
198,
201,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
1600,
366,
81,
4943,
355,
277,
71,
25,
201,
198,
220,
220,
220,
890,
62,
11213,
796,
277,
71,
13,
961,
3419,
201,
198,
201,
198,
2617,
37623,
... | 2.003876 | 774 |
"""Factories to create instances for the SQLAlchemy models."""
import datetime as dt
import random
import string
import factory
import faker
from factory import alchemy
from geopy import distance
from tests import config as test_config
from urban_meal_delivery import db
def _random_timespan( # noqa:WPS211
*,
... | [
37811,
29054,
1749,
284,
2251,
10245,
329,
262,
16363,
2348,
26599,
4981,
526,
15931,
198,
198,
11748,
4818,
8079,
355,
288,
83,
198,
11748,
4738,
198,
11748,
4731,
198,
198,
11748,
8860,
198,
11748,
277,
3110,
198,
6738,
8860,
1330,
43... | 2.372634 | 5,759 |
"""
find known MAC-Adresses Filter for ansible
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any... | [
37811,
198,
19796,
1900,
20582,
12,
2782,
16746,
25853,
329,
9093,
856,
198,
198,
1212,
318,
1479,
290,
555,
12685,
26584,
3788,
2716,
656,
262,
1171,
7386,
13,
198,
198,
21129,
318,
1479,
284,
4866,
11,
13096,
11,
7715,
11,
779,
11,
... | 3.253813 | 918 |
#!/usr/bin/env python
"""
Apply a low pass filter to a pulsar profile
"""
#broaden filter
import pyfits as pf
import numpy as n
import pylab as p
import os
import sys
import shutil
import time
from scipy import signal
def smooth(x,window_len=11,window='hanning'):
"""smooth the data using a window with requested ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
44836,
257,
1877,
1208,
8106,
284,
257,
22271,
283,
7034,
198,
37811,
198,
198,
2,
36654,
268,
8106,
198,
198,
11748,
12972,
21013,
355,
279,
69,
198,
11748,
299,
32152,
35... | 2.156458 | 2,710 |
import numpy as np
import csv
def iq_data(filename,csvname):
"""
Reads in a binary file and data from range bins is taken and complex iq data is stored in a csv file specified by csvname.
Parameter:
filename: str
The .dat binary file name.
csvname: str
User define... | [
11748,
299,
32152,
355,
45941,
198,
11748,
269,
21370,
628,
198,
4299,
1312,
80,
62,
7890,
7,
34345,
11,
40664,
3672,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
4149,
82,
287,
257,
13934,
2393,
290,
1366,
422,
2837,
41701,
... | 2.143763 | 946 |
# %%
# PLOTS
# Cifuentes et al. (2021)
# ∆PA vs. mu ratio
# d2 vs. d1
# MG vs. G-J
# Ug vs. Mtotal
# First: this cell loads the data and the common params.
# Then: each cell must be run separately
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import rc
import pandas as pd
impo... | [
2,
43313,
198,
198,
2,
9297,
33472,
198,
2,
327,
361,
84,
298,
274,
2123,
435,
13,
357,
1238,
2481,
8,
198,
198,
2,
18872,
228,
4537,
3691,
13,
38779,
8064,
198,
2,
288,
17,
3691,
13,
288,
16,
198,
2,
34809,
3691,
13,
402,
12,... | 2.204957 | 4,035 |
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in
import numpy as np # linear algebra
i... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
554,
58,
2361,
25,
628,
198,
2,
770,
11361,
513,
2858,
2058,
351,
867,
7613,
23696,
12782,
6589,
198,
2,
632,
318,
5447,
416,
262,
47... | 2.820824 | 15,175 |
import jaydebeapi
import shutil
from properties import *
def tier_down():
"""This function takes care about tier downing main changes did to the system i.e.database remove[mysql],remove APIM instances"""
if DB_TYPE == 'mysql':
conn = jaydebeapi.connect("com.mysql.cj.jdbc.Driver",
... | [
11748,
474,
323,
2934,
1350,
15042,
198,
11748,
4423,
346,
198,
6738,
6608,
1330,
1635,
628,
198,
4299,
14249,
62,
2902,
33529,
198,
220,
220,
220,
37227,
1212,
2163,
2753,
1337,
546,
14249,
866,
278,
1388,
2458,
750,
284,
262,
1080,
... | 2.193878 | 588 |
"""Tests dict input objects for `tackle.providers.system.hooks.envs` module."""
import os
from tackle.main import tackle
from tackle.exceptions import HookCallException
import pytest
import platform
@pytest.fixture()
def tmp_env_var():
"""Set env var temporarily."""
os.environ['TMP_VAR_THING'] = 'stuff'
y... | [
37811,
51,
3558,
8633,
5128,
5563,
329,
4600,
36346,
13,
15234,
4157,
13,
10057,
13,
25480,
82,
13,
268,
14259,
63,
8265,
526,
15931,
198,
11748,
28686,
198,
6738,
9761,
13,
12417,
1330,
9761,
198,
6738,
9761,
13,
1069,
11755,
1330,
1... | 2.522472 | 178 |
import pyopencl as cl
import numpy as np
import math
from skimage import img_as_ubyte
class CL_hist_1D:
"""
Just a wrapper around all the opencl boilerplate code
"""
| [
11748,
12972,
9654,
565,
355,
537,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
6738,
1341,
9060,
1330,
33705,
62,
292,
62,
549,
88,
660,
628,
198,
4871,
7852,
62,
10034,
62,
16,
35,
25,
198,
220,
220,
220,
37227,
198... | 2.830769 | 65 |
# This code can be used for ploting shape functions of linear element in 1D.
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 10, 11)
for i in range(len(x)):
plt.plot(x,basisf(x,i))
plt.xlabel('x')
plt.ylabel('$\phi_i (x)$')
plt.title('Linear shape functions in 1D')
plt.grid()
plt.show()
| [
2,
770,
2438,
460,
307,
973,
329,
7110,
278,
5485,
5499,
286,
14174,
5002,
287,
352,
35,
13,
220,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
87,
796,
45941,
13,
... | 2.352941 | 136 |
# -*- coding: utf-8 -*-
# ==============================================================================
import os
import re
from datetime import date, timedelta
from scrapy.spiders import CrawlSpider, Rule
from scrapy.linkextractors.lxmlhtml import LxmlLinkExtractor
from scrapy.http import FormRequest, Request
from w... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
38093,
25609,
28,
198,
198,
11748,
28686,
198,
11748,
302,
198,
6738,
4818,
8079,
1330,
3128,
11,
28805,
12514,
198,
6738,
15881,
88,
13,
2777,
4157,
1330,
327,
13132... | 2.289206 | 491 |
import os
import sys
import time
import logging
import argparse
logger = logging.getLogger()
# ---------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------
# ---------------------... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
18931,
198,
11748,
1822,
29572,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
3419,
198,
198,
2,
16529,
1783,
32501,
198,
2,
16529,
1783,
32501,
198,
220,
220,
220... | 8.561404 | 57 |
from .urlfetch import UrlFetch
| [
6738,
764,
333,
1652,
7569,
1330,
8799,
75,
37,
7569,
628
] | 2.909091 | 11 |
import numpy as np
#arange
#sqrt
#random
#exp
#add
#max
a=np.arange(5,55,5)
a1=[1,2,3,4,5]
print(a)
i=0
n=5
for i in range(11):
print(n*i)
b=np.sqrt(a)
print(b)
#b1=np.sqrt(25)
#print(b1)
c=np.exp(a) #eulers number raised to array
print(c)
d=np.add(a1,a1)
print(d)
#e=np.max(a,b)
#pri... | [
11748,
299,
32152,
355,
45941,
201,
198,
2,
283,
858,
201,
198,
2,
31166,
17034,
201,
198,
2,
25120,
201,
198,
2,
11201,
201,
198,
2,
2860,
201,
198,
2,
9806,
201,
198,
64,
28,
37659,
13,
283,
858,
7,
20,
11,
2816,
11,
20,
8,
... | 1.551887 | 212 |
import cv2
img = cv2.imread('shapes.png', 1) # Reading the image
greyImg = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # Converting into Grey scale image, so as to make the work pretty easier
# Finding the threshold image
_, threshImg = cv2.threshold(greyImg, 240, 255, cv2.THRESH_BINARY)
# Finding the contours of the im... | [
11748,
269,
85,
17,
198,
198,
9600,
796,
269,
85,
17,
13,
320,
961,
10786,
1477,
7916,
13,
11134,
3256,
352,
8,
220,
1303,
11725,
262,
2939,
198,
49502,
3546,
70,
796,
269,
85,
17,
13,
33967,
83,
10258,
7,
9600,
11,
269,
85,
17,... | 2.575604 | 1,574 |
# Copyright 2020 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | [
2,
15069,
12131,
26778,
9564,
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,
733... | 2.932897 | 1,222 |
from concurrent.futures import ThreadPoolExecutor, as_completed
from copy import deepcopy, copy
from operator import itemgetter
from typing import TypeVar, Optional, Union, Type, List, Dict, Iterable, Callable
from google.cloud.firestore import Client, CollectionReference, Query, DocumentSnapshot
# Need environment v... | [
6738,
24580,
13,
69,
315,
942,
1330,
14122,
27201,
23002,
38409,
11,
355,
62,
785,
16838,
198,
6738,
4866,
1330,
2769,
30073,
11,
4866,
198,
6738,
10088,
1330,
2378,
1136,
353,
198,
6738,
19720,
1330,
5994,
19852,
11,
32233,
11,
4479,
... | 3.684492 | 187 |
#!/bin/python2
# -*- coding: utf-8 -*-
import json
import pickle
import sys
import operator
import nltk
from nltk.tokenize import TweetTokenizer
from nltk.probability import ConditionalFreqDist
from nltk.util import ngrams
argv = sys.argv[1:]
try:
if len(argv) != 1:
raise ValueError()
corpus = argv[0... | [
2,
48443,
8800,
14,
29412,
17,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
33918,
198,
11748,
2298,
293,
198,
11748,
25064,
198,
11748,
10088,
198,
198,
11748,
299,
2528,
74,
198,
6738,
299,
2528,
74,
... | 2.093204 | 515 |
from PyQt5.QtCore import QObject
import datetime
import numpy as np
from queue import Empty
import pandas as pd
import json
class Accumulator:
"""Abstract class for accumulating streams of data.
It is use to save or plot in real time data from stimulus logs or
behaviour tracking. Data is stored in a list... | [
6738,
9485,
48,
83,
20,
13,
48,
83,
14055,
1330,
1195,
10267,
198,
11748,
4818,
8079,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
16834,
1330,
33523,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
33918,
628,
198,
4871,
6366,
38... | 2.265312 | 3,690 |