content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from cfn_kong_provider import KongProvider
request_schema = {
"type": "object",
"required": ["AdminURL", "ACL"],
"properties": {
"AdminURL": {
"type": "string", "pattern": "^https?://.+",
"description": "of kong admin port"},
"JWT": {
"type": "object",
... | [
6738,
269,
22184,
62,
74,
506,
62,
15234,
1304,
1330,
9071,
29495,
198,
198,
25927,
62,
15952,
2611,
796,
1391,
198,
220,
220,
220,
366,
4906,
1298,
366,
15252,
1600,
198,
220,
220,
220,
366,
35827,
1298,
14631,
46787,
21886,
1600,
36... | 1.656784 | 877 |
#!/usr/bin/env python
import rospy
import cv2
import time
from person_detection import PersonDetection
from pose_estimation import PoseEstimation
from camera_reader import CameraStreamer
from persons import Persons
# color constants
RED_COLOR = (0, 0, 255)
BLUE_COLOR = (255, 0, 0)
WHITE_COLOR = (255, 255, 255)
DEFAUL... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
686,
2777,
88,
198,
11748,
269,
85,
17,
198,
11748,
640,
198,
6738,
1048,
62,
15255,
3213,
1330,
7755,
11242,
3213,
198,
6738,
12705,
62,
395,
18991,
1330,
37557,
22362,
18... | 2.606426 | 249 |
import numpy as np
import os
from numpy.linalg import inv
from numpy.linalg import det
list1=["like_3x2pt_LSST_Y10_area=1.800000e+04_dmo","like_3x2pt_WFIRST_area=2.000000e+03_dmo","like_3x2pt_WFIRST_area=1.800000e+04_dmo"]
FOMDE=np.array([1.0,1.0,1.0])
i=0
FOMDE[i]
print FOMDE[i]
for name in list1:
i=0
file... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
6738,
299,
32152,
13,
75,
1292,
70,
1330,
800,
198,
6738,
299,
32152,
13,
75,
1292,
70,
1330,
1062,
198,
198,
4868,
16,
28,
14692,
2339,
62,
18,
87,
17,
457,
62,
6561,
2257,
6... | 1.806962 | 316 |
from flask_restplus import Api
from .parallel_templates import template
api = Api(
title='C99 Parallel Template Api',
version='1.0',
description="""Provides a set of parallel programming
templates for easy parallelization."""
)
# Adding template resource namesace to the API
api.add_namespace(templat... | [
6738,
42903,
62,
2118,
9541,
1330,
5949,
72,
198,
6738,
764,
1845,
29363,
62,
11498,
17041,
1330,
11055,
628,
198,
15042,
796,
5949,
72,
7,
198,
220,
220,
220,
3670,
11639,
34,
2079,
42945,
37350,
5949,
72,
3256,
198,
220,
220,
220,
... | 3.27 | 100 |
#!@WHICHPYTHON@
import string, sys
#------------------ Alphabet -------------------
class Alphabet(object):
"""Biological alphabet class.
This defines the set of symbols from which various objects can be built, e.g. sequences and motifs.
The symbol set is immutable and accessed as a tuple.
symstr: symbols in al... | [
2,
0,
31,
12418,
2149,
14082,
56,
4221,
1340,
31,
198,
198,
11748,
4731,
11,
25064,
198,
198,
2,
1783,
438,
45695,
34400,
6329,
198,
198,
4871,
45695,
7,
15252,
2599,
198,
197,
37811,
33,
15071,
24830,
1398,
13,
220,
198,
197,
1212,... | 2.764899 | 6,410 |
import arcade
import yaml
from gamemanager import GameManager
def load_config():
""" Load config data from config.yaml """
with open("config.yaml", 'r') as stream:
try:
return yaml.safe_load(stream)
except yaml.YAMLError as exc:
print(exc)
def main():
""" Main met... | [
11748,
27210,
198,
11748,
331,
43695,
198,
198,
6738,
9106,
8463,
3536,
1330,
3776,
13511,
198,
198,
4299,
3440,
62,
11250,
33529,
198,
220,
220,
220,
37227,
8778,
4566,
1366,
422,
4566,
13,
88,
43695,
37227,
628,
220,
220,
220,
351,
... | 2.386047 | 215 |
ff = open("ath")
biggest=""
amt=0
for line in ff:
row = line.split("\t")
if int(row[3]) > amt:
biggest=row[0]
amt = int(row[3])
print "new biggest", biggest, "with amount", amt | [
487,
796,
1280,
7203,
776,
4943,
198,
198,
14261,
3495,
33151,
198,
321,
83,
28,
15,
198,
1640,
1627,
287,
31246,
25,
198,
197,
808,
796,
1627,
13,
35312,
7203,
59,
83,
4943,
198,
197,
361,
493,
7,
808,
58,
18,
12962,
1875,
716,
... | 2.202381 | 84 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import sys
from col... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
1946,
41689,
1628,
20420,
357,
3826,
27342,
9865,
3843,
20673,
13,
9132,
737,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
3826,
38559,
24290,
737,
198,
198,
6738,
1... | 2.436634 | 8,877 |
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2017, Heinrich Schuchardt <xypron.glpk@gmx.de>
# Test efi API implementation
import pytest
import u_boot_utils
@pytest.mark.buildconfigspec('cmd_bootefi_selftest')
def test_efi_selftest(u_boot_console):
"""Test the UEFI implementation
:param u_boot_console: U-Boo... | [
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
38644,
12,
17,
13,
15,
198,
2,
15069,
357,
66,
8,
2177,
11,
26431,
7527,
3059,
794,
446,
83,
1279,
5431,
31186,
13,
4743,
79,
74,
31,
70,
36802,
13,
2934,
29,
198,
198,
2,
6208,
30... | 2.432528 | 2,816 |
# -*- coding: utf-8 -*-
"""
@author: Yi Zhang.
Department of Aerodynamics
Faculty of Aerospace Engineering
TU Delft, Delft, Netherlands
"""
import sys
if './' not in sys.path: sys.path.append('./')
from objects.CSCG._3d.forms.standard._3s.discretize.main import _3dCSCG_Discretize
from obje... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
198,
31,
9800,
25,
26463,
19439,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
2732,
286,
15781,
44124,
198,
220,
220,
220,
220,
220,
220,
220,
220,
3... | 2.29882 | 763 |
import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
logging.getLogger("pyrogram").setLevel(logging.WARNING)
import os
from config import Config
from pyrogram import Client
if __name__ == "__mai... | [
11748,
18931,
198,
6404,
2667,
13,
35487,
16934,
7,
5715,
28,
6404,
2667,
13,
30531,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5794,
11639,
4,
7,
292,
310,
524,
8,
82... | 2.183521 | 267 |
# Copyright (c) 2006-2008 Alexander Burtsev
# See LICENSE for details
"""AMI tests
@author: U{Alexander Burtsev<mailto:eburus@gmail.com>}
$Id: test_ami.py 24 2008-02-18 12:22:42Z burus $
"""
from twisted.trial import unittest
from twisted.internet.protocol import FileWrapper
from twisted.test.test_protocols import S... | [
2,
15069,
357,
66,
8,
4793,
12,
11528,
10009,
347,
3325,
325,
85,
198,
2,
4091,
38559,
24290,
329,
3307,
198,
198,
37811,
43870,
5254,
198,
31,
9800,
25,
471,
90,
38708,
347,
3325,
325,
85,
27,
4529,
1462,
25,
1765,
31891,
31,
148... | 1.854776 | 1,026 |
from mytest import *
from mytest.annotationTest import spamrun
@spamrun
if __name__ == '__main__':
fuc(1,2)
| [
198,
6738,
616,
9288,
1330,
1635,
198,
198,
6738,
616,
9288,
13,
1236,
14221,
14402,
1330,
18084,
5143,
198,
198,
31,
2777,
321,
5143,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
277,
1229,
... | 2.4375 | 48 |
#!/usr/bin/env python2
# coding: utf-8
import yaml
from argparse import ArgumentParser
from sys import stdout, stderr
from java_source_parser import make_model
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
11748,
331,
43695,
198,
6738,
1822,
29572,
1330,
45751,
46677,
198,
6738,
25064,
1330,
14367,
448,
11,
336,
1082,
81,
198,
6738,
20129,
... | 2.873239 | 71 |
import numpy as np
import matplotlib.pyplot as plt
teste()
| [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
628,
198,
198,
9288,
68,
3419,
198
] | 2.695652 | 23 |
#!/usr/bin/python
# coding: UTF-8
# musicdata service to read from SPOP
# Written by: Ron Ritchey
import threading, logging, queue, time, sys, telnetlib, json, getopt
from . import musicdata
if __name__ == '__main__':
logging.basicConfig(format='%(asctime)s:%(levelname)s:%(message)s', filename='musicdata_spop... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
19617,
25,
41002,
12,
23,
198,
198,
2,
2647,
7890,
2139,
284,
1100,
422,
6226,
3185,
198,
2,
22503,
416,
25,
6575,
371,
270,
2395,
88,
628,
198,
11748,
4704,
278,
11,
18931,
11,
16834,... | 2.282178 | 606 |
#!/bin/env python
# -*-coding:utf-8 -*
# pylint: disable=missing-module-docstring
# pylint: disable=wrong-import-position
# pylint: disable=unused-import
# flake8: noqa
import os
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(
__file__), '../src/tribud')))
import model
| [
2,
48443,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
66,
7656,
25,
40477,
12,
23,
532,
9,
198,
2,
279,
2645,
600,
25,
15560,
28,
45688,
12,
21412,
12,
15390,
8841,
198,
2,
279,
2645,
600,
25,
15560,
28,
36460,
12,
11748,
12,
... | 2.435484 | 124 |
import argparse
import os
import sys
import numpy as np
import tensorflow as tf
from matplotlib import pyplot as plt
from PIL import Image
from urllib.request import urlretrieve
import depth_prediction.models as models
from main import utils
import glob
import logging
logger = utils.get_logger(name=__name__)
DEFAULT_... | [
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
6738,
350,
4146,
1330,
7412,
198... | 2.452355 | 1,868 |
""" Kafka schema
"""
from . import serializer
from . import avro
from . import registry
__version__:str = '1.0.0.rc1'
__author__: str ='Brandon Bluemner'
| [
37811,
46906,
32815,
198,
37811,
198,
6738,
764,
1330,
11389,
7509,
198,
6738,
764,
1330,
1196,
305,
198,
6738,
764,
1330,
20478,
628,
198,
834,
9641,
834,
25,
2536,
796,
705,
16,
13,
15,
13,
15,
13,
6015,
16,
6,
198,
834,
9800,
8... | 2.854545 | 55 |
""" Create a vocabulary wrapper.
Original code:
https://github.com/yalesong/pvse/blob/master/vocab.py
"""
from collections import Counter
import json
import os
import pickle
import fire
from nltk.tokenize import word_tokenize
from pycocotools.coco import COCO
ANNOTATIONS = {
'mrw': ['mrw-v1.0.json'],
'tgif'... | [
37811,
13610,
257,
25818,
29908,
13,
198,
198,
20556,
2438,
25,
198,
5450,
1378,
12567,
13,
785,
14,
88,
2040,
506,
14,
79,
85,
325,
14,
2436,
672,
14,
9866,
14,
18893,
397,
13,
9078,
198,
37811,
198,
198,
6738,
17268,
1330,
15034,
... | 2.353825 | 732 |
import torch
import torch.nn as nn
import torch.nn.functional as F
from network.vgg import VggNet
from network.resnet import ResNet
from util.config import config as cfg
| [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
3127,
13,
85,
1130,
1330,
569,
1130,
7934,
198,
6738,
3127,
13,
411,
3262,
1330,
1874,
7934,
198,
6738,
7736,
13,
... | 3.411765 | 51 |
import numpy as np
import torch
from sklearn.utils import resample
import torch.multiprocessing
torch.multiprocessing.set_sharing_strategy('file_system')
| [
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
1341,
35720,
13,
26791,
1330,
581,
1403,
198,
11748,
28034,
13,
16680,
541,
305,
919,
278,
198,
13165,
354,
13,
16680,
541,
305,
919,
278,
13,
2617,
62,
21987,
62,
2536,
433... | 3.156863 | 51 |
k = 128
input_size = 320 # number of input bits
upper_bound_gates = 11000
# path to the cbmc compiler
cbmc_path = "data/CBMC-GC-2/bin/"
default_output = "cbmc_parser/gate_files/default_output/"
# on Windows it has to be the address of the "Hyper-V Virtual Ethernet Adapter #2" if you use docker
test_server_ip = 'loca... | [
74,
796,
13108,
198,
15414,
62,
7857,
796,
20959,
220,
1303,
1271,
286,
5128,
10340,
198,
45828,
62,
7784,
62,
70,
689,
796,
1367,
830,
198,
198,
2,
3108,
284,
262,
269,
20475,
66,
17050,
198,
66,
20475,
66,
62,
6978,
796,
366,
78... | 2.900826 | 121 |
from flask import Flask, render_template, jsonify
from extractor import extractorv1
import functools
import os
import sqlalchemy as sql
import pandas as pd
import datetime
import pickle
from app import predictions
import time
while True:
now = datetime.datetime.now()
hour = now.hour
minute = now.minut... | [
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
33918,
1958,
198,
6738,
7925,
273,
1330,
7925,
273,
85,
16,
198,
11748,
1257,
310,
10141,
198,
11748,
28686,
198,
11748,
44161,
282,
26599,
355,
44161,
198,
11748,
19798,
292,
355,
279,... | 2.727778 | 180 |
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 4 14:27:23 2020
@author: MBelobraydic
"""
import argparse
import sys
import pandas as pd
import json
from dbf900_main_bytes import yield_blocks, parse_record
from dbf900_layouts_bytes import dbf900_layout
from dbf900_formats_bytes import pic_yyyymmdd, pic_numeric, pic_an... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
30030,
2447,
220,
604,
1478,
25,
1983,
25,
1954,
12131,
198,
198,
31,
9800,
25,
10771,
417,
672,
2433,
67,
291,
198,
37811,
198,
11748,
1822,
2... | 2.656051 | 157 |
#!/usr/bin/env python
from django.core.management import call_command
from boot_django import boot_django
boot_django()
call_command("makemigrations", "formulaic")
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
1330,
869,
62,
21812,
198,
6738,
6297,
62,
28241,
14208,
1330,
6297,
62,
28241,
14208,
198,
198,
18769,
62,
28241,
14208,
3419,
198,
13345,
... | 3.018182 | 55 |
import numpy as np
from scipy import integrate
import matplotlib.pyplot as plt
from UTILS.Calculus import Calculus
from UTILS.SetAxisLimit import SetAxisLimit
from UTILS.Tools import Tools
from UTILS.Errors import Errors
import sys
# Theoretical background https://arxiv.org/abs/1401.5176
# Mocak, Meakin, Viallet, Ar... | [
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
1330,
19386,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
19255,
45484,
13,
9771,
17576,
1330,
2199,
17576,
198,
6738,
19255,
45484,
13,
7248,
31554,
27... | 3.263889 | 144 |
"""Disassembler of Python byte code into mnemonics."""
import sys
import types
from opcode import *
from opcode import __all__ as _opcodes_all
__all__ = ["dis","disassemble","distb","disco"] + _opcodes_all
del _opcodes_all
def dis(x=None):
"""Disassemble classes, methods, functions, or code.
With no argume... | [
37811,
7279,
34455,
1754,
286,
11361,
18022,
2438,
656,
285,
77,
7966,
873,
526,
15931,
198,
198,
11748,
25064,
198,
11748,
3858,
198,
198,
6738,
1034,
8189,
1330,
1635,
198,
6738,
1034,
8189,
1330,
11593,
439,
834,
355,
4808,
404,
4014... | 1.845302 | 2,799 |
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RSplancs(RPackage):
"""Spatial and Space-Time Point Pattern Analysis"""
homepage = "h... | [
2,
15069,
2211,
12,
1238,
1828,
13914,
45036,
3549,
2351,
4765,
11,
11419,
290,
584,
198,
2,
1338,
441,
4935,
34152,
13,
4091,
262,
1353,
12,
5715,
27975,
38162,
9947,
2393,
329,
3307,
13,
198,
2,
198,
2,
30628,
55,
12,
34156,
12,
... | 2.472414 | 290 |
# Copyright 2020 Mobvoi Inc. (authors: Fangjun Kuang)
# Xiaomi Corp. (author: Haowen Qiu)
#
# See ../../../LICENSE for clarification regarding multiple authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance wit... | [
2,
15069,
220,
220,
220,
220,
220,
12131,
220,
16540,
13038,
72,
3457,
13,
220,
220,
220,
220,
220,
220,
220,
357,
41617,
25,
24468,
29741,
12554,
648,
8,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.228351 | 3,372 |
from django.contrib import admin
from back.models.node import *
@admin.register(Node)
# @admin.register(Sensor)
# class SensorAdmin(admin.ModelAdmin):
# search_fields = ['node__uid', 'description']
# list_display = ['node', 'pin', 'sensor_type',
# 'description', 'created', 'modified']
... | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
736,
13,
27530,
13,
17440,
1330,
1635,
628,
198,
198,
31,
28482,
13,
30238,
7,
19667,
8,
628,
198,
2,
2488,
28482,
13,
30238,
7,
47864,
8,
198,
2,
1398,
35367,
46787,
... | 2.685185 | 162 |
import errno
import mock
from chroma_agent.lib import node_admin
from chroma_agent.lib.shell import AgentShell
from iml_common.test.command_capture_testcase import (
CommandCaptureTestCase,
CommandCaptureCommand,
)
| [
11748,
11454,
3919,
198,
11748,
15290,
198,
6738,
15358,
64,
62,
25781,
13,
8019,
1330,
10139,
62,
28482,
198,
6738,
15358,
64,
62,
25781,
13,
8019,
13,
29149,
1330,
15906,
23248,
198,
6738,
545,
75,
62,
11321,
13,
9288,
13,
21812,
62... | 3.246377 | 69 |
import pygame
from queue import PriorityQueue
"""
Path Finding - Buscador de caminhos com A*
É um programa em python desenvolvido durante a disciplina de
Inteligência Artificial da Faculdade de Tecnologia da Unicamp pelos alunos:
1. Kevin Barrios
2. Larissa Benevides
3. Matheus Alves
4. Math... | [
11748,
12972,
6057,
201,
198,
6738,
16834,
1330,
34416,
34991,
201,
198,
201,
198,
37811,
201,
198,
15235,
27063,
532,
5869,
66,
7079,
390,
269,
5669,
71,
418,
401,
317,
9,
201,
198,
38351,
23781,
1430,
64,
795,
21015,
748,
268,
10396... | 2.050433 | 7,614 |
#!/usr/bin/env python3
# -"- encoding: utf-8 -"-
import re
import pickle
from tgen.data import DA
from tgen.tfclassif import Reranker
from tgen.logf import log_info
from tgen.futil import file_stream, read_das
# ----
# BEGIN code copied over from e2e-cleaning -- TODO dependency?
# ----
REALIZATIONS = {
'area': ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
26793,
21004,
25,
3384,
69,
12,
23,
532,
26793,
198,
198,
11748,
302,
198,
11748,
2298,
293,
198,
6738,
256,
5235,
13,
7890,
1330,
17051,
198,
6738,
256,
5235,
13,
27110,... | 1.949983 | 5,758 |
import os
import setupmeta
| [
11748,
28686,
198,
198,
11748,
9058,
28961,
628
] | 3.625 | 8 |
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 8 10:22:45 2019
@author: mangelon
"""
import numpy as np
import pandas as pd
from scipy.optimize import newton
def price(yield_to_mat, redemption, rate, freq, maturity_dt, settlement_dt,
dcc="30/360 US", eom=False):
"""
Returns the price given the yi... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
19480,
3158,
220,
807,
838,
25,
1828,
25,
2231,
13130,
198,
198,
31,
9800,
25,
582,
25280,
261,
198,
37811,
198,
11748,
299,
32152,
355,
45941,
... | 2.023516 | 1,786 |
from ctypes import Structure, c_double, c_int, c_ubyte
from . import constants
SCALE_INFO_ARRAY = c_gsfScaleInfo * constants.GSF_MAX_PING_ARRAY_SUBRECORDS
| [
6738,
269,
19199,
1330,
32522,
11,
269,
62,
23352,
11,
269,
62,
600,
11,
269,
62,
549,
88,
660,
198,
198,
6738,
764,
1330,
38491,
628,
198,
198,
6173,
21358,
62,
10778,
62,
1503,
30631,
796,
269,
62,
14542,
69,
29990,
12360,
1635,
... | 2.580645 | 62 |
import numpy as np
import matplotlib.pyplot as plt
import CoolProp, scipy.optimize
backend = 'HEOS'
fluid = 'R125'
kwargs = dict(lw = 2)
print('Ideal')
ICT = IdealCurveTracer(backend, fluid, p0 = 1e5, T0 = 900)
T, p = ICT.trace()
plt.plot(T, p, '-', label = 'Ideal Curve', **kwargs)
print('Boyle')
BCT = BoyleCu... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
15226,
24331,
11,
629,
541,
88,
13,
40085,
1096,
628,
628,
628,
198,
198,
1891,
437,
796,
705,
13909,
2640,
6,
198,
35522,
312,
... | 2.188849 | 556 |
# -*- coding: utf-8 -*-
"""
Practical Algorthns
Problem set: 5.1 - Working with Data Structures
2d and 3a
"""
from timeit import default_timer as timer
import sys
N = 1_000_000
# 2d
"""
Create a list of a million elements, populated with the
first million natural numbers. Using a for loop, (so no direct
formula... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
47,
36112,
978,
70,
1506,
5907,
198,
40781,
900,
25,
642,
13,
16,
532,
14594,
351,
6060,
32112,
942,
198,
198,
17,
67,
290,
513,
64,
198,
198,
37811,
198... | 2.835681 | 426 |
from __future__ import print_function, division, absolute_import
import time
from robust_serial import write_order, Order, write_i8, write_i16, read_i8, read_order
from robust_serial.utils import open_serial_port
if __name__ == '__main__':
try:
serial_file = open_serial_port(baudrate=115200, timeout=Non... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
7297,
11,
4112,
62,
11748,
198,
198,
11748,
640,
198,
198,
6738,
12373,
62,
46911,
1330,
3551,
62,
2875,
11,
8284,
11,
3551,
62,
72,
23,
11,
3551,
62,
72,
1433,
11,
1100,
62,
72,
... | 2.427126 | 494 |
# Generated by Django 2.2.8 on 2020-01-16 18:52
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import pyuploadcare.dj.models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
23,
319,
12131,
12,
486,
12,
1433,
1248,
25,
4309,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
142... | 3.065574 | 61 |
#!/usr/bin/env python
#coding=utf-8
import cv2
import numpy as np
import matplotlib.pyplot as plt
root = "/home/li/bag/0824/02"
if __name__ == '__main__':
x_data = []
y1_data = []
y2_data = []
offset_data = []
# read_csv()
# show_image()
imu_data = load_imu()
imu_x_data = imu_data[:... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
66,
7656,
28,
40477,
12,
23,
198,
11748,
269,
85,
17,
220,
220,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
15763,
... | 1.766074 | 1,462 |
import os
import sys
import numpy as np
if __name__ == '__main__':
if len(sys.argv) < 2 or sys.argv[1] not in ('p1', 'p2'):
print('you done did it wrong')
exit()
filename = os.path.join(sys.argv[0].split('/', 1)[0], 'input.txt')
lines = get_input(filename)
part = sys.argv[1:]
if 'p... | [
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
611,
18896,
7,
17597,
13,
853,
85,
8,
1279,
362,
393,
25064,
13,
853,
... | 2.046154 | 195 |
"""
switchboard.helpers
~~~~~~~~~~~~~~~~
:copyright: (c) 2015 Kyle Adams.
:license: Apache License 2.0, see LICENSE for more details.
"""
from webob import Request
class MockRequest(Request):
"""
A mock request object which stores a user
instance and the ip address.
"""
| [
37811,
198,
31943,
3526,
13,
16794,
364,
198,
27156,
198,
198,
25,
22163,
4766,
25,
357,
66,
8,
1853,
14316,
12620,
13,
198,
25,
43085,
25,
24843,
13789,
362,
13,
15,
11,
766,
38559,
24290,
329,
517,
3307,
13,
198,
37811,
198,
198,
... | 3.258427 | 89 |
import os, sys
import unittest, time
import pdb
from testconfig import this_trick, tests_dir
from WorkflowCommon import *
def suite():
"""Create test suite from WorkflowCommonTestCase unit test class and return"""
return unittest.TestLoader().loadTestsFromTestCase(WorkflowCommonTestCase)
| [
11748,
28686,
11,
25064,
198,
11748,
555,
715,
395,
11,
640,
198,
11748,
279,
9945,
198,
6738,
1332,
11250,
1330,
428,
62,
2213,
624,
11,
5254,
62,
15908,
198,
6738,
5521,
11125,
17227,
1330,
1635,
198,
198,
4299,
18389,
33529,
198,
2... | 3.465116 | 86 |
#!/usr/bin/env python
import logging
import os
import subprocess
import sys
from setuptools import setup
from distutils.extension import Extension
logging.basicConfig()
log = logging.getLogger()
# Parse the version from the fiona module.
with open('rasterio/__init__.py') as f:
for line in f:
if line.find... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
6738,
1233,
26791,
13,
2302,
3004,
1330,
27995,
198,
198,
... | 2.240212 | 2,452 |
"""UUID utilities."""
from __future__ import annotations
from typing import Callable
from uuid import UUID, uuid4
def uuid(_uuid: Callable[[], UUID] = uuid4) -> str:
"""Generate unique id in UUID4 format.
See Also:
For now this is provided by :func:`uuid.uuid4`.
"""
return str(_uuid())
| [
37811,
52,
27586,
20081,
526,
15931,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
19720,
1330,
4889,
540,
198,
6738,
334,
27112,
1330,
471,
27586,
11,
334,
27112,
19,
628,
198,
4299,
334,
27112,
28264,
12303,
312,
25,
4889... | 2.669492 | 118 |
# -*- coding: utf8 -*-
"""
This is part of shot detector.
Produced by w495 at 2017.05.04 04:18:27
"""
from __future__ import absolute_import, division, print_function
import logging
from .base_stat_swfilter import BaseSWFilter
class DebugSWFilter(BaseSWFilter):
"""
...
"""
__logger = lo... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
23,
532,
9,
12,
198,
37811,
198,
220,
220,
220,
770,
318,
636,
286,
2823,
31029,
13,
198,
220,
220,
220,
21522,
771,
416,
266,
33781,
379,
2177,
13,
2713,
13,
3023,
8702,
25,
1507,
25,
1983,
... | 1.803008 | 665 |
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 16 23:11:56 2017
@author: Flamingo
"""
import pandas as pd
import numpy as np
import datetime
import copy
import sys
sys.path.append('../TOOLS')
from IJCAI2017_TOOL import *
#%% readin shop data
HOLI = pd.read_csv('../additional/HOLI.csv')
HOLI = HOLI.set_index(['DAT... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
26223,
3158,
1467,
2242,
25,
1157,
25,
3980,
2177,
198,
198,
31,
9800,
25,
1610,
3723,
78,
198,
37811,
628,
198,
11748,
19798,
292,
355,
279,
6... | 1.902205 | 6,667 |
import unittest
from pony.orm import *
from pony.orm.tests.testutils import *
from pony.orm.tests import setup_database, teardown_database
db = Database()
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
198,
6738,
26902,
13,
579,
1330,
1635,
198,
6738,
26902,
13,
579,
13,
41989,
13,
9288,
26791,
1330,
1635,
198,
6738,
26902,
13,
579,
13,
41989,
1330,
9058,
62,
48806,
11,
573,
446,
593,
62,
48806,
198,
198... | 2.915493 | 71 |
"""
An IPython FileContentsManager that uses Postgres for checkpoints.
"""
from __future__ import unicode_literals
from .api_utils import (
_decode_unknown_from_base64,
outside_root_to_404,
reads_base64,
to_b64,
writes_base64,
)
from .managerbase import PostgresManagerMixin
from .query import (
... | [
37811,
198,
2025,
6101,
7535,
9220,
15842,
13511,
326,
3544,
2947,
34239,
329,
36628,
13,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
764,
15042,
62,
26791,
1330,
357,
198,
220,
220,
220,... | 2.127672 | 1,731 |
__all__ = ['BinaryCmdEncoder']
import struct
from tron import Misc
from .CommandEncoder import CommandEncoder
| [
834,
439,
834,
796,
37250,
33,
3219,
40109,
27195,
12342,
20520,
198,
198,
11748,
2878,
198,
198,
6738,
491,
261,
1330,
29882,
198,
198,
6738,
764,
21575,
27195,
12342,
1330,
9455,
27195,
12342,
628
] | 3.352941 | 34 |
#!/bin/env python
| [
2,
48443,
8800,
14,
24330,
21015,
198
] | 2.571429 | 7 |
from datetime import datetime
from peewee import AutoField
from peewee import DateTimeField
from peewee import ForeignKeyField
from peewee import TextField
from peewee import IntegerField
from bot.models.base import Base
from bot.models.user import User
| [
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
613,
413,
1453,
1330,
11160,
15878,
198,
6738,
613,
413,
1453,
1330,
7536,
7575,
15878,
198,
6738,
613,
413,
1453,
1330,
8708,
9218,
15878,
198,
6738,
613,
413,
1453,
1330,
8255,
15878... | 3.724638 | 69 |
import pyeapi
from pprint import pprint
import argparse
if __name__ == '__main__':
main()
| [
11748,
279,
5948,
15042,
198,
6738,
279,
4798,
1330,
279,
4798,
198,
11748,
1822,
29572,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
198
] | 2.823529 | 34 |
@iso_register("US-SC")
class SouthCarolina(UnitedStates):
"""South Carolina"""
FIXED_HOLIDAYS = UnitedStates.FIXED_HOLIDAYS + ((5, 10, "Confederate Memorial Day"),)
include_thanksgiving_friday = True
include_christmas_eve = True
include_boxing_day = True
include_columbus_day = False | [
31,
26786,
62,
30238,
7203,
2937,
12,
6173,
4943,
198,
4871,
2520,
9914,
47196,
7,
17013,
42237,
2599,
198,
197,
37811,
14942,
5913,
37811,
198,
197,
47084,
1961,
62,
39,
3535,
2389,
4792,
50,
796,
1578,
42237,
13,
47084,
1961,
62,
39... | 2.861386 | 101 |
import unittest
import requests as req
from app.config.config import HOST
from app.api.base.base_name import *
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
11748,
7007,
355,
43089,
198,
6738,
598,
13,
11250,
13,
11250,
1330,
367,
10892,
198,
6738,
598,
13,
15042,
13,
8692,
13,
8692,
62,
3672,
1330,
1635,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
... | 2.890909 | 55 |
import pickle
import argparse
import json
from copy import deepcopy
import numpy as np
import grr.GIF_network as gfn
from grr.Tools import check_dict_fields
#%% PARSE COMMANDLINE ARGUMENTS
parser = argparse.ArgumentParser()
parser.add_argument(
'--mods', type=str, required=True, help='Pickled neuron models.'
)... | [
11748,
2298,
293,
198,
11748,
1822,
29572,
198,
11748,
33918,
198,
6738,
4866,
1330,
2769,
30073,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
11748,
1036,
81,
13,
38,
5064,
62,
27349,
355,
308,
22184,
198,
6738,
1036,
81,
13,
3... | 2.36996 | 1,265 |
"""
Script to upload secrets to AWS SSM Parameter Store and tag them appropriately
This script will read your secret value from the clipboard automagically
"""
import click
import pyperclip
from colorama import init, Fore
from upside.enforcer.upload.util import upload_secret, secret_key_pattern
from upside.enforcer.u... | [
37811,
198,
7391,
284,
9516,
13141,
284,
30865,
6723,
44,
25139,
2357,
9363,
290,
7621,
606,
20431,
198,
1212,
4226,
481,
1100,
534,
3200,
1988,
422,
262,
47999,
3557,
39066,
198,
37811,
198,
198,
11748,
3904,
198,
11748,
12972,
525,
15... | 3.424242 | 330 |
from django.conf.urls import url
from core.views import MediaUploadView, MediaHierarchyView
urlpatterns = [
url(r'^$', MediaUploadView.as_view(), name='media_upload'),
url(r'^files/$', MediaHierarchyView.as_view(), name='media_view'),
]
| [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
198,
6738,
4755,
13,
33571,
1330,
6343,
41592,
7680,
11,
6343,
39,
959,
9282,
7680,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
3,
3256,
6... | 2.806818 | 88 |
import random
from app.generator.utils import *
from PIL import Image, ImageColor, ImageFont, ImageDraw, ImageFilter
from app.utils import image_utils
# 旋转函数
def random_rotate(img):
''' ______________
| / /|
| / / |
|/________/__|
旋转可能有两种情况,一种是矩形,一种是平行四边形,
但是... | [
11748,
4738,
198,
6738,
598,
13,
8612,
1352,
13,
26791,
1330,
1635,
198,
6738,
350,
4146,
1330,
7412,
11,
7412,
10258,
11,
7412,
23252,
11,
7412,
25302,
11,
7412,
22417,
198,
6738,
598,
13,
26791,
1330,
2939,
62,
26791,
628,
198,
2,
... | 1.347032 | 438 |
import random
myList = randomListGenerator()
output = min(myList)
print(myList)
print(output) | [
11748,
4738,
220,
628,
198,
198,
1820,
8053,
796,
4738,
8053,
8645,
1352,
3419,
198,
22915,
796,
949,
7,
1820,
8053,
8,
198,
4798,
7,
1820,
8053,
8,
198,
4798,
7,
22915,
8
] | 2.939394 | 33 |
import cv2
import numpy as np
import torch
from torchvision import transforms
from torch import nn
from torch.nn import init
import torch.nn.functional as F
import functools
import math
import warnings
def image_float_to_uint8(img):
"""
Convert a float image (0.0-1.0) to uint8 (0-255)
"""
vmin = np.mi... | [
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
28034,
10178,
1330,
31408,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
28034,
13,
20471,
1330,
2315,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376... | 2.12512 | 6,250 |
# -*- coding: utf-8
"""Module for testing reading charactersitic lines.
This file is part of project TESPy (github.com/oemof/tespy). It's copyrighted
by the contributors recorded in the version control history of the file,
available from its original location
tests/test_tools/test_characteristics.py
SPDX-License-Ide... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
26796,
329,
4856,
3555,
3435,
16233,
3951,
13,
198,
198,
1212,
2393,
318,
636,
286,
1628,
309,
1546,
20519,
357,
12567,
13,
785,
14,
78,
368,
1659,
14,
4879,
9078,
737,
... | 2.426471 | 3,196 |
import paho.mqtt.client as mqtt
import uuid
import ssl
import json
from typing import Dict, List
# pip install paho-mqtt
TOPIC = 'myTopic'
QOS = 2 # 0, 1 or 2
# read about qos here: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels/
# and here: https://www.rabbitmq.com/mqtt.html#featur... | [
11748,
279,
17108,
13,
76,
80,
926,
13,
16366,
355,
285,
80,
926,
198,
11748,
334,
27112,
198,
11748,
264,
6649,
198,
11748,
33918,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
198,
198,
2,
7347,
2721,
279,
17108,
12,
76,
80,
926,
... | 2.763401 | 541 |
#
# @component {
# "kind" : "viz",
# "language" : "py",
# "description" : "Plots grayscale images",
# "permissions": "public",
# "properties": [
# { "name": "Number to plot" , "field": "count", "kind": "integer", "min": 1, "max": 1000, "required": true, "default": 9 },
# { "name": "Number of columns" , "fiel... | [
2,
220,
201,
198,
2,
2488,
42895,
1391,
201,
198,
2,
197,
1,
11031,
1,
1058,
366,
85,
528,
1600,
201,
198,
2,
197,
1,
16129,
1,
1058,
366,
9078,
1600,
201,
198,
2,
197,
1,
11213,
1,
1058,
366,
3646,
1747,
1036,
592,
38765,
426... | 2.380645 | 310 |
# Generated by Django 3.2.4 on 2021-06-13 02:53
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
19,
319,
33448,
12,
3312,
12,
1485,
7816,
25,
4310,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
"""User support functions and definitions."""
import dataclasses
import typing
from . import mongo, core
@dataclasses.dataclass
class User(core.ModelBase):
"""Representation of authenticated user."""
email: str
is_admin: bool = False
roles: typing.List = dataclasses.field(default_factory=list)
def... | [
37811,
12982,
1104,
5499,
290,
17336,
526,
15931,
198,
11748,
4818,
330,
28958,
198,
11748,
19720,
198,
198,
6738,
764,
1330,
285,
25162,
11,
4755,
628,
198,
31,
19608,
330,
28958,
13,
19608,
330,
31172,
198,
4871,
11787,
7,
7295,
13,
... | 3.075342 | 146 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
2,
15069,
1853,
383,
309,
22854,
37535,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
... | 3.577096 | 1,109 |
#!/usr/bin/env python3
import os, sys
import getpass
import tempfile
import subprocess
"""
Install Snakemake
This script runs the necessary commands to install Snakemake.
"""
if __name__=="__main__":
install_snakemake_the_slightly_easier_way()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
28686,
11,
25064,
198,
11748,
651,
6603,
198,
11748,
20218,
7753,
198,
11748,
850,
14681,
198,
198,
37811,
198,
15798,
16705,
15883,
198,
198,
1212,
4226,
4539,
262,
3306,
972... | 2.747475 | 99 |
#!/usr/bin/env python
import sys
from cdrouter import CDRouter
from cdrouter.highlights import Highlight
if len(sys.argv) < 3:
print('usage: <base_url> <token>')
sys.exit(1)
base = sys.argv[1]
token = sys.argv[2]
c = CDRouter(base, token=token)
for r in c.results.iter_list(sort=['-id']):
for tr in c.t... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
25064,
198,
198,
6738,
22927,
472,
353,
1330,
6458,
49,
39605,
198,
6738,
22927,
472,
353,
13,
8929,
8091,
1330,
3334,
2971,
198,
198,
361,
18896,
7,
17597,
13,
853,
85,
... | 2.005976 | 502 |
from my_devices import device_list
from my_functions import napalm_connect
if __name__ == "__main__":
connection = []
for device in device_list:
conn = napalm_connect(device)
connection.append(conn)
for conn in connection:
print(conn)
conn.load_merge_candidate(filename="{}... | [
6738,
616,
62,
42034,
1330,
3335,
62,
4868,
198,
6738,
616,
62,
12543,
2733,
1330,
25422,
38182,
62,
8443,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
4637,
796,
17635,
198,
220,
220,
220,
... | 2.400722 | 277 |
#! /usr/bin/env python3
import sys
DIRECTIONS = [(0, -1), (-1, 0), (1, 0), (0, 1)]
if __name__ == '__main__':
if len(sys.argv) != 2:
sys.exit('Usage: %s (1|2)' % sys.argv[0])
if sys.argv[1] == '1':
print(run_1(sys.stdin.read()))
elif sys.argv[1] == '2':
print(run_2(sys... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
25064,
198,
198,
17931,
23988,
11053,
796,
47527,
15,
11,
532,
16,
828,
13841,
16,
11,
657,
828,
357,
16,
11,
657,
828,
357,
15,
11,
352,
15437,
628,
628,
628,
628,
... | 1.882075 | 212 |
# flake8: noqa
from catalyst.core.callback import *
from catalyst.core.callbacks import *
from .confusion_matrix import ConfusionMatrixCallback
from .inference import InferCallback
from .meter import MeterMetricsCallback
from .metrics import (
AccuracyCallback,
AUCCallback,
ClasswiseIouCallback,
Class... | [
2,
781,
539,
23,
25,
645,
20402,
198,
198,
6738,
31357,
13,
7295,
13,
47423,
1330,
1635,
198,
6738,
31357,
13,
7295,
13,
13345,
10146,
1330,
1635,
198,
198,
6738,
764,
10414,
4241,
62,
6759,
8609,
1330,
7326,
4241,
46912,
47258,
198,
... | 2.995261 | 211 |
import time
class Deadline:
"""It is convenient to use this class instead of timeout variable if the
timeout variable is accessed multiple times inside a function.
"""
@property
@property
@property
| [
11748,
640,
628,
198,
4871,
35954,
25,
198,
220,
220,
220,
37227,
1026,
318,
11282,
284,
779,
428,
1398,
2427,
286,
26827,
7885,
611,
262,
198,
220,
220,
220,
26827,
7885,
318,
17535,
3294,
1661,
2641,
257,
2163,
13,
198,
220,
220,
... | 3.603175 | 63 |
import time
import cv2
import numpy as np
from tqdm import tqdm
data = np.load('pts.npz')
src_pts = data['src_pts']
dst_pts = data['dst_pts']
num_tests = 100000
start = time.time()
for _ in tqdm(range(num_tests)):
H, mask = cv2.findHomography(src_pts, dst_pts, cv2.RANSAC, 5.0)
elapsed_time = time.time() - star... | [
11748,
640,
198,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
198,
7890,
796,
45941,
13,
2220,
10786,
457,
82,
13,
37659,
89,
11537,
198,
10677,
62,
457,
82,
796,... | 2.376471 | 170 |
from queue import Queue
from typing import TYPE_CHECKING, Any, Dict, Type, Union, Optional
import pytest
from nonebug.base import BaseApp, Context
from .model import Api, Send, Model
from .fake import make_fake_bot, make_fake_adapter
if TYPE_CHECKING:
from nonebot.adapters import Bot, Event, Adapter, Message, M... | [
6738,
16834,
1330,
4670,
518,
198,
6738,
19720,
1330,
41876,
62,
50084,
2751,
11,
4377,
11,
360,
713,
11,
5994,
11,
4479,
11,
32233,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
4844,
25456,
13,
8692,
1330,
7308,
4677,
11,
30532,
198... | 3.294118 | 102 |
from cursor import device
from cursor import path
from cursor import filter
import json
import random
from alive_progress import alive_bar
if __name__ == "__main__":
# recordings = data.DataDirHandler().recordings()
# _loader = loader.Loader(directory=recordings, limit_files=1)
# pc = _loader.all_path... | [
6738,
23493,
1330,
3335,
198,
6738,
23493,
1330,
3108,
198,
6738,
23493,
1330,
8106,
198,
198,
11748,
33918,
198,
11748,
4738,
198,
6738,
6776,
62,
33723,
1330,
6776,
62,
5657,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
... | 1.970381 | 1,418 |
#
# Copyright (c) 2019 ISP RAS (http://www.ispras.ru)
# Ivannikov Institute for System Programming of the Russian Academy of Sciences
#
# 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
#
# h... | [
2,
198,
2,
15069,
357,
66,
8,
13130,
33086,
371,
1921,
357,
4023,
1378,
2503,
13,
271,
1050,
292,
13,
622,
8,
198,
2,
16975,
1236,
1134,
709,
5136,
329,
4482,
30297,
286,
262,
3394,
8581,
286,
13473,
198,
2,
198,
2,
49962,
739,
... | 3.905138 | 506 |
#!/usr/bin/env python3
import sys
import os
sys.path.append("../lib/")
sys.path.append("../io_path/")
from datetime import datetime
import subprocess
import psutil
import signal
import ibofos
import ibofos_constant
import cli
import json_parser
import spdk_rpc
import TEST
import TEST_LOG
import TEST_DEBUGGING
##... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
25064,
198,
11748,
28686,
198,
198,
17597,
13,
6978,
13,
33295,
7203,
40720,
8019,
14,
4943,
198,
17597,
13,
6978,
13,
33295,
7203,
40720,
952,
62,
6978,
14,
4943,
198,... | 3.984496 | 129 |
import hug
@hug.cli()
@hug.get('/')
| [
11748,
16225,
198,
198,
31,
71,
1018,
13,
44506,
3419,
198,
31,
71,
1018,
13,
1136,
10786,
14,
11537,
628
] | 1.9 | 20 |
from core import messages
from core.weexceptions import FatalException
from mako import template
from core.config import sessions_path, sessions_ext
from core.loggers import log, dlog, stream_handler
from core.module import Status
import os
import yaml
import glob
import logging
import urllib.parse
import atexit
import... | [
6738,
4755,
1330,
6218,
198,
6738,
4755,
13,
732,
1069,
11755,
1330,
41815,
16922,
198,
6738,
285,
25496,
1330,
11055,
198,
6738,
4755,
13,
11250,
1330,
10991,
62,
6978,
11,
10991,
62,
2302,
198,
6738,
4755,
13,
6404,
5355,
1330,
2604,
... | 3.08 | 150 |
"""Celery tasks for stories"""
from datetime import timedelta
from pathlib import Path
import re
from celery import shared_task
from celery.schedules import crontab
from celery.task import periodic_task
from celery.utils.log import get_task_logger
from django.core.cache import cache
from django.db.models import F, Q
... | [
37811,
34,
417,
1924,
8861,
329,
3923,
37811,
198,
198,
6738,
4818,
8079,
1330,
28805,
12514,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
302,
198,
198,
6738,
18725,
1924,
1330,
4888,
62,
35943,
198,
6738,
18725,
1924,
13,
1416,
704... | 2.551335 | 974 |
import os
import sys
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('GtkSource', '3.0')
from gi.repository import Gtk, GtkSource, GLib, Gio
MENU_XML = """
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<menu id="menubar">
<submenu>
<attribute name="label" translatable="yes">ファイル</attrib... | [
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
308,
72,
198,
12397,
13,
46115,
62,
9641,
10786,
38,
30488,
3256,
705,
18,
13,
15,
11537,
198,
12397,
13,
46115,
62,
9641,
10786,
38,
30488,
7416,
3256,
705,
18,
13,
15,
11537,
198,
... | 2.179874 | 795 |
from Bio import SeqIO
from Bio.Seq import Seq
import random
import math
###########################################################
################### SDU ###################
###########################################################
###########################################################
#####... | [
6738,
16024,
1330,
1001,
80,
9399,
198,
6738,
16024,
13,
4653,
80,
1330,
1001,
80,
198,
11748,
4738,
198,
11748,
10688,
628,
198,
29113,
14468,
7804,
21017,
198,
14468,
21017,
220,
220,
220,
220,
220,
220,
220,
220,
9834,
52,
220,
220... | 2.085448 | 13,002 |
import string
# convert text in lyrics to lower case and removes all punctuations
# e.g !"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~
with open("lyricsData.txt","x",encoding="UTF-8") as new:
with open("lyrics.txt","r") as lines:
for line in lines:
line = line.lower() # convert words to lower case
... | [
11748,
4731,
198,
198,
2,
10385,
2420,
287,
15844,
284,
2793,
1339,
290,
20694,
477,
21025,
6055,
198,
2,
304,
13,
70,
220,
2474,
29953,
4,
5,
43054,
3419,
9,
10,
12095,
19571,
25,
26,
27,
14804,
30,
31,
58,
6852,
60,
61,
62,
63... | 2.291367 | 278 |
import os
from unittest import TestCase
from pathlib import Path
import PIL
import torch
import clip
import numpy as np
from clip_mania.core.executor import ModelExecutor
from clip_mania.utils.data.preprocess import DatasetProcessor
| [
11748,
28686,
198,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
350,
4146,
198,
198,
11748,
28034,
198,
11748,
10651,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
106... | 3.380282 | 71 |
import click
from popper import __version__ as popper_version
from popper.cli import pass_context, log
@click.command('version', short_help='Show version of Popper and exit.')
@pass_context
def cli(ctx):
"""Displays version of Popper and exit.
"""
# Args:
# ctx(Popper.cli.context): For process int... | [
11748,
3904,
198,
198,
6738,
745,
2848,
1330,
11593,
9641,
834,
355,
745,
2848,
62,
9641,
198,
6738,
745,
2848,
13,
44506,
1330,
1208,
62,
22866,
11,
2604,
628,
198,
31,
12976,
13,
21812,
10786,
9641,
3256,
1790,
62,
16794,
11639,
153... | 2.701422 | 211 |
# Copyright 2017 Red Hat, 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, ... | [
2,
15069,
2177,
2297,
10983,
11,
3457,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
... | 3.235589 | 399 |
import os
import platform
from pathlib import Path
ROOT = os.path.abspath(os.path.dirname(__file__))
def find_platform_location(dir_type):
"""
Attempt to find and create operating system data folders
"""
if platform.system() == "Linux":
home_dir = os.path.expanduser("~")
if dir_type ... | [
11748,
28686,
198,
11748,
3859,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
13252,
2394,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
4008,
628,
198,
198,
4299,
1064,
62,
24254,
6... | 2.259191 | 1,632 |
import attr
from pyspark import StorageLevel
from geo_pyspark.core.jvm.abstract import JvmObject
from geo_pyspark.register.java_libs import GeoSparkLib
from geo_pyspark.utils.decorators import require
@attr.s | [
11748,
708,
81,
198,
6738,
279,
893,
20928,
1330,
20514,
4971,
198,
198,
6738,
40087,
62,
79,
893,
20928,
13,
7295,
13,
73,
14761,
13,
397,
8709,
1330,
449,
14761,
10267,
198,
6738,
40087,
62,
79,
893,
20928,
13,
30238,
13,
12355,
6... | 2.944444 | 72 |
# MIT License
#
# Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2020
#
# 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
# r... | [
2,
17168,
13789,
198,
2,
198,
2,
15069,
357,
34,
8,
383,
1215,
690,
36098,
3851,
436,
1108,
16984,
3524,
357,
7227,
8,
46665,
12131,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257... | 3.399015 | 609 |
""" A IceController Module """
from masonite.controllers import Controller
from masonite.request import Request
from app.Ice import Ice
| [
37811,
317,
6663,
22130,
19937,
37227,
198,
198,
6738,
285,
888,
578,
13,
3642,
36667,
1330,
22741,
198,
6738,
285,
888,
578,
13,
25927,
1330,
19390,
198,
6738,
598,
13,
23709,
1330,
6663,
198
] | 4.029412 | 34 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
16529,
35937,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
198,
2,
5964,
1321... | 2.988411 | 604 |
#! /usr/bin/env python3
import re
with open('input/day5') as input:
polymer = list(map(lambda x: x.strip(), input.readlines()))[0]
x = polymer
x = react(x)
print("Part 1: %d" % len(x))
shortest = len(polymer)
begin = ord('a')
for i in range(26):
x = polymer
lower, upper = chr(begin + i), chr(begin + i).upper()... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
302,
198,
198,
4480,
1280,
10786,
15414,
14,
820,
20,
11537,
355,
5128,
25,
198,
197,
35428,
647,
796,
1351,
7,
8899,
7,
50033,
2124,
25,
2124,
13,
36311,
22784,
5128,
... | 2.488889 | 225 |
import os
# comment char
_COMMENT_CHAR = '#'
def read_list_from_file(fn: str, items_per_line=None, separator=None, comment_char=_COMMENT_CHAR):
"""
Read a list from given file
Note: list file is organized by lines, comments are started with _COMMENT_CHAR
:param fn: file name
:param items_per_lin... | [
11748,
28686,
628,
198,
2,
2912,
1149,
198,
62,
9858,
10979,
62,
38019,
796,
705,
2,
6,
628,
198,
4299,
1100,
62,
4868,
62,
6738,
62,
7753,
7,
22184,
25,
965,
11,
3709,
62,
525,
62,
1370,
28,
14202,
11,
2880,
1352,
28,
14202,
11... | 2.404762 | 420 |
from . import (
social_media,
code_hosting,
code_packaging,
website_analytics,
outputs,
email,
forums,
forum_categories,
example
)
__all__ = ['social_media', 'code_hosting', 'code_packaging',
'website_analytics', 'outputs', 'email', 'forums',
'forum_categories'... | [
6738,
764,
1330,
357,
198,
220,
220,
220,
1919,
62,
11431,
11,
198,
220,
220,
220,
2438,
62,
4774,
278,
11,
198,
220,
220,
220,
2438,
62,
8002,
3039,
11,
198,
220,
220,
220,
3052,
62,
38200,
14094,
11,
198,
220,
220,
220,
23862,
... | 2.296552 | 145 |
from qubiter.SEO_writer import *
import qubiter.utilities_gen as utg
from shutil import copyfile
class CodaSEO_writer(SEO_writer):
"""
This class is a child of class `SEO_writer`. The constructor of this
class accepts as input the paths to a pair of well-formed initial
English and Picture files. The c... | [
6738,
627,
2545,
263,
13,
50,
4720,
62,
16002,
1330,
1635,
198,
11748,
627,
2545,
263,
13,
315,
2410,
62,
5235,
355,
3384,
70,
198,
6738,
4423,
346,
1330,
4866,
7753,
628,
198,
4871,
327,
11329,
50,
4720,
62,
16002,
7,
50,
4720,
6... | 2.139095 | 2,430 |
from pprint import pprint
from string import Template
from decoderGenerator import getDecodeTree, getSwitch
opCodes = {
"00 000000": ("", "NOP", []),
"00 001000": ("", "LD ${N}, SP", []),
"00 RR 0001": ("", "LD ${R}, ${N}", []),
"00 RR 1001": ("", "ADD HL, ${R}", []),
"00 0r 0 010": ("", "LD ${R}, ... | [
6738,
279,
4798,
1330,
279,
4798,
198,
6738,
4731,
1330,
37350,
198,
6738,
875,
12342,
8645,
1352,
1330,
651,
10707,
1098,
27660,
11,
651,
38978,
198,
198,
404,
34,
4147,
796,
1391,
198,
220,
220,
220,
366,
405,
41853,
1298,
5855,
160... | 2.091854 | 1,154 |
import os
import sys
import pygame
import time
from pygame.locals import *
CAPTION = "Rescue Xiaomeng"
SCREEN_SIZE = (800, 600)
pygame.init()
pygame.display.set_caption(CAPTION)
screen = pygame.display.set_mode(SCREEN_SIZE)
xm = People()
xm.show()
run()
| [
11748,
28686,
198,
11748,
25064,
198,
11748,
12972,
6057,
198,
11748,
640,
198,
6738,
12972,
6057,
13,
17946,
874,
1330,
1635,
198,
198,
33177,
24131,
796,
366,
49,
3798,
518,
22450,
296,
1516,
1,
198,
6173,
2200,
1677,
62,
33489,
796,
... | 2.529412 | 102 |