content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# Copyright (c) 2017 OpenStack Foundation
#
# 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,
357,
66,
8,
2177,
4946,
25896,
5693,
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,... | 3.424354 | 271 |
from __future__ import annotations
from typing import List
from reamber.quaver.QuaHit import QuaHit
from reamber.quaver.lists.notes.QuaNoteList import QuaNoteList
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
302,
7789,
13,
421,
8770,
13,
4507,
64,
17889,
1330,
2264,
64,
17889,
198,
6738,
302,
7789,
13,
421,
8770,
13,
20713,
13,
17815,
13,
4507,
64,
... | 3.32 | 50 |
"""
This module gathers all user-facing functions with a `load_` prefix.
"""
import os
import numpy as np
from more_itertools import always_iterable
from yt.config import ytcfg
from yt.funcs import issue_deprecation_warning, mylog
from yt.utilities.decompose import decompose_array, get_psize
from yt.utilities.excep... | [
37811,
198,
1212,
8265,
43609,
477,
2836,
12,
29532,
5499,
351,
257,
4600,
2220,
62,
63,
21231,
13,
198,
198,
37811,
198,
198,
11748,
28686,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
517,
62,
270,
861,
10141,
1330,
1464,
62,... | 2.444821 | 19,781 |
from sklearn.decomposition import PCA
from sklearn.neighbors import NearestCentroid
from sklearn import neighbors
from sklearn.cluster import KMeans
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np
from scipy.stats import mode
from sklearn.metrics import pairwise_distances_argmin
from sklea... | [
6738,
1341,
35720,
13,
12501,
296,
9150,
1330,
4217,
32,
198,
6738,
1341,
35720,
13,
710,
394,
32289,
1330,
3169,
12423,
19085,
3882,
198,
6738,
1341,
35720,
1330,
12020,
198,
6738,
1341,
35720,
13,
565,
5819,
1330,
509,
5308,
504,
198,... | 3.393939 | 132 |
#! /bin/env python
#
# Protein Engineering Analysis Tool Structure Analysis (PEATSA)
# Copyright (C) 2010 Michael Johnston & Jens Erik Nielsen
#
# Author: Michael Johnston
#
# 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
# th... | [
2,
0,
1220,
8800,
14,
24330,
21015,
198,
2,
198,
2,
31702,
14044,
14691,
16984,
32522,
14691,
357,
11401,
1404,
4090,
8,
198,
2,
15069,
357,
34,
8,
3050,
3899,
28972,
1222,
449,
641,
22722,
31154,
198,
2,
198,
2,
6434,
25,
3899,
2... | 2.732295 | 2,118 |
from pathlib import Path
from fhir.resources.codesystem import CodeSystem
from oops_fhir.utils import CodeSystemConcept
__all__ = ["v3MapRelationship"]
_resource = CodeSystem.parse_file(Path(__file__).with_suffix(".json"))
class v3MapRelationship:
"""
v3 Code System MapRelationship
The closeness or... | [
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
277,
71,
343,
13,
37540,
13,
40148,
6781,
1330,
6127,
11964,
198,
198,
6738,
267,
2840,
62,
69,
71,
343,
13,
26791,
1330,
6127,
11964,
3103,
984,
628,
198,
834,
439,
834,
796,
14631,
85... | 2.942333 | 763 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re
from rest_framework import serializers
from ZhiQue.utils.markdown import markdown_renderer, html_filter
from .relations import ArticleCategoryField
from .utils import truncate_content
from .models import Category, Article, Tag
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
302,
198,
198,
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
198,
6738,
1168,
5303,
15681,
13,
26791,
13,
4102,
2902,... | 3.392857 | 84 |
# coding: utf-8
import numpy as np
import os
import itertools
# data position
INPUT_DATA = r'.../'
file_list = []
count = 0
# go through all the subfolders and files
for parent, dir_names, file_names in sorted(os.walk(INPUT_DATA)):
for file_name in file_names:
file_list.append(file_name) # get the list... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
340,
861,
10141,
198,
198,
2,
1366,
2292,
198,
1268,
30076,
62,
26947,
796,
374,
6,
986,
14,
6,
198,
198,
7753,
62,
4868,
796,... | 2.380734 | 2,398 |
from sqlalchemy import Column, Table, Integer, String, MetaData
meta = MetaData()
users = Table('users', meta,
Column('id', Integer, primary_key=True),
Column('user', String(64)),
Column('salt', String(128)), #salt, should be random
Column('password', String(64)... | [
6738,
44161,
282,
26599,
1330,
29201,
11,
8655,
11,
34142,
11,
10903,
11,
30277,
6601,
628,
198,
28961,
796,
30277,
6601,
3419,
198,
18417,
796,
8655,
10786,
18417,
3256,
13634,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22... | 2.376623 | 154 |
# 583. Delete Operation for Two Strings | [
2,
642,
5999,
13,
23520,
14680,
329,
4930,
4285,
654
] | 3.9 | 10 |
"""Support for the Rhasspy Hermes protocol.
The Rhasspy Hermes protocol is an extension of the Snips Hermes protocol.
"""
import typing
from abc import ABCMeta
from dataclasses_json import DataClassJsonMixin, LetterCase, dataclass_json
@dataclass_json(letter_case=LetterCase.CAMEL)
class Message(DataClassJsonMixin, ... | [
37811,
15514,
329,
262,
10323,
562,
9078,
41167,
8435,
13,
198,
198,
464,
10323,
562,
9078,
41167,
8435,
318,
281,
7552,
286,
262,
5489,
2419,
41167,
8435,
13,
198,
37811,
198,
11748,
19720,
198,
6738,
450,
66,
1330,
9738,
48526,
198,
... | 2.273077 | 1,820 |
from django.urls import path
from cart.views import add_to_cart, remove_from_cart, CartView, decreaseCart
from . views import Home, ProductDetail
app_name= 'mainapp'
urlpatterns = [
path('', Home.as_view(), name='home'),
path('product/<slug>/', ProductDetail.as_view(), name='product'),
path('cart/', CartVi... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
6383,
13,
33571,
1330,
751,
62,
1462,
62,
26674,
11,
4781,
62,
6738,
62,
26674,
11,
13690,
7680,
11,
10070,
43476,
198,
6738,
764,
5009,
1330,
5995,
11,
8721,
11242,
603,
198,
... | 2.704082 | 196 |
#!/usr/bin/env python3
import time
import random
import hashlib
import os
import sys
import json
import argparse
from PIL import Image
from twisted.internet import reactor
from txzmq import ZmqEndpoint, ZmqEndpointType
from txzmq import ZmqFactory
from txzmq import ZmqSubConnection, ZmqPubConnection
sys.path.inser... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
640,
198,
11748,
4738,
198,
11748,
12234,
8019,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
33918,
198,
11748,
1822,
29572,
198,
198,
6738,
350,
4146,
1330,
7412,
1... | 2.37062 | 742 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-11-24 10:49
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
22,
319,
2177,
12,
1157,
12,
1731,
838,
25,
2920,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.736842 | 57 |
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 14 12:30:00 2019
@author: Aakash Hemadri
""" | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
26223,
1526,
1478,
1105,
25,
1270,
25,
405,
13130,
198,
198,
31,
9800,
25,
317,
461,
1077,
15617,
324,
380,
198,
37811
] | 2.3 | 40 |
# Copyright 2017 The Forseti Security 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 ap... | [
2,
15069,
2177,
383,
27325,
316,
72,
4765,
46665,
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,
2845,
287,
11... | 2.381513 | 2,207 |
import SQLite
import glob
for db_name in glob.glob("./dbs/saved/*.db"):
con = SQLite.connect(db_name)
update_database(con, db_name)
| [
11748,
16363,
578,
628,
198,
198,
11748,
15095,
198,
198,
1640,
20613,
62,
3672,
287,
15095,
13,
4743,
672,
7,
1911,
14,
67,
1443,
14,
82,
9586,
15211,
13,
9945,
1,
2599,
198,
220,
220,
220,
369,
796,
16363,
578,
13,
8443,
7,
9945... | 2.322581 | 62 |
"""
API generator for the BGAPI protocol using the bleapi.xml format.
"""
import sys
import argparse
import xml.dom.minidom
# Map "base" datatypes to struct specifiers
BASE_DATA_TYPE_TO_STRUCT = {
'int8': 'b',
'int16': 'h',
'uint8': 'B',
'uint16': 'H',
'uint32': 'I',
'bd_addr': '6s'
# u... | [
37811,
198,
17614,
17301,
329,
262,
34839,
17614,
8435,
1262,
262,
7245,
15042,
13,
19875,
5794,
13,
198,
37811,
198,
11748,
25064,
198,
11748,
1822,
29572,
198,
11748,
35555,
13,
3438,
13,
1084,
312,
296,
198,
198,
2,
9347,
366,
8692,
... | 2.478158 | 847 |
from __future__ import annotations
from collections import deque, defaultdict
from contextlib import contextmanager
from dataclasses import dataclass
from enum import Enum
from functools import lru_cache
from typing import Optional, Union, Literal, Dict, Generator, ClassVar
from rich.console import Console
from rich.... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
17268,
1330,
390,
4188,
11,
4277,
11600,
198,
6738,
4732,
8019,
1330,
4732,
37153,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
33829,
1330,
2039,
388,
198,
6738,
... | 3.668 | 250 |
import argparse
import platform
import pwd
from typing import Literal
import privacykpis.args
import privacykpis.browsers
import privacykpis.common
| [
11748,
1822,
29572,
198,
11748,
3859,
198,
11748,
279,
16993,
198,
6738,
19720,
1330,
25659,
1691,
198,
198,
11748,
6782,
74,
79,
271,
13,
22046,
198,
11748,
6782,
74,
79,
271,
13,
65,
8516,
364,
198,
11748,
6782,
74,
79,
271,
13,
1... | 3.355556 | 45 |
import os
from django.utils.functional import SimpleLazyObject
from django.contrib.auth.models import AnonymousUser
from django.contrib.auth import get_user_model as user_model
from common.utils import get_token
| [
11748,
28686,
198,
198,
6738,
42625,
14208,
13,
26791,
13,
45124,
1330,
17427,
43,
12582,
10267,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
19200,
12982,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
... | 3.583333 | 60 |
import cv2
import numpy as np
# import tensorflow as tf
from keras.models import Sequential, Model
from keras.layers import Lambda
from keras.layers import Cropping2D
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPooling2D, Convolution2D
from keras import backend as K
from keras.p... | [
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
2,
1330,
11192,
273,
11125,
355,
48700,
198,
6738,
41927,
292,
13,
27530,
1330,
24604,
1843,
11,
9104,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
21114,
6814,
198,
6738,
419... | 3.020075 | 2,391 |
#!/usr/bin/env python
# coding: utf-8
# # Environment Setup
# ## Once
# In[1]:
# Change output format
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
#InteractiveShell.ast_node_interactivity = "last_expr"
# Import packages
import warnings
import pandas as... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
1303,
9344,
31122,
198,
198,
2,
22492,
4874,
198,
198,
2,
554,
58,
16,
5974,
628,
198,
2,
9794,
5072,
5794,
198,
6738,
6101,
7535,
13... | 2.173348 | 9,305 |
import os
import subprocess
import sys
import getpass
from colorama import Fore, Back, Style
from subprocess import Popen, PIPE
import pwd, grp
import time
banner()
if not os.geteuid()==0:
sys.exit(f"{Fore.LIGHTRED_EX}This script must be run as root!{Style.RESET_ALL}")
print("0 - EXIT")
print("1 - ... | [
11748,
28686,
220,
198,
11748,
850,
14681,
220,
198,
11748,
25064,
220,
198,
11748,
651,
6603,
220,
198,
6738,
3124,
1689,
1330,
4558,
11,
5157,
11,
17738,
220,
198,
6738,
850,
14681,
1330,
8099,
268,
11,
350,
4061,
36,
198,
11748,
27... | 2.361905 | 525 |
"""BigQuery public API."""
from typing import Optional
import google.auth.credentials
import google.cloud.bigquery # noqa: F401, fail early if bigquery is missing
import pydata_google_auth
import ibis.common.exceptions as com
import ibis.config
from ibis.backends.base import BaseBackend
from ibis.config import opti... | [
37811,
12804,
20746,
1171,
7824,
526,
15931,
198,
198,
6738,
19720,
1330,
32233,
198,
198,
11748,
23645,
13,
18439,
13,
66,
445,
14817,
198,
11748,
23645,
13,
17721,
13,
14261,
22766,
220,
1303,
645,
20402,
25,
376,
21844,
11,
2038,
190... | 2.582227 | 979 |
# -*- coding: utf-8 -*-
# Copyright 1996-2015 PSERC. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# Copyright (c) 2016-2022 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
8235,
12,
4626,
6599,
47691,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
198,
2,
5964,
... | 2.361367 | 1,843 |
# AUTOGENERATED FILE! PLEASE DON'T EDIT
"""
This is for functions that cuts out specific parts of the table
"""
from typing import Callable, Union, List, overload, Iterator, Any, Set, Tuple
from k1lib.cli.init import BaseCli, Table, T, fastF
import k1lib.cli as cli
import k1lib, os, torch
from collections import deque
... | [
2,
47044,
7730,
1677,
1137,
11617,
45811,
0,
37795,
23917,
6,
51,
48483,
198,
37811,
198,
1212,
318,
329,
5499,
326,
6630,
503,
2176,
3354,
286,
262,
3084,
198,
37811,
198,
6738,
19720,
1330,
4889,
540,
11,
4479,
11,
7343,
11,
31754,
... | 2.568951 | 1,153 |
# pylint: disable=no-self-use
from typing import Dict, List, Callable
import logging
from overrides import overrides
from pytorch_pretrained_bert.tokenization import BertTokenizer
from allennlp.common.util import pad_sequence_to_length
from allennlp.data.vocabulary import Vocabulary
from allennlp.data.tokenizers.to... | [
198,
2,
279,
2645,
600,
25,
15560,
28,
3919,
12,
944,
12,
1904,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
11,
4889,
540,
198,
11748,
18931,
198,
198,
6738,
23170,
1460,
1330,
23170,
1460,
198,
198,
6738,
12972,
13165,
354,
62,
531... | 2.781384 | 2,095 |
# Generated by Django 3.2.4 on 2022-01-07 09:13
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
19,
319,
33160,
12,
486,
12,
2998,
7769,
25,
1485,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from pet import * | [
6738,
4273,
1330,
1635
] | 4.25 | 4 |
# -*- coding: utf-8 -*-
"""ZeroMQ implementations of the Plaso queue interface."""
import abc
import errno
import threading
import time
# The 'Queue' module was renamed to 'queue' in Python 3
try:
import Queue # pylint: disable=import-error
except ImportError:
import queue as Queue # pylint: disable=import-erro... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
28667,
49215,
25504,
286,
262,
1345,
292,
78,
16834,
7071,
526,
15931,
198,
198,
11748,
450,
66,
198,
11748,
11454,
3919,
198,
11748,
4704,
278,
198,
11748,
640,
... | 2.696884 | 9,564 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Open Education Polito.
#
# fare is free software; you can redistribute it and/or modify it under the
# terms of the MIT License; see LICENSE file for more details.
"""Searching class for revisioned records."""
from __future__ import absolute_import, print_function
from ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
34,
8,
13130,
4946,
7868,
7793,
78,
13,
198,
2,
198,
2,
14505,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
340,
73... | 2.766272 | 338 |
from __future__ import absolute_import, print_function, unicode_literals
import pytest
import entities
@pytest.mark.usefixtures("mock_etcd")
@pytest.mark.usefixtures("mock_etcd")
@pytest.mark.usefixtures("mock_etcd")
def test_after_get_no_frameset(frame_obj, test_db_cursor):
"""Ensure that the frame object ... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
3601,
62,
8818,
11,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
12972,
9288,
198,
198,
11748,
12066,
628,
198,
31,
9078,
9288,
13,
4102,
13,
1904,
69,
25506,
7203,
76,
735,
62,
3... | 2.762887 | 291 |
"""
>>> allure_report = getfixture('allure_report')
COUNT OF CASES AND GROUPS
>>> assert_that(allure_report,
... all_of(
... has_property('test_cases', has_length(10)),
... has_property('test_groups', has_length(0))
... )) # doctest: +SKIP
"""
import pytest
@p... | [
37811,
198,
33409,
477,
495,
62,
13116,
796,
651,
69,
9602,
10786,
439,
495,
62,
13116,
11537,
198,
198,
34,
28270,
3963,
35106,
1546,
5357,
10863,
2606,
3705,
198,
33409,
6818,
62,
5562,
7,
439,
495,
62,
13116,
11,
198,
986,
220,
2... | 2.018838 | 1,911 |
import os
import re
import requests
from game_controller import GameController
class YucataAuthenticatedNyiError(YucataAuthenticationError,
NotImplementedError):
"""Use this exception class at the beginning of methods that can't work
until we have a way to programmatically ... | [
11748,
28686,
198,
11748,
302,
198,
11748,
7007,
198,
198,
6738,
983,
62,
36500,
1330,
3776,
22130,
628,
198,
198,
4871,
575,
1229,
1045,
47649,
3474,
45,
48111,
12331,
7,
56,
1229,
1045,
47649,
3299,
12331,
11,
198,
220,
220,
220,
22... | 2.016949 | 2,065 |
import os
import pyfiglet
os.system("clear")
print(pyfiglet.figlet_format("Dust Gen"))
print("Dust Gen wordlist creator!")
print("Created by DaD")
print("(File name must be in .txt extension)")
file_name = input("Enter wordlist file name: ")
fhand = open(file_name,"w")
passwords = input("Enter password or (0) for end: ... | [
11748,
28686,
198,
11748,
12972,
5647,
1616,
198,
418,
13,
10057,
7203,
20063,
4943,
198,
4798,
7,
9078,
5647,
1616,
13,
5647,
1616,
62,
18982,
7203,
43767,
5215,
48774,
198,
4798,
7203,
43767,
5215,
1573,
4868,
13172,
2474,
8,
198,
479... | 2.884211 | 190 |
from cape import Cape, stringify
cape = Cape('ANY ENCRYPTION KEY', 'S')
# test
| [
6738,
36023,
1330,
15725,
11,
4731,
1958,
628,
198,
36435,
796,
15725,
10786,
31827,
412,
7792,
18276,
11571,
2849,
35374,
3256,
705,
50,
11537,
198,
198,
2,
1332,
628,
628
] | 2.833333 | 30 |
# Copyright (c) 2020 Dmitry Marakasov <amdmi3@amdmi3.ru>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | [
2,
15069,
357,
66,
8,
12131,
45181,
1526,
461,
292,
709,
1279,
28745,
11632,
18,
31,
28745,
11632,
18,
13,
622,
29,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
2,
... | 3.76435 | 331 |
#© 2017-2020, ETH Zurich, D-INFK, lubu@inf.ethz.ch
import ipfsapi
import re
from timeit import default_timer as timer
IPFS_ADDR_PATTERN = re.compile(".*(/ipfs/.*)/?")
if __name__ == '__main__':
storage = IPFSStorage(ip='35.159.23.185')
addr = storage.store_chunk("HelloChunk")
print addr
print stor... | [
2,
16224,
2177,
12,
42334,
11,
35920,
43412,
11,
360,
12,
1268,
26236,
11,
300,
549,
84,
31,
10745,
13,
2788,
89,
13,
354,
198,
198,
11748,
20966,
9501,
15042,
198,
11748,
302,
198,
6738,
640,
270,
1330,
4277,
62,
45016,
355,
19781,... | 2.391608 | 143 |
import pylab as pl
import numpy as np
n = 1024
X = np.random.normal(0, 1, n)
Y = np.random.normal(0, 1, n)
T = np.arctan2(Y,X)
pl.scatter(X, Y, s=75, c=T, alpha=.5)
pl.xlim(-1.5, 1.5)
pl.xticks(())
pl.ylim(-1.5, 1.5)
pl.yticks(())
pl.text(-0.05, 1.02, " Scatter Plot: pl.scatter(...)\n",
horizontalalignment='... | [
11748,
279,
2645,
397,
355,
458,
198,
11748,
299,
32152,
355,
45941,
198,
198,
77,
796,
28119,
198,
55,
796,
45941,
13,
25120,
13,
11265,
7,
15,
11,
352,
11,
299,
8,
198,
56,
796,
45941,
13,
25120,
13,
11265,
7,
15,
11,
352,
11,... | 2.094801 | 327 |
# Generated by Django 3.2.12 on 2022-03-29 00:31
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
1065,
319,
33160,
12,
3070,
12,
1959,
3571,
25,
3132,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.875 | 32 |
from __future__ import unicode_literals
from django.apps import AppConfig
| [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.619048 | 21 |
# !/usr/bin/env python
# encoding:UTF-8
from dynamic_preferences.preferences import UserPreference, GlobalPreference
from dynamic_preferences.types import *
from dynamic_preferences.registries import register
@register
@register
@register
class RegistrationAllowed(BooleanPreference, GlobalPreference):
"""
... | [
2,
5145,
14,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
48504,
12,
23,
198,
198,
6738,
8925,
62,
3866,
69,
4972,
13,
3866,
69,
4972,
1330,
11787,
6719,
4288,
11,
8060,
6719,
4288,
198,
6738,
8925,
62,
3866,
69,
4972,
13... | 2.87766 | 376 |
#$Id: pv.gb.cracks.py 408 2017-05-16 15:42:56Z mexas $
#
# pvbatch script to show threshold values, in this
# case cracks, i.e. cells with states between some
# lower and upper values.
#
# The script reads the raw binary file specified.
# The cracks are shown as surfaces with a uniform colour.
#
# Make sure to adjust t... | [
29953,
7390,
25,
279,
85,
13,
22296,
13,
6098,
4595,
13,
9078,
41247,
2177,
12,
2713,
12,
1433,
1315,
25,
3682,
25,
3980,
57,
502,
87,
292,
720,
198,
2,
198,
2,
279,
85,
43501,
4226,
284,
905,
11387,
3815,
11,
287,
428,
198,
2,
... | 2.550212 | 2,121 |
import librosa
import numpy as np
from scipy.io.wavfile import write as write_wav
| [
11748,
9195,
4951,
64,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
952,
13,
45137,
7753,
1330,
3551,
355,
3551,
62,
45137,
628,
198
] | 3 | 28 |
"""
Simple webVTT validation module based on https://github.com/w3c/webvtt.js
"""
from dataclasses import dataclass
import re
@dataclass
| [
37811,
198,
26437,
3992,
53,
15751,
21201,
8265,
1912,
319,
3740,
1378,
12567,
13,
785,
14,
86,
18,
66,
14,
12384,
85,
926,
13,
8457,
198,
37811,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
11748,
302,
198,
198,
31,
19... | 3 | 46 |
import unittest
from typing import NamedTuple, List, Type
from wasmer import Instance, ImportObject
from wasmer import Type
from loguru import logger
I32 = Type.I32
I64 = Type.I64
F32 = Type.F32
F64 = Type.F64
V128 = Type.V128
EXTERN_REF = Type.EXTERN_REF
FUNC_REF = Type.FUNC_REF
get_types = lambda x: list(map(lambd... | [
11748,
555,
715,
395,
198,
6738,
19720,
1330,
34441,
51,
29291,
11,
7343,
11,
5994,
198,
198,
6738,
373,
647,
1330,
2262,
590,
11,
17267,
10267,
198,
6738,
373,
647,
1330,
5994,
198,
6738,
2604,
14717,
1330,
49706,
198,
198,
40,
2624,... | 2.793651 | 315 |
#!/usr/bin/env python
from ansible_collections.terryhowe.hashivault.plugins.module_utils.hashivault import hashivault_argspec
from ansible_collections.terryhowe.hashivault.plugins.module_utils.hashivault import hashivault_auth_client
from ansible_collections.terryhowe.hashivault.plugins.module_utils.hashivault import h... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
9093,
856,
62,
4033,
26448,
13,
353,
563,
4919,
68,
13,
17831,
452,
1721,
13,
37390,
13,
21412,
62,
26791,
13,
17831,
452,
1721,
1330,
12234,
452,
1721,
62,
853,
16684,
198,
67... | 2.697039 | 439 |
import numpy as np
import smdebug
import torch
import torch.nn as nn
import torchvision
from smdebug import modes
from torchvision import models
# list of ordered tensor names
activation_outputs = [
#'relu_ReLU_output_0',
"layer1.0.relu_0_output_0",
"layer1.1.relu_0_output_0",
"layer2.0.relu_0_output_0... | [
11748,
299,
32152,
355,
45941,
198,
11748,
895,
24442,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
10178,
198,
6738,
895,
24442,
1330,
12881,
198,
6738,
28034,
10178,
1330,
4981,
198,
198,
2,
1351,
... | 2.171084 | 415 |
import requests
import json
result = ""
verbose = True
if __name__ == "__main__":
main(["localhost:8000"],"id -a") | [
11748,
7007,
201,
198,
11748,
33918,
201,
198,
201,
198,
20274,
796,
13538,
201,
198,
19011,
577,
796,
6407,
201,
198,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
201,
198,
220,
220,
220,
1388,
7,
14... | 2.529412 | 51 |
import sys
from getFile import getFile
from filter import Filter
from utils import dealArgs
from getPairs import getPairs
from db import connect_db, close_db, add_words, empty_table
def getAndFilter(options):
"""
Retrieves the files listed within options['files'] and filters them based on the other options[...... | [
11748,
25064,
198,
6738,
651,
8979,
1330,
651,
8979,
198,
6738,
8106,
1330,
25853,
198,
6738,
3384,
4487,
1330,
1730,
42035,
198,
6738,
651,
47,
3468,
1330,
651,
47,
3468,
198,
6738,
20613,
1330,
2018,
62,
9945,
11,
1969,
62,
9945,
11... | 2.764511 | 603 |
from W3.Reader import *
import cv2
import torch
class CustomTorchDataset:
"""Face Landmarks dataset."""
def __init__(self, gt_file, root_dir, transform=None):
"""
Args:
gt_file (string): Path to the file with annotations.
root_dir (string): Directory with all th... | [
6738,
370,
18,
13,
33634,
1330,
1635,
198,
11748,
269,
85,
17,
198,
11748,
28034,
198,
4871,
8562,
15884,
354,
27354,
292,
316,
25,
198,
220,
220,
220,
37227,
32388,
6379,
14306,
27039,
526,
15931,
628,
220,
220,
220,
825,
11593,
1500... | 2.286667 | 300 |
# util functions about data
from scipy.stats import rankdata, iqr, trim_mean
from sklearn.metrics import f1_score, mean_squared_error
import numpy as np
from numpy import percentile
# calculate F1 scores
| [
2,
7736,
5499,
546,
1366,
198,
198,
6738,
629,
541,
88,
13,
34242,
1330,
4279,
7890,
11,
1312,
80,
81,
11,
15797,
62,
32604,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
277,
16,
62,
26675,
11,
1612,
62,
16485,
1144,
62,
18224,
... | 3.285714 | 63 |
'''
Create ssh executor system
'''
# Import python libs
import os
import json
import getpass
# Import salt libs
import salt.ssh.shell
import salt.utils.thin
import salt.roster
import salt.state
import salt.loader
class SSH(object):
'''
Create an ssh execution system
'''
def get_pubkey(self):
... | [
7061,
6,
198,
16447,
26678,
3121,
273,
1080,
198,
7061,
6,
198,
2,
17267,
21015,
9195,
82,
198,
11748,
28686,
198,
11748,
33918,
198,
11748,
651,
6603,
198,
198,
2,
17267,
8268,
9195,
82,
198,
11748,
8268,
13,
45824,
13,
29149,
198,
... | 1.832877 | 5,840 |
# -*- coding: utf-8 -*-
import asyncio
import json
from aiohttp import web
from aiohttp_auth import auth
from ircb.storeclient import UserStore
from ircb.web.decorators import auth_required
from ircb.forms.user import UserForm
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
30351,
952,
198,
11748,
33918,
198,
198,
6738,
257,
952,
4023,
1330,
3992,
198,
6738,
257,
952,
4023,
62,
18439,
1330,
6284,
198,
198,
6738,
220,
1980,
65,
13,
... | 2.974359 | 78 |
from importlib import import_module
from aiogram.types import Message
from TelegramEDT import ADMIN_ID, dp, logger, modules_active
module_name = "modules"
logger = logger.getChild(module_name)
| [
6738,
1330,
8019,
1330,
1330,
62,
21412,
198,
198,
6738,
257,
72,
21857,
13,
19199,
1330,
16000,
198,
198,
6738,
50203,
1961,
51,
1330,
5984,
23678,
62,
2389,
11,
288,
79,
11,
49706,
11,
13103,
62,
5275,
198,
198,
21412,
62,
3672,
7... | 3.206349 | 63 |
# -*- coding: utf-8 -*-
from PyQt5 import QtCore, QtGui, QtWidgets
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
14055,
11,
33734,
8205,
72,
11,
33734,
54,
312,
11407,
628
] | 2.090909 | 33 |
#!/usr/bin/python3
print('model 1 print global')
if __name__ == "__main__":
print('model 1 main')
| [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
4798,
10786,
19849,
352,
3601,
3298,
11537,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
10786,
19849,
352,
1388,
11537,
628
] | 2.625 | 40 |
import gym
import nle
import numpy as np
from MyAgent import MyAgent
env = gym.make("NetHackScore-v0")
agent = MyAgent(env.observation_space, env.action_space)
score = []
env.seed(42)
for i in range(0, 20):
s = env.reset()
rewards = []
done = False
while not done:
a = agent.act(s)
s,... | [
11748,
11550,
198,
11748,
299,
293,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
2011,
36772,
1330,
2011,
36772,
198,
198,
24330,
796,
11550,
13,
15883,
7203,
7934,
32833,
26595,
12,
85,
15,
4943,
198,
198,
25781,
796,
2011,
36772,
7,... | 2.162584 | 898 |
import unittest
import select
import signal
import sys
import os
from test.test_support import run_unittest
if __name__ == "__main__":
test_main()
| [
11748,
555,
715,
395,
198,
11748,
2922,
198,
11748,
6737,
198,
11748,
25064,
198,
11748,
28686,
198,
6738,
1332,
13,
9288,
62,
11284,
1330,
1057,
62,
403,
715,
395,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
129... | 3.039216 | 51 |
# see https://www.codewars.com/kata/55ab4f980f2d576c070000f4/train/python
from TestFunction import Test
test = Test(None)
test.assert_equals(game(0), [0])
test.assert_equals(game(1), [1, 2])
test.assert_equals(game(2), [3, 2])
test.assert_equals(game(3), [9, 2])
test.assert_equals(game(4), [8])
test.assert_equa... | [
2,
766,
3740,
1378,
2503,
13,
19815,
413,
945,
13,
785,
14,
74,
1045,
14,
2816,
397,
19,
69,
40022,
69,
17,
67,
37452,
66,
2998,
2388,
69,
19,
14,
27432,
14,
29412,
198,
220,
220,
220,
220,
628,
198,
6738,
6208,
22203,
1330,
620... | 2.055556 | 252 |
from models.crfrnn_model import get_crfrnn_model_def
import utils
_INPUT_FILENAME = "image.jpg"
_OUTPUT_FILENAME = "labels.png"
# downloaded from https://goo.gl/ciEYZi
_MODEL_WEIGHTS = "crfrnn_keras_model.h5"
if __name__ == "__main__":
main()
| [
6738,
4981,
13,
6098,
8310,
20471,
62,
19849,
1330,
651,
62,
6098,
8310,
20471,
62,
19849,
62,
4299,
198,
11748,
3384,
4487,
198,
198,
62,
1268,
30076,
62,
46700,
1677,
10067,
796,
366,
9060,
13,
9479,
1,
198,
62,
2606,
7250,
3843,
... | 2.314815 | 108 |
import cv2
import numpy as np
import math
import matplotlib.pyplot as plt
import glob
from utilities import Utilities
# two levels of log_level = info, debug
# Note: roi_type = None is also permitted
# In that case, the image is not masked
if __name__ == "__main__":
ld = LaneDetection(LOG_LEVEL = 'IN... | [
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
15095,
198,
6738,
20081,
1330,
41086,
628,
220,
220,
220,
1303,
734,
2974,
286,
2604,
... | 2.711656 | 163 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# (c) 2016, Mario Santos <mario.rf.santos@gmail.com>
#
from __future__ import unicode_literals
import os
import sys
import logging
import re
import json
import requests
import argparse
import pyperclip
from lxml import html
from tabulate import tabulate
logging.basicC... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
198,
2,
357,
66,
8,
1584,
11,
10682,
28458,
1279,
3876,
952,
13,
41871,
13,
82,
415,
418,
31,
14816,
13,
... | 2.247318 | 3,263 |
def get_submission_karma_for_user(subreddit, user):
"""
Obtain submission karma for user in the specified subreddit
"""
karma = 0
submitted_posts = user.submissions.top('all')
for post in submitted_posts:
subreddit_name = post.subreddit.display_name
if subreddit_name == subr... | [
198,
4299,
651,
62,
7266,
3411,
62,
74,
10961,
62,
1640,
62,
7220,
7,
7266,
10748,
11,
2836,
2599,
628,
220,
220,
220,
37227,
198,
220,
220,
220,
1835,
3153,
14498,
31789,
329,
2836,
287,
262,
7368,
25163,
198,
220,
220,
220,
37227,... | 2.683603 | 433 |
import os
import subprocess
from scripts.test.shared import WASM_OPT, WASM_DIS, WASM_SHELL, NODEJS, run_process
from .utils import BinaryenTestCase
| [
11748,
28686,
198,
11748,
850,
14681,
198,
198,
6738,
14750,
13,
9288,
13,
28710,
1330,
21725,
44,
62,
3185,
51,
11,
21725,
44,
62,
26288,
11,
21725,
44,
62,
9693,
23304,
11,
399,
16820,
20120,
11,
1057,
62,
14681,
198,
6738,
764,
2... | 3.061224 | 49 |
from __future__ import unicode_literals
from statemachine import _Statemachine
from settings import NETWORK_ADAPTATER
from utils import utils
import subprocess
| [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
6738,
1185,
368,
20480,
1330,
4808,
17126,
368,
20480,
198,
6738,
6460,
1330,
49791,
62,
2885,
2969,
51,
23261,
198,
6738,
3384,
4487,
1330,
3384,
4487,
198,
11748,
850,
1... | 3.833333 | 42 |
"""
Copyright 2017 The Johns Hopkins University Applied Physics Laboratory LLC
and Andres Torrubia
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.or... | [
37811,
201,
198,
15269,
2177,
383,
25824,
21183,
2059,
27684,
23123,
18643,
11419,
201,
198,
392,
843,
411,
4022,
25089,
544,
201,
198,
3237,
2489,
10395,
13,
201,
198,
201,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,... | 2.264862 | 13,962 |
import prometheus_client
from prometheus_client.exposition import default_handler
from dagster import Field, check, resource
class PrometheusResource:
"""Integrates with Prometheus via the prometheus_client library."""
def push_to_gateway(self, job, grouping_key=None, handler=default_handler):
"""Pu... | [
11748,
1552,
36916,
62,
16366,
198,
6738,
1552,
36916,
62,
16366,
13,
1069,
9150,
1330,
4277,
62,
30281,
198,
198,
6738,
48924,
1706,
1330,
7663,
11,
2198,
11,
8271,
628,
198,
4871,
42696,
26198,
25,
198,
220,
220,
220,
37227,
34500,
... | 2.409605 | 2,124 |
#!/usr/bin/env python
import sys
from setuptools import setup
# To use a consistent encoding
from codecs import open
import os
from os import path
# Prepare and send a new release to PyPI
if "release" in sys.argv[-1]:
os.system("python setup.py sdist")
os.system("twine upload dist/*")
os.system("rm -rf dis... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
25064,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
2,
1675,
779,
257,
6414,
21004,
198,
6738,
40481,
82,
1330,
1280,
198,
11748,
28686,
198,
6738,
28686,
1330,
3108,
198,
198,
... | 2.647059 | 527 |
# -*- coding: utf-8 -*-
"""weather_predict.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/16B8oSf-qI2wee85XFbmPJBbwXHkXVUyu
"""
# Toy example of using a deep neural network to predict average temperature
# by month. Note that this is not any be... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
23563,
62,
79,
17407,
13,
541,
2047,
65,
198,
198,
38062,
4142,
7560,
416,
1623,
4820,
2870,
13,
198,
198,
20556,
2393,
318,
5140,
379,
198,
220,
220,
220,
3740... | 2.565041 | 492 |
import settings
import shutil
import os.path
import os
import sys
from tqdm import tqdm
import common.database as db
from sqlalchemy_continuum_vendored.utils import version_table
| [
198,
198,
11748,
6460,
198,
11748,
4423,
346,
198,
11748,
28686,
13,
6978,
198,
11748,
28686,
198,
11748,
25064,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
198,
11748,
2219,
13,
48806,
355,
20613,
198,
6738,
44161,
282,
26599... | 3.241379 | 58 |
import os
# abs path to this package
PACKAGE_PATH: str = os.path.dirname(os.path.abspath(__file__))
REPO_PATH: str = os.path.abspath(os.path.join(PACKAGE_PATH, '..'))
DATA_PATH: str = os.path.join(PACKAGE_PATH, 'data')
NLTK_DATA_PATH: str = os.path.join(DATA_PATH, 'nltk_data')
AGENCY_DATA_PATH: str = os.path.join(DATA... | [
11748,
28686,
198,
198,
2,
2352,
3108,
284,
428,
5301,
198,
47,
8120,
11879,
62,
34219,
25,
965,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
834,
7753,
834,
4008,
198,
2200,
16402,
62,
34219,
25... | 2.337931 | 145 |
import tensorflow as tf
import numpy as np
import struct
import os
from keras.preprocessing.image import img_to_array
from keras.preprocessing.image import load_img
import matplotlib.pyplot as plt
from matplotlib.pyplot import figure
from tensorflow.python.framework import tensor_util
figure(figsize=(8, 8), dpi=80)
... | [
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2878,
198,
11748,
28686,
198,
6738,
41927,
292,
13,
3866,
36948,
13,
9060,
1330,
33705,
62,
1462,
62,
18747,
198,
6738,
41927,
292,
13,
3866,
36948,
1... | 2.321881 | 553 |
import hnswlib
import numpy as np
import time
dim = 128
num_elements = 1000
M = 6
ef = 10
k = 10
nun_queries = 10
# Generating sample data
data = np.float32(np.random.random((num_elements, dim)))
# Split the data to batches of ten:
data_batches = [data[10*i:10*(i+1)] for i in range(num_elements//10)]
print("data_bat... | [
11748,
289,
77,
2032,
8019,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
640,
198,
198,
27740,
796,
13108,
198,
22510,
62,
68,
3639,
796,
8576,
198,
44,
796,
718,
198,
891,
796,
838,
198,
74,
796,
838,
198,
77,
403,
62,
421,
10... | 2.651438 | 1,182 |
"""
Configuration parameters
"""
MONGO_DB_STR = '' # CHANGE_THIS
SECRET_KEY = 'CHANGE_THIS' # CHANGE_THIS
| [
37811,
198,
38149,
10007,
198,
37811,
198,
198,
27857,
11230,
62,
11012,
62,
18601,
796,
10148,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
5870,
27746,
62,
43559,
198,
23683,
26087,
62,
20373,
796,
705,
3398,
27... | 2.259259 | 54 |
'''
Create cloudformation template for Anchore Engine ALB
'''
from troposphere import (
Sub, Ref, GetAtt, ImportValue,
Output, Export, Template, Parameter
)
from troposphere.elasticloadbalancingv2 import (
LoadBalancer, LoadBalancerAttributes,
Listener, TargetGroup, Action, Matcher,
TargetGroupAttri... | [
7061,
6,
198,
16447,
6279,
1161,
11055,
329,
29253,
382,
7117,
8355,
33,
198,
7061,
6,
198,
6738,
14673,
22829,
1330,
357,
198,
220,
220,
220,
3834,
11,
6524,
11,
3497,
8086,
11,
17267,
11395,
11,
198,
220,
220,
220,
25235,
11,
3647... | 1.884737 | 3,158 |
# -*- coding: utf-8 -*-
__all__ = [
'dynamic_calculation_setups',
'calculation_setups',
'config',
'convert_backend',
'Database',
'databases',
'DataStore',
'get_activity',
'geomapping',
'IndexManager',
'JsonWrapper',
'mapping',
'Method',
'methods',
'Normalizati... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
705,
67,
28995,
62,
9948,
14902,
62,
2617,
4739,
3256,
198,
220,
220,
220,
705,
9948,
14902,
62,
2617,
4739,
3256,
198,
... | 2.880131 | 609 |
###################################################################
# File Name: test_feeder.py
# Author: Zhongdao Wang
# mail: wcd17@mails.tsinghua.edu.cn
# Created Time: Thu 06 Sep 2018 04:09:46 PM CST
###################################################################
from __future__ import print_function
from __fu... | [
29113,
29113,
21017,
198,
2,
9220,
6530,
25,
1332,
62,
12363,
263,
13,
9078,
198,
2,
6434,
25,
10511,
506,
67,
5488,
15233,
198,
2,
6920,
25,
266,
10210,
1558,
31,
26165,
13,
912,
278,
33061,
13,
15532,
13,
31522,
198,
2,
15622,
3... | 2.349901 | 503 |
import functools
import io
import json
import os
from unittest import TestCase, mock
from primehub import PrimeHub, PrimeHubConfig, cli
from primehub.utils import create_logger
logger = create_logger('primehub-test')
class BaseTestCase(TestCase):
"""
A base test case which mocks out the low-level HTTP Clie... | [
11748,
1257,
310,
10141,
198,
11748,
33245,
198,
11748,
33918,
198,
11748,
28686,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
11,
15290,
198,
198,
6738,
6994,
40140,
1330,
5537,
16066,
11,
5537,
16066,
16934,
11,
537,
72,
198,
6738,
69... | 2.986014 | 143 |
import os
import jinja2
from flask import Blueprint, request, render_template
template_env = jinja2.Environment(loader=jinja2.FileSystemLoader(os.getcwd()))
algorithms_handler_bp = Blueprint('algorithms_handler', __name__)
def route_algorithms():
"""
**route_algorithms**
:return:
"""
# Load s... | [
11748,
28686,
198,
11748,
474,
259,
6592,
17,
198,
6738,
42903,
1330,
39932,
11,
2581,
11,
8543,
62,
28243,
198,
28243,
62,
24330,
796,
474,
259,
6592,
17,
13,
31441,
7,
29356,
28,
18594,
6592,
17,
13,
8979,
11964,
17401,
7,
418,
13... | 2.743865 | 652 |
# -*- coding: utf-8 -*-
from twisted.internet.protocol import Protocol, Factory, ClientFactory
from twisted.internet.protocol import DatagramProtocol as TwistedDatagram
from twisted.internet.address import IPv4Address
from twisted.internet.base import BaseConnector
from twisted.internet.defer import Deferred
f... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
201,
198,
6738,
19074,
13,
37675,
13,
11235,
4668,
1330,
20497,
11,
19239,
11,
20985,
22810,
201,
198,
6738,
19074,
13,
37675,
13,
11235,
4668,
1330,
220,
16092,
67... | 2.684361 | 3,843 |
import matplotlib
# matplotlib.use("Agg")
from sklearn.covariance import graphical_lasso
from sklearn import covariance
from profiler.utility import find_all_subsets, visualize_heatmap
from sksparse.cholmod import cholesky, analyze
from scipy import sparse
from copy import deepcopy
from profiler.graph import *
from sci... | [
11748,
2603,
29487,
8019,
198,
2,
2603,
29487,
8019,
13,
1904,
7203,
46384,
4943,
198,
6738,
1341,
35720,
13,
66,
709,
2743,
590,
1330,
27831,
62,
75,
28372,
198,
6738,
1341,
35720,
1330,
44829,
590,
198,
6738,
1534,
5329,
13,
315,
87... | 3.118421 | 152 |
# Generated by Django 2.2.16 on 2021-04-29 00:09
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
1433,
319,
33448,
12,
3023,
12,
1959,
3571,
25,
2931,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.875 | 32 |
#
# Data generator for training the SELDnet
#
import os
import numpy as np
import cls_feature_class
from IPython import embed
from collections import deque
import random
| [
2,
198,
2,
6060,
17301,
329,
3047,
262,
311,
24639,
3262,
198,
2,
198,
198,
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
537,
82,
62,
30053,
62,
4871,
198,
6738,
6101,
7535,
1330,
11525,
198,
6738,
17268,
1330,
390,
... | 3.659574 | 47 |
#!/usr/bin/env python
# process stdin into an M4 macro definition file
# recognize three keyword qgl qwgl qglX
#
# output
# global macros keep track of the three intervals for function types:
# gl_start gl_end wgl_start wgl_end glX_start glX_end
# NOTE: will we need similar thing for extensions?
#
# each function:
# f<... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
1429,
14367,
259,
656,
281,
337,
19,
15021,
6770,
2393,
198,
2,
7564,
1115,
21179,
10662,
4743,
10662,
86,
4743,
10662,
4743,
55,
198,
2,
198,
2,
5072,
198,
2,
3298,
34749,
1394,
... | 2.229481 | 597 |
"""Metadata linking the semantic meaning of FERC 1 row numbers across years."""
| [
37811,
9171,
14706,
17795,
262,
37865,
3616,
286,
376,
47691,
352,
5752,
3146,
1973,
812,
526,
15931,
198
] | 4.444444 | 18 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2020 LG Electronics Inc.
# SPDX-License-Identifier: Apache-2.0
import hashlib
import tlsh
from io import open
_EXCLUDE_TRUE_VALUE = "Exclude"
_TLSH_CHECKSUM_NULL = "0"
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
12131,
17370,
27828,
3457,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
... | 2.42268 | 97 |
#!/usr/bin/env python
"""
CDN are, sometimes, deployed on a specific subdomain. SubdomainDetection
plugin performs CDN detection by trying to access this specific subdomain and
by analyzing its DNS.
"""
from plugins.SubdomainDetection.behaviors import detect
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
8610,
45,
389,
11,
3360,
11,
12380,
319,
257,
2176,
850,
27830,
13,
3834,
27830,
11242,
3213,
198,
33803,
17706,
6458,
45,
13326,
416,
2111,
284,
1895,
428,
2176,
850,... | 3.838235 | 68 |
# -*- coding: utf-8 -*-
import Tkinter as tk
import random
from PIL import Image, ImageTk
from subprocess import call, PIPE
import os, os.path
IMAGES_DIR = os.path.join(os.path.dirname(__file__), "images")
MODE_MOTION_NAME = u"Тренировать движение" # train motion in Russian
MODE_CLICK_NAME = u"Тренировать клики" # t... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
309,
74,
3849,
355,
256,
74,
198,
11748,
4738,
198,
6738,
350,
4146,
1330,
7412,
11,
7412,
51,
74,
198,
6738,
850,
14681,
1330,
869,
11,
350,
4061,
36,
198,
1... | 2.12766 | 282 |
import functools, time, logging, sys
from flask import (
Blueprint, flash, g, redirect, render_template, request, session, url_for
)
from werkzeug.security import check_password_hash, generate_password_hash
from werkzeug.exceptions import abort
from inspect import getmembers
from pprint import pprint
from quiz.... | [
11748,
1257,
310,
10141,
11,
640,
11,
18931,
11,
25064,
198,
198,
6738,
42903,
1330,
357,
198,
220,
220,
220,
39932,
11,
7644,
11,
308,
11,
18941,
11,
8543,
62,
28243,
11,
2581,
11,
6246,
11,
19016,
62,
1640,
198,
8,
198,
6738,
26... | 3.20603 | 199 |
import requests
import sys
login_data = {'username':'','': ''}
with requests.Session(config)
| [
11748,
7007,
198,
11748,
25064,
198,
198,
38235,
62,
7890,
796,
1391,
6,
29460,
10354,
6,
3256,
7061,
25,
10148,
92,
198,
198,
4480,
7007,
13,
36044,
7,
11250,
8,
198
] | 3.064516 | 31 |
#!/usr/bin/env python3
from . import geometry
from . import math
from . import data
from . import comm
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
6738,
764,
1330,
22939,
198,
6738,
764,
1330,
10688,
198,
6738,
764,
1330,
1366,
198,
6738,
764,
1330,
725,
198
] | 3.433333 | 30 |
version = '1.8.0'
git_version = '24080398ff4793ed8aac028ffa4b714a4803d7fb'
| [
198,
9641,
796,
705,
16,
13,
23,
13,
15,
6,
198,
18300,
62,
9641,
796,
705,
16102,
1795,
31952,
487,
2857,
6052,
276,
23,
64,
330,
46957,
487,
64,
19,
65,
45722,
64,
22148,
18,
67,
22,
21855,
6,
198
] | 1.9 | 40 |
from collections import OrderedDict
del_attr = ["function", "module"]
| [
6738,
17268,
1330,
14230,
1068,
35,
713,
628,
198,
12381,
62,
35226,
796,
14631,
8818,
1600,
366,
21412,
8973,
198,
220,
220,
220,
220
] | 3.166667 | 24 |
from collections import defaultdict, deque
import erdos
import pylot.utils
from pylot.perception.messages import ObstacleTrajectoriesMessage
from pylot.perception.tracking.obstacle_trajectory import ObstacleTrajectory
class PerfectTrackerOperator(erdos.Operator):
"""Operator that gives past trajectories of other... | [
6738,
17268,
1330,
4277,
11600,
11,
390,
4188,
198,
11748,
1931,
37427,
198,
198,
11748,
279,
2645,
313,
13,
26791,
198,
6738,
279,
2645,
313,
13,
525,
4516,
13,
37348,
1095,
1330,
46378,
6008,
15721,
752,
1749,
12837,
198,
6738,
279,
... | 2.422287 | 682 |
coordinates_0000FF = ((143, 262),
(143, 263), (143, 264), (143, 265), (143, 266), (143, 269), (143, 274), (143, 276), (143, 284), (144, 258), (144, 259), (144, 260), (144, 261), (144, 262), (144, 263), (144, 264), (144, 265), (144, 266), (144, 267), (144, 268), (144, 269), (144, 273), (144, 277), (144, 278), (144, 27... | [
37652,
17540,
62,
2388,
5777,
796,
14808,
21139,
11,
35404,
828,
220,
220,
198,
7,
21139,
11,
39135,
828,
357,
21139,
11,
32158,
828,
357,
21139,
11,
32090,
828,
357,
21139,
11,
37737,
828,
357,
21139,
11,
38249,
828,
357,
21139,
11,
... | 2.385712 | 6,313 |
"""Pool exceptions."""
from __future__ import annotations
__all__ = [
"PoolError",
"PoolClosedError",
]
class PoolError(Exception):
"""Geneal pool exception."""
class PoolClosedError(PoolError):
"""Exception raised when an operation is done on a closed pool."""
| [
37811,
27201,
13269,
526,
15931,
198,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
366,
27201,
12331,
1600,
198,
220,
220,
220,
366,
27201,
2601,
1335,
12331,
1600,
198,
60,
628,
19... | 3.191011 | 89 |
radio.on_received_string(on_received_string)
noon = 0
clock = 0
radio.set_group(1)
clock = 1
noon = 8
basic.forever(on_forever)
| [
37004,
13,
261,
62,
47844,
62,
8841,
7,
261,
62,
47844,
62,
8841,
8,
201,
198,
201,
198,
6357,
796,
657,
201,
198,
15750,
796,
657,
201,
198,
37004,
13,
2617,
62,
8094,
7,
16,
8,
201,
198,
15750,
796,
352,
201,
198,
6357,
796,
... | 2.283333 | 60 |
#High level API
from .matmulConfig import MatmulConfig
from .mathsUtils import MathsUtils
| [
2,
11922,
1241,
7824,
198,
6738,
764,
6759,
76,
377,
16934,
1330,
6550,
76,
377,
16934,
198,
6738,
764,
11018,
82,
18274,
4487,
1330,
16320,
82,
18274,
4487,
198
] | 3.103448 | 29 |