content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# -*- coding: utf-8 -*-
"""Data fetching utility for USDA datasets.
This module provides the primary support functions for downloading datasets from
a text file. Each line in the text file is expected to be a complete URL. Lines
that begin with '#' are ignored.
Example:
This module can be run directly with th... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
6601,
21207,
278,
10361,
329,
29986,
40522,
13,
198,
198,
1212,
8265,
3769,
262,
4165,
1104,
5499,
329,
22023,
40522,
422,
198,
64,
2420,
2393,
13,
220,
5501... | 2.693227 | 502 |
from feeds.alltests.feeds_tests import * | [
6738,
21318,
13,
439,
41989,
13,
12363,
82,
62,
41989,
1330,
1635
] | 3.333333 | 12 |
import numpy as np
import pylab
from scipy import sparse
import regreg.api as rr
Y = np.random.standard_normal(500); Y[100:150] += 7; Y[250:300] += 14
loss = rr.quadratic.shift(-Y, coef=0.5)
sparsity = rr.l1norm(len(Y), 1.4)
# TODO should make a module to compute typical Ds
D = sparse.csr_matrix((np.identity(500) +... | [
11748,
299,
32152,
355,
45941,
198,
11748,
279,
2645,
397,
197,
198,
6738,
629,
541,
88,
1330,
29877,
198,
198,
11748,
842,
2301,
13,
15042,
355,
374,
81,
198,
198,
56,
796,
45941,
13,
25120,
13,
20307,
62,
11265,
7,
4059,
1776,
575... | 2.318126 | 811 |
from typing import Dict
import aiohttp
from async_timeout import timeout
from openapi.testing import json_body
| [
6738,
19720,
1330,
360,
713,
198,
198,
11748,
257,
952,
4023,
198,
6738,
30351,
62,
48678,
1330,
26827,
198,
198,
6738,
1280,
15042,
13,
33407,
1330,
33918,
62,
2618,
628,
628,
628,
628,
628,
628,
628,
628
] | 3.459459 | 37 |
#!/usr/bin/env python
import os
import subprocess
TID_FILE = "src/tiddlers/system/plugins/security_tools/twsm.tid"
VERSION_FILE = "VERSION"
if __name__ == "__main__":
main() | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
198,
51,
2389,
62,
25664,
796,
366,
10677,
14,
83,
1638,
8116,
14,
10057,
14,
37390,
14,
12961,
62,
31391,
14,
4246,
5796,
13,
83,
312,
1,
... | 2.594203 | 69 |
# coding=utf-8
"""
@author: oShine <oyjqdlp@126.com>
@link: https://github.com/ouyangjunqiu/ou.py
定时器,每隔一段时间执行一次
"""
import threading
| [
2,
19617,
28,
40477,
12,
23,
198,
37811,
198,
198,
31,
9800,
25,
267,
2484,
500,
1279,
726,
73,
80,
25404,
79,
31,
19420,
13,
785,
29,
198,
31,
8726,
25,
3740,
1378,
12567,
13,
785,
14,
280,
17859,
29741,
80,
16115,
14,
280,
13,... | 1.593023 | 86 |
for n in range(10):
print(n, factorial(n))
| [
198,
198,
1640,
299,
287,
2837,
7,
940,
2599,
198,
220,
220,
220,
3601,
7,
77,
11,
1109,
5132,
7,
77,
4008,
198
] | 2.130435 | 23 |
@set_log(1)
def test01():
"""
@super_set_func(1) 带有参数的装饰器,用来区分多个函数都被同一个装饰器装饰,用来区分函数
实现的原理是,把装饰器外边包上一层函数,带有参数
这种特殊的带有参数的装饰器,并不是直接test01 = set_log(1, test01)的,并非直接把函数名传递给set_log
1- @装饰器(参数) 会先**调用**set_log函数,把1当作实参进行传递,此时跟函数名没有关系,先调用带有参数的set_log函数
2- 把set_log函数的返回值,当作装饰器进行装饰... | [
198,
198,
31,
2617,
62,
6404,
7,
16,
8,
198,
4299,
1332,
486,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
16668,
62,
2617,
62,
20786,
7,
16,
8,
10263,
116,
99,
17312,
231,
20998,
224,
46763,
1... | 0.86014 | 858 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of fionautil.
# http://github.com/fitnr/fionautil
# Licensed under the GPLv3 license:
# http://http://opensource.org/licenses/GPL-3.0
# Copyright (c) 2015, Neil Freeman <contact@fakeisthenewreal.org>
import collections
from unittest import TestCase as... | [
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,
770,
2393,
318,
636,
286,
277,
295,
2306,
346,
13,
198,
2,
2638,
1378,
12567,
13,
785,
14,
11147,
48624,
14... | 2.64 | 225 |
#!/usr/bin/env python
# ScraperWiki Limited
# Ian Hopkinson, 2013-06-20
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
import codecs
sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
"""
Analysis and visualisation library for pdftables
"""
import pdftables as pt
import matplotlib.pyplot... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
1446,
38545,
32603,
15302,
198,
2,
12930,
21183,
261,
11,
2211,
12,
3312,
12,
1238,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
11593,
37443,
... | 2.221617 | 1,286 |
import rhinoscriptsyntax as rs
| [
11748,
9529,
11996,
6519,
1837,
41641,
355,
44608,
201,
198,
220,
220,
220,
220,
201,
198,
220,
220,
220,
220
] | 2.1 | 20 |
# !/usr/bin/python3.7
# -*- coding: utf-8 -*-
# @Time : 2020/6/22 上午9:58
# @Author: Jtyoui@qq.com
# @Notes : 身份证检查
from .idcard import IdCard
__version__ = '2020.6.22'
__author__ = 'Jtyoui'
__description__ = '身份证实体抽取,身份证补全,身份证检测等功能。'
__email__ = 'jtyoui@qq.com'
__names__ = 'pyUnit_idCard'
__url__ = 'https://github.co... | [
2,
5145,
14,
14629,
14,
8800,
14,
29412,
18,
13,
22,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
7575,
220,
1058,
12131,
14,
21,
14,
1828,
220,
41468,
39355,
230,
24,
25,
3365,
198,
2,
2488,
13... | 1.6 | 215 |
# -*- coding: utf-8 -*-
# Copyright (c) 2017-2018 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
220,
15069,
357,
66,
8,
2177,
12,
7908,
12024,
21852,
11,
3457,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
... | 3.186352 | 381 |
# Copyright 2017 Arie Bregman
#
# 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 agree... | [
2,
15069,
2177,
317,
5034,
347,
2301,
805,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
220,
220,
407,
779,
428,
2393,
2845,
287,
11846,... | 2.813149 | 578 |
import pytest
from nerwhal.integrated_recognizers.phone_number_recognizer import PhoneNumberRecognizer
@pytest.fixture(scope="module")
# DIN 5008
# Microsoft's canonical format
# E.123
# Others
# Non-standard
# US style
# Not phone numbers
| [
11748,
12972,
9288,
198,
198,
6738,
17156,
1929,
282,
13,
18908,
4111,
62,
26243,
11341,
13,
4862,
62,
17618,
62,
26243,
7509,
1330,
14484,
15057,
6690,
2360,
7509,
628,
198,
31,
9078,
9288,
13,
69,
9602,
7,
29982,
2625,
21412,
4943,
... | 2.917526 | 97 |
# OBSS SAHI Tool
# Code written by Kadir Nar, 2022.
import unittest
from sahi.utils.cv import read_image
from sahi.utils.torchvision import TorchVisionTestConstants
MODEL_DEVICE = "cpu"
CONFIDENCE_THRESHOLD = 0.5
IMAGE_SIZE = 320
if __name__ == "__main__":
unittest.main()
| [
2,
440,
4462,
50,
14719,
25374,
16984,
198,
2,
6127,
3194,
416,
31996,
343,
13596,
11,
33160,
13,
628,
198,
11748,
555,
715,
395,
198,
198,
6738,
473,
5303,
13,
26791,
13,
33967,
1330,
1100,
62,
9060,
198,
6738,
473,
5303,
13,
26791... | 2.605505 | 109 |
from django.urls import path, include
from tool import views
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register('candidates', views.CandidatesViewSet)
router.register('jobs', views.JobViewSet)
urlpatterns = [
path('', include(router.urls)),
path('recruiters/', views.Rec... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
2291,
198,
6738,
2891,
1330,
5009,
198,
198,
6738,
1334,
62,
30604,
13,
472,
1010,
1330,
15161,
49,
39605,
198,
198,
472,
353,
796,
15161,
49,
39605,
3419,
198,
472,
353,
13,
30238,
... | 2.911765 | 204 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
9387,
351,
428,
670,
329,
3224,
1321,
198,
2,
5115,
6634,
9238,
13,
220,
383,
7054,... | 3.695035 | 282 |
import pexpect
import timeout_decorator
#csk = CreateSSLKey()
#csk.start()
| [
11748,
613,
87,
806,
198,
11748,
26827,
62,
12501,
273,
1352,
628,
628,
628,
198,
2,
6359,
74,
796,
13610,
31127,
9218,
3419,
198,
2,
6359,
74,
13,
9688,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
220,
628
] | 2.3 | 40 |
import argparse
import torch
import torch.utils.data.distributed
import pprint
from utils.MyDataset import MyDataLoader, MyDataset
from config import args as default_args, project_root_path
import numpy as np
import pandas as pd
import os
from models import (
SOTA_goal_model,
AlbertForMultipleChoice,
Robert... | [
11748,
1822,
29572,
198,
11748,
28034,
198,
11748,
28034,
13,
26791,
13,
7890,
13,
17080,
6169,
198,
11748,
279,
4798,
198,
6738,
3384,
4487,
13,
3666,
27354,
292,
316,
1330,
2011,
6601,
17401,
11,
2011,
27354,
292,
316,
198,
6738,
4566... | 2.286232 | 2,760 |
# python 3.6
import logging
import os
import random
import time
from threading import Thread
from paho.mqtt import client as mqtt_client
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s', level=logging.INFO)
mqtt_broker = os.environ['MQTT_BROKER']
mqtt_topic = os.environ['MQTT_TOPIC']
value_type... | [
2,
21015,
513,
13,
21,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
640,
198,
6738,
4704,
278,
1330,
14122,
198,
198,
6738,
279,
17108,
13,
76,
80,
926,
1330,
5456,
355,
285,
80,
926,
62,
16366,
198,
198,
6404... | 2.654618 | 498 |
import pytest
from .app import oso, Organization, Repository, User
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.fixture
| [
11748,
12972,
9288,
198,
198,
6738,
764,
1324,
1330,
267,
568,
11,
12275,
11,
1432,
13264,
11,
11787,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198... | 2.527473 | 91 |
import csv
buffer = []
for i in range(0,100):
buffer.append(i)
print("Writing buffer to buffer.csv now...")
data_logger_csv(buffer,"buffer.csv") | [
11748,
269,
21370,
198,
197,
197,
198,
22252,
796,
17635,
198,
1640,
1312,
287,
2837,
7,
15,
11,
3064,
2599,
198,
197,
22252,
13,
33295,
7,
72,
8,
198,
197,
198,
4798,
7203,
33874,
11876,
284,
11876,
13,
40664,
783,
9313,
8,
198,
... | 2.678571 | 56 |
# -*- coding: utf-8
"""Unit tests for the mstranslate event plugin."""
# pylint: disable=missing-docstring,too-few-public-methods
from twisted.internet.defer import inlineCallbacks
from twisted.trial.unittest import TestCase
from ...test.helpers import CommandTestMixin
from . import Default
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
198,
37811,
26453,
5254,
329,
262,
285,
2536,
504,
17660,
1785,
13877,
526,
15931,
198,
2,
279,
2645,
600,
25,
15560,
28,
45688,
12,
15390,
8841,
11,
18820,
12,
32146,
12,
11377,
12,
243... | 3.3 | 90 |
from abc import ABCMeta, abstractmethod
class DefaultExperimentProvider(object):
"""
Abstract base class for objects that provide the ID of an MLflow Experiment based on the
current client context. For example, when the MLflow client is running in a Databricks Job,
a provider is used to obtain the ID ... | [
6738,
450,
66,
1330,
9738,
48526,
11,
12531,
24396,
628,
198,
4871,
15161,
20468,
3681,
29495,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
27741,
2779,
1398,
329,
5563,
326,
2148,
262,
4522,
286,
281,
10373,
11125,
... | 3.251984 | 504 |
# -*- coding: utf-8 -*-
"""Provide a traversal root that looks up registered resources."""
__all__ = [
'EngineRoot',
]
import logging
logger = logging.getLogger(__name__)
import zope.interface as zi
import pyramid_basemodel as bm
from pyramid_basemodel import container
from pyramid_basemodel import tree
from ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
15946,
485,
257,
33038,
282,
6808,
326,
3073,
510,
6823,
4133,
526,
15931,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
705,
13798,
30016,
3256,
... | 2.713168 | 767 |
#!/usr/bin/env python
import urllib2
httpCode = http_code()
uri = ["https://www.digitalocean.com/community/tutorials/how-to-import-and-export-databases-in-mysql-or-mariadb/lkajsklas/90/laksjkjas/alsjhkahskjas/asjhakjshkjas/aslkjakslj"]
for i in uri:
httpCode.error(i)
print '\n'
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
628,
198,
11748,
2956,
297,
571,
17,
628,
198,
220,
220,
220,
220,
220,
198,
198,
4023,
10669,
796,
2638,
62,
8189,
3419,
198,
198,
9900,
796,
14631,
5450,
1378,
2503,
13,
34725,
78,
5829... | 2.097222 | 144 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
response = urllib2.urlopen("https://www.python.org/")
html = response.read()
# print out the HTML response
print(html)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
2956,
297,
571,
17,
198,
198,
26209,
796,
2956,
297,
571,
17,
13,
6371,
9654,
7203,
5450,
1378,
2503,
13,... | 2.577465 | 71 |
# LOCAL IMPORTS
from Connection.connection import Connection # connecting to SQL database
"""
It's meant to be run only before using the project for the first time (or at least for the first time in
a certain database (make sure you changed parameters in Connection/'con_parameters.py' file.
"""
with C... | [
2,
37347,
1847,
30023,
33002,
201,
198,
6738,
26923,
13,
38659,
1330,
26923,
1303,
14320,
284,
16363,
6831,
201,
198,
37811,
201,
198,
220,
220,
220,
632,
338,
4001,
284,
307,
1057,
691,
878,
1262,
262,
1628,
329,
262,
717,
640,
357,
... | 2.618529 | 367 |
import sys
sys.path.insert(0, "/home/puneeth/Projects/GAN/GenerativeAdversarialNetworks/utilities")
import mini_batch_gradient_descent as gd
import plotting_functions as pf
import numpy as np
X = np.transpose(np.random.random_sample(10) * 2.0)
obj = [X]
mle = gd.GradientDescentOptimizer(X, 10**-4, 1)
theta = mle.optimi... | [
11748,
25064,
198,
17597,
13,
6978,
13,
28463,
7,
15,
11,
12813,
11195,
14,
79,
1726,
2788,
14,
16775,
82,
14,
45028,
14,
8645,
876,
2782,
690,
36098,
7934,
5225,
14,
315,
2410,
4943,
198,
11748,
9927,
62,
43501,
62,
49607,
62,
8906... | 2.437788 | 217 |
# Import Setup and Dependancies
import numpy as np
import datetime as dt
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
from flask import Flask, jsonify
########## Database Setup ###########
engine = create_engine("sql... | [
2,
17267,
31122,
290,
37947,
16183,
198,
11748,
299,
32152,
355,
45941,
220,
198,
11748,
4818,
8079,
355,
288,
83,
198,
11748,
44161,
282,
26599,
220,
198,
6738,
44161,
282,
26599,
13,
2302,
13,
2306,
296,
499,
1330,
3557,
499,
62,
86... | 2.18552 | 1,105 |
from lib.database import db_connect | [
6738,
9195,
13,
48806,
1330,
20613,
62,
8443
] | 4.375 | 8 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from werkzeug.wrappers import Response
import frappe
import json
__version__ = '0.0.1'
@frappe.whitelist(allow_guest=True)
# api url: http://<site_name>/api/method/vsf_erpnext.cart.update?token=&cartId=
@frappe.whitelist(allow_guest=True)
| [
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,
6738,
266,
9587,
2736,
1018,
13,
29988,
11799,
1330,
18261,
198,
11748,
5306,
27768,
198,
11748,
33918,
19... | 2.456 | 125 |
import pytest
from gaea.config import CONFIG
from hermes.constants import SENDER, TO
from hermes.email_engine import EmailEngine
@pytest.fixture(scope="module", autouse=True)
| [
11748,
12972,
9288,
198,
198,
6738,
308,
44705,
13,
11250,
1330,
25626,
198,
198,
6738,
607,
6880,
13,
9979,
1187,
1330,
311,
10619,
1137,
11,
5390,
198,
6738,
607,
6880,
13,
12888,
62,
18392,
1330,
9570,
13798,
628,
198,
31,
9078,
92... | 3.155172 | 58 |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | [
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
393,
517,
198,
2,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
9387,
351,
198,
2,
428,
670,
329,
3224,
1321,
5115,
6634,
9238,
13,
198,
2,
383,
7054,
37,
... | 2.911493 | 1,514 |
import networkx as nx
from models.case import Case
from models.legal_knowledge_graph import LegalKnowledgeGraph
from helpers import *
from custom import *
G = init_graph("{}/all_citations.txt".format(DATADIR)).fetch_subgraph(
query_type='case')
print(len(G.nodes()))
print(len(G.edges()))
print(G.in_degree_di... | [
11748,
3127,
87,
355,
299,
87,
198,
198,
6738,
4981,
13,
7442,
1330,
8913,
198,
6738,
4981,
13,
18011,
62,
45066,
62,
34960,
1330,
16027,
23812,
2965,
37065,
198,
6738,
49385,
1330,
1635,
198,
6738,
2183,
1330,
1635,
198,
198,
38,
796... | 2.421296 | 1,296 |
import torch
import torch.nn as nn
import nlpblock as nb
"""
Example to run
model = RNN_Attention(emb_dim=50,
n_class=2, n_hidden=128, n_layers=1, bidirectional=False, linearTransform=True)
output, attention = model(
torch.rand([3, 5, 50]) # [batch, seq_len, emb_dim]
)
print(output.shape,... | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
299,
34431,
9967,
355,
299,
65,
198,
198,
37811,
198,
16281,
284,
1057,
198,
19849,
796,
371,
6144,
62,
8086,
1463,
7,
24419,
62,
27740,
28,
1120,
11,
198,
220,
2... | 2.358621 | 145 |
import os
from celery.result import AsyncResult
from fastapi import APIRouter, Depends, Request
from fastapi.responses import FileResponse, JSONResponse
from services.calculators import TophatterCalculator
from services.database.user_database import UserDatabase
from services.mapper import TophatterMapper
from service... | [
11748,
28686,
198,
198,
6738,
18725,
1924,
13,
20274,
1330,
1081,
13361,
23004,
198,
6738,
3049,
15042,
1330,
3486,
4663,
39605,
11,
2129,
2412,
11,
19390,
198,
6738,
3049,
15042,
13,
16733,
274,
1330,
9220,
31077,
11,
19449,
31077,
198,
... | 3.255102 | 196 |
nome = input('Digite o nome completo da pessoa: ').strip() # usa-se o método strip para retirar os espaços vazios antes e depois da frase
print('O nome completo da pessoa em maiúsculo é: ', nome.upper()) # usa o método 'upper' para transformar toda a frase em maiúscula
print('O nome completo da pessoa em minúsculo é: ... | [
77,
462,
796,
5128,
10786,
19511,
578,
267,
299,
462,
1224,
1462,
12379,
279,
408,
12162,
25,
705,
737,
36311,
3419,
1303,
514,
64,
12,
325,
267,
285,
25125,
24313,
10283,
31215,
1005,
343,
283,
28686,
1658,
8957,
16175,
418,
410,
103... | 1.751163 | 860 |
import abc
import os
import zipfile
from typing import List
from justmltools.config.abstract_data_path_config import AbstractDataPathConfig
from justmltools.config.local_data_path_config import LocalDataPathConfig
| [
11748,
450,
66,
198,
11748,
28686,
198,
11748,
19974,
7753,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
655,
76,
2528,
10141,
13,
11250,
13,
397,
8709,
62,
7890,
62,
6978,
62,
11250,
1330,
27741,
6601,
15235,
16934,
198,
6738,
655,
... | 3.6 | 60 |
# -*- coding: utf-8 -*-
'''Command line interface module for intro_py-intro.
'''
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os, sys, argparse, json
import logging, inspect
from future.builtins import (ascii, filter, hex, map, oct, zip, str, open, dict)
from intro... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
21575,
1627,
7071,
8265,
329,
18951,
62,
9078,
12,
600,
305,
13,
198,
198,
7061,
6,
198,
198,
6738,
11593,
37443,
834,
1330,
357,
48546,
62,
11748,
11,
7297,
... | 2.31379 | 1,211 |
from sklearn.model_selection import BaseCrossValidator
import numpy as np
import pandas as pd
# We dont implement this one
if __name__ == "__main__":
versions = np.reshape(np.array( [1,1,1,2,2,2,2,3,3,3] ), (10,1))
data = np.reshape(np.zeros(100), (10, 10))
X = pd.DataFrame( np.append( versions, ... | [
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
7308,
21544,
47139,
1352,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
775,
17666,
3494,
428,
530,
628,
198... | 2.301527 | 262 |
# format, name, destination register, source 1, data of source 1, IB in which data expected, source 2, data of source 2, IB in which data expected, immediate data, T_NT,stall
#A=[format,name,rd,rs1,rs2,imm]
#A=[format,name,rd,rs1,rs2,imm]
# format, name, destination register, source 1, data of source 1, IB in whic... | [
198,
2,
5794,
11,
1438,
11,
10965,
7881,
11,
2723,
352,
11,
1366,
286,
2723,
352,
11,
34782,
287,
543,
1366,
2938,
11,
2723,
362,
11,
1366,
286,
2723,
362,
11,
34782,
287,
543,
1366,
2938,
11,
7103,
1366,
11,
309,
62,
11251,
11,
... | 1.923077 | 494 |
from datetime import datetime
from django.shortcuts import redirect
from django.urls import reverse_lazy
from django.views.generic import ListView, View
from django.views.generic.edit import CreateView, UpdateView
from django.contrib.auth.mixins import LoginRequiredMixin
from backend.forum.models import Category, Sec... | [
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
18941,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
62,
75,
12582,
198,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
7343,
7680,
11,... | 2.384314 | 765 |
import urllib
import urllib.request
try:
site = urllib.request.urlopen('http://pudim.com.br/')
except urllib.error.URLError:
print('O site ardeu')
else:
print('Pode ir tá tudo nice')
| [
11748,
2956,
297,
571,
198,
11748,
2956,
297,
571,
13,
25927,
198,
28311,
25,
198,
220,
220,
220,
2524,
796,
2956,
297,
571,
13,
25927,
13,
6371,
9654,
10786,
4023,
1378,
79,
463,
320,
13,
785,
13,
1671,
14,
11537,
198,
16341,
2956,... | 2.321429 | 84 |
import six
DefinitionsHost = {'discriminator': 'name',
'required': ['name',
'region_id',
'ip_address',
'device_type'],
'type': 'object',
'properties': {
... | [
11748,
2237,
628,
198,
7469,
50101,
17932,
796,
1391,
6,
15410,
3036,
20900,
10354,
705,
3672,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
35827,
10354,
37250,
3672,
3256,
... | 1.687093 | 18,881 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './modules/dialogPassword.ui'
#
# Created by: PyQt4 UI code generator 4.12.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
try:
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
5178,
7822,
7560,
422,
3555,
334,
72,
2393,
705,
19571,
18170,
14,
38969,
519,
35215,
13,
9019,
6,
198,
2,
198,
2,
15622,
416,
25,
9485,
48,
83,
19,
12454,
... | 2.715278 | 144 |
#!/bin/python
import listify_circuits
listify_circuits.optimize_circuits(16, 'forward') | [
2,
48443,
8800,
14,
29412,
198,
198,
11748,
1351,
1958,
62,
21170,
15379,
198,
4868,
1958,
62,
21170,
15379,
13,
40085,
1096,
62,
21170,
15379,
7,
1433,
11,
705,
11813,
11537
] | 2.83871 | 31 |
'''
Quick setup script.
'''
import os
os.system('brew install ffmpeg')
os.system('brew install youtube-dl')
modules=['ffmpy','pandas','soundfile','pafy', 'tqdm']
pip_install(modules)
| [
7061,
6,
198,
21063,
9058,
4226,
13,
198,
7061,
6,
198,
11748,
28686,
220,
198,
198,
418,
13,
10057,
10786,
11269,
2721,
31246,
43913,
11537,
198,
418,
13,
10057,
10786,
11269,
2721,
35116,
12,
25404,
11537,
198,
18170,
28,
17816,
487,
... | 2.681159 | 69 |
import os
import sys
import torch
import logging
import pickle
import datetime
from tqdm import tqdm
sys.path.append('datapreprocess')
sys.path.append('module')
from datafunc import make_dataloader, test_data_for_predict, build_processed_data, make_validloader
from model import LinearNet, RnnNet, RnnAttentionNet
| [
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
28034,
198,
11748,
18931,
198,
11748,
2298,
293,
198,
11748,
4818,
8079,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
198,
17597,
13,
6978,
13,
33295,
10786,
19608,
499,
260,
14... | 3.148515 | 101 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-04-23 11:10
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
24,
319,
1584,
12,
3023,
12,
1954,
1367,
25,
940,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
... | 2.781818 | 55 |
from setuptools import find_packages, setup
setup(
name='pbase',
version='0.0.1',
author='Peng Shi',
author_email='peng_shi@outlook.com',
description='framework for deep learning applications',
url='https://github.com/Impavidity/pbase',
license='MIT',
install_requires=[
],
pac... | [
6738,
900,
37623,
10141,
1330,
1064,
62,
43789,
11,
9058,
628,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
79,
8692,
3256,
198,
220,
220,
220,
2196,
11639,
15,
13,
15,
13,
16,
3256,
198,
220,
220,
220,
1772,
11639,
47,
1516,
1... | 2.695313 | 128 |
"""Add Action table.
Revision ID: 4cbe8e432c6b
Revises: 7b08cf35abd9
Create Date: 2018-07-27 20:05:30.976453
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4cbe8e432c6b'
down_revision = '7b08cf35abd9'
branch_labels = None
depends_on = None
| [
37811,
4550,
7561,
3084,
13,
198,
198,
18009,
1166,
4522,
25,
604,
66,
1350,
23,
68,
45331,
66,
21,
65,
198,
18009,
2696,
25,
767,
65,
2919,
12993,
2327,
397,
67,
24,
198,
16447,
7536,
25,
2864,
12,
2998,
12,
1983,
1160,
25,
2713,... | 2.385827 | 127 |
"""
MIT License
Copyright (c) 2021 Jedy Matt Tabasco
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publ... | [
37811,
198,
36393,
13789,
198,
198,
15269,
357,
66,
8,
33448,
449,
4716,
4705,
16904,
292,
1073,
198,
198,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
1659,
428,
3788,
290,
3917,
10314... | 2.698344 | 1,147 |
import dependency_injector.containers as containers
import dependency_injector.providers as providers
import strongr.core
from strongr.schedulerdomain.model.scalingdrivers.nullscaler import NullScaler
from strongr.schedulerdomain.model.scalingdrivers.simplescaler import SimpleScaler
from strongr.schedulerdomain.model... | [
11748,
20203,
62,
259,
752,
273,
13,
3642,
50221,
355,
16472,
198,
11748,
20203,
62,
259,
752,
273,
13,
15234,
4157,
355,
9549,
198,
198,
11748,
1913,
81,
13,
7295,
198,
198,
6738,
1913,
81,
13,
1416,
704,
18173,
27830,
13,
19849,
1... | 3.047619 | 336 |
from rest_framework import serializers
from .models import Post, Location, Tag,Photo
# class PostSerializer(serializers.Serializer):
# id = serializers.IntegerField(read_only = True)
# title = serializers.CharField(max_length = 255)
# detail = serializers.CharField(max_length = 2047)
# def create(se... | [
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
6738,
764,
27530,
1330,
2947,
11,
13397,
11,
17467,
11,
6191,
628,
198,
198,
2,
1398,
2947,
32634,
7509,
7,
46911,
11341,
13,
32634,
7509,
2599,
198,
2,
220,
220,
220,
220,
4686,
796,
... | 2.637405 | 262 |
import copy
import logging
import math
from datetime import datetime
import numpy as np
import quaternion
import cv2
from TelemetryParsing import readTelemetryCsv
from visnav.algo import tools
from visnav.algo.tools import Pose
from visnav.algo.model import Camera
from visnav.algo.odo.base import Measu... | [
11748,
4866,
201,
198,
11748,
18931,
201,
198,
11748,
10688,
201,
198,
6738,
4818,
8079,
1330,
4818,
8079,
201,
198,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
627,
9205,
295,
201,
198,
11748,
269,
85,
17,
201,
198,
201... | 2.968553 | 159 |
from typing import List
from collections import Counter
| [
6738,
19720,
1330,
7343,
198,
6738,
17268,
1330,
15034,
628
] | 5.7 | 10 |
import io
from setuptools import setup, find_packages
setup(
name='smart-crawler',
version='0.2',
url='https://github.com/limdongjin/smart-crawler',
license='MIT',
author='limdongjin',
author_email='geniuslim27@gmail.com',
description='Smart Crawler',
packages=find_packages(),
lon... | [
11748,
33245,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
628,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
27004,
12,
66,
39464,
3256,
198,
220,
220,
220,
2196,
11639,
15,
13,
17,
3256,
198,
220,
220,
220... | 1.934037 | 379 |
import matplotlib.pyplot as plt
import numpy as np
tray = np.genfromtxt("solar.dat",delimiter=",")
a = tray[:,0]
b = tray[:,1]
c = tray[:,2]
d = tray[:,3]
fig = plt.figure(figsize = (20,20))
plt.subplot(2,3,1)
plt.scatter(a,b)
plt.title('Grafica a vs b ')
plt.xlabel('a' )
plt.ylabel('b' )
plt.subplot(2,3,2)
pl... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
198,
2213,
323,
796,
45941,
13,
5235,
6738,
14116,
7203,
82,
6192,
13,
19608,
1600,
12381,
320,
2676,
28,
2430,
8,
628,
198,
64,
796,
... | 1.809935 | 463 |
import json
import pycountry
import requests
import sys
import os
from bs4 import BeautifulSoup
from collections import namedtuple
directory = os.path.dirname(os.path.abspath(__file__))
def create_players(table):
"""
Loop through given table and create Player objects with the following
attributes:
... | [
11748,
33918,
198,
11748,
12972,
19315,
198,
11748,
7007,
198,
11748,
25064,
198,
11748,
28686,
198,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
198,
34945,
796,
28686,
13,
6978,
13,
159... | 2.22607 | 2,079 |
#!/usr/bin/python
"""
Release script for botan (http://botan.randombit.net/)
(C) 2011, 2012 Jack Lloyd
Distributed under the terms of the Botan license
"""
import errno
import logging
import optparse
import os
import shlex
import StringIO
import shutil
import subprocess
import sys
import tarfile
if __name__ == '__... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
37811,
198,
26362,
4226,
329,
10214,
272,
357,
4023,
1378,
13645,
272,
13,
25192,
2381,
270,
13,
3262,
34729,
198,
198,
7,
34,
8,
2813,
11,
2321,
3619,
22361,
198,
198,
20344,
6169,
73... | 2.657895 | 190 |
# Copyright 2014 Roberto Brian Sarrionandia
#
# 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 t... | [
2,
15069,
1946,
32076,
8403,
311,
3258,
295,
392,
544,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
... | 3.256849 | 292 |
import torch
import sys; sys.path.append("/workspace/once-for-all")
from ofa.model_zoo import MobileInvertedResidualBlock
from ofa.layers import ConvLayer, PoolingLayer, LinearLayer,
block_config = {
"name": "MobileInvertedResidualBlock",
"mobile_inverted_conv": {
"name": "MBI... | [
11748,
28034,
198,
198,
11748,
25064,
26,
25064,
13,
6978,
13,
33295,
7203,
14,
5225,
10223,
14,
27078,
12,
1640,
12,
439,
4943,
198,
6738,
286,
64,
13,
19849,
62,
89,
2238,
1330,
12173,
818,
13658,
4965,
312,
723,
12235,
198,
6738,
... | 1.753846 | 715 |
from ...abc import Expression
from ..value.valueexpr import VALUE
class CONTEXT(Expression):
"""
The current context.
Usage:
```
!CONTEXT
``
"""
Attributes = {
}
| [
6738,
2644,
39305,
1330,
41986,
198,
6738,
11485,
8367,
13,
8367,
31937,
1330,
26173,
8924,
628,
198,
4871,
22904,
13918,
7,
16870,
2234,
2599,
198,
197,
37811,
198,
464,
1459,
4732,
13,
198,
198,
28350,
25,
198,
15506,
63,
198,
0,
10... | 3 | 57 |
from .controllers.pid import PID_ctrl
PID = PID_ctrl
from .filters.sma import simple_moving_average
SMA = simple_moving_average
from .filters.ewma import exponentially_weighted_moving_average
EWMA = exponentially_weighted_moving_average
from .sensors.camera import camera
camera = camera
| [
6738,
764,
3642,
36667,
13,
35317,
1330,
37022,
62,
44755,
198,
47,
2389,
796,
37022,
62,
44755,
198,
198,
6738,
764,
10379,
1010,
13,
82,
2611,
1330,
2829,
62,
31462,
62,
23913,
198,
50,
5673,
796,
2829,
62,
31462,
62,
23913,
198,
... | 3.344828 | 87 |
from clef_extractors import *
CLEF_BASE_DIR = "/work/ogalolu/data/clef/"
CLEF_LOWRES_DIR = ""
if not CLEF_BASE_DIR:
raise FileNotFoundError(f"Download CLEF and set CLEF_BASE_DIR in {__file__}")
#
# CLEF paths
#
PATH_BASE_QUERIES = CLEF_BASE_DIR + "Topics/"
PATH_BASE_DOCUMENTS = CLEF_BASE_DIR + "DocumentData/"
PATH... | [
6738,
1190,
69,
62,
2302,
974,
669,
1330,
1635,
198,
198,
29931,
37,
62,
33,
11159,
62,
34720,
796,
12813,
1818,
14,
519,
282,
349,
84,
14,
7890,
14,
2375,
69,
30487,
198,
29931,
37,
62,
43,
3913,
19535,
62,
34720,
796,
13538,
198... | 2.316098 | 1,025 |
DESTINATION = "dest"
ROUTE = "route"
TIMESTAMP = "time"
INCOMPLETE = "incomplete" | [
35,
6465,
1268,
6234,
796,
366,
16520,
1,
198,
49,
2606,
9328,
796,
366,
38629,
1,
198,
51,
3955,
6465,
23518,
796,
366,
2435,
1,
198,
1268,
41335,
9328,
796,
366,
259,
20751,
1
] | 2.382353 | 34 |
# Copyright 2014 Josh Pieper, jjp@pobox.com.
#
# 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... | [
2,
15069,
1946,
8518,
21690,
525,
11,
474,
34523,
31,
79,
672,
1140,
13,
785,
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,
... | 3.481343 | 268 |
import unittest
from troposphere.route53 import AliasTarget
if __name__ == "__main__":
unittest.main()
| [
11748,
555,
715,
395,
198,
198,
6738,
14673,
22829,
13,
38629,
4310,
1330,
978,
4448,
21745,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 2.775 | 40 |
# Copyright (c) OpenMMLab. All rights reserved.
from typing import Dict, Iterable, Optional, Union
import onnx
import onnx.helper
import onnx.utils
from mmdeploy.apis.core import PIPELINE_MANAGER
from mmdeploy.core.optimizers import (attribute_to_dict, create_extractor,
get_new_n... | [
2,
15069,
357,
66,
8,
4946,
44,
5805,
397,
13,
1439,
2489,
10395,
13,
198,
6738,
19720,
1330,
360,
713,
11,
40806,
540,
11,
32233,
11,
4479,
198,
198,
11748,
319,
77,
87,
198,
11748,
319,
77,
87,
13,
2978,
525,
198,
11748,
319,
... | 1.952758 | 4,170 |
import multiprocessing
import os
from joblib import delayed, Parallel
from Utilities.OSMnx_Utility import *
from Utilities.GTFS_Utility import *
from Utilities.General_Function import *
from Utilities.Data_Manipulation import *
import copy
import time
import tqdm
class InstanceNetwork:
"""
The 'InstanceNetw... | [
11748,
18540,
305,
919,
278,
198,
11748,
28686,
198,
198,
6738,
1693,
8019,
1330,
11038,
11,
42945,
198,
198,
6738,
41086,
13,
2640,
44,
77,
87,
62,
18274,
879,
1330,
1635,
198,
6738,
41086,
13,
38,
10234,
50,
62,
18274,
879,
1330,
... | 2.353743 | 4,475 |
# coding=utf-8
import sqlite3
conn = sqlite3.connect('TempTest.db') # 如果db文件不存在将自动创建
curs = conn.cursor() # 从连接获得游标
curs.execute('''
CREATE TABLE messages (
id integer primary key autoincrement,
subject text not null,
sender text not null,
reply_to int,
text text not ... | [
2,
19617,
28,
40477,
12,
23,
198,
11748,
44161,
578,
18,
198,
198,
37043,
796,
44161,
578,
18,
13,
8443,
10786,
30782,
14402,
13,
9945,
11537,
220,
1303,
10263,
99,
224,
162,
252,
250,
9945,
23877,
229,
20015,
114,
38834,
27764,
246,
... | 2 | 417 |
# Interface
from abc import ABC, abstractmethod
a = Army()
af = AirForce()
n = Navy()
a.area()
a.gun()
print()
af.area()
af.gun()
print()
n.area()
n.gun() | [
2,
26491,
198,
198,
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
198,
64,
796,
5407,
3419,
198,
1878,
796,
3701,
10292,
3419,
198,
77,
796,
8565,
3419,
198,
198,
64,
13,
20337,
3419,
198,
64,
13,
7145,
3419,
198,
4798,
3419,
... | 2.338235 | 68 |
import pandas as pd
import os
if __name__ == '__main__':
update_validation_data(force=True)
print('Done') | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
28686,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
4296,
62,
12102,
341,
62,
7890,
7,
3174,
28,
17821,
8,
198,
220,
220,
220,
3601,
10786,
4567... | 2.613636 | 44 |
# Auto-luokka yliluokka erilaisille autotyypeille
# Ominaisuudet (Field, Property) merkki, malli, vuosimalli, kilometrit, käyttövoima, vaihteistotyyppi, väri ja
# Henkiloauto
if __name__ == '__main__':
henkiloauto1 = Henkiloauto('ABC-12', 'Ferrary', 'Land', 2020, 354322, 'diesel', 'automaatti', 'punain... | [
198,
2,
11160,
12,
2290,
482,
4914,
331,
75,
346,
84,
482,
4914,
1931,
10102,
271,
8270,
1960,
313,
88,
2981,
8270,
198,
198,
2,
440,
1084,
15152,
84,
463,
316,
357,
15878,
11,
14161,
8,
4017,
74,
4106,
11,
17374,
72,
11,
410,
8... | 2.238806 | 402 |
import os
import sqlite3
def cursore_maker(method):
"""Декоратор, создающий курсор, для работы с бд"""
return wrapper
class SQLWorker:
"""Это API для работы с SQLite таблицами, заточенный под основную программу"""
@cursore_maker
def make_table(self, cur):
"""Метод, создающий таблицу (... | [
11748,
28686,
198,
11748,
44161,
578,
18,
628,
198,
4299,
13882,
382,
62,
10297,
7,
24396,
2599,
198,
220,
220,
220,
37227,
140,
242,
16843,
31583,
15166,
21169,
16142,
20375,
15166,
21169,
11,
220,
21727,
25443,
115,
43666,
16142,
141,
... | 1.526505 | 1,943 |
#Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
#This program is free software; you can redistribute it and/or modify it under the terms of the BSD 3-Clause License.
#This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty... | [
2,
15269,
357,
34,
8,
12131,
13,
43208,
21852,
1766,
1539,
12052,
13,
1439,
2489,
10395,
13,
201,
198,
201,
198,
2,
1212,
1430,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
340,
739,
262,
2846,
286,
262,
3... | 3.632653 | 147 |
import numpy as np
import tensorflow as tf
from baselines.a2c.utils import conv, fc, conv_to_fc
from baselines.common.distributions import make_pdtype
from baselines.common.input import observation_input
def impala_cnn(images, depths=[16, 32, 32], use_batch_norm=True, dropout=0):
"""
Model used in the paper "I... | [
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
1615,
20655,
13,
64,
17,
66,
13,
26791,
1330,
3063,
11,
277,
66,
11,
3063,
62,
1462,
62,
16072,
198,
6738,
1615,
20655,
13,
11321,
13,
17080,
2455,
... | 2.313274 | 1,130 |
import os
from fusedwake import fusedwake
import numpy as np
from topfarm.cost_models.fuga import py_fuga
from topfarm.cost_models.fuga.py_fuga import PyFuga
from topfarm.cost_models.fused_wake_wrappers import FusedWakeGCLWakeModel
from topfarm.cost_models.utils.aep_calculator import AEPCalculator
from topfarm.cost_mod... | [
11748,
28686,
198,
6738,
43954,
48530,
1330,
43954,
48530,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1353,
43323,
13,
15805,
62,
27530,
13,
69,
30302,
1330,
12972,
62,
69,
30302,
198,
6738,
1353,
43323,
13,
15805,
62,
27530,
13,
69... | 2.686099 | 223 |
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import IndexLocator, FormatStrFormatter
'''
Meredith Rawls, Dec 2015
Plotting routine for initial 'test' runs of ELC.
It will make a plot that has both light curve data w/fit and RV data w/fit.
There are also... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
2603,
29487,
8019,
13,
83,
15799,
1330,
12901,
33711,
1352,
11,
18980,
13290,
84... | 2.229345 | 4,321 |
"""
Copyright (c) 2020 WEI.ZHOU. All rights reserved.
The following code snippets are only used for circulation and cannot be used for business.
If the code is used, no consent is required, but the author has nothing to do with any problems
and consequences.
In case of code problems, feedback can be made through the fo... | [
37811,
198,
15269,
357,
66,
8,
12131,
12887,
40,
13,
57,
46685,
13,
1439,
2489,
10395,
13,
198,
464,
1708,
2438,
45114,
389,
691,
973,
329,
19133,
290,
2314,
307,
973,
329,
1597,
13,
198,
1532,
262,
2438,
318,
973,
11,
645,
8281,
... | 2.471698 | 265 |
import string
import re
from nlpaug.util import Method
from nlpaug.util.text.tokenizer import Tokenizer
from nlpaug import Augmenter
from nlpaug.util import WarningException, WarningName, WarningCode, WarningMessage
| [
11748,
4731,
198,
11748,
302,
198,
198,
6738,
299,
34431,
7493,
13,
22602,
1330,
11789,
198,
6738,
299,
34431,
7493,
13,
22602,
13,
5239,
13,
30001,
7509,
1330,
29130,
7509,
198,
6738,
299,
34431,
7493,
1330,
2447,
434,
263,
198,
6738,
... | 3.694915 | 59 |
from ._frontend import (
BackendFailed,
CmdStatus,
Frontend,
MetadataForBuildWheelResult,
RequiresBuildSdistResult,
RequiresBuildWheelResult,
SdistResult,
WheelResult,
)
from ._version import version
from ._via_fresh_subprocess import SubprocessFrontend
#: semantic version of the projec... | [
6738,
47540,
8534,
437,
1330,
357,
198,
220,
220,
220,
5157,
437,
37,
6255,
11,
198,
220,
220,
220,
327,
9132,
19580,
11,
198,
220,
220,
220,
8880,
437,
11,
198,
220,
220,
220,
3395,
14706,
1890,
15580,
45307,
23004,
11,
198,
220,
... | 2.741935 | 217 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 27 18:29:10 2019
@author: itamar
"""
from keras.datasets import mnist
(train_images, train_labels), (test_images, test_labels) = mnist.load_data()
train_images.shape
len(train_labels)
train_labels
test_images.shape
len(test_images)
test_labels
pr... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
3300,
5267,
2681,
1248,
25,
1959,
25,
940,
13130,
198,
198,
31,
9800,
25,
340,
39236,
198... | 2.350238 | 631 |
from api import db
| [
6738,
40391,
1330,
20613,
220,
198,
220,
220,
220,
220
] | 2.4 | 10 |
from datetime import date
import numpy as np
import pandas as pd
from scipy.stats import zscore
def normalize(df):
"""
特徴量を標準化する。
Parameters
----------
df: pandas.dataframe
標準化前の特徴量データフレーム
Returns
-------
norm_df: pandas.dataframe
標準化された特徴量データフレーム
"""
def cal... | [
6738,
4818,
8079,
1330,
3128,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
629,
541,
88,
13,
34242,
1330,
1976,
26675,
628,
198,
4299,
3487,
1096,
7,
7568,
2599,
198,
220,
220,
220,
37227,
198,
... | 1.597742 | 1,417 |
__version__ = "1.0.3"
from spotify_uri.parse import parse as _parse
from spotify_uri.spotify import SpotifyUri
| [
834,
9641,
834,
796,
366,
16,
13,
15,
13,
18,
1,
198,
198,
6738,
4136,
1958,
62,
9900,
13,
29572,
1330,
21136,
355,
4808,
29572,
198,
6738,
4136,
1958,
62,
9900,
13,
20485,
1958,
1330,
26778,
52,
380,
628,
628,
628
] | 2.853659 | 41 |
import argparse
import pandas as pd
import numpy as np
import pickle
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
import nltk
nltk.download('punkt')
nltk.download('stopwords')... | [
11748,
1822,
29572,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2298,
293,
198,
6738,
1341,
35720,
13,
30053,
62,
2302,
7861,
13,
5239,
1330,
309,
69,
312,
69,
38469,
7509,
198,
6738,
1341,
35... | 3.152047 | 171 |
from __future__ import absolute_import
from collections import OrderedDict, deque
from urlparse import urlparse
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
11,
390,
4188,
198,
6738,
19016,
29572,
1330,
19016,
29572,
628,
198
] | 3.965517 | 29 |
import json
from tweepy import OAuthHandler, Stream, StreamListener #faz requisicao de tweets ao Twitter
from datetime import datetime
# CADASTRAR AS CHAVES DE ACESSO
consumer_key = "YGSFrzszgES6SFMtZTUghUhlw"
consumer_secret = "TITEr8yC97JPTaiG9flVZrGc8INvFkObHpznB6NnupabE3OKx2"
access_token = "134235234849727283... | [
11748,
33918,
220,
198,
6738,
4184,
538,
88,
1330,
440,
30515,
25060,
11,
13860,
11,
13860,
33252,
220,
1303,
69,
1031,
1038,
271,
3970,
78,
390,
12665,
257,
78,
3009,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
2,
37292,
1921,... | 2.262557 | 438 |
#!/usr/env/bin python
from setuptools import setup
setup(
name='pygitea',
version='0.0.1',
description='Gitea API wrapper for python',
url='http://github.com/jo-nas/pygitea',
author='Jonas',
author_email='jonas@steinka.mp',
install_requires=[
'parse',
'requests'
],
... | [
2,
48443,
14629,
14,
24330,
14,
8800,
21015,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
9078,
70,
578,
64,
3256,
198,
220,
220,
220,
2196,
11639,
15,
13,
15,
13,
16,
3256,
1... | 2.273684 | 190 |
from .poly import polyrecur
from scipy import integrate
from .tools import printer
from copy import deepcopy
import numpy as np
# %% Polynomial Chaos
class Expansion:
"""Class of polynomial chaos expansion"""
# Evaluates the expansion at the points
# %% Univariate Expansion
def transfo(invcdf,order,dist):
... | [
6738,
764,
35428,
1330,
7514,
8344,
333,
198,
6738,
629,
541,
88,
1330,
19386,
198,
6738,
764,
31391,
1330,
20632,
198,
6738,
4866,
1330,
2769,
30073,
198,
11748,
299,
32152,
355,
45941,
198,
198,
2,
43313,
12280,
26601,
498,
13903,
198... | 2.184211 | 1,672 |
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC, expected_conditions
from selenium.webdriver.support.wait import WebDriverWait as wait
from fixtures.params import DEFAULT_PASSWORD
| [
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11321,
13,
1525,
1330,
2750,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11284,
1330,
2938,
62,
17561,
1756,
355,
13182,
11,
2938,
62,
17561,
1756,
198,
6738,
384,
11925,
1505,
13,
... | 3.602941 | 68 |
from RNAseq import *
| [
6738,
25897,
41068,
1330,
1635,
628
] | 3.666667 | 6 |
import os
import subprocess
from clams import arg, Command
from . import current_project
version = Command(
name='version',
title='Utilities for versioning and releases.',
description='Utilities for versioning and releases.',
)
def _get_version():
"""Read and return the project version number."""
... | [
11748,
28686,
198,
11748,
850,
14681,
198,
198,
6738,
537,
4105,
1330,
1822,
11,
9455,
198,
198,
6738,
764,
1330,
1459,
62,
16302,
628,
198,
9641,
796,
9455,
7,
198,
220,
220,
220,
1438,
11639,
9641,
3256,
198,
220,
220,
220,
3670,
... | 2.788284 | 973 |
import scrapy
from scrapy.selector import Selector
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
from crawlers.items import Zgka8Item
from scrapy.http import TextResponse,FormRequest,Request
import json
| [
11748,
15881,
88,
198,
6738,
15881,
88,
13,
19738,
273,
1330,
9683,
273,
198,
6738,
15881,
88,
13,
2815,
365,
742,
974,
669,
1330,
7502,
11627,
40450,
198,
6738,
15881,
88,
13,
2777,
4157,
1330,
327,
13132,
41294,
11,
14330,
198,
6738... | 3.571429 | 70 |
"""
Week 4, Day 4: Uncrossed Lines
We write the integers of A and B (in the order they are given) on two separate horizontal lines.
Now, we may draw connecting lines: a straight line connecting two numbers A[i] and B[j] such that:
A[i] == B[j];
The line we draw does not intersect any other connecting (non-horiz... | [
37811,
198,
20916,
604,
11,
3596,
604,
25,
791,
19692,
276,
26299,
198,
198,
1135,
3551,
262,
37014,
286,
317,
290,
347,
357,
259,
262,
1502,
484,
389,
1813,
8,
319,
734,
4553,
16021,
3951,
13,
198,
198,
3844,
11,
356,
743,
3197,
... | 2.55599 | 768 |
#!/bin/python
# Priority queue that allows updating priorities
# Todo: don't do busy waiting...
import time
from heapq import * # Basic heap implementation
import Queue # Need to pull in exceptions
from tools import * # For RWLock
class DPQueue(object):
"""Thread-safe Priority queue that can update priorities... | [
2,
48443,
8800,
14,
29412,
198,
198,
2,
34416,
16834,
326,
3578,
19698,
15369,
198,
198,
2,
309,
24313,
25,
836,
470,
466,
8179,
4953,
986,
628,
198,
11748,
640,
198,
6738,
24575,
80,
1330,
1635,
1303,
14392,
24575,
7822,
198,
11748,
... | 1.959641 | 669 |
import requests
from bs4 import BeautifulSoup as BS
params = {"p1":"108001","p2":"108136","l":"0","type":"5"}
res = requests.post("http://www.9800.com.tw/trend.asp",data = params)
lottery_page = BS(res.text,"html.parser")
lottery_info = lottery_page.select("tbody")[4].select("td")
data = []
for i in range(le... | [
11748,
7007,
201,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
355,
24218,
201,
198,
201,
198,
37266,
796,
19779,
79,
16,
2404,
940,
7410,
16,
2430,
79,
17,
2404,
15711,
20809,
2430,
75,
2404,
15,
2430,
4906,
2404,
20,
20662,
201... | 2.268623 | 443 |