content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import os
import sys
import json
import copy
import mdtraj
import numpy as np
import time
import pandas as pd
import pickle
import mdtraj as md
import multiprocessing as mp
try:
import cupy as cp
cudaExists = True
import kernel
except ImportError as e:
cudaExists = False
print("Can't load CuPy, cont... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
33918,
198,
11748,
4866,
198,
11748,
45243,
9535,
73,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
640,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2298,
293,
198,
11748,
45243,
9535,
... | 1.991736 | 726 |
#
# This file contains the Python code from Program 7.23 of
# "Data Structures and Algorithms
# with Object-Oriented Design Patterns in Python"
# by Bruno R. Preiss.
#
# Copyright (c) 2003 by Bruno R. Preiss, P.Eng. All rights reserved.
#
# http://www.brpreiss.com/books/opus7/programs/pgm07_23.txt
#
| [
2,
198,
2,
770,
2393,
4909,
262,
11361,
2438,
422,
6118,
767,
13,
1954,
286,
198,
2,
366,
6601,
32112,
942,
290,
978,
7727,
907,
198,
2,
351,
9515,
12,
46,
380,
4714,
8495,
47020,
287,
11361,
1,
198,
2,
416,
31045,
371,
13,
3771... | 2.903846 | 104 |
__author__ = 'gkour'
import numpy as np
import torch
from abstractbrain import AbstractBrain
import os.path
from standardbrainnetwork import AbstractNetwork
import utils
torch.device('cuda' if torch.cuda.is_available() else 'cpu')
| [
834,
9800,
834,
796,
705,
70,
74,
454,
6,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
12531,
27825,
1330,
27741,
44687,
198,
11748,
28686,
13,
6978,
198,
6738,
3210,
27825,
27349,
1330,
27741,
26245,
198,
1174... | 3.405797 | 69 |
# ############## SWITH TO SSL ON TOKEN
from twisted.internet import reactor, ssl
from twisted.internet.protocol import ServerFactory
from twisted.protocols.basic import LineReceiver
if __name__ == '__main__':
factory = ServerFactory()
factory.protocol = TLSServer
reactor.listenTCP(8000, factory)
react... | [
2,
1303,
7804,
4242,
2,
12672,
10554,
5390,
25952,
6177,
5390,
43959,
198,
6738,
19074,
13,
37675,
1330,
21905,
11,
264,
6649,
198,
6738,
19074,
13,
37675,
13,
11235,
4668,
1330,
9652,
22810,
198,
6738,
19074,
13,
11235,
4668,
82,
13,
... | 3.194175 | 103 |
#!/usr/bin/env python
"""Extend regular notebook server to be aware of multiuser things."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import os
try:
from urllib.parse import quote
except ImportError:
# PY2 Compat
from urllib import quote
import r... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
11627,
437,
3218,
20922,
4382,
284,
307,
3910,
286,
1963,
3754,
263,
1243,
526,
15931,
198,
198,
2,
15069,
357,
66,
8,
449,
929,
88,
353,
7712,
4816,
13,
198,
2,
4307,
6169,
... | 2.654077 | 1,668 |
from django.core.management.base import BaseCommand
from grievance.models import *
from django.contrib.auth.models import User
| [
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
198,
6738,
47645,
13,
27530,
1330,
1635,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198
] | 3.848485 | 33 |
#!/usr/bin/env python2
import os,sys,glob,copy,re,shutil,collections,string
import glob
import re
from os.path import join, dirname
import math
#IS_catching_
list_of_files = glob.glob("./textFiles/microtubule*")
number_of_files_tmp = len( list_of_files )
for file in list_of_files:
print( file )
num... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
11748,
28686,
11,
17597,
11,
4743,
672,
11,
30073,
11,
260,
11,
1477,
22602,
11,
4033,
26448,
11,
8841,
198,
11748,
15095,
198,
11748,
302,
198,
6738,
28686,
13,
6978,
1330,
4654,
... | 2.159681 | 1,002 |
#!/usr/bin/env python
from __future__ import division, absolute_import, print_function
import os
import datetime
import glob
from jams.argsort import argsort
import numpy as np
__all__ = ['fullnames', 'fullnames_dates', 'fullnames_dates_sizes', 'fullnames_sizes',
'fullnames_times', 'fullnames_times_sizes',
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
11593,
37443,
834,
1330,
7297,
11,
4112,
62,
11748,
11,
3601,
62,
8818,
198,
11748,
28686,
198,
11748,
4818,
8079,
198,
11748,
15095,
198,
6738,
44147,
13,
22046,
419,
1330,
26498,... | 2.678761 | 38,641 |
#!/usr/bin/env python
# coding=utf-8
# (C) Copyright 2017 Hewlett Packard Enterprise Development LP
#
# 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,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
28,
40477,
12,
23,
198,
198,
2,
357,
34,
8,
15069,
2177,
30446,
15503,
6400,
446,
14973,
7712,
18470,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
1... | 3.156425 | 358 |
"""
Given a column title as appear in an Excel sheet, return its corresponding
column number.
For example:
A -> 1
B -> 2
C -> 3
...
Z -> 26
AA -> 27
AB -> 28
...
Example:
Input: "AB"
Output: 28
... | [
37811,
198,
220,
220,
220,
11259,
257,
5721,
3670,
355,
1656,
287,
281,
24134,
9629,
11,
1441,
663,
11188,
220,
198,
220,
220,
220,
5721,
1271,
13,
628,
220,
220,
220,
1114,
1672,
25,
628,
220,
220,
220,
220,
220,
220,
220,
220,
2... | 2.314121 | 347 |
import math
hueStepSize = 2.34 # 600 lumens divided into 8 bit
| [
11748,
10688,
198,
71,
518,
8600,
10699,
796,
362,
13,
2682,
220,
220,
1303,
10053,
46390,
641,
9086,
656,
807,
1643,
628
] | 3 | 22 |
# Run this file by right clicking it within the Project tab in the left pane, and then choose "Run test"
print("Hello world!")
print("Did i do this right?") | [
2,
5660,
428,
2393,
416,
826,
12264,
340,
1626,
262,
4935,
7400,
287,
262,
1364,
37218,
11,
290,
788,
3853,
366,
10987,
1332,
1,
198,
198,
4798,
7203,
15496,
995,
2474,
8,
198,
4798,
7203,
11633,
1312,
466,
428,
826,
1701,
8
] | 3.738095 | 42 |
import versioneer
from setuptools import setup, find_packages
setup(
name='miniast',
url='https://github.com/cpcloud/miniast',
packages=find_packages(),
python_requires='>=3.5',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description='Lightweight macros for Pytho... | [
11748,
2196,
28153,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
628,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
45313,
459,
3256,
198,
220,
220,
220,
19016,
11639,
5450,
1378,
12567,
13,
785,
14,
13155,
17... | 2.806452 | 155 |
import yaml
| [
11748,
331,
43695,
198
] | 3 | 4 |
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
2,
15069,
357,
66,
8,
2211,
30446,
15503,
12,
11869,
446,
7712,
5834,
11,
406,
13,
47,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
239... | 3.183815 | 865 |
{
"name" : "ZK Biometric Device Integration Kware (ZKTECO) Demo (UDP)",
"version" : "1.0",
"author" : "JUVENTUD PRODUCTIVA VENEZOLANA",
"category" : "HR",
"website" : "https://www.youtube.com/channel/UCTj66IUz5M-QV15Mtbx_7yg",
"description": "Module for the connection between odoo and zkteco dev... | [
90,
198,
220,
220,
220,
366,
3672,
1,
1058,
366,
57,
42,
8436,
16996,
16232,
38410,
509,
1574,
357,
57,
42176,
2943,
46,
8,
34588,
357,
52,
6322,
42501,
198,
220,
220,
220,
366,
9641,
1,
1058,
366,
16,
13,
15,
1600,
198,
220,
22... | 2.5 | 296 |
import STM32
import PikaPiZero
import PikaStdLib
time = STM32.Time()
uart = STM32.UART()
uart.init()
uart.setId(1)
uart.enable()
print('initing rgb...')
rgb = PikaPiZero.RGB()
rgb.init()
rgb.enable()
print('init rgb ok!')
mem = PikaStdLib.MemChecker()
print('mem max:')
mem.max()
while True:
time.sleep_ms(50)
... | [
11748,
3563,
44,
2624,
198,
11748,
350,
9232,
38729,
28667,
198,
11748,
350,
9232,
1273,
67,
25835,
198,
2435,
796,
3563,
44,
2624,
13,
7575,
3419,
198,
19986,
796,
3563,
44,
2624,
13,
52,
7227,
3419,
198,
198,
19986,
13,
15003,
3419,... | 2.273973 | 146 |
import logging
import typing
import gym
import numpy as np
from DeepRL.Env import EnvAbstract, EnvState
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger()
logger.setLevel(logging.INFO)
| [
11748,
18931,
198,
11748,
19720,
198,
198,
11748,
11550,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
10766,
7836,
13,
4834,
85,
1330,
2039,
85,
23839,
11,
2039,
85,
9012,
198,
198,
6404,
2667,
13,
35487,
16934,
7,
5715,
28,
64... | 2.971429 | 70 |
# -*- coding: utf-8 -*-
#
# utils.py
#
# Copyright (C) libracore, 2017-2020
# https://www.libracore.com or https://github.com/libracore
#
# For information on ERPNext, refer to https://erpnext.org/
#
import frappe
import json
import urllib.parse
import six
import pdfkit, os
from frappe import _, attach_... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
2,
201,
198,
2,
3384,
4487,
13,
9078,
201,
198,
2,
201,
198,
2,
15069,
357,
34,
8,
300,
2889,
330,
382,
11,
2177,
12,
42334,
201,
198,
2,
3740,
1378,
2503,
... | 2.114286 | 525 |
import os
import random
from dataclasses import dataclass
from typing import Optional, List
VOICES_FOLDER = os.path.abspath(os.path.join(os.path.dirname(__file__), 'voices'))
@dataclass
@dataclass
__all__ = [
'VOICES_FOLDER',
'VoiceFile',
'Voice'
]
| [
11748,
28686,
198,
11748,
4738,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
19720,
1330,
32233,
11,
7343,
628,
198,
29516,
34444,
62,
37,
3535,
14418,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,... | 2.46789 | 109 |
#!/usr/bin/env python3
import requests
from bs4 import BeautifulSoup
import argparse
import sys
parser = argparse.ArgumentParser()
parser.add_argument("source", help="A WAPO or NYT article to pull in from a URL.")
parser.add_argument("-d", "--dest", help="filename to save article as. defaults to print to the screen")... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
7007,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
1822,
29572,
198,
11748,
25064,
198,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
198,
... | 2.976 | 375 |
#*****************************************************************************
# Copyright 2004-2008 Steve Menard
#
# 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... | [
2,
17174,
17174,
4557,
35625,
201,
198,
2,
220,
220,
15069,
5472,
12,
11528,
6542,
6065,
446,
201,
198,
2,
201,
198,
2,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
201,
198,
2,
22... | 2.695455 | 440 |
import numpy as np
from scipy import fftpack
import tensorly as tl
from unittest import TestCase
from ..util import square_tensor_gen, TensorInfoBucket, RandomInfoBucket, eval_rerr
from ..sketch import Sketch
import time
from tensorly.decomposition import tucker
from ..recover_from_sketches import SketchTwoPassRecover... | [
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
1330,
277,
701,
8002,
198,
11748,
11192,
273,
306,
355,
256,
75,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
6738,
11485,
22602,
1330,
6616,
62,
83,
22854,
62,
5235,
... | 3.274809 | 131 |
"""Example driving LED matrix"""
import random
import time
from buildhat import Matrix
matrix = Matrix('C')
matrix.clear(("red", 10))
time.sleep(1)
matrix.clear()
time.sleep(1)
matrix.set_pixel((0, 0), ("blue", 10))
matrix.set_pixel((2, 2), ("red", 10))
time.sleep(1)
while True:
out = [[(int(random.uniform(0... | [
37811,
16281,
5059,
12365,
17593,
37811,
198,
198,
11748,
4738,
198,
11748,
640,
198,
198,
6738,
1382,
5183,
1330,
24936,
198,
198,
6759,
8609,
796,
24936,
10786,
34,
11537,
198,
198,
6759,
8609,
13,
20063,
7,
7203,
445,
1600,
838,
4008... | 2.447059 | 170 |
from collections import OrderedDict
from fence.jwt.keys import load_keypairs
from tests import utils
def test_reconstruct_keys_dict(app, client):
"""
Test reconstructing the dictionary mapping key ids to public keys from the
return value from the public keys endpoint.
"""
response = client.get("... | [
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
198,
6738,
13990,
13,
73,
46569,
13,
13083,
1330,
3440,
62,
2539,
79,
3468,
198,
198,
6738,
5254,
1330,
3384,
4487,
628,
198,
4299,
1332,
62,
260,
41571,
62,
13083,
62,
11600,
7,
1324,
1... | 3.019481 | 154 |
# author: github/zabir-nabil | [
2,
1772,
25,
33084,
14,
89,
397,
343,
12,
77,
14991
] | 2.545455 | 11 |
"""
@author: Sriram Veturi
@title: SmartSearch - An Intelligent Search Engine.
@date: 05/06/2019
"""
import os
import math
import json
DATA_DIR = "./documents"
TF_IDF_FILES_DIR = "./tf_idf_files"
def generate_tf():
"""
Function to build the corpus for every document.
:return tf_dict: Ter Frequency Dictionary (Ma... | [
37811,
198,
31,
9800,
25,
21714,
343,
321,
49744,
9900,
198,
31,
7839,
25,
10880,
18243,
532,
1052,
49452,
11140,
7117,
13,
198,
31,
4475,
25,
8870,
14,
3312,
14,
23344,
198,
37811,
198,
198,
11748,
28686,
198,
11748,
10688,
198,
1174... | 2.628598 | 2,154 |
# https://git-scm.com/book/pt-br/v1/Primeiros-passos-No%C3%A7%C3%B5es-B%C3%A1sicas-de-Git
# Este é um progama para codificar em CN (Códogo Numerico)
alfabeto = {'\\n':'\\n','*':'*','-':'-','+':'+',' ':'=','!':'!','?':'?','.':'.',',':',',':':':',';':';','(':'(',')':')','a':'1','b':'2','c':'3','d':'4','e':'5','f':'6','g... | [
2,
3740,
1378,
18300,
12,
1416,
76,
13,
785,
14,
2070,
14,
457,
12,
1671,
14,
85,
16,
14,
26405,
72,
4951,
12,
6603,
418,
12,
2949,
4,
34,
18,
4,
32,
22,
4,
34,
18,
4,
33,
20,
274,
12,
33,
4,
34,
18,
4,
32,
16,
21383,
... | 1.902913 | 824 |
class BaseHTTPRequestError(Exception):
"""Base error for request responses."""
class NotFound(BaseHTTPRequestError):
"""Raised when the guild or user is not found."""
class InvalidToken(BaseHTTPRequestError):
"""Raised when the authentication key is invalid."""
class Ratelimited(BaseHTTPRequestError):... | [
4871,
7308,
40717,
18453,
12331,
7,
16922,
2599,
198,
220,
220,
220,
37227,
14881,
4049,
329,
2581,
9109,
526,
15931,
628,
198,
4871,
1892,
21077,
7,
14881,
40717,
18453,
12331,
2599,
198,
220,
220,
220,
37227,
21762,
1417,
618,
262,
19... | 3.674074 | 135 |
"""Support for reading vehicle status from BMW connected drive portal."""
from __future__ import annotations
from copy import copy
from dataclasses import dataclass
import logging
from bimmer_connected.const import SERVICE_ALL_TRIPS, SERVICE_LAST_TRIP, SERVICE_STATUS
from bimmer_connected.state import ChargingState
f... | [
37811,
15514,
329,
3555,
4038,
3722,
422,
19339,
5884,
3708,
17898,
526,
15931,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
4866,
1330,
4866,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
11748,
18931,
198,
198,... | 1.968484 | 12,343 |
# Programa para Clasificación de suelos mediante SUCS.
gravas, arenas, finos = 29, 67, 4
gruesos = gravas + arenas
pesoMuestra = gravas + arenas + finos
cu, cc = 3.4, 2.6
ll, lp = 52, 24
ip = ll - lp
pi = 0.73 * (ll - 20)
sueloOrganico = True
if (gruesos / pesoMuestra) > 0.5:
if (gravas / gruesos) > 0.5:
... | [
2,
6118,
64,
31215,
1012,
292,
811,
32009,
18840,
390,
424,
417,
418,
1117,
3014,
68,
13558,
7902,
13,
198,
198,
70,
4108,
292,
11,
46168,
11,
957,
418,
796,
2808,
11,
8275,
11,
604,
198,
48929,
274,
418,
796,
9067,
292,
1343,
461... | 1.679761 | 1,171 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# pip install Pillow
from PIL import Image
image_file = "Collapse all.png"
img = Image.open(image_file).convert('RGBA')
pixdata = img.load()
# Делаем темнее картинку, игнорируя фон
for y in range(img.size[1]):
for x in range(img.size[0]):
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
834,
9800,
834,
796,
705,
541,
21879,
1077,
6,
628,
198,
2,
7347,
2721,
19770,
322,
198,
6738,
350,
4146,
... | 1.957031 | 256 |
#! /usr/bin/env python
"""
read and write test for Storage System
liuyang1,mtime: 2012-12-04 13:18:11
"""
import os
from random import randint
import log
g_path="/home/liuy/video/"
g_logger=log.initLogging("RWT")
if __name__=="__main__":
main()
| [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
961,
290,
3551,
1332,
329,
20514,
4482,
198,
4528,
4669,
648,
16,
11,
76,
2435,
25,
2321,
12,
1065,
12,
3023,
1511,
25,
1507,
25,
1157,
220,
198,
37811,
198,
198,
117... | 2.525253 | 99 |
from slackbot.bot import Bot, listen_to, respond_to, default_reply
import re
import logging
import random
LOG_FORMAT = '%(asctime)-15s %(message)s'
logger = None
announce = "Received direct tweet (@sae @brian @otherdavid @ken @tgiordonell0): {0} {1}"
@listen_to('#slack2tweet (.*) (.*)', re.IGNORECASE)
@respond_to... | [
6738,
30740,
13645,
13,
13645,
1330,
18579,
11,
6004,
62,
1462,
11,
3031,
62,
1462,
11,
4277,
62,
47768,
198,
11748,
302,
198,
11748,
18931,
198,
11748,
4738,
628,
198,
25294,
62,
21389,
1404,
796,
705,
4,
7,
292,
310,
524,
13219,
1... | 2.193622 | 439 |
from twitter import *
import pyttsx
import APIKEYS
''' MYCREDS.txt has the following format:
oauthtokenvalue
oauthsecretvalue
'''
if __name__ == "__main__":
t = getTwitterByConfig()
timeline = getTimeline(t)
printTimeline(timeline)
engine = getSpeechEngine()
... | [
6738,
17044,
1330,
1635,
201,
198,
11748,
12972,
83,
912,
87,
201,
198,
11748,
7824,
7336,
16309,
201,
198,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
201,
198,
7061,
6,
17615,
9419,
... | 2.324503 | 151 |
# Copyright 2019 The Forte 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 applicable ... | [
2,
15069,
13130,
383,
6401,
68,
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,
351,
2... | 3.012433 | 563 |
# Copyright 2020 MONAI Consortium
# 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, s... | [
2,
15069,
12131,
25000,
20185,
42727,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,... | 3.694581 | 203 |
from __future__ import print_function
import argparse
import os
import stat
import sys
import re
import platform
import shutil
from lib import utils
from lib import compare
# test mode: create copy of reference files
# update mode: try to open file in p4 if necessary
# test mode: run perl script to compare referen... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
1185,
198,
11748,
25064,
198,
11748,
302,
198,
11748,
3859,
198,
11748,
4423,
346,
198,
6738,
9195,
1330,
3384,
4487,
198,
6738,
... | 2.954202 | 2,118 |
import pickle
import warnings
from datetime import datetime
import os
from typing import Callable, Dict, Iterable
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torchvision
from matplotlib import pyplot as plt
from sklearn.manifold import TSNE
from sklearn.model_selection import Stra... | [
11748,
2298,
293,
198,
11748,
14601,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
28686,
220,
198,
6738,
19720,
1330,
4889,
540,
11,
360,
713,
11,
40806,
540,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,... | 2.107578 | 2,296 |
#!/usr/bin/env python
# encoding: UTF-8
import json
from pprint import pprint
import datetime
import re
import sys
def parseJson():
''' Main application logic of parser. Parses the JSON file which contains the Azure subscription configuration and
it was generated by the Azurite Explorer. Converts the file to a JSON... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
41002,
12,
23,
198,
198,
11748,
33918,
198,
6738,
279,
4798,
1330,
279,
4798,
198,
11748,
4818,
8079,
198,
11748,
302,
198,
11748,
25064,
198,
198,
4299,
21136,
41,
1559,... | 2.881239 | 8,395 |
import numpy as np
from gym import utils
from gym.envs.mujoco import mujoco_env
# reacher-v1 state feature
| [
11748,
299,
32152,
355,
45941,
198,
6738,
11550,
1330,
3384,
4487,
198,
6738,
11550,
13,
268,
14259,
13,
76,
23577,
25634,
1330,
285,
23577,
25634,
62,
24330,
628,
220,
220,
220,
1303,
302,
3493,
12,
85,
16,
1181,
3895,
198
] | 2.8 | 40 |
#!/usr/bin/env python
from __future__ import annotations
from arenasdk.nodes.gpu_exclusive_node import GPUExclusiveNode
from arenasdk.nodes.gpu_exclusive_node import build_gpu_exclusive_nodes
from arenasdk.nodes.gpu_topology_node import GPUTopologyNode
from arenasdk.nodes.gpu_topology_node import build_gpu_topology_n... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
6738,
46168,
34388,
13,
77,
4147,
13,
46999,
62,
41195,
62,
17440,
1330,
11362,
3109,
5731,
19667,
198,
6738,
46168,
34388,
13,
77,
4147,
13,
... | 3.076577 | 222 |
"""Provides end-to-end flow to use machine learning models.
"""
__author__ = 'khanhtpd'
__date__ = '2021-12-01'
import math
from typing import Union
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
def count_missing_columns_rows(data: pd.DataFrame, figsize: tup... | [
37811,
15946,
1460,
886,
12,
1462,
12,
437,
5202,
284,
779,
4572,
4673,
4981,
13,
198,
37811,
198,
834,
9800,
834,
796,
705,
74,
7637,
4352,
30094,
6,
198,
834,
4475,
834,
796,
705,
1238,
2481,
12,
1065,
12,
486,
6,
628,
198,
1174... | 2.314928 | 6,719 |
#!/usr/bin/env python
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
15069,
2321,
3012,
3457,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
7... | 3.645418 | 251 |
#!usr/bin/python
# -*- coding: utf-8 -*-
import re
from torchvision.models.densenet import DenseNet, model_urls as imagenet_urls
from torchvision.models.utils import load_state_dict_from_url
from .utils import cnn_model
__all__ = ['densenet121', 'densenet169', 'densenet201', 'densenet161']
model_urls = {
'dense... | [
2,
0,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
302,
198,
6738,
28034,
10178,
13,
27530,
13,
67,
18756,
316,
1330,
360,
1072,
7934,
11,
2746,
62,
6371,
82,
355,
3... | 2.617135 | 2,241 |
import re
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
| [
11748,
302,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
3254,
24765,
12331,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
12582,
355,
4808,
628
] | 3.5 | 34 |
# Generated by Django 2.0.1 on 2018-02-08 13:16
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
13,
16,
319,
2864,
12,
2999,
12,
2919,
1511,
25,
1433,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import unittest
from visuanalytics.tests.analytics.transform.transform_test_helper import prepare_test
| [
11748,
555,
715,
395,
198,
198,
6738,
1490,
7258,
3400,
14094,
13,
41989,
13,
38200,
14094,
13,
35636,
13,
35636,
62,
9288,
62,
2978,
525,
1330,
8335,
62,
9288,
628
] | 3.5 | 30 |
import discord
import dispacher
import questions
import security
client = discord.Client()
@client.event
@client.event
client.run('<discord token>') | [
11748,
36446,
198,
11748,
4596,
3493,
198,
11748,
2683,
198,
11748,
2324,
198,
198,
16366,
796,
36446,
13,
11792,
3419,
628,
198,
31,
16366,
13,
15596,
198,
198,
31,
16366,
13,
15596,
628,
198,
16366,
13,
5143,
10786,
27,
15410,
585,
... | 3.5 | 44 |
import sys
import os
o_path = os.getcwd()
sys.path.append(o_path)
import Scraper.HuabanScraper as HuabanScraper
from multiprocessing import Pool
import multiprocessing
import configparser
config_file = 'config.ini'
con = configparser.ConfigParser()
con.read(config_file, encoding='utf-8')
section = con.sect... | [
11748,
25064,
201,
198,
11748,
28686,
201,
198,
78,
62,
6978,
796,
28686,
13,
1136,
66,
16993,
3419,
201,
198,
17597,
13,
6978,
13,
33295,
7,
78,
62,
6978,
8,
201,
198,
11748,
1446,
38545,
13,
38202,
45094,
3351,
38545,
355,
11256,
... | 2.31 | 300 |
from __future__ import print_function # For Py2/3 compatibility
import async_eel
import asyncio
loop = asyncio.get_event_loop()
@async_eel.expose # Expose this function to Javascript
if __name__ == '__main__':
asyncio.run_coroutine_threadsafe(main(), loop)
loop.run_forever()
| [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
197,
2,
1114,
9485,
17,
14,
18,
17764,
198,
11748,
30351,
62,
68,
417,
198,
11748,
30351,
952,
628,
198,
26268,
796,
30351,
952,
13,
1136,
62,
15596,
62,
26268,
3419,
628,
198,
31,
292,... | 2.52 | 125 |
from keras import Sequential
from keras.layers import Dense
from keras.activations import relu, linear
class PLAYER:
""" A trained agent that plays the game """
| [
6738,
41927,
292,
1330,
24604,
1843,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
360,
1072,
198,
6738,
41927,
292,
13,
15791,
602,
1330,
823,
84,
11,
14174,
198,
198,
4871,
28180,
1137,
25,
628,
220,
220,
220,
37227,
317,
8776,
5797,
... | 3.5 | 48 |
import numpy as np
import matplotlib.pyplot as plt
from .single_unit import PSTH
def crosscorrelogram(target, reference, ROI=(-0.5,0.5), binsize=.01, shift=None, skip_plot=False):
"""
Cross Correlation between two unit, optionally corrected by shift predictor.
arguments:
- target: the target spik... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
764,
29762,
62,
20850,
1330,
28220,
39,
628,
198,
4299,
3272,
10215,
2411,
21857,
7,
16793,
11,
4941,
11,
15107,
40,
16193,
12,
15... | 2.120849 | 1,084 |
#!/usr/bin/env python3
"""
Basic uci implementation
"""
import sys
import time
from .board import Board
from .evaluation import Evaluator
from .search import Searcher
from .ttable import ttable
from .utils import move_from_san, san_from_move
if __name__ == "__main__":
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
37811,
198,
26416,
334,
979,
7822,
198,
37811,
198,
198,
11748,
25064,
198,
11748,
640,
198,
198,
6738,
764,
3526,
1330,
5926,
198,
6738,
764,
18206,
2288,
1330,
26439,
84,
13... | 3.097826 | 92 |
"""File selection dialog classes.
Classes:
- FileDialog
- LoadFileDialog
- SaveFileDialog
This module also presents tk common file dialogues, it provides interfaces
to the native file dialogues available w Tk 4.2 oraz newer, oraz the
directory dialogue available w Tk 8.3 oraz newer.
These interfaces were written by ... | [
37811,
8979,
6356,
17310,
6097,
13,
198,
198,
9487,
274,
25,
198,
198,
12,
9220,
44204,
198,
12,
8778,
8979,
44204,
198,
12,
12793,
8979,
44204,
198,
198,
1212,
8265,
635,
10969,
256,
74,
2219,
2393,
17310,
947,
11,
340,
3769,
20314,
... | 2.391498 | 3,599 |
"""add booking image model
Revision ID: 9247b9acb4bd
Revises: 7a4e99ff303f
Create Date: 2018-05-28 18:08:48.285717
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9247b9acb4bd'
down_revision = '7a4e99ff303f'
branch_labels = None
depends_on = None
| [
37811,
2860,
25452,
2939,
2746,
198,
198,
18009,
1166,
4522,
25,
860,
23753,
65,
24,
330,
65,
19,
17457,
198,
18009,
2696,
25,
767,
64,
19,
68,
2079,
487,
22572,
69,
198,
16447,
7536,
25,
2864,
12,
2713,
12,
2078,
1248,
25,
2919,
... | 2.472 | 125 |
import os
import sys
from flexlogger.automation import Application
def main(project_path):
"""Launch FlexLogger, open a project, and gets the value of a test property."""
with Application.launch() as app:
project = app.open_project(path=project_path)
test_property_name = input("Enter the name... | [
11748,
28686,
198,
11748,
25064,
198,
198,
6738,
7059,
6404,
1362,
13,
2306,
296,
341,
1330,
15678,
628,
198,
4299,
1388,
7,
16302,
62,
6978,
2599,
198,
220,
220,
220,
37227,
38296,
26719,
11187,
1362,
11,
1280,
257,
1628,
11,
290,
30... | 2.626404 | 356 |
import sqlite3
conn = sqlite3.connect('oinpUpdatesDatabase.db')
c = conn.cursor()
c.execute("""CREATE TABLE IF NOT EXISTS updates (update_id blob, update_date text, update_data text)""")
# c.execute("INSERT INTO updates VALUES (:id, :date, :dataInfo)",
# {'id': update2.id, 'date': update2.date, 'dataInfo'... | [
11748,
44161,
578,
18,
198,
198,
37043,
796,
44161,
578,
18,
13,
8443,
10786,
36743,
79,
4933,
19581,
38105,
13,
9945,
11537,
198,
66,
796,
48260,
13,
66,
21471,
3419,
198,
198,
66,
13,
41049,
7203,
15931,
43387,
6158,
43679,
16876,
5... | 2.762376 | 202 |
#!/usr/bin/env python3
import geometry_msgs.msg
import rospy
import roslib
import tf_conversions
import tf2_ros
from std_msgs.msg import String
from scipy.optimize import minimize as fmin
# /* estimated camera2 pose */
m_rotx = -0.653
m_roty = 0.271
m_rotz = -0.271
m_rotw = 0.653
m_tranx = 0.073
m_trany = 0.073
m_tra... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
22939,
62,
907,
14542,
13,
19662,
198,
11748,
686,
2777,
88,
198,
11748,
686,
6649,
571,
198,
11748,
48700,
62,
1102,
47178,
198,
11748,
48700,
17,
62,
4951,
198,
6738,
1436... | 2.266393 | 244 |
PREF_DB_QUERY = "Preferences DB Query Exec"
PREF_DB_LEAK = "Pref DB Leak"
DB_QUERY = "SQL-lite Query Exec"
DB_LEAK = "SQL-lite Leaks"
CONN_LEAKS = "Connectivity Leaks"
FW = "File Writing"
FO = "File Opening"
LOC_LEAKS = "Location Leaks"
SOCKET = "Open Socket"
PREF_LOC_LEAKS = "Pref Location Leaks"
PREF_TM_LEAKS = "Pre... | [
47,
31688,
62,
11012,
62,
10917,
19664,
796,
366,
36698,
4972,
20137,
43301,
8393,
1,
198,
47,
31688,
62,
11012,
62,
2538,
10206,
796,
366,
36698,
20137,
1004,
461,
1,
198,
11012,
62,
10917,
19664,
796,
366,
17861,
12,
36890,
43301,
8... | 2.322878 | 542 |
from PIL import Image, ImageEnhance, ImageChops
import numpy as np, math
''' file che contiene le funzione per la manipolazione delle immaggini '''
# converte l'immagine da array di numpy ad oggeto di pillow
# converte l'immagine da oggetto di pillow ad array di numpy
# regola il contrasto dell'immagine
# rego... | [
6738,
350,
4146,
1330,
7412,
11,
7412,
35476,
590,
11,
7412,
1925,
2840,
198,
11748,
299,
32152,
355,
45941,
11,
10688,
198,
198,
7061,
6,
2393,
1125,
542,
72,
1734,
443,
1257,
89,
7935,
583,
8591,
7704,
349,
1031,
7935,
1619,
293,
... | 2.294118 | 765 |
from datetime import datetime
from models import Wallet
from pandas import DataFrame
from ohlcv_data import load_binance_data
from indicators import sma, ema, wma
from strategy_utils import save_strategy_data
def run_ma_strategy(df:DataFrame, ma:str = 'sma', span = 7) -> None:
'''
ma can be one of [sma, ema, '... | [
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
4981,
1330,
37249,
198,
6738,
19798,
292,
1330,
6060,
19778,
198,
6738,
11752,
75,
33967,
62,
7890,
1330,
3440,
62,
8800,
590,
62,
7890,
198,
6738,
21337,
1330,
895,
64,
11,
795,
64,
11,
... | 2.423414 | 914 |
import sys
import pytest
from ctypes import c_char_p, c_void_p, cast
import sdl2
from sdl2 import SDL_Init, SDL_Quit, SDL_QuitSubSystem, SDL_INIT_EVERYTHING
# NOTE: These tests are very incomplete and in need of a rewrite
# Test initializing event structs (is this actually useful?)
| [
11748,
25064,
198,
11748,
12972,
9288,
198,
6738,
269,
19199,
1330,
269,
62,
10641,
62,
79,
11,
269,
62,
19382,
62,
79,
11,
3350,
198,
11748,
264,
25404,
17,
198,
6738,
264,
25404,
17,
1330,
45417,
62,
31768,
11,
45417,
62,
4507,
27... | 3.119565 | 92 |
import pytest
from abuse_whois import schemas
@pytest.mark.parametrize(
"address,expected",
[
("http://example.com", "form"),
("abuse@example.com", "email"),
],
)
| [
11748,
12972,
9288,
198,
198,
6738,
5076,
62,
8727,
271,
1330,
3897,
5356,
628,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7,
198,
220,
220,
220,
366,
21975,
11,
40319,
1600,
198,
220,
220,
220,
685,
198,
220,
220,
... | 2.309524 | 84 |
import os
import cv2
import json
import numpy as np
import torch
import pickle
import matplotlib.pyplot as plt
from tqdm import tqdm
from config import system_configs
from utils import crop_image, normalize_
| [
11748,
28686,
198,
11748,
269,
85,
17,
198,
11748,
33918,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
2298,
293,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
256,
80,
36020,
1330,
256,
... | 3.25 | 64 |
import pandas
import math
import numpy as np
import re
from sklearn.ensemble import RandomForestClassifier as Rforest
from sklearn import cross_validation as validate
from sklearn.feature_selection import SelectKBest, f_classif
import operator
# select best features
if __name__ == '__main__':
trainAnd... | [
11748,
19798,
292,
201,
198,
11748,
10688,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
302,
201,
198,
6738,
1341,
35720,
13,
1072,
11306,
1330,
14534,
34605,
9487,
7483,
355,
371,
29623,
201,
198,
6738,
1341,
35720,
1330,
... | 3.292929 | 99 |
import twitter
import gevent
import click
import requests
from tweet_delete.util import td_format
from datetime import datetime
from dateutil import parser
| [
11748,
17044,
198,
11748,
4903,
1151,
198,
11748,
3904,
198,
11748,
7007,
198,
6738,
6126,
62,
33678,
13,
22602,
1330,
41560,
62,
18982,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
3128,
22602,
1330,
30751,
628
] | 4.243243 | 37 |
# local
from .base_factory import SpiderClsFactory
from .crawl_spider_factory import CrawlSpiderClsFactory
| [
2,
1957,
198,
6738,
764,
8692,
62,
69,
9548,
1330,
12648,
2601,
82,
22810,
198,
6738,
764,
66,
13132,
62,
2777,
1304,
62,
69,
9548,
1330,
327,
13132,
41294,
2601,
82,
22810,
198
] | 3.242424 | 33 |
#!/usr/bin/env python3
n,m = map(int, input().split())
t1 = [0] * 100010
t2 = [0] * 100010
tt = int(0)
for i in range(n):
l,r = map(int, input().split())
t1[l] += 1
t2[r+1] -= 1
for i in range(1,100010):
t1[i] += t1[i-1]
t2[i] += t2[i-1]
for i in range(m):
l,r = map(int, input().split())
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
77,
11,
76,
796,
3975,
7,
600,
11,
5128,
22446,
35312,
28955,
198,
198,
83,
16,
796,
685,
15,
60,
1635,
1802,
20943,
198,
83,
17,
796,
685,
15,
60,
1635,
1802,
20943,
19... | 1.805128 | 195 |
""" ``sklearn_xarray.common.wrappers`` """
from types import MethodType
from sklearn.base import clone
from sklearn.utils.validation import check_X_y, check_array
from .base import (
partial_fit, predict, predict_proba, predict_log_proba, decision_function,
transform, inverse_transform, fit_transform, score,... | [
37811,
7559,
8135,
35720,
62,
87,
18747,
13,
11321,
13,
29988,
11799,
15506,
37227,
198,
198,
6738,
3858,
1330,
11789,
6030,
198,
198,
6738,
1341,
35720,
13,
8692,
1330,
17271,
198,
6738,
1341,
35720,
13,
26791,
13,
12102,
341,
1330,
21... | 2.616095 | 2,597 |
import numpy as np
import os
import pandas as pd
## read yuliang tces
f = open('../target_info/tces.csv')
tces_data = f.readlines()
f.close()
del tces_data[0]
yuliang_ticids = []
for row in tces_data:
ticid = row.split(',')[1]
yuliang_ticids.append(int(ticid))
yuliang_ticids = set(yuliang_ticids)
## create a... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
2235,
1100,
331,
377,
15483,
256,
728,
220,
198,
69,
796,
1280,
10786,
40720,
16793,
62,
10951,
14,
83,
728,
13,
40664,
11537,
198,
83,
... | 2.088235 | 578 |
import unittest
import datetime
from sqlalchemy.exc import NoResultFound, IntegrityError
from src.flight_model.model import create_database, Session, Airline, Flight
from src.flight_model.logic import create_airport
from src.flight_model.logic import create_airline
from src.flight_model.logic import create_flight
from ... | [
11748,
555,
715,
395,
198,
11748,
4818,
8079,
198,
6738,
44161,
282,
26599,
13,
41194,
1330,
1400,
23004,
21077,
11,
39348,
12331,
198,
6738,
12351,
13,
22560,
62,
19849,
13,
19849,
1330,
2251,
62,
48806,
11,
23575,
11,
3701,
1370,
11,
... | 3.448819 | 127 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
""" Misc tool functions """
import pythonzimbra
import pythonzimbra.tools.xmlserializer
import re
import hmac
import hashlib
from xml.dom import minidom
re_zuuid = re.compile(r'[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}')
def is_... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
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,
37811,
29882,
2891,
5499,
37227,
198,
198,
11748,
... | 2.225 | 1,160 |
# OpenNero will execute ModMain when this mod is loaded
from BlocksTower.client import ClientMain
| [
2,
4946,
45,
3529,
481,
12260,
3401,
13383,
618,
428,
953,
318,
9639,
198,
6738,
35111,
51,
789,
13,
16366,
1330,
20985,
13383,
198
] | 4.083333 | 24 |
from abc import abstractmethod, ABCMeta
| [
6738,
450,
66,
1330,
12531,
24396,
11,
9738,
48526,
628,
628
] | 3.909091 | 11 |
import FWCore.ParameterSet.Config as cms
OutALCARECOPromptCalibProdSiPixel_noDrop = cms.PSet(
SelectEvents = cms.untracked.PSet(
SelectEvents = cms.vstring('pathALCARECOPromptCalibProdSiPixel')
),
outputCommands=cms.untracked.vstring(
'keep *_ALCARECOPromptCalibProdSiPixel_*_*',
'ke... | [
11748,
48849,
14055,
13,
36301,
7248,
13,
16934,
355,
269,
907,
198,
198,
7975,
1847,
20034,
2943,
3185,
45700,
9771,
571,
2964,
67,
42801,
40809,
62,
3919,
26932,
796,
269,
907,
13,
3705,
316,
7,
198,
220,
220,
220,
9683,
37103,
796,... | 2.367713 | 223 |
# -*- coding:utf-8 -*-
# Copyright (c) 2020 Huawei Technologies Co.,Ltd.
#
# openGauss is licensed under Mulan PSL v2.
# You can use this software according to the terms
# and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
#
# http://license.coscl.org.cn/MulanPSL2
#
# THIS SOFTWARE... | [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
12131,
43208,
21852,
1766,
1539,
43,
8671,
13,
198,
2,
198,
2,
1280,
35389,
1046,
318,
11971,
739,
17996,
272,
6599,
43,
410,
17,
13,
198,
2,
921,... | 3.198413 | 252 |
"""
Created on Wed Jul 8 21:03:54 2020
@author: ning
"""
import os
from glob import glob
from tqdm import tqdm
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib
# matplotlib.pyplot.switch_backend('agg')
from matplotlib import pyplot as plt
from matplotlib.patches import Patch
from... | [
37811,
198,
41972,
319,
3300,
5979,
220,
807,
2310,
25,
3070,
25,
4051,
12131,
198,
198,
31,
9800,
25,
299,
278,
198,
37811,
198,
198,
11748,
28686,
198,
6738,
15095,
1330,
15095,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
... | 2.116201 | 2,074 |
# -----------------------------------------------------------
# CS229: Machine Learning Assignment 2
#
# author: Armand Sumo
#
# email: armandsumo@gmail.com
# -----------------------------------------------------------
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
# --------------... | [
2,
20368,
22369,
6329,
198,
2,
9429,
23539,
25,
10850,
18252,
50144,
362,
198,
2,
198,
2,
1772,
25,
7057,
392,
5060,
78,
198,
2,
220,
198,
2,
3053,
25,
3211,
1746,
43712,
31,
14816,
13,
785,
198,
2,
20368,
22369,
6329,
198,
198,
... | 4.733333 | 150 |
from nsm.model import NSM, NSMLightningModule, instruction_model_types
import nsm.datasets.synthetic as syn
import nsm.datasets.clevr as clevr
import pytorch_lightning as pl
from tqdm import tqdm
import torch
from itertools import product
import argparse
from pprint import pprint
import logging
if __name__ == "__mai... | [
6738,
299,
5796,
13,
19849,
1330,
10896,
44,
11,
10896,
5805,
432,
768,
26796,
11,
12064,
62,
19849,
62,
19199,
198,
11748,
299,
5796,
13,
19608,
292,
1039,
13,
1837,
429,
6587,
355,
6171,
198,
11748,
299,
5796,
13,
19608,
292,
1039,
... | 2.608247 | 485 |
import logging
from logging.handlers import QueueHandler, QueueListener
import time
from khlbot.config import LOGGING_CONSOLE_LEVEL, LOGGING_FILE_LEVEL, LOGGING_FILE_DIR
import sys
import os
class Logger:
"""
Config logging module
"""
@staticmethod
def listener_configure(_queue, dirpath=LOGGING_F... | [
11748,
18931,
198,
6738,
18931,
13,
4993,
8116,
1330,
4670,
518,
25060,
11,
4670,
518,
33252,
198,
11748,
640,
198,
6738,
479,
18519,
13645,
13,
11250,
1330,
41605,
38,
2751,
62,
10943,
15821,
2538,
62,
2538,
18697,
11,
41605,
38,
2751,... | 2.363326 | 878 |
"""Desenvolva um programa que as duas notas de um aluno. Calcule e mostre a sua média."""
from utilidadescev.dado import leia_real
from utilidadescev.numero import media
n1 = leia_real('Digite 1ª nota: ')
n2 = leia_real('Digite 2ª nota: ')
print(f'A média entre {n1} e {n2} é igual {media(n1, n2):.2f}')
| [
37811,
5960,
268,
10396,
6862,
23781,
1430,
64,
8358,
355,
7043,
292,
407,
292,
390,
23781,
435,
36909,
13,
2199,
23172,
304,
749,
260,
257,
424,
64,
285,
2634,
67,
544,
526,
15931,
198,
198,
6738,
7736,
312,
2367,
344,
85,
13,
67,
... | 2.201439 | 139 |
import configparser
from pathlib import Path
def add_layout(name, layout_props):
'''
EXAMPLE LAYOUT_PROPS
{
"title_2": [[("0", "e"), ("0", "e"), ("1", "w"), ("4", "h")]],
"images_2": [[("0", "e"), ("0", "e"), ("2", "w"), ("1", "h")]],
"text_2": [[("2", "w"), ("0", "e"), ("2", "w"), ("1", ... | [
11748,
4566,
48610,
198,
6738,
3108,
8019,
1330,
10644,
628,
628,
628,
198,
198,
4299,
751,
62,
39786,
7,
3672,
11,
12461,
62,
1676,
862,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
7788,
2390,
16437,
406,
4792,
12425,
... | 1.803419 | 819 |
import os
import time
import requests
import io
import hashlib
from PIL import Image
from selenium import webdriver
import signal
from glob import glob
##############
# Parameters
##############
number_of_images = 400
GET_IMAGE_TIMEOUT = 2
SLEEP_BETWEEN_INTERACTIONS = 0.1
SLEEP_BEFORE_MORE = 5
IMAGE_QUALITY = 85
... | [
11748,
28686,
198,
11748,
640,
198,
198,
11748,
7007,
198,
11748,
33245,
198,
11748,
12234,
8019,
198,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
198,
11748,
6737,
198,
198,
6738,
15095,
1330,
... | 3.059569 | 789 |
import logging
from ozobotmapf.graphics.drawables import FullArrow, DrawableGroup, Line, Arc
from ozobotmapf.graphics.shapes import Rectangle
from ozobotmapf.simulator.path_position import PathPosition
from ozobotmapf.simulator.position_tile import PositionTile
from ozobotmapf.utils.constants import Directions
| [
11748,
18931,
198,
198,
6738,
15649,
672,
313,
8899,
69,
13,
70,
11549,
13,
19334,
2977,
1330,
6462,
3163,
808,
11,
15315,
540,
13247,
11,
6910,
11,
10173,
198,
6738,
15649,
672,
313,
8899,
69,
13,
70,
11549,
13,
1477,
7916,
1330,
4... | 3.376344 | 93 |
from .file import FileAdapter as file
from .memcached import MemcachedAdapterFactory as memcached
from .djangocache import DjangoCacheFactory as djcache
from .rediscache import RedisAdapterFactory as rediscache
| [
6738,
764,
7753,
1330,
9220,
47307,
355,
2393,
198,
6738,
764,
11883,
66,
2317,
1330,
4942,
66,
2317,
47307,
22810,
355,
1066,
66,
2317,
198,
6738,
764,
28241,
648,
420,
4891,
1330,
37770,
30562,
22810,
355,
42625,
23870,
198,
6738,
764... | 3.907407 | 54 |
# -*- coding: utf-8 -*-
from cdpy.common import CdpSdkBase, Squelch
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
22927,
9078,
13,
11321,
1330,
327,
26059,
50,
34388,
14881,
11,
5056,
417,
354,
628
] | 2.258065 | 31 |
import json, subprocess
from .. pyaz_utils import get_cli_name, get_params
| [
11748,
33918,
11,
850,
14681,
198,
6738,
11485,
12972,
1031,
62,
26791,
1330,
651,
62,
44506,
62,
3672,
11,
651,
62,
37266,
628
] | 3.304348 | 23 |
"""https://adventofcode.com/2021/day/3"""
data = open('day-03/input', 'r', encoding='utf-8').read().splitlines()
N = len(data[0])
gamma = 0
epsilon = 0
for n in range(N):
count0 = sum(1 for line in data if line[n] == '0')
count1 = len(data) - count0
gamma *= 2
epsilon *= 2
if count0 < count1:
... | [
37811,
5450,
1378,
324,
1151,
1659,
8189,
13,
785,
14,
1238,
2481,
14,
820,
14,
18,
37811,
198,
198,
7890,
796,
1280,
10786,
820,
12,
3070,
14,
15414,
3256,
705,
81,
3256,
21004,
11639,
40477,
12,
23,
27691,
961,
22446,
35312,
6615,
... | 2.149733 | 187 |
from rdflib import Graph as _Graph
from rdflib.namespace import (
Namespace, NamespaceManager as _NamespaceManager,
RDF, RDFS, OWL, XSD, FOAF, SKOS) # VOID
SIOC = Namespace('http://rdfs.org/sioc/ns#')
OA = Namespace('http://www.openannotation.org/ns/')
CATALYST = Namespace('http://purl.org/catalyst/core#')
ID... | [
6738,
374,
67,
2704,
571,
1330,
29681,
355,
4808,
37065,
198,
6738,
374,
67,
2704,
571,
13,
14933,
10223,
1330,
357,
198,
220,
220,
220,
28531,
10223,
11,
28531,
10223,
13511,
355,
4808,
36690,
10223,
13511,
11,
198,
220,
220,
220,
37... | 2.533505 | 388 |
from chainer.functions.activation import relu
from chainer.functions.activation import sigmoid
from chainer import link
from chainer.links.connection import linear
class Highway(link.Chain):
"""Highway module.
In highway network, two gates are added to the ordinal non-linear
transformation (:math:`H(x) ... | [
6738,
6333,
263,
13,
12543,
2733,
13,
48545,
1330,
823,
84,
198,
6738,
6333,
263,
13,
12543,
2733,
13,
48545,
1330,
264,
17225,
1868,
198,
6738,
6333,
263,
1330,
2792,
198,
6738,
6333,
263,
13,
28751,
13,
38659,
1330,
14174,
628,
198,... | 2.465278 | 1,152 |
def string_to_lowercase(input_string=None, **kwargs):
"""
Convert the provided string to all lowercase characters
Args:
input_string (CEF type: *): The string to convert to lowercase
Returns a JSON-serializable object that implements the configured data paths:
lowercase_string ... | [
4299,
4731,
62,
1462,
62,
21037,
7442,
7,
15414,
62,
8841,
28,
14202,
11,
12429,
46265,
22046,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
38240,
262,
2810,
4731,
284,
477,
2793,
7442,
3435,
198,
220,
220,
220,
220,
198,
22... | 3.087248 | 298 |
import sys
list = []
path = sys.argv[1]
a = sys.argv[2]
f = open(path, "r")
for line in f.readlines():
list.append(line.strip(', \n'))
for i in list:
if i[0] == a:
print(i)
f.close()
| [
11748,
25064,
198,
198,
4868,
796,
17635,
198,
6978,
796,
25064,
13,
853,
85,
58,
16,
60,
198,
64,
796,
25064,
13,
853,
85,
58,
17,
60,
198,
69,
796,
1280,
7,
6978,
11,
366,
81,
4943,
198,
198,
1640,
1627,
287,
277,
13,
961,
6... | 2.076087 | 92 |
import torch
from torch import nn
from attrdict import AttrDict
from torch.nn import functional as F
from torch.distributions.normal import Normal
from torch.distributions.kl import kl_divergence
from .arch import arch
class ImageEncoderBg(nn.Module):
"""Background image encoder"""
def for... | [
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
708,
4372,
713,
1330,
3460,
81,
35,
713,
198,
6738,
28034,
13,
20471,
1330,
10345,
355,
376,
198,
6738,
28034,
13,
17080,
2455,
507,
13,
11265,
1330,
14435,
198,
6738,
28034,
1... | 1.929061 | 2,044 |
#! /usr/bin/env python
"""
Script to test PandaArm and panda_robot package.
Run script interactively to test different functions.
python -i env.py
"""
import rospy
from panda_robot import PandaArm
poses = [[-8.48556818e-02, -8.88127666e-02, -6.59622769e-01, -1.57569726e+00, -4.82374882e-04, 2.159... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
220,
220,
220,
12327,
284,
1332,
41112,
26560,
290,
279,
5282,
62,
305,
13645,
5301,
13,
628,
220,
220,
220,
5660,
4226,
9427,
2280,
284,
1332,
1180,
5499,
13,
198... | 2.271605 | 1,296 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
#!/usr/bin/env python
import time
import sys
import json
import tweepy
import urllib3
from tweepy import Stream
from tweepy import OAuthHandler
from tweepy.streaming import StreamListener
def main():
"""
Descripcion: usado solo para recolectar datos que se han mostrado en la presentacion del proyecto,
recol... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
640,
198,
11748,
25064,
198,
11748,
33918,
198,
11748,
4184,
538,
88,
198,
11748,
2956,
297,
571,
18,
198,
6738,
4184,
538,
88,
1330,
13860,
198,
6738,
4184,
538,
88,
1330,... | 2.604938 | 405 |
'''
Run Avida analyze mode
'''
import argparse, os, copy, errno, csv, subprocess, sys
output_dump_dir = "./avida_analysis_dump"
treatment_whitelist = ["change", "l9", "limres", "empty"]
avida_lineage_analysis_path="avida__analyze_fdom_lineages.cfg"
avida_genotypes_analysis_path="avida__analyze_all.cfg"
default_line... | [
7061,
6,
198,
10987,
5184,
3755,
16602,
4235,
198,
7061,
6,
198,
11748,
1822,
29572,
11,
28686,
11,
4866,
11,
11454,
3919,
11,
269,
21370,
11,
850,
14681,
11,
25064,
198,
198,
22915,
62,
39455,
62,
15908,
796,
366,
19571,
615,
3755,
... | 2.253879 | 709 |
import shutil
import itertools
import unittest
from dampr import Dampr, BlockMapper, BlockReducer, Dataset, settings
from dampr.inputs import UrlsInput
if __name__ == '__main__':
unittest.main()
| [
11748,
4423,
346,
198,
11748,
340,
861,
10141,
198,
11748,
555,
715,
395,
198,
198,
6738,
21151,
81,
1330,
360,
696,
81,
11,
9726,
44,
11463,
11,
9726,
7738,
48915,
11,
16092,
292,
316,
11,
6460,
198,
6738,
21151,
81,
13,
15414,
82,... | 2.885714 | 70 |
#!/usr/bin/env python3
def is_leap_year(year):
"""
Report if a given year is a leap year.
The tricky thing here is that a leap year occurs:
on every year that is evenly divisible by 4
except every year that is evenly divisible by 100
unless the year is also evenly divisible by 400
"""
try:
return year... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
4299,
318,
62,
293,
499,
62,
1941,
7,
1941,
2599,
198,
197,
37811,
198,
197,
19100,
611,
257,
1813,
614,
318,
257,
16470,
614,
13,
198,
197,
464,
17198,
1517,
994,
318,
32... | 3.098684 | 152 |