content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from nb_autodoc.pycode.vcpicker import extract_all_comments, VariableCommentPicker
from nb_autodoc.pycode.overload import extract_all_overloads, OverloadPicker
| [
6738,
299,
65,
62,
2306,
375,
420,
13,
9078,
8189,
13,
85,
13155,
15799,
1330,
7925,
62,
439,
62,
15944,
11,
35748,
21357,
47,
15799,
198,
6738,
299,
65,
62,
2306,
375,
420,
13,
9078,
8189,
13,
2502,
2220,
1330,
7925,
62,
439,
62,... | 3.076923 | 52 |
# Auto generated by 'inv collect-airflow'
from airfly._vendor.airflow.models.baseoperator import BaseOperator
| [
2,
11160,
7560,
416,
705,
16340,
2824,
12,
958,
11125,
6,
198,
6738,
1633,
12254,
13557,
85,
18738,
13,
958,
11125,
13,
27530,
13,
8692,
46616,
1330,
7308,
18843,
1352,
628
] | 3.580645 | 31 |
from reportlab.pdfgen import canvas
from GridPdf.myfunc import *
from settings import Settings
# Create a canvas
setting = Settings()
cSpec = CanvasSpec(setting)
c = canvas.Canvas(cSpec.filename + '.pdf', cSpec.size)
# Main draw func with inputs (object, detailTF, canvas, color, lineWidth)
draw(cSpec, 1, c, setting.c... | [
6738,
989,
23912,
13,
12315,
5235,
1330,
21978,
198,
6738,
24846,
47,
7568,
13,
1820,
20786,
1330,
1635,
198,
6738,
6460,
1330,
16163,
198,
198,
2,
13610,
257,
21978,
198,
33990,
796,
16163,
3419,
198,
66,
22882,
796,
1680,
11017,
22882... | 2.905 | 200 |
# -*- coding: utf-8 -*-
#
import sys
import numpy
import pytest
import asciiplotlib as apl
@pytest.mark.skipif(
sys.stdout.encoding not in ["UTF-8", "UTF8"],
reason="Need UTF-8 terminal (not {})".format(sys.stdout.encoding),
)
@pytest.mark.skipif(
sys.stdout.encoding not in ["UTF-8", "UTF8"],
reas... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
11748,
25064,
198,
198,
11748,
299,
32152,
198,
11748,
12972,
9288,
198,
198,
11748,
355,
979,
24705,
313,
8019,
355,
257,
489,
628,
198,
31,
9078,
9288,
13,
4... | 2.387255 | 408 |
from django.contrib.auth import authenticate
from django.core.handlers.wsgi import WSGIRequest
from django.test import Client, RequestFactory, testcases
import ariadne
from graphql import ExecutionResult
from .settings import jwt_settings
from .shortcuts import get_token
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
8323,
5344,
198,
6738,
42625,
14208,
13,
7295,
13,
4993,
8116,
13,
18504,
12397,
1330,
25290,
18878,
18453,
198,
6738,
42625,
14208,
13,
9288,
1330,
20985,
11,
19390,
22810,
11,
1332,
... | 3.693333 | 75 |
import cv2
import argparse
from Retinaface.Retinaface import FaceDetector
from pathlib import Path
parser = argparse.ArgumentParser(description='take a picture')
parser.add_argument('--name', '-n', default='unknown', type=str, help='input the name of the recording person')
args = parser.parse_args()
save_path = Path(... | [
11748,
269,
85,
17,
198,
11748,
1822,
29572,
198,
6738,
4990,
1437,
2550,
13,
9781,
1437,
2550,
1330,
15399,
11242,
9250,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
7,
11213,
11639,
20... | 2.316667 | 540 |
import os, shutil, subprocess, signal, sys, cv2
stream_path = "video"
fps = 16
# ffmpeg stream command
raw_command = "ffmpeg -protocol_whitelist file,udp,rtp -i sololink.sdp -y -vf fps=" + str(fps) + " -f image2 " + stream_path + "/img%09d.bmp"
if __name__ == "__main__":
# empty stream directory contents
i... | [
11748,
28686,
11,
4423,
346,
11,
850,
14681,
11,
6737,
11,
25064,
11,
269,
85,
17,
198,
198,
5532,
62,
6978,
796,
366,
15588,
1,
198,
29647,
796,
1467,
198,
198,
2,
31246,
43913,
4269,
3141,
198,
1831,
62,
21812,
796,
366,
487,
43... | 2.162362 | 542 |
# Generated by Django 3.1.6 on 2021-09-04 07:55
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
21,
319,
33448,
12,
2931,
12,
3023,
8753,
25,
2816,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | [
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,... | 3.696203 | 237 |
from concurrent import futures
import time
import grpc
import hashtag_pb2
import hashtag_pb2_grpc
import redis
import os
r = redis.Redis(host=os.environ['REDIS_HOST_URL'], port=6379, db=0, charset="utf-8", decode_responses=True)
_ONE_DAY_IN_SECONDS = 60 * 60 * 24
if __name__ == '__main__':
serve()
| [
6738,
24580,
1330,
25650,
198,
198,
11748,
640,
198,
11748,
1036,
14751,
198,
11748,
23950,
62,
40842,
17,
198,
11748,
23950,
62,
40842,
17,
62,
2164,
14751,
198,
11748,
2266,
271,
198,
11748,
28686,
198,
198,
81,
796,
2266,
271,
13,
... | 2.561983 | 121 |
#!/usr/bin/python
import argparse
import sys
import suds
import re
from suds.client import Client
import numpy as np
import pandas as pd
import time
import requests
from urllib.request import urlretrieve
from urllib.parse import quote
import socket
from collections import Counter
import plotly.express as px
start_time... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
11748,
1822,
29572,
198,
11748,
25064,
198,
11748,
424,
9310,
198,
11748,
302,
198,
6738,
424,
9310,
13,
16366,
1330,
20985,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279... | 3.51341 | 261 |
#!/usr/bin/env python
"""
Riverbed Community Toolkit
NetIM - Synthetic Test
Script: Chrome-open-url-generic.py
Application: Chrome
Simple generic script that automates the Chrome browser on a windows machine to navigate to a page
The URL of the page to naviage must be passed in parameters
Usage:
pyth... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
201,
198,
37811,
201,
198,
42204,
3077,
8108,
16984,
15813,
201,
198,
7934,
3955,
532,
26375,
6587,
6208,
201,
198,
201,
198,
7391,
25,
13282,
12,
9654,
12,
6371,
12,
41357,
13,
9078,
201,
... | 2.588859 | 377 |
from typing import Any
import pytest
from async_rx import Observer, rx_filter
from ..model import ObserverCounterCollector
from .model import get_observable
@pytest.mark.curio
| [
6738,
19720,
1330,
4377,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
30351,
62,
40914,
1330,
27058,
11,
374,
87,
62,
24455,
198,
198,
6738,
11485,
19849,
1330,
27058,
31694,
31337,
273,
198,
6738,
764,
19849,
1330,
651,
62,
672,
3168,... | 3.415094 | 53 |
import os
import re
from setuptools import setup, find_packages
__version__ = None
with open('pl/__init__.py') as f:
exec(f.read())
if "VERSION" in os.environ:
if os.environ["VERSION"]:
__version__ = os.environ["VERSION"]
# Convert version from Semantic Version into PEP 440
pattern = re.compile(r"""... | [
11748,
28686,
198,
11748,
302,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
834,
9641,
834,
796,
6045,
198,
4480,
1280,
10786,
489,
14,
834,
15003,
834,
13,
9078,
11537,
355,
277,
25,
198,
220,
220,
220,
... | 2.53252 | 492 |
#!/usr/bin/env python3
#
# Electron Cash - A Bitcoin Cash SPV Wallet
#
# This file Copyright (C) 2019 Calin Culianu <calin.culianu@gmail.com>
# License: MIT License
#
import time
import threading
import queue
import weakref
import math
from collections import defaultdict
from .util import PrintError, print_error
class... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
198,
2,
5903,
1313,
16210,
532,
317,
6185,
16210,
6226,
53,
37249,
198,
2,
198,
2,
770,
2393,
15069,
357,
34,
8,
13130,
2199,
259,
32559,
666,
84,
1279,
9948,
259,
13,
3129,... | 3.225052 | 1,453 |
from base import *
import imp
#
# Sample cloud settings (for OpenShift)
# See https://github.com/openshift/django-example
#
# Turn off debug
DEBUG = False
if not DEBUG:
ALLOWED_HOSTS = [
# IMPORTANT: See https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
'status.aksalj.me'
]
#... | [
6738,
2779,
1330,
1635,
198,
11748,
848,
198,
2,
198,
2,
27565,
6279,
6460,
357,
1640,
4946,
33377,
8,
198,
2,
4091,
3740,
1378,
12567,
13,
785,
14,
44813,
29323,
14,
28241,
14208,
12,
20688,
198,
2,
198,
198,
2,
6756,
572,
14257,
... | 2.398844 | 519 |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import email.mime.multipart
import email.mime.text
import logging
import os.path
import pickle
import re
import smtplib
import subprocess
import sys
from datetime import datetime, timedelta
from phabricator import Phabricator
# Setting up a ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
1822,
29572,
198,
11748,
3053,
13,
76,
524,
13,
16680,
541,
433,
198,
11748,
3053,
13,
76,
524,
13,
5239,
198,
11... | 2.881874 | 491 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | [
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
220,
220,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
921,
743,
7330,
198,
2,
220,
220,
... | 2.541667 | 1,584 |
"""
.. _configurations:
Advanced Configurations
=======================
Defining Parameter Spaces
-------------------------
Optuna supports five kinds of parameters.
.. code-block:: python
def objective(trial):
# Categorical parameter
optimizer = trial.suggest_categorical('optimizer', ['Momentu... | [
37811,
198,
492,
4808,
11250,
20074,
25,
198,
198,
28809,
17056,
20074,
198,
4770,
1421,
18604,
198,
198,
7469,
3191,
25139,
2357,
48086,
198,
22369,
12,
198,
198,
27871,
9613,
6971,
1936,
6982,
286,
10007,
13,
198,
198,
492,
2438,
12,
... | 2.810139 | 1,006 |
import logging
import enum
import soco
from soco_plugin.message import Command as Parent
from soco_plugin.command import Mixin
class Command(Parent):
"""
>>> import home
>>> import soco_plugin
>>> cmd = soco_plugin.command.volume.ramp.Command.make(["Bath"])
>>> old_state = home.appliance.sound.p... | [
11748,
18931,
198,
11748,
33829,
198,
198,
11748,
1307,
78,
198,
6738,
1307,
78,
62,
33803,
13,
20500,
1330,
9455,
355,
16774,
198,
6738,
1307,
78,
62,
33803,
13,
21812,
1330,
15561,
259,
628,
198,
4871,
9455,
7,
24546,
2599,
198,
220... | 2.363402 | 388 |
from functools import wraps
import strongr.restdomain.model.gateways
# oauth2 lib does not support namespaces so we need a hack
# https://github.com/lepture/flask-oauthlib/issues/180
| [
6738,
1257,
310,
10141,
1330,
27521,
198,
11748,
1913,
81,
13,
2118,
27830,
13,
19849,
13,
10494,
1322,
198,
198,
2,
267,
18439,
17,
9195,
857,
407,
1104,
3891,
43076,
523,
356,
761,
257,
8156,
198,
2,
3740,
1378,
12567,
13,
785,
14... | 3.172414 | 58 |
import torch
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection
| [
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
2603,
29487,
8019,
13,
4033,
26448,
1330,
6910,
36307,
628,
628,
628
] | 3.529412 | 34 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
__version__ = '0.13.1'
| [
6738,
11593,
37443,
834,
1330,
357,
48546,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
28000,
1098,
62,
17201... | 2.216667 | 60 |
/*
Copyright 2016 BitTorrent 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 agreed to in writing, software
dist... | [
15211,
198,
15269,
1584,
4722,
39286,
3457,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
5832,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
1639,
7... | 2.235604 | 2,848 |
#!/usr/bin/env python3
import sys
import math
import pprint
import os
import re
import doctest
import itertools
import types
import logging
from collections import deque
from collections import defaultdict
#import networkx as nx
from copy import deepcopy
try:
import matplotlib.pyplot as plt
except ImportError:
p... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
25064,
198,
11748,
10688,
198,
11748,
279,
4798,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
10412,
395,
198,
11748,
340,
861,
10141,
198,
11748,
3858,
198,
11748,
18... | 2.050661 | 908 |
from rest_framework import routers
from .api import (
ClassroomViewSet, CurrentFacilityViewSet, DeviceOwnerViewSet, FacilityUserViewSet, FacilityViewSet, LearnerGroupViewSet, MembershipViewSet, RoleViewSet,
SessionViewSet
)
router = routers.SimpleRouter()
router.register(r'facilityuser', FacilityUserViewSet)... | [
6738,
1334,
62,
30604,
1330,
41144,
198,
198,
6738,
764,
15042,
1330,
357,
198,
220,
220,
220,
5016,
3823,
7680,
7248,
11,
9236,
47522,
879,
7680,
7248,
11,
16232,
42419,
7680,
7248,
11,
29118,
12982,
7680,
7248,
11,
29118,
7680,
7248,
... | 3.198381 | 247 |
from django.contrib import admin
from books.models import Author, Book, PublicationLanguage
admin.site.register(Author)
admin.site.register(PublicationLanguage)
admin.site.register(Book)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
3835,
13,
27530,
1330,
6434,
11,
4897,
11,
45065,
32065,
198,
198,
28482,
13,
15654,
13,
30238,
7,
13838,
8,
198,
28482,
13,
15654,
13,
30238,
7,
15202,
341,
32065,
8,
... | 3.634615 | 52 |
__version__ = "2.1.0"
__MODEL_HUB_ORGANIZATION__ = 'sentence-transformers'
from .datasets import SentencesDataset, ParallelSentencesDataset
from .LoggingHandler import LoggingHandler
from .SentenceTransformer import SentenceTransformer
from .readers import InputExample
from .cross_encoder.CrossEncoder import Cros... | [
834,
9641,
834,
796,
366,
17,
13,
16,
13,
15,
1,
201,
198,
834,
33365,
3698,
62,
39,
10526,
62,
1581,
45028,
14887,
6234,
834,
796,
705,
34086,
594,
12,
35636,
364,
6,
201,
198,
6738,
764,
19608,
292,
1039,
1330,
11352,
3007,
2735... | 3.132075 | 106 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import uuid
| [
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,
198,
11748,
334,
27112,
628
] | 2.902439 | 41 |
"""Golden tests cases for testing illegal tags."""
from liquid.golden.case import Case
cases = [
Case(
description="unknown tag",
template=r"{% nosuchthing %}",
expect="",
error=True,
strict=True,
),
Case(
description="no addition operator",
template... | [
37811,
32378,
5254,
2663,
329,
4856,
5293,
15940,
526,
15931,
198,
198,
6738,
8122,
13,
24267,
268,
13,
7442,
1330,
8913,
198,
198,
33964,
796,
685,
198,
220,
220,
220,
8913,
7,
198,
220,
220,
220,
220,
220,
220,
220,
6764,
2625,
34... | 2.117166 | 367 |
from abc import ABCMeta
class ApiModel(metaclass=ABCMeta):
"""Abstract class for defining a new API object"""
| [
6738,
450,
66,
1330,
9738,
48526,
628,
198,
4871,
5949,
72,
17633,
7,
4164,
330,
31172,
28,
24694,
48526,
2599,
198,
220,
220,
220,
37227,
23839,
1398,
329,
16215,
257,
649,
7824,
2134,
37811,
198
] | 3.314286 | 35 |
#!/usr/bin/env python
__author__ = 'Sergei F. Kliver'
import argparse
from RouToolPa.Collections.General import IdList
#from RouToolPa.Tools.Abstract import Tool
#from RouToolPa.Routines import NCBIRoutines
from RouToolPa.Tools.LinuxTools import Axel
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
834,
9800,
834,
796,
705,
7089,
469,
72,
376,
13,
14770,
1428,
6,
198,
11748,
1822,
29572,
198,
6738,
13876,
25391,
28875,
13,
5216,
26448,
13,
12218,
1330,
5121,
8053,
628,
198,
2,
... | 2.507485 | 668 |
"""Describe overall framework configuration."""
import os
import pytest
from kubernetes.config.kube_config import KUBE_CONFIG_DEFAULT_LOCATION
from settings import DEFAULT_IMAGE, DEFAULT_PULL_POLICY, DEFAULT_IC_TYPE, DEFAULT_SERVICE
def pytest_addoption(parser) -> None:
"""Get cli-arguments.
:param parser:... | [
37811,
24564,
4892,
4045,
9355,
8398,
526,
15931,
198,
198,
11748,
28686,
198,
11748,
12972,
9288,
198,
198,
6738,
479,
18478,
3262,
274,
13,
11250,
13,
74,
3266,
62,
11250,
1330,
509,
10526,
36,
62,
10943,
16254,
62,
7206,
38865,
62,
... | 2.319953 | 847 |
#!/usr/bin/env python
import os
import requests
import json
import ConfigParser
config = ConfigParser.ConfigParser()
config.read('local_settings.cfg')
dictionary = {'baseURL': config.get('ArchivesSpace', 'baseURL'), 'repository':config.get('ArchivesSpace', 'repository'), 'user': config.get('ArchivesSpace', 'user'), '... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
28686,
198,
11748,
7007,
198,
11748,
33918,
198,
11748,
17056,
46677,
198,
198,
11250,
796,
17056,
46677,
13,
16934,
46677,
3419,
198,
11250,
13,
961,
10786,
12001,
62,
33692,
... | 2.892057 | 491 |
from tests.utils import W3CTestCase
| [
6738,
5254,
13,
26791,
1330,
370,
18,
4177,
395,
20448,
628
] | 3.363636 | 11 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
| [
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,
198,
6738,
42625,
14208,
13,
10414,
1330,
... | 3.111111 | 45 |
__author__ = "David Adrian"
__copyright__ = "Copyright 2017, AI Research, Data Technology Centre, Volkswagen Group"
__credits__ = ["David Adrian, Richard Kurle"]
__license__ = "MIT"
__maintainer__ = "David Adrian"
| [
834,
9800,
834,
796,
366,
11006,
21462,
1,
198,
834,
22163,
4766,
834,
796,
366,
15269,
2177,
11,
9552,
4992,
11,
6060,
8987,
9072,
11,
32991,
4912,
1,
198,
834,
66,
20696,
834,
796,
14631,
11006,
21462,
11,
6219,
18132,
293,
8973,
... | 3.451613 | 62 |
# coding=utf-8
# Author: Li xinming
# coding=utf-8
from math import log10
from math import pow
from operator import attrgetter
from random import choice
from random import random
from random import sample
from sys import argv
# save_out = stdout
# 输出重定向至指定的文件中,便于查看
# file_obj = open('out.txt', 'w+')
# stdout = file... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
6434,
25,
220,
220,
7455,
2124,
259,
2229,
198,
2,
19617,
28,
40477,
12,
23,
198,
6738,
10688,
1330,
2604,
940,
198,
6738,
10688,
1330,
7182,
198,
6738,
10088,
1330,
708,
81,
1136,
353,
198,
67... | 1.909379 | 2,836 |
import numpy as np
import networkx as nx
import pickle
from graphik.graphs.graph_base import RobotPlanarGraph
from graphik.robots.robot_base import RobotPlanar
from graphik.utils.utils import list_to_variable_dict, make_save_string
from graphik.utils.experiments import (
run_multiple_experiments,
process_exper... | [
11748,
299,
32152,
355,
45941,
198,
11748,
3127,
87,
355,
299,
87,
198,
11748,
2298,
293,
198,
198,
6738,
4823,
1134,
13,
34960,
82,
13,
34960,
62,
8692,
1330,
16071,
20854,
283,
37065,
198,
6738,
4823,
1134,
13,
22609,
1747,
13,
305,... | 2.211224 | 2,263 |
import telebot
from config import keys, TOKEN
from utils import CryptoConverter, ConvertionException
bot = telebot.TeleBot (TOKEN)
@bot.message_handler(commands=['start', 'help'])
@bot.message_handler(commands=['values'])
@bot.message_handler(content_types=['text', ])
@bot.message_handler(content_typ... | [
11748,
5735,
13645,
201,
198,
6738,
4566,
1330,
8251,
11,
5390,
43959,
201,
198,
6738,
3384,
4487,
1330,
36579,
3103,
332,
353,
11,
38240,
295,
16922,
201,
198,
201,
198,
13645,
796,
5735,
13645,
13,
31709,
20630,
357,
10468,
43959,
8,
... | 2.677632 | 152 |
from setuptools import setup
setup(
name='N th Fibonacci Number',
version='1.0',
description='This program provides nth fibonacci number.',
author='Lalit Bangad, Anirudh Pande, Pratyush Vaidya',
author_email='llbangad@ncsu.edu, apande@ncsu.edu,pavaidya@ncsu.edu',
url='https://github.com/lalit10... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
45,
294,
41566,
261,
44456,
7913,
3256,
198,
220,
220,
220,
2196,
11639,
16,
13,
15,
3256,
198,
220,
220,
220,
6764,
11639,
1212,
1430,
3769,
... | 2.505618 | 267 |
import pytest
import numpy as np
import scanpy as sc
@pytest.mark.parametrize(
"method",
["t-test", "logreg"],
)
| [
11748,
12972,
9288,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
9367,
9078,
355,
629,
628,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7,
198,
220,
220,
220,
366,
24396,
1600,
198,
220,
220,
220,
14631,
83,
12... | 2.403846 | 52 |
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
from tensorflow.compat.v1 import keras
# from tensorflow.compat.v1. keras.datasets import mnist
# from tensorflow.compat.v1.keras.datasets import fashion_mnist
# from tensorflow.compat.v1.keras.datasets import cifar10
from tensorflow.compat.v1.keras import ba... | [
198,
11748,
11192,
273,
11125,
13,
5589,
265,
13,
85,
16,
355,
48700,
198,
27110,
13,
40223,
62,
85,
17,
62,
46571,
3419,
198,
198,
6738,
11192,
273,
11125,
13,
5589,
265,
13,
85,
16,
1330,
41927,
292,
198,
2,
422,
11192,
273,
111... | 2.84492 | 187 |
from random import randint
import numpy as np
import matplotlib.pyplot as plt
if __name__ == "__main__":
Menu() | [
6738,
4738,
1330,
43720,
600,
198,
11748,
299,
32152,
355,
45941,
220,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
628,
220,
220,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,... | 2.75 | 44 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from ..standard.default import schedule as base_schedule
| [
2,
15069,
357,
66,
8,
5413,
10501,
13,
198,
2,
49962,
739,
262,
17168,
5964,
13,
198,
198,
6738,
11485,
20307,
13,
12286,
1330,
7269,
355,
2779,
62,
15952,
5950,
198
] | 4.225806 | 31 |
# import pickle untuk membaca model yang disimpan
import pickle
# import sklearn untuk menggunakan algoritma KNN
from sklearn.preprocessing import StandardScaler
from sklearn.neighbors import KNeighborsClassifier
# import Flask untuk membuat web server
from flask import Flask, render_template, request
# buat objek F... | [
2,
1330,
2298,
293,
1418,
2724,
1066,
65,
22260,
2746,
331,
648,
595,
320,
6839,
198,
11748,
2298,
293,
198,
198,
2,
1330,
1341,
35720,
1418,
2724,
1450,
1130,
403,
461,
272,
435,
7053,
270,
2611,
509,
6144,
198,
6738,
1341,
35720,
... | 2.896774 | 310 |
"""
This tutorial shows you how to use a data recorder to record some data for
imitation learning for instance and how to load the data again. Or replay some
episodes.
"""
from causal_world.envs.causalworld import CausalWorld
from causal_world.task_generators.task import generate_task
from causal_world.loggers.data_re... | [
37811,
198,
1212,
11808,
2523,
345,
703,
284,
779,
257,
1366,
38156,
284,
1700,
617,
1366,
329,
198,
320,
3780,
4673,
329,
4554,
290,
703,
284,
3440,
262,
1366,
757,
13,
1471,
24788,
617,
198,
538,
8052,
13,
198,
37811,
198,
6738,
2... | 3.531915 | 141 |
from django.core.files.storage import Storage
from fdfs_client.client import Fdfs_client
from django.conf import settings
class FastDFSStorage(Storage):
"""自定义文件存储系统"""
def _open(self, name, mode='rb'):
"""打开文件时会自动调用的方法
因为这个类是实现存储,不涉及到文件的打开,所以这个方法用不到,但是,必须文档告诉我必须实现,所以pass
"""
... | [
6738,
42625,
14208,
13,
7295,
13,
16624,
13,
35350,
1330,
20514,
198,
6738,
277,
7568,
82,
62,
16366,
13,
16366,
1330,
376,
7568,
82,
62,
16366,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
628,
198,
4871,
12549,
8068,
50,
31425,
7... | 1.234783 | 1,380 |
import numpy as np
import gym
from gym.agents.base import BaseAgent
if __name__ == '__main__':
_test_env()
| [
11748,
299,
32152,
355,
45941,
198,
198,
11748,
11550,
198,
6738,
11550,
13,
49638,
13,
8692,
1330,
7308,
36772,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
4808,
9288,
62,
24330,
3419,
... | 2.761905 | 42 |
from django.test import client
from django.urls import URLPattern
from .enums import HttpMethod
from .helpers import reverse_url
PUBLIC_ENDPOINTS: dict[str, tuple] = {
"admin": HttpMethod.safe_methods(),
}
ACCEPTABLE_PUBLIC_ENDPOINT_STATUSES: set[int] = {
200,
400,
404,
405,
}
ACCEPTABLE_AUTHENTI... | [
6738,
42625,
14208,
13,
9288,
1330,
5456,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
10289,
47546,
198,
198,
6738,
764,
268,
5700,
1330,
367,
29281,
17410,
198,
6738,
764,
16794,
364,
1330,
9575,
62,
6371,
198,
198,
5105,
32936,
62,
... | 2.357143 | 154 |
#%%
import pandas as pd
folders = ['2021-04-04_REL606_glucose_growth',
'2021-04-27_REL606_acetate_growth']
dfs = []
for i, f in enumerate(folders):
data = pd.read_csv(f'../../../data/growth_curves/{f}/processed/{f}.csv')
dfs.append(data)
data = pd.concat(dfs, sort=False)
if 'time_idx' in data.keys... | [
2,
16626,
198,
11748,
19798,
292,
355,
279,
67,
220,
198,
198,
11379,
364,
796,
37250,
1238,
2481,
12,
3023,
12,
3023,
62,
16448,
33206,
62,
4743,
1229,
577,
62,
27922,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.192308 | 208 |
import numpy as np
import cv2
import os
from edge_pixels import find_edge_pixels
from fft import to_complex_number, fft, complex_to_number
for img in os.listdir('./inputs'):
print(f"Processando: {img}")
x = cv2.imread('./inputs/' + img, 0)
hei, wid = x.shape[:2]
output_shape = np.zeros(x.shape[:2])
list_edge, ou... | [
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
11748,
28686,
198,
6738,
5743,
62,
79,
14810,
1330,
1064,
62,
14907,
62,
79,
14810,
198,
6738,
277,
701,
1330,
284,
62,
41887,
62,
17618,
11,
277,
701,
11,
3716,
62,
1462,... | 2.449219 | 256 |
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator
from django.shortcuts import get_object_or_404, redirect, render
from yatube.settings import POSTS_COUNT
from .forms import CommentForm, PostForm
from .models import Follow, Group, Post, User
@login_required
... | [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
12501,
273,
2024,
1330,
17594,
62,
35827,
198,
6738,
42625,
14208,
13,
7295,
13,
79,
363,
20900,
1330,
31525,
20900,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
651,
62,
15252,
62,
... | 3.28 | 125 |
import copy
from haco.utils.callback import HACOCallbacks
from haco.utils.config import baseline_eval_config
from haco.utils.human_in_the_loop_env import HumanInTheLoopEnv
from haco.utils.train import train
from haco.utils.train_utils import get_train_parser
from ray.rllib.agents.ppo.ppo import PPOTrainer
evaluation_... | [
11748,
4866,
198,
198,
6738,
289,
10602,
13,
26791,
13,
47423,
1330,
367,
2246,
4503,
439,
10146,
198,
6738,
289,
10602,
13,
26791,
13,
11250,
1330,
14805,
62,
18206,
62,
11250,
198,
6738,
289,
10602,
13,
26791,
13,
10734,
62,
259,
62... | 2.089431 | 738 |
"""decorators module
"""
from . import utils as u
__author__ = "Bruno Lange"
__email__ = "blangeram@gmail.com"
__license__ = "MIT"
| [
37811,
12501,
273,
2024,
8265,
198,
37811,
198,
198,
6738,
764,
1330,
3384,
4487,
355,
334,
198,
198,
834,
9800,
834,
796,
366,
33,
5143,
78,
47579,
1,
198,
834,
12888,
834,
796,
366,
2436,
2564,
321,
31,
14816,
13,
785,
1,
198,
8... | 2.627451 | 51 |
'''
自动识别抽奖
直播间互动区 “关键字”出现次数>4 时,弹窗提示开始抽奖
前期准备工作需要安装:Python环境,opencv,pillow,ADB并配置好环境变量,百度文本识别
'''
#coding:utf8
import os
from PIL import Image
#import pytesseract
import cv2
import ctypes
from aip import AipOcr
'''
def ocr_text():
# 文本识别pytesseract,准确度底,弃用
image = Image.ope... | [
7061,
6,
201,
198,
164,
229,
103,
27950,
101,
46237,
228,
26344,
104,
162,
232,
121,
25001,
244,
201,
198,
33566,
112,
162,
240,
255,
29785,
112,
12859,
240,
27950,
101,
44293,
118,
564,
250,
17739,
111,
165,
242,
106,
27764,
245,
4... | 1.446629 | 712 |
# from __future__ import annotations
import inspect
import dill
import logging
from warnings import warn
from typing import Type, TypeVar, Any, Mapping, Dict, Optional, List
from typing import Generator, MutableMapping, Callable, Set
from functools import WRAPPER_ASSIGNMENTS
from collections import OrderedDict
import c... | [
2,
422,
11593,
37443,
834,
1330,
37647,
198,
11748,
10104,
198,
11748,
288,
359,
198,
11748,
18931,
198,
6738,
14601,
1330,
9828,
198,
6738,
19720,
1330,
5994,
11,
5994,
19852,
11,
4377,
11,
337,
5912,
11,
360,
713,
11,
32233,
11,
734... | 2.346689 | 17,471 |
from .server import console
from .database import migration, model
from .http import route, controller
from .tools import helper
def run_server(server):
"""
"""
return console.run(server)
def create_migration(name):
"""
:param name:
:return:
"""
return migration.create_migration(name... | [
6738,
764,
15388,
1330,
8624,
198,
6738,
764,
48806,
1330,
13472,
11,
2746,
198,
6738,
764,
4023,
1330,
6339,
11,
10444,
198,
6738,
764,
31391,
1330,
31904,
628,
198,
4299,
1057,
62,
15388,
7,
15388,
2599,
198,
220,
220,
220,
37227,
1... | 2.663664 | 333 |
import datetime as dt
import json
from typing import List, Optional
from uuid import UUID
from fastapi.encoders import jsonable_encoder
from injector import singleton, inject
from common.cache import fail_silently, hash_cache_key
from common.injection import Cache
from database.utils import map_to
from post.models im... | [
11748,
4818,
8079,
355,
288,
83,
198,
11748,
33918,
198,
6738,
19720,
1330,
7343,
11,
32233,
198,
6738,
334,
27112,
1330,
471,
27586,
198,
198,
6738,
3049,
15042,
13,
12685,
375,
364,
1330,
33918,
540,
62,
12685,
12342,
198,
6738,
8677,... | 3.648936 | 94 |
# -*- coding: utf-8 -*-
# @createTime : 2020/5/12 8:46
# @author : Huanglg
# @fileName: table.py
# @email: luguang.huang@mabotech.com
# -*- coding: utf-8 -*-
import json
import os
import time
import traceback
import natsort
import shutil
from PIL import Image, ImageEnhance
import tr
import cv2
import numpy as np
i... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
17953,
7575,
220,
220,
220,
1058,
12131,
14,
20,
14,
1065,
807,
25,
3510,
198,
2,
2488,
9800,
220,
1058,
31663,
75,
70,
198,
2,
2488,
7753,
5376,
25,
3084,
... | 1.657168 | 3,474 |
#!/usr/bin/env python
__author__ = "XXX"
__email__ = "XXX"
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
834,
9800,
834,
796,
366,
43145,
1,
198,
834,
12888,
834,
796,
366,
43145,
1,
198
] | 2.36 | 25 |
import pathlib
import heapq
from collections import Counter
ANSWER_LINE_START = "export const answers = ["
# The most frequent letters are worth the most points.
if __name__ == "__main__":
run()
| [
11748,
3108,
8019,
198,
11748,
24575,
80,
198,
6738,
17268,
1330,
15034,
198,
198,
15037,
45532,
62,
24027,
62,
2257,
7227,
796,
366,
39344,
1500,
7429,
796,
14631,
198,
198,
2,
383,
749,
10792,
7475,
389,
2861,
262,
749,
2173,
13,
62... | 3.383333 | 60 |
import numpy as np
import os
data_root = '/tigress/qlu/data/keras-nn-srm/data/'
data_format = '.npz'
def load_data(data_name):
"""
data avail: 'cifar10', 'cifar100', 'mnist_std', 'mnist_conv'
data_info = [num_classes, img_rows, img_cols, img_channels]
"""
data_path = os.path.join(data_root, dat... | [
11748,
299,
32152,
355,
45941,
220,
198,
11748,
28686,
220,
198,
198,
7890,
62,
15763,
796,
31051,
83,
328,
601,
14,
80,
2290,
14,
7890,
14,
6122,
292,
12,
20471,
12,
82,
26224,
14,
7890,
14,
6,
198,
7890,
62,
18982,
796,
45302,
3... | 2.259887 | 177 |
# Copyright Aleksey Gurtovoy 2001-2004
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# See http://www.boost.org/libs/mpl for documentation.
# $Source: /cvsroot/boost/boost/libs/mpl/preprocessed/preprocess_... | [
198,
2,
15069,
9300,
74,
4397,
402,
3325,
709,
726,
5878,
12,
15724,
198,
2,
198,
2,
4307,
6169,
739,
262,
19835,
10442,
13789,
11,
10628,
352,
13,
15,
13,
220,
198,
2,
357,
6214,
19249,
2393,
38559,
24290,
62,
16,
62,
15,
13,
1... | 2.39726 | 219 |
from numpy import *
for i in range(1,7,1):
points = genfromtxt("data"+str(i)+".csv", delimiter=",")
learning_rate = 0.001
initial_b , initial_m , num_iterations = 0 ,0 ,1000
print ("\nGradient descent for dataset = {0} at b = {1}, m = {2}, error = {3}".format(i,initial_b, initial_m, compute_error(ini... | [
6738,
299,
32152,
1330,
1635,
628,
198,
1640,
1312,
287,
2837,
7,
16,
11,
22,
11,
16,
2599,
198,
220,
220,
220,
2173,
796,
2429,
6738,
14116,
7203,
7890,
1,
10,
2536,
7,
72,
47762,
1911,
40664,
1600,
46728,
2676,
28,
2430,
8,
198,... | 3.890244 | 656 |
from scapy.all import IP, TCP, sr, conf
from random import randint
import sys
if __name__ == "__main__":
if not (len(sys.argv) == 2):
print(f"usage: {sys.argv[0]} target_address")
else:
answer, no_answer = [], []
try:
open_ports, closed_ports, no_answer_ports = pscan(sys.a... | [
6738,
629,
12826,
13,
439,
1330,
6101,
11,
23633,
11,
19677,
11,
1013,
198,
6738,
4738,
1330,
43720,
600,
198,
11748,
25064,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
611,
407,
357,
... | 2.192623 | 244 |
from .models import Question, Answer
from django.forms import ModelForm
from django import forms
| [
6738,
764,
27530,
1330,
18233,
11,
23998,
198,
6738,
42625,
14208,
13,
23914,
1330,
9104,
8479,
198,
6738,
42625,
14208,
1330,
5107,
628,
198
] | 4.125 | 24 |
from .SpecEvaluation import SpecEvaluation
from .SpecEvaluations import SpecEvaluations
class ProblemConstraintsEvaluations(SpecEvaluations):
"""Special multi-evaluation class for all constraints of a same problem.
See submethod ``.from_problem``
"""
specifications_role = "constraint"
@staticm... | [
6738,
764,
22882,
36,
2100,
2288,
1330,
18291,
36,
2100,
2288,
198,
6738,
764,
22882,
36,
2100,
6055,
1330,
18291,
36,
2100,
6055,
628,
198,
4871,
20647,
3103,
2536,
6003,
36,
2100,
6055,
7,
22882,
36,
2100,
6055,
2599,
198,
220,
220,... | 2.736726 | 452 |
from __future__ import absolute_import
from __future__ import unicode_literals
import sys
import json
import requests
from django.conf import settings
from django.core.management.base import BaseCommand
from django.core.mail import mail_admins
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
11748,
25064,
198,
11748,
33918,
198,
11748,
7007,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625... | 3.84375 | 64 |
'''This package contains the data structures for the :mod:`researchers`
There is just one model: :class:`~researchers.models.Researcher`
There is also a helper function create_user_profile which creates a new :class:`~researchers.models.Researcher` object for each User object.
'''
from django.contrib.auth.models impo... | [
7061,
6,
1212,
5301,
4909,
262,
1366,
8573,
329,
262,
1058,
4666,
25,
63,
260,
325,
283,
3533,
63,
198,
198,
1858,
318,
655,
530,
2746,
25,
1058,
4871,
25,
63,
93,
260,
325,
283,
3533,
13,
27530,
13,
4965,
50194,
63,
198,
1858,
... | 2.89434 | 530 |
'''Independent-running GSAS-II based auto-integration program with minimal
GUI, no visualization but intended to implement significant levels of
parallelization.
'''
# Autointegration from
# $Id: GSASIIimgGUI.py 3926 2019-04-23 18:11:07Z toby $
# hacked for stand-alone use
#
# idea: select image file type & set filte... | [
7061,
6,
40566,
12,
20270,
26681,
1921,
12,
3978,
1912,
8295,
12,
18908,
1358,
1430,
351,
10926,
198,
40156,
11,
645,
32704,
475,
5292,
284,
3494,
2383,
2974,
286,
220,
198,
1845,
29363,
1634,
13,
198,
7061,
6,
198,
2,
5231,
1563,
1... | 2.104858 | 8,316 |
from keras.models import Sequential
from keras.layers.core import Flatten, Dense, Dropout
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from keras.layers.convolutional import ZeroPadding2D
def VGG_16(weights_path=None, in_shape = (3,224,224), out_classes = 1000):
"""
Defines the VGG conv ... | [
198,
6738,
41927,
292,
13,
27530,
1330,
24604,
1843,
198,
6738,
41927,
292,
13,
75,
6962,
13,
7295,
1330,
1610,
41769,
11,
360,
1072,
11,
14258,
448,
198,
6738,
41927,
292,
13,
75,
6962,
13,
42946,
2122,
282,
1330,
34872,
2122,
17,
... | 2.437611 | 1,122 |
'''This module weather.py handles the weather updates receiving
part of the program. This means that it uses the APIkeys to be able
to get the newest weather updates for the notifications, and also the weather brief.'''
import json
import requests
def get_weather() -> dict:
'''This function allows the program... | [
7061,
6,
1212,
8265,
6193,
13,
9078,
17105,
262,
6193,
5992,
6464,
201,
198,
3911,
286,
262,
1430,
13,
770,
1724,
326,
340,
3544,
262,
7824,
13083,
284,
307,
1498,
201,
198,
1462,
651,
262,
15530,
6193,
5992,
329,
262,
19605,
11,
29... | 2.483376 | 1,173 |
import gui
import network
import audio
import control
import globals
from player import Player
| [
11748,
11774,
198,
11748,
3127,
198,
11748,
6597,
198,
11748,
1630,
198,
198,
11748,
15095,
874,
198,
6738,
2137,
1330,
7853,
628,
628,
628,
220,
220,
220,
220,
198,
220,
220,
220,
220,
198
] | 3.264706 | 34 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import random
from torch_scatter import scatter_mean
import sys
sys.path.append('../')
from lib.pointgroup_ops.functions import pointgroup_ops
from model.components import WeightedFocalLoss, CenterLoss, TripletLoss
from model.common import generate_ad... | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
11748,
4738,
198,
6738,
28034,
62,
1416,
1436,
1330,
41058,
62,
32604,
198,
11748,
25064,
198,
198,
17597,
13,
6978,
13,
... | 3.434426 | 122 |
#!/bin/python
with open("predictions.txt") as pfd, open("predictions2.txt","w+") as ofd:
for line in pfd:
ofd.write(str(int(line.strip())+1)+"\n")
| [
2,
48443,
8800,
14,
29412,
198,
4480,
1280,
7203,
28764,
9278,
13,
14116,
4943,
355,
279,
16344,
11,
1280,
7203,
28764,
9278,
17,
13,
14116,
2430,
86,
10,
4943,
355,
286,
67,
25,
198,
197,
1640,
1627,
287,
279,
16344,
25,
198,
197,
... | 2.323077 | 65 |
from .common_setup import *
from ..vi import VariationalBayes, conditional_different_points, WhitenedVariationalPosterior
from ..misc import safe_cholesky
import tensorflow_probability as tfp
import tensorflow as tf
from .. import float_type
| [
6738,
764,
11321,
62,
40406,
1330,
1635,
198,
6738,
11485,
8903,
1330,
15965,
864,
15262,
274,
11,
26340,
62,
39799,
62,
13033,
11,
13183,
2945,
23907,
864,
47,
6197,
1504,
198,
6738,
11485,
44374,
1330,
3338,
62,
354,
4316,
2584,
198,
... | 3.61194 | 67 |
from typing import Dict, Optional
from daemon.stores.mixin import AiohttpMixin
from daemon.stores.containers import ContainerStore
class PodStore(ContainerStore, AiohttpMixin):
"""A Store of Pods spawned as Containers by Daemon"""
_kind = 'pod'
async def add_in_partial(
self, uri: str, params: ... | [
6738,
19720,
1330,
360,
713,
11,
32233,
198,
198,
6738,
33386,
13,
43409,
13,
19816,
259,
1330,
317,
952,
4023,
35608,
259,
198,
6738,
33386,
13,
43409,
13,
3642,
50221,
1330,
43101,
22658,
628,
198,
4871,
17437,
22658,
7,
29869,
22658,... | 2.415507 | 503 |
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.testutils import APITestCase, SnubaTestCase
from sentry.testutils.helpers.datetime import iso_format, before_now
from sentry.models import Group
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
6371,
411,
349,
690,
1330,
9575,
198,
6738,
1908,
563,
13,
9288,
26791,
1330,
3486,
2043,
395,
20448,
11,
5489,
22013,
14402,
20448,
198,
6738,
... | 3.521739 | 69 |
from django.db import models
import os
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
11748,
28686,
628,
198
] | 3.416667 | 12 |
"""Python Cookbook
Chapter 8, recipe 2.
"""
from pprint import pprint
log_rows = \
[['date', 'engine on', 'fuel height'],
['', 'engine off', 'fuel height'],
['', 'Other notes', ''],
['10/25/13', '08:24:00 AM', '29'],
['', '01:15:00 PM', '27'],
['', "calm seas -- anchor solomon's island", ''],
['10/26/13', '09:1... | [
37811,
37906,
8261,
2070,
198,
198,
14126,
807,
11,
8364,
362,
13,
198,
37811,
198,
6738,
279,
4798,
1330,
279,
4798,
198,
198,
6404,
62,
8516,
796,
3467,
198,
58,
17816,
4475,
3256,
705,
18392,
319,
3256,
705,
25802,
6001,
6,
4357,
... | 2.239316 | 2,106 |
"""connector.py
Created on: May 19, 2017
Authors: Jeroen van der Heijden <jeroen@cesbit.com>
jomido <https://github.com/jomido>
"""
import os
import json
import aiohttp
from .client_token import Token
from .service_account_token import ServiceAccountToken
from .entity import Entity
from .key import Key
... | [
37811,
8443,
273,
13,
9078,
198,
198,
41972,
319,
25,
1737,
678,
11,
2177,
198,
220,
220,
46665,
25,
449,
3529,
268,
5719,
4587,
679,
2926,
6559,
1279,
73,
3529,
268,
31,
728,
2545,
13,
785,
29,
198,
220,
220,
220,
220,
220,
220,
... | 2.602459 | 244 |
#!/usr/bin/env python
import h5py
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import sys
runnr = int(sys.argv[1])
filename = '/asap3/flash/gpfs/bl1/2017/data/11001733/processed/hummingbird/r%04d_ol1.h5' %runnr
with h5py.File(filename, 'r') as f:
hitscore = f['entry_1/... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
289,
20,
9078,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
198,
6759,
29487,
8019,
13,
1904,
10786,
46384,
11537,
198,
11748,
2603,
29487,
8019,
13,
9078,
2... | 2.230126 | 239 |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
5903,
6582,
532,
18700,
6185,
5456,
198,
2,
15069,
357,
34,
8,
1853,
5658,
20687,
1533,
83,
2815,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
... | 3.502174 | 460 |
# Generated by Django 3.0.6 on 2020-07-13 23:23
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
21,
319,
12131,
12,
2998,
12,
1485,
2242,
25,
1954,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
#generates timestamps
import datetime
#contains hashing algorithms
import hashlib
#defining the 'block' data structure
import time
#defining the blockchain datastructure
#consists of 'blocks' linked together
#to form a 'chain'. Thats why its called
#'blockchain'
blockchain = Blockchain()
#mine 10 blocks
f... | [
2,
8612,
689,
4628,
395,
9430,
201,
198,
11748,
4818,
8079,
201,
198,
2,
3642,
1299,
49544,
16113,
201,
198,
11748,
12234,
8019,
201,
198,
2,
4299,
3191,
262,
705,
9967,
6,
1366,
4645,
201,
198,
11748,
640,
201,
198,
2,
4299,
3191,
... | 2.927461 | 193 |
from interaction_engine.engine import InteractionEngine
| [
6738,
10375,
62,
18392,
13,
18392,
1330,
4225,
2673,
13798,
628
] | 5.181818 | 11 |
# -*- coding: utf-8 -*-
from manim_imports_ext import *
# Scene types
# Scenes
# class Thumbnail(GraphicalIntuitions):
| [
1303,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
582,
320,
62,
320,
3742,
62,
2302,
1330,
1635,
628,
628,
628,
628,
198,
2,
28315,
3858,
628,
198,
198,
2,
49525,
628,
628,
628,
628,
628,
628,
628,
628,
628... | 2.397436 | 78 |
#!/usr/bin/env python
#-*-coding:utf-8-*-
'''
Created on 2017年12月12日
@Author: Xinpeng
@Description: 用来处理json is not JSON serializable。
'''
import json
import datetime | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
12,
9,
12,
66,
7656,
25,
40477,
12,
23,
12,
9,
12,
198,
198,
7061,
6,
198,
41972,
319,
2177,
33176,
112,
1065,
17312,
230,
1065,
33768,
98,
198,
198,
31,
13838,
25,
25426,
79,... | 2.15 | 80 |
from selia.views.create_views.manager_base import CreateManagerBase
| [
6738,
384,
24660,
13,
33571,
13,
17953,
62,
33571,
13,
37153,
62,
8692,
1330,
13610,
13511,
14881,
628
] | 3.833333 | 18 |
from random import randint as rdi
from math import radians
from compas.geometry import Box
from compas.datastructures import Mesh
from compas.datastructures import mesh_transform_numpy
from compas.utilities import rgb_to_hex
from compas.geometry import Translation
from compas.geometry import Rotation
from compas_vie... | [
6738,
4738,
1330,
43720,
600,
355,
374,
10989,
198,
198,
6738,
10688,
1330,
2511,
1547,
198,
198,
6738,
552,
292,
13,
469,
15748,
1330,
8315,
198,
6738,
552,
292,
13,
19608,
459,
1356,
942,
1330,
47529,
198,
6738,
552,
292,
13,
19608,... | 2.397802 | 455 |
get_staff_sql = "select is_phen_staff from user_privileges inner join user_registrations on user_privileges.id_user=user_registrations.id_user where user_registrations.email='{0}'"
get_salt_sql = "select salt from user_registrations where email='{0}'"
get_name_passwd_sql = "select username from user_registrations whe... | [
1136,
62,
28120,
62,
25410,
796,
366,
19738,
318,
62,
31024,
62,
28120,
422,
2836,
62,
13776,
576,
3212,
8434,
4654,
2836,
62,
2301,
396,
9143,
319,
2836,
62,
13776,
576,
3212,
13,
312,
62,
7220,
28,
7220,
62,
2301,
396,
9143,
13,
... | 2.966667 | 120 |
import re
from typing import Mapping
import requests
bearer_re = r"index.html\?(.*)"
| [
11748,
302,
198,
6738,
19720,
1330,
337,
5912,
198,
198,
11748,
7007,
198,
198,
1350,
11258,
62,
260,
796,
374,
1,
9630,
13,
6494,
59,
30,
7,
15885,
16725,
628
] | 2.933333 | 30 |
import unittest
from unittest.mock import MagicMock
from lmctl.client.client_credentials_auth import ClientCredentialsAuth
| [
11748,
555,
715,
395,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
6139,
44,
735,
198,
6738,
300,
76,
34168,
13,
16366,
13,
16366,
62,
66,
445,
14817,
62,
18439,
1330,
20985,
34,
445,
14817,
30515,
198
] | 3.236842 | 38 |
import os
import pytest
import asyncio
import taskloaf.worker
from taskloaf.cluster import cluster
from taskloaf.mpi import mpiexisting, MPIComm, rank
from taskloaf.test_decorators import mpi_procs
from taskloaf.run import run
from fixtures import w
if __name__ == "__main__":
test_log()
@mpi_procs(2)
@mpi_procs(... | [
11748,
28686,
198,
11748,
12972,
9288,
198,
11748,
30351,
952,
198,
11748,
4876,
5439,
1878,
13,
28816,
198,
6738,
4876,
5439,
1878,
13,
565,
5819,
1330,
13946,
198,
6738,
4876,
5439,
1878,
13,
3149,
72,
1330,
285,
21749,
87,
9665,
11,
... | 2.691667 | 120 |
import math
from pyspark.sql import functions as F
import pyspark.sql.types as T
import unidecode as ud
from faker import Faker
from numpy import random
import binascii
import zlib
from HLL import HyperLogLog
from datafaucet import crypto
from datafaucet.spark import types
from datafaucet.spark import dataframe
a... | [
11748,
10688,
198,
198,
6738,
279,
893,
20928,
13,
25410,
1330,
5499,
355,
376,
198,
11748,
279,
893,
20928,
13,
25410,
13,
19199,
355,
309,
198,
198,
11748,
555,
485,
8189,
355,
334,
67,
198,
198,
6738,
277,
3110,
1330,
376,
3110,
... | 2.228599 | 1,028 |
from . import Type
from ..support.heading import Heading
from ..support import utils
from ..exceptions import UndressError
| [
6738,
764,
1330,
5994,
198,
6738,
11485,
11284,
13,
33878,
1330,
679,
4980,
198,
6738,
11485,
11284,
1330,
3384,
4487,
198,
6738,
11485,
1069,
11755,
1330,
13794,
601,
12331,
628
] | 4.133333 | 30 |
from .base_classes import Container
class Canvas(Container):
"""Use the HTML `<canvas>` element with either the [canvas scripting
API](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API) or the
[WebGL API](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API) to
draw graphics and animat... | [
6738,
764,
8692,
62,
37724,
1330,
43101,
628,
198,
4871,
1680,
11017,
7,
29869,
2599,
198,
220,
220,
220,
37227,
11041,
262,
11532,
4600,
27,
5171,
11017,
29,
63,
5002,
351,
2035,
262,
685,
5171,
11017,
36883,
198,
220,
220,
220,
7824... | 3.12938 | 371 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | [
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
220,
220,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
921,
743,
7330,
198,
2,
220,
220,
... | 2.717216 | 1,609 |
import argparse
import collections
import glob
import gzip
import heapq
import itertools
import json
import math
import multiprocessing
import os
import random
import re
import shutil
import subprocess
import sys
import time
from robustcode.analysis.graph import AstNode
from robustcode.parsers.parser import parse_file... | [
11748,
1822,
29572,
198,
11748,
17268,
198,
11748,
15095,
198,
11748,
308,
13344,
198,
11748,
24575,
80,
198,
11748,
340,
861,
10141,
198,
11748,
33918,
198,
11748,
10688,
198,
11748,
18540,
305,
919,
278,
198,
11748,
28686,
198,
11748,
4... | 3.453947 | 304 |