content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from tweepy import Stream
from tweepy import OAuthHandler
from tweepy.streaming import StreamListener
import mysql.connector
import datetime
import time
import pandas as pd
import json
from nltk.sentiment.vader import SentimentIntensityAnalyzer
new_words = {
'moon': 2.0,
'🚀': 2.0,
'paper hands': -0.8,
... | [
6738,
4184,
538,
88,
1330,
13860,
198,
6738,
4184,
538,
88,
1330,
440,
30515,
25060,
198,
6738,
4184,
538,
88,
13,
5532,
278,
1330,
13860,
33252,
198,
11748,
48761,
13,
8443,
273,
198,
11748,
4818,
8079,
198,
11748,
640,
198,
11748,
1... | 2.181507 | 584 |
from ..env import env
# Used by runserver or gunicorn commands
SERVER_HOST = env("HCAP__HOST", default="127.0.0.1")
SERVER_PORT = env("HCAP__PORT", default=8000)
# Used by gunicorn command
SERVER_WORKERS = env("HCAP__WORKERS", default=1)
| [
6738,
11485,
24330,
1330,
17365,
198,
198,
2,
16718,
416,
1057,
15388,
393,
2485,
291,
1211,
9729,
198,
35009,
5959,
62,
39,
10892,
796,
17365,
7203,
16045,
2969,
834,
39,
10892,
1600,
4277,
2625,
16799,
13,
15,
13,
15,
13,
16,
4943,
... | 2.727273 | 88 |
"""
permaize.py
Take a PDF, extract hyperlinks, and archive them.
Input: a PDF file
Output: Links to archives of all URLs found in PDF file, one per line
Problems:
* Many links are truncated at line-breaks. Need to look into detecting
these and dealing with them.
"""
import click
import json
import logging
import r... | [
37811,
198,
525,
2611,
1096,
13,
9078,
198,
12322,
257,
12960,
11,
7925,
8718,
28751,
11,
290,
15424,
606,
13,
198,
20560,
25,
257,
12960,
2393,
198,
26410,
25,
21691,
284,
22415,
286,
477,
32336,
1043,
287,
12960,
2393,
11,
530,
583,... | 2.494098 | 1,186 |
import sys
import six
from functools import wraps
from django.http import JsonResponse
from django.http.response import HttpResponseBase
from django.shortcuts import render
from elasticsearch_dsl.response import Response
from elasticsearch_dsl.utils import AttrDict, AttrList, ObjectBase
from wagtail.wagtailsearch.bac... | [
11748,
25064,
198,
11748,
2237,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
198,
6738,
42625,
14208,
13,
4023,
1330,
449,
1559,
31077,
198,
6738,
42625,
14208,
13,
4023,
13,
26209,
1330,
367,
29281,
31077,
14881,
198,
6738,
42625,
1420... | 2.825815 | 798 |
'''
小哼卖书
2017-10-17
'''
if __name__ == "__main__":
pb = PurchaseBook()
nums = [1,2,4,9,9,8,0,3,1,0,-1]
nums= pb.buy(nums)
print(nums)
| [
7061,
6,
198,
220,
220,
220,
10263,
108,
237,
161,
241,
120,
39355,
244,
20046,
99,
198,
220,
220,
220,
2177,
12,
940,
12,
1558,
198,
7061,
6,
628,
628,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
... | 1.541284 | 109 |
import pandas as pd
from .crud import contextual_session
from .export_ingestion import insert_dataframe_ignore_duplicates
from .models import (
CronometerNote,
CronometerDailySummary,
CronometerExercise,
CronometerServing,
CronometerBiometric,
)
| [
11748,
19798,
292,
355,
279,
67,
198,
6738,
764,
6098,
463,
1330,
38356,
62,
29891,
198,
6738,
764,
39344,
62,
278,
395,
295,
1330,
7550,
62,
7890,
14535,
62,
46430,
62,
646,
489,
16856,
198,
6738,
764,
27530,
1330,
357,
198,
220,
2... | 3.045455 | 88 |
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 12 16:58:24 2019
@author: WT
"""
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import numpy as np
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
19480,
5979,
1105,
1467,
25,
3365,
25,
1731,
13130,
198,
198,
31,
9800,
25,
41281,
198,
37811,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
204... | 2.615385 | 78 |
from .fragments import PROJECT_FRAGMENT
GQL_GET_PROJECTS = f'''
query($userID: ID!, $searchQuery: String, $skip: Int!, $first: Int!) {{
data: getProjects(userID: $userID, searchQuery: $searchQuery, skip: $skip, first: $first) {{
{PROJECT_FRAGMENT}
}}
}}
'''
GQL_GET_PROJECT = f'''
query($projectID: ID!) {{
d... | [
6738,
764,
8310,
363,
902,
1330,
21965,
23680,
62,
37,
33202,
10979,
198,
198,
38,
9711,
62,
18851,
62,
31190,
41,
2943,
4694,
796,
277,
7061,
6,
198,
22766,
16763,
7220,
2389,
25,
4522,
28265,
720,
12947,
20746,
25,
10903,
11,
720,
... | 2.435583 | 163 |
class Figure:
"""Базовый класс"""
def add_area(self, figure):
"""Метод вычисления суммы площадей фигур"""
if isinstance(figure, Figure):
return self.area + figure.area
else:
print("Передан неправильный класс")
| [
4871,
11291,
25,
198,
220,
220,
220,
37227,
140,
239,
16142,
140,
115,
25443,
110,
45035,
140,
117,
12466,
118,
30143,
16142,
21727,
21727,
37811,
628,
220,
220,
220,
825,
751,
62,
20337,
7,
944,
11,
3785,
2599,
198,
220,
220,
220,
... | 1.467033 | 182 |
from pycocotools.cocoeval import COCOeval
import json
import torch
import time
from tqdm import tqdm
import os | [
6738,
12972,
66,
420,
313,
10141,
13,
66,
25634,
18206,
1330,
327,
4503,
46,
18206,
198,
11748,
33918,
198,
11748,
28034,
198,
11748,
640,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
28686
] | 3.055556 | 36 |
#!/usr/bin/env python
import os
import numpy as np
from empirical.GMM_models.ASK_2014_nga import ASK_2014_nga
from empirical.util.classdef import Fault, Site
# compare with Matlab version
periods = [0.012, 0.018, 0.03, 0.05, 0.07, 0.1, 0.16, 0.2, 0.25, 0.3, 0.4, 0.5, 0.75, 1, 1.5, 2, 3, 4, 5, 6.5, 8, 10, -1]
mags ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
28686,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
21594,
13,
38,
12038,
62,
27530,
13,
1921,
42,
62,
4967,
62,
782,
64,
1330,
7054,
42,
62,
4967,
62,
782,
... | 2.051351 | 370 |
#
# PySNMP MIB module XYLAN-BASE-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/XYLAN-BASE-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:44:24 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
41420,
25697,
12,
33,
11159,
12,
8895,
33,
357,
4023,
1378,
16184,
76,
489,
8937,
13,
785,
14,
79,
893,
11632,
8,
198,
2,
7054,
45,
13,
16,
2723,
2393,
1378,
14,
14490,
14,
67,
615,... | 2.252532 | 2,962 |
"""
Implementation of operations on Array objects and objects supporting
the buffer protocol.
"""
from __future__ import print_function, absolute_import, division
import math
import llvmlite.llvmpy.core as lc
from llvmlite.llvmpy.core import Constant
import numpy
from numba import types, cgutils, typing
from numba.... | [
37811,
198,
3546,
32851,
286,
4560,
319,
15690,
5563,
290,
5563,
6493,
198,
1169,
11876,
8435,
13,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
4112,
62,
11748,
11,
7297,
198,
198,
11748,
10688,
198,
198,
1... | 2.357591 | 16,105 |
"""Collection of custom Keras layers."""
# Imports
from keras import backend as K
from keras.layers.core import Dense, Reshape, RepeatVector, Lambda, Dropout
from keras.layers import Input, merge
from keras.layers.recurrent import LSTM
from keras.layers.normalization import BatchNormalization
from keras.regularizers i... | [
37811,
36307,
286,
2183,
17337,
292,
11685,
526,
15931,
198,
198,
2,
1846,
3742,
198,
6738,
41927,
292,
1330,
30203,
355,
509,
198,
6738,
41927,
292,
13,
75,
6962,
13,
7295,
1330,
360,
1072,
11,
1874,
71,
1758,
11,
30021,
38469,
11,
... | 2.116564 | 3,586 |
# vim: set fileencoding=utf-8 :
from __future__ import absolute_import, print_function, unicode_literals
import time
import duo_client
import stethoscope.configurator
import stethoscope.plugins.sources.duo.utils
| [
2,
43907,
25,
900,
2393,
12685,
7656,
28,
40477,
12,
23,
1058,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
3601,
62,
8818,
11,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
640,
198,
198,
11748,
18545,
62,
16366,
1... | 3.191176 | 68 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import annotations
import copy
import os
import re
from typing import Tuple, Union
import networkx as nx
import numpy as np
import pandas as pd
import partridge as ptg
from partridge.config import default_config
from .Logger import WranglerLogger
from .U... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
4866,
198,
11748,
28686,
198,
11748,
302,
198,
6738,
19720,
... | 2.18513 | 7,357 |
# -*- coding: UTF-8 -*-
# description: 妞妞公主有一块黑白棋盘,该棋盘共有n行m列,任意相邻的两个格子都是不同的颜色(黑或白),坐标为(1,1)的格子是白色的。
# 这一天牛牛来看妞妞公主,和妞妞公主说:只要你告诉我n和m,我就能马上算出黑色方块和白色方块的数量
# 妞妞公主说:这太简单了。这样吧,我在这n行m列中选择一个左下角坐标为(x0,y0),右上角坐标为(x1,y1)的矩形,把这个矩形里的共
# (x1-x0+1)*(y1-y0+1)个方块全部涂白,你还能算出黑色方块和白色方块的数量吗?
# ... | [
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
2,
6764,
25,
10263,
99,
252,
36685,
252,
17739,
105,
10310,
119,
17312,
231,
31660,
161,
251,
245,
165,
119,
239,
163,
50159,
162,
96,
233,
33566,
246,
171,
120,
234,
462... | 0.743184 | 2,971 |
#1 /usr/bin/python
from catalan import catalan
if __name__ == "__main__":
for i in range(10):
print("catalan({}) == {}".format(i, catalan(i))) | [
2,
16,
1220,
14629,
14,
8800,
14,
29412,
198,
198,
6738,
3797,
25786,
1330,
3797,
25786,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
628,
197,
1640,
1312,
287,
2837,
7,
940,
2599,
198,
197,
197,
4798,
7203,
92... | 2.551724 | 58 |
# Coding Question: Given JSON object that have marks of students, create a json object that returns the average marks in each subject
class StudentRecords:
'Student records management'
# Input
total_students_dict = {
'Student1' : {'english': 90,'maths': 50,'science': 80},
'Student2' : {'english': 70,'maths'... | [
2,
327,
7656,
18233,
25,
11259,
19449,
2134,
326,
423,
8849,
286,
2444,
11,
2251,
257,
33918,
2134,
326,
5860,
262,
2811,
8849,
287,
1123,
2426,
198,
4871,
13613,
6690,
3669,
25,
198,
220,
220,
705,
38778,
4406,
4542,
6,
628,
198,
1... | 3.422222 | 180 |
# https://github.com/tomdoel/pyxnatbrowser
# Author: Tom Doel www.tomdoel.com
# Distributed under the Simplified BSD License.
from tkinter import PanedWindow, Menu
from tkinter import messagebox
from tkinter.constants import BOTH
from browser import __version__
from browser.browserconfiguration import BrowserConfigur... | [
2,
3740,
1378,
12567,
13,
785,
14,
39532,
4598,
417,
14,
9078,
87,
32353,
40259,
198,
2,
6434,
25,
4186,
2141,
417,
7324,
13,
39532,
4598,
417,
13,
785,
198,
2,
4307,
6169,
739,
262,
45157,
1431,
347,
10305,
13789,
13,
198,
198,
6... | 3.882716 | 162 |
"""beta-TCVAE
Isolating Sources of Disentanglement in Variational Autoencoders
http://arxiv.org/abs/1802.04942
code by author
https://github.com/rtqichen/beta-tcvae
"""
from typing import Dict
import math
import torch
from torch import Tensor
import pixyz.distributions as pxd
import pixyz.losses as pxl
from .bas... | [
198,
37811,
31361,
12,
4825,
11731,
36,
198,
198,
3792,
349,
803,
26406,
286,
3167,
298,
648,
1732,
287,
15965,
864,
5231,
6571,
19815,
364,
198,
4023,
1378,
283,
87,
452,
13,
2398,
14,
8937,
14,
1507,
2999,
13,
15,
2920,
3682,
198,... | 2.078876 | 2,206 |
from typing import Optional
from torch import Tensor
from torch import nn
from paragen.modules.encoders.layers import AbstractEncoderLayer
from .moe import MoE
class MoEEncoderLayer(AbstractEncoderLayer):
"""
MoEEncoderLayer performs one layer of MoeEncoder.
Args:
d_model: feature dimension
... | [
6738,
19720,
1330,
32233,
198,
198,
6738,
28034,
1330,
309,
22854,
198,
6738,
28034,
1330,
299,
77,
198,
198,
6738,
1582,
11286,
13,
18170,
13,
12685,
375,
364,
13,
75,
6962,
1330,
27741,
27195,
12342,
49925,
198,
6738,
764,
76,
2577,
... | 2.357873 | 978 |
from django.urls import path
from .views import (
CustomAuthToken,
register_view,
Verification_view,
checkServerTime_view,
get_system_status_view,
get_exchange_info_view,
get_order_book_view,
get_recent_trades_view,
get_historical_trades_view,
get_aggregate_trades_view,
get_... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
764,
33571,
1330,
357,
198,
220,
220,
220,
8562,
30515,
30642,
11,
220,
198,
220,
220,
220,
7881,
62,
1177,
11,
198,
220,
220,
220,
4643,
2649,
62,
1177,
11,
198,
220,
220,
... | 2.658333 | 600 |
import logging
import logging.handlers
import datetime
import os
| [
11748,
18931,
198,
11748,
18931,
13,
4993,
8116,
198,
11748,
4818,
8079,
198,
11748,
28686,
628,
628
] | 4 | 17 |
from functools import wraps
from typing import (
List, Tuple,
)
import time
from .logs import log as klog
from .tools import wraps_class
import xbmc
import xbmcplugin
import xbmcgui
import xbmcaddon
log_level_short_name = {
xbmc.LOGDEBUG: 'DBG',
xbmc.LOGERROR: 'ERR',
xbmc.LOGFATAL: 'FTL',
xbmc.L... | [
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
19720,
1330,
357,
198,
220,
220,
220,
7343,
11,
309,
29291,
11,
198,
8,
198,
11748,
640,
198,
6738,
764,
6404,
82,
1330,
2604,
355,
479,
6404,
198,
6738,
764,
31391,
1330,
27521,
... | 2.324397 | 746 |
from ui_tests.exporter.pages.BasePage import BasePage
| [
6738,
334,
72,
62,
41989,
13,
1069,
26634,
13,
31126,
13,
14881,
9876,
1330,
7308,
9876,
628
] | 3.235294 | 17 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.StaffInfo import StaffInfo
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
2829,
17752,
355,
33918,
198,
198,
6738,
435,
541,
323,
13,
64,
404,
13,
15042,
13,
9979,
415,
13,
22973,
3418... | 2.691176 | 68 |
from rester.struct import DictWrapper
import json
import os
import yaml
from rester.manifest import Variables
| [
6738,
1334,
263,
13,
7249,
1330,
360,
713,
36918,
2848,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
331,
43695,
198,
6738,
1334,
263,
13,
805,
8409,
1330,
15965,
2977,
628,
628
] | 3.53125 | 32 |
'''Holds classes designed for working with encryption keys'''
import base64
import json
import os
import re
from typing import Union
import jsonschema
from nacl.exceptions import InvalidkeyError
import nacl.public
import nacl.pwhash
import nacl.secret
import nacl.signing
import nacl.utils
from retval import RetVal, Er... | [
7061,
6,
39,
10119,
6097,
3562,
329,
1762,
351,
15835,
8251,
7061,
6,
198,
11748,
2779,
2414,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
302,
198,
6738,
19720,
1330,
4479,
198,
198,
11748,
44804,
684,
2395,
2611,
198,
6738,
299,
... | 2.794195 | 9,096 |
from flask import Flask
app = Flask(__name__, static_url_path="", static_folder="http/client/app/build")
app.config.from_object("app.config")
app.secret_key = app.config["SECRET_KEY"]
from app import http
| [
6738,
42903,
1330,
46947,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
11,
9037,
62,
6371,
62,
6978,
2625,
1600,
9037,
62,
43551,
2625,
4023,
14,
16366,
14,
1324,
14,
11249,
4943,
198,
198,
1324,
13,
11250,
13,
6738,
62,
15252,
72... | 2.971429 | 70 |
import random
import urllib.request as urllib2
import PyPDF2
from os.path import join
from bs4 import BeautifulSoup
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
import pandas as pd
import pickle
impor... | [
11748,
4738,
198,
11748,
2956,
297,
571,
13,
25927,
355,
2956,
297,
571,
17,
198,
11748,
9485,
20456,
17,
198,
6738,
28686,
13,
6978,
1330,
4654,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
6738,
384,
11925,
1505,
13,
12384,
... | 3.16129 | 155 |
# This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more informations
# Copyright (C) Philippe Biondi <phil@secdev.org>
# Copyright (C) Mike Ryan <mikeryan@lacklustre.net>
# This program is published under a GPLv2 license
"""
Bluetooth layers, sockets and send/receive functions.
"""
import soc... | [
2,
770,
2393,
318,
636,
286,
1446,
12826,
198,
2,
4091,
2638,
1378,
2503,
13,
2363,
7959,
13,
2398,
14,
42068,
14,
1416,
12826,
329,
517,
4175,
602,
198,
2,
15069,
357,
34,
8,
39393,
347,
295,
10989,
1279,
28864,
31,
2363,
7959,
1... | 2.242724 | 3,642 |
from django.db import models
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
628
] | 3.75 | 8 |
import cv2
import numpy as np
| [
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
220,
220,
220,
220
] | 2.266667 | 15 |
# -*- coding: utf-8 -*-
'''
Created on 6 mars 2017
@author: Jacky
'''
import logging
from django.conf import settings
# from ArkDiscordBot.apps import bot
logger = logging.getLogger('BOT.{}'.format(__name__))
ARK_CHAT_CHANNEL = getattr(settings, 'ARK_CHAT_CHANNEL')
ARK_CHAT_REFRESH = int(getattr(settings, 'ARK_CH... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
41972,
319,
718,
48962,
2177,
198,
198,
31,
9800,
25,
3619,
88,
198,
7061,
6,
198,
11748,
18931,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198... | 2.561644 | 146 |
import dataclasses
from rich.console import Console
from neuro_flow.parser import ConfigDir
@dataclasses.dataclass(frozen=True)
| [
11748,
4818,
330,
28958,
198,
198,
6738,
5527,
13,
41947,
1330,
24371,
198,
198,
6738,
7669,
62,
11125,
13,
48610,
1330,
17056,
35277,
628,
198,
31,
19608,
330,
28958,
13,
19608,
330,
31172,
7,
69,
42005,
28,
17821,
8,
198
] | 3.3 | 40 |
#
# Copyright (c) 2018 Wang XX
#
# MIT License
# http://www.opensource.org/licenses/mit-license.php
#
import cntk as C
from cntk.initializer import xavier, glorot_uniform, normal
from cntk.logging import ProgressPrinter
import numpy as np
if __name__=='__main__':
HIDDEN_DIM=128
input_ph=C.sequence.inpu... | [
2,
220,
198,
2,
15069,
357,
66,
8,
2864,
15233,
21044,
220,
198,
2,
220,
198,
2,
17168,
13789,
220,
198,
2,
2638,
1378,
2503,
13,
44813,
1668,
13,
2398,
14,
677,
4541,
14,
2781,
12,
43085,
13,
10121,
220,
198,
2,
220,
220,
198,
... | 2.252451 | 816 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Example for getting weather data from Yahoo."""
import urllib
import urllib2
import json
def get_weather():
"""Get the weather."""
sql = ("select * from weather.forecast where woeid in "
"(select woeid from geo.places(1) where text=\"Karlsruhe\")")... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
16281,
329,
1972,
6193,
1366,
422,
16551,
526,
15931,
198,
198,
11748,
2956,
297,
571,
198,
11748,
2956,
29... | 2.469298 | 228 |
import serial
import time
import datetime
import pynmea2
APN = 'TM'
URL = 'www.ppp.one/gps.php' | [
11748,
11389,
198,
11748,
640,
198,
11748,
4818,
8079,
198,
11748,
279,
2047,
1326,
64,
17,
198,
198,
2969,
45,
796,
705,
15972,
6,
198,
21886,
796,
705,
2503,
13,
381,
79,
13,
505,
14,
70,
862,
13,
10121,
6
] | 2.4 | 40 |
import note_seq
from pretty_midi import PrettyMIDI
import midi2audio
import argparse
SAMPLE_RATE = 16000
SF2_PATH = '../SGM-v2.01-Sal-Guit-Bass-V1.3.sf2'
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--input", default="../inference/get_0.mid")
parser.add_argument("--... | [
11748,
3465,
62,
41068,
198,
6738,
2495,
62,
13602,
72,
1330,
20090,
44,
2389,
40,
198,
11748,
3095,
72,
17,
24051,
198,
11748,
1822,
29572,
198,
198,
49302,
16437,
62,
49,
6158,
796,
1467,
830,
198,
20802,
17,
62,
34219,
796,
705,
... | 2.497512 | 201 |
config = {
'beta1': 0.9,
'beta1_fb': 0.99,
'beta2': 0.99,
'beta2_fb': 0.999,
'epsilon': 5.372362237423211e-07,
'epsilon_fb': 9.668307793961592e-06,
'feedback_wd': 1.255944396346018e-05,
'lr': 1.4115422537655614e-05,
'lr_fb': 0.00015183543020814424,
'sigma': 0.09922937053034697,
'target_stepsize': 0.02621187229150487,
'... | [
11250,
796,
1391,
198,
6,
31361,
16,
10354,
657,
13,
24,
11,
198,
6,
31361,
16,
62,
21855,
10354,
657,
13,
2079,
11,
198,
6,
31361,
17,
10354,
657,
13,
2079,
11,
198,
6,
31361,
17,
62,
21855,
10354,
657,
13,
17032,
11,
198,
6,
... | 2.210158 | 571 |
#print - kiírattás
print('Asd') | [
2,
4798,
532,
47748,
8836,
81,
1078,
40138,
198,
198,
4798,
10786,
1722,
67,
11537
] | 2.133333 | 15 |
import NeuralNetwork as nn
import RestrictedBoltzmannMachine as rbm
class DeepBeliefNetwork(object):
"""docstring for DeepBeliefNetwork"""
| [
11748,
47986,
26245,
355,
299,
77,
198,
11748,
8324,
20941,
33,
5978,
89,
9038,
37573,
355,
374,
20475,
198,
198,
4871,
10766,
12193,
2086,
26245,
7,
15252,
2599,
198,
197,
37811,
15390,
8841,
329,
10766,
12193,
2086,
26245,
37811,
198,
... | 2.943396 | 53 |
# Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | [
2,
15069,
2211,
4946,
25896,
5693,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
921,
743,
7330,
... | 2.095094 | 4,627 |
from modules.lexer.keywords import cast_value_to_type
from modules.lexer.position import Position
from modules.lexer.token import Token
from modules.lexer.token_types import TT
from modules.visitor import errors as v_errors
from modules.visitor.transpiler.operators import get_c_operator
from .ast_node import ASTNode
fr... | [
6738,
13103,
13,
2588,
263,
13,
2539,
10879,
1330,
3350,
62,
8367,
62,
1462,
62,
4906,
198,
6738,
13103,
13,
2588,
263,
13,
9150,
1330,
23158,
198,
6738,
13103,
13,
2588,
263,
13,
30001,
1330,
29130,
198,
6738,
13103,
13,
2588,
263,
... | 2.424332 | 337 |
import unittest
from os1.packet import unpack
from .utils import FIXTURE_DIR, Recorder
| [
11748,
555,
715,
395,
198,
198,
6738,
28686,
16,
13,
8002,
316,
1330,
555,
8002,
198,
198,
6738,
764,
26791,
1330,
44855,
51,
11335,
62,
34720,
11,
3311,
2875,
628
] | 3 | 30 |
import datetime
from indicators.models import Indicator
from indicators.views.view_utils import (
generate_periodic_target_single,
generate_periodic_targets
)
from django import test
@test.tag('targets', 'fast')
@test.tag('targets', 'fast')
class GenerateMultiplePeriodicTargets(test.TestCase):
"""gener... | [
11748,
4818,
8079,
198,
198,
6738,
21337,
13,
27530,
1330,
1423,
26407,
198,
6738,
21337,
13,
33571,
13,
1177,
62,
26791,
1330,
357,
198,
220,
220,
220,
7716,
62,
41007,
291,
62,
16793,
62,
29762,
11,
198,
220,
220,
220,
7716,
62,
4... | 2.154978 | 1,155 |
from pathlib import Path
from skimage.io import imread
import numpy as np
from matplotlib import pyplot as plt
from tadataka.camera.io import load
from tadataka.feature import extract_features, Matcher
from tadataka.pose import Pose, estimate_pose_change, solve_pnp
from tadataka.triangulation import TwoViewTriangulat... | [
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
1341,
9060,
13,
952,
1330,
545,
961,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
198,
6738,
36264,
48088,
13,
25695,
13,
952,
... | 2.685801 | 662 |
import json
from tqdm import tqdm
if __name__ == '__main__':
main() | [
11748,
33918,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419
] | 2.517241 | 29 |
# This script is used to turn off the motion blur plugin from RenderPipeline
# We do this by commenting out the motion blur plugin in the plugins yaml configuration file from RP
import os.path as osp
fname = "plugins.yaml"
rp_dir = osp.join(osp.dirname(__file__), "thirdParty", "RenderPipeline", "config")
# Read each... | [
2,
770,
4226,
318,
973,
284,
1210,
572,
262,
6268,
23671,
13877,
422,
46722,
47,
541,
4470,
198,
2,
775,
466,
428,
416,
26387,
503,
262,
6268,
23671,
13877,
287,
262,
20652,
331,
43695,
8398,
2393,
422,
25812,
198,
198,
11748,
28686,
... | 2.77971 | 345 |
#
# Plasma
# Copyright (c) 2021 Yusuf Olokoba.
#
from torch import cat, clamp, tensor, Tensor
from ..conversion import rgb_to_yuv, yuv_to_rgb
def contrast (input: Tensor, weight: Tensor) -> Tensor:
"""
Apply contrast adjustment to an image.
Parameters:
input (Tensor): Input image with shape... | [
2,
220,
198,
2,
220,
220,
31226,
198,
2,
220,
220,
15069,
357,
66,
8,
33448,
41749,
3046,
6544,
482,
19981,
13,
198,
2,
198,
198,
6738,
28034,
1330,
3797,
11,
29405,
11,
11192,
273,
11,
309,
22854,
198,
198,
6738,
11485,
1102,
964... | 2.291391 | 1,057 |
# coding=utf-8
# Copyright 2018 The TF-Agents Authors.
#
# 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... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
2864,
383,
24958,
12,
10262,
658,
46665,
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,
... | 3.682274 | 299 |
# Test of Integrator class
import pytest
from simframe import Frame
from simframe import Integrator
from simframe import schemes
from simframe.frame import Field
from simframe.frame import Heartbeat
from simframe.frame import IntVar
| [
2,
6208,
286,
15995,
12392,
1398,
628,
198,
11748,
12972,
9288,
198,
6738,
985,
14535,
1330,
25184,
198,
6738,
985,
14535,
1330,
15995,
12392,
198,
6738,
985,
14535,
1330,
16546,
198,
6738,
985,
14535,
13,
14535,
1330,
7663,
198,
6738,
... | 4.086207 | 58 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import with_statement
import collections
from json import JSONEncoder
# A JSONEncoder subclass which handles map-like and list-like objects.
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
351,
62,
26090,
198,
198,
11748,
17268,
198,
6738,
33918,
... | 4.203125 | 64 |
from neo4j import __version__ as neo4j_version
from neo4j import GraphDatabase
from py2neo import Graph
import matplotlib.pyplot as plt
import py2neo
import pandas as pd
import re
if __name__ == "__main__":
print(neo4j_version)
# connect to graph database
graphdb = Graph(scheme="bolt", host="localhost",... | [
6738,
19102,
19,
73,
1330,
11593,
9641,
834,
355,
19102,
19,
73,
62,
9641,
198,
6738,
19102,
19,
73,
1330,
29681,
38105,
198,
6738,
12972,
17,
710,
78,
1330,
29681,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
... | 2.397155 | 1,828 |
from bokeh.sampledata import us_states, us_counties
from bokeh.plotting import figure, show, output_notebook, output_file, save
from bokeh import palettes
from bokeh.models import ColorBar,HoverTool,LinearColorMapper,ColumnDataSource,FixedTicker, LogColorMapper
output_notebook()
import re
import numpy as np
from modeli... | [
6738,
1489,
365,
71,
13,
37687,
10137,
1045,
1330,
514,
62,
27219,
11,
514,
62,
9127,
444,
198,
6738,
1489,
365,
71,
13,
29487,
889,
1330,
3785,
11,
905,
11,
5072,
62,
11295,
2070,
11,
5072,
62,
7753,
11,
3613,
198,
6738,
1489,
36... | 2.275496 | 6,697 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Adrian Lärkeryd <adrian.larkeryd@scilifelab.uu.se>
# Plotting libs
import plotly
import plotly.graph_objs as go
# My own files
from colour_science import SCILIFE_COLOURS
from issn_files import ISSN_IMPACT_2019, ISSN_IMPACT_2017, ISSN_IMPACT_2016, ISSN_IMPACT_20... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
6434,
25,
21462,
406,
11033,
81,
74,
1924,
67,
1279,
324,
4484,
13,
75,
668,
1924,
67,
31,
1416,
346,
361,
... | 1.80071 | 10,136 |
# coding: utf8
from zeit.cms.content.sources import FEATURE_TOGGLES
from zeit.cms.i18n import MessageFactory as _
from zeit.content.author.browser.interfaces import DuplicateAuthorWarning
import gocept.form.grouped
import re
import transaction
import zeit.cms.browser.form
import zeit.content.author.author
import zeit.c... | [
2,
19617,
25,
3384,
69,
23,
198,
6738,
41271,
270,
13,
46406,
13,
11299,
13,
82,
2203,
1330,
18630,
40086,
62,
51,
7730,
8763,
1546,
198,
6738,
41271,
270,
13,
46406,
13,
72,
1507,
77,
1330,
16000,
22810,
355,
4808,
198,
6738,
41271... | 2.964444 | 450 |
from interface.services.dm.ipubsub_management_service import PubsubManagementServiceClient | [
198,
6738,
7071,
13,
30416,
13,
36020,
13,
541,
549,
7266,
62,
27604,
62,
15271,
1330,
8525,
7266,
48032,
16177,
11792
] | 4.333333 | 21 |
# -*- coding: utf-8 -*-
import numpy as np
from dipy.reconst.multi_voxel import multi_voxel_fit
from dipy.reconst.base import ReconstModel, ReconstFit
from dipy.reconst.cache import Cache
from scipy.special import hermite, gamma, genlaguerre
try: # preferred scipy >= 0.14, required scipy >= 1.0
from scipy.special ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
19550,
88,
13,
260,
9979,
13,
41684,
62,
85,
1140,
417,
1330,
5021,
62,
85,
1140,
417,
62,
11147,
198,
6738,
19550,
88,
13,
... | 2.166118 | 22,803 |
import os
import pickle
import numpy as np
from fastapi import FastAPI
from pydantic import BaseModel
from typing import List, Tuple
from app.recommender import Recommender
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI(title="Movie Recommendations")
#origins = [
# "*"
#]
#
#app.add_middlewa... | [
11748,
28686,
198,
198,
11748,
2298,
293,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
3049,
15042,
1330,
12549,
17614,
198,
6738,
279,
5173,
5109,
1330,
7308,
17633,
198,
6738,
19720,
1330,
7343,
11,
309,
29291,
198,
6738,
598,
13,
4... | 2.608491 | 212 |
import os
import matplotlib.pyplot as plt
import matplotlib.animation as pltanim
import pandas as pd
class FigObserver:
'''
matplotlibにおけるfigとそのsubplot(axes)の状態保持・監視するスーパークラス。
plot処理はサブクラスにて関数を追加して実装。
'''
def __init__(self, figsize = (20, 20), cnt_row = 2, cnt_col = 2):
'''
... | [
11748,
28686,
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
11748,
2603,
29487,
8019,
13,
11227,
341,
355,
458,
83,
11227,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,
201,
198,
4871,
12138,
3131... | 1.503653 | 2,327 |
import math
value = float(input("Digite um valor:"))
print(f'O valor digitado foi {value} e a sua porção inteira é {math.trunc(value)}') | [
11748,
10688,
198,
8367,
796,
12178,
7,
15414,
7203,
19511,
578,
23781,
1188,
273,
11097,
4008,
198,
4798,
7,
69,
6,
46,
1188,
273,
16839,
4533,
11511,
72,
1391,
8367,
92,
304,
257,
424,
64,
16964,
16175,
28749,
493,
68,
8704,
38251,
... | 2.666667 | 51 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from typing import List
import json
def lisp_to_nested_expression(lisp_string: str) -> List:
"""
Takes a logical form as a lisp string and returns a nested list representation of the lisp.
For example, "(count (division first))" wou... | [
2,
15069,
357,
66,
8,
5413,
10501,
13,
198,
2,
49962,
739,
262,
17168,
5964,
13,
198,
198,
6738,
19720,
1330,
7343,
198,
11748,
33918,
628,
198,
4299,
300,
8802,
62,
1462,
62,
77,
7287,
62,
38011,
7,
75,
8802,
62,
8841,
25,
965,
... | 2.563895 | 493 |
import math
import wx
from meerk40t.core.node.op_cut import CutOpNode
from meerk40t.core.node.op_dots import DotsOpNode
from meerk40t.core.node.op_engrave import EngraveOpNode
from meerk40t.core.node.op_hatch import HatchOpNode
from meerk40t.core.node.op_image import ImageOpNode
from meerk40t.core.node.op_raster impo... | [
11748,
10688,
198,
198,
11748,
266,
87,
198,
198,
6738,
502,
9587,
1821,
83,
13,
7295,
13,
17440,
13,
404,
62,
8968,
1330,
9712,
18257,
19667,
198,
6738,
502,
9587,
1821,
83,
13,
7295,
13,
17440,
13,
404,
62,
67,
1747,
1330,
360,
... | 2.968182 | 220 |
from bson import ObjectId
from pymongo.errors import DuplicateKeyError
from flags import Platform, ProfilePermissionDefault, ProfilePermission, PermissionLevel
from models import OID_KEY, ChannelProfileModel, ChannelModel, ChannelConfigModel
from mongodb.factory import ChannelManager
from mongodb.factory.prof_base imp... | [
6738,
275,
1559,
1330,
9515,
7390,
198,
6738,
279,
4948,
25162,
13,
48277,
1330,
49821,
5344,
9218,
12331,
198,
198,
6738,
9701,
1330,
19193,
11,
13118,
5990,
3411,
19463,
11,
13118,
5990,
3411,
11,
2448,
3411,
4971,
198,
6738,
4981,
13... | 3.767123 | 146 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
| [
2,
21004,
25,
3384,
69,
12,
23,
198,
11748,
4818,
8079,
198,
6738,
5366,
13,
9945,
1330,
20613,
198,
6738,
5366,
13,
85,
17,
1330,
10011,
2611,
44,
4254,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198
] | 3.263158 | 38 |
import cv2 as cv
import numpy as np
from urllib.request import urlopen
import os
import datetime
import time
import sys
#change to your ESP32-CAM ip
url="http://192.168.29.199:81/stream"
CAMERA_BUFFRER_SIZE=4096
stream=urlopen(url)
bts=b''
i=0
while True:
try:
bts+=stream.read(CAMERA_BU... | [
11748,
269,
85,
17,
355,
269,
85,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
6738,
2956,
297,
571,
13,
25927,
1330,
19016,
9654,
201,
198,
11748,
28686,
201,
198,
11748,
4818,
8079,
201,
198,
11748,
640,
201,
198,
11748,
25064... | 1.569784 | 695 |
from pwn import *
io = remote('111.200.241.244', 53598)
e = ELF('level2')
system_address = e.symbols['system']
log.success('system_address => %s' % hex(system_address).upper())
bin_sh_address = e.search(b'/bin/sh').__next__()
log.success('bin_sh_address => %s' % hex(bin_sh_address).upper())
payload = b'a'*0x88 + b'fuc... | [
6738,
279,
675,
1330,
1635,
198,
198,
952,
796,
6569,
10786,
16243,
13,
2167,
13,
28872,
13,
25707,
3256,
642,
2327,
4089,
8,
198,
68,
796,
17852,
37,
10786,
5715,
17,
11537,
198,
10057,
62,
21975,
796,
304,
13,
1837,
2022,
10220,
1... | 2.309417 | 223 |
#!/usr/bin/env python
'''
GlobusArchiver.py helps users archive data to the Campaign Store (and other Globus Endpoints)
'''
import sys
if sys.version_info[0] < 3:
raise Exception(f"Must be using Python 3.6 or later")
if sys.version_info[0] == 3 and sys.version_info[1] < 6:
raise Exception(f"Must be using Pytho... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
7061,
6,
198,
9861,
672,
385,
19895,
1428,
13,
9078,
5419,
2985,
15424,
1366,
284,
262,
13718,
9363,
357,
392,
584,
40713,
385,
5268,
13033,
8,
198,
7061,
6,
198,
198,
11748,
25064,
... | 2.89222 | 4,203 |
#!/usr/bin/env python
from __future__ import print_function
import py_trees
import time
import rospy
from fetch_demo.behaviour_tree import PandaTree
DEBUG = False
PRINT_TREE = True
if __name__ == "__main__":
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
12972,
62,
83,
6037,
198,
11748,
640,
198,
11748,
686,
2777,
88,
198,
198,
6738,
21207,
62,
9536,
78,
13,
20709,
... | 2.790123 | 81 |
# Generated by Django 2.2.10 on 2022-03-04 09:39
from django.conf import settings
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
940,
319,
33160,
12,
3070,
12,
3023,
7769,
25,
2670,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 3.125 | 40 |
import cv2
import os
import numpy as np
import pandas as pd
def get_boxes(image_path, lw, threshold_min, cc, mode, output_path):
"""
Get the check boxes in an image
Arguments:
image_path = path of the image file
lw = length of the kernel
threshold_min = min value for binarizati... | [
11748,
269,
85,
17,
198,
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
4299,
651,
62,
29305,
7,
9060,
62,
6978,
11,
300,
86,
11,
11387,
62,
1084,
11,
36624,
11,
4235,
11,
5072,
6... | 1.988764 | 1,157 |
import os
from http.server import HTTPServer as BaseHTTPServer, SimpleHTTPRequestHandler
if __name__ == '__main__':
serve_viewer(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'mesh')) | [
11748,
28686,
198,
6738,
2638,
13,
15388,
1330,
38288,
18497,
355,
7308,
6535,
28820,
18497,
11,
17427,
40717,
18453,
25060,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
4691,
62,
1177,
263,
7,... | 2.802817 | 71 |
from terrabot.sim.cult import Cult
from terrabot.sim.event import EventTrigger, EventType
from terrabot.sim.resource import ResourceDelta
from terrabot.sim.tile import Tile, TileType, CultBonus
ROUND_TILES = (
Tile(
name = "RoundTile-4Water-Spade",
tile_type = TileType.ROUND,
... | [
6738,
8812,
397,
313,
13,
14323,
13,
40820,
1330,
22449,
198,
6738,
8812,
397,
313,
13,
14323,
13,
15596,
1330,
8558,
48344,
11,
8558,
6030,
198,
6738,
8812,
397,
313,
13,
14323,
13,
31092,
1330,
20857,
42430,
198,
6738,
8812,
397,
31... | 1.852423 | 454 |
from typing import Tuple
from hypothesis import given
from tests.port_tests.hints import PortedSegment
from tests.utils import (equivalence,
implication)
from . import strategies
@given(strategies.segments)
@given(strategies.segments_pairs)
@given(strategies.segments_triplets)
@given(... | [
6738,
19720,
1330,
309,
29291,
198,
198,
6738,
14078,
1330,
1813,
198,
198,
6738,
5254,
13,
634,
62,
41989,
13,
71,
29503,
1330,
4347,
276,
41030,
434,
198,
6738,
5254,
13,
26791,
1330,
357,
4853,
2473,
594,
11,
198,
220,
220,
220,
... | 2.710938 | 128 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
readme = open('README.rst').read()
setup(
name='mpass',
version=get_version(),
description="""MPASS""",
long_description=readme,
author='Haltu',
packages=find_packages(),
include_package_data=True,
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
961,
1326,
796,
1280,
10786,
15675,
11682,
13,... | 2.341709 | 199 |
#!/usr/bin/env python
from template.python.fileio import write_file
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
11055,
13,
29412,
13,
7753,
952,
1330,
3551,
62,
7753,
628,
628,
198
] | 3.041667 | 24 |
#!/env/Scripts/python
"""Library containing the handlers associated with the Teams Resouce"""
from django.http import HttpRequest, HttpResponse
from django.db.utils import IntegrityError
from workmanager.request_utils import route_base_request, no_items_found, Json, find_resource_continue_or_404 as find_team
from wor... | [
2,
48443,
24330,
14,
7391,
82,
14,
29412,
198,
37811,
23377,
7268,
262,
32847,
3917,
351,
262,
24690,
1874,
280,
344,
37811,
198,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
18453,
11,
367,
29281,
31077,
198,
6738,
42625,
14208... | 3.642857 | 98 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | [
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,... | 3.72043 | 186 |
import logging
import uuid
import pytest
from gold_digger.utils import ContextLogger
rerun_started = False
def pytest_addoption(parser):
"""
:type parser: _pytest.config.argparsing.Parser
"""
parser.addoption("--database-tests", action="store_true", help="Run database tests on real temporary databa... | [
11748,
18931,
198,
11748,
334,
27112,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
3869,
62,
12894,
1362,
13,
26791,
1330,
30532,
11187,
1362,
198,
198,
260,
5143,
62,
46981,
796,
10352,
628,
198,
4299,
12972,
9288,
62,
2860,
18076,
7,... | 2.579019 | 734 |
# Zhihao Zhang
# NGSIM dataset processor trajdata.py file
import math
import os
import numpy as np
from src import ngsim_trajdata
from src import trajectory_smoothing
from src.Vec import VecSE2
from src import const
from src.Roadway import roadway
from src.Record import record
from src.Basic import Vehicle
from tqdm i... | [
2,
1168,
5303,
23778,
19439,
198,
2,
399,
14313,
3955,
27039,
12649,
1291,
73,
7890,
13,
9078,
2393,
198,
198,
11748,
10688,
198,
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
12351,
1330,
23370,
14323,
62,
9535,
73,
7890... | 2.208086 | 2,523 |
import sys
from sqlalchemy import create_engine
import pandas as pd
import re
import numpy as np
import nltk
nltk.download(['punkt', 'wordnet'])
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
from sklearn.ensemble import RandomForestClassifier
from sklearn.multioutput import MultiOut... | [
11748,
25064,
198,
6738,
44161,
282,
26599,
1330,
2251,
62,
18392,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
302,
198,
11748,
299,
32152,
355,
45941,
198,
198,
11748,
299,
2528,
74,
198,
77,
2528,
74,
13,
15002,
7,
17816,
3035... | 2.397527 | 1,698 |
#!/usr/bin/python
# Imports
import sys, os, re, time
import argparse
import pdb
import pickle
from itertools import *
# Science
import numpy as np
import scipy.stats as stats
import pandas as pd
# Plotting
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib import colors
##########... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
2,
1846,
3742,
198,
11748,
25064,
11,
28686,
11,
302,
11,
640,
198,
11748,
1822,
29572,
198,
11748,
279,
9945,
198,
11748,
2298,
293,
198,
6738,
340,
861,
10141,
1330,
1635,
198,
2,
58... | 2.30138 | 17,025 |
from PyQt6.QtWidgets import QApplication, QWidget, QPushButton, QLabel
from PyQt6.QtGui import QIcon, QFont
import sys
app = QApplication(sys.argv)
window = Window()
window.show()
sys.exit(app.exec())
| [
6738,
9485,
48,
83,
21,
13,
48,
83,
54,
312,
11407,
1330,
1195,
23416,
11,
1195,
38300,
11,
1195,
49222,
21864,
11,
1195,
33986,
201,
198,
6738,
9485,
48,
83,
21,
13,
48,
83,
8205,
72,
1330,
1195,
19578,
11,
1195,
23252,
201,
198,... | 2.465116 | 86 |
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 15 10:19:09 2020
@author: tonim
"""
import keras,os
from keras.models import Sequential
from keras.layers import Dense, Conv2D, MaxPool2D , Flatten
from keras.preprocessing.image import ImageDataGenerator
import numpy as np
##image_p=ImageDataGenerator()
##Ima... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
26223,
2556,
1315,
838,
25,
1129,
25,
2931,
12131,
201,
198,
201,
198,
31,
9800,
25,
5680,
320,
201,
198,
37811,
201,
198,
11748,
419... | 2.661484 | 1,415 |
import boto3
from trp import Document
# Document
s3BucketName = "ki-textract-demo-docs"
documentName = "expense.png"
# Amazon Textract client
textract = boto3.client('textract')
# Call Amazon Textract
response = textract.analyze_document(
Document={
'S3Object': {
'Bucket': s3BucketName,
... | [
11748,
275,
2069,
18,
198,
6738,
491,
79,
1330,
16854,
198,
198,
2,
16854,
198,
82,
18,
33,
38811,
5376,
796,
366,
4106,
12,
5239,
974,
12,
9536,
78,
12,
31628,
1,
198,
22897,
5376,
796,
366,
11201,
1072,
13,
11134,
1,
198,
198,
... | 2.097466 | 513 |
import sys
import uuid
import psutil
import time
from datetime import datetime
# remove for production
from pprint import pprint
from functools import reduce
import function_lib as lib
| [
11748,
25064,
198,
11748,
334,
27112,
198,
11748,
26692,
22602,
198,
11748,
640,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
2,
4781,
329,
3227,
198,
6738,
279,
4798,
1330,
279,
4798,
198,
6738,
1257,
310,
10141,
1330,
4646,
198,
1174... | 3.857143 | 49 |
import os
import math
import numpy as np
import tensorflow as tf
if __name__ == "__main__":
s = get_data()
print(s['X'].shape, s['y'].shape) | [
11748,
28686,
198,
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
264,
796,
651,
62,
7890,
3419,
198,
... | 2.483333 | 60 |
# Generated by Django 3.0.3 on 2020-03-01 19:34
from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import uuid
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
18,
319,
12131,
12,
3070,
12,
486,
678,
25,
2682,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
11748,
42625,
14208,
13,
3642,
822,
13,
7353,
34239,
13,
25747,
13,
17752,
65,
... | 3 | 71 |
import requests
from link_processing import get_file_format_from_link
from data_collection import download_picture
| [
11748,
7007,
198,
6738,
2792,
62,
36948,
1330,
651,
62,
7753,
62,
18982,
62,
6738,
62,
8726,
198,
6738,
1366,
62,
43681,
1330,
4321,
62,
34053,
628,
628
] | 4.214286 | 28 |
import pyaudio
import threading
import time
import argparse
import wave
import torchaudio
import torch
from utils.dataset import get_featurizer
# from utils.decoder import DecodeGreedy, CTCBeamDecoder
from utils.decoder import DecodeGreedy, GreedyCTCDecoder
import os
CHUNCK_SIZE = 1024
if __name__ == "__main__":
... | [
11748,
12972,
24051,
198,
11748,
4704,
278,
198,
11748,
640,
198,
11748,
1822,
29572,
198,
11748,
6769,
198,
11748,
28034,
24051,
198,
11748,
28034,
198,
6738,
3384,
4487,
13,
19608,
292,
316,
1330,
651,
62,
5036,
2541,
7509,
198,
2,
42... | 2.561798 | 445 |
import urllib.parse
import urllib.request
from configparser import NoOptionError
from io import StringIO
import pandas as pd
import sroka.config.config as config
def get_data_from_rubicon(rubicon_dict, currency='USD'):
"""
Function that download data from Rubicon db through API to pandas DataFrame.
Arg... | [
11748,
2956,
297,
571,
13,
29572,
198,
11748,
2956,
297,
571,
13,
25927,
198,
6738,
4566,
48610,
1330,
1400,
19722,
12331,
198,
6738,
33245,
1330,
10903,
9399,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
11748,
264,
305,
4914,
... | 2.613183 | 1,153 |
import time
import torch
import numpy as np
import cv2
| [
11748,
640,
198,
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
628,
628,
628,
628
] | 3.1 | 20 |
from django.contrib import admin
from . import models
# Register your models here.
admin.site.register(models.Technology)
admin.site.register(models.Kit)
admin.site.register(models.Reservation)
admin.site.register(models.ReservationRequest)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
1330,
4981,
198,
198,
2,
17296,
534,
4981,
994,
13,
198,
28482,
13,
15654,
13,
30238,
7,
27530,
13,
44893,
8,
198,
28482,
13,
15654,
13,
30238,
7,
27530,
13,
20827,
8,
... | 3.507246 | 69 |
import enum
import os
from collections import defaultdict
import numpy as np
import pandas as pd
from tqdm import tqdm
from pathlib import Path
from sklearn import metrics
from sklearn.preprocessing import StandardScaler
from sklearn.cluster import AgglomerativeClustering
from sklearn.decomposition import LatentDiric... | [
11748,
33829,
198,
11748,
28686,
198,
6738,
17268,
1330,
4277,
11600,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
6738,
3108,
8019,
1330,
1064... | 2.780488 | 492 |
from collections import OrderedDict
import os
from warnings import warn
from .utils import load_jobfile, save_jobfile
from .constants import sep, wsep, flag_on, flag_off
| [
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
11748,
28686,
198,
6738,
14601,
1330,
9828,
198,
198,
6738,
764,
26791,
1330,
3440,
62,
21858,
7753,
11,
3613,
62,
21858,
7753,
198,
6738,
764,
9979,
1187,
1330,
41767,
11,
266,
325,
79,
1... | 3.42 | 50 |
from django import forms
from .configs import CNT_CHOICES | [
6738,
42625,
14208,
1330,
5107,
198,
6738,
764,
11250,
82,
1330,
327,
11251,
62,
44899,
34444
] | 3.5625 | 16 |
import smbus2
import bme280
import time
| [
11748,
895,
10885,
17,
198,
11748,
275,
1326,
21033,
198,
198,
11748,
640,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198
] | 2.173913 | 23 |
#
# @lc app=leetcode id=123 lang=python3
#
# [123] Best Time to Buy and Sell Stock III
#
# https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/description/
#
# algorithms
# Hard (39.74%)
# Likes: 3278
# Dislikes: 85
# Total Accepted: 277.6K
# Total Submissions: 695.1K
# Testcase Example: '[3,3,5,0,... | [
2,
198,
2,
2488,
44601,
598,
28,
293,
316,
8189,
4686,
28,
10163,
42392,
28,
29412,
18,
198,
2,
198,
2,
685,
10163,
60,
6705,
3862,
284,
11763,
290,
25688,
10500,
6711,
198,
2,
198,
2,
3740,
1378,
293,
316,
8189,
13,
785,
14,
16... | 2.508449 | 651 |