content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from collections import defaultdict, deque
from functools import partial, wraps
import logging
import os
import socket
from threading import Event, Lock, Thread
import traceback
from Queue import Queue
from cassandra.connection import (Connection, ResponseWaiter, ConnectionShutdown,
C... | [
6738,
17268,
1330,
4277,
11600,
11,
390,
4188,
198,
6738,
1257,
310,
10141,
1330,
13027,
11,
27521,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
17802,
198,
6738,
4704,
278,
1330,
8558,
11,
13656,
11,
14122,
198,
11748,
12854,
1891,
... | 2.977901 | 362 |
# Generated by Django 3.0.7 on 2020-11-13 06:46
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
22,
319,
12131,
12,
1157,
12,
1485,
9130,
25,
3510,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
#!/usr/bin/env python
import os.path
import argparse
import matplotlib
matplotlib.use('Qt5Agg')
import matplotlib.pyplot as plt
plt.style.use('bmh')
plt.rcParams['font.sans-serif'] = 'Noto Sans'
plt.rcParams['mathtext.fontset'] = 'stixsans'
import pandas as pd
import util
from util import IMAGE_HEIGHT_PX, IMAGE_WIDT... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
28686,
13,
6978,
198,
11748,
1822,
29572,
198,
198,
11748,
2603,
29487,
8019,
198,
6759,
29487,
8019,
13,
1904,
10786,
48,
83,
20,
46384,
11537,
198,
11748,
2603,
29487,
8019... | 2.652381 | 210 |
import unittest
import time
from m2m_token.errors import ConfigError
from m2m_token.token import generate
| [
11748,
555,
715,
395,
201,
198,
11748,
640,
201,
198,
201,
198,
6738,
285,
17,
76,
62,
30001,
13,
48277,
1330,
17056,
12331,
201,
198,
6738,
285,
17,
76,
62,
30001,
13,
30001,
1330,
7716,
201,
198,
201,
198
] | 2.923077 | 39 |
import logging
| [
11748,
18931,
628,
628,
628,
628,
628,
628,
628
] | 3.111111 | 9 |
from django.urls import path, include
from .views import AllProductsView, OrderView
from rest_framework.routers import DefaultRouter, SimpleRouter
app_name = 'shop'
router = SimpleRouter()
router.register('products', AllProductsView)
router.register('order', OrderView)
urlpatterns = [
]
urlpatterns += router.urls
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
2291,
198,
6738,
764,
33571,
1330,
1439,
48650,
7680,
11,
8284,
7680,
198,
6738,
1334,
62,
30604,
13,
472,
1010,
1330,
15161,
49,
39605,
11,
17427,
49,
39605,
198,
198,
1324,
62,
3672,... | 3.278351 | 97 |
# Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from erpnext.setup.install import create_default_cash_flow_mapper_templates
| [
2,
15069,
357,
66,
8,
2177,
11,
39313,
27768,
290,
25767,
669,
198,
2,
13789,
25,
22961,
3611,
5094,
13789,
410,
18,
13,
4091,
5964,
13,
14116,
198,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
5... | 3.485294 | 68 |
import os
from fabric.api import *
try:
from config.fabric import github_username, github_password
github_username = github_username
github_access_token = github_password
except ImportError:
print("Set up config/fabric.py file")
env.hosts = ['localhost']
env.origin = "https://github.com/MaxASchwarzer/... | [
11748,
28686,
198,
6738,
9664,
13,
15042,
1330,
1635,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
4566,
13,
36434,
1173,
1330,
33084,
62,
29460,
11,
33084,
62,
28712,
198,
220,
220,
220,
33084,
62,
29460,
796,
33084,
62,
29460,
198,... | 3.037313 | 134 |
# Copyright 2020 The TensorFlow Authors. 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 applica... | [
2,
15069,
12131,
383,
309,
22854,
37535,
46665,
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,... | 3.469622 | 609 |
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from featnames import ACCEPT, REJECT, NORM, CON
from plot.const import BIN_TICKS, TRICOLOR, COLORS, SLRBO_TICKS
from plot.util import save_fig, get_name
| [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
6738,
2218,
14933,
1330,
15859,
8905,
51,
11,
4526,
23680,
11,
25273,
44,
11,
7102,
198,
6738,
7... | 2.829268 | 82 |
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
27741,
12982,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
113... | 3.541667 | 48 |
from functools import wraps
from itertools import count
from typing import Callable
from logzero import logger
from chaoslib.types import Journal
counter = None
@keepcount
@initcounter
| [
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
340,
861,
10141,
1330,
954,
198,
6738,
19720,
1330,
4889,
540,
198,
198,
6738,
2604,
22570,
1330,
49706,
198,
198,
6738,
11918,
8019,
13,
19199,
1330,
4913,
198,
198,
24588,
796,
6045,
628... | 3.75 | 52 |
# -*- coding: utf-8 -*-
import numpy as np
from PIL import Image
ACC_PIXEL = 3
RELATE_ERR = 0.05
# image's width
IMAGE_WIDTH = 416
# image's height
IMAGE_HEIGHT = 128
# image's width
IMAGE_ORG_WIDTH = 1248
# image's height
IMAGE_ORG_HEIGHT = 384
DEPTH_DIVIDING = 256.0
if __name__ == "__main__":
total = 0
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
350,
4146,
1330,
7412,
628,
198,
26861,
62,
47,
10426,
3698,
796,
513,
198,
16448,
6158,
62,
1137,
49,
796,
657,
13,
2713,
19... | 2.094203 | 414 |
import os
import sys
import numpy as np
import random
from metrics_ddie import ddie_compute_metrics
from statsmodels.stats import contingency_tables
_, output_dir1, output_dir2 = sys.argv
preds1 = np.load(os.path.join(output_dir1, 'preds.npy'))
preds2 = np.load(os.path.join(output_dir2, 'preds.npy'))
labels = np.loa... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4738,
198,
6738,
20731,
62,
1860,
494,
1330,
288,
11979,
62,
5589,
1133,
62,
4164,
10466,
198,
6738,
9756,
27530,
13,
34242,
1330,
38820,
62,
83,
2977,
198... | 2.115385 | 468 |
# Denma the Owner (1052004) | Henesys Plastic Surgery (100000103)
# Male: 20000 - 20099 (Motivated to Tess)
# Female: 21000 - 21099 (Defiant to Futuroid)
from net.swordie.ms.loaders import StringData
options = []
al = chr.getAvatarData().getAvatarLook()
faceColour = al.getFace() % 1000 - al.getFace() % 100
if al.ge... | [
2,
5601,
2611,
262,
23853,
357,
13348,
15724,
8,
930,
6752,
274,
893,
33731,
39037,
357,
49388,
486,
3070,
8,
198,
2,
12674,
25,
939,
405,
532,
939,
2079,
357,
47733,
30829,
284,
39412,
8,
198,
2,
15396,
25,
2310,
830,
532,
20064,
... | 2.744856 | 243 |
import sys
sys.path.append('./Controller')
from TicTacToe import TicTacToe
from HumanPlayer import HumanPlayer
from MonteCarloTreeSearchPlayer import MonteCarloTreeSearchPlayer
from MonteCarloTreeSearchPlayerV2 import MonteCarloTreeSearchPlayerV2
if __name__ == '__main__':
p1 = MonteCarloTreeSearchPlayer("MCTS1")
... | [
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
7,
4458,
14,
22130,
11537,
198,
6738,
309,
291,
51,
330,
2514,
68,
1330,
309,
291,
51,
330,
2514,
68,
198,
6738,
5524,
14140,
1330,
5524,
14140,
198,
6738,
22489,
9914,
5439,
27660,
18243... | 2.564246 | 179 |
from setuptools import setup
setup(
name='dictlisttools',
version='1.0.0',
packages=['dictlisttools', 'dictlisttools.tests'],
test_suite='dictlisttools.tests',
url='https://github.com/anthonyblanchflower/dictlisttools',
author='Anthony Blanchflower',
author_email='anthony.blanchflower@btint... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
11600,
4868,
31391,
3256,
198,
220,
220,
220,
2196,
11639,
16,
13,
15,
13,
15,
3256,
198,
220,
220,
220,
10392,
28,
17816,
11600,
4868,
31391,
... | 2.913043 | 138 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-02-27 08:24
from __future__ import unicode_literals
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,
17,
319,
1584,
12,
2999,
12,
1983,
8487,
25,
1731,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
1... | 2.724638 | 69 |
from lark import Lark
import turtle
| [
6738,
300,
668,
1330,
406,
668,
198,
11748,
28699,
198,
197,
197,
197,
198
] | 2.857143 | 14 |
from enum import Enum
from common.direction import Direction
from robot.robot import Robot
from algorithm.node import *
from math import trunc, pi
import dearpygui.dearpygui as dpg | [
6738,
33829,
1330,
2039,
388,
198,
6738,
2219,
13,
37295,
1330,
41837,
198,
6738,
9379,
13,
305,
13645,
1330,
16071,
198,
6738,
11862,
13,
17440,
1330,
1635,
198,
6738,
10688,
1330,
40122,
11,
31028,
198,
198,
11748,
390,
5117,
88,
4831... | 3.693878 | 49 |
from sentry.processors import Processor
| [
6738,
1908,
563,
13,
14681,
669,
1330,
32893,
628
] | 4.555556 | 9 |
from rttapi.factory import LocationList, ServiceList
AVAIL_RESOURCES = ["location", "service"]
def resource(rtype, credenvelope):
"""Resource factory method."""
if rtype == "location":
resource = LocationList(credenvelope)
elif rtype == "service":
resource = ServiceList(credenvelope)
... | [
6738,
374,
926,
15042,
13,
69,
9548,
1330,
13397,
8053,
11,
4809,
8053,
220,
628,
198,
10116,
32,
4146,
62,
19535,
2606,
7397,
1546,
796,
14631,
24886,
1600,
366,
15271,
8973,
628,
198,
198,
4299,
8271,
7,
81,
4906,
11,
2600,
268,
1... | 2.429293 | 198 |
from pyChemometrics import ChemometricsScaler, ChemometricsPLS
import numpy as np
np.random.seed(0)
import pandas as pds
# Use the standard datasets
t_dset = pds.read_csv('./tests/test_data/regression.csv')
xmat = t_dset.iloc[:, 1:4].values
y = t_dset.iloc[:, 0].values
y = y[np.newaxis].T
mc_scaler = ChemometricsSc... | [
6738,
12972,
41829,
908,
10466,
1330,
12870,
908,
10466,
3351,
36213,
11,
12870,
908,
10466,
6489,
50,
198,
11748,
299,
32152,
355,
45941,
198,
198,
37659,
13,
25120,
13,
28826,
7,
15,
8,
198,
198,
11748,
19798,
292,
355,
279,
9310,
1... | 2.231222 | 679 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
os.chdir('/Users/pablobottero/github/master/python/data_analysis')
bikes2011 = pd.read_csv('rentals_weather_2011.csv')
del rentals_weather_2011['index2']
del rentals_weather_2011['dteday_y... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
2948... | 2.478161 | 435 |
from uvicontainer.config import Config
from uvicontainer.main import BaseServer, TCPServer, UDPServer, main, run
__version__ = "0.1.1rc1"
__all__ = ["main", "run", "Config", "BaseServer", "TCPServer", "UDPServer"]
| [
6738,
334,
25531,
756,
10613,
13,
11250,
1330,
17056,
198,
6738,
334,
25531,
756,
10613,
13,
12417,
1330,
7308,
10697,
11,
17283,
3705,
18497,
11,
43700,
3705,
18497,
11,
1388,
11,
1057,
198,
198,
834,
9641,
834,
796,
366,
15,
13,
16,... | 2.828947 | 76 |
from .dataset import dataset
from ..image import aflw_image
| [
6738,
764,
19608,
292,
316,
1330,
27039,
198,
6738,
11485,
9060,
1330,
257,
2704,
86,
62,
9060,
198
] | 3.333333 | 18 |
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 21 19:55:46 2013
@author: edouard.duchesnay@cea.fr
@author: benoit.da_mota@inria.fr
@author: jinpeng.li@cea.fr
"""
from sklearn import datasets
from sklearn.svm import LinearSVC as SVM
from sklearn.lda import LDA
from sklearn.feature_selection import SelectKBest
X, y = d... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
2892,
2365,
2310,
678,
25,
2816,
25,
3510,
2211,
198,
198,
31,
9800,
25,
1225,
280,
446,
13,
646,
2052,
77,
323,
31,
344,
64,
13,
8310,
198,
... | 2.180592 | 2,298 |
# Copyright (c) 2019-2020, NVIDIA 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | [
2,
15069,
357,
66,
8,
13130,
12,
42334,
11,
15127,
23929,
44680,
6234,
13,
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,
... | 2.24407 | 1,307 |
#! /usr/bin/python3
# 797. All Paths From Source to Target
# Medium
#
# Given a directed, acyclic graph of N nodes. Find all possible paths from node 0 to node N-1, and return them in any order.
#
# The graph is given as follows: the nodes are 0, 1, ..., graph.length - 1. graph[i] is a list of all nodes j for which... | [
2,
0,
1220,
14629,
14,
8800,
14,
29412,
18,
198,
198,
2,
767,
5607,
13,
1439,
10644,
82,
3574,
8090,
284,
12744,
198,
2,
13398,
198,
2,
198,
2,
11259,
257,
7924,
11,
936,
88,
565,
291,
4823,
286,
399,
13760,
13,
220,
9938,
477,
... | 2.765125 | 281 |
#!/usr/bin/python
import time
import Axon
import Axon.ThreadedComponent
Timer().run()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
640,
198,
11748,
12176,
261,
198,
11748,
12176,
261,
13,
16818,
276,
21950,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
48801,
22446,
5143,
3419,
628
] | 2.404762 | 42 |
########################################################################
#
# File Name: ParsedExpr.py
#
#
"""
The implementation of all of the expression pared tokens.
WWW: http://4suite.org/XPATH e-mail: support@4suite.org
Copyright (c) 2000-2001 Fourthought Inc, USA. All Rights Reserved.
See http://4suit... | [
29113,
29113,
7804,
198,
2,
198,
2,
9220,
6530,
25,
220,
220,
23042,
276,
3109,
1050,
13,
9078,
198,
2,
198,
2,
198,
37811,
198,
464,
7822,
286,
477,
286,
262,
5408,
279,
1144,
16326,
13,
198,
17947,
54,
25,
2638,
1378,
19,
2385,
... | 3.268519 | 324 |
from abc import ABC, abstractmethod
from typing import Optional
from pythonit_toolkit.emails.templates import EmailTemplate
| [
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
19720,
1330,
32233,
198,
198,
6738,
21015,
270,
62,
25981,
15813,
13,
368,
1768,
13,
11498,
17041,
1330,
9570,
30800,
628
] | 4.064516 | 31 |
## @file
# This file is used to define the identification of INF/DEC/DSC files
#
# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
## Identification
#
# This class defined basic Identification information structure which is used by INF/DEC/DSC files
#
# @p... | [
2235,
2488,
7753,
198,
2,
770,
2393,
318,
973,
284,
8160,
262,
11795,
286,
45594,
14,
41374,
14,
5258,
34,
3696,
198,
2,
198,
2,
15069,
357,
66,
8,
4343,
11,
8180,
10501,
13,
1439,
2489,
10395,
29847,
11473,
29,
198,
2,
30628,
55,... | 2.893082 | 318 |
# Copyright 2019-2020 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... | [
2,
15069,
13130,
12,
42334,
47482,
324,
84,
29082,
21852,
3457,
13,
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,... | 2.397544 | 7,086 |
import getopt
import os
import sys
from OCC.StlAPI import StlAPI_Writer
from OCC.STEPControl import STEPControl_Reader
from OCC.IFSelect import IFSelect_RetDone, IFSelect_ItemsByEntity
if __name__ == '__main__':
main(sys.argv[1:])
| [
11748,
651,
8738,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
6738,
440,
4093,
13,
1273,
75,
17614,
1330,
520,
75,
17614,
62,
34379,
198,
6738,
440,
4093,
13,
42135,
15988,
1330,
49154,
15988,
62,
33634,
198,
6738,
440,
4093,
13,
... | 2.91358 | 81 |
from markdown import markdown
from BeautifulSoup import BeautifulSoup
from django import template
from django.template.defaultfilters import stringfilter
from django.utils.encoding import force_unicode
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter(is_safe=True)
@string... | [
6738,
1317,
2902,
1330,
1317,
2902,
198,
6738,
23762,
50,
10486,
1330,
23762,
50,
10486,
198,
198,
6738,
42625,
14208,
1330,
11055,
198,
6738,
42625,
14208,
13,
28243,
13,
12286,
10379,
1010,
1330,
4731,
24455,
198,
6738,
42625,
14208,
13... | 3.636364 | 99 |
import pytest
import time
from test_helpers import create_socket, send_msg, assert_msg_ok, assert_msg_fail
from test_setup import CCXML_PATH, CONNECTION, DEVICETYPE, HOME, SESSION
#@pytest.mark.xfail(reason="No validating file path on JS side")
| [
11748,
12972,
9288,
198,
11748,
640,
198,
6738,
1332,
62,
16794,
364,
1330,
2251,
62,
44971,
11,
3758,
62,
19662,
11,
6818,
62,
19662,
62,
482,
11,
6818,
62,
19662,
62,
32165,
198,
6738,
1332,
62,
40406,
1330,
12624,
55,
5805,
62,
3... | 2.963855 | 83 |
from bs4 import BeautifulSoup
import requests
import csv
import sys
from urllib.error import HTTPError
sys.path.append("..")
import mytemp
url='https://s.taobao.com/search?q=%E8%8C%B6%E5%8F%B6&imgfile=&commend=all&ssid=s5-e&search_type=item&sourceId=tb.index&spm=a21bo.2017.201856-taobao-item.2&ie=utf8&initiati... | [
201,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
201,
198,
11748,
7007,
201,
198,
11748,
269,
21370,
201,
198,
11748,
25064,
201,
198,
6738,
2956,
297,
571,
13,
18224,
1330,
14626,
12331,
201,
198,
17597,
13,
6978,
13,
33295,
7203... | 2.135593 | 177 |
#!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Michael A.G. Aivazis
# California Institute of Technology
# (C) 1998-2003 All Rights Reserved
#
# <LicenseText>
#
# ~~~~~~~~~~~~~~... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
220,
220,
27156,
27156,
27156,
27156,
27156,
198,
2,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2... | 2.606635 | 211 |
from unittest import TestCase
from command.model.configuration._arg_group import *
| [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
3141,
13,
19849,
13,
11250,
3924,
13557,
853,
62,
8094,
1330,
1635,
628
] | 3.818182 | 22 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2011-2013 by nils_2 <weechatter@arcor.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any l... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
66,
8,
2813,
12,
6390,
416,
299,
4487,
62,
17,
1279,
732,
3055,
1436,
31,
5605,
273,
13,
2934,
29,
198,
2,
198,
2,
770,
1430,
318,
1479,
3... | 2.221371 | 2,611 |
"""
Ideally, Sugaroid should also support reading input from
a computer audio input device, such as a desktop microphone or
a laptop microphone. This is not yet implemented.
.. warning ::
This feature is not yet implemented and looking for
community contribution
"""
| [
37811,
198,
41452,
453,
11,
20874,
1868,
815,
635,
1104,
3555,
5128,
422,
220,
198,
64,
3644,
6597,
5128,
3335,
11,
884,
355,
257,
11364,
21822,
393,
198,
64,
13224,
21822,
13,
770,
318,
407,
1865,
9177,
13,
198,
198,
492,
6509,
790... | 4.212121 | 66 |
import os
import smooth1d
#(0) Simulate one dataset, multuple parameters:
nIterations = 3
JJ = [5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 35, 45, 50] #sample sizes
noise_amps = [0.01, 0.20]
sim = smooth1d.sim.Simulator()
sim.set_alpha(0.05)
sim.set_filter('None')
# sim.set_dataset_name('Vaughan1982')
# ... | [
198,
11748,
28686,
198,
11748,
7209,
16,
67,
628,
628,
198,
2,
7,
15,
8,
3184,
5039,
530,
27039,
11,
1963,
29291,
10007,
25,
198,
77,
29993,
602,
796,
513,
198,
32178,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
685,
20,
1... | 2.305699 | 386 |
from __future__ import unicode_literals, print_function
import itertools
import json
import os
from conceptnet5.edges import make_edge
from conceptnet5.formats.msgpack_stream import MsgpackStreamWriter
from conceptnet5.languages import ALL_LANGUAGES
from conceptnet5.readers.wiktionary import valid_language
from conc... | [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
11,
3601,
62,
8818,
198,
198,
11748,
340,
861,
10141,
198,
11748,
33918,
198,
198,
11748,
28686,
198,
198,
6738,
3721,
3262,
20,
13,
276,
3212,
1330,
787,
62,
14907,
198,
673... | 2.727497 | 811 |
n = int(input('Digite N: '))
for l in range(1, n+1):
for c in range(1, n+1):
if c == l:
print('*', end='')
else:
print('.', end='')
if c % n == 0:
print('\n', end='') | [
77,
796,
493,
7,
15414,
10786,
19511,
578,
399,
25,
705,
4008,
198,
1640,
300,
287,
2837,
7,
16,
11,
299,
10,
16,
2599,
198,
220,
220,
220,
329,
269,
287,
2837,
7,
16,
11,
299,
10,
16,
2599,
198,
220,
220,
220,
220,
220,
220,
... | 1.666667 | 138 |
import pytest
import datetime
from shapely.wkt import loads
from unittest.mock import patch
from pyramid.testing import DummyRequest
from pyramid_oereb.core import b64
from pyramid_oereb.core.adapter import FileAdapter
from pyramid_oereb.core.records.image import ImageRecord
from pyramid_oereb.core.records.theme imp... | [
11748,
12972,
9288,
198,
11748,
4818,
8079,
198,
198,
6738,
5485,
306,
13,
86,
21841,
1330,
15989,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
198,
198,
6738,
27944,
13,
33407,
1330,
360,
13513,
18453,
198,
198,
6738,
27944,
62... | 3.04902 | 306 |
from gurobipy import *
import numpy as np
import sys
import time
# https://dspace.mit.edu/handle/1721.1/29599
# compute the optimal action, given the (possibly) lambda-adjusted q-values
| [
6738,
915,
22609,
541,
88,
1330,
1635,
198,
11748,
299,
32152,
355,
45941,
220,
198,
11748,
25064,
198,
11748,
640,
628,
198,
2,
3740,
1378,
67,
13200,
13,
2781,
13,
15532,
14,
28144,
14,
1558,
2481,
13,
16,
14,
25710,
2079,
628,
62... | 3.029851 | 67 |
# Autogenerated from KST: please remove this line if doing any edits by hand!
import unittest
from default_endian_mod import _schema
| [
2,
5231,
519,
877,
515,
422,
509,
2257,
25,
3387,
4781,
428,
1627,
611,
1804,
597,
31671,
416,
1021,
0,
198,
198,
11748,
555,
715,
395,
198,
198,
6738,
4277,
62,
437,
666,
62,
4666,
1330,
4808,
15952,
2611,
198
] | 3.375 | 40 |
"""Rss scraping with Beautifulsoup."""
import subprocess
import isort # noqa: F401
import requests
import snoop
from bs4 import BeautifulSoup
from loguru import logger
fmt = "{time} - {name} - {level} - {message}"
logger.add("../logs/info.log", level="INFO", format=fmt, backtrace=True, diagnose=True) # noqa: E501
l... | [
37811,
49,
824,
46743,
351,
23762,
82,
10486,
526,
15931,
198,
11748,
850,
14681,
198,
198,
11748,
318,
419,
220,
1303,
645,
20402,
25,
376,
21844,
198,
11748,
7007,
198,
11748,
3013,
11224,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10... | 2.556338 | 284 |
from .sort import Sort
from .mpt import MPT | [
6738,
764,
30619,
1330,
33947,
198,
6738,
764,
76,
457,
1330,
4904,
51
] | 3.307692 | 13 |
"""Entry point for the pretraining task."""
import collections
import logging
import math
import os
import warnings
from pathlib import Path
from typing import Dict, Union, Any, Optional, List
import numpy as np
import torch
import torch.nn as nn
from packaging import version
from torch.cuda.amp import autocast
from t... | [
37811,
30150,
966,
329,
262,
2181,
24674,
4876,
526,
15931,
198,
11748,
17268,
198,
11748,
18931,
198,
11748,
10688,
198,
11748,
28686,
198,
11748,
14601,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
360,
713,
11,
4479,
11,... | 2.353538 | 18,346 |
import os
import portalocker
from deep_architect.contrib.communicators.communicator import Communicator
from deep_architect.contrib.communicators.file_utils import (consume_file,
read_file,
write_f... | [
11748,
28686,
198,
11748,
17898,
12721,
198,
198,
6738,
2769,
62,
998,
5712,
13,
3642,
822,
13,
10709,
44549,
13,
10709,
26407,
1330,
4440,
26407,
198,
6738,
2769,
62,
998,
5712,
13,
3642,
822,
13,
10709,
44549,
13,
7753,
62,
26791,
1... | 1.821229 | 179 |
astr = 'python'
alist = [10, 20, 30]
atuple = ('tom', 'jerry')
adict = {'name': 'bob', 'age': 20}
for ch in astr:
print(ch)
for i in alist:
print(i)
for name in atuple:
print(name)
for key in adict:
print('%s: %s' % (key, adict[key]))
| [
459,
81,
796,
705,
29412,
6,
198,
49845,
796,
685,
940,
11,
1160,
11,
1542,
60,
198,
265,
29291,
796,
19203,
39532,
3256,
705,
73,
6996,
11537,
198,
324,
713,
796,
1391,
6,
3672,
10354,
705,
65,
672,
3256,
705,
496,
10354,
1160,
9... | 2.073171 | 123 |
from django.contrib import admin
from blog.models import Comentarios
# Register your models here.
admin.site.register(Comentarios)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
4130,
13,
27530,
1330,
955,
298,
13010,
198,
198,
2,
17296,
534,
4981,
994,
13,
198,
198,
28482,
13,
15654,
13,
30238,
7,
5377,
298,
13010,
8,
198
] | 3.5 | 38 |
import asyncio
from collections import namedtuple
import pytest
from .route import parse, MatcherEntry, Segment, SegmentType, Route, \
compile, roundto8
@pytest.mark.parametrize('pattern,result', [
('/', [('exact', '/')]),
('/{{a}}', [('exact', '/{a}')]),
('{a}', [('placeholder', 'a')]),
('a/{a}... | [
11748,
30351,
952,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
764,
38629,
1330,
21136,
11,
6550,
2044,
30150,
11,
1001,
5154,
11,
1001,
5154,
6030,
11,
18956,
11,
3467,
198,
220,
220,
220,
1... | 2.254132 | 484 |
import gevent.monkey
gevent.monkey.patch_ssl()
from mq_handler.hupun_stock_bills.model.erp_receipt_info import ErpReceiptInfo
from mq_handler.hupun_stock_bills.page.query_outbound import QueryOutbound
from mq_handler.hupun_stock_bills.page.outbound import Outbound
import json
from mq_handler.base import Base
from pyspi... | [
11748,
4903,
1151,
13,
49572,
198,
469,
1151,
13,
49572,
13,
17147,
62,
45163,
3419,
198,
6738,
285,
80,
62,
30281,
13,
71,
929,
403,
62,
13578,
62,
65,
2171,
13,
19849,
13,
263,
79,
62,
260,
344,
10257,
62,
10951,
1330,
5256,
79,... | 2.52809 | 267 |
import pymongo
import re
import os,sys,inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirname(current_dir)
sys.path.insert(0, parent_dir)
from json_parser import parser
import numpy as np
query()
| [
11748,
279,
4948,
25162,
198,
11748,
302,
198,
11748,
28686,
11,
17597,
11,
1040,
806,
198,
14421,
62,
15908,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
1040,
806,
13,
1136,
7753,
7,
1040,
806,
... | 2.647619 | 105 |
# coding=utf-8
# Copyright 2021-present, the Recognai S.L. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | [
2,
220,
19617,
28,
40477,
12,
23,
198,
2,
220,
15069,
33448,
12,
25579,
11,
262,
31517,
1872,
311,
13,
43,
13,
1074,
13,
198,
2,
198,
2,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
1... | 3.354167 | 336 |
# myTeam.py
# ---------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://ai.berkeley.edu.
#
# A... | [
2,
616,
15592,
13,
9078,
198,
2,
45337,
198,
2,
10483,
26426,
6188,
25,
220,
921,
389,
1479,
284,
779,
393,
9117,
777,
4493,
329,
198,
2,
9856,
4959,
2810,
326,
357,
16,
8,
345,
466,
407,
14983,
393,
7715,
198,
2,
8136,
11,
357,... | 3.374315 | 1,277 |
import sqlite3
from flask import g
DATABASE = '/path/to/database.db'
@app.teardown_appcontext | [
11748,
44161,
578,
18,
198,
6738,
42903,
1330,
308,
198,
198,
35,
1404,
6242,
11159,
796,
31051,
6978,
14,
1462,
14,
48806,
13,
9945,
6,
198,
198,
31,
1324,
13,
660,
446,
593,
62,
1324,
22866
] | 2.638889 | 36 |
import csv
import logging
import math
def can_float(value):
"""Takes in a string a determines whether or not it
can be converted to a float.
Args:
value: the string to check if can be converted to float
Returns:
bool: True if can convert to float, False otherwise
Raises:
... | [
11748,
269,
21370,
198,
11748,
18931,
198,
11748,
10688,
628,
198,
4299,
460,
62,
22468,
7,
8367,
2599,
198,
220,
220,
220,
37227,
51,
1124,
287,
257,
4731,
257,
15947,
1771,
393,
407,
340,
198,
220,
220,
220,
460,
307,
11513,
284,
... | 2.283315 | 893 |
import hashlib
import torch
import torch.nn as nn
class Model(nn.Module):
""" Class representing sampleable neural network model """
def hashsummary(self):
""" Print a model summary - checksums of each layer parameters """
children = list(self.children())
result = []
for child... | [
11748,
12234,
8019,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
198,
4871,
9104,
7,
20471,
13,
26796,
2599,
198,
220,
220,
220,
37227,
5016,
10200,
6291,
540,
17019,
3127,
2746,
37227,
628,
220,
220,
220,
825,
... | 2.204641 | 474 |
# TODO: create PyTorch adapter! | [
2,
16926,
46,
25,
2251,
9485,
15884,
354,
21302,
0
] | 3.1 | 10 |
from submission import Submission
| [
6738,
14498,
1330,
42641,
628,
198
] | 6 | 6 |
"""
The app pages stores some utility files:
- fixtures for the tests
- base.html
- home.html
"""
from django.views.generic import TemplateView
from django.shortcuts import render
| [
37811,
198,
220,
220,
220,
383,
598,
5468,
7000,
617,
10361,
3696,
25,
198,
220,
220,
220,
532,
34609,
329,
262,
5254,
198,
220,
220,
220,
532,
2779,
13,
6494,
198,
220,
220,
220,
532,
1363,
13,
6494,
198,
37811,
198,
198,
6738,
4... | 3.174603 | 63 |
# -*- coding: utf-8 -*-
try:
from BeautifulSoup import BeautifulSoup as bss
except:
from bs4 import BeautifulSoup as bs
try:
import urllib2
except:
import urllib.request as urllib2
import urllib
import re
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
28311,
25,
198,
197,
6738,
23762,
50,
10486,
1330,
23762,
50,
10486,
355,
275,
824,
198,
16341,
25,
198,
197,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
355,
275,
82,
... | 2.573171 | 82 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
| [
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,
9945,
1330,
4981,
11,
15720,
602,
628
] | 2.891892 | 37 |
import math
res = 0
k1, k2 = [int(x) for x in input().split()]
n = int(input())
objects = []
for i in range(n):
x_i, y_i = [int(a) for a in input().split()]
objects.append((x_i, y_i))
prob_x = {}
prob_xy = {}
for i in range(n):
prob_x[objects[i][0]] = prob_x.get(objects[i][0], 0) + 1. / n
prob_xy[o... | [
11748,
10688,
198,
198,
411,
796,
657,
198,
74,
16,
11,
479,
17,
796,
685,
600,
7,
87,
8,
329,
2124,
287,
5128,
22446,
35312,
3419,
60,
198,
77,
796,
493,
7,
15414,
28955,
198,
198,
48205,
796,
17635,
198,
1640,
1312,
287,
2837,
... | 2.094421 | 233 |
"""
Django settings for tock.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
fr... | [
37811,
198,
35,
73,
14208,
6460,
329,
284,
694,
13,
198,
198,
1890,
517,
1321,
319,
428,
2393,
11,
766,
198,
5450,
1378,
31628,
13,
28241,
648,
404,
305,
752,
13,
785,
14,
268,
14,
16,
13,
22,
14,
4852,
873,
14,
33692,
14,
198,
... | 2.226512 | 2,150 |
"""
Wrapper for loading templates from the filesystem in a multi-tenant setting.
"""
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import connection
from django.template.loaders.filesystem import Loader as BaseLoader
from django_tenants import utils
| [
37811,
198,
36918,
2848,
329,
11046,
24019,
422,
262,
29905,
287,
257,
5021,
12,
1452,
415,
4634,
13,
198,
37811,
628,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
12205,
525,... | 3.804878 | 82 |
import mypackage.foo
mypackage.bar.dostuff()
# <ref>
| [
11748,
616,
26495,
13,
21943,
198,
198,
1820,
26495,
13,
5657,
13,
67,
455,
1648,
3419,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
5420,
29,
198
] | 1.914286 | 35 |
#******************************************************************************************************
# enumerations.py - Gbtc
#
# Copyright © 2021, Grid Protection Alliance. All Rights Reserved.
#
# Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
# the NOTICE... | [
2,
17174,
17174,
17174,
2466,
1174,
198,
2,
220,
27056,
602,
13,
9078,
532,
402,
18347,
66,
198,
2,
198,
2,
220,
15069,
10673,
33448,
11,
24846,
9985,
10302,
13,
220,
1439,
6923,
33876,
13,
198,
2,
198,
2,
220,
49962,
284,
262,
24... | 4.683849 | 291 |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('README.rst').read()
setup(
name='crossbarhttprequests',
packages=['crossbarhttp'],
version='0.1.6',
description='This is a library for connecting to Crossbar.io HTTP Bridge Services using pyth... | [
28311,
25,
198,
220,
220,
220,
422,
900,
37623,
10141,
1330,
9058,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
422,
1233,
26791,
13,
7295,
1330,
9058,
198,
198,
961,
1326,
796,
1280,
10786,
15675,
11682,
13,
81,
301,
27691,
961,... | 2.665105 | 427 |
import hashlib
| [
11748,
12234,
8019,
628,
198
] | 3.4 | 5 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# rotate_servo_listener.py
# author: Kentaro Wada <www.kentaro.wada@gmail.com>
import os
import sys
sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(__file__)), '../../code'))
import rospy
from std_msgs.msg import Bool
from blink_led import BlinkLed
PIN_CT... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
23064,
62,
3168,
78,
62,
4868,
877,
13,
9078,
198,
2,
1772,
25,
8758,
12022,
370,
4763,
1279,
2503,
13,
74,
298,... | 2.389222 | 167 |
import random
SIZE = 8192
FACTOR = 0.5
SOURCE_NODE = 342
DEST_NODE = 4982
with open('test.txt', 'w') as f:
f.write(str(SIZE) + '\n' + str(SOURCE_NODE) + '\n' + str(DEST_NODE) + '\n')
for i in range(int(SIZE * FACTOR)):
f.write(str(random.randint(0, SIZE - 1)) + ' ' +
str(random.randint... | [
11748,
4738,
198,
198,
33489,
796,
807,
17477,
198,
37,
10659,
1581,
796,
657,
13,
20,
198,
47690,
62,
45,
16820,
796,
44341,
198,
35,
6465,
62,
45,
16820,
796,
604,
4089,
17,
198,
198,
4480,
1280,
10786,
9288,
13,
14116,
3256,
705,... | 1.879518 | 249 |
# (C) British Crown Copyright 2011 - 2018, Met Office
#
# This file is part of cartopy.
#
# cartopy is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option)... | [
2,
357,
34,
8,
3517,
12223,
15069,
2813,
532,
2864,
11,
3395,
4452,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
6383,
11081,
13,
198,
2,
198,
2,
6383,
11081,
318,
1479,
3788,
25,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
34... | 2.388686 | 3,288 |
from chartofaccount.models import Directorate
from main.models import Approval
| [
6738,
8262,
1659,
23317,
13,
27530,
1330,
44437,
198,
6738,
1388,
13,
27530,
1330,
20010,
2100,
628,
198
] | 4.5 | 18 |
from __future__ import print_function
import FWCore.ParameterSet.Config as cms
import FWCore.ParameterSet.VarParsing as VarParsing
process = cms.Process("Demo")
#prepare options
options = VarParsing.VarParsing("analysis")
options.register ('globalTag',
"auto:run2_data",
VarParsin... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
48849,
14055,
13,
36301,
7248,
13,
16934,
355,
269,
907,
198,
11748,
48849,
14055,
13,
36301,
7248,
13,
19852,
47,
945,
278,
355,
12372,
47,
945,
278,
198,
198,
14681,
796,
26... | 1.866325 | 3,314 |
# coding: utf8
# !/usr/env/python
from terrainbento import Basic
| [
2,
19617,
25,
3384,
69,
23,
198,
2,
5145,
14,
14629,
14,
24330,
14,
29412,
198,
198,
6738,
15510,
46119,
78,
1330,
14392,
628,
628
] | 2.76 | 25 |
from typing import List
import aiohttp
from dataclasses import dataclass
from tastyworks.models.order import Order, OrderPriceEffect
@dataclass
| [
6738,
19720,
1330,
7343,
198,
198,
11748,
257,
952,
4023,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
198,
6738,
25103,
5225,
13,
27530,
13,
2875,
1330,
8284,
11,
8284,
18124,
18610,
628,
198,
31,
19608,
330,
31172,
628,
... | 3.571429 | 42 |
""" This File contains the unit tests for the gip game """
import unittest
from game import gip
| [
37811,
770,
9220,
4909,
262,
4326,
5254,
329,
262,
308,
541,
983,
37227,
198,
11748,
555,
715,
395,
198,
6738,
983,
1330,
308,
541,
628
] | 3.88 | 25 |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from recipe_engine.types import freeze
DEPS = [
'depot_tools/bot_update',
'depot_tools/gclient',
'depot_tools/git',
'recipe_engine/context',
'rec... | [
198,
2,
15069,
1946,
383,
18255,
1505,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
198,
2,
1043,
287,
262,
38559,
24290,
2393,
13,
198,
198,
... | 2.52551 | 392 |
import pymongo
from luigi.configuration import get_config
config = get_config()
mongo = pymongo.MongoClient(
host=config['mongo']['host'],
port=config['mongo']['port'],
)
| [
11748,
279,
4948,
25162,
198,
6738,
300,
84,
25754,
13,
11250,
3924,
1330,
651,
62,
11250,
628,
198,
11250,
796,
651,
62,
11250,
3419,
628,
198,
76,
25162,
796,
279,
4948,
25162,
13,
44,
25162,
11792,
7,
198,
220,
220,
220,
2583,
28... | 2.541667 | 72 |
#!/usr/bin/env python3
# Start a server on `localhost:8080` that runs a command on every request and serves
# its output, or displays a more detailed 500 error message if the command fails.
# Essentially this is a lightweight version of CGI, I think.
import sys, subprocess
from http.server import BaseHTTPRequestHandl... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
7253,
257,
4382,
319,
4600,
36750,
25,
1795,
1795,
63,
326,
4539,
257,
3141,
319,
790,
2581,
290,
9179,
198,
2,
663,
5072,
11,
393,
11298,
257,
517,
6496,
5323,
4049,
3... | 3.339181 | 171 |
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QApplication, QMainWindow, QInputDialog
import numpy as np
import pluto as pl
util = pl.PlutoObject(None)
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
... | [
11748,
25064,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
14055,
11,
33734,
8205,
72,
11,
33734,
54,
312,
11407,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
54,
312,
11407,
1330,
1195,
23416,
11,
1195,
13383,
27703,
11,
1195,
20560,
4420... | 2.438596 | 171 |
"""
This package contains functions for enhancing different kinds of structures
(e.g. edges/membrane, blobs/nuclei, vessels) in images.
"""
# import sub-packages to support nested calls
from . import edge, shape
# list out things that are available for public use
__all__ = (
# sub-packages
'edge',
'shape',... | [
37811,
198,
1212,
5301,
4909,
5499,
329,
27496,
1180,
6982,
286,
8573,
198,
7,
68,
13,
70,
13,
13015,
14,
11883,
1671,
1531,
11,
698,
8158,
14,
77,
14913,
72,
11,
14891,
8,
287,
4263,
13,
198,
37811,
198,
2,
1330,
850,
12,
43789,
... | 3.295918 | 98 |
import re
| [
11748,
302,
628
] | 3.666667 | 3 |
import numpy as np
from scipy import sparse
import os
"""
NOTE
Format of the savings
NAME X_POS Y_POS HEIGHT(row) WIDTH(col)
"""
CUR_DIR = os.path.dirname(__file__)
| [
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
1330,
29877,
198,
11748,
28686,
198,
198,
37811,
198,
16580,
198,
26227,
286,
262,
10653,
198,
20608,
1395,
62,
37997,
575,
62,
37997,
11179,
9947,
7,
808,
8,
370,
2389,
4221,
7,... | 2.544118 | 68 |
"""
:mod:`redis_helpers` - Redis and other helper classes for the Bibliographic
Framework App
"""
__author__ = "Jeremy Nelson"
import csv
from aristotle.settings import REDIS_DATASTORE
def get_brief(**kwargs):
"""
Searches datastore and returns brief record from bibframe:CreativeWork,
bibfra... | [
37811,
201,
198,
1058,
4666,
25,
63,
445,
271,
62,
16794,
364,
63,
532,
2297,
271,
290,
584,
31904,
6097,
329,
262,
347,
29142,
6826,
201,
198,
25161,
2034,
201,
198,
37811,
201,
198,
834,
9800,
834,
796,
366,
35623,
12996,
1,
201,
... | 1.91617 | 2,350 |
import numpy as np
def centroid(points):
"""
Calculate the center of mass over a collection of points
:param points: The points, expressed as numpy.array
:type points: numpy.array
:return: The center of mass for the given points
:rtype: numpy.array
"""
com = np.mean(points, 0)
re... | [
11748,
299,
32152,
355,
45941,
628,
198,
4299,
1247,
3882,
7,
13033,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
27131,
378,
262,
3641,
286,
2347,
625,
257,
4947,
286,
2173,
628,
220,
220,
220,
1058,
17143,
2173,
25,
383,
2... | 2.564327 | 342 |
"""
"""
import sys
from typing import Tuple
from src.tree import Tree
from src.node import Node
import src.util as util
def minimize_nj_criterion(ft: Tree) -> Tuple[tuple, Node]:
"""Returns i,j for which d(i, j) - r(i) -r(j) is minimal and corresponding new node of merging i,j
Args:
ft (Tree): Tre... | [
37811,
198,
198,
37811,
198,
11748,
25064,
198,
198,
6738,
19720,
1330,
309,
29291,
198,
198,
6738,
12351,
13,
21048,
1330,
12200,
198,
6738,
12351,
13,
17440,
1330,
19081,
198,
11748,
12351,
13,
22602,
355,
7736,
628,
198,
4299,
17775,
... | 1.930884 | 1,143 |
import api_zoom
import random, os, time, pickle, sys, importlib
from datetime import datetime
import config
get = api_zoom.get
post_json = api_zoom.post_json
if __name__ == '__main__':
os.environ['PYTHONINSPECT'] = '1'
a = Avalon()
avalon_help()
| [
11748,
40391,
62,
89,
4207,
198,
11748,
4738,
11,
28686,
11,
640,
11,
2298,
293,
11,
25064,
11,
1330,
8019,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
4566,
198,
198,
1136,
796,
40391,
62,
89,
4207,
13,
1136,
198,
7353,
62... | 2.431193 | 109 |
import numpy as np
import numba
import scipy.sparse
from functools import wraps
from itertools import chain
from collections.abc import Iterable
from ._sparse_array import SparseArray
from ._utils import check_compressed_axes, normalize_axis, check_zero_fill_value
from ._umath import elemwise
from ._coo.common import... | [
11748,
299,
32152,
355,
45941,
198,
11748,
997,
7012,
198,
11748,
629,
541,
88,
13,
82,
29572,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
340,
861,
10141,
1330,
6333,
198,
6738,
17268,
13,
39305,
1330,
40806,
540,
198,
198,
... | 2.251762 | 10,923 |
from collections import defaultdict
from typing import Dict
from typing import List
import numpy as np
class ArrayStore:
"""Storage class for keeping track of arrays."""
class LiFoStack:
"""Last in first out stack for numpy ndarrays."""
| [
6738,
17268,
1330,
4277,
11600,
198,
6738,
19720,
1330,
360,
713,
198,
6738,
19720,
1330,
7343,
198,
198,
11748,
299,
32152,
355,
45941,
628,
198,
4871,
15690,
22658,
25,
198,
220,
220,
220,
37227,
31425,
1398,
329,
5291,
2610,
286,
265... | 3.521127 | 71 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat May 11 21:41:44 2019
@author: xiaodanchen
"""
from util_code import data_preprocessing
from util_code import lstm_train | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
7031,
1737,
1367,
2310,
25,
3901,
25,
2598,
13130,
198,
198,
31,
9800,
25,
2124,
544,
375... | 2.633803 | 71 |
import pytest
from schemathesis.stateful import ParsedData
from schemathesis.utils import NOT_SET
@pytest.mark.parametrize(
"parameters, body", (({"a": 1}, None), ({"a": 1}, NOT_SET), ({"a": 1}, {"value": 1}), ({"a": 1}, [1, 2, 3]))
)
| [
11748,
12972,
9288,
198,
198,
6738,
3897,
6759,
8497,
13,
5219,
913,
1330,
23042,
276,
6601,
198,
6738,
3897,
6759,
8497,
13,
26791,
1330,
5626,
62,
28480,
628,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7,
198,
220,
... | 2.494845 | 97 |
#(C) Copyright Syd Logan 2017-2020
#(C) Copyright Thousand Smiles Foundation 2017-2020
#
#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 req... | [
2,
7,
34,
8,
15069,
11415,
22221,
2177,
12,
42334,
198,
2,
7,
34,
8,
15069,
39255,
2439,
2915,
5693,
2177,
12,
42334,
198,
2,
198,
2,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,... | 3.62614 | 329 |
import numpy as np
import cv2
import glob
import imageio
connections = [
(0,1),
(0,2),
(3,5),
(4,6),
(5,7),
(6,8)
]
for txtfile in glob.glob("data/LH7/**/*.txt"):
fname = txtfile.split("/")[-1].split(".")[0]
folder = "/".join(txtfile.split("/")[:-1])
images = []
with open(txtfi... | [
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
11748,
15095,
198,
11748,
2939,
952,
198,
198,
8443,
507,
796,
685,
198,
220,
220,
220,
357,
15,
11,
16,
828,
198,
220,
220,
220,
357,
15,
11,
17,
828,
198,
220,
220,
... | 1.623663 | 1,496 |
from etldjango.settings import DEBUG
from .utiles import get_client_and_log_resource
import io
import logging
import json
client, _LOG_RESOURCE = get_client_and_log_resource()
| [
6738,
2123,
335,
73,
14208,
13,
33692,
1330,
16959,
198,
6738,
764,
315,
2915,
1330,
651,
62,
16366,
62,
392,
62,
6404,
62,
31092,
198,
11748,
33245,
198,
11748,
18931,
198,
11748,
33918,
628,
198,
16366,
11,
4808,
25294,
62,
19535,
3... | 3.314815 | 54 |