content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
import glob
import os
import pandas as pd
import json
import ast
from tqdm import tqdm
import click
import pickle
from multiprocessing import Pool, cpu_count, Queue
from functools import partial
import itertools
import sys
sys.setrecursionlimit(15000)
import logging
logpath = "./tree_matches.log"
logger = loggin... | [
11748,
15095,
198,
11748,
28686,
220,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
33918,
198,
11748,
6468,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
3904,
198,
11748,
2298,
293,
198,
6738,
18540,
305,
919,
278,
... | 2.021005 | 1,333 |
# =================================================================
#
# Authors: Stephen Lloyd
# Ian Edwards
#
# Copyright (c) 2020, OpenCDMS Project
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to dea... | [
2,
38093,
198,
2,
198,
2,
46665,
25,
7970,
22361,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12930,
17381,
198,
2,
198,
2,
15069,
357,
66,
8,
12131,
11,
4946,
8610,
5653,
4935,
198,
2,
198,
2,
2448,
3411,
318,
29376,
... | 2.919715 | 1,121 |
import os
from selenium import webdriver
from sa11y.analyze import Analyze
import urllib3
urllib3.disable_warnings()
| [
11748,
28686,
198,
198,
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
473,
1157,
88,
13,
38200,
2736,
1330,
16213,
2736,
198,
198,
11748,
2956,
297,
571,
18,
198,
198,
333,
297,
571,
18,
13,
40223,
62,
40539,
654,
3419,
628
] | 2.880952 | 42 |
# 275. H-Index II
# Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optimize your algorithm?
| [
2,
25829,
13,
367,
12,
15732,
2873,
198,
2,
7281,
510,
329,
367,
12,
15732,
25,
1867,
611,
262,
33499,
7177,
318,
23243,
287,
41988,
1502,
30,
10347,
345,
27183,
534,
11862,
30,
198
] | 4 | 34 |
from django.conf import settings
from django import template
from news.models import NewsItem, NewsAuthor, NewsCategory
register = template.Library()
def parse_token(token):
"""
Parses a token into 'slug', 'limit', and 'varname' values.
Token must follow format {% tag_name <slug> [<limit>] as <varname> %}
"""
... | [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
1330,
11055,
198,
6738,
1705,
13,
27530,
1330,
3000,
7449,
11,
3000,
13838,
11,
3000,
27313,
198,
198,
30238,
796,
11055,
13,
23377,
3419,
628,
628,
198,
4299,
21136,
6... | 2.740413 | 339 |
import math
import falcon
import jsonschema
| [
11748,
10688,
198,
11748,
24215,
1102,
198,
11748,
44804,
684,
2395,
2611,
628,
628,
628,
628,
628,
628,
198,
220,
220,
220,
220,
220,
220,
220,
220,
628,
628,
628,
628,
628,
628,
198
] | 2.264706 | 34 |
import os
from goldminer import game
if __name__ == "__main__":
print("Initializing")
print("Working directory: " + os.getcwd())
game.start()
| [
11748,
28686,
198,
6738,
3869,
1084,
263,
1330,
983,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
7203,
24243,
2890,
4943,
198,
220,
220,
220,
3601,
7203,
28516,
8619,
25,
366,
1343,
286... | 2.767857 | 56 |
#!/usr/bin/env python
from math import ceil
import os
import sys
import argparse
import multiprocessing
import subprocess as sp
import re
#from pprint import pprint
from array import array
from yaml import load, dump
contexts = ('CG','CHG','CHH')
def ParseFai(inFile):
'''
Parses a fa.fai into a python dictionary
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
10688,
1330,
2906,
346,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
1822,
29572,
198,
11748,
18540,
305,
919,
278,
198,
11748,
850,
14681,
355,
599,
198,
11748,
302,
198... | 2.392324 | 469 |
import json
import pytest
from microdata_validator import Metadata, PatchingError
RESOURCE_DIR = 'tests/resources/metadata_model'
with open(f'{RESOURCE_DIR}/KREFTREG_DS_described.json') as f:
TRANSFORMED_METADATA = json.load(f)
with open(f'{RESOURCE_DIR}/KREFTREG_DS_described_update.json') as f:
UPDATED_METAD... | [
11748,
33918,
198,
198,
11748,
12972,
9288,
198,
6738,
4580,
7890,
62,
12102,
1352,
1330,
3395,
14706,
11,
17106,
278,
12331,
198,
198,
19535,
31033,
62,
34720,
796,
705,
41989,
14,
37540,
14,
38993,
62,
19849,
6,
198,
4480,
1280,
7,
... | 2.473997 | 673 |
# metrics/__init__.py
# author: Playinf
# email: playinf@stu.xmu.edu.cn
from .metrics import create_tagger_evaluation_metrics
| [
2,
20731,
14,
834,
15003,
834,
13,
9078,
198,
2,
1772,
25,
3811,
10745,
198,
2,
3053,
25,
711,
10745,
31,
301,
84,
13,
87,
30300,
13,
15532,
13,
31522,
198,
198,
6738,
764,
4164,
10466,
1330,
2251,
62,
83,
7928,
62,
18206,
2288,
... | 2.645833 | 48 |
import sys
import pytest
from briefcase.platforms.macOS.dmg import macOSDmgCreateCommand
if sys.platform != 'darwin':
pytest.skip("requires macOS", allow_module_level=True)
| [
11748,
25064,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
4506,
7442,
13,
24254,
82,
13,
20285,
2640,
13,
67,
11296,
1330,
40017,
35,
11296,
16447,
21575,
198,
198,
361,
25064,
13,
24254,
14512,
705,
27455,
5404,
10354,
198,
220,
220,... | 3.033333 | 60 |
from flask import Flask
app = Flask(__name__)
if app.config["ENV"] == "production":
app.config.from_object("config.ProductionConfig")
elif app.config["ENV"] == "testing":
app.config.from_object("config.TestingConfig")
else:
app.config.from_object("config.DevelopmentConfig")
from app import views
from app im... | [
6738,
42903,
1330,
46947,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
628,
198,
361,
598,
13,
11250,
14692,
1677,
53,
8973,
6624,
366,
25493,
1298,
628,
197,
1324,
13,
11250,
13,
6738,
62,
15252,
7203,
11250,
13,
35027,
16934,
... | 3.2 | 105 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Project : MeUtils.
# @File : conf
# @Time : 2021/1/31 10:20
# @Author : yuanjie
# @Email : yuanjie@xiaomi.com
# @Software : PyCharm
# @Description :
from meutils.pipe import *
#
#
#
conf_cli = lambda: fire.Fire(run) #... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
16775,
220,
220,
220,
220,
220,
1058,
2185,
18274,
4487,
13,
198,
2,
2488,
8979,
220,
220,
220,
220,
220,
... | 2.043716 | 183 |
install Request module
pip install requests
import requests
r = requests.get('https://xkcd.com/353/')
print(r)
print(r.text)
#Download image
r = requests.get('https://xkcd.com/comics/python.png')
print(r.content)
with open('comic.png', 'wb') as f:
f.write(r.content)
print(r.status_code)
print(r.ok)... | [
17350,
19390,
8265,
198,
198,
79,
541,
2721,
7007,
198,
198,
11748,
7007,
198,
198,
81,
796,
7007,
13,
1136,
10786,
5450,
1378,
87,
74,
10210,
13,
785,
14,
33319,
14,
11537,
198,
198,
4798,
7,
81,
8,
198,
198,
4798,
7,
81,
13,
5... | 2.501408 | 355 |
from django.conf.urls import url, include
from django.contrib import admin
from rest_framework_jwt.views import obtain_jwt_token
from rest_framework_jwt.views import refresh_jwt_token
from rest_framework_jwt.views import verify_jwt_token
# Configuration API Router
from rest_framework import routers
#router = routers... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
11,
2291,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
1334,
62,
30604,
62,
73,
46569,
13,
33571,
1330,
7330,
62,
73,
46569,
62,
30001,
198,
6738,
1334,... | 2.608051 | 472 |
import numpy as np
from scipy.optimize import curve_fit, minimize_scalar
h_planck = 4.135667662e-3 # eV/ps
h_planck_bar = 6.58211951e-4 # eV/ps
kb_boltzmann = 8.6173324e-5 # eV/K
fitting_functions = {
0: Lorentzian,
1: Lorentzian_asymmetric,
2: Damped_harmonic,
}
# Test for automatic detection ... | [
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
40085,
1096,
1330,
12133,
62,
11147,
11,
17775,
62,
1416,
282,
283,
198,
198,
71,
62,
11578,
694,
796,
604,
13,
17059,
28933,
39380,
68,
12,
18,
220,
1303,
304,
53,
14,
8... | 2.394619 | 223 |
from __init__ import print_msg_box
#creating object
#list = singleLinkedList()
#list.insertLast(50, 60,70)
#list.display()
'''
It shows the entered things at last
output:
=======
50
60
70
50...
'''
#list.insertFirst(10,20,30)
#list.display()
'''
It shows the entered things at first then remaining
output:
=====... | [
6738,
11593,
15003,
834,
1330,
3601,
62,
19662,
62,
3524,
198,
2,
20123,
278,
2134,
220,
198,
2,
4868,
796,
2060,
11280,
276,
8053,
3419,
198,
198,
2,
4868,
13,
28463,
5956,
7,
1120,
11,
3126,
11,
2154,
8,
198,
2,
4868,
13,
13812,... | 2.466165 | 266 |
# Generated by Django 2.2.14 on 2020-08-23 10:13
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
1415,
319,
12131,
12,
2919,
12,
1954,
838,
25,
1485,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.875 | 32 |
"""Decorators for auth module."""
from functools import wraps
from src.protocol import make_response
from src.database import session_scope
from .models import Session
def login_required(func):
"""Check that user is logged in based on the valid token exists in request."""
return wrapper
| [
37811,
10707,
273,
2024,
329,
6284,
8265,
526,
15931,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
198,
6738,
12351,
13,
11235,
4668,
1330,
787,
62,
26209,
198,
198,
6738,
12351,
13,
48806,
1330,
6246,
62,
29982,
198,
6738,
764,
27530... | 3.75 | 80 |
# Name:
# Date:
# proj05: functions and lists
# Part I
def divisors(num):
"""
Takes a number and returns all divisors of the number, ordered least to greatest
:param num: int
:return: list (int)
"""
# Fill in the function and change the return statment.
numlist = []
check = 1
whil... | [
2,
6530,
25,
198,
2,
7536,
25,
198,
198,
2,
386,
73,
2713,
25,
5499,
290,
8341,
198,
198,
2,
2142,
314,
198,
198,
4299,
2659,
271,
669,
7,
22510,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
33687,
257,
1271,
290,
5860,
... | 2.671848 | 1,158 |
# Copyright 2015 Bloomberg Finance L.P.
#
# 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 i... | [
2,
15069,
1853,
15689,
15007,
406,
13,
47,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,... | 2.893314 | 703 |
'''
Une case est definie par sa couleur,
ses coordonnees et un acces a la grille
pour recuperer ses voisins
'''
| [
7061,
6,
201,
198,
220,
220,
220,
471,
710,
1339,
1556,
2730,
494,
1582,
473,
2284,
293,
333,
11,
201,
198,
220,
220,
220,
264,
274,
6349,
47476,
274,
2123,
555,
697,
274,
257,
8591,
1036,
8270,
201,
198,
220,
220,
220,
12797,
664... | 2.285714 | 56 |
#import Libraries
import cv2
import sys
import numpy as np
from matplotlib import pyplot as plt
import matplotlib.image as mpimg
##################################################
'''
This example illustrates how to extract interesting key points
as features from an image
Usage:
keypointsSIFTDescriptor.py [<image... | [
2,
11748,
46267,
198,
11748,
269,
85,
17,
198,
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
11748,
2603,
29487,
8019,
13,
9060,
355,
29034,
9600,
198,
29113,
1446... | 3.054893 | 419 |
import xml.etree.ElementTree as ET
from .baseVmWareXmlResponse import BaseVmWareXmlResponse
| [
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
198,
6738,
764,
8692,
53,
76,
38824,
55,
4029,
31077,
1330,
7308,
53,
76,
38824,
55,
4029,
31077,
628
] | 3.206897 | 29 |
import sys
import logging
if sys.version_info[:2] <= (2, 6):
logging.Logger.getChild = lambda self, suffix:\
self.manager.getLogger('.'.join((self.name, suffix)) if self.root is not self else suffix)
import pytest
from chatexchange.markdown_detector import markdown
logger = logging.getLogger(__name__)
| [
11748,
25064,
198,
11748,
18931,
198,
361,
25064,
13,
9641,
62,
10951,
58,
25,
17,
60,
19841,
357,
17,
11,
718,
2599,
198,
220,
220,
220,
18931,
13,
11187,
1362,
13,
1136,
16424,
796,
37456,
2116,
11,
35488,
7479,
198,
220,
220,
220... | 2.857143 | 112 |
x_indexes = [i for i, j in enumerate(xaddr)] if j == myxaddr]
y_indexes = [i for i, j in enumerate(yaddr)] if j == myyaddr]
print('x_indexes: ' + str(x_indexes))
print('y_indexes:' +str(y_indexes))
# keep common indexes
common = [i for i, j in zip(x_indexes, y_indexes) if i == j]
print('common: ' + str(common))
| [
87,
62,
9630,
274,
796,
685,
72,
329,
1312,
11,
474,
287,
27056,
378,
7,
87,
29851,
15437,
611,
474,
6624,
616,
87,
29851,
60,
198,
88,
62,
9630,
274,
796,
685,
72,
329,
1312,
11,
474,
287,
27056,
378,
7,
88,
29851,
15437,
611,
... | 2.445313 | 128 |
import os
from typing import Optional, List
from fastapi import APIRouter, Request, Response, status, Depends
from pyefriend_api.models.setting import Setting as SettingModel
from pyefriend_api.app.auth import login_required
from .schema import SettingOrm, SettingUpdate
r = APIRouter(prefix='/setting',
... | [
11748,
28686,
198,
6738,
19720,
1330,
32233,
11,
7343,
198,
6738,
3049,
15042,
1330,
3486,
4663,
39605,
11,
19390,
11,
18261,
11,
3722,
11,
2129,
2412,
198,
198,
6738,
12972,
891,
1289,
62,
15042,
13,
27530,
13,
33990,
1330,
25700,
355,... | 3.226415 | 106 |
"""Unit tests for util/multi_analysis.py"""
import os
import unittest
from dsi.multi_analysis import MultiEvergreenAnalysis, main
from test_lib.fixture_files import FixtureFiles
from test_lib.test_requests_parent import TestRequestsParent
FIXTURE_FILES = FixtureFiles()
if __name__ == "__main__":
unittest.mai... | [
37811,
26453,
5254,
329,
7736,
14,
41684,
62,
20930,
13,
9078,
37811,
628,
198,
11748,
28686,
198,
11748,
555,
715,
395,
198,
198,
6738,
288,
13396,
13,
41684,
62,
20930,
1330,
15237,
23921,
14809,
32750,
11,
1388,
198,
6738,
1332,
62,
... | 3.085714 | 105 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-08 03:42
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
24,
13,
21,
319,
1584,
12,
2713,
12,
2919,
7643,
25,
3682,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
1... | 2.794872 | 78 |
from typing import Any, List, Dict
RAW_INFO: Dict[str, List[Dict[str, Any]]] = {
"streams": [
{
"index": 0,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "High",
"codec_type": "video",
... | [
6738,
19720,
1330,
4377,
11,
7343,
11,
360,
713,
198,
198,
20530,
62,
10778,
25,
360,
713,
58,
2536,
11,
7343,
58,
35,
713,
58,
2536,
11,
4377,
11907,
60,
796,
1391,
198,
220,
220,
220,
366,
5532,
82,
1298,
685,
198,
220,
220,
2... | 1.737931 | 4,205 |
from simulator import PolychromaticField, cf, mm
F = PolychromaticField(
spectrum=1.5 * cf.illuminant_d65,
extent_x=12.0 * mm,
extent_y=12.0 * mm,
Nx=1200,
Ny=1200,
)
F.add_aperture_from_image(
"./apertures/circular_rings.jpg", pad=(9 * mm, 9 * mm), Nx=1500, Ny=1500
)
rgb = F.compute_colors_at... | [
6738,
35375,
1330,
12280,
28663,
1512,
15878,
11,
30218,
11,
8085,
198,
198,
37,
796,
12280,
28663,
1512,
15878,
7,
198,
220,
220,
220,
10958,
28,
16,
13,
20,
1635,
30218,
13,
359,
7230,
415,
62,
67,
2996,
11,
198,
220,
220,
220,
... | 2.021978 | 182 |
from items import vehicles, _xml
from gui.Scaleform.daapi.view.lobby.trainings.training_room import TrainingRoom;
from helpers.statistics import StatisticsCollector;
from game import init
import ScoreViewTools
old_noteHangarLoadingState = StatisticsCollector.noteHangarLoadingState
StatisticsCollector.noteHangarLoadin... | [
6738,
3709,
1330,
5672,
11,
4808,
19875,
198,
6738,
11774,
13,
29990,
687,
13,
6814,
15042,
13,
1177,
13,
75,
11369,
13,
27432,
654,
13,
34409,
62,
3823,
1330,
13614,
41178,
26,
198,
6738,
49385,
13,
14269,
3969,
1330,
14370,
31337,
2... | 3.66171 | 269 |
import random
numbers = []
for i in range(0, 100):
numbers.append(random.randint(1, 100))
numbers = mergeSort(numbers)
print(numbers)
| [
11748,
4738,
198,
198,
77,
17024,
796,
17635,
198,
1640,
1312,
287,
2837,
7,
15,
11,
1802,
2599,
198,
220,
220,
220,
3146,
13,
33295,
7,
25120,
13,
25192,
600,
7,
16,
11,
1802,
4008,
198,
198,
77,
17024,
796,
20121,
42758,
7,
77,
... | 2.641509 | 53 |
from utilsw2 import *
from Reader import *
from Adapted_voc_evaluation import *
import glob
path_to_video = 'datasets/AICity_data/train/S03/c010/vdo.avi'
path_to_frames = 'datasets/frames/'
results_path = 'Results/Task1_1'
if __name__ == '__main__':
colors = [cv2.COLOR_BGR2HSV, cv2.COLOR_BGR2RGB, cv2.COLOR_BGR2YC... | [
6738,
7736,
2032,
17,
1330,
1635,
198,
6738,
25342,
1330,
1635,
198,
6738,
30019,
276,
62,
18893,
62,
18206,
2288,
1330,
1635,
198,
11748,
15095,
198,
6978,
62,
1462,
62,
15588,
796,
705,
19608,
292,
1039,
14,
32,
2149,
414,
62,
7890,... | 2.070093 | 214 |
# Copyright 2021 Sai Sampath Kumar Balivada
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to ... | [
2,
15069,
33448,
25251,
42168,
776,
26105,
8528,
452,
4763,
198,
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.591973 | 299 |
# -*- coding: utf-8 -*-
# Copyright 2019 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 agr... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
13130,
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... | 3.360324 | 247 |
def euclidean_gcd(first, second):
"""
Calculates GCD of two numbers using the division-based Euclidean Algorithm
:param first: First number
:param second: Second number
"""
while(second):
first, second = second, first % second
return first
def euclidean_gcd_recursive(first, seco... | [
4299,
304,
36616,
485,
272,
62,
70,
10210,
7,
11085,
11,
1218,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
27131,
689,
402,
8610,
286,
734,
3146,
1262,
262,
7297,
12,
3106,
48862,
485,
272,
978,
42289,
198,
220,
220,
220,
... | 2.72807 | 228 |
""" Distances metrics based on the covariance matrix (mostly in the context of merging and compress)"""
import torch
import numpy as np
import torch.nn.functional as F
np.random.seed(0)
def cov(m, y=None):
"""computes covariance of m"""
if y is not None:
m = torch.cat((m, y), dim=0)
m_exp = torch.... | [
37811,
4307,
1817,
20731,
1912,
319,
262,
44829,
590,
17593,
357,
29471,
287,
262,
4732,
286,
35981,
290,
27413,
8,
37811,
198,
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
37... | 2.112738 | 683 |
import tensorflow as tf
import tensorflow_hub as hub
import numpy as np
def get_use_embedding(texts):
use_embed = hub.Module("https://tfhub.dev/google/universal-sentence-encoder-large/3")
# Reduce logging output.
# tf.logging.set_verbosity(tf.logging.ERROR)
with tf.Session() as session:
session.run([t... | [
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
11192,
273,
11125,
62,
40140,
355,
12575,
198,
11748,
299,
32152,
355,
45941,
628,
628,
198,
4299,
651,
62,
1904,
62,
20521,
12083,
7,
5239,
82,
2599,
198,
220,
779,
62,
20521,
796,
12... | 2.652291 | 371 |
from __future__ import unicode_literals
from netmiko.endace.endace_ssh import EndaceSSH
__all__ = ['EndaceSSH']
| [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
201,
198,
6738,
2010,
76,
12125,
13,
437,
558,
13,
437,
558,
62,
45824,
1330,
5268,
558,
5432,
39,
201,
198,
201,
198,
834,
439,
834,
796,
37250,
12915,
558,
5432,
39,
2052... | 2.6 | 45 |
# -*- coding: utf-8 -*-
# pylint: disable=wildcard-import,redefined-builtin,unused-wildcard-import
from __future__ import absolute_import, division, print_function
from builtins import *
# pylint: enable=wildcard-import,redefined-builtin,unused-wildcard-import
from genemap.mappers import get_mappers
def main(args):... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
279,
2645,
600,
25,
15560,
28,
21992,
9517,
12,
11748,
11,
445,
18156,
12,
18780,
259,
11,
403,
1484,
12,
21992,
9517,
12,
11748,
198,
6738,
11593,
37443,
834,... | 2.635659 | 387 |
import gzip
import random
import subprocess
import sys
#############
# 42 nt set # 20 nt upstream and downstream of canonical GT|AG
#############
genomes = ('at', 'ce', 'dm')
for gen in genomes:
# observed
eie = f'eie.{gen}.txt.gz'
dons = get_donors(eie)
accs = get_acceptors(eie)
write_fasta(f'splice42/{gen}.... | [
11748,
308,
13344,
198,
11748,
4738,
198,
11748,
850,
14681,
198,
11748,
25064,
628,
198,
198,
7804,
4242,
2,
198,
2,
5433,
299,
83,
900,
1303,
1160,
299,
83,
28717,
290,
33218,
286,
40091,
7963,
91,
4760,
198,
7804,
4242,
2,
198,
1... | 2.287356 | 522 |
from sklearn.cluster import KMeans
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
main()
| [
6738,
1341,
35720,
13,
565,
5819,
1330,
509,
5308,
504,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,... | 2.893617 | 47 |
# Generated by Django 2.1.4 on 2018-12-12 16:51
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
19,
319,
2864,
12,
1065,
12,
1065,
1467,
25,
4349,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import os
import pandas
import time
from datetime import datetime, timedelta
from collections import defaultdict
from copy import deepcopy
from googleapiclient.discovery import build
"""
All functions that are used for querying, processing, and saving
the data are located here.
"""
VALID_PERIOD_LENGTHS = ["day", "w... | [
11748,
28686,
198,
11748,
19798,
292,
198,
11748,
640,
198,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
4866,
1330,
2769,
30073,
198,
198,
6738,
23645,
499,
291,
75,
1153,
1... | 3.574468 | 94 |
import os
from dotenv import load_dotenv
from Cryptodome.Cipher import PKCS1_v1_5 as Cipher_pkcs1_v1_5
from Cryptodome.Signature import PKCS1_v1_5 as Signature_pkcs1_v1_5
from Cryptodome.PublicKey import RSA
load_dotenv()
API_URI = os.environ.get("API_URI", "https://nodes.thetangle.org:443").split(",")
API_OPEN = ... | [
11748,
28686,
198,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
6738,
15126,
375,
462,
13,
34,
10803,
1330,
29673,
7902,
16,
62,
85,
16,
62,
20,
355,
44334,
62,
79,
74,
6359,
16,
62,
85,
16,
62,
20,
198,
6738,
15126... | 2.241497 | 294 |
# Copyright 2015 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,
1853,
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.7 | 270 |
from .global_hac import GlobalHAC
| [
6738,
764,
20541,
62,
71,
330,
1330,
8060,
39,
2246,
198
] | 3.090909 | 11 |
from dataclasses import dataclass
from functools import total_ordering
from collections import Counter
import typing
import textwrap
Poly = typing.Tuple[Point, ...]
def generate(n: int) -> typing.List[Poly]:
if n == 1:
return [(Point(0, 0),)]
prev_results = generate(n - 1)
results = set()
fo... | [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
1257,
310,
10141,
1330,
2472,
62,
34555,
198,
6738,
17268,
1330,
15034,
198,
11748,
19720,
198,
11748,
2420,
37150,
198,
198,
34220,
796,
19720,
13,
51,
29291,
58,
12727,
11,
26... | 2.018104 | 939 |
#!/usr/bin/env python3
# --------------------( LICENSE )--------------------
# Copyright (c) 2014-2021 Beartype authors.
# See "LICENSE" for further details.
'''
**Beartype forward reference data submodule.**
This submodule exercises **forward reference type hints** (i.e., strings whose
valu... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
41436,
7,
38559,
24290,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
19351,
198,
... | 3.584433 | 758 |
# coding: utf-8
StatusContinue = 100
StatusSwitchingProtocols = 101
StatusProcessing = 102
StatusEarlyHints = 103
StatusOK = 200
StatusCreated = 201
StatusAccepted = 202
StatusNonAuthoritativeInfo = 203
StatusNoContent = 204
StatusResetContent = 205
StatusPartialContent = 206
StatusMultiStatus = 207
StatusAlreadyRepor... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
19580,
29453,
796,
1802,
198,
19580,
10462,
19811,
19703,
4668,
82,
796,
8949,
198,
19580,
18709,
278,
796,
15143,
198,
19580,
20457,
39,
29503,
796,
15349,
198,
19580,
11380,
796,
939,
198,
1... | 3.658065 | 465 |
import logging
import oscar
x0a_name="User lookup"
log = logging.getLogger('oscar.snac.x0a')
subcodes = {}
def x0a_x01(o, sock, data):
'''
SNAC (xa, x1): User lookup Family Error
reference: U{http://iserverd.khstu.ru/oscar/snac_0a_01.html}
'''
errcode, errmsg, subcode = oscar.snac.... | [
11748,
18931,
201,
198,
201,
198,
11748,
267,
13034,
201,
198,
201,
198,
87,
15,
64,
62,
3672,
2625,
12982,
35847,
1,
201,
198,
6404,
796,
18931,
13,
1136,
11187,
1362,
10786,
418,
7718,
13,
16184,
330,
13,
87,
15,
64,
11537,
201,
... | 2.018987 | 474 |
#!/usr/bin/env python
"""setup.py
Defines the setup instructions for the punch framework
Copyright (C) 2016 Rodrigo Chacon
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, in... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
40406,
13,
9078,
198,
198,
7469,
1127,
262,
9058,
7729,
329,
262,
10862,
9355,
198,
198,
15269,
357,
34,
8,
1584,
46198,
609,
7807,
198,
198,
5990,
3411,
318,
29376,
7520,
11,
... | 2.795334 | 943 |
'''
Drilling info analysis
This program reads well header data and production logs (e.g. exported from Drilling Info as .csv files) and
walks the user through the genreation of decline curves for each well provided in the input data. Decine curves
are fit with a the hyperbolic curve that is estimated using an iterativ... | [
7061,
6,
198,
6187,
4509,
7508,
3781,
198,
198,
1212,
1430,
9743,
880,
13639,
1366,
290,
3227,
17259,
357,
68,
13,
70,
13,
29050,
422,
1583,
4509,
14151,
355,
764,
40664,
3696,
8,
290,
198,
16783,
591,
262,
2836,
832,
262,
12121,
34... | 3.512605 | 476 |
#!/usr/bin/env python
import os
import re
import unittest
from git import Repo
from semver import match
from click import option, argument, echo, ClickException
from touchresume.cli import cli
from touchresume import __version__
if __name__ == '__main__':
cli()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
555,
715,
395,
198,
198,
6738,
17606,
1330,
1432,
78,
198,
6738,
5026,
332,
1330,
2872,
198,
6738,
3904,
1330,
3038,
11,
4578,
11,
9809,... | 3.174419 | 86 |
from reb.src import pynyt
from reb.conf import APIKEY_NYT_ARTICLE
nyt = pynyt.ArticleSearch(APIKEY_NYT_ARTICLE)
nytArchive = pynyt.ArchiveApi(APIKEY_NYT_ARTICLE)
# # get 1000 news articles from the Foreign newsdesk from 1987
# results_obama = nyt.query(
# q='obama',
# begin_date="20170101",
# end_date="... | [
198,
198,
6738,
3405,
13,
10677,
1330,
279,
2047,
20760,
198,
6738,
3405,
13,
10414,
1330,
7824,
20373,
62,
12805,
51,
62,
7227,
31419,
198,
198,
3281,
83,
796,
279,
2047,
20760,
13,
14906,
18243,
7,
17614,
20373,
62,
12805,
51,
62,
... | 2.298578 | 211 |
"""A file system service for managing CVMFS-based client file systems."""
import os
from cm.services import service_states
import logging
log = logging.getLogger('cloudman')
| [
37811,
32,
2393,
1080,
2139,
329,
11149,
327,
15996,
10652,
12,
3106,
5456,
2393,
3341,
526,
15931,
198,
11748,
28686,
198,
198,
6738,
12067,
13,
30416,
1330,
2139,
62,
27219,
198,
198,
11748,
18931,
198,
6404,
796,
18931,
13,
1136,
111... | 3.765957 | 47 |
# -*- coding: utf-8 -*-
import re, web, datetime, hashlib, struct, yaml, sys, wikipedia
import xml.etree.ElementTree as ET
re_NUMERIC = re.compile("(-?\d+)[ ,]+(-?\d+)")
re_NUMERICF = re.compile("(-?[\.\d]+)[ ,]+(-?[\.\d]+)") #fractions allowed
re_EXPEDITION = re.compile('\[\[(\d{4}-\d{2}-\d{2} -?\d+ -?\d+)')
sit... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
302,
11,
3992,
11,
4818,
8079,
11,
12234,
8019,
11,
2878,
11,
331,
43695,
11,
25064,
11,
47145,
11151,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
3... | 2.207865 | 534 |
def nearest_smallest_element(arr):
"""
Given an array arr, find the nearest smaller element for each element.
The index of the smaller element must be smaller than the current element.
"""
smaller_numbers = []
return [nearest(n) for n in arr]
| [
4299,
16936,
62,
17470,
395,
62,
30854,
7,
3258,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
11259,
281,
7177,
5240,
11,
1064,
262,
16936,
4833,
5002,
329,
1123,
5002,
13,
198,
220,
220,
220,
383,
6376,
286,
262,
4833,
5002... | 3.240964 | 83 |
# -*- coding: utf-8 -*-
'''
Relations for BIRD.
'''
import socket
import netaddr
import netifaces
from charmhelpers.core import hookenv
from charmhelpers.core.services.helpers import RelationContext
def resolve_domain_name(name, ip_version=4):
'''
Takes a domain name and resolves it to an IP address
of... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
47117,
329,
347,
46833,
13,
198,
7061,
6,
198,
11748,
17802,
198,
198,
11748,
2010,
29851,
198,
11748,
2010,
361,
2114,
198,
198,
6738,
20024,
16794,
364,
... | 2.636175 | 481 |
from hashlib import sha1
from django.core.cache import cache
from django.utils.encoding import smart_str
def cached(key=None, timeout=300):
"""
Cache the result of function call.
Args:
key: the key with which value will be saved. If key is None
then it is calculated automatically
... | [
6738,
12234,
8019,
1330,
427,
64,
16,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
23870,
1330,
12940,
198,
6738,
42625,
14208,
13,
26791,
13,
12685,
7656,
1330,
4451,
62,
2536,
198,
198,
4299,
39986,
7,
2539,
28,
14202,
11,
26827,
28,... | 2.921053 | 152 |
#!/usr/bin/env python3
"""
1. Go to:
https://usage.dteenergy.com/?interval=hour
2. Download CSV
3. Run:
python dtecsv.py .\electric_usage_report_05-31-2021_to_06-05-2021.csv
"""
import csv
import datetime
import click
import matplotlib.pyplot as plt
x = []
y = []
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
37811,
198,
16,
13,
1514,
284,
25,
198,
198,
5450,
1378,
26060,
13,
67,
660,
22554,
13,
785,
20924,
3849,
2100,
28,
9769,
198,
198,
17,
13,
10472,
44189,
198,
198,
18,
13,... | 2.345865 | 133 |
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | [
2,
15069,
357,
66,
8,
33448,
11,
15127,
23929,
44680,
6234,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
284... | 3.488372 | 559 |
# The following comments couldn't be translated into the new config version:
# Test storing OtherThing as well
# Configuration file for PrePoolInputTest
import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST2ND")
process.load("FWCore.Framework.test.cmsExceptionsFatal_cff")
#process.maxEvents = cms.un... | [
2,
383,
1708,
3651,
3521,
470,
307,
14251,
656,
262,
649,
4566,
2196,
25,
198,
198,
2,
6208,
23069,
3819,
51,
722,
355,
880,
198,
2,
28373,
2393,
329,
3771,
27201,
20560,
14402,
220,
198,
198,
11748,
48849,
14055,
13,
36301,
7248,
1... | 2.633721 | 344 |
import datetime
import os, sys
import numpy as np
import matplotlib.pyplot as plt
import casadi as cas
##### For viewing the videos in Jupyter Notebook
import io
import base64
from IPython.display import HTML
# from ..</src> import car_plotting
# from .import src.car_plotting
PROJECT_PATH = '/home/nbuckman/Dropbox (... | [
11748,
4818,
8079,
198,
11748,
28686,
11,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
11748,
6124,
9189,
355,
6124,
198,
198,
4242,
2,
1114,
11681,
262,
5861,
287,
... | 2.012769 | 11,747 |
import numpy as np
from tensorflow.keras.callbacks import TensorBoard
import cv2
import sys
import threading
import keras
from keras.layers import Conv2D,Dense,MaxPooling2D,Flatten,BatchNormalization,Dropout
from IPython.display import display
from PIL import Image
import tensorflow as tf
np.random.seed(1)
with tf.dev... | [
11748,
299,
32152,
355,
45941,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
13345,
10146,
1330,
309,
22854,
29828,
198,
11748,
269,
85,
17,
198,
11748,
25064,
198,
11748,
4704,
278,
198,
11748,
41927,
292,
198,
6738,
41927,
292,
13,... | 2.514493 | 828 |
#!/usr/bin/env python
import distutils
from setupfiles.dist import DistributionMetadata
from setupfiles.setup import setup
__all__ = ["setup"]
distutils.dist.DistributionMetadata = DistributionMetadata
distutils.core.setup = setup
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
1233,
26791,
198,
6738,
9058,
16624,
13,
17080,
1330,
27484,
9171,
14706,
198,
6738,
9058,
16624,
13,
40406,
1330,
9058,
198,
198,
834,
439,
834,
796,
14631,
40406,
8973,
198,
198... | 3.640625 | 64 |
import Gramatica
testSeparadorDeSilabas("AprEnDer", "A-prEn-Der")
testSeparadorDeSilabas("piCo", "-pi-Co")
testSeparadorDeSilabas("PDIO", "P-DIO")
testSeparadorDeSilabas("aprender", "a-pren-der")
testSeparadorDeSilabas("tabla", "ta-bla")
testSeparadorDeSilabas("ratn", "ra-tn")
testSeparadorDeSilabas("pico", "-pi-co")... | [
11748,
20159,
1512,
64,
628,
198,
9288,
19117,
283,
7079,
5005,
15086,
397,
292,
7203,
13680,
4834,
28532,
1600,
366,
32,
12,
1050,
4834,
12,
28532,
4943,
198,
9288,
19117,
283,
7079,
5005,
15086,
397,
292,
7203,
14415,
7222,
1600,
2744... | 2.358925 | 1,042 |
#
# Minify JSON data files in the `/dist` directory.
# Script invoked by the npm postbuild script after building the project with `npm run build`.
#
from os import (
path,
listdir,
fsdecode
)
import json
from datetime import datetime
if __name__ == '__main__':
minifier = JSONMinifier()
minifier.... | [
2,
198,
2,
1855,
1958,
19449,
1366,
3696,
287,
262,
4600,
14,
17080,
63,
8619,
13,
198,
2,
12327,
24399,
416,
262,
30599,
1281,
11249,
4226,
706,
2615,
262,
1628,
351,
4600,
77,
4426,
1057,
1382,
44646,
198,
2,
198,
198,
6738,
28686... | 2.720497 | 161 |
import subprocess
import platform
from Scripts import plist, utils
c = CPUName()
c.main()
| [
11748,
850,
14681,
198,
11748,
3859,
198,
6738,
12327,
82,
1330,
458,
396,
11,
3384,
4487,
198,
198,
66,
796,
16932,
4944,
480,
3419,
198,
66,
13,
12417,
3419,
198
] | 3.033333 | 30 |
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2016, Yung-Yu Chen <yyc@solvcon.net>
# BSD 3-Clause License, see COPYING
import os
import numpy as np
import solvcon as sc
# vim: set ff=unix fenc=utf8 ft=python nobomb et sw=4 ts=4 tw=79:
| [
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
66,
8,
1584,
11,
575,
2150,
12,
40728,
12555,
1279,
22556,
66,
31,
34453,
85,
1102,
13,
3262,
29,
198,
2,
347,
10305,
513,
12,
2601,
682,
13789,
... | 2.343137 | 102 |
""" COCO dataset (quick and dirty)
Hacked together by Ross Wightman
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch.utils.data as data
import os
import cv2
import random
import torch
import numpy as np
from PIL import Image
from pycocotool... | [
37811,
327,
4503,
46,
27039,
357,
24209,
290,
11841,
8,
198,
198,
39,
6021,
1978,
416,
9847,
370,
432,
805,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
3... | 3.424242 | 99 |
'''OpenGL extension EXT.sRGB_write_control
This module customises the behaviour of the
OpenGL.raw.GLES2.EXT.sRGB_write_control to provide a more
Python-friendly API
Overview (from the spec)
This extension's intent is to expose new functionality which allows an
application the ability to decide if the conversion... | [
7061,
6,
11505,
8763,
7552,
27489,
13,
82,
36982,
62,
13564,
62,
13716,
198,
198,
1212,
8265,
2183,
2696,
262,
9172,
286,
262,
220,
198,
11505,
8763,
13,
1831,
13,
8763,
1546,
17,
13,
13918,
13,
82,
36982,
62,
13564,
62,
13716,
284,... | 3.723343 | 347 |
from imagenet.models.biggan import BigGAN
from imagenet.models.u2net import U2NET
from imagenet.models.cgn import CGN
from imagenet.models.classifier_ensemble import InvariantEnsemble
__all__ = [
CGN, InvariantEnsemble, BigGAN, U2NET
]
| [
6738,
3590,
268,
316,
13,
27530,
13,
14261,
1030,
1330,
4403,
45028,
198,
6738,
3590,
268,
316,
13,
27530,
13,
84,
17,
3262,
1330,
471,
17,
12884,
198,
6738,
3590,
268,
316,
13,
27530,
13,
66,
4593,
1330,
327,
16630,
198,
6738,
3590... | 2.738636 | 88 |
# Do not edit this file directly.
# It was auto-generated by: code/programs/reflexivity/reflexive_refresh
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
| [
2,
2141,
407,
4370,
428,
2393,
3264,
13,
198,
2,
632,
373,
8295,
12,
27568,
416,
25,
2438,
14,
23065,
82,
14,
5420,
2588,
3458,
14,
5420,
2588,
425,
62,
5420,
3447,
628,
198,
2220,
7203,
31,
65,
41319,
62,
31391,
1003,
31391,
14,
... | 2.809524 | 63 |
from yaml import safe_load
from .blocklist import Blocklist | [
6738,
331,
43695,
1330,
3338,
62,
2220,
198,
6738,
764,
9967,
4868,
1330,
9726,
4868
] | 3.933333 | 15 |
""" Create meta data file 'metadata.yaml' for :class:`~pySPACE.resources.dataset_defs.feature_vector.FeatureVectorDataset`
Used for external files, which can not be read directly in pySPACE.
Eg. csv files without names.
To be called in the dataset directory.
"""
def get_numerical_user_input(msg):
""" Request inp... | [
37811,
13610,
13634,
1366,
2393,
705,
38993,
13,
88,
43695,
6,
329,
1058,
4871,
25,
63,
93,
9078,
4303,
11598,
13,
37540,
13,
19608,
292,
316,
62,
4299,
82,
13,
30053,
62,
31364,
13,
38816,
38469,
27354,
292,
316,
63,
198,
220,
198,... | 2.061571 | 1,884 |
""" Testing Abstract LUT model
"""
import unittest
import os
import shutil
import tempfile
from PyOpenColorIO.Constants import INTERP_LINEAR, INTERP_TETRAHEDRAL
from utils import lut_presets as presets
from utils.lut_presets import PresetException, OUT_BITDEPTH
import utils.abstract_lut_helper as alh
from utils.colors... | [
37811,
23983,
27741,
406,
3843,
2746,
198,
198,
37811,
198,
11748,
555,
715,
395,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
20218,
7753,
198,
6738,
9485,
11505,
10258,
9399,
13,
34184,
1187,
1330,
23255,
47,
62,
24027,
1503,
... | 2.727848 | 316 |
import argparse
import sys
import logging
import json
if __name__ == '__main__':
parser = args_parser().parse_args()
if parser.verbose >= 1:
logging.getLogger('').setLevel(logging.DEBUG)
if parser.urls_file is None and parser.url is None:
args_parser().print_usage()
sys.exit()
... | [
11748,
1822,
29572,
198,
11748,
25064,
198,
11748,
18931,
198,
11748,
33918,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
30751,
796,
26498,
62,
48610,
22446,
29572,
62,
22046,
3419,
628,
... | 2.134913 | 1,097 |
import math
print(circle_area(5))
print(intermediate_number(-24, 24))
evens, odds = separate([6, 5, 2, 1, 7])
print(evens)
print(odds)
| [
11748,
10688,
628,
628,
198,
4798,
7,
45597,
62,
20337,
7,
20,
4008,
628,
198,
198,
4798,
7,
3849,
13857,
62,
17618,
32590,
1731,
11,
1987,
4008,
628,
198,
198,
10197,
82,
11,
10402,
796,
4553,
26933,
21,
11,
642,
11,
362,
11,
352... | 2.416667 | 60 |
#!/usr/bin/env python
#
# Copyright (c) 2010, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin
# This software is licensed under the CC-GNU GPL version 2.0 or later.
# License: http://creativecommons.org/licenses/GPL/2.0/
#
# Author: Seung-jin Kim
# Contact: s... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
198,
2,
15069,
357,
66,
8,
3050,
11,
1312,
3646,
415,
37322,
876,
11,
2059,
286,
7943,
11,
10250,
8225,
21146,
46779,
11,
2059,
286,
3936,
379,
9533,
198,
2,
770,
3788,
318... | 3.415162 | 277 |
import json
import os
classlist = os.listdir("./image/")
for classname in classlist:
# "./Classification/"+classname+"/"
try: os.mkdir("./Classification/"+classname+"/")
except: pass
filenamelist = os.listdir("./image/"+classname)
url = "https://cdn.jsdelivr.net/gh/2x-ercha/twikoo-magic/image/" +... | [
11748,
33918,
198,
11748,
28686,
198,
198,
4871,
4868,
796,
28686,
13,
4868,
15908,
7,
1911,
14,
9060,
14,
4943,
198,
198,
1640,
1398,
3672,
287,
1398,
4868,
25,
198,
220,
220,
220,
1303,
366,
19571,
9487,
2649,
30487,
10,
4871,
3672,... | 2.289256 | 242 |
#!/usr/bin/env python3
import sys
from multiprocessing import Queue,Process,Lock
from datetime import datetime
import getopt
import configparser
que1 = Queue()
que2 = Queue()
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
25064,
198,
6738,
18540,
305,
919,
278,
1330,
4670,
518,
11,
18709,
11,
25392,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
651,
8738,
198,
11748,
4566,
48610,
... | 2.361905 | 105 |
#!/usr/bin/env python3
import argparse
import yaml
import pathlib
import decimal
import datetime
import os
decimal.getcontext().prec = 10
parser = argparse.ArgumentParser()
parser.add_argument('--data', help='path to data directory', required=True)
args = parser.parse_args()
script_path = os.path.dirname(os.path.re... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
1822,
29572,
198,
11748,
331,
43695,
198,
11748,
3108,
8019,
198,
11748,
32465,
198,
11748,
4818,
8079,
198,
11748,
28686,
198,
198,
12501,
4402,
13,
1136,
22866,
22446,
... | 2.673879 | 647 |
# -*- coding: utf-8 -*-
#for local
#import config
#config.write_environ()
import os,json
from flask import Flask, render_template, request, redirect, url_for, session
from requests_oauthlib import OAuth1Session
from datetime import timedelta
import twitter_auth
import twitter_delete
import postTweet
import databaseI... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
1640,
1957,
198,
2,
11748,
4566,
198,
2,
11250,
13,
13564,
62,
268,
2268,
3419,
198,
198,
11748,
28686,
11,
17752,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,... | 3.067982 | 456 |
from PySide.QtGui import QKeySequence
from PySide.QtCore import Qt
from .menu import Menu, MenuEntry, MenuSeparator
| [
198,
6738,
9485,
24819,
13,
48,
83,
8205,
72,
1330,
1195,
9218,
44015,
594,
198,
6738,
9485,
24819,
13,
48,
83,
14055,
1330,
33734,
198,
198,
6738,
764,
26272,
1330,
21860,
11,
21860,
30150,
11,
21860,
19117,
283,
1352,
198
] | 2.95 | 40 |
"""
shades
contains classes and functions relating to Shades' shade object
"""
from abc import ABC, abstractmethod
from typing import Tuple, List
import numpy as np
from PIL import Image
from .noise_fields import NoiseField, noise_fields
from .utils import color_clamp
| [
37811,
198,
1477,
2367,
198,
198,
3642,
1299,
6097,
290,
5499,
11270,
284,
47260,
6,
17979,
2134,
198,
37811,
198,
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
19720,
1330,
309,
29291,
11,
7343,
198,
198,
11748,
299,
32152,
... | 3.556962 | 79 |
def CA(file):
"""correspondence analysis.
Args:
file (directory): csv file contains genes' RSCU values
Returns:
- csv file contains genes' values for the first 4 axes of the correspondence analysis result
- csv file contains codons' values for the first 4 axes o... | [
4299,
7257,
7,
7753,
2599,
201,
198,
201,
198,
220,
220,
220,
37227,
10215,
5546,
594,
3781,
13,
201,
198,
201,
198,
220,
220,
220,
943,
14542,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
201,
198,
220,
220,
220,
220,
... | 2.163416 | 1,897 |
"""
Main RenderChan package
"""
| [
37811,
198,
13383,
46722,
48407,
5301,
198,
37811,
198
] | 3.555556 | 9 |
import sys
import os
import shutil
sys.path.append('.')
import chia_rep
| [
11748,
25064,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
198,
17597,
13,
6978,
13,
33295,
10786,
2637,
8,
198,
11748,
442,
544,
62,
7856,
628,
628
] | 2.814815 | 27 |
# Jacqueline Kory Westlund
# May 2016
#
# The MIT License (MIT)
#
# Copyright (c) 2016 Personal Robots Group
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including w... | [
2,
44726,
4470,
509,
652,
2688,
37525,
198,
2,
1737,
1584,
198,
2,
198,
2,
383,
17168,
13789,
357,
36393,
8,
198,
2,
198,
2,
15069,
357,
66,
8,
1584,
15644,
39096,
4912,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
28... | 3.7 | 360 |
# Generated by Django 4.0.1 on 2022-01-11 19:00
from django.db import migrations, models
import django.db.models.deletion
import scans.models
| [
2,
2980,
515,
416,
37770,
604,
13,
15,
13,
16,
319,
33160,
12,
486,
12,
1157,
678,
25,
405,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
19... | 2.938776 | 49 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# **
#
# ======================== #
# CHECK_RESERVATIONS_COMMAND #
# ======================== #
# Command for checking reservations.
#
# @author ES
# **
import logging
from collections import OrderedDict
from es_common.command.es_command import ESCommand
from es_common.enu... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
12429,
198,
2,
198,
2,
36658,
1421,
18604,
1303,
198,
2,
5870,
25171,
62,
19535,
1137,
53,
18421,
62,
9858,
44,
... | 3.149123 | 114 |
# coding: utf-8
from email.mime.text import MIMEText
from email.parser import Parser
import os
import pytest
def test_mails_filename_order(debugsmtp):
me = 'bar@example.com'
you = 'foo@example.com'
for i in range(10):
msg = MIMEText('Mail%02i.' % i)
msg['Subject'] = 'Test'
msg[... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
6738,
3053,
13,
76,
524,
13,
5239,
1330,
337,
3955,
2767,
2302,
198,
6738,
3053,
13,
48610,
1330,
23042,
263,
198,
11748,
28686,
198,
11748,
12972,
9288,
628,
628,
628,
198,
4299,
1332,
62,
26165... | 2.342444 | 622 |
# 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 agreed to in writing, ... | [
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,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
733... | 2.441245 | 3,021 |
from .supervisor import Supervisor
| [
6738,
764,
16668,
13131,
1330,
45673,
198
] | 5 | 7 |
# Generated by Django 3.0.5 on 2020-05-21 17:31
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
20,
319,
12131,
12,
2713,
12,
2481,
1596,
25,
3132,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
from jd.api.base import RestApi
| [
6738,
474,
67,
13,
15042,
13,
8692,
1330,
8324,
32,
14415,
628,
197,
197,
197,
628,
628,
198
] | 2.277778 | 18 |
"""Unit tests for generate training data test."""
from os import path
from absl import flags
import tensorflow as tf
from tensorflow_gnn.tools import generate_training_data
from tensorflow_gnn.utils import test_utils
FLAGS = flags.FLAGS
if __name__ == "__main__":
tf.test.main()
| [
37811,
26453,
5254,
329,
7716,
3047,
1366,
1332,
526,
15931,
198,
198,
6738,
28686,
1330,
3108,
198,
198,
6738,
2352,
75,
1330,
9701,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
62,
4593,
77,
13,
31391,
1330... | 3.164835 | 91 |
import random as rnd
import numpy as np
from random_agent import RandomAgent
from geister2 import Geister2
from vsenv import VsEnv
| [
11748,
4738,
355,
374,
358,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
4738,
62,
25781,
1330,
14534,
36772,
198,
6738,
4903,
1694,
17,
1330,
2269,
1694,
17,
198,
6738,
3691,
24330,
1330,
31280,
4834,
85,
628
] | 3.567568 | 37 |